mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt7603: restart MCU on driver unload
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -119,6 +119,7 @@ int mt7603_set_channel(struct mt7603_dev *dev, struct cfg80211_chan_def *def);
|
||||
int mt7603_mcu_set_channel(struct mt7603_dev *dev);
|
||||
int mt7603_mcu_reg_read(struct mt7603_dev *dev, u32 reg, u32 *val, bool rf);
|
||||
int mt7603_mcu_set_eeprom(struct mt7603_dev *dev);
|
||||
int mt7603_mcu_exit(struct mt7603_dev *dev);
|
||||
|
||||
void mt7603_wtbl_init(struct mt7603_dev *dev, int idx, const u8 *addr);
|
||||
void mt7603_wtbl_clear(struct mt7603_dev *dev, int idx);
|
||||
|
||||
@@ -192,6 +192,14 @@ mt7603_mcu_start_firmware(struct mt7603_dev *dev, u32 addr)
|
||||
return mt7603_mcu_msg_send(dev, skb, -MCU_CMD_FW_START_REQ, MCU_Q_NA, NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
mt7603_mcu_restart(struct mt7603_dev *dev)
|
||||
{
|
||||
struct sk_buff *skb = mt7603_mcu_msg_alloc(dev, NULL, 0);
|
||||
|
||||
return mt7603_mcu_msg_send(dev, skb, -MCU_CMD_RESTART_DL_REQ, MCU_Q_NA, NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
mt7603_load_firmware(struct mt7603_dev *dev)
|
||||
{
|
||||
@@ -289,6 +297,11 @@ int mt7603_mcu_init(struct mt7603_dev *dev)
|
||||
return mt7603_load_firmware(dev);
|
||||
}
|
||||
|
||||
int mt7603_mcu_exit(struct mt7603_dev *dev)
|
||||
{
|
||||
return mt7603_mcu_restart(dev);
|
||||
}
|
||||
|
||||
int mt7603_mcu_set_eeprom(struct mt7603_dev *dev)
|
||||
{
|
||||
static const u16 req_fields[] = {
|
||||
|
||||
@@ -75,6 +75,7 @@ mt76pci_remove(struct pci_dev *pdev)
|
||||
struct mt7603_dev *dev = pci_get_drvdata(pdev);
|
||||
|
||||
ieee80211_unregister_hw(mt76_hw(dev));
|
||||
mt7603_mcu_exit(dev);
|
||||
mt7603_dma_cleanup(dev);
|
||||
ieee80211_free_hw(mt76_hw(dev));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user