Commit Graph

16 Commits

Author SHA1 Message Date
Richard Hughes
9f71fe3dc9 Make the 'id' for fu_plugin_add_firmware_gtype() optional
We can work out the correct value automatically in all cases but one, and it's
less for the plugin author to get wrong...
2021-01-04 15:27:10 +00:00
Richard Hughes
a14de30153 trivial: Require <string.h> for strlen() and memcpy() 2020-12-14 16:49:03 +00:00
Richard Hughes
05e3377d11 trivial: Add fu_common_bytes_new_offset()
This is a safer version of g_bytes_new_from_bytes() which returns a GError
if the offsets are invalid rather than emitting a critical warning.

This prevents a critical warning and potential crash when parsing invalid
bcm57xx firmware.
2020-12-08 20:54:25 +00:00
Richard Hughes
698099f643 trivial: Remove several unused variables 2020-12-08 20:06:46 +00:00
Marcus Comstedt
6035b520b7 bcm57xx: Refactor CRC code to remove extra byteswap 2020-12-01 14:50:00 +00:00
Marcus Comstedt
4a74a87d1e bcm57xx: Fix CRC check 2020-12-01 14:50:00 +00:00
Richard Hughes
d99f74f0b7 Revert "bcm57xx: Use PCI function 1 as 0 does not work with the Dell KH08P"
This reverts commit b5eddee5f6.

Using pci function 0 works on my Lenovo P50 but not my Lenovo X1. Don't break
machines where we are shipping the chip rather than ones where we probably are
not, especially when it's probably a kernel bug somewhere.

Fixes https://github.com/fwupd/fwupd/issues/2608
2020-11-20 09:54:34 +00:00
Richard Hughes
b5eddee5f6 bcm57xx: Use PCI function 1 as 0 does not work with the Dell KH08P 2020-11-14 07:56:32 +00:00
Evan Lojewski
0304f8d4fd bcm57xx: Fix reading vendor/device ids from firmware.
The PCI Vendor and Device ID locations located in firmware were mistakenly
swapped in the bcm5719-fw repository. As a result, the code here based on said
repository also has swapped IDs. This fixes the ids to reflect the
correct locations.

Signed-off-by: Evan Lojewski <github@meklort.com>
2020-11-06 08:27:06 +00:00
Richard Hughes
203ed841da trivial: Codespell fixes 2020-11-02 14:26:26 +00:00
Richard Hughes
94e3d24f55 bcm57xx: Make hotplug more reliable
Although hotpluggging PCIe cards isn't common, it's how I'm testing this in the
device test enclosure. Add a tiny delay to wait for the kernel to populate the
net class on hotplug.
2020-10-29 14:01:25 +00:00
Mario Limonciello
8aa5d41eb7 Add external interface messages 2020-10-26 12:05:20 -05:00
Richard Hughes
3b577c5de3 bcm57xx: Fix trivial warnings when building on Win32 2020-10-22 13:55:14 +01:00
Richard Hughes
cc2f6aa1b2 Add fu_device_sleep_with_progress helper()
This makes the console a bit more helpful than just 'hanging'...
2020-10-11 07:34:00 +01:00
Evan Lojewski
44361fa14e bcm57xx: Improve reliability when flashing
- Use pci function 0 instead of 1 when flashing firmware.
  In certain situations, the BCM5719 NVM controller can lockup if
  a function other than 0 is used to read from NVM word-by-word like
  the kernel driver does.
- Fix APE_MODE offset in BAR[2] to enable proper resetting of the APE.
- Remove unnededed NVRam lock when resetting the APE.

Signed-off-by: Evan Lojewski <github@meklort.com>
2020-10-09 07:37:33 +01:00
Richard Hughes
4123885c81 bcm57xx: Add a plugin that can update the BCM5719 network adapter 2020-10-08 16:49:07 +01:00