Skip to contentSkip to conversation

Input: xpad - add disable_xboxone module parameter

PATCH In review Apoorv Parle 2 participants 8 messages May 17, 2025 – May 25, 2025 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Input: xpad - add disable_xboxone module parameter

Hi,

This patch adds a disable_xboxone module parameter to the xpad driver, allowing users to prevent xpad from binding to Xbox One and Series X|S devices (XTYPE_XBOXONE). This is especially useful for users who wish to use the out-of-tree xone driver (https://github.com/dlundqvist/xone) .

Currently, there is no in-tree driver that supports Xbox wireless dongles; the only option is the out-of-tree xone project which implements the GIP protocol. The xone project itself, or similar functionality cannot be easily upstreamed due to the unclear legality of redistributing the required Microsoft firmware. This patch lets users avoid device conflicts and run both drivers side by side, without having to patch or fork xpad (eg: https://github.com/medusalix/xpad-noone) for each kernel update.

Tested on kernel version 6.14.0 with both legacy Xbox 360 controllers and a Microsoft Xbox Wireless Adapter Dongle + Xbox Controller Model 1914

Thanks for your consideration.

Best,
Apoorv Parle

Apoorv Parle (1):
Input: xpad - add disable_xboxone module parameter

 drivers/input/joystick/xpad.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
Signature · 1 line
2.48.1
#1 lore raw

PATCH 1/1 Input: xpad - add disable_xboxone module parameter

This parameter skips probing for XTYPE_XBOXONE devices, allowing out-of-tree drivers like xone to handle newer Xbox controllers without conflicts.

---
 drivers/input/joystick/xpad.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/input/joystick/xpad.c +12 -0
index 57a5ff3d1992..5bab5c2250d2 100644
@@ -121,6 +121,10 @@ static bool auto_poweroff = true;
 module_param(auto_poweroff, bool, S_IWUSR | S_IRUGO);
 MODULE_PARM_DESC(auto_poweroff, "Power off wireless controllers on suspend");
 
+static bool disable_xboxone;
+module_param(disable_xboxone, bool, 0644);
+MODULE_PARM_DESC(disable_xboxone, "Disable all Xbox One devices (XTYPE_XBOXONE)");
+
 static const struct xpad_device {
 	u16 idVendor;
 	u16 idProduct;
@@ -2089,6 +2093,14 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
 			xpad->mapping |= MAP_STICKS_TO_NULL;
 	}
 
+	if (xpad->xtype == XTYPE_XBOXONE && disable_xboxone) {
+		/*
+		 * Disable XTYPE_XBOXONE based on module parameter.
+		 */
+		error = -ENODEV;
+		goto err_free_in_urb;
+	}
+
 	if (xpad->xtype == XTYPE_XBOXONE &&
 	    intf->cur_altsetting->desc.bInterfaceNumber != GIP_WIRED_INTF_DATA) {
 		/*
Signature · 1 line
2.48.1
maintainer
#2 lore raw
In reply to Apoorv Parle

Hi Apoorv,

Quoted 7 lines · Apoorv Parle

Hi,

This patch adds a disable_xboxone module parameter to the xpad driver, allowing users to prevent xpad from binding to Xbox One and Series X|S devices (XTYPE_XBOXONE). This is especially useful for users who wish to use the out-of-tree xone driver (https://github.com/dlundqvist/xone) .

Quoted 7 lines

Currently, there is no in-tree driver that supports Xbox wireless dongles; the only option is the out-of-tree xone project which implements the GIP protocol. The xone project itself, or similar functionality cannot be easily upstreamed due to the unclear legality of redistributing the required Microsoft firmware. This patch lets users avoid device conflicts and run both drivers side by side, without having to patch or fork xpad (eg: https://github.com/medusalix/xpad-noone) for each kernel update.

I believe this can be achieved from userspace by unbinding the original xbox driver and binding the alternative driver via sysfs, no kernel changes needed.

Thanks.

Signature · 1 line
Dmitry
#3 lore raw

The goal is to not blacklist the xpad driver completely, because I still need that driver for other controllers (older Xbox 360 controller or 3rd party controllers) when using multiple controllers (couch multiplayer) on the same machine.

Today I'm forced to blacklist xpad altogether to get xone up because they conflict on the device IDs, and then I can only use 1 controller, not both.
Or I have to create a copy of xpad with Xbox-One device IDs stripped out (i.e. xpad-noone) to keep both drivers active side-by-side, so my new XboxOne can use xone and my old Xbox 360 can use the xpad driver. This patch is trying to make that seamless. And it'll have the added benefit of making distro packaging easier as xpad can just stay upstream with no separate builds needed, and xone driver can be a non-free opt-in installation with this module param enabled.

Quoted 27 lines · Dmitry Torokhov

Hi Apoorv,

Quoted 7 lines · Apoorv Parle

Hi,

This patch adds a disable_xboxone module parameter to the xpad driver, allowing users to prevent xpad from binding to Xbox One and Series X|S devices (XTYPE_XBOXONE). This is especially useful for users who wish to use the out-of-tree xone driver (https://github.com/dlundqvist/xone) .

Quoted 7 lines

Currently, there is no in-tree driver that supports Xbox wireless dongles; the only option is the out-of-tree xone project which implements the GIP protocol. The xone project itself, or similar functionality cannot be easily upstreamed due to the unclear legality of redistributing the required Microsoft firmware. This patch lets users avoid device conflicts and run both drivers side by side, without having to patch or fork xpad (eg: https://github.com/medusalix/xpad-noone) for each kernel update.

I believe this can be achieved from userspace by unbinding the original xbox driver and binding the alternative driver via sysfs, no kernel changes needed.

Thanks.

--
Dmitry

maintainer
#5 lore raw
In reply to a message not in the archive
Quoted 5 lines · Apoorv Parle

The goal is to not blacklist the xpad driver completely, because I still need that driver for other controllers (older Xbox 360 controller or 3rd party controllers) when using multiple controllers (couch multiplayer) on the same machine.

Quoted 9 lines

Today I'm forced to blacklist xpad altogether to get xone up because they conflict on the device IDs, and then I can only use 1 controller, not both. Or I have to create a copy of xpad with Xbox-One device IDs stripped out (i.e. xpad-noone) to keep both drivers active side-by-side, so my new XboxOne can use xone and my old Xbox 360 can use the xpad driver. This patch is trying to make that seamless. And it'll have the added benefit of making distro packaging easier as xpad can just stay upstream with no separate builds needed, and xone driver can be a non-free opt-in installation with this module param enabled.

I understand. However you can unbind and bind individual devices to individual drivers via sysfs by writing into /sys/bus/usb/drivers/{xpad|xone}/{un}bind.

Thanks.

Signature · 1 line
Dmitry
#6 lore raw

Ah, yes, that's possible. But it's too hard to generally use - requires manual command line intervention each time the xbox dongle is plugged-in and/or computer reboots.There's no easy way to robustly automate this especially for layperson linux gamers.
A stripped-down and hand-compiled version of xpad is at least fully automated, but only until the linux kernel is updated by the distro.

Quoted 9 lines · Dmitry Torokhov

I understand. However you can unbind and bind individual devices to individual drivers via sysfs by writing into /sys/bus/usb/drivers/{xpad|xone}/{un}bind.

Thanks.

--
Dmitry

#8 lore raw
In reply to a message not in the archive

From what I've read on udev rules so far, I'm not sure if there's a clean deterministic way of unbinding one driver and binding it to another.
As I understand, I'll have to write a script to run for either the "add" action or the "bind" action. The "add" script runs asynchronous to kernel's binding, so it could happen before or after xpad binding is done; and even if I unbind it, kernel can re-bind it again while scanning the USB bus, which again creates a race with the script. If I use the "bind" action instead of "add" action, the script can recurse depending on timing of kernel's attempt to rebind. I tried to look for similar examples but couldn't find any -- just a few very high cpu usage bugs due to similar recursion.
Other similar scenarios (like graphics drivers) that I tried to find, just blacklist whole kernel modules or used some module param.

Though I'll admit, my knowledge of udev rules is somewhat limited.

Quoted 31 lines · A. Bosch

Hi,

could you not create udev rules to perform these actions?

- Andreas

Am 20. Mai 2025 06:04:36 MESZ schrieb Apoorv Parle <[email protected]>:

Quoted 22 lines

Ah, yes, that's possible. But it's too hard to generally use - requires manual command line intervention each time the xbox dongle is plugged-in and/or computer reboots.There's no easy way to robustly automate this especially for layperson linux gamers.
A stripped-down and hand-compiled version of xpad is at least fully automated, but only until the linux kernel is updated by the distro.

Quoted 10 lines · Dmitry Torokhov

I understand. However you can unbind and bind individual devices to individual drivers via sysfs by writing into /sys/bus/usb/drivers/{xpad|xone}/{un}bind.

Thanks.

--
Dmitry

#9 lore raw

Any thoughts on considering this patch?

Quoted 51 lines · Apoorv Parle

From what I've read on udev rules so far, I'm not sure if there's a clean deterministic way of unbinding one driver and binding it to another.
As I understand, I'll have to write a script to run for either the "add" action or the "bind" action. The "add" script runs asynchronous to kernel's binding, so it could happen before or after xpad binding is done; and even if I unbind it, kernel can re-bind it again while scanning the USB bus, which again creates a race with the script. If I use the "bind" action instead of "add" action, the script can recurse depending on timing of kernel's attempt to rebind. I tried to look for similar examples but couldn't find any -- just a few very high cpu usage bugs due to similar recursion.
Other similar scenarios (like graphics drivers) that I tried to find, just blacklist whole kernel modules or used some module param.

Though I'll admit, my knowledge of udev rules is somewhat limited.

Quoted 31 lines · A. Bosch

Hi,

could you not create udev rules to perform these actions?

- Andreas

Am 20. Mai 2025 06:04:36 MESZ schrieb Apoorv Parle <[email protected]>:

Quoted 22 lines

Ah, yes, that's possible. But it's too hard to generally use - requires manual command line intervention each time the xbox dongle is plugged-in and/or computer reboots.There's no easy way to robustly automate this especially for layperson linux gamers.
A stripped-down and hand-compiled version of xpad is at least fully automated, but only until the linux kernel is updated by the distro.

Quoted 10 lines · Dmitry Torokhov

I understand. However you can unbind and bind individual devices to individual drivers via sysfs by writing into /sys/bus/usb/drivers/{xpad|xone}/{un}bind.

Thanks.

--
Dmitry