mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
wifi: mt76: mt7925: add MBMC event handling
Handle MBMC unsolicited events from firmware to report the current MBMC state. This helps validate MT7927 band setup. Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20260425195011.790265-19-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
05fd148853
commit
bcc6e3358a
|
|
@ -1069,6 +1069,7 @@ enum {
|
|||
MCU_UNI_EVENT_SCAN_DONE = 0x0e,
|
||||
MCU_UNI_EVENT_RDD_REPORT = 0x11,
|
||||
MCU_UNI_EVENT_ROC = 0x27,
|
||||
MCU_UNI_EVENT_MBMC = 0x28,
|
||||
MCU_UNI_EVENT_TX_DONE = 0x2d,
|
||||
MCU_UNI_EVENT_THERMAL = 0x35,
|
||||
MCU_UNI_EVENT_RSSI_MONITOR = 0x41,
|
||||
|
|
|
|||
|
|
@ -566,6 +566,34 @@ mt7925_mcu_uni_debug_msg_event(struct mt792x_dev *dev, struct sk_buff *skb)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
mt7925_mcu_handle_mbmc_event(struct mt792x_dev *dev, struct sk_buff *skb)
|
||||
{
|
||||
struct mbmc_conf_tlv *tlv;
|
||||
u32 tlv_len;
|
||||
|
||||
skb_pull(skb, sizeof(struct mt7925_mcu_rxd) + 4);
|
||||
tlv_len = skb->len;
|
||||
tlv = (struct mbmc_conf_tlv *)skb->data;
|
||||
|
||||
while (tlv_len >= sizeof(*tlv) &&
|
||||
le16_to_cpu(tlv->len) >= sizeof(*tlv) &&
|
||||
le16_to_cpu(tlv->len) <= tlv_len) {
|
||||
u16 tag = le16_to_cpu(tlv->tag);
|
||||
|
||||
if (tag == UNI_MBMC_SETTING || tag == UNI_MBMC_NO_RESP_SETTING) {
|
||||
dev_dbg(dev->mt76.dev,
|
||||
"MBMC event: tag=%u mbmc_en=%u\n",
|
||||
tag, tlv->mbmc_en);
|
||||
break;
|
||||
}
|
||||
|
||||
tlv_len -= le16_to_cpu(tlv->len);
|
||||
tlv = (struct mbmc_conf_tlv *)
|
||||
((u8 *)tlv + le16_to_cpu(tlv->len));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
mt7925_mcu_uni_rx_unsolicited_event(struct mt792x_dev *dev,
|
||||
struct sk_buff *skb)
|
||||
|
|
@ -584,6 +612,9 @@ mt7925_mcu_uni_rx_unsolicited_event(struct mt792x_dev *dev,
|
|||
case MCU_UNI_EVENT_ROC:
|
||||
mt7925_mcu_uni_roc_event(dev, skb);
|
||||
break;
|
||||
case MCU_UNI_EVENT_MBMC:
|
||||
mt7925_mcu_handle_mbmc_event(dev, skb);
|
||||
break;
|
||||
case MCU_UNI_EVENT_SCAN_DONE:
|
||||
mt7925_mcu_scan_event(dev, skb);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -143,7 +143,8 @@ enum {
|
|||
};
|
||||
|
||||
enum {
|
||||
UNI_MBMC_SETTING,
|
||||
UNI_MBMC_SETTING = 0,
|
||||
UNI_MBMC_NO_RESP_SETTING = 1,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user