Lines Matching full:phy
38 mt7915_tm_set_tx_power(struct mt7915_phy *phy) in mt7915_tm_set_tx_power() argument
40 struct mt7915_dev *dev = phy->dev; in mt7915_tm_set_tx_power()
41 struct mt76_phy *mphy = phy->mt76; in mt7915_tm_set_tx_power()
54 .band_idx = phy->mt76->band_idx, in mt7915_tm_set_tx_power()
59 if (phy->mt76->test.state != MT76_TM_STATE_OFF) in mt7915_tm_set_tx_power()
60 tx_power = phy->mt76->test.tx_power; in mt7915_tm_set_tx_power()
74 mt7915_tm_set_freq_offset(struct mt7915_phy *phy, bool en, u32 val) in mt7915_tm_set_freq_offset() argument
76 struct mt7915_dev *dev = phy->dev; in mt7915_tm_set_freq_offset()
80 .param.freq.band = phy->mt76->band_idx, in mt7915_tm_set_freq_offset()
106 mt7915_tm_set_trx(struct mt7915_phy *phy, int type, bool en) in mt7915_tm_set_trx() argument
108 struct mt7915_dev *dev = phy->dev; in mt7915_tm_set_trx()
114 .param.trx.band = phy->mt76->band_idx, in mt7915_tm_set_trx()
122 mt7915_tm_clean_hwq(struct mt7915_phy *phy, u8 wcid) in mt7915_tm_clean_hwq() argument
124 struct mt7915_dev *dev = phy->dev; in mt7915_tm_clean_hwq()
129 .param.clean.band = phy->mt76->band_idx, in mt7915_tm_clean_hwq()
137 mt7915_tm_set_slot_time(struct mt7915_phy *phy, u8 slot_time, u8 sifs) in mt7915_tm_set_slot_time() argument
139 struct mt7915_dev *dev = phy->dev; in mt7915_tm_set_slot_time()
141 .testmode_en = !(phy->mt76->test.state == MT76_TM_STATE_OFF), in mt7915_tm_set_slot_time()
147 .param.slot.band = phy->mt76->band_idx, in mt7915_tm_set_slot_time()
155 mt7915_tm_set_tam_arb(struct mt7915_phy *phy, bool enable, bool mu) in mt7915_tm_set_tam_arb() argument
157 struct mt7915_dev *dev = phy->dev; in mt7915_tm_set_tam_arb()
171 mt7915_tm_set_wmm_qid(struct mt7915_phy *phy, u8 qid, u8 aifs, u8 cw_min, in mt7915_tm_set_wmm_qid() argument
174 struct mt7915_vif *mvif = (struct mt7915_vif *)phy->monitor_vif->drv_priv; in mt7915_tm_set_wmm_qid()
186 return mt7915_mcu_update_edca(phy->dev, &req); in mt7915_tm_set_wmm_qid()
190 mt7915_tm_set_ipg_params(struct mt7915_phy *phy, u32 ipg, u8 mode) in mt7915_tm_set_ipg_params() argument
197 struct mt7915_dev *dev = phy->dev; in mt7915_tm_set_ipg_params()
201 u8 band = phy->mt76->band_idx; in mt7915_tm_set_ipg_params()
247 mt7915_tm_set_slot_time(phy, slot_time, sifs); in mt7915_tm_set_ipg_params()
249 return mt7915_tm_set_wmm_qid(phy, in mt7915_tm_set_ipg_params()
255 mt7915_tm_set_tx_len(struct mt7915_phy *phy, u32 tx_time) in mt7915_tm_set_tx_len() argument
257 struct mt76_phy *mphy = phy->mt76; in mt7915_tm_set_tx_len()
327 ret = mt76_testmode_alloc_skb(phy->mt76, tx_len); in mt7915_tm_set_tx_len()
335 mt7915_tm_reg_backup_restore(struct mt7915_phy *phy) in mt7915_tm_reg_backup_restore() argument
338 struct mt7915_dev *dev = phy->dev; in mt7915_tm_reg_backup_restore()
339 u32 *b = phy->test.reg_backup; in mt7915_tm_reg_backup_restore()
340 u8 band = phy->mt76->band_idx; in mt7915_tm_reg_backup_restore()
361 if (phy->mt76->test.state == MT76_TM_STATE_OFF) { in mt7915_tm_reg_backup_restore()
372 phy->test.reg_backup = b; in mt7915_tm_reg_backup_restore()
404 mt7915_tm_init(struct mt7915_phy *phy, bool en) in mt7915_tm_init() argument
406 struct mt7915_dev *dev = phy->dev; in mt7915_tm_init()
409 if (!test_bit(MT76_STATE_RUNNING, &phy->mt76->state)) in mt7915_tm_init()
412 mt7915_mcu_set_sku_en(phy, !en); in mt7915_tm_init()
415 mt7915_tm_reg_backup_restore(phy); in mt7915_tm_init()
416 mt7915_tm_set_trx(phy, TM_MAC_TXRX, !en); in mt7915_tm_init()
418 mt7915_mcu_add_bss_info(phy, phy->monitor_vif, en); in mt7915_tm_init()
420 mt7915_mcu_add_sta(dev, phy->monitor_vif, NULL, state, true); in mt7915_tm_init()
423 mt7915_tm_set_tam_arb(phy, en, 0); in mt7915_tm_init()
427 mt7915_tm_update_channel(struct mt7915_phy *phy) in mt7915_tm_update_channel() argument
429 mutex_unlock(&phy->dev->mt76.mutex); in mt7915_tm_update_channel()
430 mt76_update_channel(phy->mt76); in mt7915_tm_update_channel()
431 mutex_lock(&phy->dev->mt76.mutex); in mt7915_tm_update_channel()
433 mt7915_mcu_set_chan_info(phy, MCU_EXT_CMD(SET_RX_PATH)); in mt7915_tm_update_channel()
437 mt7915_tm_set_tx_frames(struct mt7915_phy *phy, bool en) in mt7915_tm_set_tx_frames() argument
439 struct mt76_testmode_data *td = &phy->mt76->test; in mt7915_tm_set_tx_frames()
440 struct mt7915_dev *dev = phy->dev; in mt7915_tm_set_tx_frames()
446 mt7915_tm_set_trx(phy, TM_MAC_RX_RXV, false); in mt7915_tm_set_tx_frames()
447 mt7915_tm_clean_hwq(phy, dev->mt76.global_wcid.idx); in mt7915_tm_set_tx_frames()
450 mt7915_tm_update_channel(phy); in mt7915_tm_set_tx_frames()
453 phy->test.spe_idx = td->tx_spe_idx; in mt7915_tm_set_tx_frames()
455 phy->test.spe_idx = mt76_connac_spe_idx(td->tx_antenna_mask); in mt7915_tm_set_tx_frames()
458 mt7915_tm_set_tam_arb(phy, en, in mt7915_tm_set_tx_frames()
469 mt7915_tm_set_ipg_params(phy, ipg, td->tx_rate_mode); in mt7915_tm_set_tx_frames()
470 mt7915_tm_set_tx_len(phy, tx_time); in mt7915_tm_set_tx_frames()
479 info->control.vif = phy->monitor_vif; in mt7915_tm_set_tx_frames()
481 mt7915_tm_set_trx(phy, TM_MAC_TX, en); in mt7915_tm_set_tx_frames()
485 mt7915_tm_set_rx_frames(struct mt7915_phy *phy, bool en) in mt7915_tm_set_rx_frames() argument
487 mt7915_tm_set_trx(phy, TM_MAC_RX_RXV, false); in mt7915_tm_set_rx_frames()
490 struct mt7915_dev *dev = phy->dev; in mt7915_tm_set_rx_frames()
492 mt7915_tm_update_channel(phy); in mt7915_tm_set_rx_frames()
495 mt76_rr(dev, MT_MIB_SDR3(phy->mt76->band_idx)); in mt7915_tm_set_rx_frames()
496 mt7915_tm_set_trx(phy, TM_MAC_RX_RXV, en); in mt7915_tm_set_rx_frames()
512 mt7915_tm_set_tx_cont(struct mt7915_phy *phy, bool en) in mt7915_tm_set_tx_cont() argument
516 struct mt7915_dev *dev = phy->dev; in mt7915_tm_set_tx_cont()
517 struct cfg80211_chan_def *chandef = &phy->mt76->chandef; in mt7915_tm_set_tx_cont()
519 struct mt76_testmode_data *td = &phy->mt76->test; in mt7915_tm_set_tx_cont()
522 u8 band = phy->mt76->band_idx; in mt7915_tm_set_tx_cont()
575 sband = &phy->mt76->sband_5g.sband; in mt7915_tm_set_tx_cont()
577 sband = &phy->mt76->sband_6g.sband; in mt7915_tm_set_tx_cont()
579 sband = &phy->mt76->sband_2g.sband; in mt7915_tm_set_tx_cont()
631 mt7915_tm_update_channel(phy); in mt7915_tm_set_tx_cont()
638 mt7915_tm_update_params(struct mt7915_phy *phy, u32 changed) in mt7915_tm_update_params() argument
640 struct mt76_testmode_data *td = &phy->mt76->test; in mt7915_tm_update_params()
641 bool en = phy->mt76->test.state != MT76_TM_STATE_OFF; in mt7915_tm_update_params()
644 mt7915_tm_set_freq_offset(phy, en, en ? td->freq_offset : 0); in mt7915_tm_update_params()
646 mt7915_tm_set_tx_power(phy); in mt7915_tm_update_params()
653 struct mt7915_phy *phy = mphy->priv; in mt7915_tm_set_state() local
660 mt7915_tm_set_tx_frames(phy, state == MT76_TM_STATE_TX_FRAMES); in mt7915_tm_set_state()
663 mt7915_tm_set_rx_frames(phy, state == MT76_TM_STATE_RX_FRAMES); in mt7915_tm_set_state()
666 mt7915_tm_set_tx_cont(phy, state == MT76_TM_STATE_TX_CONT); in mt7915_tm_set_state()
669 mt7915_tm_init(phy, !(state == MT76_TM_STATE_OFF)); in mt7915_tm_set_state()
685 mt7915_tm_update_params(phy, changed); in mt7915_tm_set_state()
696 struct mt7915_phy *phy = mphy->priv; in mt7915_tm_set_params() local
697 struct mt7915_dev *dev = phy->dev; in mt7915_tm_set_params()
699 bool ext_phy = phy != &dev->phy; in mt7915_tm_set_params()
717 mt7915_tm_update_params(phy, changed); in mt7915_tm_set_params()
725 struct mt7915_phy *phy = mphy->priv; in mt7915_tm_dump_stats() local
726 struct mt7915_dev *dev = phy->dev; in mt7915_tm_dump_stats()
737 if (nla_put_s32(msg, MT76_TM_RX_ATTR_FREQ_OFFSET, phy->test.last_freq_offset)) in mt7915_tm_dump_stats()
744 for (i = 0; i < ARRAY_SIZE(phy->test.last_rcpi); i++) in mt7915_tm_dump_stats()
745 if (nla_put_u8(msg, i, phy->test.last_rcpi[i])) in mt7915_tm_dump_stats()
754 for (i = 0; i < ARRAY_SIZE(phy->test.last_ib_rssi); i++) in mt7915_tm_dump_stats()
755 if (nla_put_s8(msg, i, phy->test.last_ib_rssi[i])) in mt7915_tm_dump_stats()
764 for (i = 0; i < ARRAY_SIZE(phy->test.last_wb_rssi); i++) in mt7915_tm_dump_stats()
765 if (nla_put_s8(msg, i, phy->test.last_wb_rssi[i])) in mt7915_tm_dump_stats()
770 if (nla_put_u8(msg, MT76_TM_RX_ATTR_SNR, phy->test.last_snr)) in mt7915_tm_dump_stats()
775 cnt = mt76_rr(dev, MT_MIB_SDR3(phy->mt76->band_idx)); in mt7915_tm_dump_stats()
779 q = phy->mt76->band_idx ? MT_RXQ_BAND1 : MT_RXQ_MAIN; in mt7915_tm_dump_stats()