diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2020-10-14 13:03:58 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-12-04 16:31:11 +0300 |
commit | 3cb43b66060a5620cb1878668740c799235ad463 (patch) | |
tree | 9bfdc3b96969e834adb7a5c0d37dd49f8a001813 /drivers/net/wireless/mediatek/mt76/mt7603/mcu.c | |
parent | bf4a938ab2cf854ed17f134e89e8aeff27c027f3 (diff) | |
download | linux-3cb43b66060a5620cb1878668740c799235ad463.tar.xz |
mt76: move mt76_mcu_send_firmware in common module
Move mt76_mcu_send_firmware routine in common code since it is actually
shared between mt7615, mt7663, mt7603 and mt7915 devices
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7603/mcu.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7603/mcu.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c index b2ccfe6772ce..9e6c8e1b7ea5 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c @@ -94,27 +94,6 @@ mt7603_mcu_init_download(struct mt7603_dev *dev, u32 addr, u32 len) } static int -mt7603_mcu_send_firmware(struct mt7603_dev *dev, const void *data, int len) -{ - int cur_len, ret = 0; - - while (len > 0) { - cur_len = min_t(int, 4096 - sizeof(struct mt7603_mcu_txd), - len); - - ret = mt76_mcu_send_msg(&dev->mt76, -MCU_CMD_FW_SCATTER, data, - cur_len, false); - if (ret) - break; - - data += cur_len; - len -= cur_len; - } - - return ret; -} - -static int mt7603_mcu_start_firmware(struct mt7603_dev *dev, u32 addr) { struct { @@ -200,7 +179,8 @@ static int mt7603_load_firmware(struct mt7603_dev *dev) goto out; } - ret = mt7603_mcu_send_firmware(dev, fw->data, dl_len); + ret = mt76_mcu_send_firmware(&dev->mt76, -MCU_CMD_FW_SCATTER, + fw->data, dl_len); if (ret) { dev_err(dev->mt76.dev, "Failed to send firmware to device\n"); goto out; |