diff options
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r-- | include/linux/usb.h | 50 |
1 files changed, 37 insertions, 13 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index 10278d18709c..689b14b26c8d 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -482,6 +482,7 @@ struct usb3_lpm_parameters { | |||
482 | * @connect_time: time device was first connected | 482 | * @connect_time: time device was first connected |
483 | * @do_remote_wakeup: remote wakeup should be enabled | 483 | * @do_remote_wakeup: remote wakeup should be enabled |
484 | * @reset_resume: needs reset instead of resume | 484 | * @reset_resume: needs reset instead of resume |
485 | * @port_is_suspended: the upstream port is suspended (L2 or U3) | ||
485 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB | 486 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB |
486 | * specific data for the device. | 487 | * specific data for the device. |
487 | * @slot_id: Slot ID assigned by xHCI | 488 | * @slot_id: Slot ID assigned by xHCI |
@@ -560,6 +561,7 @@ struct usb_device { | |||
560 | 561 | ||
561 | unsigned do_remote_wakeup:1; | 562 | unsigned do_remote_wakeup:1; |
562 | unsigned reset_resume:1; | 563 | unsigned reset_resume:1; |
564 | unsigned port_is_suspended:1; | ||
563 | #endif | 565 | #endif |
564 | struct wusb_dev *wusb_dev; | 566 | struct wusb_dev *wusb_dev; |
565 | int slot_id; | 567 | int slot_id; |
@@ -588,8 +590,9 @@ extern struct usb_device *usb_hub_find_child(struct usb_device *hdev, | |||
588 | */ | 590 | */ |
589 | #define usb_hub_for_each_child(hdev, port1, child) \ | 591 | #define usb_hub_for_each_child(hdev, port1, child) \ |
590 | for (port1 = 1, child = usb_hub_find_child(hdev, port1); \ | 592 | for (port1 = 1, child = usb_hub_find_child(hdev, port1); \ |
591 | port1 <= hdev->maxchild; \ | 593 | port1 <= hdev->maxchild; \ |
592 | child = usb_hub_find_child(hdev, ++port1)) | 594 | child = usb_hub_find_child(hdev, ++port1)) \ |
595 | if (!child) continue; else | ||
593 | 596 | ||
594 | /* USB device locking */ | 597 | /* USB device locking */ |
595 | #define usb_lock_device(udev) device_lock(&(udev)->dev) | 598 | #define usb_lock_device(udev) device_lock(&(udev)->dev) |
@@ -805,6 +808,22 @@ static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size) | |||
805 | .bcdDevice_hi = (hi) | 808 | .bcdDevice_hi = (hi) |
806 | 809 | ||
807 | /** | 810 | /** |
811 | * USB_DEVICE_INTERFACE_CLASS - describe a usb device with a specific interface class | ||
812 | * @vend: the 16 bit USB Vendor ID | ||
813 | * @prod: the 16 bit USB Product ID | ||
814 | * @cl: bInterfaceClass value | ||
815 | * | ||
816 | * This macro is used to create a struct usb_device_id that matches a | ||
817 | * specific interface class of devices. | ||
818 | */ | ||
819 | #define USB_DEVICE_INTERFACE_CLASS(vend, prod, cl) \ | ||
820 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ | ||
821 | USB_DEVICE_ID_MATCH_INT_CLASS, \ | ||
822 | .idVendor = (vend), \ | ||
823 | .idProduct = (prod), \ | ||
824 | .bInterfaceClass = (cl) | ||
825 | |||
826 | /** | ||
808 | * USB_DEVICE_INTERFACE_PROTOCOL - describe a usb device with a specific interface protocol | 827 | * USB_DEVICE_INTERFACE_PROTOCOL - describe a usb device with a specific interface protocol |
809 | * @vend: the 16 bit USB Vendor ID | 828 | * @vend: the 16 bit USB Vendor ID |
810 | * @prod: the 16 bit USB Product ID | 829 | * @prod: the 16 bit USB Product ID |
@@ -1129,8 +1148,8 @@ extern int usb_disabled(void); | |||
1129 | * Note: URB_DIR_IN/OUT is automatically set in usb_submit_urb(). | 1148 | * Note: URB_DIR_IN/OUT is automatically set in usb_submit_urb(). |
1130 | */ | 1149 | */ |
1131 | #define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */ | 1150 | #define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */ |
1132 | #define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame | 1151 | #define URB_ISO_ASAP 0x0002 /* iso-only; use the first unexpired |
1133 | * ignored */ | 1152 | * slot in the schedule */ |
1134 | #define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ | 1153 | #define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ |
1135 | #define URB_NO_FSBR 0x0020 /* UHCI-specific */ | 1154 | #define URB_NO_FSBR 0x0020 /* UHCI-specific */ |
1136 | #define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ | 1155 | #define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ |
@@ -1309,15 +1328,20 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1309 | * the transfer interval in the endpoint descriptor is logarithmic. | 1328 | * the transfer interval in the endpoint descriptor is logarithmic. |
1310 | * Device drivers must convert that value to linear units themselves.) | 1329 | * Device drivers must convert that value to linear units themselves.) |
1311 | * | 1330 | * |
1312 | * Isochronous URBs normally use the URB_ISO_ASAP transfer flag, telling | 1331 | * If an isochronous endpoint queue isn't already running, the host |
1313 | * the host controller to schedule the transfer as soon as bandwidth | 1332 | * controller will schedule a new URB to start as soon as bandwidth |
1314 | * utilization allows, and then set start_frame to reflect the actual frame | 1333 | * utilization allows. If the queue is running then a new URB will be |
1315 | * selected during submission. Otherwise drivers must specify the start_frame | 1334 | * scheduled to start in the first transfer slot following the end of the |
1316 | * and handle the case where the transfer can't begin then. However, drivers | 1335 | * preceding URB, if that slot has not already expired. If the slot has |
1317 | * won't know how bandwidth is currently allocated, and while they can | 1336 | * expired (which can happen when IRQ delivery is delayed for a long time), |
1318 | * find the current frame using usb_get_current_frame_number () they can't | 1337 | * the scheduling behavior depends on the URB_ISO_ASAP flag. If the flag |
1319 | * know the range for that frame number. (Ranges for frame counter values | 1338 | * is clear then the URB will be scheduled to start in the expired slot, |
1320 | * are HC-specific, and can go from 256 to 65536 frames from "now".) | 1339 | * implying that some of its packets will not be transferred; if the flag |
1340 | * is set then the URB will be scheduled in the first unexpired slot, | ||
1341 | * breaking the queue's synchronization. Upon URB completion, the | ||
1342 | * start_frame field will be set to the (micro)frame number in which the | ||
1343 | * transfer was scheduled. Ranges for frame counter values are HC-specific | ||
1344 | * and can go from as low as 256 to as high as 65536 frames. | ||
1321 | * | 1345 | * |
1322 | * Isochronous URBs have a different data transfer model, in part because | 1346 | * Isochronous URBs have a different data transfer model, in part because |
1323 | * the quality of service is only "best effort". Callers provide specially | 1347 | * the quality of service is only "best effort". Callers provide specially |