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

wifi: mt76: mt7925: extend mt7925_mcu_uni_roc_event

We extended the function to be able multiple pieces of information
in a single event, supporting the future MLO-enabled firmware.
Co-developed-by: default avatarMing Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: default avatarMing Yen Hsieh <mingyen.hsieh@mediatek.com>
Co-developed-by: default avatarDeren Wu <deren.wu@mediatek.com>
Signed-off-by: default avatarDeren Wu <deren.wu@mediatek.com>
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/4be7b34904034d521dab147883b898b5402fd29f.1720248331.git.sean.wang@kernel.orgSigned-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 7cf7785a
......@@ -313,16 +313,14 @@ mt7925_mcu_roc_iter(void *priv, u8 *mac, struct ieee80211_vif *vif)
mvif->band_idx = grant->dbdcband;
}
static void
mt7925_mcu_uni_roc_event(struct mt792x_dev *dev, struct sk_buff *skb)
static void mt7925_mcu_roc_handle_grant(struct mt792x_dev *dev,
struct tlv *tlv)
{
struct ieee80211_hw *hw = dev->mt76.hw;
struct mt7925_roc_grant_tlv *grant;
struct mt7925_mcu_rxd *rxd;
int duration;
rxd = (struct mt7925_mcu_rxd *)skb->data;
grant = (struct mt7925_roc_grant_tlv *)(rxd->tlv + 4);
grant = (struct mt7925_roc_grant_tlv *)tlv;
/* should never happen */
WARN_ON_ONCE((le16_to_cpu(grant->tag) != UNI_EVENT_ROC_GRANT));
......@@ -340,6 +338,29 @@ mt7925_mcu_uni_roc_event(struct mt792x_dev *dev, struct sk_buff *skb)
jiffies + msecs_to_jiffies(duration));
}
static void
mt7925_mcu_uni_roc_event(struct mt792x_dev *dev, struct sk_buff *skb)
{
struct tlv *tlv;
int i = 0;
skb_pull(skb, sizeof(struct mt7925_mcu_rxd) + 4);
while (i < skb->len) {
tlv = (struct tlv *)(skb->data + i);
switch (le16_to_cpu(tlv->tag)) {
case UNI_EVENT_ROC_GRANT:
mt7925_mcu_roc_handle_grant(dev, tlv);
break;
case UNI_EVENT_ROC_GRANT_SUB_LINK:
break;
}
i += le16_to_cpu(tlv->len);
}
}
static void
mt7925_mcu_scan_event(struct mt792x_dev *dev, struct sk_buff *skb)
{
......
......@@ -41,6 +41,7 @@ enum mt7925_roc_req {
enum {
UNI_EVENT_ROC_GRANT = 0,
UNI_EVENT_ROC_GRANT_SUB_LINK = 4,
UNI_EVENT_ROC_TAG_NUM
};
......
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