mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 12:03:54 +02:00
mt76: mt7615: use new tag sta_rec_wtbl
In order to reduce command/event times, newer firmware adds a tag sta_rec_wtbl to take care of WTBL operations. MCU_EXT_CMD_WTBL_UPDATE is deprecated. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Tested-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
6849e29ed9
commit
184dd9a11d
|
|
@ -1174,6 +1174,7 @@ int mt7615_mcu_set_bmc(struct mt7615_dev *dev,
|
|||
.conn_type = cpu_to_le32(CONNECTION_INFRA_BC),
|
||||
},
|
||||
};
|
||||
struct sta_rec_wtbl *wtbl = NULL;
|
||||
struct wtbl_req_hdr *wtbl_hdr;
|
||||
struct wtbl_generic *wtbl_g;
|
||||
struct wtbl_rx *wtbl_rx;
|
||||
|
|
@ -1181,6 +1182,13 @@ int mt7615_mcu_set_bmc(struct mt7615_dev *dev,
|
|||
|
||||
eth_broadcast_addr(req.basic.peer_addr);
|
||||
|
||||
if (dev->fw_ver > MT7615_FIRMWARE_V1) {
|
||||
req.hdr.tlv_num = cpu_to_le16(2);
|
||||
wtbl = (struct sta_rec_wtbl *)buf;
|
||||
wtbl->tag = cpu_to_le16(STA_REC_WTBL);
|
||||
buf += sizeof(*wtbl);
|
||||
}
|
||||
|
||||
wtbl_hdr = (struct wtbl_req_hdr *)buf;
|
||||
buf += sizeof(*wtbl_hdr);
|
||||
wtbl_hdr->wlan_idx = mvif->sta.wcid.idx;
|
||||
|
|
@ -1214,6 +1222,9 @@ int mt7615_mcu_set_bmc(struct mt7615_dev *dev,
|
|||
wtbl_hdr->tlv_num = cpu_to_le16(2);
|
||||
|
||||
out:
|
||||
if (wtbl)
|
||||
wtbl->len = cpu_to_le16(buf - (u8 *)wtbl_hdr);
|
||||
|
||||
return mt7615_mcu_send_sta_rec(dev, (u8 *)&req, (u8 *)wtbl_hdr,
|
||||
buf - (u8 *)wtbl_hdr, en);
|
||||
}
|
||||
|
|
@ -1242,6 +1253,7 @@ int mt7615_mcu_set_sta(struct mt7615_dev *dev, struct ieee80211_vif *vif,
|
|||
.aid = cpu_to_le16(sta->aid),
|
||||
},
|
||||
};
|
||||
struct sta_rec_wtbl *wtbl = NULL;
|
||||
struct wtbl_req_hdr *wtbl_hdr;
|
||||
struct wtbl_generic *wtbl_g;
|
||||
struct wtbl_rx *wtbl_rx;
|
||||
|
|
@ -1305,6 +1317,13 @@ int mt7615_mcu_set_sta(struct mt7615_dev *dev, struct ieee80211_vif *vif,
|
|||
}
|
||||
|
||||
/* wtbl */
|
||||
if (dev->fw_ver > MT7615_FIRMWARE_V1) {
|
||||
wtbl = (struct sta_rec_wtbl *)buf;
|
||||
wtbl->tag = cpu_to_le16(STA_REC_WTBL);
|
||||
buf += sizeof(*wtbl);
|
||||
stlv++;
|
||||
}
|
||||
|
||||
wtbl_hdr = (struct wtbl_req_hdr *)buf;
|
||||
buf += sizeof(*wtbl_hdr);
|
||||
wtbl_hdr->wlan_idx = msta->wcid.idx;
|
||||
|
|
@ -1400,6 +1419,9 @@ int mt7615_mcu_set_sta(struct mt7615_dev *dev, struct ieee80211_vif *vif,
|
|||
}
|
||||
|
||||
out:
|
||||
if (wtbl)
|
||||
wtbl->len = cpu_to_le16(buf - (u8 *)wtbl_hdr);
|
||||
|
||||
wtbl_hdr->tlv_num = cpu_to_le16(wtlv);
|
||||
req.hdr.tlv_num = cpu_to_le16(stlv);
|
||||
|
||||
|
|
|
|||
|
|
@ -565,9 +565,10 @@ struct sta_rec_ba {
|
|||
__le16 winsize;
|
||||
} __packed;
|
||||
|
||||
#define MT7615_STA_REC_UPDATE_MAX_SIZE (sizeof(struct sta_rec_basic) + \
|
||||
sizeof(struct sta_rec_ht) + \
|
||||
sizeof(struct sta_rec_vht))
|
||||
struct sta_rec_wtbl {
|
||||
__le16 tag;
|
||||
__le16 len;
|
||||
} __packed;
|
||||
|
||||
enum {
|
||||
STA_REC_BASIC,
|
||||
|
|
@ -582,6 +583,7 @@ enum {
|
|||
STA_REC_HT,
|
||||
STA_REC_VHT,
|
||||
STA_REC_APPS,
|
||||
STA_REC_WTBL = 13,
|
||||
STA_REC_MAX_NUM
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user