diff options
author | Mathias Nyman <mathias.nyman@linux.intel.com> | 2016-02-12 09:40:14 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-14 20:03:23 -0500 |
commit | faee822c5a7ab99de25cd34fcde3f8d37b6b9923 (patch) | |
tree | 646b022979a99da4cc9bf47aee3e4efd890ffe03 | |
parent | b37d83a6a41499d582b8faedff1913ec75d9e70b (diff) |
usb: Add USB 3.1 Precision time measurement capability descriptor support
USB 3.1 devices that support precision time measurement have an
additional PTM cabaility descriptor as part of the full BOS descriptor
Look for this descriptor while parsing the BOS descriptor, and store it in
struct usb_hub_bos if it exists.
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/core/config.c | 3 | ||||
-rw-r--r-- | include/linux/usb.h | 1 | ||||
-rw-r--r-- | include/uapi/linux/usb/ch9.h | 10 |
3 files changed, 14 insertions, 0 deletions
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 58d089802ab3..5eb1a87228b4 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c | |||
@@ -894,6 +894,9 @@ int usb_get_bos_descriptor(struct usb_device *dev) | |||
894 | dev->bos->ss_id = | 894 | dev->bos->ss_id = |
895 | (struct usb_ss_container_id_descriptor *)buffer; | 895 | (struct usb_ss_container_id_descriptor *)buffer; |
896 | break; | 896 | break; |
897 | case USB_PTM_CAP_TYPE: | ||
898 | dev->bos->ptm_cap = | ||
899 | (struct usb_ptm_cap_descriptor *)buffer; | ||
897 | default: | 900 | default: |
898 | break; | 901 | break; |
899 | } | 902 | } |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 8fc881af8735..6a9a0c28415d 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -332,6 +332,7 @@ struct usb_host_bos { | |||
332 | struct usb_ss_cap_descriptor *ss_cap; | 332 | struct usb_ss_cap_descriptor *ss_cap; |
333 | struct usb_ssp_cap_descriptor *ssp_cap; | 333 | struct usb_ssp_cap_descriptor *ssp_cap; |
334 | struct usb_ss_container_id_descriptor *ss_id; | 334 | struct usb_ss_container_id_descriptor *ss_id; |
335 | struct usb_ptm_cap_descriptor *ptm_cap; | ||
335 | }; | 336 | }; |
336 | 337 | ||
337 | int __usb_get_extra_descriptor(char *buffer, unsigned size, | 338 | int __usb_get_extra_descriptor(char *buffer, unsigned size, |
diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h index a65f1f328de1..252ac16635dc 100644 --- a/include/uapi/linux/usb/ch9.h +++ b/include/uapi/linux/usb/ch9.h | |||
@@ -912,6 +912,16 @@ struct usb_ssp_cap_descriptor { | |||
912 | #define USB_SSP_SUBLINK_SPEED_LSM (0xff << 16) /* Lanespeed mantissa */ | 912 | #define USB_SSP_SUBLINK_SPEED_LSM (0xff << 16) /* Lanespeed mantissa */ |
913 | } __attribute__((packed)); | 913 | } __attribute__((packed)); |
914 | 914 | ||
915 | /* | ||
916 | * Precision time measurement capability descriptor: advertised by devices and | ||
917 | * hubs that support PTM | ||
918 | */ | ||
919 | #define USB_PTM_CAP_TYPE 0xb | ||
920 | struct usb_ptm_cap_descriptor { | ||
921 | __u8 bLength; | ||
922 | __u8 bDescriptorType; | ||
923 | __u8 bDevCapabilityType; | ||
924 | } __attribute__((packed)); | ||
915 | 925 | ||
916 | /*-------------------------------------------------------------------------*/ | 926 | /*-------------------------------------------------------------------------*/ |
917 | 927 | ||