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()
408 if (!test_bit(MT76_STATE_RUNNING, &phy->mt76->state)) in mt7915_tm_init()
411 mt7915_mcu_set_sku_en(phy, !en); in mt7915_tm_init()
414 mt7915_tm_reg_backup_restore(phy); in mt7915_tm_init()
415 mt7915_tm_set_trx(phy, TM_MAC_TXRX, !en); in mt7915_tm_init()
417 mt7915_mcu_add_bss_info(phy, phy->monitor_vif, en); in mt7915_tm_init()
418 mt7915_mcu_add_sta(dev, phy->monitor_vif, NULL, en); in mt7915_tm_init()
421 mt7915_tm_set_tam_arb(phy, en, 0); in mt7915_tm_init()
425 mt7915_tm_update_channel(struct mt7915_phy *phy) in mt7915_tm_update_channel() argument
427 mutex_unlock(&phy->dev->mt76.mutex); in mt7915_tm_update_channel()
428 mt7915_set_channel(phy); in mt7915_tm_update_channel()
429 mutex_lock(&phy->dev->mt76.mutex); in mt7915_tm_update_channel()
431 mt7915_mcu_set_chan_info(phy, MCU_EXT_CMD(SET_RX_PATH)); in mt7915_tm_update_channel()
435 mt7915_tm_set_tx_frames(struct mt7915_phy *phy, bool en) in mt7915_tm_set_tx_frames() argument
437 struct mt76_testmode_data *td = &phy->mt76->test; in mt7915_tm_set_tx_frames()
438 struct mt7915_dev *dev = phy->dev; in mt7915_tm_set_tx_frames()
444 mt7915_tm_set_trx(phy, TM_MAC_RX_RXV, false); in mt7915_tm_set_tx_frames()
445 mt7915_tm_clean_hwq(phy, dev->mt76.global_wcid.idx); in mt7915_tm_set_tx_frames()
448 mt7915_tm_update_channel(phy); in mt7915_tm_set_tx_frames()
451 phy->test.spe_idx = td->tx_spe_idx; in mt7915_tm_set_tx_frames()
453 phy->test.spe_idx = mt76_connac_spe_idx(td->tx_antenna_mask); in mt7915_tm_set_tx_frames()
456 mt7915_tm_set_tam_arb(phy, en, in mt7915_tm_set_tx_frames()
467 mt7915_tm_set_ipg_params(phy, ipg, td->tx_rate_mode); in mt7915_tm_set_tx_frames()
468 mt7915_tm_set_tx_len(phy, tx_time); in mt7915_tm_set_tx_frames()
477 info->control.vif = phy->monitor_vif; in mt7915_tm_set_tx_frames()
479 mt7915_tm_set_trx(phy, TM_MAC_TX, en); in mt7915_tm_set_tx_frames()
483 mt7915_tm_set_rx_frames(struct mt7915_phy *phy, bool en) in mt7915_tm_set_rx_frames() argument
485 mt7915_tm_set_trx(phy, TM_MAC_RX_RXV, false); in mt7915_tm_set_rx_frames()
488 struct mt7915_dev *dev = phy->dev; in mt7915_tm_set_rx_frames()
490 mt7915_tm_update_channel(phy); in mt7915_tm_set_rx_frames()
493 mt76_rr(dev, MT_MIB_SDR3(phy->mt76->band_idx)); in mt7915_tm_set_rx_frames()
494 mt7915_tm_set_trx(phy, TM_MAC_RX_RXV, en); in mt7915_tm_set_rx_frames()
510 mt7915_tm_set_tx_cont(struct mt7915_phy *phy, bool en) in mt7915_tm_set_tx_cont() argument
514 struct mt7915_dev *dev = phy->dev; in mt7915_tm_set_tx_cont()
515 struct cfg80211_chan_def *chandef = &phy->mt76->chandef; in mt7915_tm_set_tx_cont()
517 struct mt76_testmode_data *td = &phy->mt76->test; in mt7915_tm_set_tx_cont()
520 u8 band = phy->mt76->band_idx; in mt7915_tm_set_tx_cont()
573 sband = &phy->mt76->sband_5g.sband; in mt7915_tm_set_tx_cont()
575 sband = &phy->mt76->sband_6g.sband; in mt7915_tm_set_tx_cont()
577 sband = &phy->mt76->sband_2g.sband; in mt7915_tm_set_tx_cont()
629 mt7915_tm_update_channel(phy); in mt7915_tm_set_tx_cont()
636 mt7915_tm_update_params(struct mt7915_phy *phy, u32 changed) in mt7915_tm_update_params() argument
638 struct mt76_testmode_data *td = &phy->mt76->test; in mt7915_tm_update_params()
639 bool en = phy->mt76->test.state != MT76_TM_STATE_OFF; in mt7915_tm_update_params()
642 mt7915_tm_set_freq_offset(phy, en, en ? td->freq_offset : 0); in mt7915_tm_update_params()
644 mt7915_tm_set_tx_power(phy); in mt7915_tm_update_params()
651 struct mt7915_phy *phy = mphy->priv; in mt7915_tm_set_state() local
658 mt7915_tm_set_tx_frames(phy, state == MT76_TM_STATE_TX_FRAMES); in mt7915_tm_set_state()
661 mt7915_tm_set_rx_frames(phy, state == MT76_TM_STATE_RX_FRAMES); in mt7915_tm_set_state()
664 mt7915_tm_set_tx_cont(phy, state == MT76_TM_STATE_TX_CONT); in mt7915_tm_set_state()
667 mt7915_tm_init(phy, !(state == MT76_TM_STATE_OFF)); in mt7915_tm_set_state()
683 mt7915_tm_update_params(phy, changed); in mt7915_tm_set_state()
694 struct mt7915_phy *phy = mphy->priv; in mt7915_tm_set_params() local
695 struct mt7915_dev *dev = phy->dev; in mt7915_tm_set_params()
697 bool ext_phy = phy != &dev->phy; in mt7915_tm_set_params()
715 mt7915_tm_update_params(phy, changed); in mt7915_tm_set_params()
723 struct mt7915_phy *phy = mphy->priv; in mt7915_tm_dump_stats() local
724 struct mt7915_dev *dev = phy->dev; in mt7915_tm_dump_stats()
735 if (nla_put_s32(msg, MT76_TM_RX_ATTR_FREQ_OFFSET, phy->test.last_freq_offset)) in mt7915_tm_dump_stats()
742 for (i = 0; i < ARRAY_SIZE(phy->test.last_rcpi); i++) in mt7915_tm_dump_stats()
743 if (nla_put_u8(msg, i, phy->test.last_rcpi[i])) in mt7915_tm_dump_stats()
752 for (i = 0; i < ARRAY_SIZE(phy->test.last_ib_rssi); i++) in mt7915_tm_dump_stats()
753 if (nla_put_s8(msg, i, phy->test.last_ib_rssi[i])) in mt7915_tm_dump_stats()
762 for (i = 0; i < ARRAY_SIZE(phy->test.last_wb_rssi); i++) in mt7915_tm_dump_stats()
763 if (nla_put_s8(msg, i, phy->test.last_wb_rssi[i])) in mt7915_tm_dump_stats()
768 if (nla_put_u8(msg, MT76_TM_RX_ATTR_SNR, phy->test.last_snr)) in mt7915_tm_dump_stats()
773 cnt = mt76_rr(dev, MT_MIB_SDR3(phy->mt76->band_idx)); in mt7915_tm_dump_stats()
777 q = phy->mt76->band_idx ? MT_RXQ_BAND1 : MT_RXQ_MAIN; in mt7915_tm_dump_stats()