Commit bb366c5b authored by Sean Wang's avatar Sean Wang Committed by Felix Fietkau

mt76: mt7615: introduce BSS absence event

Introduce BSS absence event that is reported when the fw
is leaving or entering current operational channel.
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Co-developed-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 20305f98
...@@ -339,6 +339,26 @@ mt7615_mcu_scan_event(struct mt7615_dev *dev, struct sk_buff *skb) ...@@ -339,6 +339,26 @@ mt7615_mcu_scan_event(struct mt7615_dev *dev, struct sk_buff *skb)
MT7615_HW_SCAN_TIMEOUT); MT7615_HW_SCAN_TIMEOUT);
} }
static void
mt7615_mcu_bss_event(struct mt7615_dev *dev, struct sk_buff *skb)
{
struct mt7615_mcu_bss_event *event;
struct mt76_phy *mphy;
event = (struct mt7615_mcu_bss_event *)(skb->data +
sizeof(struct mt7615_mcu_rxd));
if (event->bss_idx && dev->mt76.phy2)
mphy = dev->mt76.phy2;
else
mphy = &dev->mt76.phy;
if (event->is_absent)
ieee80211_stop_queues(mphy->hw);
else
ieee80211_wake_queues(mphy->hw);
}
static void static void
mt7615_mcu_rx_unsolicited_event(struct mt7615_dev *dev, struct sk_buff *skb) mt7615_mcu_rx_unsolicited_event(struct mt7615_dev *dev, struct sk_buff *skb)
{ {
...@@ -352,6 +372,9 @@ mt7615_mcu_rx_unsolicited_event(struct mt7615_dev *dev, struct sk_buff *skb) ...@@ -352,6 +372,9 @@ mt7615_mcu_rx_unsolicited_event(struct mt7615_dev *dev, struct sk_buff *skb)
case MCU_EVENT_SCAN_DONE: case MCU_EVENT_SCAN_DONE:
mt7615_mcu_scan_event(dev, skb); mt7615_mcu_scan_event(dev, skb);
return; return;
case MCU_EVENT_BSS_ABSENCE:
mt7615_mcu_bss_event(dev, skb);
break;
default: default:
break; break;
} }
...@@ -367,6 +390,7 @@ void mt7615_mcu_rx_event(struct mt7615_dev *dev, struct sk_buff *skb) ...@@ -367,6 +390,7 @@ void mt7615_mcu_rx_event(struct mt7615_dev *dev, struct sk_buff *skb)
rxd->ext_eid == MCU_EXT_EVENT_ASSERT_DUMP || rxd->ext_eid == MCU_EXT_EVENT_ASSERT_DUMP ||
rxd->ext_eid == MCU_EXT_EVENT_PS_SYNC || rxd->ext_eid == MCU_EXT_EVENT_PS_SYNC ||
rxd->eid == MCU_EVENT_SCHED_SCAN_DONE || rxd->eid == MCU_EVENT_SCHED_SCAN_DONE ||
rxd->eid == MCU_EVENT_BSS_ABSENCE ||
rxd->eid == MCU_EVENT_SCAN_DONE || rxd->eid == MCU_EVENT_SCAN_DONE ||
!rxd->seq) !rxd->seq)
mt7615_mcu_rx_unsolicited_event(dev, skb); mt7615_mcu_rx_unsolicited_event(dev, skb);
......
...@@ -82,6 +82,7 @@ enum { ...@@ -82,6 +82,7 @@ enum {
MCU_EVENT_ACCESS_REG = 0x02, MCU_EVENT_ACCESS_REG = 0x02,
MCU_EVENT_MT_PATCH_SEM = 0x04, MCU_EVENT_MT_PATCH_SEM = 0x04,
MCU_EVENT_SCAN_DONE = 0x0d, MCU_EVENT_SCAN_DONE = 0x0d,
MCU_EVENT_BSS_ABSENCE = 0x11,
MCU_EVENT_CH_PRIVILEGE = 0x18, MCU_EVENT_CH_PRIVILEGE = 0x18,
MCU_EVENT_SCHED_SCAN_DONE = 0x23, MCU_EVENT_SCHED_SCAN_DONE = 0x23,
MCU_EVENT_EXT = 0xed, MCU_EVENT_EXT = 0xed,
...@@ -398,6 +399,13 @@ struct nt7615_sched_scan_done { ...@@ -398,6 +399,13 @@ struct nt7615_sched_scan_done {
__le16 pad; __le16 pad;
} __packed; } __packed;
struct mt7615_mcu_bss_event {
u8 bss_idx;
u8 is_absent;
u8 free_quota;
u8 pad;
} __packed;
/* offload mcu commands */ /* offload mcu commands */
enum { enum {
MCU_CMD_START_HW_SCAN = MCU_CE_PREFIX | 0x03, MCU_CMD_START_HW_SCAN = MCU_CE_PREFIX | 0x03,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment