Skip to contentSkip to conversation

uas: fix super speed bMaxPacketSize0

PATCH In review Gerd Hoffmann 3 participants 3 messages Jan 17, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 uas: fix super speed bMaxPacketSize0

For usb2 bMaxPacketSize0 is "n", for usb3 it is "1 << n", so it must be 9 not 64 ...

rom "Universal Serial Bus 3.1 Specification":

If the device is operating at Gen X speed, the bMaxPacketSize0 field shall be set to 09H indicating a 512-byte maximum packet. An Enhanced SuperSpeed device shall not support any other maximum packet sizes for the default control pipe (endpoint 0) control endpoint.

We now announce a 512-byte maximum packet.

Fixes 89a453d4a5c ("uas-uas: usb3 streams")
---
 hw/usb/dev-uas.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/usb/dev-uas.c +1 -1
index 6d6d1073b907..1bc4dd4fafb8 100644
@@ -303,7 +303,7 @@ static const USBDescDevice desc_device_high = {
 
 static const USBDescDevice desc_device_super = {
     .bcdUSB                        = 0x0300,
-    .bMaxPacketSize0               = 64,
+    .bMaxPacketSize0               = 9,
     .bNumConfigurations            = 1,
     .confs = (USBDescConfig[]) {
         {
Signature · 1 line
2.18.1
#1 lore raw
Quoted 4 lines · Gerd Hoffmann

For usb2 bMaxPacketSize0 is "n", for usb3 it is "1 << n", so it must be 9 not 64 ...

rom "Universal Serial Bus 3.1 Specification":

Oops typo "From" ;) You can obviously fix that directly on your tree, no need for v3.

Thanks for the v2!

Quoted 31 lines

If the device is operating at Gen X speed, the bMaxPacketSize0 field shall be set to 09H indicating a 512-byte maximum packet. An Enhanced SuperSpeed device shall not support any other maximum packet sizes for the default control pipe (endpoint 0) control endpoint.

We now announce a 512-byte maximum packet.

Fixes 89a453d4a5c ("uas-uas: usb3 streams")
---
  hw/usb/dev-uas.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/usb/dev-uas.c +1 -1
index 6d6d1073b907..1bc4dd4fafb8 100644
@@ -303,7 +303,7 @@ static const USBDescDevice desc_device_high = {
 
  static const USBDescDevice desc_device_super = {
      .bcdUSB                        = 0x0300,
-    .bMaxPacketSize0               = 64,
+    .bMaxPacketSize0               = 9,
      .bNumConfigurations            = 1,
      .confs = (USBDescConfig[]) {
          {
#2 lore raw
In reply to Gerd Hoffmann

I am okay with this patch. Thank you.

Ben

Quoted 43 lines

-----Original Message-----
From: Gerd Hoffmann <[email protected]>
Sent: Friday, January 17, 2020 12:37 AM
To: [email protected]
Cc: [email protected]; Gerd Hoffmann <[email protected]>
Subject: [PATCH v2] uas: fix super speed bMaxPacketSize0

For usb2 bMaxPacketSize0 is "n", for usb3 it is "1 << n", so it must be 9 not 64
...

rom "Universal Serial Bus 3.1 Specification":

If the device is operating at Gen X speed, the bMaxPacketSize0 field shall be set to 09H indicating a 512-byte maximum packet. An Enhanced SuperSpeed device shall not support any other maximum packet sizes for the default control pipe (endpoint 0) control endpoint.

We now announce a 512-byte maximum packet.

Fixes 89a453d4a5c ("uas-uas: usb3 streams")
---
 hw/usb/dev-uas.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/usb/dev-uas.c index renamed from hw/usb/dev-uas.c +0 -0

6d6d1073b907..1bc4dd4fafb8 100644

hw/usb/dev-uas.c +1 -2
@@ -303,7 +303,7 @@ static const USBDescDevice desc_device_high = {
 
 static const USBDescDevice desc_device_super = {
     .bcdUSB                        = 0x0300,
-    .bMaxPacketSize0               = 64,
+    .bMaxPacketSize0               = 9,
     .bNumConfigurations            = 1,
     .confs = (USBDescConfig[]) {
         {
--

2.18.1