diff mbox series

mt76: mt7603: report firmware version using ethtool

Message ID 209575773fd531daf616f2d167f98430997735ec.1556369866.git.lorenzo@kernel.org (mailing list archive)
State Accepted
Delegated to: Felix Fietkau
Headers show
Series mt76: mt7603: report firmware version using ethtool | expand

Commit Message

Lorenzo Bianconi April 27, 2019, 1:02 p.m. UTC
Print fw_ver and build_date members of struct mt7603_fw_trailer
similarly to what appears in the output of 'dmesg' when the MCU firmware
is loaded.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7603/mcu.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c
index 57481012ee47..19b66e9aae45 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c
@@ -260,6 +260,9 @@  int mt7603_load_firmware(struct mt7603_dev *dev)
 	mt76_clear(dev, MT_SCH_4, BIT(8));
 
 	dev->mcu_running = true;
+	snprintf(dev->mt76.hw->wiphy->fw_version,
+		 sizeof(dev->mt76.hw->wiphy->fw_version),
+		 "%.10s-%.15s", hdr->fw_ver, hdr->build_date);
 	dev_info(dev->mt76.dev, "firmware init done\n");
 
 out: