USB: gadget: Fix Superspeed endpoint descriptor length issue
USB Device should report USB endpoint descriptor size as seven bytes
for all endpoints except audio endpoint. Only for audio endpoint, length
should be of endpoint descriptor size. Otherwise USB complaince tests
will fail due to wrong endpoint descriptor length. Fix this issue by
updating endpoint descriptor length field to seven bytes in serial and
rmnet function drivers.
CRs-Fixed: 422740
Change-Id: I8b42be39a7f8a315e3919bdf38293eda18bd601d
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
diff --git a/drivers/usb/gadget/f_rmnet.c b/drivers/usb/gadget/f_rmnet.c
index 4357e0d..2f94675 100644
--- a/drivers/usb/gadget/f_rmnet.c
+++ b/drivers/usb/gadget/f_rmnet.c
@@ -149,7 +149,7 @@
/* Super speed support */
static struct usb_endpoint_descriptor rmnet_ss_notify_desc = {
- .bLength = sizeof rmnet_ss_notify_desc,
+ .bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = USB_DIR_IN,
.bmAttributes = USB_ENDPOINT_XFER_INT,
@@ -168,7 +168,7 @@
};
static struct usb_endpoint_descriptor rmnet_ss_in_desc = {
- .bLength = sizeof rmnet_ss_in_desc,
+ .bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = USB_DIR_IN,
.bmAttributes = USB_ENDPOINT_XFER_BULK,
@@ -185,7 +185,7 @@
};
static struct usb_endpoint_descriptor rmnet_ss_out_desc = {
- .bLength = sizeof rmnet_ss_out_desc,
+ .bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = USB_DIR_OUT,
.bmAttributes = USB_ENDPOINT_XFER_BULK,
diff --git a/drivers/usb/gadget/f_serial.c b/drivers/usb/gadget/f_serial.c
index 43347b3..74dba07 100644
--- a/drivers/usb/gadget/f_serial.c
+++ b/drivers/usb/gadget/f_serial.c
@@ -246,7 +246,7 @@
#ifdef CONFIG_MODEM_SUPPORT
static struct usb_endpoint_descriptor gser_ss_notify_desc = {
- .bLength = sizeof gser_ss_notify_desc,
+ .bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = USB_DIR_IN,
.bmAttributes = USB_ENDPOINT_XFER_INT,