@@ -2411,9 +2411,9 @@ int mt7996_mcu_add_dev_info(struct mt7996_phy *phy, struct ieee80211_vif *vif,
24112411}
24122412
24132413static void
2414- mt7996_mcu_beacon_cntdwn (struct ieee80211_vif * vif , struct sk_buff * rskb ,
2415- struct sk_buff * skb ,
2416- struct ieee80211_mutable_offsets * offs )
2414+ mt7996_mcu_beacon_cntdwn (struct sk_buff * rskb , struct sk_buff * skb ,
2415+ struct ieee80211_mutable_offsets * offs ,
2416+ bool csa )
24172417{
24182418 struct bss_bcn_cntdwn_tlv * info ;
24192419 struct tlv * tlv ;
@@ -2422,7 +2422,7 @@ mt7996_mcu_beacon_cntdwn(struct ieee80211_vif *vif, struct sk_buff *rskb,
24222422 if (!offs -> cntdwn_counter_offs [0 ])
24232423 return ;
24242424
2425- tag = vif -> bss_conf . csa_active ? UNI_BSS_INFO_BCN_CSA : UNI_BSS_INFO_BCN_BCC ;
2425+ tag = csa ? UNI_BSS_INFO_BCN_CSA : UNI_BSS_INFO_BCN_BCC ;
24262426
24272427 tlv = mt7996_mcu_add_uni_tlv (rskb , tag , sizeof (* info ));
24282428
@@ -2432,16 +2432,13 @@ mt7996_mcu_beacon_cntdwn(struct ieee80211_vif *vif, struct sk_buff *rskb,
24322432
24332433static void
24342434mt7996_mcu_beacon_mbss (struct sk_buff * rskb , struct sk_buff * skb ,
2435- struct ieee80211_vif * vif , struct bss_bcn_content_tlv * bcn ,
2435+ struct bss_bcn_content_tlv * bcn ,
24362436 struct ieee80211_mutable_offsets * offs )
24372437{
24382438 struct bss_bcn_mbss_tlv * mbss ;
24392439 const struct element * elem ;
24402440 struct tlv * tlv ;
24412441
2442- if (!vif -> bss_conf .bssid_indicator )
2443- return ;
2444-
24452442 tlv = mt7996_mcu_add_uni_tlv (rskb , UNI_BSS_INFO_BCN_MBSSID , sizeof (* mbss ));
24462443
24472444 mbss = (struct bss_bcn_mbss_tlv * )tlv ;
@@ -2484,7 +2481,8 @@ mt7996_mcu_beacon_mbss(struct sk_buff *rskb, struct sk_buff *skb,
24842481}
24852482
24862483static void
2487- mt7996_mcu_beacon_cont (struct mt7996_dev * dev , struct ieee80211_vif * vif ,
2484+ mt7996_mcu_beacon_cont (struct mt7996_dev * dev ,
2485+ struct ieee80211_bss_conf * link_conf ,
24882486 struct sk_buff * rskb , struct sk_buff * skb ,
24892487 struct bss_bcn_content_tlv * bcn ,
24902488 struct ieee80211_mutable_offsets * offs )
@@ -2498,9 +2496,9 @@ mt7996_mcu_beacon_cont(struct mt7996_dev *dev, struct ieee80211_vif *vif,
24982496 if (offs -> cntdwn_counter_offs [0 ]) {
24992497 u16 offset = offs -> cntdwn_counter_offs [0 ];
25002498
2501- if (vif -> bss_conf . csa_active )
2499+ if (link_conf -> csa_active )
25022500 bcn -> csa_ie_pos = cpu_to_le16 (offset - 4 );
2503- if (vif -> bss_conf . color_change_active )
2501+ if (link_conf -> color_change_active )
25042502 bcn -> bcc_ie_pos = cpu_to_le16 (offset - 3 );
25052503 }
25062504
@@ -2511,28 +2509,30 @@ mt7996_mcu_beacon_cont(struct mt7996_dev *dev, struct ieee80211_vif *vif,
25112509 memcpy (buf + MT_TXD_SIZE , skb -> data , skb -> len );
25122510}
25132511
2514- int mt7996_mcu_add_beacon (struct ieee80211_hw * hw ,
2515- struct ieee80211_vif * vif , int en )
2512+ int mt7996_mcu_add_beacon (struct ieee80211_hw * hw , struct ieee80211_vif * vif ,
2513+ struct ieee80211_bss_conf * link_conf )
25162514{
25172515 struct mt7996_dev * dev = mt7996_hw_dev (hw );
2518- struct mt7996_phy * phy = mt7996_hw_phy (hw );
2519- struct mt7996_vif * mvif = (struct mt7996_vif * )vif -> drv_priv ;
2516+ struct mt76_vif_link * mlink = mt76_vif_conf_link (& dev -> mt76 , vif , link_conf );
25202517 struct ieee80211_mutable_offsets offs ;
25212518 struct ieee80211_tx_info * info ;
25222519 struct sk_buff * skb , * rskb ;
25232520 struct tlv * tlv ;
25242521 struct bss_bcn_content_tlv * bcn ;
25252522 int len ;
25262523
2527- if (vif -> bss_conf . nontransmitted )
2524+ if (link_conf -> nontransmitted )
25282525 return 0 ;
25292526
2530- rskb = __mt7996_mcu_alloc_bss_req (& dev -> mt76 , & mvif -> deflink .mt76 ,
2527+ if (!mlink )
2528+ return - EINVAL ;
2529+
2530+ rskb = __mt7996_mcu_alloc_bss_req (& dev -> mt76 , mlink ,
25312531 MT7996_MAX_BSS_OFFLOAD_SIZE );
25322532 if (IS_ERR (rskb ))
25332533 return PTR_ERR (rskb );
25342534
2535- skb = ieee80211_beacon_get_template (hw , vif , & offs , 0 );
2535+ skb = ieee80211_beacon_get_template (hw , vif , & offs , link_conf -> link_id );
25362536 if (!skb ) {
25372537 dev_kfree_skb (rskb );
25382538 return - EINVAL ;
@@ -2546,21 +2546,22 @@ int mt7996_mcu_add_beacon(struct ieee80211_hw *hw,
25462546 }
25472547
25482548 info = IEEE80211_SKB_CB (skb );
2549- info -> hw_queue |= FIELD_PREP (MT_TX_HW_QUEUE_PHY , phy -> mt76 -> band_idx );
2549+ info -> hw_queue |= FIELD_PREP (MT_TX_HW_QUEUE_PHY , mlink -> band_idx );
25502550
25512551 len = ALIGN (sizeof (* bcn ) + MT_TXD_SIZE + skb -> len , 4 );
25522552 tlv = mt7996_mcu_add_uni_tlv (rskb , UNI_BSS_INFO_BCN_CONTENT , len );
25532553 bcn = (struct bss_bcn_content_tlv * )tlv ;
2554- bcn -> enable = en ;
2555- if (!en )
2554+ bcn -> enable = link_conf -> enable_beacon ;
2555+ if (!bcn -> enable )
25562556 goto out ;
25572557
2558- mt7996_mcu_beacon_cont (dev , vif , rskb , skb , bcn , & offs );
2559- mt7996_mcu_beacon_mbss (rskb , skb , vif , bcn , & offs );
2560- mt7996_mcu_beacon_cntdwn (vif , rskb , skb , & offs );
2558+ mt7996_mcu_beacon_cont (dev , link_conf , rskb , skb , bcn , & offs );
2559+ if (link_conf -> bssid_indicator )
2560+ mt7996_mcu_beacon_mbss (rskb , skb , bcn , & offs );
2561+ mt7996_mcu_beacon_cntdwn (rskb , skb , & offs , link_conf -> csa_active );
25612562out :
25622563 dev_kfree_skb (skb );
2563- return mt76_mcu_skb_send_msg (& phy -> dev -> mt76 , rskb ,
2564+ return mt76_mcu_skb_send_msg (& dev -> mt76 , rskb ,
25642565 MCU_WMWA_UNI_CMD (BSS_INFO_UPDATE ), true);
25652566}
25662567
0 commit comments