diff options
author | Sean Wang <sean.wang@mediatek.com> | 2021-01-28 03:33:56 +0800 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-01-29 18:10:02 +0100 |
commit | 0da3c795d07bf005d4b0be8d6cdc4714aa51a988 (patch) | |
tree | 2b34f6151eebb60b2fb7a572137e283e928cc040 /drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | |
parent | eaafabd2850d782366ca0558d432857d5e3d472a (diff) | |
download | linux-stable-0da3c795d07bf005d4b0be8d6cdc4714aa51a988.tar.gz linux-stable-0da3c795d07bf005d4b0be8d6cdc4714aa51a988.tar.bz2 linux-stable-0da3c795d07bf005d4b0be8d6cdc4714aa51a988.zip |
mt76: mt7921: add coredump support
Introduce coredump support to mt7921 driver.
The coredump would be produced when MCU met the fatal error or driver
sent out the specific cmd to force trigger it.
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c index 40c10510b32a..6cbccfb05f8b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c @@ -1497,6 +1497,40 @@ int mt76_connac_mcu_sched_scan_enable(struct mt76_phy *phy, } EXPORT_SYMBOL_GPL(mt76_connac_mcu_sched_scan_enable); +int mt76_connac_mcu_chip_config(struct mt76_dev *dev) +{ + struct { + __le16 id; + u8 type; + u8 resp_type; + __le16 data_size; + __le16 resv; + u8 data[320]; + } req = { + .resp_type = 0, + }; + + memcpy(req.data, "assert", 7); + + return mt76_mcu_send_msg(dev, MCU_CMD_CHIP_CONFIG, &req, sizeof(req), + false); +} +EXPORT_SYMBOL_GPL(mt76_connac_mcu_chip_config); + +void mt76_connac_mcu_coredump_event(struct mt76_dev *dev, struct sk_buff *skb, + struct mt76_connac_coredump *coredump) +{ + spin_lock_bh(&dev->lock); + __skb_queue_tail(&coredump->msg_list, skb); + spin_unlock_bh(&dev->lock); + + coredump->last_activity = jiffies; + + queue_delayed_work(dev->wq, &coredump->work, + MT76_CONNAC_COREDUMP_TIMEOUT); +} +EXPORT_SYMBOL_GPL(mt76_connac_mcu_coredump_event); + #ifdef CONFIG_PM const struct wiphy_wowlan_support mt76_connac_wowlan_support = { |