linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5] usb: usb3.0 ch9 definitions
@ 2010-10-09 14:46 Tatyana Brokhman
  2010-10-10  8:10 ` Matthew Wilcox
  2010-10-10 10:32 ` Sergei Shtylyov
  0 siblings, 2 replies; 5+ messages in thread
From: Tatyana Brokhman @ 2010-10-09 14:46 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-arm-msm, Tatyana Brokhman, Greg Kroah-Hartman,
	Matthew Wilcox, Sarah Sharp, linux-kernel

Adding SuperSpeed usb definitions as defined by ch9 of the USB3.0 spec.
This patch is a preparation for adding SuperSpeed support to the gadget
framework.

Signed-off-by: Tatyana Brokhman<tlinder@codeaurora.org>
---
 include/linux/usb/ch9.h |   58 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 57 insertions(+), 1 deletions(-)

diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index da2ed77..fc5506f 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -123,8 +123,23 @@
 #define USB_DEVICE_A_ALT_HNP_SUPPORT	5	/* (otg) other RH port does */
 #define USB_DEVICE_DEBUG_MODE		6	/* (special devices only) */
 
+/*
+ * New Feature Selectors as added by USB 3.0
+ * See USB 3.0 spec Table 9-6
+ */
+#define USB_DEVICE_U1_ENABLE	48	/* dev may initiate U1 transition */
+#define USB_DEVICE_U2_ENABLE	49	/* dev may initiate U2 transition */
+#define USB_DEVICE_LTM_ENABLE	50	/* dev may send LTM */
+#define USB_INTRF_FUNC_SUSPEND	0	/* function suspend */
+
+#define USB_INTR_FUNC_SUSPEND_OPT_MASK	0xFF00
+
 #define USB_ENDPOINT_HALT		0	/* IN/OUT will STALL */
 
+/* Bit array elements as returned by the USB_REQ_GET_STATUS request. */
+#define USB_DEV_STAT_U1_ENABLED		2	/* transition into U1 state */
+#define USB_DEV_STAT_U2_ENABLED		3	/* transition into U2 state */
+#define USB_DEV_STAT_LTM_ENABLED	4	/* Latency tolerance messages */
 
 /**
  * struct usb_ctrlrequest - SETUP data for a USB device control request
@@ -675,6 +690,7 @@ struct usb_bos_descriptor {
 	__u8  bNumDeviceCaps;
 } __attribute__((packed));
 
+#define USB_DT_BOS_SIZE		5
 /*-------------------------------------------------------------------------*/
 
 /* USB_DT_DEVICE_CAPABILITY:  grouped with BOS */
@@ -712,16 +728,56 @@ struct usb_wireless_cap_descriptor {	/* Ultra Wide Band */
 	__u8  bReserved;
 } __attribute__((packed));
 
+/* USB 2.0 Extension descriptor */
 #define	USB_CAP_TYPE_EXT		2
 
 struct usb_ext_cap_descriptor {		/* Link Power Management */
 	__u8  bLength;
 	__u8  bDescriptorType;
 	__u8  bDevCapabilityType;
-	__u8  bmAttributes;
+	__le32 bmAttributes;
 #define USB_LPM_SUPPORT			(1 << 1)	/* supports LPM */
 } __attribute__((packed));
 
+#define USB_DT_USB_EXT_CAP_SIZE	7
+
+/*
+ * SuperSpeed USB Capability descriptor: Defines the set of SuperSpeed USB
+ * specific device level capabilities
+ */
+#define		USB_SS_CAP_TYPE		3
+struct usb_ss_cap_descriptor {		/* Link Power Management */
+	__u8  bLength;
+	__u8  bDescriptorType;
+	__u8  bDevCapabilityType;
+	__u8  bmAttributes;
+#define USB_LTM_SUPPORT			(1 << 1) /* supports LTM */
+	__le16 wSpeedSupported;
+#define USB_LOW_SPEED_OPERATION		(1)	 /* Low speed operation */
+#define USB_FULL_SPEED_OPERATION	(1 << 1) /* Full speed operation */
+#define USB_HIGH_SPEED_OPERATION	(1 << 2) /* High speed operation */
+#define USB_5GBPS_OPERATION		(1 << 3) /* Operation at 5Gbps */
+	__u8  bFunctionalitySupport;
+	__u8  bU1devExitLat;
+	__le16 bU2DevExitLat;
+} __attribute__((packed));
+
+#define USB_DT_USB_SS_CAP_SIZE	10
+
+/*
+ * Container ID Capability descriptor: Defines the instance unique ID used to
+ * identify the instance across all operating modes
+ */
+#define	CONTAINER_ID_TYPE	4
+struct usb_ss_container_id_descriptor {
+	__u8  bLength;
+	__u8  bDescriptorType;
+	__u8  bDevCapabilityType;
+	__u8  bReserved;
+	__u8  ContainerID[16]; /* 128-bit number */
+} __attribute__((packed));
+
+#define USB_DT_USB_SS_CONTN_ID_SIZE	20
 /*-------------------------------------------------------------------------*/
 
 /* USB_DT_WIRELESS_ENDPOINT_COMP:  companion descriptor associated with
-- 
1.6.3.3

--
Sent by	an consultant of the Qualcomm Inovation Center, Inc.
The Qualcomm Inovation Center, Inc.is a member of the Code Aurora Forum.

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v5] usb: usb3.0 ch9 definitions
  2010-10-09 14:46 [PATCH v5] usb: usb3.0 ch9 definitions Tatyana Brokhman
@ 2010-10-10  8:10 ` Matthew Wilcox
  2010-10-10  9:49   ` tlinder
  2010-10-10 10:32 ` Sergei Shtylyov
  1 sibling, 1 reply; 5+ messages in thread
From: Matthew Wilcox @ 2010-10-10  8:10 UTC (permalink / raw)
  To: Tatyana Brokhman
  Cc: linux-usb, linux-arm-msm, Greg Kroah-Hartman, Sarah Sharp,
	linux-kernel

On Sat, Oct 09, 2010 at 04:46:12PM +0200, Tatyana Brokhman wrote:
> +/*
> + * SuperSpeed USB Capability descriptor: Defines the set of SuperSpeed USB
> + * specific device level capabilities
> + */
> +#define		USB_SS_CAP_TYPE		3
> +struct usb_ss_cap_descriptor {		/* Link Power Management */
> +	__u8  bLength;
> +	__u8  bDescriptorType;
> +	__u8  bDevCapabilityType;
> +	__u8  bmAttributes;
> +#define USB_LTM_SUPPORT			(1 << 1) /* supports LTM */
> +	__le16 wSpeedSupported;
> +#define USB_LOW_SPEED_OPERATION		(1)	 /* Low speed operation */
> +#define USB_FULL_SPEED_OPERATION	(1 << 1) /* Full speed operation */
> +#define USB_HIGH_SPEED_OPERATION	(1 << 2) /* High speed operation */
> +#define USB_5GBPS_OPERATION		(1 << 3) /* Operation at 5Gbps */
> +	__u8  bFunctionalitySupport;
> +	__u8  bU1devExitLat;
> +	__le16 bU2DevExitLat;
> +} __attribute__((packed));
> +
> +#define USB_DT_USB_SS_CAP_SIZE	10

Hang on, if we're looking at page 10-57 of "USB 3 0 (11132008)-final.pdf",
it's 12 bytes long with the last two bytes being wReserved.  Is there
an erratum that changes this?  I just looked through
"USB3_Errata [June 2010].pdf" and don't see any errata that look germane.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v5] usb: usb3.0 ch9 definitions
  2010-10-10  8:10 ` Matthew Wilcox
@ 2010-10-10  9:49   ` tlinder
  2010-10-20  6:48     ` tlinder
  0 siblings, 1 reply; 5+ messages in thread
From: tlinder @ 2010-10-10  9:49 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Tatyana Brokhman, linux-usb, linux-arm-msm, Greg Kroah-Hartman,
	Sarah Sharp, linux-kernel

Hi Matthew

Page 10-57 you're referring to defines the SuperSpeed USB Device
Capability descriptor for Hub Class. The descriptor itself is defined in
ch9 section 9.6.2.2 and the wReserved is not defined there. Thus the total
length of the descriptor is 10 bytes and not 12.
IMO we should follow the definition in ch9. It seems that ch 10 has a typo
in it. You're right about the errata. I found no reference to this issue
either.
I'll contact USB-IF regarding this issue.
Thanks for bringing this up!

Best regards
Tanya Brokhman

> On Sat, Oct 09, 2010 at 04:46:12PM +0200, Tatyana Brokhman wrote:
>> +/*
>> + * SuperSpeed USB Capability descriptor: Defines the set of SuperSpeed
>> USB
>> + * specific device level capabilities
>> + */
>> +#define		USB_SS_CAP_TYPE		3
>> +struct usb_ss_cap_descriptor {		/* Link Power Management */
>> +	__u8  bLength;
>> +	__u8  bDescriptorType;
>> +	__u8  bDevCapabilityType;
>> +	__u8  bmAttributes;
>> +#define USB_LTM_SUPPORT			(1 << 1) /* supports LTM */
>> +	__le16 wSpeedSupported;
>> +#define USB_LOW_SPEED_OPERATION		(1)	 /* Low speed operation */
>> +#define USB_FULL_SPEED_OPERATION	(1 << 1) /* Full speed operation */
>> +#define USB_HIGH_SPEED_OPERATION	(1 << 2) /* High speed operation */
>> +#define USB_5GBPS_OPERATION		(1 << 3) /* Operation at 5Gbps */
>> +	__u8  bFunctionalitySupport;
>> +	__u8  bU1devExitLat;
>> +	__le16 bU2DevExitLat;
>> +} __attribute__((packed));
>> +
>> +#define USB_DT_USB_SS_CAP_SIZE	10
>
> Hang on, if we're looking at page 10-57 of "USB 3 0 (11132008)-final.pdf",
> it's 12 bytes long with the last two bytes being wReserved.  Is there
> an erratum that changes this?  I just looked through
> "USB3_Errata [June 2010].pdf" and don't see any errata that look germane.
>
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v5] usb: usb3.0 ch9 definitions
  2010-10-09 14:46 [PATCH v5] usb: usb3.0 ch9 definitions Tatyana Brokhman
  2010-10-10  8:10 ` Matthew Wilcox
@ 2010-10-10 10:32 ` Sergei Shtylyov
  1 sibling, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2010-10-10 10:32 UTC (permalink / raw)
  To: Tatyana Brokhman
  Cc: linux-usb, linux-arm-msm, Greg Kroah-Hartman, Matthew Wilcox,
	Sarah Sharp, linux-kernel

Hello.

On 09-10-2010 18:46, Tatyana Brokhman wrote:

> Adding SuperSpeed usb definitions as defined by ch9 of the USB3.0 spec.
> This patch is a preparation for adding SuperSpeed support to the gadget
> framework.

> Signed-off-by: Tatyana Brokhman<tlinder@codeaurora.org>
> ---
>   include/linux/usb/ch9.h |   58 ++++++++++++++++++++++++++++++++++++++++++++++-
>   1 files changed, 57 insertions(+), 1 deletions(-)

> diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
> index da2ed77..fc5506f 100644
> --- a/include/linux/usb/ch9.h
> +++ b/include/linux/usb/ch9.h
[...]
> @@ -712,16 +728,56 @@ struct usb_wireless_cap_descriptor {	/* Ultra Wide Band */
>   	__u8  bReserved;
>   } __attribute__((packed));
>
> +/* USB 2.0 Extension descriptor */
>   #define	USB_CAP_TYPE_EXT		2
>
>   struct usb_ext_cap_descriptor {		/* Link Power Management */
>   	__u8  bLength;
>   	__u8  bDescriptorType;
>   	__u8  bDevCapabilityType;
> -	__u8  bmAttributes;
> +	__le32 bmAttributes;
>   #define USB_LPM_SUPPORT			(1<<  1)	/* supports LPM */
>   } __attribute__((packed));
>
> +#define USB_DT_USB_EXT_CAP_SIZE	7
> +
> +/*
> + * SuperSpeed USB Capability descriptor: Defines the set of SuperSpeed USB
> + * specific device level capabilities
> + */
> +#define		USB_SS_CAP_TYPE		3

    Too many tabs here.

> +struct usb_ss_cap_descriptor {		/* Link Power Management */

WBR, Sergei

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v5] usb: usb3.0 ch9 definitions
  2010-10-10  9:49   ` tlinder
@ 2010-10-20  6:48     ` tlinder
  0 siblings, 0 replies; 5+ messages in thread
From: tlinder @ 2010-10-20  6:48 UTC (permalink / raw)
  To: tlinder
  Cc: Matthew Wilcox, linux-usb, linux-arm-msm, Greg Kroah-Hartman,
	Sarah Sharp, linux-kernel

Hi Matthew

Bellow is the reply we received from Intel regarding this issue:

"Errata 10.007 in the “Q1-09 USB3_Errata.pdf” file defines a correction of
the SuperSpeed USB Device Capability structure in section 10.13.1 that
changes bLength from 12 to 10 bytes, and bFunctionalitySupport from 8 to
3."

Best Regards
Tanya Brokhman

> Hi Matthew
>
> Page 10-57 you're referring to defines the SuperSpeed USB Device
> Capability descriptor for Hub Class. The descriptor itself is defined in
> ch9 section 9.6.2.2 and the wReserved is not defined there. Thus the total
> length of the descriptor is 10 bytes and not 12.
> IMO we should follow the definition in ch9. It seems that ch 10 has a typo
> in it. You're right about the errata. I found no reference to this issue
> either.
> I'll contact USB-IF regarding this issue.
> Thanks for bringing this up!
>
> Best regards
> Tanya Brokhman
>
>> On Sat, Oct 09, 2010 at 04:46:12PM +0200, Tatyana Brokhman wrote:
>>> +/*
>>> + * SuperSpeed USB Capability descriptor: Defines the set of SuperSpeed
>>> USB
>>> + * specific device level capabilities
>>> + */
>>> +#define		USB_SS_CAP_TYPE		3
>>> +struct usb_ss_cap_descriptor {		/* Link Power Management */
>>> +	__u8  bLength;
>>> +	__u8  bDescriptorType;
>>> +	__u8  bDevCapabilityType;
>>> +	__u8  bmAttributes;
>>> +#define USB_LTM_SUPPORT			(1 << 1) /* supports LTM */
>>> +	__le16 wSpeedSupported;
>>> +#define USB_LOW_SPEED_OPERATION		(1)	 /* Low speed operation */
>>> +#define USB_FULL_SPEED_OPERATION	(1 << 1) /* Full speed operation */
>>> +#define USB_HIGH_SPEED_OPERATION	(1 << 2) /* High speed operation */
>>> +#define USB_5GBPS_OPERATION		(1 << 3) /* Operation at 5Gbps */
>>> +	__u8  bFunctionalitySupport;
>>> +	__u8  bU1devExitLat;
>>> +	__le16 bU2DevExitLat;
>>> +} __attribute__((packed));
>>> +
>>> +#define USB_DT_USB_SS_CAP_SIZE	10
>>
>> Hang on, if we're looking at page 10-57 of "USB 3 0
>> (11132008)-final.pdf",
>> it's 12 bytes long with the last two bytes being wReserved.  Is there
>> an erratum that changes this?  I just looked through
>> "USB3_Errata [June 2010].pdf" and don't see any errata that look
>> germane.
>>
>>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-10-20  6:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-09 14:46 [PATCH v5] usb: usb3.0 ch9 definitions Tatyana Brokhman
2010-10-10  8:10 ` Matthew Wilcox
2010-10-10  9:49   ` tlinder
2010-10-20  6:48     ` tlinder
2010-10-10 10:32 ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).