linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	linux-usb@vger.kernel.org
Cc: John Youn <John.Youn@synopsys.com>
Subject: [PATCH v4 01/12] usb: ch9: Add sublink speed struct
Date: Sat, 25 Jul 2020 18:35:59 -0700	[thread overview]
Message-ID: <0ac6bfdfa164df18faf2a91c8c4266aa446d444e.1595727196.git.thinhn@synopsys.com> (raw)
In-Reply-To: <cover.1595727196.git.thinhn@synopsys.com>

USB 3.2 specification supports dual-lane for super-speed-plus. USB
devices may operate at different sublink speeds. To avoid using magic
numbers and capture the sublink speed better, introduce the
usb_sublink_speed structure and various sublink speed attribute enum.

See SSP BOS descriptor in USB 3.2 specification section 9.6.2.5

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
---
Changes in v4:
- None
Changes in v3:
- None
Changes in v2:
- Move to include/linux/usb/ch9.h instead of under uapi

 include/linux/usb/ch9.h | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index 604c6c514a50..01191649a0ad 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -36,6 +36,49 @@
 #include <linux/device.h>
 #include <uapi/linux/usb/ch9.h>
 
+/* USB 3.2 sublink speed attributes */
+
+enum usb_lane_speed_exponent {
+	USB_LSE_BPS = 0,
+	USB_LSE_KBPS = 1,
+	USB_LSE_MBPS = 2,
+	USB_LSE_GBPS = 3,
+};
+
+enum usb_sublink_type {
+	USB_ST_SYMMETRIC_RX = 0,
+	USB_ST_ASYMMETRIC_RX = 1,
+	USB_ST_SYMMETRIC_TX = 2,
+	USB_ST_ASYMMETRIC_TX = 3,
+};
+
+enum usb_link_protocol {
+	USB_LP_SS = 0,
+	USB_LP_SSP = 1,
+};
+
+/**
+ * struct usb_sublink_speed - sublink speed attribute
+ * @id: sublink speed attribute ID (SSID)
+ * @mantissa: lane speed mantissa
+ * @exponent: lane speed exponent
+ * @type: sublink type
+ * @protocol: sublink protocol
+ *
+ * Super-speed-plus supports multiple lanes. Use the sublink speed attributes to
+ * describe the sublink speed.
+ *
+ * See USB 3.2 spec section 9.6.2.6 for super-speed-plus capability for more
+ * information.
+ */
+struct usb_sublink_speed {
+	u8				id;
+	u16				mantissa;
+	enum usb_lane_speed_exponent	exponent;
+	enum usb_sublink_type		type;
+	enum usb_link_protocol		protocol;
+};
+
 /**
  * usb_ep_type_string() - Returns human readable-name of the endpoint type.
  * @ep_type: The endpoint type to return human-readable name for.  If it's not
-- 
2.11.0


  reply	other threads:[~2020-07-26  1:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-26  1:35 [PATCH v4 00/12] usb: Handle different sublink speeds Thinh Nguyen
2020-07-26  1:35 ` Thinh Nguyen [this message]
2020-07-26  1:36 ` [PATCH v4 02/12] usb: gadget: composite: Avoid using magic numbers Thinh Nguyen
2020-07-26  1:36 ` [PATCH v4 03/12] usb: gadget: Expose sublink speed attributes Thinh Nguyen
2020-07-26  1:36 ` [PATCH v4 04/12] usb: gadget: Set max speed for SSP devices Thinh Nguyen
2020-07-26  1:36 ` [PATCH v4 05/12] usb: composite: Properly report sublink speed Thinh Nguyen
2020-07-26  1:36 ` [PATCH v4 06/12] usb: devicetree: Include USB SSP Gen X x Y Thinh Nguyen
2020-07-31 20:21   ` Rob Herring
2020-08-01  2:36     ` Thinh Nguyen
2020-07-26  1:36 ` [PATCH v4 07/12] usb: common: Add and update common functions for SSP speeds Thinh Nguyen
2020-07-26  1:36 ` [PATCH v4 08/12] usb: dwc3: Initialize lane count and sublink speed Thinh Nguyen
2020-07-26  1:36 ` [PATCH v4 09/12] usb: dwc3: gadget: Report sublink speed capability Thinh Nguyen
2020-07-26  1:36 ` [PATCH v4 10/12] usb: dwc3: gadget: Implement setting of sublink speed Thinh Nguyen
2020-07-26  1:37 ` [PATCH v4 11/12] usb: dwc3: gadget: Track connected lane and " Thinh Nguyen
2020-07-26  1:37 ` [PATCH v4 12/12] usb: dwc3: gadget: Set speed only up to the max supported Thinh Nguyen
2020-09-05  0:53 ` [PATCH v4 00/12] usb: Handle different sublink speeds Thinh Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ac6bfdfa164df18faf2a91c8c4266aa446d444e.1595727196.git.thinhn@synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=John.Youn@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).