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()
217 phy->omac_mask |= BIT_ULL(mvif->mt76.omac_idx); in mt7615_add_interface()
240 ret = mt7615_mcu_add_dev_info(phy, vif, true); in mt7615_add_interface()
253 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_remove_interface() local
258 mt7615_mcu_add_bss_info(phy, vif, NULL, false); in mt7615_remove_interface()
259 mt7615_mcu_sta_add(phy, vif, NULL, false); in mt7615_remove_interface()
261 mt76_testmode_reset(phy->mt76, true); in mt7615_remove_interface()
262 if (vif == phy->monitor_vif) in mt7615_remove_interface()
263 phy->monitor_vif = NULL; in mt7615_remove_interface()
267 mt7615_mcu_add_dev_info(phy, vif, false); in mt7615_remove_interface()
273 phy->omac_mask &= ~BIT_ULL(mvif->mt76.omac_idx); in mt7615_remove_interface()
285 int mt7615_set_channel(struct mt7615_phy *phy) in mt7615_set_channel() argument
287 struct mt7615_dev *dev = phy->dev; in mt7615_set_channel()
288 bool ext_phy = phy != &dev->phy; in mt7615_set_channel()
291 cancel_delayed_work_sync(&phy->mt76->mac_work); in mt7615_set_channel()
295 set_bit(MT76_RESET, &phy->mt76->state); in mt7615_set_channel()
297 mt76_set_channel(phy->mt76); in mt7615_set_channel()
300 ret = mt7615_mcu_apply_rx_dcoc(phy); in mt7615_set_channel()
304 ret = mt7615_mcu_apply_tx_dpd(phy); in mt7615_set_channel()
309 ret = mt7615_mcu_set_chan_info(phy, MCU_EXT_CMD(CHANNEL_SWITCH)); in mt7615_set_channel()
313 mt7615_mac_set_timing(phy); in mt7615_set_channel()
314 ret = mt7615_dfs_init_radar_detector(phy); in mt7615_set_channel()
318 mt7615_mac_cca_stats_reset(phy); in mt7615_set_channel()
319 ret = mt7615_mcu_set_sku_en(phy, true); in mt7615_set_channel()
323 mt7615_mac_reset_counters(phy); in mt7615_set_channel()
324 phy->noise = 0; in mt7615_set_channel()
325 phy->chfreq = mt76_rr(dev, MT_CHFREQ(ext_phy)); in mt7615_set_channel()
328 clear_bit(MT76_RESET, &phy->mt76->state); in mt7615_set_channel()
333 if (!mt76_testmode_enabled(phy->mt76)) { in mt7615_set_channel()
336 ieee80211_queue_delayed_work(phy->mt76->hw, in mt7615_set_channel()
337 &phy->mt76->mac_work, timeout); in mt7615_set_channel()
348 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_set_key() local
389 mt7615_mcu_add_bss_info(phy, vif, NULL, true); in mt7615_set_key()
415 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_set_sar_specs() local
418 if (!cfg80211_chandef_valid(&phy->mt76->chandef)) in mt7615_set_sar_specs()
425 if (mt7615_firmware_offload(phy->dev)) in mt7615_set_sar_specs()
426 return mt76_connac_mcu_set_rate_txpower(phy->mt76); in mt7615_set_sar_specs()
429 err = mt7615_set_channel(phy); in mt7615_set_sar_specs()
438 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_config() local
439 bool band = phy != &dev->phy; in mt7615_config()
445 if (phy->mt76->test.state != MT76_TM_STATE_OFF) { in mt7615_config()
447 mt76_testmode_reset(phy->mt76, false); in mt7615_config()
452 ret = mt7615_set_channel(phy); in mt7615_config()
459 mt76_testmode_reset(phy->mt76, true); in mt7615_config()
462 phy->rxfilter |= MT_WF_RFCR_DROP_OTHER_UC; in mt7615_config()
464 phy->rxfilter &= ~MT_WF_RFCR_DROP_OTHER_UC; in mt7615_config()
466 mt76_wr(dev, MT_WF_RFCR(band), phy->rxfilter); in mt7615_config()
500 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_configure_filter() local
501 bool band = phy != &dev->phy; in mt7615_configure_filter()
514 phy->rxfilter &= ~(_hw); \ in mt7615_configure_filter()
515 if (!mt76_testmode_enabled(phy->mt76)) \ in mt7615_configure_filter()
516 phy->rxfilter |= !(flags & FIF_##_flag) * (_hw);\ in mt7615_configure_filter()
519 phy->rxfilter &= ~(MT_WF_RFCR_DROP_OTHER_BSS | in mt7615_configure_filter()
530 if (phy->n_beacon_vif || !mt7615_firmware_offload(dev)) in mt7615_configure_filter()
531 phy->rxfilter &= ~MT_WF_RFCR_DROP_OTHER_BEACON; in mt7615_configure_filter()
545 mt76_wr(dev, MT_WF_RFCR(band), phy->rxfilter); in mt7615_configure_filter()
587 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_bss_info_changed() local
594 if (slottime != phy->slottime) { in mt7615_bss_info_changed()
595 phy->slottime = slottime; in mt7615_bss_info_changed()
596 mt7615_mac_set_timing(phy); in mt7615_bss_info_changed()
604 mt7615_mcu_add_bss_info(phy, vif, NULL, true); in mt7615_bss_info_changed()
605 mt7615_mcu_sta_add(phy, vif, NULL, true); in mt7615_bss_info_changed()
627 mt7615_mac_set_beacon_filter(phy, vif, vif->cfg.assoc); in mt7615_bss_info_changed()
653 struct mt7615_phy *phy; in mt7615_mac_sta_add() local
666 phy = mvif->mt76.band_idx ? mt7615_ext_phy(dev) : &dev->phy; in mt7615_mac_sta_add()
667 err = mt76_connac_pm_wake(phy->mt76, &dev->pm); in mt7615_mac_sta_add()
672 err = mt7615_mcu_add_bss_info(phy, vif, sta, true); in mt7615_mac_sta_add()
679 err = mt7615_mcu_sta_add(&dev->phy, vif, sta, true); in mt7615_mac_sta_add()
683 mt76_connac_power_save_sched(phy->mt76, &dev->pm); in mt7615_mac_sta_add()
695 struct mt7615_phy *phy; in mt7615_mac_sta_remove() local
699 phy = mvif->mt76.band_idx ? mt7615_ext_phy(dev) : &dev->phy; in mt7615_mac_sta_remove()
700 mt76_connac_pm_wake(phy->mt76, &dev->pm); in mt7615_mac_sta_remove()
702 mt7615_mcu_sta_add(&dev->phy, vif, sta, false); in mt7615_mac_sta_remove()
706 mt7615_mcu_add_bss_info(phy, vif, sta, false); in mt7615_mac_sta_remove()
713 mt76_connac_power_save_sched(phy->mt76, &dev->pm); in mt7615_mac_sta_remove()
722 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_sta_rate_tbl_update() local
740 if (mt76_connac_pm_ref(phy->mt76, &dev->pm)) { in mt7615_sta_rate_tbl_update()
741 mt7615_mac_set_rates(phy, msta, NULL, msta->rates); in mt7615_sta_rate_tbl_update()
742 mt76_connac_pm_unref(phy->mt76, &dev->pm); in mt7615_sta_rate_tbl_update()
804 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_set_rts_threshold() local
805 int err, band = phy != &dev->phy; in mt7615_set_rts_threshold()
894 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_get_stats() local
895 struct mib_stats *mib = &phy->mib; in mt7615_get_stats()
897 mt7615_mutex_acquire(phy->dev); in mt7615_get_stats()
904 mt7615_mutex_release(phy->dev); in mt7615_get_stats()
991 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_set_coverage_class() local
992 struct mt7615_dev *dev = phy->dev; in mt7615_set_coverage_class()
995 phy->coverage_class = max_t(s16, coverage_class, 0); in mt7615_set_coverage_class()
996 mt7615_mac_set_timing(phy); in mt7615_set_coverage_class()
1004 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_set_antenna() local
1006 bool ext_phy = phy != &dev->phy; in mt7615_set_antenna()
1016 phy->mt76->antenna_mask = tx_ant; in mt7615_set_antenna()
1023 phy->mt76->chainmask = tx_ant; in mt7615_set_antenna()
1025 mt76_set_stream_caps(phy->mt76, true); in mt7615_set_antenna()
1035 struct mt7615_phy *phy = priv; in mt7615_roc_iter() local
1037 mt7615_mcu_set_roc(phy, vif, NULL, 0); in mt7615_roc_iter()
1042 struct mt7615_phy *phy; in mt7615_roc_work() local
1044 phy = (struct mt7615_phy *)container_of(work, struct mt7615_phy, in mt7615_roc_work()
1047 if (!test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state)) in mt7615_roc_work()
1050 mt7615_mutex_acquire(phy->dev); in mt7615_roc_work()
1051 ieee80211_iterate_active_interfaces(phy->mt76->hw, in mt7615_roc_work()
1053 mt7615_roc_iter, phy); in mt7615_roc_work()
1054 mt7615_mutex_release(phy->dev); in mt7615_roc_work()
1055 ieee80211_remain_on_channel_expired(phy->mt76->hw); in mt7615_roc_work()
1060 struct mt7615_phy *phy = from_timer(phy, timer, roc_timer); in mt7615_roc_timer() local
1062 ieee80211_queue_work(phy->mt76->hw, &phy->roc_work); in mt7615_roc_timer()
1067 struct mt7615_phy *phy; in mt7615_scan_work() local
1069 phy = (struct mt7615_phy *)container_of(work, struct mt7615_phy, in mt7615_scan_work()
1076 spin_lock_bh(&phy->dev->mt76.lock); in mt7615_scan_work()
1077 skb = __skb_dequeue(&phy->scan_event_list); in mt7615_scan_work()
1078 spin_unlock_bh(&phy->dev->mt76.lock); in mt7615_scan_work()
1085 ieee80211_sched_scan_results(phy->mt76->hw); in mt7615_scan_work()
1087 &phy->mt76->state)) { in mt7615_scan_work()
1092 ieee80211_scan_completed(phy->mt76->hw, &info); in mt7615_scan_work()
1176 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_remain_on_channel() local
1179 if (test_and_set_bit(MT76_STATE_ROC, &phy->mt76->state)) in mt7615_remain_on_channel()
1182 mt7615_mutex_acquire(phy->dev); in mt7615_remain_on_channel()
1184 err = mt7615_mcu_set_roc(phy, vif, chan, duration); in mt7615_remain_on_channel()
1186 clear_bit(MT76_STATE_ROC, &phy->mt76->state); in mt7615_remain_on_channel()
1190 if (!wait_event_timeout(phy->roc_wait, phy->roc_grant, HZ)) { in mt7615_remain_on_channel()
1191 mt7615_mcu_set_roc(phy, vif, NULL, 0); in mt7615_remain_on_channel()
1192 clear_bit(MT76_STATE_ROC, &phy->mt76->state); in mt7615_remain_on_channel()
1197 mt7615_mutex_release(phy->dev); in mt7615_remain_on_channel()
1205 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_cancel_remain_on_channel() local
1208 if (!test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state)) in mt7615_cancel_remain_on_channel()
1211 del_timer_sync(&phy->roc_timer); in mt7615_cancel_remain_on_channel()
1212 cancel_work_sync(&phy->roc_work); in mt7615_cancel_remain_on_channel()
1214 mt7615_mutex_acquire(phy->dev); in mt7615_cancel_remain_on_channel()
1215 err = mt7615_mcu_set_roc(phy, vif, NULL, 0); in mt7615_cancel_remain_on_channel()
1216 mt7615_mutex_release(phy->dev); in mt7615_cancel_remain_on_channel()
1245 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_suspend() local
1254 clear_bit(MT76_STATE_RUNNING, &phy->mt76->state); in mt7615_suspend()
1255 cancel_delayed_work_sync(&phy->scan_work); in mt7615_suspend()
1256 cancel_delayed_work_sync(&phy->mt76->mac_work); in mt7615_suspend()
1258 set_bit(MT76_STATE_SUSPEND, &phy->mt76->state); in mt7615_suspend()
1262 phy->mt76); in mt7615_suspend()
1274 struct mt7615_phy *phy = mt7615_hw_phy(hw); in mt7615_resume() local
1282 set_bit(MT76_STATE_RUNNING, &phy->mt76->state); in mt7615_resume()
1294 clear_bit(MT76_STATE_SUSPEND, &phy->mt76->state); in mt7615_resume()
1298 phy->mt76); in mt7615_resume()
1301 ieee80211_queue_delayed_work(hw, &phy->mt76->mac_work, timeout); in mt7615_resume()