fwupd/plugins/logitech-hidpp
Richard Hughes 91536c5638 logitech-hidpp: Add the Model ID instance ID before getting firmware versions
This will allow us to create a device-radio child in the future.
2021-09-01 15:42:24 +01:00
..
data Rename unifying plugin to logitech-hidpp (Fixes: #1329) 2019-11-04 13:35:36 -06:00
fu-logitech-hidpp-bootloader-nordic.c trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-logitech-hidpp-bootloader-nordic.h trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-logitech-hidpp-bootloader-texas.c trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-logitech-hidpp-bootloader-texas.h trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-logitech-hidpp-bootloader.c trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-logitech-hidpp-bootloader.h trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-logitech-hidpp-common.c trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-logitech-hidpp-common.h logitech-hidpp: Add support for updating Bolt receivers 2021-09-01 15:07:09 +01:00
fu-logitech-hidpp-device.c logitech-hidpp: Add the Model ID instance ID before getting firmware versions 2021-09-01 15:42:24 +01:00
fu-logitech-hidpp-device.h logitech-hidpp: Allow children to attach using the parent device for future code 2021-08-31 17:15:15 +01:00
fu-logitech-hidpp-hidpp-msg.c logitech-hidpp: Add support for updating Bolt receivers 2021-09-01 15:07:09 +01:00
fu-logitech-hidpp-hidpp-msg.h trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-logitech-hidpp-hidpp.c trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-logitech-hidpp-hidpp.h logitech-hidpp: Add support for updating Bolt receivers 2021-09-01 15:07:09 +01:00
fu-logitech-hidpp-radio.c logitech-hidpp: Add support for updating Bolt receiver radio firmware 2021-09-01 15:07:09 +01:00
fu-logitech-hidpp-radio.h logitech-hidpp: Add support for updating Bolt receiver radio firmware 2021-09-01 15:07:09 +01:00
fu-logitech-hidpp-runtime-bolt.c logitech-hidpp: Add support for updating Bolt receiver radio firmware 2021-09-01 15:07:09 +01:00
fu-logitech-hidpp-runtime-bolt.h logitech-hidpp: Add support for updating Bolt receivers 2021-09-01 15:07:09 +01:00
fu-logitech-hidpp-runtime-unifying.c trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-logitech-hidpp-runtime-unifying.h trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-logitech-hidpp-runtime.c logitech-hidpp: Add support for updating Bolt receivers 2021-09-01 15:07:09 +01:00
fu-logitech-hidpp-runtime.h trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-logitech-hidpp-self-test.c trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-plugin-logitech-hidpp.c logitech-hidpp: Add support for updating Bolt receiver radio firmware 2021-09-01 15:07:09 +01:00
logitech-hidpp.quirk logitech-hidpp: Don't assume all USB devices with VEN_046D are Unifying 2021-09-01 15:42:24 +01:00
meson.build logitech-hidpp: Add support for updating Bolt receiver radio firmware 2021-09-01 15:07:09 +01:00
README.md logitech-hidpp: Add support for updating Bolt receiver radio firmware 2021-09-01 15:07:09 +01:00

Logitech HID

Introduction

This plugin can flash the firmware on:

  • Logitech Unifying dongles, both the Nordic (U0007) device and the Texas Instruments (U0008) versions
  • Logitech Bolt dongles
  • Unifying peripherals through the Unifying receiver

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

Some bootloader protocol information was taken from the Mousejack project, specifically logitech-usb-restore.py and unifying.py. Other documentation was supplied by Logitech.

Additional constants were taken from the https://pwr-Solaar.github.io/Solaar/ project.

Firmware Format

The daemon will decompress the cabinet archive and extract a firmware blob in a vendor-specific format that appears to be a subset of the Intel HEX format.

This plugin supports the following protocol IDs:

  • com.logitech.unifying
  • com.logitech.unifyingsigned

GUID Generation

The Unifying receivers and peripherals use the standard USB DeviceInstanceId values when in DFU mode:

  • USB\VID_046D&PID_AAAA&REV_0001
  • USB\VID_046D&PID_AAAA
  • USB\VID_046D

When in runtime mode, the HID raw DeviceInstanceId values are used:

  • HIDRAW\VEN_046D&DEV_C52B&MOD_B33B405B000000
  • HIDRAW\VEN_046D&DEV_C52B
  • HIDRAW\VEN_046D

The Bolt dongle and peripherals use HID raw DeviceInstanceId values regardless of their mode. This might change once these devices are handled by the Logitech Linux driver instead of by the generic hid driver.

Vendor ID Security

The vendor ID is set from the vendor ID, in this instance set to USB:0x046D in bootloader and HIDRAW:0x046D in runtime mode.

Update Behavior

Due to the variety of devices supported and the differences in how they're enumerated, the update behavior is slightly different between them.

In all cases, the devices have to be put in bootloader mode to run the DFU process. While in bootloader mode, the user won't be able to use the device. For receivers, that also means that while they're in bootloader mode, the peripherals paired to them won't work during the update.

A Unifying receiver presents in runtime mode, but on detach re-enumerates with a different USB PID in a bootloader mode. On attach the device again re-enumerates back to the runtime mode.

For this reason the REPLUG_MATCH_GUID internal device flag is used so that the bootloader and runtime modes are treated as the same device.

The Bolt receiver enumerates as a hidraw device both in runtime and bootloader mode, but with different HIDRAW devIDs.

Design Notes

When a dongle is detected in bootloader mode we detach the hidraw driver from the kernel and use raw control transfers. This ensures that we don't accidentally corrupt the uploading firmware. For application firmware we use hidraw which means the hardware keeps working while probing, and also allows us to detect paired devices.

How the code is organized

Here's how the different devices are handled in the plugin:

  • Unifying receiver in runtime mode: FuLogitechHidPpRuntimeUnifying (fu-logitech-hidpp-runtime-unifying.c)
  • Unifying receiver in bootloader mode:
    • Nordic chipset: FuLogitechHidPpBootloaderNordic (fu-logitech-hidpp-bootloader-nordic.c)
    • TI chipset: FuLogitechHidPpBootloaderTexas (fu-logitech-hidpp-bootloader-texas.c)
  • Bolt receiver in runtime mode: FuLogitechHidPpRuntimeBolt (fu-logitech-hidpp-runtime-bolt.c)
  • Bolt receiver in bootloader mode and all peripherals: FuLogitechHidPpDevice (fu-logitech-hidpp-device.c)

FuLogitechHidPpDevice effectively handles all devices that use the HID++2.0 protocol.

Every device contains two updatable entities, the main application FW and the radio stack FW (SoftDevice). The latter will show up as a child device of the actual device and is handled by FuLogitechHidPpRadio (fu-logitech-hidpp-radio.c), which simply defers to the parent device for most operations.

Plugin-specific flags

Even though the same code handles multiple different devices, there are some inherent differences in them that makes it necessary to handle some exceptional behaviors sometimes.

In order to do that there are a few specific flags that can be used to tweak the plugin code for certain device types:

  • rebind-attach: some devices will have their device file unbound and re-bound after reset, so the device object can't be simply re-probed using the same file descriptor.
  • force-receiver-id: this flag is used to differentiate the receiver device in FuLogitechHidPpDevice, since the receiver has a specific HID++ ID.

External Interface Access

This plugin requires read/write access to /dev/bus/usb.