@@ -2411,9 +2411,9 @@ int mt7996_mcu_add_dev_info(struct mt7996_phy *phy, struct ieee80211_vif *vif,
2411
2411
}
2412
2412
2413
2413
static 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 )
2417
2417
{
2418
2418
struct bss_bcn_cntdwn_tlv * info ;
2419
2419
struct tlv * tlv ;
@@ -2422,7 +2422,7 @@ mt7996_mcu_beacon_cntdwn(struct ieee80211_vif *vif, struct sk_buff *rskb,
2422
2422
if (!offs -> cntdwn_counter_offs [0 ])
2423
2423
return ;
2424
2424
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 ;
2426
2426
2427
2427
tlv = mt7996_mcu_add_uni_tlv (rskb , tag , sizeof (* info ));
2428
2428
@@ -2432,16 +2432,13 @@ mt7996_mcu_beacon_cntdwn(struct ieee80211_vif *vif, struct sk_buff *rskb,
2432
2432
2433
2433
static void
2434
2434
mt7996_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 ,
2436
2436
struct ieee80211_mutable_offsets * offs )
2437
2437
{
2438
2438
struct bss_bcn_mbss_tlv * mbss ;
2439
2439
const struct element * elem ;
2440
2440
struct tlv * tlv ;
2441
2441
2442
- if (!vif -> bss_conf .bssid_indicator )
2443
- return ;
2444
-
2445
2442
tlv = mt7996_mcu_add_uni_tlv (rskb , UNI_BSS_INFO_BCN_MBSSID , sizeof (* mbss ));
2446
2443
2447
2444
mbss = (struct bss_bcn_mbss_tlv * )tlv ;
@@ -2484,7 +2481,8 @@ mt7996_mcu_beacon_mbss(struct sk_buff *rskb, struct sk_buff *skb,
2484
2481
}
2485
2482
2486
2483
static 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 ,
2488
2486
struct sk_buff * rskb , struct sk_buff * skb ,
2489
2487
struct bss_bcn_content_tlv * bcn ,
2490
2488
struct ieee80211_mutable_offsets * offs )
@@ -2498,9 +2496,9 @@ mt7996_mcu_beacon_cont(struct mt7996_dev *dev, struct ieee80211_vif *vif,
2498
2496
if (offs -> cntdwn_counter_offs [0 ]) {
2499
2497
u16 offset = offs -> cntdwn_counter_offs [0 ];
2500
2498
2501
- if (vif -> bss_conf . csa_active )
2499
+ if (link_conf -> csa_active )
2502
2500
bcn -> csa_ie_pos = cpu_to_le16 (offset - 4 );
2503
- if (vif -> bss_conf . color_change_active )
2501
+ if (link_conf -> color_change_active )
2504
2502
bcn -> bcc_ie_pos = cpu_to_le16 (offset - 3 );
2505
2503
}
2506
2504
@@ -2511,28 +2509,30 @@ mt7996_mcu_beacon_cont(struct mt7996_dev *dev, struct ieee80211_vif *vif,
2511
2509
memcpy (buf + MT_TXD_SIZE , skb -> data , skb -> len );
2512
2510
}
2513
2511
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 )
2516
2514
{
2517
2515
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 );
2520
2517
struct ieee80211_mutable_offsets offs ;
2521
2518
struct ieee80211_tx_info * info ;
2522
2519
struct sk_buff * skb , * rskb ;
2523
2520
struct tlv * tlv ;
2524
2521
struct bss_bcn_content_tlv * bcn ;
2525
2522
int len ;
2526
2523
2527
- if (vif -> bss_conf . nontransmitted )
2524
+ if (link_conf -> nontransmitted )
2528
2525
return 0 ;
2529
2526
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 ,
2531
2531
MT7996_MAX_BSS_OFFLOAD_SIZE );
2532
2532
if (IS_ERR (rskb ))
2533
2533
return PTR_ERR (rskb );
2534
2534
2535
- skb = ieee80211_beacon_get_template (hw , vif , & offs , 0 );
2535
+ skb = ieee80211_beacon_get_template (hw , vif , & offs , link_conf -> link_id );
2536
2536
if (!skb ) {
2537
2537
dev_kfree_skb (rskb );
2538
2538
return - EINVAL ;
@@ -2546,21 +2546,22 @@ int mt7996_mcu_add_beacon(struct ieee80211_hw *hw,
2546
2546
}
2547
2547
2548
2548
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 );
2550
2550
2551
2551
len = ALIGN (sizeof (* bcn ) + MT_TXD_SIZE + skb -> len , 4 );
2552
2552
tlv = mt7996_mcu_add_uni_tlv (rskb , UNI_BSS_INFO_BCN_CONTENT , len );
2553
2553
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 )
2556
2556
goto out ;
2557
2557
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 );
2561
2562
out :
2562
2563
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 ,
2564
2565
MCU_WMWA_UNI_CMD (BSS_INFO_UPDATE ), true);
2565
2566
}
2566
2567
0 commit comments