Lines Matching full:mt76
20 return phy && test_bit(MT76_STATE_RUNNING, &phy->mt76->state); in mt7915_dev_running()
32 mutex_lock(&dev->mt76.mutex); in mt7915_start()
37 ret = mt76_connac_mcu_set_pm(&dev->mt76, 0, 0); in mt7915_start()
49 ret = mt76_connac_mcu_set_pm(&dev->mt76, 1, 0); in mt7915_start()
60 ret = mt76_connac_mcu_set_rts_thresh(&dev->mt76, 0x92b, in mt7915_start()
73 set_bit(MT76_STATE_RUNNING, &phy->mt76->state); in mt7915_start()
75 if (!mt76_testmode_enabled(phy->mt76)) in mt7915_start()
76 ieee80211_queue_delayed_work(hw, &phy->mt76->mac_work, in mt7915_start()
83 mutex_unlock(&dev->mt76.mutex); in mt7915_start()
93 cancel_delayed_work_sync(&phy->mt76->mac_work); in mt7915_stop()
95 mutex_lock(&dev->mt76.mutex); in mt7915_stop()
97 mt76_testmode_reset(phy->mt76, true); in mt7915_stop()
99 clear_bit(MT76_STATE_RUNNING, &phy->mt76->state); in mt7915_stop()
102 mt76_connac_mcu_set_pm(&dev->mt76, 1, 1); in mt7915_stop()
107 mt76_connac_mcu_set_pm(&dev->mt76, 0, 1); in mt7915_stop()
111 mutex_unlock(&dev->mt76.mutex); in mt7915_stop()
191 mutex_lock(&dev->mt76.mutex); in mt7915_add_interface()
193 mt76_testmode_reset(phy->mt76, true); in mt7915_add_interface()
199 mvif->mt76.idx = __ffs64(~dev->mt76.vif_mask); in mt7915_add_interface()
200 if (mvif->mt76.idx >= (MT7915_MAX_INTERFACES << dev->dbdc_support)) { in mt7915_add_interface()
210 mvif->mt76.omac_idx = idx; in mt7915_add_interface()
212 mvif->mt76.band_idx = phy->band_idx; in mt7915_add_interface()
214 mvif->mt76.wmm_idx = vif->type != NL80211_IFTYPE_AP; in mt7915_add_interface()
216 mvif->mt76.wmm_idx += 2; in mt7915_add_interface()
222 dev->mt76.vif_mask |= BIT_ULL(mvif->mt76.idx); in mt7915_add_interface()
223 phy->omac_mask |= BIT_ULL(mvif->mt76.omac_idx); in mt7915_add_interface()
225 idx = MT7915_WTBL_RESERVED - mvif->mt76.idx; in mt7915_add_interface()
244 (!mvif->mt76.omac_idx || mvif->mt76.omac_idx > 3)) in mt7915_add_interface()
253 rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid); in mt7915_add_interface()
256 mutex_unlock(&dev->mt76.mutex); in mt7915_add_interface()
273 mutex_lock(&dev->mt76.mutex); in mt7915_remove_interface()
274 mt76_testmode_reset(phy->mt76, true); in mt7915_remove_interface()
275 mutex_unlock(&dev->mt76.mutex); in mt7915_remove_interface()
282 rcu_assign_pointer(dev->mt76.wcid[idx], NULL); in mt7915_remove_interface()
284 mutex_lock(&dev->mt76.mutex); in mt7915_remove_interface()
285 dev->mt76.vif_mask &= ~BIT_ULL(mvif->mt76.idx); in mt7915_remove_interface()
286 phy->omac_mask &= ~BIT_ULL(mvif->mt76.omac_idx); in mt7915_remove_interface()
287 mutex_unlock(&dev->mt76.mutex); in mt7915_remove_interface()
294 mt76_packet_id_flush(&dev->mt76, &msta->wcid); in mt7915_remove_interface()
302 cancel_delayed_work_sync(&phy->mt76->mac_work); in mt7915_set_channel()
304 mutex_lock(&dev->mt76.mutex); in mt7915_set_channel()
305 set_bit(MT76_RESET, &phy->mt76->state); in mt7915_set_channel()
307 mt76_set_channel(phy->mt76); in mt7915_set_channel()
327 clear_bit(MT76_RESET, &phy->mt76->state); in mt7915_set_channel()
328 mutex_unlock(&dev->mt76.mutex); in mt7915_set_channel()
330 mt76_txq_schedule_all(phy->mt76); in mt7915_set_channel()
332 if (!mt76_testmode_enabled(phy->mt76)) in mt7915_set_channel()
333 ieee80211_queue_delayed_work(phy->mt76->hw, in mt7915_set_channel()
334 &phy->mt76->mac_work, in mt7915_set_channel()
383 mutex_lock(&dev->mt76.mutex); in mt7915_set_key()
385 if (cmd == SET_KEY && !sta && !mvif->mt76.cipher) { in mt7915_set_key()
386 mvif->mt76.cipher = mt76_connac_mcu_get_cipher(key->cipher); in mt7915_set_key()
397 mt76_wcid_key_setup(&dev->mt76, wcid, in mt7915_set_key()
400 err = mt76_connac_mcu_add_key(&dev->mt76, vif, &msta->bip, in mt7915_set_key()
404 mutex_unlock(&dev->mt76.mutex); in mt7915_set_key()
416 mutex_lock(&dev->mt76.mutex); in mt7915_set_sar_specs()
417 if (!cfg80211_chandef_valid(&phy->mt76->chandef)) in mt7915_set_sar_specs()
426 mutex_unlock(&dev->mt76.mutex); in mt7915_set_sar_specs()
440 if (phy->mt76->test.state != MT76_TM_STATE_OFF) { in mt7915_config()
441 mutex_lock(&dev->mt76.mutex); in mt7915_config()
442 mt76_testmode_reset(phy->mt76, false); in mt7915_config()
443 mutex_unlock(&dev->mt76.mutex); in mt7915_config()
459 mutex_lock(&dev->mt76.mutex); in mt7915_config()
471 mt76_testmode_reset(phy->mt76, true); in mt7915_config()
475 mutex_unlock(&dev->mt76.mutex); in mt7915_config()
515 mutex_lock(&dev->mt76.mutex); in mt7915_configure_filter()
548 mutex_unlock(&dev->mt76.mutex); in mt7915_configure_filter()
562 if (mvif->mt76.omac_idx > HW_BSSID_MAX) in mt7915_update_bss_color()
582 mutex_lock(&dev->mt76.mutex); in mt7915_bss_info_changed()
631 mutex_unlock(&dev->mt76.mutex); in mt7915_bss_info_changed()
641 mutex_lock(&dev->mt76.mutex); in mt7915_channel_switch_beacon()
643 mutex_unlock(&dev->mt76.mutex); in mt7915_channel_switch_beacon()
649 struct mt7915_dev *dev = container_of(mdev, struct mt7915_dev, mt76); in mt7915_mac_sta_add()
655 idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA); in mt7915_mac_sta_add()
681 struct mt7915_dev *dev = container_of(mdev, struct mt7915_dev, mt76); in mt7915_mac_sta_remove()
709 struct mt76_wcid *wcid = &dev->mt76.global_wcid; in mt7915_tx()
734 mutex_lock(&dev->mt76.mutex); in mt7915_set_rts_threshold()
735 ret = mt76_connac_mcu_set_rts_thresh(&dev->mt76, val, phy != &dev->phy); in mt7915_set_rts_threshold()
736 mutex_unlock(&dev->mt76.mutex); in mt7915_set_rts_threshold()
760 mutex_lock(&dev->mt76.mutex); in mt7915_ampdu_action()
763 mt76_rx_aggr_start(&dev->mt76, &msta->wcid, tid, ssn, in mt7915_ampdu_action()
768 mt76_rx_aggr_stop(&dev->mt76, &msta->wcid, tid); in mt7915_ampdu_action()
793 mutex_unlock(&dev->mt76.mutex); in mt7915_ampdu_action()
822 mutex_lock(&dev->mt76.mutex); in mt7915_get_stats()
829 mutex_unlock(&dev->mt76.mutex); in mt7915_get_stats()
845 lockdep_assert_held(&dev->mt76.mutex); in __mt7915_get_tsf()
847 n = mvif->mt76.omac_idx > HW_BSSID_MAX ? HW_BSSID_0 in __mt7915_get_tsf()
848 : mvif->mt76.omac_idx; in __mt7915_get_tsf()
850 if (is_mt7915(&dev->mt76)) in __mt7915_get_tsf()
869 mutex_lock(&dev->mt76.mutex); in mt7915_get_tsf()
871 mutex_unlock(&dev->mt76.mutex); in mt7915_get_tsf()
890 mutex_lock(&dev->mt76.mutex); in mt7915_set_tsf()
892 n = mvif->mt76.omac_idx > HW_BSSID_MAX ? HW_BSSID_0 in mt7915_set_tsf()
893 : mvif->mt76.omac_idx; in mt7915_set_tsf()
897 if (is_mt7915(&dev->mt76)) in mt7915_set_tsf()
904 mutex_unlock(&dev->mt76.mutex); in mt7915_set_tsf()
921 mutex_lock(&dev->mt76.mutex); in mt7915_offset_tsf()
923 n = mvif->mt76.omac_idx > HW_BSSID_MAX ? HW_BSSID_0 in mt7915_offset_tsf()
924 : mvif->mt76.omac_idx; in mt7915_offset_tsf()
928 if (is_mt7915(&dev->mt76)) in mt7915_offset_tsf()
935 mutex_unlock(&dev->mt76.mutex); in mt7915_offset_tsf()
944 mutex_lock(&dev->mt76.mutex); in mt7915_set_coverage_class()
947 mutex_unlock(&dev->mt76.mutex); in mt7915_set_coverage_class()
964 mutex_lock(&dev->mt76.mutex); in mt7915_set_antenna()
966 phy->mt76->antenna_mask = tx_ant; in mt7915_set_antenna()
971 phy->mt76->chainmask = tx_ant; in mt7915_set_antenna()
973 mt76_set_stream_caps(phy->mt76, true); in mt7915_set_antenna()
977 mutex_unlock(&dev->mt76.mutex); in mt7915_set_antenna()
992 if (is_mt7915(&phy->dev->mt76) && in mt7915_sta_statistics()
1017 if (mtk_wed_device_active(&phy->dev->mt76.mmio.wed)) { in mt7915_sta_statistics()
1095 mt76_connac_mcu_wtbl_update_hdr_trans(&dev->mt76, vif, sta); in mt7915_sta_set_4addr()
1111 mt76_connac_mcu_wtbl_update_hdr_trans(&dev->mt76, vif, sta); in mt7915_sta_set_decap_offload()
1241 if (msta->vif->mt76.idx != wi->idx) in mt7915_ethtool_worker()
1257 .idx = mvif->mt76.idx, in mt7915_get_et_stats()
1263 mutex_lock(&dev->mt76.mutex); in mt7915_get_et_stats()
1277 n = phy->band_idx ? ARRAY_SIZE(dev->mt76.aggr_stats) / 2 : 0; in mt7915_get_et_stats()
1279 data[ei++] = dev->mt76.aggr_stats[i + n]; in mt7915_get_et_stats()
1337 mutex_unlock(&dev->mt76.mutex); in mt7915_get_et_stats()
1344 dev_err(dev->mt76.dev, "ei: %d MT7915_SSTATS_LEN: %d", in mt7915_get_et_stats()
1356 mutex_lock(&dev->mt76.mutex); in mt7915_twt_teardown_request()
1358 mutex_unlock(&dev->mt76.mutex); in mt7915_twt_teardown_request()
1370 mutex_lock(&dev->mt76.mutex); in mt7915_set_radar_background()
1372 if (dev->mt76.region == NL80211_DFS_UNSET) in mt7915_set_radar_background()
1405 mutex_unlock(&dev->mt76.mutex); in mt7915_set_radar_background()
1422 struct mtk_wed_device *wed = &dev->mt76.mmio.wed; in mt7915_net_fill_forward_path()
1433 path->mtk_wdma.bss = mvif->mt76.idx; in mt7915_net_fill_forward_path()