Lines Matching full:mt76
24 return phy && test_bit(MT76_STATE_RUNNING, &phy->mt76->state); in mt7615_dev_running()
47 ret = mt76_connac_mcu_set_mac_enable(&dev->mt76, 0, true, false); in mt7615_start()
59 ret = mt76_connac_mcu_set_mac_enable(&dev->mt76, 1, true, false); in mt7615_start()
67 ret = mt76_connac_mcu_set_channel_domain(phy->mt76); in mt7615_start()
71 ret = mt76_connac_mcu_set_rate_txpower(phy->mt76); in mt7615_start()
80 set_bit(MT76_STATE_RUNNING, &phy->mt76->state); in mt7615_start()
83 ieee80211_queue_delayed_work(hw, &phy->mt76->mac_work, timeout); in mt7615_start()
99 cancel_delayed_work_sync(&phy->mt76->mac_work); in mt7615_stop()
110 mt76_testmode_reset(phy->mt76, true); in mt7615_stop()
112 clear_bit(MT76_STATE_RUNNING, &phy->mt76->state); in mt7615_stop()
117 mt76_connac_mcu_set_mac_enable(&dev->mt76, 1, false, false); in mt7615_stop()
122 mt76_connac_mcu_set_mac_enable(&dev->mt76, 0, false, false); in mt7615_stop()
191 mt76_testmode_reset(phy->mt76, true); in mt7615_add_interface()
197 mvif->mt76.idx = __ffs64(~dev->mt76.vif_mask); in mt7615_add_interface()
198 if (mvif->mt76.idx >= MT7615_MAX_INTERFACES) { in mt7615_add_interface()
208 mvif->mt76.omac_idx = idx; in mt7615_add_interface()
210 mvif->mt76.band_idx = ext_phy; in mt7615_add_interface()
211 mvif->mt76.wmm_idx = vif->type != NL80211_IFTYPE_AP; in mt7615_add_interface()
212 mvif->mt76.wcid = &mvif->sta.wcid; in mt7615_add_interface()
214 mvif->mt76.wmm_idx += 2; in mt7615_add_interface()
216 dev->mt76.vif_mask |= BIT_ULL(mvif->mt76.idx); in mt7615_add_interface()
217 dev->omac_mask |= BIT_ULL(mvif->mt76.omac_idx); in mt7615_add_interface()
218 phy->omac_mask |= BIT_ULL(mvif->mt76.omac_idx); in mt7615_add_interface()
224 idx = MT7615_WTBL_RESERVED - mvif->mt76.idx; in mt7615_add_interface()
228 mt76_wcid_init(&mvif->sta.wcid, mvif->mt76.band_idx); in mt7615_add_interface()
233 rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid); in mt7615_add_interface()
260 mt76_testmode_reset(phy->mt76, true); in mt7615_remove_interface()
268 rcu_assign_pointer(dev->mt76.wcid[idx], NULL); in mt7615_remove_interface()
270 dev->mt76.vif_mask &= ~BIT_ULL(mvif->mt76.idx); in mt7615_remove_interface()
271 dev->omac_mask &= ~BIT_ULL(mvif->mt76.omac_idx); in mt7615_remove_interface()
272 phy->omac_mask &= ~BIT_ULL(mvif->mt76.omac_idx); in mt7615_remove_interface()
276 spin_lock_bh(&dev->mt76.sta_poll_lock); in mt7615_remove_interface()
279 spin_unlock_bh(&dev->mt76.sta_poll_lock); in mt7615_remove_interface()
281 mt76_wcid_cleanup(&dev->mt76, &mvif->sta.wcid); in mt7615_remove_interface()
293 if (is_mt7615(&dev->mt76) && dev->flash_eeprom) { in mt7615_set_channel()
324 if (!mt76_testmode_enabled(phy->mt76)) { in mt7615_set_channel()
327 ieee80211_queue_delayed_work(phy->mt76->hw, in mt7615_set_channel()
328 &phy->mt76->mac_work, timeout); in mt7615_set_channel()
379 if (cmd == SET_KEY && !sta && !mvif->mt76.cipher) { in mt7615_set_key()
380 mvif->mt76.cipher = mt76_connac_mcu_get_cipher(key->cipher); in mt7615_set_key()
392 mt76_wcid_key_setup(&dev->mt76, wcid, key); in mt7615_set_key()
393 if (mt76_is_mmio(&dev->mt76)) in mt7615_set_key()
410 if (!cfg80211_chandef_valid(&phy->mt76->chandef)) in mt7615_set_sar_specs()
418 return mt76_connac_mcu_set_rate_txpower(phy->mt76); in mt7615_set_sar_specs()
420 return mt76_update_channel(phy->mt76); in mt7615_set_sar_specs()
433 if (phy->mt76->test.state != MT76_TM_STATE_OFF) { in mt7615_config()
435 mt76_testmode_reset(phy->mt76, false); in mt7615_config()
439 ret = mt76_update_channel(phy->mt76); in mt7615_config()
445 mt76_testmode_reset(phy->mt76, true); in mt7615_config()
501 if (!mt76_testmode_enabled(phy->mt76)) \ in mt7615_configure_filter()
547 u8 i, band = mvif->mt76.band_idx; in mt7615_update_mu_group()
552 if (is_mt7663(&dev->mt76)) in mt7615_update_mu_group()
560 if (is_mt7663(&dev->mt76)) in mt7615_update_mu_group()
602 mt76_connac_mcu_set_vif_ps(&dev->mt76, vif); in mt7615_bss_info_changed()
608 mt76_connac_mcu_update_arp_filter(&dev->mt76, &mvif->mt76, in mt7615_bss_info_changed()
636 struct mt7615_dev *dev = container_of(mdev, struct mt7615_dev, mt76); in mt7615_mac_sta_add()
642 idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7615_WTBL_STA - 1); in mt7615_mac_sta_add()
650 msta->wcid.phy_idx = mvif->mt76.band_idx; in mt7615_mac_sta_add()
652 phy = mvif->mt76.band_idx ? mt7615_ext_phy(dev) : &dev->phy; in mt7615_mac_sta_add()
653 err = mt76_connac_pm_wake(phy->mt76, &dev->pm); in mt7615_mac_sta_add()
669 mt76_connac_power_save_sched(phy->mt76, &dev->pm); in mt7615_mac_sta_add()
678 struct mt7615_dev *dev = container_of(mdev, struct mt7615_dev, mt76); in mt7615_mac_sta_remove()
685 phy = mvif->mt76.band_idx ? mt7615_ext_phy(dev) : &dev->phy; in mt7615_mac_sta_remove()
686 mt76_connac_pm_wake(phy->mt76, &dev->pm); in mt7615_mac_sta_remove()
699 mt76_connac_power_save_sched(phy->mt76, &dev->pm); in mt7615_mac_sta_remove()
716 spin_lock_bh(&dev->mt76.lock); in mt7615_sta_rate_tbl_update()
726 if (mt76_connac_pm_ref(phy->mt76, &dev->pm)) { in mt7615_sta_rate_tbl_update()
728 mt76_connac_pm_unref(phy->mt76, &dev->pm); in mt7615_sta_rate_tbl_update()
730 spin_unlock_bh(&dev->mt76.lock); in mt7615_sta_rate_tbl_update()
736 mt76.tx_worker); in mt7615_tx_worker()
739 queue_work(dev->mt76.wq, &dev->pm.wake_work); in mt7615_tx_worker()
743 mt76_tx_worker_run(&dev->mt76); in mt7615_tx_worker()
755 struct mt76_wcid *wcid = &dev->mt76.global_wcid; in mt7615_tx()
794 err = mt76_connac_mcu_set_rts_thresh(&dev->mt76, val, band); in mt7615_set_rts_threshold()
823 mt76_rx_aggr_start(&dev->mt76, &msta->wcid, tid, ssn, in mt7615_ampdu_action()
828 mt76_rx_aggr_stop(&dev->mt76, &msta->wcid, tid); in mt7615_ampdu_action()
904 u16 idx = mvif->mt76.omac_idx; in mt7615_get_tsf()
932 u16 idx = mvif->mt76.omac_idx; in mt7615_set_tsf()
958 u16 idx = mvif->mt76.omac_idx; in mt7615_offset_tsf()
1002 phy->mt76->antenna_mask = tx_ant; in mt7615_set_antenna()
1009 phy->mt76->chainmask = tx_ant; in mt7615_set_antenna()
1011 mt76_set_stream_caps(phy->mt76, true); in mt7615_set_antenna()
1033 if (!test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state)) in mt7615_roc_work()
1037 ieee80211_iterate_active_interfaces(phy->mt76->hw, in mt7615_roc_work()
1041 ieee80211_remain_on_channel_expired(phy->mt76->hw); in mt7615_roc_work()
1048 ieee80211_queue_work(phy->mt76->hw, &phy->roc_work); in mt7615_roc_timer()
1062 spin_lock_bh(&phy->dev->mt76.lock); in mt7615_scan_work()
1064 spin_unlock_bh(&phy->dev->mt76.lock); in mt7615_scan_work()
1071 ieee80211_sched_scan_results(phy->mt76->hw); in mt7615_scan_work()
1073 &phy->mt76->state)) { in mt7615_scan_work()
1078 ieee80211_scan_completed(phy->mt76->hw, &info); in mt7615_scan_work()
1165 if (test_and_set_bit(MT76_STATE_ROC, &phy->mt76->state)) in mt7615_remain_on_channel()
1172 clear_bit(MT76_STATE_ROC, &phy->mt76->state); in mt7615_remain_on_channel()
1178 clear_bit(MT76_STATE_ROC, &phy->mt76->state); in mt7615_remain_on_channel()
1194 if (!test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state)) in mt7615_cancel_remain_on_channel()
1240 clear_bit(MT76_STATE_RUNNING, &phy->mt76->state); in mt7615_suspend()
1242 cancel_delayed_work_sync(&phy->mt76->mac_work); in mt7615_suspend()
1244 set_bit(MT76_STATE_SUSPEND, &phy->mt76->state); in mt7615_suspend()
1248 phy->mt76); in mt7615_suspend()
1251 err = mt76_connac_mcu_set_hif_suspend(&dev->mt76, true, true); in mt7615_suspend()
1268 set_bit(MT76_STATE_RUNNING, &phy->mt76->state); in mt7615_resume()
1273 err = mt76_connac_mcu_set_hif_suspend(&dev->mt76, false, true); in mt7615_resume()
1280 clear_bit(MT76_STATE_SUSPEND, &phy->mt76->state); in mt7615_resume()
1284 phy->mt76); in mt7615_resume()
1287 ieee80211_queue_delayed_work(hw, &phy->mt76->mac_work, timeout); in mt7615_resume()
1297 struct mt76_dev *mdev = &dev->mt76; in mt7615_set_wakeup()