* [9front] [PATCH] nusb/serial: fix pl2303 usbcmd error checks
@ 2022-01-01 22:51 Michael Forney
2022-02-28 23:55 ` [9front] " Michael Forney
0 siblings, 1 reply; 7+ messages in thread
From: Michael Forney @ 2022-01-01 22:51 UTC (permalink / raw)
To: 9front
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;
^ permalink raw reply [flat|nested] 7+ messages in thread
* [9front] Re: [PATCH] nusb/serial: fix pl2303 usbcmd error checks
2022-01-01 22:51 [9front] [PATCH] nusb/serial: fix pl2303 usbcmd error checks Michael Forney
@ 2022-02-28 23:55 ` Michael Forney
2022-03-02 4:08 ` ori
0 siblings, 1 reply; 7+ messages in thread
From: Michael Forney @ 2022-02-28 23:55 UTC (permalink / raw)
To: 9front
On 2022-01-01-22, Michael Forney <mforney@mforney.org> wrote:
> Since e0087b2a, usbcmd with Rh2d returns the size of the data stage
> (excluding the setup packet), so adjust the expected return values
> accordingly.
Ping. nusb/serial doesn't work at all with Prolific devices without this patch.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [9front] Re: [PATCH] nusb/serial: fix pl2303 usbcmd error checks
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
0 siblings, 2 replies; 7+ messages in thread
From: ori @ 2022-03-02 4:08 UTC (permalink / raw)
To: 9front
Quoth Michael Forney <mforney@mforney.org>:
> On 2022-01-01-22, Michael Forney <mforney@mforney.org> wrote:
> > Since e0087b2a, usbcmd with Rh2d returns the size of the data stage
> > (excluding the setup packet), so adjust the expected return values
> > accordingly.
>
> Ping. nusb/serial doesn't work at all with Prolific devices without this patch.
>
currently, I have no usb serial devices to test with,
but it looks good on reading -- committed.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-03-04 11:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-01 22:51 [9front] [PATCH] nusb/serial: fix pl2303 usbcmd error checks Michael Forney
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
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).