@@ -62,7 +62,7 @@ static struct mt76_wcid *mt7996_rx_get_wcid(struct mt7996_dev *dev,
6262 int i ;
6363
6464 wcid = mt76_wcid_ptr (dev , idx );
65- if (!wcid )
65+ if (!wcid || ! wcid -> sta )
6666 return NULL ;
6767
6868 if (!mt7996_band_valid (dev , band_idx ))
@@ -903,8 +903,12 @@ void mt7996_mac_write_txwi(struct mt7996_dev *dev, __le32 *txwi,
903903 IEEE80211_TX_CTRL_MLO_LINK );
904904
905905 mvif = vif ? (struct mt7996_vif * )vif -> drv_priv : NULL ;
906- if (mvif )
907- mlink = rcu_dereference (mvif -> mt76 .link [link_id ]);
906+ if (mvif ) {
907+ if (wcid -> offchannel )
908+ mlink = rcu_dereference (mvif -> mt76 .offchannel_link );
909+ if (!mlink )
910+ mlink = rcu_dereference (mvif -> mt76 .link [link_id ]);
911+ }
908912
909913 if (mlink ) {
910914 omac_idx = mlink -> omac_idx ;
@@ -1243,8 +1247,10 @@ mt7996_mac_tx_free(struct mt7996_dev *dev, void *data, int len)
12431247 idx = FIELD_GET (MT_TXFREE_INFO_WLAN_ID , info );
12441248 wcid = mt76_wcid_ptr (dev , idx );
12451249 sta = wcid_to_sta (wcid );
1246- if (!sta )
1250+ if (!sta ) {
1251+ link_sta = NULL ;
12471252 goto next ;
1253+ }
12481254
12491255 link_sta = rcu_dereference (sta -> link [wcid -> link_id ]);
12501256 if (!link_sta )
@@ -1694,43 +1700,53 @@ mt7996_wait_reset_state(struct mt7996_dev *dev, u32 state)
16941700static void
16951701mt7996_update_vif_beacon (void * priv , u8 * mac , struct ieee80211_vif * vif )
16961702{
1697- struct ieee80211_hw * hw = priv ;
1703+ struct ieee80211_bss_conf * link_conf ;
1704+ struct mt7996_phy * phy = priv ;
1705+ struct mt7996_dev * dev = phy -> dev ;
1706+ unsigned int link_id ;
1707+
16981708
16991709 switch (vif -> type ) {
17001710 case NL80211_IFTYPE_MESH_POINT :
17011711 case NL80211_IFTYPE_ADHOC :
17021712 case NL80211_IFTYPE_AP :
1703- mt7996_mcu_add_beacon (hw , vif , & vif -> bss_conf );
17041713 break ;
17051714 default :
1706- break ;
1715+ return ;
1716+ }
1717+
1718+ for_each_vif_active_link (vif , link_conf , link_id ) {
1719+ struct mt7996_vif_link * link ;
1720+
1721+ link = mt7996_vif_link (dev , vif , link_id );
1722+ if (!link || link -> phy != phy )
1723+ continue ;
1724+
1725+ mt7996_mcu_add_beacon (dev -> mt76 .hw , vif , link_conf );
17071726 }
17081727}
17091728
1729+ void mt7996_mac_update_beacons (struct mt7996_phy * phy )
1730+ {
1731+ ieee80211_iterate_active_interfaces (phy -> mt76 -> hw ,
1732+ IEEE80211_IFACE_ITER_RESUME_ALL ,
1733+ mt7996_update_vif_beacon , phy );
1734+ }
1735+
17101736static void
17111737mt7996_update_beacons (struct mt7996_dev * dev )
17121738{
17131739 struct mt76_phy * phy2 , * phy3 ;
17141740
1715- ieee80211_iterate_active_interfaces (dev -> mt76 .hw ,
1716- IEEE80211_IFACE_ITER_RESUME_ALL ,
1717- mt7996_update_vif_beacon , dev -> mt76 .hw );
1741+ mt7996_mac_update_beacons (& dev -> phy );
17181742
17191743 phy2 = dev -> mt76 .phys [MT_BAND1 ];
1720- if (!phy2 )
1721- return ;
1722-
1723- ieee80211_iterate_active_interfaces (phy2 -> hw ,
1724- IEEE80211_IFACE_ITER_RESUME_ALL ,
1725- mt7996_update_vif_beacon , phy2 -> hw );
1744+ if (phy2 )
1745+ mt7996_mac_update_beacons (phy2 -> priv );
17261746
17271747 phy3 = dev -> mt76 .phys [MT_BAND2 ];
1728- if (!phy3 )
1729- return ;
1730-
1731- ieee80211_iterate_active_interfaces (phy3 -> hw ,
1732- IEEE80211_IFACE_ITER_RESUME_ALL ,
1733- mt7996_update_vif_beacon , phy3 -> hw );
1748+ if (phy3 )
1749+ mt7996_mac_update_beacons (phy3 -> priv );
17341750}
17351751
17361752void mt7996_tx_token_put (struct mt7996_dev * dev )
0 commit comments