Lines Matching full:phy
17 struct mt7615_phy *phy; in mt7615_dev_running() local
22 phy = mt7615_ext_phy(dev); in mt7615_dev_running()
24 return phy && test_bit(MT76_STATE_RUNNING, &phy->mt76->state); in mt7615_dev_running()
30 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_start() local
54 if (phy != &dev->phy) { 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()
76 ret = mt7615_mcu_set_chan_info(phy, MCU_EXT_CMD(SET_RX_PATH)); 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()
86 mt7615_mac_reset_counters(phy); in mt7615_start()
97 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_stop() local
99 cancel_delayed_work_sync(&phy->mt76->mac_work); in mt7615_stop()
100 del_timer_sync(&phy->roc_timer); in mt7615_stop()
101 cancel_work_sync(&phy->roc_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()
113 cancel_delayed_work_sync(&phy->scan_work); in mt7615_stop()
115 if (phy != &dev->phy) { in mt7615_stop()
184 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_add_interface() local
186 bool ext_phy = phy != &dev->phy; in mt7615_add_interface()
191 mt76_testmode_reset(phy->mt76, true); in mt7615_add_interface()
195 phy->monitor_vif = vif; in mt7615_add_interface()
218 phy->omac_mask |= BIT_ULL(mvif->mt76.omac_idx); in mt7615_add_interface()
239 ret = mt7615_mcu_add_dev_info(phy, vif, true); in mt7615_add_interface()
252 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_remove_interface() local
257 mt7615_mcu_add_bss_info(phy, vif, NULL, false); in mt7615_remove_interface()
258 mt7615_mcu_sta_add(phy, vif, NULL, false); in mt7615_remove_interface()
260 mt76_testmode_reset(phy->mt76, true); in mt7615_remove_interface()
261 if (vif == phy->monitor_vif) in mt7615_remove_interface()
262 phy->monitor_vif = NULL; in mt7615_remove_interface()
266 mt7615_mcu_add_dev_info(phy, vif, false); in mt7615_remove_interface()
272 phy->omac_mask &= ~BIT_ULL(mvif->mt76.omac_idx); in mt7615_remove_interface()
286 struct mt7615_phy *phy = mphy->priv; in mt7615_set_channel() local
287 struct mt7615_dev *dev = phy->dev; in mt7615_set_channel()
288 bool ext_phy = phy != &dev->phy; in mt7615_set_channel()
294 ret = mt7615_mcu_apply_rx_dcoc(phy); in mt7615_set_channel()
298 ret = mt7615_mcu_apply_tx_dpd(phy); in mt7615_set_channel()
303 ret = mt7615_mcu_set_chan_info(phy, MCU_EXT_CMD(CHANNEL_SWITCH)); in mt7615_set_channel()
307 mt7615_mac_set_timing(phy); in mt7615_set_channel()
308 ret = mt7615_dfs_init_radar_detector(phy); in mt7615_set_channel()
312 mt7615_mac_cca_stats_reset(phy); in mt7615_set_channel()
313 ret = mt7615_mcu_set_sku_en(phy, true); in mt7615_set_channel()
317 mt7615_mac_reset_counters(phy); in mt7615_set_channel()
318 phy->noise = 0; in mt7615_set_channel()
319 phy->chfreq = mt76_rr(dev, MT_CHFREQ(ext_phy)); 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()
340 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_set_key() local
381 mt7615_mcu_add_bss_info(phy, vif, NULL, true); in mt7615_set_key()
407 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_set_sar_specs() local
410 if (!cfg80211_chandef_valid(&phy->mt76->chandef)) in mt7615_set_sar_specs()
417 if (mt7615_firmware_offload(phy->dev)) 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()
426 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_config() local
427 bool band = phy != &dev->phy; in mt7615_config()
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()
448 phy->rxfilter |= MT_WF_RFCR_DROP_OTHER_UC; in mt7615_config()
450 phy->rxfilter &= ~MT_WF_RFCR_DROP_OTHER_UC; in mt7615_config()
452 mt76_wr(dev, MT_WF_RFCR(band), phy->rxfilter); in mt7615_config()
486 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_configure_filter() local
487 bool band = phy != &dev->phy; in mt7615_configure_filter()
500 phy->rxfilter &= ~(_hw); \ in mt7615_configure_filter()
501 if (!mt76_testmode_enabled(phy->mt76)) \ in mt7615_configure_filter()
502 phy->rxfilter |= !(flags & FIF_##_flag) * (_hw);\ in mt7615_configure_filter()
505 phy->rxfilter &= ~(MT_WF_RFCR_DROP_OTHER_BSS | in mt7615_configure_filter()
516 if (phy->n_beacon_vif || !mt7615_firmware_offload(dev)) in mt7615_configure_filter()
517 phy->rxfilter &= ~MT_WF_RFCR_DROP_OTHER_BEACON; in mt7615_configure_filter()
531 mt76_wr(dev, MT_WF_RFCR(band), phy->rxfilter); in mt7615_configure_filter()
573 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_bss_info_changed() local
580 if (slottime != phy->slottime) { in mt7615_bss_info_changed()
581 phy->slottime = slottime; in mt7615_bss_info_changed()
582 mt7615_mac_set_timing(phy); in mt7615_bss_info_changed()
590 mt7615_mcu_add_bss_info(phy, vif, NULL, true); in mt7615_bss_info_changed()
591 mt7615_mcu_sta_add(phy, vif, NULL, true); in mt7615_bss_info_changed()
613 mt7615_mac_set_beacon_filter(phy, vif, vif->cfg.assoc); in mt7615_bss_info_changed()
639 struct mt7615_phy *phy; in mt7615_mac_sta_add() local
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()
658 err = mt7615_mcu_add_bss_info(phy, vif, sta, true); in mt7615_mac_sta_add()
665 err = mt7615_mcu_sta_add(&dev->phy, vif, sta, true); in mt7615_mac_sta_add()
669 mt76_connac_power_save_sched(phy->mt76, &dev->pm); in mt7615_mac_sta_add()
681 struct mt7615_phy *phy; in mt7615_mac_sta_remove() local
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()
688 mt7615_mcu_sta_add(&dev->phy, vif, sta, false); in mt7615_mac_sta_remove()
692 mt7615_mcu_add_bss_info(phy, vif, sta, false); in mt7615_mac_sta_remove()
699 mt76_connac_power_save_sched(phy->mt76, &dev->pm); in mt7615_mac_sta_remove()
708 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_sta_rate_tbl_update() local
726 if (mt76_connac_pm_ref(phy->mt76, &dev->pm)) { in mt7615_sta_rate_tbl_update()
727 mt7615_mac_set_rates(phy, msta, NULL, msta->rates); in mt7615_sta_rate_tbl_update()
728 mt76_connac_pm_unref(phy->mt76, &dev->pm); in mt7615_sta_rate_tbl_update()
790 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_set_rts_threshold() local
791 int err, band = phy != &dev->phy; in mt7615_set_rts_threshold()
880 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_get_stats() local
881 struct mib_stats *mib = &phy->mib; in mt7615_get_stats()
883 mt7615_mutex_acquire(phy->dev); in mt7615_get_stats()
890 mt7615_mutex_release(phy->dev); in mt7615_get_stats()
977 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_set_coverage_class() local
978 struct mt7615_dev *dev = phy->dev; in mt7615_set_coverage_class()
981 phy->coverage_class = max_t(s16, coverage_class, 0); in mt7615_set_coverage_class()
982 mt7615_mac_set_timing(phy); in mt7615_set_coverage_class()
990 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_set_antenna() local
992 bool ext_phy = phy != &dev->phy; in mt7615_set_antenna()
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()
1021 struct mt7615_phy *phy = priv; in mt7615_roc_iter() local
1023 mt7615_mcu_set_roc(phy, vif, NULL, 0); in mt7615_roc_iter()
1028 struct mt7615_phy *phy; in mt7615_roc_work() local
1030 phy = (struct mt7615_phy *)container_of(work, struct mt7615_phy, in mt7615_roc_work()
1033 if (!test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state)) in mt7615_roc_work()
1036 mt7615_mutex_acquire(phy->dev); in mt7615_roc_work()
1037 ieee80211_iterate_active_interfaces(phy->mt76->hw, in mt7615_roc_work()
1039 mt7615_roc_iter, phy); in mt7615_roc_work()
1040 mt7615_mutex_release(phy->dev); in mt7615_roc_work()
1041 ieee80211_remain_on_channel_expired(phy->mt76->hw); in mt7615_roc_work()
1046 struct mt7615_phy *phy = from_timer(phy, timer, roc_timer); in mt7615_roc_timer() local
1048 ieee80211_queue_work(phy->mt76->hw, &phy->roc_work); in mt7615_roc_timer()
1053 struct mt7615_phy *phy; in mt7615_scan_work() local
1055 phy = (struct mt7615_phy *)container_of(work, struct mt7615_phy, in mt7615_scan_work()
1062 spin_lock_bh(&phy->dev->mt76.lock); in mt7615_scan_work()
1063 skb = __skb_dequeue(&phy->scan_event_list); 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()
1162 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_remain_on_channel() local
1165 if (test_and_set_bit(MT76_STATE_ROC, &phy->mt76->state)) in mt7615_remain_on_channel()
1168 mt7615_mutex_acquire(phy->dev); in mt7615_remain_on_channel()
1170 err = mt7615_mcu_set_roc(phy, vif, chan, duration); in mt7615_remain_on_channel()
1172 clear_bit(MT76_STATE_ROC, &phy->mt76->state); in mt7615_remain_on_channel()
1176 if (!wait_event_timeout(phy->roc_wait, phy->roc_grant, HZ)) { in mt7615_remain_on_channel()
1177 mt7615_mcu_set_roc(phy, vif, NULL, 0); in mt7615_remain_on_channel()
1178 clear_bit(MT76_STATE_ROC, &phy->mt76->state); in mt7615_remain_on_channel()
1183 mt7615_mutex_release(phy->dev); in mt7615_remain_on_channel()
1191 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_cancel_remain_on_channel() local
1194 if (!test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state)) in mt7615_cancel_remain_on_channel()
1197 del_timer_sync(&phy->roc_timer); in mt7615_cancel_remain_on_channel()
1198 cancel_work_sync(&phy->roc_work); in mt7615_cancel_remain_on_channel()
1200 mt7615_mutex_acquire(phy->dev); in mt7615_cancel_remain_on_channel()
1201 err = mt7615_mcu_set_roc(phy, vif, NULL, 0); in mt7615_cancel_remain_on_channel()
1202 mt7615_mutex_release(phy->dev); in mt7615_cancel_remain_on_channel()
1231 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_suspend() local
1240 clear_bit(MT76_STATE_RUNNING, &phy->mt76->state); in mt7615_suspend()
1241 cancel_delayed_work_sync(&phy->scan_work); 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()
1260 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_resume() local
1268 set_bit(MT76_STATE_RUNNING, &phy->mt76->state); 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()