From: Michael Forney <mforney@mforney.org>
To: 9front@9front.org
Subject: [9front] [PATCH] nusb/serial: fix pl2303 usbcmd error checks
Date: Sat, 01 Jan 2022 22:51:18 +0000 [thread overview]
Message-ID: <46F9DBF771CE337040E83F3DBA19CDEB@arrow> (raw)
Since e0087b2a, usbcmd with Rh2d returns the size of the data stage
(excluding the setup packet), so adjust the expected return values
accordingly.
---
diff 9c5ac15e11ffa2c5e57796c3a32baa769cce9aac 6b850d84118c8ee7e66b12daab17ef48fe65176e
--- a/sys/src/cmd/nusb/serial/prolific.c Wed Feb 10 01:00:05 2021
+++ b/sys/src/cmd/nusb/serial/prolific.c Sat Jan 1 14:51:18 2022
@@ -281,7 +281,7 @@
dsprint(2, "serial: vendorwrite val: 0x%x idx:%d\n", val, index);
res = usbcmd(ser->dev, Rh2d | Rvendor | Rdev, VendorWriteReq,
val, index, nil, 0);
- if(res != 8) fprint(2, "serial: vendorwrite failed with res=%d\n", res);
+ if(res != 0) fprint(2, "serial: vendorwrite failed with res=%d\n", res);
return res;
}
@@ -373,7 +373,7 @@
dumpbuf(buf, sizeof buf);
res = usbcmd(ser->dev, Rh2d | Rclass | Riface, SetLineReq,
0, 0, buf, sizeof buf);
- if(res != 8+ParamReqSz){
+ if(res != ParamReqSz){
fprint(2, "serial: plsetparam failed with res=%d\n", res);
if(res >= 0) werrstr("plsetparam failed with res=%d", res);
return -1;
next reply other threads:[~2022-01-02 0:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-01 22:51 Michael Forney [this message]
2022-02-28 23:55 ` [9front] " Michael Forney
2022-03-02 4:08 ` ori
2022-03-02 19:09 ` cinap_lenrek
2022-03-02 19:12 ` cinap_lenrek
2022-03-02 21:06 ` Michael Forney
2022-03-04 10:47 ` cinap_lenrek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46F9DBF771CE337040E83F3DBA19CDEB@arrow \
--to=mforney@mforney.org \
--cc=9front@9front.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).