@@ -842,75 +842,6 @@ u32 mt7915_wed_init_buf(void *ptr, dma_addr_t phys, int token_id)
842842 return MT_TXD_SIZE + sizeof (* txp );
843843}
844844
845- static void
846- mt7915_tx_check_aggr (struct ieee80211_sta * sta , __le32 * txwi )
847- {
848- struct mt7915_sta * msta ;
849- u16 fc , tid ;
850- u32 val ;
851-
852- if (!sta || !(sta -> deflink .ht_cap .ht_supported || sta -> deflink .he_cap .has_he ))
853- return ;
854-
855- tid = le32_get_bits (txwi [1 ], MT_TXD1_TID );
856- if (tid >= 6 ) /* skip VO queue */
857- return ;
858-
859- val = le32_to_cpu (txwi [2 ]);
860- fc = FIELD_GET (MT_TXD2_FRAME_TYPE , val ) << 2 |
861- FIELD_GET (MT_TXD2_SUB_TYPE , val ) << 4 ;
862- if (unlikely (fc != (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_DATA )))
863- return ;
864-
865- msta = (struct mt7915_sta * )sta -> drv_priv ;
866- if (!test_and_set_bit (tid , & msta -> wcid .ampdu_state ))
867- ieee80211_start_tx_ba_session (sta , tid , 0 );
868- }
869-
870- static void
871- mt7915_txwi_free (struct mt7915_dev * dev , struct mt76_txwi_cache * t ,
872- struct ieee80211_sta * sta , struct list_head * free_list )
873- {
874- struct mt76_dev * mdev = & dev -> mt76 ;
875- struct mt7915_sta * msta ;
876- struct mt76_wcid * wcid ;
877- __le32 * txwi ;
878- u16 wcid_idx ;
879-
880- mt76_connac_txp_skb_unmap (mdev , t );
881- if (!t -> skb )
882- goto out ;
883-
884- txwi = (__le32 * )mt76_get_txwi_ptr (mdev , t );
885- if (sta ) {
886- wcid = (struct mt76_wcid * )sta -> drv_priv ;
887- wcid_idx = wcid -> idx ;
888- } else {
889- wcid_idx = le32_get_bits (txwi [1 ], MT_TXD1_WLAN_IDX );
890- wcid = rcu_dereference (dev -> mt76 .wcid [wcid_idx ]);
891-
892- if (wcid && wcid -> sta ) {
893- msta = container_of (wcid , struct mt7915_sta , wcid );
894- sta = container_of ((void * )msta , struct ieee80211_sta ,
895- drv_priv );
896- spin_lock_bh (& mdev -> sta_poll_lock );
897- if (list_empty (& msta -> wcid .poll_list ))
898- list_add_tail (& msta -> wcid .poll_list ,
899- & mdev -> sta_poll_list );
900- spin_unlock_bh (& mdev -> sta_poll_lock );
901- }
902- }
903-
904- if (sta && likely (t -> skb -> protocol != cpu_to_be16 (ETH_P_PAE )))
905- mt7915_tx_check_aggr (sta , txwi );
906-
907- __mt76_tx_complete_skb (mdev , wcid_idx , t -> skb , free_list );
908-
909- out :
910- t -> skb = NULL ;
911- mt76_put_txwi (mdev , t );
912- }
913-
914845static void
915846mt7915_mac_tx_free_prepare (struct mt7915_dev * dev )
916847{
@@ -1031,7 +962,7 @@ mt7915_mac_tx_free(struct mt7915_dev *dev, void *data, int len)
1031962 if (!txwi )
1032963 continue ;
1033964
1034- mt7915_txwi_free ( dev , txwi , sta , & free_list );
965+ mt76_connac2_txwi_free ( mdev , txwi , sta , & free_list );
1035966 }
1036967 }
1037968
@@ -1063,7 +994,7 @@ mt7915_mac_tx_free_v0(struct mt7915_dev *dev, void *data, int len)
1063994 if (!txwi )
1064995 continue ;
1065996
1066- mt7915_txwi_free ( dev , txwi , NULL , & free_list );
997+ mt76_connac2_txwi_free ( mdev , txwi , NULL , & free_list );
1067998 }
1068999
10691000 mt7915_mac_tx_free_done (dev , & free_list , wake );
@@ -1378,20 +1309,6 @@ mt7915_update_beacons(struct mt7915_dev *dev)
13781309 mt7915_update_vif_beacon , mphy_ext -> hw );
13791310}
13801311
1381- void mt7915_tx_token_put (struct mt7915_dev * dev )
1382- {
1383- struct mt76_txwi_cache * txwi ;
1384- int id ;
1385-
1386- spin_lock_bh (& dev -> mt76 .token_lock );
1387- idr_for_each_entry (& dev -> mt76 .token , txwi , id ) {
1388- mt7915_txwi_free (dev , txwi , NULL , NULL );
1389- dev -> mt76 .token_count -- ;
1390- }
1391- spin_unlock_bh (& dev -> mt76 .token_lock );
1392- idr_destroy (& dev -> mt76 .token );
1393- }
1394-
13951312static int
13961313mt7915_mac_restart (struct mt7915_dev * dev )
13971314{
@@ -1440,7 +1357,7 @@ mt7915_mac_restart(struct mt7915_dev *dev)
14401357 napi_disable (& dev -> mt76 .tx_napi );
14411358
14421359 /* token reinit */
1443- mt7915_tx_token_put ( dev );
1360+ mt76_connac2_tx_token_put ( & dev -> mt76 );
14441361 idr_init (& dev -> mt76 .token );
14451362
14461363 mt7915_dma_reset (dev , true);
@@ -1633,7 +1550,7 @@ void mt7915_mac_reset_work(struct work_struct *work)
16331550 if (mt7915_wait_reset_state (dev , MT_MCU_CMD_RESET_DONE )) {
16341551 mt7915_dma_reset (dev , false);
16351552
1636- mt7915_tx_token_put ( dev );
1553+ mt76_connac2_tx_token_put ( & dev -> mt76 );
16371554 idr_init (& dev -> mt76 .token );
16381555
16391556 mt76_wr (dev , MT_MCU_INT_EVENT , MT_MCU_INT_EVENT_DMA_INIT );
0 commit comments