Nano receivers were unsupported on kernel 3.2; fixes #88

This commit is contained in:
Daniel Pavel 2013-07-18 14:01:36 +02:00
parent dd2a18d60e
commit a8c5d3bc24
2 changed files with 22 additions and 12 deletions

View File

@ -94,8 +94,12 @@ def _match(action, device, vendor_id=None, product_id=None, interface_number=Non
if not hid_device:
return
hid_driver_name = hid_device['DRIVER']
if hid_driver is not None and hid_driver != hid_driver_name:
return
if hid_driver:
if isinstance(hid_driver, tuple):
if hid_driver_name not in hid_driver:
return
elif hid_driver_name != hid_driver:
return
intf_device = device.find_parent('usb', 'usb_interface')
# print ("*** usb interface", action, device, "usb_interface:", intf_device)

View File

@ -23,23 +23,29 @@
from __future__ import absolute_import, division, print_function, unicode_literals
_UNIFYING_DRIVER = 'logitech-djreceiver'
_GENERIC_DRIVER = ('hid-generic', 'generic-usb')
# each tuple contains (vendor_id, product_id, usb interface number, hid driver)
# standard Unifying receivers (marked with the orange Unifying logo)
UNIFYING_RECEIVER = (0x046d, 0xc52b, 2, 'logitech-djreceiver')
UNIFYING_RECEIVER_2 = (0x046d, 0xc532, 2, 'logitech-djreceiver')
UNIFYING_RECEIVER = (0x046d, 0xc52b, 2, _UNIFYING_DRIVER)
UNIFYING_RECEIVER_2 = (0x046d, 0xc532, 2, _UNIFYING_DRIVER)
# Nano receviers that support the Unifying protocol
NANO_RECEIVER_ADVANCED = (0x046d, 0xc52f, 1, 'hid-generic')
NANO_RECEIVER_ADVANCED = (0x046d, 0xc52f, 1, _GENERIC_DRIVER)
# Nano receivers that don't support the Unifying protocol
NANO_RECEIVER_C517 = (0x046d, 0xc517, 1, 'hid-generic')
NANO_RECEIVER_C518 = (0x046d, 0xc518, 1, 'hid-generic')
NANO_RECEIVER_C51A = (0x046d, 0xc51a, 1, 'hid-generic')
NANO_RECEIVER_C51B = (0x046d, 0xc51b, 1, 'hid-generic')
NANO_RECEIVER_C521 = (0x046d, 0xc521, 1, 'hid-generic')
NANO_RECEIVER_C525 = (0x046d, 0xc525, 1, 'hid-generic')
NANO_RECEIVER_C526 = (0x046d, 0xc526, 1, 'hid-generic')
NANO_RECEIVER_C517 = (0x046d, 0xc517, 1, _GENERIC_DRIVER)
NANO_RECEIVER_C518 = (0x046d, 0xc518, 1, _GENERIC_DRIVER)
NANO_RECEIVER_C51A = (0x046d, 0xc51a, 1, _GENERIC_DRIVER)
NANO_RECEIVER_C51B = (0x046d, 0xc51b, 1, _GENERIC_DRIVER)
NANO_RECEIVER_C521 = (0x046d, 0xc521, 1, _GENERIC_DRIVER)
NANO_RECEIVER_C525 = (0x046d, 0xc525, 1, _GENERIC_DRIVER)
NANO_RECEIVER_C526 = (0x046d, 0xc526, 1, _GENERIC_DRIVER)