mt76: mt7603: report firmware version using ethtool
authorLorenzo Bianconi <lorenzo@kernel.org>
Sat, 27 Apr 2019 13:02:10 +0000 (15:02 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 1 May 2019 11:04:00 +0000 (13:04 +0200)
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>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7603/mcu.c

index ca08b546fa0ae2b283dbfc04d84b85f7c17f69db..766d968671b3aa47141e8131d3bf96d0eae96718 100644 (file)
@@ -252,6 +252,9 @@ running:
        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: