Commit Graph

19 Commits

Author SHA1 Message Date
Richard Hughes
baf10157dd pixart-rf: Retry the SetReport after a successfull firmware update 2021-03-29 10:23:16 +01:00
JimmyYu
af1e70ad92 pixart: Modify ota retransmit flow 2021-03-22 17:48:08 +01:00
JimmyYu
bc39faf4cf pixart: Add check result in fw upgrade response
Signed-off-by: Richard Hughes <richard@hughsie.com>
2021-03-15 13:07:13 +00:00
Ricardo Cañuelo
2619442293 pixart: Detect multiple devices of the same type
Set the logical_id to the HID_UNIQ string instead of using the vendor,
device and model info.
2021-03-11 14:38:55 +01:00
JimmyYu
18d79a0625 pixart: Check firmware compatibility with hardware before flashing
Also add low-battery detection to ensure the update is safe to apply.
2021-03-10 16:23:18 +01:00
Richard Hughes
1981c63d58 Remove FuFirmwareImage and just use FuFirmware instead
This allows us to 'nest' firmware formats, and removes a ton of duplication.

The aim here is to deprecate FuFirmwareImage -- it's almost always acting
as a 'child' FuFirmware instance, and even copies most of the vfuncs to allow
custom types. If I'm struggling to work out what should be a FuFirmware and
what should be a FuFirmwareImage then a plugin author has no hope.

For simple payloads we were adding bytes into an image and then the image into
a firmware. This gets really messy when most plugins are treating the FuFirmware
*as* the binary firmware file.

The GBytes saved in the FuFirmware would be considered the payload with the
aim of not using FuFirmwareImage in the single-image case.
2021-03-09 21:14:12 +00:00
JimmyYu
6d45136c25 pixart: Filter the wrong report ID 2021-03-05 12:19:33 +01:00
Richard Hughes
c9d6fecc5e pixart: Workaround a HIDIOCGFEATURE bug and/or regression
We're still in the process of hunting for the real cause.
2021-03-03 15:36:42 +00:00
Richard Hughes
bf3732f994 pixart: Use the bluetooth UUID to set the logical ID
This means you can have more than one device attached to the same controller.
2021-03-03 15:36:42 +00:00
Richard Hughes
88d9ace4a3 pixart: Include the missing ->to_string() parent class 2021-03-03 15:36:42 +00:00
Richard Hughes
b3f9841924 Support more than one protocol for a given device
Devices may want to support more than one protocol, and for some devices
(e.g. Unifying peripherals stuck in bootloader mode) you might not even be able
to query for the correct protocol anyway.
2021-03-01 16:14:36 +00:00
JimmyYu
618fae792f pixart: Re-define var and Guid 2021-02-18 09:11:35 +00:00
Richard Hughes
645a62002e pixart: Add some error prefixes to aid debugging 2021-02-17 08:48:45 +00:00
Richard Hughes
63a9665107 pixart: Fuzz the firmware parser 2021-02-17 08:48:45 +00:00
JimmyYu
b7551c0211 pixart: Add support for more devices 2021-02-17 08:48:45 +00:00
Richard Hughes
d99f86023f trivial: Add getters to FuChunk
At the moment FuChunks are sometimes mutable, and sometimes immutable, and it's
all a bit too low level for comfort.

Before we can do any kind of optimisation or verification we need plugins to
stop reading directly from the C structure. The aim here is to make FuChunk
optionally mutable without making assumptions about the memory model, and also
to be able to introspect it for the docs.
2021-01-28 16:42:54 +00:00
Richard Hughes
0d412b535e trivial: Remove invalid buffer dump in pixart_rf
Spotted by Coverity.
2021-01-08 20:53:11 +00:00
Richard Hughes
eddaed0c11 Allow specifying more than one VendorID for a device
Asking the user for the UID mapping isn't working very well, as it requires lots
of manual handholding. It also doesn't work very well when the device vendor
does not actually have a PCI ID or if the vendor has split into two entities.

Just use the OUI address as an additional VendorID and match any of the device
IDs against any of the metadata-supplied values.
2021-01-04 22:30:20 +00:00
Jimmy Yu
23cd466ef1 Add plugin to update PixArt RF devices
Signed-off-by: Richard Hughes <richard@hughsie.com>
2021-01-04 17:20:13 +00:00