[OpenWrt-Devel] Negative offset for checksum in ath79's 10-ath9k-eeprom

Adrian Schmutzler mail at adrianschmutzler.de
Wed Sep 18 08:18:07 EDT 2019


I've encountered the following issue, for which I would like a second opinion.

In ath79's 10-ath9k-eeprom, in addition to patching the firmware MAC address, some devices also need a checksum adjustment:

For this purpose, the function ath9k_patch_fw_mac_crc is used (below ath9k_patch_fw_mac), where the chksum_offset is calculated by subtracting 10 from the mac_offset.
(For ath10k chksum_offset value is hardcoded to 2).

However, in ath79's 10-ath9k-eeprom, some devices call this function with a mac_offset of 0x2, e.g.

	ath9k_eeprom_extract "art" 0x1000 0x440
	ath9k_patch_fw_mac_crc $(mtd_get_mac_text "mac" 0x4) 0x2

This would result in a negative chksum_offset.

To me this looks like a misuse of ath9k_patch_fw_mac_crc where ath9k_patch_fw_mac should have been used.
Or does anyone see a reason for this?
(I've added the device support authors in Cc)

If not, I would send the following fixes:
- Change ath9k_patch_fw_mac_crc to ath9k_patch_fw_mac for the relevant cases
- Add a check for negative values of chksum_offset and display a warning

List of affected devices:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20190918/ab9c9981/attachment.sig>
-------------- next part --------------
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list