usb_request.c (190727) | usb_request.c (190731) |
---|---|
1/* $FreeBSD: head/sys/dev/usb/usb_request.c 190727 2009-04-05 18:19:19Z thompsa $ */ | 1/* $FreeBSD: head/sys/dev/usb/usb_request.c 190731 2009-04-05 18:20:03Z thompsa $ */ |
2/*- 3 * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. 4 * Copyright (c) 1998 Lennart Augustsson. All rights reserved. 5 * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: --- 82 unchanged lines hidden (view full) --- 92void 93usb2_do_clear_stall_callback(struct usb2_xfer *xfer) 94{ 95 struct usb2_device_request req; 96 struct usb2_device *udev; 97 struct usb2_pipe *pipe; 98 struct usb2_pipe *pipe_end; 99 struct usb2_pipe *pipe_first; | 2/*- 3 * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. 4 * Copyright (c) 1998 Lennart Augustsson. All rights reserved. 5 * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: --- 82 unchanged lines hidden (view full) --- 92void 93usb2_do_clear_stall_callback(struct usb2_xfer *xfer) 94{ 95 struct usb2_device_request req; 96 struct usb2_device *udev; 97 struct usb2_pipe *pipe; 98 struct usb2_pipe *pipe_end; 99 struct usb2_pipe *pipe_first; |
100 uint8_t to = USB_EP_MAX; | 100 uint8_t to; |
101 102 udev = xfer->xroot->udev; 103 104 USB_BUS_LOCK(udev->bus); 105 106 /* round robin pipe clear stall */ 107 108 pipe = udev->pipe_curr; | 101 102 udev = xfer->xroot->udev; 103 104 USB_BUS_LOCK(udev->bus); 105 106 /* round robin pipe clear stall */ 107 108 pipe = udev->pipe_curr; |
109 pipe_end = udev->pipes + USB_EP_MAX; | 109 pipe_end = udev->pipes + udev->pipes_max; |
110 pipe_first = udev->pipes; | 110 pipe_first = udev->pipes; |
111 to = udev->pipes_max; |
|
111 if (pipe == NULL) { 112 pipe = pipe_first; 113 } 114 switch (USB_GET_STATE(xfer)) { 115 case USB_ST_TRANSFERRED: 116 if (pipe->edesc && 117 pipe->is_stalled) { 118 pipe->toggle_next = 0; --- 730 unchanged lines hidden (view full) --- 849{ 850 uint16_t len; 851 852 struct usb2_device_request req; 853 854 if (udev->flags.usb2_mode != USB_MODE_DEVICE) 855 return (USB_ERR_INVAL); 856 | 112 if (pipe == NULL) { 113 pipe = pipe_first; 114 } 115 switch (USB_GET_STATE(xfer)) { 116 case USB_ST_TRANSFERRED: 117 if (pipe->edesc && 118 pipe->is_stalled) { 119 pipe->toggle_next = 0; --- 730 unchanged lines hidden (view full) --- 850{ 851 uint16_t len; 852 853 struct usb2_device_request req; 854 855 if (udev->flags.usb2_mode != USB_MODE_DEVICE) 856 return (USB_ERR_INVAL); 857 |
857 req.bmRequestType = UT_READ_CLASS_DEVICE; | 858 req.bmRequestType = UT_READ_DEVICE; |
858 req.bRequest = UR_GET_DESCRIPTOR; 859 USETW2(req.wValue, UDESC_CONFIG, config_index); 860 USETW(req.wIndex, 0); 861 USETW(req.wLength, 0); 862 863 (usb2_temp_get_desc_p) (udev, &req, 864 __DECONST(const void **, ppcd), &len); 865 --- 667 unchanged lines hidden --- | 859 req.bRequest = UR_GET_DESCRIPTOR; 860 USETW2(req.wValue, UDESC_CONFIG, config_index); 861 USETW(req.wIndex, 0); 862 USETW(req.wLength, 0); 863 864 (usb2_temp_get_desc_p) (udev, &req, 865 __DECONST(const void **, ppcd), &len); 866 --- 667 unchanged lines hidden --- |