Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package xpadneo for openSUSE:Factory checked in at 2024-12-24 16:26:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/xpadneo (Old) and /work/SRC/openSUSE:Factory/.xpadneo.new.1881 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xpadneo" Tue Dec 24 16:26:09 2024 rev:3 rq:1233158 version:0.9.7 Changes: -------- --- /work/SRC/openSUSE:Factory/xpadneo/xpadneo.changes 2024-07-15 19:49:34.420336262 +0200 +++ /work/SRC/openSUSE:Factory/.xpadneo.new.1881/xpadneo.changes 2024-12-24 16:26:16.553422434 +0100 @@ -1,0 +2,16 @@ +Mon Dec 23 16:07:05 UTC 2024 - Yunhe Guo <[email protected]> + +- Update to version 0.9.7 + * core, quirks: Add GameSir T4 Nova Lite support + * core, quirks: Add GuliKit KK3 MAX quirks + * core, quirks: Add heuristics to detect GameSir Nova controllers + * hid-xpadneo: Actually allow building with kernel 6.12 + * hid-xpadneo: Allow building with kernel 6.12 + * xpadneo, core: Add configuration for disabling Xbox logo shift-mode + * xpadneo, core: Fix coding style + * xpadneo, hidraw: Fixup previous commit to properly work with DKMS + * xpadneo, hidraw: Work around other software messing with our udev rules + * xpadneo, quirks: Let another Microsoft OUI bypass heuristics + * xpadneo, quirks: Prevent applying heuristics for some known vendors + +------------------------------------------------------------------- Old: ---- xpadneo-0.9.6.tar.gz New: ---- xpadneo-0.9.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xpadneo.spec ++++++ --- /var/tmp/diff_new_pack.ynnMqs/_old 2024-12-24 16:26:17.297453050 +0100 +++ /var/tmp/diff_new_pack.ynnMqs/_new 2024-12-24 16:26:17.297453050 +0100 @@ -18,7 +18,7 @@ Name: xpadneo -Version: 0.9.6 +Version: 0.9.7 Release: 0 Summary: Driver for Xbox Wireless Controller License: GPL-3.0-only @@ -67,6 +67,6 @@ %files /usr/lib/modprobe.d/xpadneo.conf -/usr/lib/udev/rules.d/50-xpadneo-fixup-steamlink.rules /usr/lib/udev/rules.d/60-xpadneo.rules +/usr/lib/udev/rules.d/70-xpadneo-disable-hidraw.rules ++++++ xpadneo-0.9.6.tar.gz -> xpadneo-0.9.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/.gitignore new/xpadneo-0.9.7/.gitignore --- old/xpadneo-0.9.6/.gitignore 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/.gitignore 2024-12-23 14:28:19.000000000 +0100 @@ -1,5 +1,6 @@ *~ .vscode +/misc/examples/**/*.o /misc/examples/c_directional_rumble_test/direction_rumble_test /misc/examples/c_hidraw/hidraw docs/_site/** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/.shellcheckrc new/xpadneo-0.9.7/.shellcheckrc --- old/xpadneo-0.9.6/.shellcheckrc 1970-01-01 01:00:00.000000000 +0100 +++ new/xpadneo-0.9.7/.shellcheckrc 2024-12-23 14:28:19.000000000 +0100 @@ -0,0 +1 @@ +external-sources=true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/NEWS.md new/xpadneo-0.9.7/NEWS.md --- old/xpadneo-0.9.6/NEWS.md 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/NEWS.md 2024-12-23 14:28:19.000000000 +0100 @@ -1,3 +1,90 @@ +# Changes since v0.9.6 up to v0.9.7 + +This is a maintanance release of the previous "final" v0.9.6 because v0.10 will +be delayed a little longer. + +It provides support building for kernel 6.12 and later. It also adds new +hardware support quirks and compatibility fix-ups. Although the list of changes +seems long and accumulated over some time, there are no functional changes. +Also, DKMS problems (like xpadneo missing after a kernel update or kernel +hanging on boot because xpadneo is not built) should finally be fixed. + +**Heads up, package maintainers:** Upcoming xpadneo v0.10 will provide a new +make-based installer to make usage in packaging scripts easier and more +streamlined. See `docs/PACKAGING.md` in the master branch for more details. + + +## Headlines: + + * core, quirks: Add GameSir T4 Nova Lite support + * core, quirks: Add GuliKit KK3 MAX quirks + * core, quirks: Add heuristics to detect GameSir Nova controllers + * hid-xpadneo: Actually allow building with kernel 6.12 + * hid-xpadneo: Allow building with kernel 6.12 + * xpadneo, core: Add configuration for disabling Xbox logo shift-mode + * xpadneo, core: Fix coding style + * xpadneo, hidraw: Fixup previous commit to properly work with DKMS + * xpadneo, hidraw: Work around other software messing with our udev rules + * xpadneo, quirks: Let another Microsoft OUI bypass heuristics + * xpadneo, quirks: Prevent applying heuristics for some known vendors + +``` +Kai Krakow (33): + xpadneo, core: Sort device quirks into proper order + docs: Improve BT_DONGLES.md + docs: Remove feature claims that are obsolete or no longer true + docs: Fix wording and casing + docs, README: Remove the broken Codacy badge + xpadneo, core: Reorder devices by PID + docs: Add troubleshoot instructions for controllers requesting a PIN + docs: Add troubleshooting instructions after upgrading firmware + docs: Add missing blank line + docs: Add compatibilty status for a Simplecom Bluetooth dongle + hid-xpadneo: Allow building with kernel 6.12 + xpadneo, hidraw: Work around other software messing with our udev rules + xpadneo, hidraw: Fixup previous commit to properly work with DKMS + hid-xpadneo: Actually allow building with kernel 6.12 + hid-xpadneo, core: Match kernel 6.12 report_fixup signature + xpadneo, core: Fix coding style + core, quirks: Add GameSir T4 Nova Lite support + core, quirks: Add heuristics to detect GameSir Nova controllers + core, quirks: DRY the rumble tests + core, tests: Fix the pulse test and print test info + core, debug: Allow output of decoded rumble packets for debugging + xpadneo, debug: Fix indentation and output + core, quirks: Add GuliKit KK3 MAX quirks + xpadneo, quirks: Prevent applying heuristics for some known vendors + xpadneo, quirks: Let another Microsoft OUI bypass heuristics + xpadneo, installer: Fix some general issues with the scripts + xpadneo, dkms: Match minimum kernel version with source code + xpadneo, quirks: Another Microsoft OUI + xpadneo, installer: Exit immediately on error + xpadneo, dkms: Use "yes" for autoinstall instead of "Y" + xpadneo, ci: Add missing dependencies + xpadneo, ci: Add Ubuntu 24.04 + xpadneo, examples: Build hidraw properly on Ubuntu + +Alexander Tsoy (2): + docs: Suggest alternative command to get controller info + docs: Add compatibilty status for UGREEN CM390 + +Matthew Scharley (1): + bluez-tools isn't required on Tumbleweed + +Scott Bailey (1): + Doc update for KK3 Max + +arnxxau (1): + added ff_connect_notify config option to configure.sh + +bouhaa (1): + xpadneo, core: Add configuration for disabling Xbox logo shift-mode + +liberodark (1): + docs: Update BT_DONGLES +``` + + # Changes since v0.9.5 up to v0.9.6 ## Headlines: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/VERSION new/xpadneo-0.9.7/VERSION --- old/xpadneo-0.9.6/VERSION 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/VERSION 2024-12-23 14:28:19.000000000 +0100 @@ -1 +1 @@ -v0.9.6 +v0.9.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/azure-pipelines.yml new/xpadneo-0.9.7/azure-pipelines.yml --- old/xpadneo-0.9.6/azure-pipelines.yml 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/azure-pipelines.yml 2024-12-23 14:28:19.000000000 +0100 @@ -12,6 +12,8 @@ imageName: 'ubuntu-20.04' Ubuntu 22.04 LTS: imageName: 'ubuntu-22.04' + Ubuntu 24.04 LTS: + imageName: 'ubuntu-24.04' pool: vmImage: $(imageName) @@ -19,12 +21,13 @@ steps: - script: | sudo apt-get update - sudo apt-get install -y linux-headers-`uname -r` - sudo apt-get install -y dkms + sudo apt-get install -y build-essential pkg-config linux-headers-`uname -r` displayName: 'setup' - script: | + sudo apt-get install -y dkms sudo ./install.sh --verbose displayName: 'install' - script: | + sudo apt-get install -y dkms sudo ./uninstall.sh --verbose displayName: 'uninstall' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/configure.sh new/xpadneo-0.9.7/configure.sh --- old/xpadneo-0.9.6/configure.sh 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/configure.sh 2024-12-23 14:28:19.000000000 +0100 @@ -14,7 +14,7 @@ : "${CONF_FILE:="/etc/modprobe.d/99-xpadneo-options.conf"}" # Use getopt NOT getopts to parse arguments. -OPTS=$(getopt -n "$NAME" -o h:m:r: -l help,version,trigger-rumble-mode:,rumble-attenuation: -- "$@") +OPTS=$(getopt -n "$NAME" -o h:m:r:n: -l help,version,trigger-rumble-mode:,rumble-attenuation:,ff_connect_notify: -- "$@") ## Print Help ## function display_help { @@ -41,6 +41,14 @@ exit 1 fi ;; + "ff_connect_notify") + if [[ "$value" -gt 2 ]] || [[ "$value" -lt 0 ]]; + then + echo "$NAME: $key: Invalid value! Value must be 0 or 1." + exit 1 + fi + ;; + *) # key not known, should not be possible exit 2 @@ -101,7 +109,7 @@ # If line doesn't exist echo all of the defaults. mkdir -p "$(dirname "${CONF_FILE}")" touch "${CONF_FILE}" - echo "options hid_xpadneo disable_deadzones=0 rumble_attenuation=0 trigger_rumble_mode=0" >> "$CONF_FILE" + echo "options hid_xpadneo disable_deadzones=0 rumble_attenuation=0 trigger_rumble_mode=0 ff_connect_notify=1" >> "$CONF_FILE" fi eval set -- "$OPTS" @@ -126,6 +134,13 @@ value="${2#*=}" set_param "$key" "$value" shift 2 + ;; + + -n | --ff_connect_notify) + key='ff_connect_notify' + value="${2#*=}" + set_param "$key" "$value" + shift 2 ;; --) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/docs/BT_DONGLES.md new/xpadneo-0.9.7/docs/BT_DONGLES.md --- old/xpadneo-0.9.6/docs/BT_DONGLES.md 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/docs/BT_DONGLES.md 2024-12-23 14:28:19.000000000 +0100 @@ -20,6 +20,7 @@ name jupiter short name ``` +If `btmgmt` command is not available, try `bluetoothctl mgmt.info` instead. ### Cambridge Silicon Radio @@ -59,6 +60,12 @@ * Re-Connection Problems * Reliable once connected * Reported by @NoXPhasma [here](https://github.com/atar-axis/xpadneo/issues/91#issuecomment-484815264) +* [TP-Link USB Bluetooth Adapter Bluetooth 4.0 (UB400)](https://www.amazon.com/gp/product/B07V1SZCY6) + * Chipset: CSR ??? + * `ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)` + * Performance: + * Connection is flawless + * Reported by @Arian8j2 [here](https://github.com/atar-axis/xpadneo/issues/389#issuecomment-1677012088) ### Broadcom @@ -93,3 +100,31 @@ * Status: bluetoothd logs "Request attribute has encountered an unlikely error" * Chipset: AX200 * Used as on-board chipset: ASUS B550-i + + +### Realtek + +Known bad firmware for RTL8761BU chipset is 0xdfc6d922. It causes frequent +reconnects. Firmware version can be found in the kernel log: +``` +$ sudo dmesg | grep 'RTL: fw version' +[ 21.193448] Bluetooth: hci0: RTL: fw version 0xdfc6d922 +``` + +* [TP-Link USB Bluetooth Adapter Bluetooth 5.0 (UB500)](https://www.amazon.com/gp/product/B09DMP6T22) + * Chipset: RTL8761BU + * `ID 2357:0604 TP-Link TP-Link UB500 Adapter` + * Performance: + * Disconnects after some random interval and reconnects + * When it's connected, it's good + * Reported by @Arian8j2 [here](https://github.com/atar-axis/xpadneo/issues/389#issuecomment-1677012088) +* [Simplecom NB409 Bluetooth 5.0 USB Wireless Dongle with A2DP EDR](https://www.mwave.com.au/product/simplecom-nb409-bluetooth-50-usb-wireless-dongle-with-a2dp-edr-ac38550) + * Chipset: RTL8761BU + * `ID 0bda:8771 Realtek Semiconductor Corp. Bluetooth Radio` + * Status: it works straight out of the box for a user on Manjaro KDE with kernel 5.15 and 6.1 + * Reported by @mscharley [here](https://github.com/atar-axis/xpadneo/issues/406) +* [UGREEN Bluetooth 5.0 USB Adapter (CM390)](https://www.amazon.com/gp/product/B08R8992YC/) + * Chipset: RTL8761BU + * `ID 0bda:8771 Realtek Semiconductor Corp. Bluetooth Radio` + * Performance: + * Connection flawless if good firmware is being used diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/docs/CONFIGURATION.md new/xpadneo-0.9.7/docs/CONFIGURATION.md --- old/xpadneo-0.9.6/docs/CONFIGURATION.md 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/docs/CONFIGURATION.md 2024-12-23 14:28:19.000000000 +0100 @@ -33,6 +33,10 @@ * `16` if your controller boots in Linux mode (auto-detected, do not change manually) * `32` if you prefer to use Nintendo button mappings (i.e., 8BitDo controllers, defaults to off) * `64` if your controller has a awkwardly mapped Share button (auto-detected, do not set manually) +* 'disable_shift_mode' (default 0) + * Let's you disable Xbox logo button shift behavior + * '0' Xbox logo button will be used as shift + * '1' will pass through the Xbox logo button as is Some settings may need to be changed at loading time of the module, take a look at the following example to see how that works: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/docs/README.md new/xpadneo-0.9.7/docs/README.md --- old/xpadneo-0.9.6/docs/README.md 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/docs/README.md 2024-12-23 14:28:19.000000000 +0100 @@ -4,7 +4,6 @@ Just leave a message if your donation is for a specific use (like a new hardware or a specific function). [](https://dev.azure.com/dollingerflorian/dollingerflorian/_build/latest?definitionId=1?branchName=master) -[](https://www.codacy.com/app/atar-axis/xpadneo?utm_source=github.com&utm_medium=referral&utm_content=atar-axis/xpadneo&utm_campaign=Badge_Grade) [](http://isitmaintained.com/project/atar-axis/xpadneo "Average time to resolve an issue") [](https://repology.org/project/xpadneo/versions) [](https://discord.gg/nCqfKa84KA) @@ -68,20 +67,17 @@ ## Advantages of this Driver * Supports Bluetooth -* Supports all Force Feedback/Rumble effects through Linux `ff-memless` effect emulation +* Supports most force feedback and all rumble effects through Linux `ff-memless` effect emulation * Supports [Trigger Force Feedback](https://www.youtube.com/watch?v=G4PHupKm2OQ) in every game by applying a pressure-dependent effect intensity to the current rumble effect (not even supported in Windows) -* Supports disabling FF -* Supports multiple Gamepads at the same time (not even supported in Windows) +* Supports adjusting rumble intensity including disabling rumble * Offers a consistent mapping, even if the Gamepad was paired to Windows/Xbox before, and independent of software layers (SDL2, Stadia via Chrome Gamepad API, etc) -* Working Select, Start, Mode buttons * Working paddles (buttons on the backside of the controller) -* Correct Axis Range (signed, important for e.g. RPCS3) -* Supports Battery Level Indication (including the Play 'n Charge Kit) +* Correct axis range (signed, important for e.g. RPCS3) +* Supports battery level indication (including the Play 'n Charge Kit)  -* Easy Installation -* Agile Support and Development +* Easy installation * Supports customization through profiles (work in progress) * Optional high-precision mode for Wine/Proton users * Share button support on supported controllers @@ -137,9 +133,10 @@ ### GuliKit KingKong Controller Family This driver supports the GuliKit King Kong controller family, the driver was tested with model NS09 (using firmware -v2.0) but should work just fine for the older models, too. If in doubt, follow the firmware upgrade guides on the -GuliKit home page to receive the latest firmware. Both the Android mode and the X-Input mode are supported but it may -depend on your Bluetooth stack which mode works better for you (Android mode didn't pair for me). +v2.0) and NS39 (aka KK3 MAX, firmware v3.6) but should work just fine for the older models, too. If in doubt, follow +the firmware upgrade guides on the GuliKit home page to receive the latest firmware. Both the Android mode and the +X-Input mode are supported but it may depend on your Bluetooth stack which mode works better for you (Android mode +didn't pair for me). This driver supports the Nintendo layout of those controllers to exposes them correctly as button A, B, X, and Y as labelled on the device. This is swapped compared to the original Xbox controller layout. However, this feature is @@ -175,6 +172,23 @@ This controller uses emulated profile switching support (see below). +### GameSir T4 Nova Lite Family + +This driver supports the GameSir T4 Nova Lite controller family, tested by the community. These models have a quirk of +only allowing rumble when all motor-enable bits are set and does not have trigger rumble motors. It looks like these +models are available with different MAC OUIs, so your particular controller may not be automatically detected. In this +case, manually add the quirk flags for your controller: + +``` +# /etc/modprobe.conf +options hid_xpadneo quirks=3E:42:6C:xx:xx:xx+6 +``` + +This controller uses emulated profile switching support (see below). + +This manufacturer uses random MAC addresses, so we cannot rely on known OUIs. Heuristics try to detect this controller. + + ## Profile Switching The driver supports switching between different profiles, either through emulation or by using the hardware @@ -202,6 +216,9 @@ - Full support will be available once the Xbox Elite Series 2 controller is fully supported. - If you hold the button for too long, the controller will turn off - we cannot prevent that. +**Important:** Emulated profile switching won't work if you disabled the shift-mode of the Xbox logo button (module +parameter `disable_shift_mode`). + ## Getting Started @@ -231,7 +248,7 @@ * On **Manjaro** try `sudo pacman -S dkms linux-latest-headers bluez bluez-utils` * On **openSUSE** (tested on Tumbleweed, should work for Leap), it is - `sudo zypper install dkms make bluez bluez-tools kernel-devel kernel-source` + `sudo zypper install dkms make bluez kernel-devel kernel-source` * On **OSMC** you will have to run the following commands ``sudo apt-get install dkms rbp2-headers-`uname -r` `` ``sudo ln -s "/usr/src/rbp2-headers-`uname -r`" "/lib/modules/`uname -r`/build"`` (as a [workaround](https://github.com/osmc/osmc/issues/471)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/docs/TROUBLESHOOTING.md new/xpadneo-0.9.7/docs/TROUBLESHOOTING.md --- old/xpadneo-0.9.6/docs/TROUBLESHOOTING.md 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/docs/TROUBLESHOOTING.md 2024-12-23 14:28:19.000000000 +0100 @@ -55,11 +55,51 @@ #### Incompatible Bluetooth Chipset -Some chipsets, e.g. the CSR 85xx, do have problems when you try to reconnect the Gamepad. +Some chipsets, e.g. the CSR 85xx or Intel AX200 (and variants like 3xxx), do have problems when you try to reconnect +the gamepad. Some chipsets may need additional driver firmware to work correctly. Try installing `linux-firmware` from your distribution. +See below, if this happens since a firmware upgrade of the controller. + + +#### Gamepad Connects and Immediately Disconnects since Firmware Upgrade + +After upgrading the controller firmware, it is essential to fully remove/forget the device from your Bluetooth device +list, then reboot to ensure a clean state, then re-pair the controller. + +Reference: + +* https://github.com/atar-axis/xpadneo/issues/439 + + +#### Gamepad Asks for a PIN During Pairing + +A user found that with genuine Xbox controllers, the fix is often to use an external USB dongle instead of the internal +chipset for pairing the controller (recommended to try first). + +If it still asks for a PIN, try `0000` to connect the controller. It should happen just once. + +Some third-party controllers and clones will still show the issue on later connects. The issue should be reported to +the Bluez project to fix it, we only provide a work-around here. + +To work around the issue, this solution was found. It may affect other devices and reduces security, use at your own +risk: + +```ini +# /etc/bluetooth/input.conf + +[General] +UserspaceHID=true +ClassicBondedOnly=false +LEAutoSecurity=false +``` + +Reference: + +* https://github.com/atar-axis/xpadneo/issues/262#issuecomment-1913918332 + ### Gamepad Is Connected but Did not Rumble diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/docs/config_help new/xpadneo-0.9.7/docs/config_help --- old/xpadneo-0.9.6/docs/config_help 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/docs/config_help 2024-12-23 14:28:19.000000000 +0100 @@ -13,6 +13,8 @@ -r, --rumble-attenuation Attenuate the strength of the trigger force feedback. [0 (none, full rumble) to 100 (max, no rumble)] +-n, --ff_connect_notify + Enable or disable connect notification. [0 (disabled), 1 (enabled)] NOTE: For more information on configuring xpadneo visit https://atar-axis.github.io/xpadneo/ Or the GitHub page: https://github.com/atar-axis/xpadneo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/docs/heuristics/gamesir-nova.md new/xpadneo-0.9.7/docs/heuristics/gamesir-nova.md --- old/xpadneo-0.9.6/docs/heuristics/gamesir-nova.md 1970-01-01 01:00:00.000000000 +0100 +++ new/xpadneo-0.9.7/docs/heuristics/gamesir-nova.md 2024-12-23 14:28:19.000000000 +0100 @@ -0,0 +1,31 @@ +# GameSir Nova OUIs + +Gamesir Nova uses random MAC OUIs. We collect them here to implement a +working heuristic matcher. + +We also collect OUIs here which should not match the heuristics because we +are seeing conflicts with some official vendors. + +Officially validated OUIs are marked with a "+". + +| OUI | Vendor | Bit representation | descriptor length +| ------------ | --------- | --------------------------------------- | ------------------- +| 3E:42:6C | GameSir | `0011 1110 : 0100 0010 : 0110 1100` | 283 +| ED:BC:9A | GameSir | `1110 1101 : 1011 1100 : 1001 1010` | 283 +| 6A:07:14 | GameSir | `0110 1010 : 0000 0111 : 0001 0100` | 283 +| **AND mask** | | **`0010 1000 : 0000 0000 : 0000 0000`** | **mask 0x28** +| 3C:FA:06 + | Microsoft | `0011 1100 : 1111 1010 : 0000 0110` | 283 inval match +| 44:16:22 + | Microsoft | `0100 0100 : 0001 0110 : 0010 0010` | +| 68:6C:E6 + | Microsoft | `0110 1000 : 0110 1100 : 1110 0110` | 283 inval match +| 98:7A:14 + | Microsoft | `1001 1000 : 0111 1010 : 0001 0100` | +| AC:8E:BD + | Microsoft | `1010 1100 : 1000 1110 : 1011 1101` | 283 inval match +| C8:3F:26 + | Microsoft | `1100 1000 : 0011 1111 : 0010 0110` | +| **AND mask** | | **`0000 0000 : 0000 0000 : 0000 0000`** | **mask 0x00** +| 98:B6:E9 + | Nintendo | `1001 1000 : 1011 0110 : 1110 1001` | +| **AND mask** | | **`0010 1000 : 1011 0110 : 1110 1001`** | **mask 0x98 B6 E9** +| 98:B6:E8 | GuliKit | `1001 1000 : 1011 0110 : 1110 1000` | +| 98:B6:EA | GuliKit | `1001 1000 : 1011 0110 : 1110 1010` | +| 98:B6:EC | GuliKit | `1001 1000 : 1011 0110 : 1110 1100` | +| **AND mask** | | **`0010 1000 : 1011 0110 : 1110 1000`** | **mask 0x98 B6 E8** +| E4:17:D8 + | 8BitDo | `1110 0100 : 0001 0111 : 1101 1000` | +| **AND mask** | | **`1110 0100 : 0001 0111 : 1101 1000`** | **mask 0xE4 17 D8** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/hid-xpadneo/dkms.conf.in new/xpadneo-0.9.7/hid-xpadneo/dkms.conf.in --- old/xpadneo-0.9.6/hid-xpadneo/dkms.conf.in 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/hid-xpadneo/dkms.conf.in 2024-12-23 14:28:19.000000000 +0100 @@ -1,11 +1,19 @@ +# vim:syntax=bash + PACKAGE_NAME="hid-xpadneo" PACKAGE_VERSION="@DO_NOT_CHANGE@" + BUILT_MODULE_NAME[0]="hid-xpadneo" BUILT_MODULE_LOCATION[0]="src" DEST_MODULE_LOCATION[0]="/kernel/drivers/hid" + +MAKE[0]="make -C '${kernel_source_dir}' M='${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/src' VERSION='${PACKAGE_VERSION}' modules" +CLEAN="make -C '${kernel_source_dir}' M='${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/src' clean" + +BUILD_EXCLUSIVE_KERNEL_MIN="4.18.0" BUILD_EXCLUSIVE_CONFIG="CONFIG_HID CONFIG_INPUT_FF_MEMLESS CONFIG_POWER_SUPPLY" -MAKE[0]="make -C $kernel_source_dir M=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build/src VERSION=$PACKAGE_VERSION modules" -CLEAN="make -C $kernel_source_dir M=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build/src clean" -AUTOINSTALL="Y" + +AUTOINSTALL="yes" + POST_INSTALL="dkms.post_install" POST_REMOVE="dkms.post_remove" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/hid-xpadneo/dkms.post_install new/xpadneo-0.9.7/hid-xpadneo/dkms.post_install --- old/xpadneo-0.9.6/hid-xpadneo/dkms.post_install 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/hid-xpadneo/dkms.post_install 2024-12-23 14:28:19.000000000 +0100 @@ -4,7 +4,7 @@ ERTM_OVERRIDE="/etc/modprobe.d/99-xpadneo-bluetooth.conf" DISABLE_ERTM="/sys/module/bluetooth/parameters/disable_ertm" -if [ `uname -r | awk -F. '{ printf "%03d%03d",$1,$2 }'` -ge 005012 ]; then +if [ "$(uname -r | awk -F. '{ printf "%03d%03d",$1,$2 }')" -ge 005012 ]; then echo "Not disabling ERTM, kernel version doesn't require it..." elif [ "$(readlink "${ERTM_OVERRIDE}" 2>/dev/null)" = "/dev/null" ]; then echo "Not disabling ERTM, local override in place..." @@ -26,8 +26,8 @@ install -D -m 0644 -t /etc/modprobe.d etc-modprobe.d/xpadneo.conf echo "Installing udev rules..." -install -D -m 0644 -t /etc/udev/rules.d etc-udev-rules.d/50-xpadneo-fixup-steamlink.rules install -D -m 0644 -t /etc/udev/rules.d etc-udev-rules.d/60-xpadneo.rules +install -D -m 0644 -t /etc/udev/rules.d etc-udev-rules.d/70-xpadneo-disable-hidraw.rules echo "Reloading udev..." udevadm control --reload diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/hid-xpadneo/dkms.post_remove new/xpadneo-0.9.7/hid-xpadneo/dkms.post_remove --- old/xpadneo-0.9.6/hid-xpadneo/dkms.post_remove 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/hid-xpadneo/dkms.post_remove 2024-12-23 14:28:19.000000000 +0100 @@ -9,8 +9,8 @@ rm -f /etc/modprobe.d/xpadneo.conf echo "Uninstalling udev rules..." +rm -f /etc/udev/rules.d/70-xpadneo-disable-hidraw.rules rm -f /etc/udev/rules.d/60-xpadneo.rules -rm -f /etc/udev/rules.d/50-xpadneo-fixup-steamlink.rules echo "Reloading udev..." udevadm control --reload diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/hid-xpadneo/etc-udev-rules.d/50-xpadneo-fixup-steamlink.rules new/xpadneo-0.9.7/hid-xpadneo/etc-udev-rules.d/50-xpadneo-fixup-steamlink.rules --- old/xpadneo-0.9.6/hid-xpadneo/etc-udev-rules.d/50-xpadneo-fixup-steamlink.rules 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/hid-xpadneo/etc-udev-rules.d/50-xpadneo-fixup-steamlink.rules 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -#FIXME(issue-291) Work around Steamlink not properly detecting the mappings -ACTION=="add|change", DRIVERS=="xpadneo", SUBSYSTEM=="hidraw", MODE:="0000" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/hid-xpadneo/etc-udev-rules.d/70-xpadneo-disable-hidraw.rules new/xpadneo-0.9.7/hid-xpadneo/etc-udev-rules.d/70-xpadneo-disable-hidraw.rules --- old/xpadneo-0.9.6/hid-xpadneo/etc-udev-rules.d/70-xpadneo-disable-hidraw.rules 1970-01-01 01:00:00.000000000 +0100 +++ new/xpadneo-0.9.7/hid-xpadneo/etc-udev-rules.d/70-xpadneo-disable-hidraw.rules 2024-12-23 14:28:19.000000000 +0100 @@ -0,0 +1,3 @@ +#FIXME(issue-291) Work around Steamlink not properly detecting the mappings +#FIXME(issue-457) Word around QMK overriding our hidraw rules +ACTION=="add|change", DRIVERS=="xpadneo", SUBSYSTEM=="hidraw", MODE:="0000", TAG-="uaccess" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/hid-xpadneo/src/hid-xpadneo.c new/xpadneo-0.9.7/hid-xpadneo/src/hid-xpadneo.c --- old/xpadneo-0.9.6/hid-xpadneo/src/hid-xpadneo.c 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/hid-xpadneo/src/hid-xpadneo.c 2024-12-23 14:28:19.000000000 +0100 @@ -10,6 +10,7 @@ #include <linux/delay.h> #include <linux/module.h> +#include <linux/version.h> #include "xpadneo.h" @@ -47,6 +48,16 @@ "(bool) Disable dead zone handling for raw processing by Wine/Proton, confuses joydev. " "0: disable, 1: enable."); +static bool param_disable_shift_mode = 0; +module_param_named(disable_shift_mode, param_disable_shift_mode, bool, 0644); +MODULE_PARM_DESC(disable_shift_mode, + "(bool) Disable use Xbox logo button as shift. Will prohibit profile switching when enabled. " + "0: disable, 1: enable."); + +static bool param_debug_hid = 0; +module_param_named(debug_hid, param_debug_hid, bool, 0644); +MODULE_PARM_DESC(debug_hid, "(u8) Debug HID reports. 0: disable, 1: enable."); + static struct { char *args[17]; unsigned int nargs; @@ -62,7 +73,9 @@ ", use Linux button mappings = " __stringify(XPADNEO_QUIRK_LINUX_BUTTONS) ", use Nintendo mappings = " __stringify(XPADNEO_QUIRK_NINTENDO) ", use Share button mappings = " __stringify(XPADNEO_QUIRK_SHARE_BUTTON) - ", reversed motor masking = " __stringify(XPADNEO_QUIRK_REVERSE_MASK)); + ", reversed motor masking = " __stringify(XPADNEO_QUIRK_REVERSE_MASK) + ", swapped motor masking = " __stringify(XPADNEO_QUIRK_SWAPPED_MASK) + ", apply no heuristics = " __stringify(XPADNEO_QUIRK_NO_HEURISTICS)); static DEFINE_IDA(xpadneo_device_id_allocator); @@ -88,14 +101,16 @@ }; static const struct quirk xpadneo_quirks[] = { + DEVICE_OUI_QUIRK("3C:FA:06", XPADNEO_QUIRK_NO_HEURISTICS), + DEVICE_OUI_QUIRK("68:6C:E6", XPADNEO_QUIRK_NO_HEURISTICS), DEVICE_OUI_QUIRK("98:B6:EA", XPADNEO_QUIRK_NO_PULSE | XPADNEO_QUIRK_NO_TRIGGER_RUMBLE | XPADNEO_QUIRK_REVERSE_MASK), - DEVICE_OUI_QUIRK("E4:17:D8", - XPADNEO_QUIRK_NO_PULSE | XPADNEO_QUIRK_NO_TRIGGER_RUMBLE | - XPADNEO_QUIRK_NO_MOTOR_MASK | XPADNEO_QUIRK_NINTENDO), - DEVICE_OUI_QUIRK("A0:5A:5D", - XPADNEO_QUIRK_NO_PULSE | XPADNEO_QUIRK_NO_MOTOR_MASK), + DEVICE_OUI_QUIRK("98:B6:EC", + XPADNEO_QUIRK_SIMPLE_CLONE | XPADNEO_QUIRK_SWAPPED_MASK), + DEVICE_OUI_QUIRK("A0:5A:5D", XPADNEO_QUIRK_NO_HAPTICS), + DEVICE_OUI_QUIRK("AC:8E:BD", XPADNEO_QUIRK_NO_HEURISTICS), + DEVICE_OUI_QUIRK("E4:17:D8", XPADNEO_QUIRK_SIMPLE_CLONE | XPADNEO_QUIRK_NINTENDO), }; struct usage_map { @@ -183,6 +198,40 @@ static struct workqueue_struct *xpadneo_rumble_wq; +static int xpadneo_output_report(struct hid_device *hdev, __u8 *buf, size_t len) +{ + struct ff_report *r = (struct ff_report *)buf; + + if (unlikely(param_debug_hid && (len > 0))) { + switch (buf[0]) { + case 0x03: + if (len >= sizeof(*r)) { + hid_info(hdev, + "HID debug: len %ld rumble cmd 0x%02x " + "motors left %d right %d strong %d weak %d " + "magnitude left %d right %d strong %d weak %d " + "pulse sustain %dms release %dms loop %d\n", + len, r->report_id, + !!(r->ff.enable & FF_RUMBLE_LEFT), + !!(r->ff.enable & FF_RUMBLE_RIGHT), + !!(r->ff.enable & FF_RUMBLE_STRONG), + !!(r->ff.enable & FF_RUMBLE_WEAK), + r->ff.magnitude_left, r->ff.magnitude_right, + r->ff.magnitude_strong, r->ff.magnitude_weak, + r->ff.pulse_sustain_10ms * 10, + r->ff.pulse_release_10ms * 10, r->ff.loop_count); + } else { + hid_info(hdev, "HID debug: len %ld malformed cmd 0x%02x\n", len, + buf[0]); + } + break; + default: + hid_info(hdev, "HID debug: len %ld unhandled cmd 0x%02x\n", len, buf[0]); + } + } + return hid_hw_output_report(hdev, buf, len); +} + static void xpadneo_ff_worker(struct work_struct *work) { struct xpadneo_devdata *xdata = @@ -263,15 +312,19 @@ spin_unlock_irqrestore(&xdata->ff_lock, flags); - /* do not send these bits if not supported */ + /* set all bits if not supported (some clones require these set) */ if (unlikely(xdata->quirks & XPADNEO_QUIRK_NO_MOTOR_MASK)) - r->ff.enable = 0; + r->ff.enable = FF_RUMBLE_ALL; /* reverse the bits for trigger and main motors */ if (unlikely(xdata->quirks & XPADNEO_QUIRK_REVERSE_MASK)) r->ff.enable = SWAP_BITS(SWAP_BITS(r->ff.enable, 1, 2), 0, 3); - ret = hid_hw_output_report(hdev, (__u8 *) r, sizeof(*r)); + /* swap the bits of trigger and main motors */ + if (unlikely(xdata->quirks & XPADNEO_QUIRK_SWAPPED_MASK)) + r->ff.enable = SWAP_BITS(SWAP_BITS(r->ff.enable, 0, 2), 1, 3); + + ret = xpadneo_output_report(hdev, (__u8 *) r, sizeof(*r)); if (ret < 0) hid_warn(hdev, "failed to send FF report: %d\n", ret); } @@ -428,89 +481,108 @@ return 0; } -static void xpadneo_welcome_rumble(struct hid_device *hdev) +static void xpadneo_test_rumble(char *which, struct xpadneo_devdata *xdata, struct ff_report pck) { - struct xpadneo_devdata *xdata = hid_get_drvdata(hdev); - struct ff_report ff_pck; - u8 save, lsave, rsave; + enum xpadneo_rumble_motors enabled = pck.ff.enable; - memset(&ff_pck.ff, 0, sizeof(ff_pck.ff)); + hid_info(xdata->hdev, "testing %s: sustain %dms release %dms loop %d wait 30ms\n", which, + pck.ff.pulse_sustain_10ms * 10, pck.ff.pulse_release_10ms * 10, pck.ff.loop_count); - ff_pck.report_id = XPADNEO_XB1S_FF_REPORT; - if ((xdata->quirks & XPADNEO_QUIRK_NO_MOTOR_MASK) == 0) { - ff_pck.ff.magnitude_weak = 40; - ff_pck.ff.magnitude_strong = 20; - ff_pck.ff.magnitude_right = 10; - ff_pck.ff.magnitude_left = 10; + /* + * XPADNEO_QUIRK_NO_MOTOR_MASK: + * The controller does not support motor masking so we set all bits, and set the magnitude to 0 instead. + */ + if (xdata->quirks & XPADNEO_QUIRK_NO_MOTOR_MASK) { + pck.ff.enable = FF_RUMBLE_ALL; + if (!(enabled & FF_RUMBLE_WEAK)) + pck.ff.magnitude_weak = 0; + if (!(enabled & FF_RUMBLE_STRONG)) + pck.ff.magnitude_strong = 0; + if (!(enabled & FF_RUMBLE_RIGHT)) + pck.ff.magnitude_right = 0; + if (!(enabled & FF_RUMBLE_LEFT)) + pck.ff.magnitude_left = 0; } - if ((xdata->quirks & XPADNEO_QUIRK_NO_PULSE) == 0) { - ff_pck.ff.pulse_sustain_10ms = 5; - ff_pck.ff.pulse_release_10ms = 5; - ff_pck.ff.loop_count = 3; - } + /* + * XPADNEO_QUIRK_NO_TRIGGER_RUMBLE: + * The controller does not support trigger rumble, so filter for the main motors only if we enabled all + * before. + */ + if (xdata->quirks & XPADNEO_QUIRK_NO_TRIGGER_RUMBLE) + pck.ff.enable &= FF_RUMBLE_MAIN; /* - * TODO Think about a way of dry'ing the following blocks in a way - * that doesn't compromise the testing nature of this + * XPADNEO_QUIRK_REVERSE_MASK: + * The controller firmware reverses the order of the motor masking bits, so we swap the bits to reverse it. */ + if (xdata->quirks & XPADNEO_QUIRK_REVERSE_MASK) + pck.ff.enable = SWAP_BITS(SWAP_BITS(pck.ff.enable, 1, 2), 0, 3); - save = ff_pck.ff.magnitude_weak; - if (xdata->quirks & XPADNEO_QUIRK_NO_MOTOR_MASK) - ff_pck.ff.magnitude_weak = 40; - else if (xdata->quirks & XPADNEO_QUIRK_REVERSE_MASK) - ff_pck.ff.enable = FF_RUMBLE_LEFT; - else - ff_pck.ff.enable = FF_RUMBLE_WEAK; - hid_hw_output_report(hdev, (u8 *)&ff_pck, sizeof(ff_pck)); + /* + * XPADNEO_QUIRK_SWAPPED_MASK: + * The controller firmware swaps the bit masks for the trigger motors with those for the main motors. + */ + if (xdata->quirks & XPADNEO_QUIRK_SWAPPED_MASK) + pck.ff.enable = SWAP_BITS(SWAP_BITS(pck.ff.enable, 0, 2), 1, 3); + + xpadneo_output_report(xdata->hdev, (u8 *)&pck, sizeof(pck)); mdelay(300); + + /* + * XPADNEO_QUIRK_NO_PULSE: + * The controller doesn't support timing parameters of the rumble command, so we manually stop the motors. + */ if (xdata->quirks & XPADNEO_QUIRK_NO_PULSE) { - ff_pck.ff.magnitude_weak = 0; - hid_hw_output_report(hdev, (u8 *)&ff_pck, sizeof(ff_pck)); - ff_pck.ff.magnitude_weak = save; + if (enabled & FF_RUMBLE_WEAK) + pck.ff.magnitude_weak = 0; + if (enabled & FF_RUMBLE_STRONG) + pck.ff.magnitude_strong = 0; + if (enabled & FF_RUMBLE_RIGHT) + pck.ff.magnitude_right = 0; + if (enabled & FF_RUMBLE_LEFT) + pck.ff.magnitude_left = 0; + xpadneo_output_report(xdata->hdev, (u8 *)&pck, sizeof(pck)); } - ff_pck.ff.enable = 0; mdelay(30); +} - save = ff_pck.ff.magnitude_strong; - if (xdata->quirks & XPADNEO_QUIRK_NO_MOTOR_MASK) - ff_pck.ff.magnitude_strong = 20; - else if (xdata->quirks & XPADNEO_QUIRK_REVERSE_MASK) - ff_pck.ff.enable = FF_RUMBLE_RIGHT; - else - ff_pck.ff.enable = FF_RUMBLE_STRONG; - hid_hw_output_report(hdev, (u8 *)&ff_pck, sizeof(ff_pck)); - mdelay(300); - if (xdata->quirks & XPADNEO_QUIRK_NO_PULSE) { - ff_pck.ff.magnitude_strong = 0; - hid_hw_output_report(hdev, (u8 *)&ff_pck, sizeof(ff_pck)); - ff_pck.ff.magnitude_strong = save; +static void xpadneo_welcome_rumble(struct hid_device *hdev) +{ + struct xpadneo_devdata *xdata = hid_get_drvdata(hdev); + struct ff_report ff_pck = { }; + + ff_pck.report_id = XPADNEO_XB1S_FF_REPORT; + + /* + * Initialize the motor magnitudes here, the test command will individually zero masked magnitudes if + * needed. + */ + ff_pck.ff.magnitude_weak = 40; + ff_pck.ff.magnitude_strong = 20; + ff_pck.ff.magnitude_right = 10; + ff_pck.ff.magnitude_left = 10; + + /* + * XPADNEO_QUIRK_NO_PULSE: + * If the controller doesn't support timing parameters of the rumble command, don't set them. Otherwise we + * may miss controllers that actually do support the parameters. + */ + if (!(xdata->quirks & XPADNEO_QUIRK_NO_PULSE)) { + ff_pck.ff.pulse_sustain_10ms = 5; + ff_pck.ff.pulse_release_10ms = 5; + ff_pck.ff.loop_count = 2; } - ff_pck.ff.enable = 0; - mdelay(30); - lsave = ff_pck.ff.magnitude_left; - rsave = ff_pck.ff.magnitude_right; - if ((xdata->quirks & XPADNEO_QUIRK_NO_TRIGGER_RUMBLE) == 0) { - if (xdata->quirks & XPADNEO_QUIRK_NO_MOTOR_MASK) { - ff_pck.ff.magnitude_left = 10; - ff_pck.ff.magnitude_right = 10; - } else if (xdata->quirks & XPADNEO_QUIRK_REVERSE_MASK) { - ff_pck.ff.enable = FF_RUMBLE_MAIN; - } else { - ff_pck.ff.enable = FF_RUMBLE_TRIGGERS; - } - hid_hw_output_report(hdev, (u8 *)&ff_pck, sizeof(ff_pck)); - mdelay(300); - if (xdata->quirks & XPADNEO_QUIRK_NO_PULSE) { - ff_pck.ff.magnitude_left = 0; - ff_pck.ff.magnitude_right = 0; - hid_hw_output_report(hdev, (u8 *)&ff_pck, sizeof(ff_pck)); - ff_pck.ff.magnitude_left = lsave; - ff_pck.ff.magnitude_right = rsave; - } - ff_pck.ff.enable = 0; - mdelay(30); + ff_pck.ff.enable = FF_RUMBLE_WEAK; + xpadneo_test_rumble("weak motor", xdata, ff_pck); + + ff_pck.ff.enable = FF_RUMBLE_STRONG; + xpadneo_test_rumble("strong motor", xdata, ff_pck); + + if (!(xdata->quirks & XPADNEO_QUIRK_NO_TRIGGER_RUMBLE)) { + ff_pck.ff.enable = FF_RUMBLE_TRIGGERS; + xpadneo_test_rumble("trigger motors", xdata, ff_pck); } } @@ -712,7 +784,11 @@ return MAP_AUTO; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,12,0) static u8 *xpadneo_report_fixup(struct hid_device *hdev, u8 *rdesc, unsigned int *rsize) +#else +static const __u8 *xpadneo_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) +#endif { struct xpadneo_devdata *xdata = hid_get_drvdata(hdev); @@ -938,10 +1014,10 @@ if ((usage->type == EV_KEY) && (usage->code == BTN_PADDLES(0))) { if (xdata->profile == 0) { /* report the paddles individually */ - input_report_key(idev, BTN_PADDLES(0), value & 1 ? 1 : 0); - input_report_key(idev, BTN_PADDLES(1), value & 2 ? 1 : 0); - input_report_key(idev, BTN_PADDLES(2), value & 4 ? 1 : 0); - input_report_key(idev, BTN_PADDLES(3), value & 8 ? 1 : 0); + input_report_key(idev, BTN_PADDLES(0), (value & 1) ? 1 : 0); + input_report_key(idev, BTN_PADDLES(1), (value & 2) ? 1 : 0); + input_report_key(idev, BTN_PADDLES(2), (value & 4) ? 1 : 0); + input_report_key(idev, BTN_PADDLES(3), (value & 8) ? 1 : 0); } goto stop_processing; } else if (usage->type == EV_ABS) { @@ -964,7 +1040,8 @@ xdata->last_abs_rz = value; goto combine_z_axes; } - } else if ((usage->type == EV_KEY) && (usage->code == BTN_XBOX)) { + } else if (!param_disable_shift_mode && (usage->type == EV_KEY) + && (usage->code == BTN_XBOX)) { /* * Handle the Xbox logo button: We want to cache the button * down event to allow for profile switching. The button will @@ -1028,6 +1105,8 @@ static int xpadneo_init_hw(struct hid_device *hdev) { int i, ret; + u8 oui_byte; + char oui[3] = { }; struct xpadneo_devdata *xdata = hid_get_drvdata(hdev); xdata->battery.name = @@ -1075,6 +1154,21 @@ } kernel_param_unlock(THIS_MODULE); + /* + * copy the first two characters from the uniq ID (MAC address) and + * expect it being too big to copy, then `kstrtou8()` converts the + * uniq ID "aa:bb:cc:dd:ee:ff" to u8, so we get the first OUI byte + */ + if ((xdata->original_rsize == 283) + && ((xdata->quirks & XPADNEO_QUIRK_NO_HEURISTICS) == 0) + && ((xdata->quirks & XPADNEO_QUIRK_SIMPLE_CLONE) == 0) + && (strscpy(oui, xdata->idev->uniq, sizeof(oui)) == -E2BIG) + && (kstrtou8(oui, 16, &oui_byte) == 0) + && XPADNEO_OUI_MASK(oui_byte, XPADNEO_OUI_MASK_GAMESIR_NOVA)) { + hid_info(hdev, "enabling heuristic GameSir Nova quirks\n"); + xdata->quirks |= XPADNEO_QUIRK_SIMPLE_CLONE; + } + if (xdata->quirks > 0) hid_info(hdev, "controller quirks: 0x%08x\n", xdata->quirks); @@ -1235,8 +1329,8 @@ static const struct hid_device_id xpadneo_devices[] = { /* XBOX ONE S / X */ - { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, 0x02FD) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, 0x02E0) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, 0x02FD) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, 0x0B20), .driver_data = XPADNEO_QUIRK_SHARE_BUTTON }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/hid-xpadneo/src/xpadneo.h new/xpadneo-0.9.7/hid-xpadneo/src/xpadneo.h --- old/xpadneo-0.9.6/hid-xpadneo/src/xpadneo.h 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/hid-xpadneo/src/xpadneo.h 2024-12-23 14:28:19.000000000 +0100 @@ -52,6 +52,15 @@ #define XPADNEO_QUIRK_NINTENDO 32 #define XPADNEO_QUIRK_SHARE_BUTTON 64 #define XPADNEO_QUIRK_REVERSE_MASK 128 +#define XPADNEO_QUIRK_SWAPPED_MASK 256 +#define XPADNEO_QUIRK_NO_HEURISTICS 512 + +#define XPADNEO_QUIRK_NO_HAPTICS (XPADNEO_QUIRK_NO_PULSE|XPADNEO_QUIRK_NO_MOTOR_MASK) +#define XPADNEO_QUIRK_SIMPLE_CLONE (XPADNEO_QUIRK_NO_HAPTICS|XPADNEO_QUIRK_NO_TRIGGER_RUMBLE) + +/* MAC OUI masks */ +#define XPADNEO_OUI_MASK(oui,mask) (((oui)&(mask))==(mask)) +#define XPADNEO_OUI_MASK_GAMESIR_NOVA 0x28 /* timing of rumble commands to work around firmware crashes */ #define XPADNEO_RUMBLE_THROTTLE_DELAY msecs_to_jiffies(50) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/install.sh new/xpadneo-0.9.7/install.sh --- old/xpadneo-0.9.6/install.sh 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/install.sh 2024-12-23 14:28:19.000000000 +0100 @@ -1,6 +1,8 @@ -#!/bin/bash -e +#!/bin/bash -cd "$(dirname "$0")" || exit 1 +set -e + +cd "$(dirname "$0")" source "lib/verbose.sh" source "lib/installer.sh" @@ -12,8 +14,6 @@ if [[ -z "${INSTALLED[*]}" ]]; then - set -e - echo "* creating dkms.conf" sed 's/"@DO_NOT_CHANGE@"/"'"${VERSION}"'"/g' <hid-xpadneo/dkms.conf.in >hid-xpadneo/dkms.conf diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/lib/installer.sh new/xpadneo-0.9.7/lib/installer.sh --- old/xpadneo-0.9.6/lib/installer.sh 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/lib/installer.sh 2024-12-23 14:28:19.000000000 +0100 @@ -31,7 +31,7 @@ : ${DKMS_BIN:?Please install dkms to continue} get_dkms_versions_installed() { - ${DKMS_BIN} status | tr -s ':,/ ' ' ' | awk -- '$1 == "hid-xpadneo" { print $2 }' | sort -nu + ${DKMS_BIN} status 2>/dev/null | tr -s ':,/ ' ' ' | awk -- '$1 == "hid-xpadneo" { print $2 }' | sort -nu } get_upstream_version_latest() { @@ -49,6 +49,4 @@ } # shellcheck disable=SC2034 -INSTALLED=( - $(get_dkms_versions_installed) -) +mapfile -t INSTALLED < <(get_dkms_versions_installed) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/misc/examples/c_hidraw/Makefile new/xpadneo-0.9.7/misc/examples/c_hidraw/Makefile --- old/xpadneo-0.9.6/misc/examples/c_hidraw/Makefile 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/misc/examples/c_hidraw/Makefile 2024-12-23 14:28:19.000000000 +0100 @@ -1,4 +1,21 @@ -CFLAGS = $(shell pkg-config ncurses --cflags) -LDFLAGS = $(shell pkg-config ncurses --libs) +PROGRAM = hidraw -all: hidraw +CFLAGS += $(shell pkg-config ncurses --cflags) +LDFLAGS += $(shell pkg-config ncurses --libs) + +SRC = hidraw.c + +OBJ = $(SRC:.c=.o) + +.PHONY: all clean + +all: $(PROGRAM) + +$(PROGRAM): $(OBJ) + $(CC) $< $(LDFLAGS) -o $@ + +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -f $(PROGRAM) $(OBJ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/uninstall.sh new/xpadneo-0.9.7/uninstall.sh --- old/xpadneo-0.9.6/uninstall.sh 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/uninstall.sh 2024-12-23 14:28:19.000000000 +0100 @@ -1,6 +1,8 @@ #!/bin/bash -cd "$(dirname "$0")" || exit 1 +set -e + +cd "$(dirname "$0")" source "lib/verbose.sh" source "lib/installer.sh" @@ -10,15 +12,13 @@ echo "* looking for registered instances" echo "found ${#INSTALLED[@]} registered instance(s) on your system" -for instance in "${INSTALLED[@]}" -do - echo "* $instance" - - set -e +# NOTE: overrides VERSION from lib/installer.sh but we don't need it +for VERSION in "${INSTALLED[@]}"; do + echo "* ${VERSION}" - echo " * uninstalling and removing $instance from DKMS" - dkms remove "${V[*]}" "hid-xpadneo/${instance}" --all + echo " * uninstalling and removing ${VERSION}" + dkms remove "${V[*]}" "hid-xpadneo/${VERSION}" --all - echo " * removing $instance folder from /usr/src" - rm --recursive "${V[@]}" "/usr/src/hid-xpadneo-$instance/" + echo " * removing ${VERSION} folder from /usr/src" + rm --recursive "${V[@]}" "/usr/src/hid-xpadneo-${VERSION}/" done diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xpadneo-0.9.6/update.sh new/xpadneo-0.9.7/update.sh --- old/xpadneo-0.9.6/update.sh 2024-02-13 00:11:06.000000000 +0100 +++ new/xpadneo-0.9.7/update.sh 2024-12-23 14:28:19.000000000 +0100 @@ -1,6 +1,8 @@ #!/bin/bash -cd "$(dirname "$0")" || exit 1 +set -e + +cd "$(dirname "$0")" source "lib/installer.sh" LATEST=$(get_upstream_version_latest)
