mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7925: clear CRB before deactivating NAN peer record
Send a zero avail_map CRB TLV before the peer record deactivation
command. This ensures FW clears the committed schedule slots for
the departing peer, preventing stale CRB entries from affecting
subsequent NDP connections.
Fixes: a5487a682406 ("wifi: mt76: mt7925: add NAN MCU helpers")
Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Stella Liu <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
8573266a26
commit
26be5a8f79
+22
-3
@@ -809,18 +809,18 @@ clear_idx:
|
|||||||
int mt792x_nan_set_peer_rec(struct mt76_dev *mdev,
|
int mt792x_nan_set_peer_rec(struct mt76_dev *mdev,
|
||||||
struct ieee80211_sta *sta)
|
struct ieee80211_sta *sta)
|
||||||
{
|
{
|
||||||
|
struct mt7925_nan_sched_update_crb_tlv *crb_tlv;
|
||||||
struct mt7925_nan_common_hdr *hdr;
|
struct mt7925_nan_common_hdr *hdr;
|
||||||
struct mt792x_sta *msta;
|
struct mt792x_sta *msta;
|
||||||
struct mt792x_nan *nan;
|
struct mt792x_nan *nan;
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
|
struct tlv *tlv;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!mdev || !sta)
|
if (!mdev || !sta)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
skb = mt76_mcu_msg_alloc(mdev, NULL,
|
skb = mt76_mcu_msg_alloc(mdev, NULL, MT7925_NAN_PEER_MAX_SIZE);
|
||||||
sizeof(struct mt7925_nan_common_hdr) +
|
|
||||||
sizeof(struct mt7925_nan_sched_manage_peer_rec_tlv));
|
|
||||||
if (!skb)
|
if (!skb)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
@@ -835,6 +835,25 @@ int mt792x_nan_set_peer_rec(struct mt76_dev *mdev,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Send a zero-avail_map CRB TLV before deactivating the peer record so
|
||||||
|
* firmware clears the committed schedule slots for this peer. Without
|
||||||
|
* this, stale CRB entries linger and cause scheduling conflicts for
|
||||||
|
* subsequent NDP connections that reuse the same sch_idx.
|
||||||
|
*/
|
||||||
|
tlv = mt76_connac_mcu_add_tlv(skb, NAN_UNI_CMD_UPDATE_CRB,
|
||||||
|
sizeof(struct mt7925_nan_sched_update_crb_tlv));
|
||||||
|
if (!tlv) {
|
||||||
|
dev_kfree_skb(skb);
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
crb_tlv = (struct mt7925_nan_sched_update_crb_tlv *)tlv;
|
||||||
|
crb_tlv->sch_idx = cpu_to_le32(msta->nan_sched.sch_idx);
|
||||||
|
crb_tlv->flags = NAN_CRB_USE_DATA_PATH;
|
||||||
|
crb_tlv->is_use_ranging = false;
|
||||||
|
crb_tlv->comm_ndc_ctrl.is_valid = false;
|
||||||
|
/* avail_map is zero-initialised by mt76_connac_mcu_add_tlv */
|
||||||
|
|
||||||
|
/* Deactivate peer record and release connection index */
|
||||||
if (mt7925_nan_peer_rec_tlv(skb, sta, msta, false)) {
|
if (mt7925_nan_peer_rec_tlv(skb, sta, msta, false)) {
|
||||||
dev_kfree_skb(skb);
|
dev_kfree_skb(skb);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|||||||
Reference in New Issue
Block a user