mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: report firmware version using ethtool
print fw_ver and build_ver members of struct mt76x02_fw_header, similarly to what appears in the output of 'dmesg' when the MCU firmware is loaded. Reported-by: Sid Hayn <[email protected]> Signed-off-by: Davide Caratti <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
8cd4ecfa0e
commit
4f346379b3
@@ -211,3 +211,16 @@ int mt76x02_mcu_cleanup(struct mt76_dev *dev)
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76x02_mcu_cleanup);
|
||||
|
||||
void mt76x02_set_ethtool_fwver(struct mt76_dev *dev,
|
||||
const struct mt76x02_fw_header *h)
|
||||
{
|
||||
u16 bld = le16_to_cpu(h->build_ver);
|
||||
u16 ver = le16_to_cpu(h->fw_ver);
|
||||
|
||||
snprintf(dev->hw->wiphy->fw_version,
|
||||
sizeof(dev->hw->wiphy->fw_version),
|
||||
"%d.%d.%02d-b%x",
|
||||
(ver >> 12) & 0xf, (ver >> 8) & 0xf, ver & 0xf, bld);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76x02_set_ethtool_fwver);
|
||||
|
||||
Reference in New Issue
Block a user