linux/include/linux/usb
Nikhil Solanke 152f174a13 usb: core: Add quirk for 255-bytes initial config read
Certain third-party USB game controllers exposing (or spoofing) an Xbox
360-compatible interface (VID:PID 045e:028e) fail to enumerate under Linux.
The device disconnects from the bus without responding to the initial
GET_DESCRIPTOR(CONFIGURATION) request, and the kernel logs 'unable to read
config index 0 descriptor/start: -71'.

The device then falls back to a secondary Android HID mode (with a
different VID:PID), losing XInput functionality including rumble support.
The failure reproduces across multiple machines, host controller types, and
kernel versions including current mainline and LTS. The device enumerates
correctly and remains in XInput mode under Windows. Notably, the device
enumerates correctly in Android mode when the same 9-byte request
is issued for that mode's configuration descriptor, confirming the firmware
bug is specific to the XInput mode.

usbmon traces from Linux and Wireshark/USBPcap traces from Windows are
identical up to the point of failure, with no visible protocol-level
difference explaining the divergence. The root cause was identified when
Michal Pecio discovered via a QEMU bus-level capture that Windows does not
use wLength=9 for the initial config descriptor request; it uses
wLength=255. Alan Stern subsequently confirmed this with a bus
analyzer on a different USB 2.0 device, and Michal verified the behavior
goes back to Windows 95 OSR2.1.

So, add a new quirk flag USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE which causes
usb_get_configuration() to issue a 255 byte sized configuration request
instead of USB_DT_CONFIG_SIZE (9) for the initial
GET_DESCRIPTOR(CONFIGURATION) request, mimicking long-standing Windows
behavior.

This patch intentionally does not add any new VID:PID entries using this
quirk. Some affected Xbox 360-compatible controllers spoof Microsoft's
VID:PID, while genuine Microsoft controllers already enumerate correctly
and do not require this quirk. Other affected clone devices use their own
VID:PID pairs and can be added individually as they are identified.

Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Suggested-by: Michal Pecio <michal.pecio@gmail.com>
Closes: https://lore.kernel.org/linux-usb/CAFgddh+JWdT4LLwMc5qjM8q_pBu-fRo2qADR5ovAKoGHWMQrRw@mail.gmail.com/
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Cc: stable <stable@kernel.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Nikhil Solanke <nikhilsolanke5@gmail.com>
Link: https://patch.msgid.link/20260728195158.65162-2-nikhilsolanke5@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-08-03 17:25:30 +02:00
..
audio-v2.h
audio-v3.h
audio.h
c67x00.h
ccid.h
cdc_ncm.h net: cdc-ncm: cleanup device descriptor 2026-03-11 14:59:48 +01:00
cdc-wdm.h
cdc.h
ch9.h
chipidea.h usb: chipidea: ci_hdrc_imx: Set out of band wakeup for i.MX95 2025-11-19 18:06:49 +01:00
composite.h usb: gadget: Remove unused usb_remove_config 2025-06-19 12:26:48 +02:00
ehci_def.h
ehci_pdriver.h
ehci-dbgp.h
ezusb.h
func_utils.h
functionfs.h
g_hid.h
gadget_configfs.h usb: gadget: Constify struct configfs_item_operations and configfs_group_operations 2025-12-23 15:31:01 +01:00
gadget.h usb: gadget: udc: fix use-after-free in usb_gadget_state_work 2025-10-28 15:46:02 +01:00
hcd.h USB: HCD: remove logic about which hcd is loaded 2026-01-14 15:59:00 +01:00
input.h
iowarrior.h
irda.h
isp116x.h
isp1301.h
ljca.h
m66592.h
mctp-usb.h usb: Add base USB MCTP definitions 2025-02-21 16:45:21 -08:00
midi-v2.h
musb-ux500.h
musb.h usb: musb: Constify struct musb_fifo_cfg 2025-02-03 16:29:53 +01:00
net2280.h
of.h
ohci_pdriver.h
onboard_dev.h
otg-fsm.h
otg.h
pd_ado.h
pd_bdo.h
pd_ext_sdb.h
pd_vdo.h
pd.h tcpm: Implement sink support for PD SPR AVS negotiation 2026-03-18 16:08:39 +01:00
phy_companion.h
phy.h usb: phy: Remove API devm_usb_put_phy() 2025-01-13 06:12:09 +01:00
quirks.h usb: core: Add quirk for 255-bytes initial config read 2026-08-03 17:25:30 +02:00
r8a66597.h
r8152.h net: usb: r8152: add TRENDnet TUC-ET2G 2026-02-27 19:27:31 -08:00
renesas_usbhs.h
rndis_host.h
role.h
rzv2m_usb3drd.h
serial.h usb: serial: Include <linux/usb.h> in <linux/usb/serial.h> 2026-07-03 07:38:14 +02:00
sl811.h
storage.h
tcpci.h
tcpm.h tcpm: Implement sink support for PD SPR AVS negotiation 2026-03-18 16:08:39 +01:00
tegra_usb_phy.h usb: phy: tegra: parametrize PORTSC1 register offset 2026-02-05 17:16:24 +01:00
typec_altmode.h Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (headers) 2026-07-03 07:38:16 +02:00
typec_dp.h usb: typec: altmodes/displayport: do not index invalid pin_assignments 2025-06-24 15:42:55 +01:00
typec_mux.h usb: typec: Stub out typec_switch APIs when CONFIG_TYPEC=n 2025-09-17 12:42:30 +02:00
typec_retimer.h
typec_tbt.h usb: typec: ps883x: Add USB4 mode and TBT3 altmode support 2025-10-22 10:58:32 +02:00
typec.h usb: typec: Introduce mode_selection bit 2026-01-23 17:18:01 +01:00
uas.h
ulpi.h usb: ulpi: Remove unused otg_ulpi_create 2025-03-03 10:23:35 +01:00
usb_phy_generic.h
usb338x.h
usbio.h usb: misc: Add Intel USBIO bridge driver 2025-09-12 14:05:09 +02:00
usbnet.h qmi_wwan: allow max_mtu above hard_mtu to control rx_urb_size 2026-03-06 16:31:41 -08:00
uvc.h media: uvcvideo: Introduce allow_privacy_override module parameter 2026-05-12 07:30:53 +02:00
webusb.h
xhci-dbgp.h
xhci-sideband.h xhci: sideband: add api to trace sideband usage 2025-09-12 14:08:02 +02:00