Skip to content

Commit

Permalink
Add support for Logitech Unifying devices
Browse files Browse the repository at this point in the history
If you do not have Unifying hardware you can emulate writing firmware using:

$ fu-unifying-tool write file.hex -v --emulate=bootloader-nordic
  • Loading branch information
hughsie committed Dec 12, 2016
1 parent 31bfba3 commit 864363e
Show file tree
Hide file tree
Showing 17 changed files with 2,741 additions and 1 deletion.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ plugins/steelseries/Makefile
plugins/test/Makefile
plugins/udev/Makefile
plugins/uefi/Makefile
plugins/unifying/Makefile
plugins/usb/Makefile
])
AC_OUTPUT
Expand Down
1 change: 1 addition & 0 deletions contrib/fwupd.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ make check VERBOSE=1
%{_libdir}/fwupd-plugins-2/libfu_plugin_test.so
%{_libdir}/fwupd-plugins-2/libfu_plugin_udev.so
%{_libdir}/fwupd-plugins-2/libfu_plugin_uefi.so
%{_libdir}/fwupd-plugins-2/libfu_plugin_unifying.so
%{_libdir}/fwupd-plugins-2/libfu_plugin_usb.so
%ghost %{_localstatedir}/lib/fwupd/gnupg

Expand Down
2 changes: 1 addition & 1 deletion plugins/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SUBDIRS = dfu ebitdo raspberrypi steelseries test udev usb
SUBDIRS = dfu ebitdo raspberrypi steelseries test udev unifying usb

if HAVE_DELL
SUBDIRS += dell
Expand Down
40 changes: 40 additions & 0 deletions plugins/unifying/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
AM_CPPFLAGS = \
$(APPSTREAM_GLIB_CFLAGS) \
$(GUSB_CFLAGS) \
$(GLIB_CFLAGS) \
-I$(top_srcdir) \
-I$(top_srcdir)/libfwupd \
-I$(top_srcdir)/src

plugindir = $(libdir)/fwupd-plugins-2
plugin_LTLIBRARIES = libfu_plugin_unifying.la

libfu_plugin_unifying_la_SOURCES = \
fu-plugin-unifying.c \
unifying-dongle.c \
unifying-dongle.h
libfu_plugin_unifying_la_LIBADD = $(GUSB_LIBS)
libfu_plugin_unifying_la_LDFLAGS = -module -avoid-version
libfu_plugin_unifying_la_CFLAGS = $(WARN_CFLAGS) \
-DG_LOG_DOMAIN=\"FuPluginDfu\"

EXTRA_DIST = README.md

noinst_PROGRAMS = \
unifying-tool

unifying_tool_SOURCES = \
unifying-dongle.c \
unifying-dongle.h \
unifying-tool.c

unifying_tool_LDADD = \
$(lib_LTLIBRARIES) \
$(APPSTREAM_GLIB_LIBS) \
$(GLIB_LIBS) \
$(GUSB_LIBS) \
$(LIBM)

unifying_tool_CFLAGS = $(AM_CFLAGS) $(WARN_CFLAGS)

-include $(top_srcdir)/git.mk
31 changes: 31 additions & 0 deletions plugins/unifying/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Unifying Support
================

Introduction
------------

This plugin can flash the firmware on Logitech Unifying dongles, both the
Nordic (U0007) device and the Texas Instruments (U0008) version.

This plugin will not work with the different "Nano" dongle (U0010) as it does
not use the Unifying protocol.

The bootloader protocol infomation was taken from the Mousejack[1] project,
specifically logitech-usb-restore.py and unifying.py.

Additional constants were taken from the Solaar[2] project.

Verification
------------

If you do not have Unifying hardware you can emulate writing firmware using:

fu-unifying-tool write file.hex -v --emulate=bootloader-nordic

This can also be used to produce protocol data to the command line to compare
against USB dumps. This plugin should interact with the hardware exactly like
the Logitech-provided flashing tool, although only a few devices have been
tested.

[1] https://www.mousejack.com/
[2] https://pwr.github.io/Solaar/
Binary file added plugins/unifying/data/dump.csv.gz
Binary file not shown.
Binary file added plugins/unifying/data/dump.tdc
Binary file not shown.
56 changes: 56 additions & 0 deletions plugins/unifying/data/lsusb-U0007-bootloader.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Bus 001 Device 036: ID 046d:aaaa Logitech, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 32
idVendor 0x046d Logitech, Inc.
idProduct 0xaaaa
bcdDevice 1.02
iManufacturer 1
iProduct 2
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 34
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 4
bmAttributes 0x80
(Bus Powered)
MaxPower 98mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 25
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0020 1x 32 bytes
bInterval 1
118 changes: 118 additions & 0 deletions plugins/unifying/data/lsusb-U0007.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
Bus 001 Device 049: ID 046d:c52b Logitech, Inc. Unifying Receiver
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x046d Logitech, Inc.
idProduct 0xc52b Unifying Receiver
bcdDevice 12.07
iManufacturer 1 Logitech
iProduct 2 USB Receiver
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 84
bNumInterfaces 3
bConfigurationValue 1
iConfiguration 4 RQR12.07_B0029
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 98mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 1 Keyboard
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 59
Report Descriptor: (length is 59)
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 8
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 2 Mouse
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 148
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 2
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 93
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0020 1x 32 bytes
bInterval 2
Device Status: 0x0000
(Bus Powered)
79 changes: 79 additions & 0 deletions plugins/unifying/data/lsusb-U0008-bootloader-old.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@

Bus 003 Device 036: ID 046d:aaac Logitech, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 32
idVendor 0x046d Logitech, Inc.
idProduct 0xaaac
bcdDevice 3.01
iManufacturer 1 Logitech
iProduct 2 USB BootLoader
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 34
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 4 BOT03.01_B0008
bmAttributes 0x80
(Bus Powered)
MaxPower 98mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 25
Report Descriptor: (length is 25)
Item(Global): Usage Page, data= [ 0xb0 0xff ] 65456
(null)
Item(Local ): Usage, data= [ 0x01 ] 1
(null)
Item(Main ): Collection, data= [ 0x01 ] 1
Application
Item(Global): Report Size, data= [ 0x08 ] 8
Item(Global): Report Count, data= [ 0x20 ] 32
Item(Global): Logical Minimum, data= [ 0x00 ] 0
Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
Item(Local ): Usage, data= [ 0x01 ] 1
(null)
Item(Main ): Input, data= [ 0x00 ] 0
Data Array Absolute No_Wrap Linear
Preferred_State No_Null_Position Non_Volatile Bitfield
Item(Local ): Usage, data= [ 0x01 ] 1
(null)
Item(Main ): Output, data= [ 0x00 ] 0
Data Array Absolute No_Wrap Linear
Preferred_State No_Null_Position Non_Volatile Bitfield
Item(Main ): End Collection, data=none
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0020 1x 32 bytes
bInterval 1
Device Status: 0x0000
(Bus Powered)
Loading

0 comments on commit 864363e

Please sign in to comment.