Lines Matching refs:mt76

18 	if (phy && test_bit(MT76_STATE_RUNNING, &phy->mt76->state))
23 return phy && test_bit(MT76_STATE_RUNNING, &phy->mt76->state);
39 if (is_mt7992(&dev->mt76)) {
48 mt7996_mac_enable_nf(dev, phy->mt76->band_idx);
70 set_bit(MT76_STATE_RUNNING, &phy->mt76->state);
72 ieee80211_queue_delayed_work(hw, &phy->mt76->mac_work,
89 mutex_lock(&dev->mt76.mutex);
91 mutex_unlock(&dev->mt76.mutex);
101 cancel_delayed_work_sync(&phy->mt76->mac_work);
103 mutex_lock(&dev->mt76.mutex);
107 clear_bit(MT76_STATE_RUNNING, &phy->mt76->state);
109 mutex_unlock(&dev->mt76.mutex);
186 u8 band_idx = phy->mt76->band_idx;
189 mutex_lock(&dev->mt76.mutex);
195 mvif->mt76.idx = __ffs64(~dev->mt76.vif_mask);
196 if (mvif->mt76.idx >= mt7996_max_interface_num(dev)) {
206 mvif->mt76.omac_idx = idx;
208 mvif->mt76.band_idx = band_idx;
209 mvif->mt76.wmm_idx = vif->type != NL80211_IFTYPE_AP;
215 dev->mt76.vif_mask |= BIT_ULL(mvif->mt76.idx);
216 phy->omac_mask |= BIT_ULL(mvif->mt76.omac_idx);
218 idx = MT7996_WTBL_RESERVED - mvif->mt76.idx;
237 (!mvif->mt76.omac_idx || mvif->mt76.omac_idx > 3))
241 if (phy->mt76->chandef.chan->band != NL80211_BAND_2GHZ)
242 mvif->mt76.basic_rates_idx = MT7996_BASIC_RATES_TBL + 4;
244 mvif->mt76.basic_rates_idx = MT7996_BASIC_RATES_TBL;
254 rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);
257 mutex_unlock(&dev->mt76.mutex);
279 rcu_assign_pointer(dev->mt76.wcid[idx], NULL);
281 mutex_lock(&dev->mt76.mutex);
282 dev->mt76.vif_mask &= ~BIT_ULL(mvif->mt76.idx);
283 phy->omac_mask &= ~BIT_ULL(mvif->mt76.omac_idx);
284 mutex_unlock(&dev->mt76.mutex);
286 spin_lock_bh(&dev->mt76.sta_poll_lock);
289 spin_unlock_bh(&dev->mt76.sta_poll_lock);
291 mt76_wcid_cleanup(&dev->mt76, &msta->wcid);
299 cancel_delayed_work_sync(&phy->mt76->mac_work);
301 mutex_lock(&dev->mt76.mutex);
302 set_bit(MT76_RESET, &phy->mt76->state);
304 mt76_set_channel(phy->mt76);
317 clear_bit(MT76_RESET, &phy->mt76->state);
318 mutex_unlock(&dev->mt76.mutex);
320 mt76_txq_schedule_all(phy->mt76);
322 ieee80211_queue_delayed_work(phy->mt76->hw,
323 &phy->mt76->mac_work,
378 mutex_lock(&dev->mt76.mutex);
380 if (cmd == SET_KEY && !sta && !mvif->mt76.cipher) {
381 mvif->mt76.cipher = mt76_connac_mcu_get_cipher(key->cipher);
393 mt76_wcid_key_setup(&dev->mt76, wcid, key);
398 err = mt7996_mcu_add_key(&dev->mt76, vif, key,
402 mutex_unlock(&dev->mt76.mutex);
428 mutex_lock(&dev->mt76.mutex);
438 mt76_rmw_field(dev, MT_DMA_DCR0(phy->mt76->band_idx),
440 mt76_wr(dev, MT_WF_RFCR(phy->mt76->band_idx), phy->rxfilter);
443 mutex_unlock(&dev->mt76.mutex);
488 mutex_lock(&dev->mt76.mutex);
514 mt76_wr(dev, MT_WF_RFCR(phy->mt76->band_idx), phy->rxfilter);
517 mt76_clear(dev, MT_WF_RFCR1(phy->mt76->band_idx), ctl_flags);
519 mt76_set(dev, MT_WF_RFCR1(phy->mt76->band_idx), ctl_flags);
521 mutex_unlock(&dev->mt76.mutex);
535 if (mvif->mt76.omac_idx > HW_BSSID_MAX)
562 idx = MT7996_BEACON_RATES_TBL + 2 * phy->mt76->band_idx;
583 u8 band = mvif->mt76.band_idx;
606 mutex_lock(&dev->mt76.mutex);
664 mutex_unlock(&dev->mt76.mutex);
674 mutex_lock(&dev->mt76.mutex);
676 mutex_unlock(&dev->mt76.mutex);
682 struct mt7996_dev *dev = container_of(mdev, struct mt7996_dev, mt76);
685 u8 band_idx = mvif->phy->mt76->band_idx;
688 idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7996_WTBL_STA);
715 struct mt7996_dev *dev = container_of(mdev, struct mt7996_dev, mt76);
743 struct mt76_wcid *wcid = &dev->mt76.global_wcid;
767 mutex_lock(&phy->dev->mt76.mutex);
769 mutex_unlock(&phy->dev->mt76.mutex);
793 mutex_lock(&dev->mt76.mutex);
796 mt76_rx_aggr_start(&dev->mt76, &msta->wcid, tid, ssn,
801 mt76_rx_aggr_stop(&dev->mt76, &msta->wcid, tid);
826 mutex_unlock(&dev->mt76.mutex);
855 mutex_lock(&dev->mt76.mutex);
862 mutex_unlock(&dev->mt76.mutex);
877 lockdep_assert_held(&dev->mt76.mutex);
879 n = mvif->mt76.omac_idx > HW_BSSID_MAX ? HW_BSSID_0
880 : mvif->mt76.omac_idx;
882 mt76_rmw(dev, MT_LPON_TCR(phy->mt76->band_idx, n), MT_LPON_TCR_SW_MODE,
884 tsf.t32[0] = mt76_rr(dev, MT_LPON_UTTR0(phy->mt76->band_idx));
885 tsf.t32[1] = mt76_rr(dev, MT_LPON_UTTR1(phy->mt76->band_idx));
897 mutex_lock(&dev->mt76.mutex);
899 mutex_unlock(&dev->mt76.mutex);
917 mutex_lock(&dev->mt76.mutex);
919 n = mvif->mt76.omac_idx > HW_BSSID_MAX ? HW_BSSID_0
920 : mvif->mt76.omac_idx;
921 mt76_wr(dev, MT_LPON_UTTR0(phy->mt76->band_idx), tsf.t32[0]);
922 mt76_wr(dev, MT_LPON_UTTR1(phy->mt76->band_idx), tsf.t32[1]);
924 mt76_rmw(dev, MT_LPON_TCR(phy->mt76->band_idx, n), MT_LPON_TCR_SW_MODE,
927 mutex_unlock(&dev->mt76.mutex);
943 mutex_lock(&dev->mt76.mutex);
945 n = mvif->mt76.omac_idx > HW_BSSID_MAX ? HW_BSSID_0
946 : mvif->mt76.omac_idx;
947 mt76_wr(dev, MT_LPON_UTTR0(phy->mt76->band_idx), tsf.t32[0]);
948 mt76_wr(dev, MT_LPON_UTTR1(phy->mt76->band_idx), tsf.t32[1]);
950 mt76_rmw(dev, MT_LPON_TCR(phy->mt76->band_idx, n), MT_LPON_TCR_SW_MODE,
953 mutex_unlock(&dev->mt76.mutex);
962 mutex_lock(&dev->mt76.mutex);
965 mutex_unlock(&dev->mt76.mutex);
974 u8 band_idx = phy->mt76->band_idx, shift = dev->chainshift[band_idx];
982 mutex_lock(&dev->mt76.mutex);
984 phy->mt76->antenna_mask = tx_ant;
988 phy->mt76->chainmask = ((dev->chainmask >> shift) &
991 phy->mt76->chainmask = (dev->chainmask >> shift) << shift;
993 phy->mt76->chainmask = tx_ant << shift;
995 mt76_set_stream_caps(phy->mt76, true);
1000 mutex_unlock(&dev->mt76.mutex);
1044 if (mtk_wed_device_active(&phy->dev->mt76.mmio.wed)) {
1065 spin_lock_bh(&dev->mt76.sta_poll_lock);
1069 spin_unlock_bh(&dev->mt76.sta_poll_lock);
1271 if (msta->vif->mt76.idx != wi->idx)
1288 .idx = mvif->mt76.idx,
1293 mutex_lock(&dev->mt76.mutex);
1308 data[ei++] = phy->mt76->aggr_stats[i];
1358 mutex_unlock(&dev->mt76.mutex);
1365 dev_err(dev->mt76.dev, "ei: %d MT7996_SSTATS_LEN: %d",
1377 mutex_lock(&dev->mt76.mutex);
1379 mutex_unlock(&dev->mt76.mutex);
1391 mutex_lock(&dev->mt76.mutex);
1393 if (dev->mt76.region == NL80211_DFS_UNSET)
1426 mutex_unlock(&dev->mt76.mutex);
1443 struct mtk_wed_device *wed = &dev->mt76.mmio.wed;
1445 if (phy != &dev->phy && phy->mt76->band_idx == MT_BAND2)
1446 wed = &dev->mt76.mmio.wed_hif2;
1457 path->mtk_wdma.bss = mvif->mt76.idx;