Re: CVS commit: [nick-nhusb] src/sys/dev/usb

2015-06-06 Thread Nick Hudson

On 06/06/15 16:27, Nick Hudson wrote:

Module Name:src
Committed By:   skrll
Date:   Sat Jun  6 15:27:38 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: usbdi_util.c usbdi_util.h


To generate a diff of this commit:
cvs rdiff -u -r1.63.2.8 -r1.63.2.9 src/sys/dev/usb/usbdi_util.c
cvs rdiff -u -r1.45.6.6 -r1.45.6.7 src/sys/dev/usb/usbdi_util.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.


Log should read

Add usbd_set_port_u[12]_timeout().

From t-hash

I'll fix it.

Nick


Re: CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-04 Thread Takahiro HAYASHI

On 2015/04/04 06:33, Nick Hudson wrote:

Module Name:src
Committed By:   skrll
Date:   Fri Apr  3 21:33:23 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: uhci.c

Log Message:
Various readability changes.

#ifdef DIAGNOSTIC - KASSERT / __diagused



@@ -3151,10 +3105,8 @@ uhci_device_ctrl_done(struct usbd_xfer *
KASSERT(sc-sc_bus.ub_usepolling || mutex_owned(sc-sc_lock));

UHCIHIST_FUNC(); UHCIHIST_CALLED();
-#ifdef DIAGNOSTIC
-   if (!(xfer-ux_rqflags  URQ_REQUEST))
-   panic(uhci_device_ctrl_done: not a request);
-#endif
+
+   KASSERT(!(xfer-ux_rqflags  URQ_REQUEST));

if (!uhci_active_intr_info(ii))
return;


It seems logic is inverted.


--
t-hash


Re: CVS commit: [nick-nhusb] src/sys/dev/usb

2015-03-06 Thread Takahiro HAYASHI

On 2015/03/06 21:55, Nick Hudson wrote:

On 03/06/15 11:36, Takahiro HAYASHI wrote:

On 2015/03/05 21:39, Nick Hudson wrote:

Modified Files:
src/sys/dev/usb [nick-nhusb]: usbdi.c

Log Message:
Minor USBHIST_LOG changes



/* Sync transfer, wait for completion. */
if (err != USBD_IN_PROGRESS) {
-USBHIST_LOG(usbdebug, - done xfer %p, not in progress, xfer,
+USBHIST_LOG(usbdebug, - done xfer %p, err %d (complete/error), xfer,
0, 0, 0);
return err;
}


Do you want to print 'err' instead of 0?


Fixed. Thanks.


BTW, typeof err is usbd_status so ENOMEM is not suitable.




I fixed one place where this was a problem - did you spot others?


usbd_do_request_flags_pipe returns ENOMEM around line 1084
but it should return usbd_status.


Thanks,
--
t-hash


Re: CVS commit: [nick-nhusb] src/sys/dev/usb

2015-03-06 Thread Takahiro HAYASHI

On 2015/03/05 21:39, Nick Hudson wrote:

Modified Files:
src/sys/dev/usb [nick-nhusb]: usbdi.c

Log Message:
Minor USBHIST_LOG changes



/* Sync transfer, wait for completion. */
if (err != USBD_IN_PROGRESS) {
-   USBHIST_LOG(usbdebug, - done xfer %p, not in progress, xfer,
+   USBHIST_LOG(usbdebug, - done xfer %p, err %d 
(complete/error), xfer,
0, 0, 0);
return err;
}


Do you want to print 'err' instead of 0?

BTW, typeof err is usbd_status so ENOMEM is not suitable.


--
t-hash


Re: CVS commit: [nick-nhusb] src/sys/dev/usb

2015-03-06 Thread Nick Hudson

On 03/06/15 11:36, Takahiro HAYASHI wrote:

On 2015/03/05 21:39, Nick Hudson wrote:

Modified Files:
src/sys/dev/usb [nick-nhusb]: usbdi.c

Log Message:
Minor USBHIST_LOG changes



/* Sync transfer, wait for completion. */
if (err != USBD_IN_PROGRESS) {
-USBHIST_LOG(usbdebug, - done xfer %p, not in progress, xfer,
+USBHIST_LOG(usbdebug, - done xfer %p, err %d 
(complete/error), xfer,

0, 0, 0);
return err;
}


Do you want to print 'err' instead of 0?


Fixed. Thanks.


BTW, typeof err is usbd_status so ENOMEM is not suitable.




I fixed one place where this was a problem - did you spot others?

Thanks,
Nick


Re: CVS commit: [nick-nhusb] src/sys/dev/usb

2014-11-30 Thread Masao Uebayashi
On Sun, Nov 30, 2014 at 10:46 PM, Nick Hudson sk...@netbsd.org wrote:
 Module Name:src
 Committed By:   skrll
 Date:   Sun Nov 30 13:46:00 UTC 2014

 Modified Files:
 src/sys/dev/usb [nick-nhusb]: ehci.c ehcireg.h ehcivar.h

 Log Message:
 Add full speed isoc support to ehci(4). Based on the patch posted in

 https://mail-index.netbsd.org/port-arm/2013/04/14/msg001842.html

 From Masao Uebayashi via Sebastien Bocahu

The work was actually done by Tsubai Masanari, and also heavily based
on FreeBSD's USB stack at that time.