diff options
author | thompsa <thompsa@FreeBSD.org> | 2009-04-05 18:20:03 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2009-04-05 18:20:03 +0000 |
commit | 50e6ad14e556fcc8682c56be4b9185c7d1078231 (patch) | |
tree | ee04b648f811bc335342970656c5d161790f4e3e | |
parent | 5e0713868e18949219adf2ed92a0333d519abe52 (diff) | |
download | FreeBSD-src-50e6ad14e556fcc8682c56be4b9185c7d1078231.zip FreeBSD-src-50e6ad14e556fcc8682c56be4b9185c7d1078231.tar.gz |
MFp4 //depot/projects/usb@159871
- bugfixes after the memory usage reduction patch
- Use "udev->pipes_max" instead of USB_EP_MAX
- Use correct "bmRequestType" for getting the config descriptor.
Submitted by: Hans Petter Selasky
-rw-r--r-- | sys/dev/usb/usb_device.c | 8 | ||||
-rw-r--r-- | sys/dev/usb/usb_request.c | 7 |
2 files changed, 8 insertions, 7 deletions
diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index 33b2706..7ce59fb 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -105,7 +105,7 @@ struct usb2_pipe * usb2_get_pipe_by_addr(struct usb2_device *udev, uint8_t ea_val) { struct usb2_pipe *pipe = udev->pipes; - struct usb2_pipe *pipe_end = udev->pipes + USB_EP_MAX; + struct usb2_pipe *pipe_end = udev->pipes + udev->pipes_max; enum { EA_MASK = (UE_DIR_IN | UE_DIR_OUT | UE_ADDR), }; @@ -160,7 +160,7 @@ usb2_get_pipe(struct usb2_device *udev, uint8_t iface_index, const struct usb2_config *setup) { struct usb2_pipe *pipe = udev->pipes; - struct usb2_pipe *pipe_end = udev->pipes + USB_EP_MAX; + struct usb2_pipe *pipe_end = udev->pipes + udev->pipes_max; uint8_t index = setup->ep_index; uint8_t ea_mask; uint8_t ea_val; @@ -320,7 +320,7 @@ usb2_init_pipe(struct usb2_device *udev, uint8_t iface_index, struct usb2_pipe * usb2_pipe_foreach(struct usb2_device *udev, struct usb2_pipe *pipe) { - struct usb2_pipe *pipe_end = udev->pipes + USB_EP_MAX; + struct usb2_pipe *pipe_end = udev->pipes + udev->pipes_max; /* be NULL safe */ if (udev == NULL) @@ -924,7 +924,7 @@ usb2_reset_iface_endpoints(struct usb2_device *udev, uint8_t iface_index) usb2_error_t err; pipe = udev->pipes; - pipe_end = udev->pipes + USB_EP_MAX; + pipe_end = udev->pipes + udev->pipes_max; for (; pipe != pipe_end; pipe++) { diff --git a/sys/dev/usb/usb_request.c b/sys/dev/usb/usb_request.c index 78671ea..edb399f 100644 --- a/sys/dev/usb/usb_request.c +++ b/sys/dev/usb/usb_request.c @@ -97,7 +97,7 @@ usb2_do_clear_stall_callback(struct usb2_xfer *xfer) struct usb2_pipe *pipe; struct usb2_pipe *pipe_end; struct usb2_pipe *pipe_first; - uint8_t to = USB_EP_MAX; + uint8_t to; udev = xfer->xroot->udev; @@ -106,8 +106,9 @@ usb2_do_clear_stall_callback(struct usb2_xfer *xfer) /* round robin pipe clear stall */ pipe = udev->pipe_curr; - pipe_end = udev->pipes + USB_EP_MAX; + pipe_end = udev->pipes + udev->pipes_max; pipe_first = udev->pipes; + to = udev->pipes_max; if (pipe == NULL) { pipe = pipe_first; } @@ -854,7 +855,7 @@ usb2_req_get_config_desc_ptr(struct usb2_device *udev, if (udev->flags.usb2_mode != USB_MODE_DEVICE) return (USB_ERR_INVAL); - req.bmRequestType = UT_READ_CLASS_DEVICE; + req.bmRequestType = UT_READ_DEVICE; req.bRequest = UR_GET_DESCRIPTOR; USETW2(req.wValue, UDESC_CONFIG, config_index); USETW(req.wIndex, 0); |