Commit 875bc23ac041519b24bd2c1faf71822e4b3e4322

Authored by Huang Rui
Committed by Greg Kroah-Hartman
1 parent c952a8ba71

usb: usbtest: fix the bit mask of usb 2.0 extension descriptor

USB 2.1 Link PM adds to use bits[1:15] according to USB 2.0 ECN Errata for
Link Power Management spec.

Bit	Encoding
0	Reserved
1	LPM
2	BESL & Altemate HIRD definitions supported
3	Recommended Baseline BESL valid
4	Recommended Deep BESL valid
11:8	Recommended Baseline BESL value
15:12	Recommended Deep BESL value
31:16	Reserved

So fix the bit mask from 0x1e to 0xfffe.

Reported-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

drivers/usb/misc/usbtest.c
... ... @@ -619,8 +619,8 @@
619 619 }
620 620  
621 621 attr = le32_to_cpu(ext->bmAttributes);
622   - /* bits[1:4] is used and others are reserved */
623   - if (attr & ~0x1e) { /* reserved == 0 */
  622 + /* bits[1:15] is used and others are reserved */
  623 + if (attr & ~0xfffe) { /* reserved == 0 */
624 624 ERROR(tdev, "reserved bits set\n");
625 625 return 0;
626 626 }