diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-23 11:20:44 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-23 11:21:03 -0500 |
commit | c69263c66e5b2a5d0c7e5a41c189b1846ae1de92 (patch) | |
tree | 81c6cf0f5b3b05739e2e73b0118077d9dd245182 /include/linux | |
parent | 45196cee28a5bcfb6ddbe2bffa4270cbed66ae4b (diff) | |
parent | 5407a3c3d942e75d4d123d213fd692bce5acc961 (diff) |
Merge branch 'usb-3.3-rc4' into usb-next
This is to pull in the xhci changes and the other fixes and device id
updates that were done in Linus's tree.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/usb.h | 8 | ||||
-rw-r--r-- | include/linux/usb/ch11.h | 5 | ||||
-rw-r--r-- | include/linux/usb/hcd.h | 2 | ||||
-rw-r--r-- | include/linux/usb/serial.h | 15 | ||||
-rw-r--r-- | include/linux/usb/uas.h | 69 |
5 files changed, 99 insertions, 0 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index 69d845739bc2..0c51663f2733 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -376,6 +376,12 @@ struct usb_bus { | |||
376 | 376 | ||
377 | struct usb_tt; | 377 | struct usb_tt; |
378 | 378 | ||
379 | enum usb_device_removable { | ||
380 | USB_DEVICE_REMOVABLE_UNKNOWN = 0, | ||
381 | USB_DEVICE_REMOVABLE, | ||
382 | USB_DEVICE_FIXED, | ||
383 | }; | ||
384 | |||
379 | /** | 385 | /** |
380 | * struct usb_device - kernel's representation of a USB device | 386 | * struct usb_device - kernel's representation of a USB device |
381 | * @devnum: device number; address on a USB bus | 387 | * @devnum: device number; address on a USB bus |
@@ -432,6 +438,7 @@ struct usb_tt; | |||
432 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB | 438 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB |
433 | * specific data for the device. | 439 | * specific data for the device. |
434 | * @slot_id: Slot ID assigned by xHCI | 440 | * @slot_id: Slot ID assigned by xHCI |
441 | * @removable: Device can be physically removed from this port | ||
435 | * | 442 | * |
436 | * Notes: | 443 | * Notes: |
437 | * Usbcore drivers should not set usbdev->state directly. Instead use | 444 | * Usbcore drivers should not set usbdev->state directly. Instead use |
@@ -509,6 +516,7 @@ struct usb_device { | |||
509 | #endif | 516 | #endif |
510 | struct wusb_dev *wusb_dev; | 517 | struct wusb_dev *wusb_dev; |
511 | int slot_id; | 518 | int slot_id; |
519 | enum usb_device_removable removable; | ||
512 | }; | 520 | }; |
513 | #define to_usb_device(d) container_of(d, struct usb_device, dev) | 521 | #define to_usb_device(d) container_of(d, struct usb_device, dev) |
514 | 522 | ||
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h index 0b83acd3360a..f1d26b6067f1 100644 --- a/include/linux/usb/ch11.h +++ b/include/linux/usb/ch11.h | |||
@@ -76,6 +76,11 @@ | |||
76 | #define USB_PORT_FEAT_C_BH_PORT_RESET 29 | 76 | #define USB_PORT_FEAT_C_BH_PORT_RESET 29 |
77 | #define USB_PORT_FEAT_FORCE_LINKPM_ACCEPT 30 | 77 | #define USB_PORT_FEAT_FORCE_LINKPM_ACCEPT 30 |
78 | 78 | ||
79 | /* USB 3.0 hub remote wake mask bits, see table 10-14 */ | ||
80 | #define USB_PORT_FEAT_REMOTE_WAKE_CONNECT (1 << 8) | ||
81 | #define USB_PORT_FEAT_REMOTE_WAKE_DISCONNECT (1 << 9) | ||
82 | #define USB_PORT_FEAT_REMOTE_WAKE_OVER_CURRENT (1 << 10) | ||
83 | |||
79 | /* | 84 | /* |
80 | * Hub Status and Hub Change results | 85 | * Hub Status and Hub Change results |
81 | * See USB 2.0 spec Table 11-19 and Table 11-20 | 86 | * See USB 2.0 spec Table 11-19 and Table 11-20 |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index b2f62f3a32af..2e6071efbfb7 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -412,6 +412,8 @@ extern irqreturn_t usb_hcd_irq(int irq, void *__hcd); | |||
412 | 412 | ||
413 | extern void usb_hc_died(struct usb_hcd *hcd); | 413 | extern void usb_hc_died(struct usb_hcd *hcd); |
414 | extern void usb_hcd_poll_rh_status(struct usb_hcd *hcd); | 414 | extern void usb_hcd_poll_rh_status(struct usb_hcd *hcd); |
415 | extern void usb_wakeup_notification(struct usb_device *hdev, | ||
416 | unsigned int portnum); | ||
415 | 417 | ||
416 | /* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */ | 418 | /* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */ |
417 | #define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1) | 419 | #define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1) |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 4267a9c717ba..10cb74d2ad1d 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -389,5 +389,20 @@ do { \ | |||
389 | printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg); \ | 389 | printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg); \ |
390 | } while (0) | 390 | } while (0) |
391 | 391 | ||
392 | /* | ||
393 | * Macro for reporting errors in write path to avoid inifinite loop | ||
394 | * when port is used as a console. | ||
395 | */ | ||
396 | #define dev_err_console(usport, fmt, ...) \ | ||
397 | do { \ | ||
398 | static bool __print_once; \ | ||
399 | struct usb_serial_port *__port = (usport); \ | ||
400 | \ | ||
401 | if (!__port->port.console || !__print_once) { \ | ||
402 | __print_once = true; \ | ||
403 | dev_err(&__port->dev, fmt, ##__VA_ARGS__); \ | ||
404 | } \ | ||
405 | } while (0) | ||
406 | |||
392 | #endif /* __LINUX_USB_SERIAL_H */ | 407 | #endif /* __LINUX_USB_SERIAL_H */ |
393 | 408 | ||
diff --git a/include/linux/usb/uas.h b/include/linux/usb/uas.h new file mode 100644 index 000000000000..9a988e413694 --- /dev/null +++ b/include/linux/usb/uas.h | |||
@@ -0,0 +1,69 @@ | |||
1 | #ifndef __USB_UAS_H__ | ||
2 | #define __USB_UAS_H__ | ||
3 | |||
4 | #include <scsi/scsi.h> | ||
5 | #include <scsi/scsi_cmnd.h> | ||
6 | |||
7 | /* Common header for all IUs */ | ||
8 | struct iu { | ||
9 | __u8 iu_id; | ||
10 | __u8 rsvd1; | ||
11 | __be16 tag; | ||
12 | }; | ||
13 | |||
14 | enum { | ||
15 | IU_ID_COMMAND = 0x01, | ||
16 | IU_ID_STATUS = 0x03, | ||
17 | IU_ID_RESPONSE = 0x04, | ||
18 | IU_ID_TASK_MGMT = 0x05, | ||
19 | IU_ID_READ_READY = 0x06, | ||
20 | IU_ID_WRITE_READY = 0x07, | ||
21 | }; | ||
22 | |||
23 | struct command_iu { | ||
24 | __u8 iu_id; | ||
25 | __u8 rsvd1; | ||
26 | __be16 tag; | ||
27 | __u8 prio_attr; | ||
28 | __u8 rsvd5; | ||
29 | __u8 len; | ||
30 | __u8 rsvd7; | ||
31 | struct scsi_lun lun; | ||
32 | __u8 cdb[16]; /* XXX: Overflow-checking tools may misunderstand */ | ||
33 | }; | ||
34 | |||
35 | /* | ||
36 | * Also used for the Read Ready and Write Ready IUs since they have the | ||
37 | * same first four bytes | ||
38 | */ | ||
39 | struct sense_iu { | ||
40 | __u8 iu_id; | ||
41 | __u8 rsvd1; | ||
42 | __be16 tag; | ||
43 | __be16 status_qual; | ||
44 | __u8 status; | ||
45 | __u8 rsvd7[7]; | ||
46 | __be16 len; | ||
47 | __u8 sense[SCSI_SENSE_BUFFERSIZE]; | ||
48 | }; | ||
49 | |||
50 | struct usb_pipe_usage_descriptor { | ||
51 | __u8 bLength; | ||
52 | __u8 bDescriptorType; | ||
53 | |||
54 | __u8 bPipeID; | ||
55 | __u8 Reserved; | ||
56 | } __attribute__((__packed__)); | ||
57 | |||
58 | enum { | ||
59 | CMD_PIPE_ID = 1, | ||
60 | STATUS_PIPE_ID = 2, | ||
61 | DATA_IN_PIPE_ID = 3, | ||
62 | DATA_OUT_PIPE_ID = 4, | ||
63 | |||
64 | UAS_SIMPLE_TAG = 0, | ||
65 | UAS_HEAD_TAG = 1, | ||
66 | UAS_ORDERED_TAG = 2, | ||
67 | UAS_ACA = 4, | ||
68 | }; | ||
69 | #endif | ||