Lines Matching +full:phy +full:- +full:s

1 // SPDX-License-Identifier: ISC
29 dev->ibf = !!val; in mt7915_implicit_txbf_set()
39 *val = dev->ibf; in mt7915_implicit_txbf_get()
52 struct mt7915_phy *phy = file->private_data; in mt7915_sys_recovery_set() local
53 struct mt7915_dev *dev = phy->dev; in mt7915_sys_recovery_set()
54 bool band = phy->mt76->band_idx; in mt7915_sys_recovery_set()
60 return -EINVAL; in mt7915_sys_recovery_set()
63 return -EFAULT; in mt7915_sys_recovery_set()
65 if (count && buf[count - 1] == '\n') in mt7915_sys_recovery_set()
66 buf[count - 1] = '\0'; in mt7915_sys_recovery_set()
71 return -EINVAL; in mt7915_sys_recovery_set()
108 dev->recovery.state |= MT_MCU_CMD_WDT_MASK; in mt7915_sys_recovery_set()
128 struct mt7915_phy *phy = file->private_data; in mt7915_sys_recovery_get() local
129 struct mt7915_dev *dev = phy->dev; in mt7915_sys_recovery_get()
137 return -ENOMEM; in mt7915_sys_recovery_get()
140 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
142 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
144 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
146 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
148 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
150 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
152 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
154 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
156 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
158 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
162 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
163 "\nlet's dump firmware SER statistics...\n"); in mt7915_sys_recovery_get()
164 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
167 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
170 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
173 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
176 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
179 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
182 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
185 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
188 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
191 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
194 desc += scnprintf(buff + desc, bufsz - desc, in mt7915_sys_recovery_get()
196 dev->recovery.wm_reset_count, in mt7915_sys_recovery_get()
197 dev->recovery.wa_reset_count); in mt7915_sys_recovery_get()
217 return -EINVAL; in mt7915_radar_trigger()
219 return mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_RADAR_EMULATE, in mt7915_radar_trigger()
231 dev->muru_debug = val; in mt7915_muru_debug_set()
232 mt7915_mcu_muru_debug_set(dev, dev->muru_debug); in mt7915_muru_debug_set()
242 *val = dev->muru_debug; in mt7915_muru_debug_get()
252 struct mt7915_phy *phy = file->private; in mt7915_muru_stats_show() local
253 struct mt7915_dev *dev = phy->dev; in mt7915_muru_stats_show()
260 "HE 2RU", "HE 3RU", "HE 4RU", "HE 5-8RU", "HE 9-16RU", in mt7915_muru_stats_show()
265 "HE 3RU", "HE 4RU", "HE 5-8RU", "HE 9-16RU", "HE >16RU" in mt7915_muru_stats_show()
270 if (!dev->muru_debug) { in mt7915_muru_stats_show()
275 mutex_lock(&dev->mt76.mutex); in mt7915_muru_stats_show()
277 ret = mt7915_mcu_muru_debug_get(phy); in mt7915_muru_stats_show()
281 /* Non-HE Downlink*/ in mt7915_muru_stats_show()
282 seq_puts(file, "[Non-HE]\nDownlink\nData Type: "); in mt7915_muru_stats_show()
285 seq_printf(file, "%8s | ", dl_non_he_type[i]); in mt7915_muru_stats_show()
289 phy->mib.dl_cck_cnt, in mt7915_muru_stats_show()
290 phy->mib.dl_ofdm_cnt, in mt7915_muru_stats_show()
291 phy->mib.dl_htmix_cnt, in mt7915_muru_stats_show()
292 phy->mib.dl_htgf_cnt, in mt7915_muru_stats_show()
293 phy->mib.dl_vht_su_cnt); in mt7915_muru_stats_show()
295 seq_puts(file, "\nDownlink MU-MIMO\nData Type: "); in mt7915_muru_stats_show()
298 seq_printf(file, "%8s | ", dl_non_he_type[i]); in mt7915_muru_stats_show()
302 phy->mib.dl_vht_2mu_cnt, in mt7915_muru_stats_show()
303 phy->mib.dl_vht_3mu_cnt, in mt7915_muru_stats_show()
304 phy->mib.dl_vht_4mu_cnt); in mt7915_muru_stats_show()
306 sub_total_cnt = phy->mib.dl_vht_2mu_cnt + in mt7915_muru_stats_show()
307 phy->mib.dl_vht_3mu_cnt + in mt7915_muru_stats_show()
308 phy->mib.dl_vht_4mu_cnt; in mt7915_muru_stats_show()
310 seq_printf(file, "\nTotal non-HE MU-MIMO DL PPDU count: %lld", in mt7915_muru_stats_show()
314 phy->mib.dl_cck_cnt + in mt7915_muru_stats_show()
315 phy->mib.dl_ofdm_cnt + in mt7915_muru_stats_show()
316 phy->mib.dl_htmix_cnt + in mt7915_muru_stats_show()
317 phy->mib.dl_htgf_cnt + in mt7915_muru_stats_show()
318 phy->mib.dl_vht_su_cnt; in mt7915_muru_stats_show()
320 seq_printf(file, "\nAll non-HE DL PPDU count: %lld", total_ppdu_cnt); in mt7915_muru_stats_show()
326 seq_printf(file, "%8s | ", dl_he_type[i]); in mt7915_muru_stats_show()
330 phy->mib.dl_he_su_cnt, phy->mib.dl_he_ext_su_cnt); in mt7915_muru_stats_show()
332 seq_puts(file, "\nDownlink MU-MIMO\nData Type: "); in mt7915_muru_stats_show()
335 seq_printf(file, "%8s | ", dl_he_type[i]); in mt7915_muru_stats_show()
339 phy->mib.dl_he_2mu_cnt, phy->mib.dl_he_3mu_cnt, in mt7915_muru_stats_show()
340 phy->mib.dl_he_4mu_cnt); in mt7915_muru_stats_show()
345 seq_printf(file, "%8s | ", dl_he_type[i]); in mt7915_muru_stats_show()
349 phy->mib.dl_he_2ru_cnt, in mt7915_muru_stats_show()
350 phy->mib.dl_he_3ru_cnt, in mt7915_muru_stats_show()
351 phy->mib.dl_he_4ru_cnt, in mt7915_muru_stats_show()
352 phy->mib.dl_he_5to8ru_cnt, in mt7915_muru_stats_show()
353 phy->mib.dl_he_9to16ru_cnt, in mt7915_muru_stats_show()
354 phy->mib.dl_he_gtr16ru_cnt); in mt7915_muru_stats_show()
356 sub_total_cnt = phy->mib.dl_he_2mu_cnt + in mt7915_muru_stats_show()
357 phy->mib.dl_he_3mu_cnt + in mt7915_muru_stats_show()
358 phy->mib.dl_he_4mu_cnt; in mt7915_muru_stats_show()
361 seq_printf(file, "\nTotal HE MU-MIMO DL PPDU count: %lld", in mt7915_muru_stats_show()
364 sub_total_cnt = phy->mib.dl_he_2ru_cnt + in mt7915_muru_stats_show()
365 phy->mib.dl_he_3ru_cnt + in mt7915_muru_stats_show()
366 phy->mib.dl_he_4ru_cnt + in mt7915_muru_stats_show()
367 phy->mib.dl_he_5to8ru_cnt + in mt7915_muru_stats_show()
368 phy->mib.dl_he_9to16ru_cnt + in mt7915_muru_stats_show()
369 phy->mib.dl_he_gtr16ru_cnt; in mt7915_muru_stats_show()
375 total_ppdu_cnt += phy->mib.dl_he_su_cnt + phy->mib.dl_he_ext_su_cnt; in mt7915_muru_stats_show()
381 seq_puts(file, "\nTrigger-based Uplink MU-MIMO\nData Type: "); in mt7915_muru_stats_show()
384 seq_printf(file, "%8s | ", ul_he_type[i]); in mt7915_muru_stats_show()
388 phy->mib.ul_hetrig_2mu_cnt, in mt7915_muru_stats_show()
389 phy->mib.ul_hetrig_3mu_cnt, in mt7915_muru_stats_show()
390 phy->mib.ul_hetrig_4mu_cnt); in mt7915_muru_stats_show()
392 seq_puts(file, "\nTrigger-based Uplink OFDMA\nData Type: "); in mt7915_muru_stats_show()
395 seq_printf(file, "%8s | ", ul_he_type[i]); in mt7915_muru_stats_show()
399 phy->mib.ul_hetrig_su_cnt, in mt7915_muru_stats_show()
400 phy->mib.ul_hetrig_2ru_cnt, in mt7915_muru_stats_show()
401 phy->mib.ul_hetrig_3ru_cnt, in mt7915_muru_stats_show()
402 phy->mib.ul_hetrig_4ru_cnt, in mt7915_muru_stats_show()
403 phy->mib.ul_hetrig_5to8ru_cnt, in mt7915_muru_stats_show()
404 phy->mib.ul_hetrig_9to16ru_cnt, in mt7915_muru_stats_show()
405 phy->mib.ul_hetrig_gtr16ru_cnt); in mt7915_muru_stats_show()
407 sub_total_cnt = phy->mib.ul_hetrig_2mu_cnt + in mt7915_muru_stats_show()
408 phy->mib.ul_hetrig_3mu_cnt + in mt7915_muru_stats_show()
409 phy->mib.ul_hetrig_4mu_cnt; in mt7915_muru_stats_show()
412 seq_printf(file, "\nTotal HE MU-MIMO UL TB PPDU count: %lld", in mt7915_muru_stats_show()
415 sub_total_cnt = phy->mib.ul_hetrig_2ru_cnt + in mt7915_muru_stats_show()
416 phy->mib.ul_hetrig_3ru_cnt + in mt7915_muru_stats_show()
417 phy->mib.ul_hetrig_4ru_cnt + in mt7915_muru_stats_show()
418 phy->mib.ul_hetrig_5to8ru_cnt + in mt7915_muru_stats_show()
419 phy->mib.ul_hetrig_9to16ru_cnt + in mt7915_muru_stats_show()
420 phy->mib.ul_hetrig_gtr16ru_cnt; in mt7915_muru_stats_show()
426 total_ppdu_cnt += phy->mib.ul_hetrig_su_cnt; in mt7915_muru_stats_show()
431 mutex_unlock(&dev->mt76.mutex); in mt7915_muru_stats_show()
438 mt7915_rdd_monitor(struct seq_file *s, void *data) in mt7915_rdd_monitor() argument
440 struct mt7915_dev *dev = dev_get_drvdata(s->private); in mt7915_rdd_monitor()
441 struct cfg80211_chan_def *chandef = &dev->rdd2_chandef; in mt7915_rdd_monitor()
445 mutex_lock(&dev->mt76.mutex); in mt7915_rdd_monitor()
448 ret = -EINVAL; in mt7915_rdd_monitor()
452 if (!dev->rdd2_phy) { in mt7915_rdd_monitor()
453 seq_puts(s, "not running\n"); in mt7915_rdd_monitor()
457 switch (chandef->width) { in mt7915_rdd_monitor()
475 seq_printf(s, "channel %d (%d MHz) width %s MHz center1: %d MHz\n", in mt7915_rdd_monitor()
476 chandef->chan->hw_value, chandef->chan->center_freq, in mt7915_rdd_monitor()
477 bw, chandef->center_freq1); in mt7915_rdd_monitor()
479 mutex_unlock(&dev->mt76.mutex); in mt7915_rdd_monitor()
498 dev->fw.debug_wm = val ? MCU_FW_LOG_TO_HOST : 0; in mt7915_fw_debug_wm_set()
500 if (dev->fw.debug_bin) in mt7915_fw_debug_wm_set()
503 val = dev->fw.debug_wm; in mt7915_fw_debug_wm_set()
505 tx = dev->fw.debug_wm || (dev->fw.debug_bin & BIT(1)); in mt7915_fw_debug_wm_set()
506 rx = dev->fw.debug_wm || (dev->fw.debug_bin & BIT(2)); in mt7915_fw_debug_wm_set()
507 en = dev->fw.debug_wm || (dev->fw.debug_bin & BIT(0)); in mt7915_fw_debug_wm_set()
527 (dev->fw.debug_wm ? 0 : BIT(0))); in mt7915_fw_debug_wm_set()
533 dev->fw.debug_wm = 0; in mt7915_fw_debug_wm_set()
543 *val = dev->fw.debug_wm; in mt7915_fw_debug_wm_get()
557 dev->fw.debug_wa = val ? MCU_FW_LOG_TO_HOST : 0; in mt7915_fw_debug_wa_set()
559 ret = mt7915_mcu_fw_log_2_host(dev, MCU_FW_LOG_WA, dev->fw.debug_wa); in mt7915_fw_debug_wa_set()
564 MCU_WA_PARAM_PDMA_RX, !!dev->fw.debug_wa, 0); in mt7915_fw_debug_wa_set()
567 dev->fw.debug_wa = 0; in mt7915_fw_debug_wa_set()
577 *val = dev->fw.debug_wa; in mt7915_fw_debug_wa_get()
618 if (!dev->relay_fwlog) in mt7915_fw_debug_bin_set()
619 dev->relay_fwlog = relay_open("fwlog_data", dev->debugfs_dir, in mt7915_fw_debug_bin_set()
621 if (!dev->relay_fwlog) in mt7915_fw_debug_bin_set()
622 return -ENOMEM; in mt7915_fw_debug_bin_set()
624 dev->fw.debug_bin = val; in mt7915_fw_debug_bin_set()
626 relay_reset(dev->relay_fwlog); in mt7915_fw_debug_bin_set()
628 return mt7915_fw_debug_wm_set(dev, dev->fw.debug_wm); in mt7915_fw_debug_bin_set()
636 *val = dev->fw.debug_bin; in mt7915_fw_debug_bin_get()
647 struct mt7915_dev *dev = file->private; in mt7915_fw_util_wm_show()
651 if (dev->fw.debug_wm) { in mt7915_fw_util_wm_show()
668 struct mt7915_dev *dev = file->private; in mt7915_fw_util_wa_show()
672 if (dev->fw.debug_wa) in mt7915_fw_util_wa_show()
682 mt7915_ampdu_stat_read_phy(struct mt7915_phy *phy, in mt7915_ampdu_stat_read_phy() argument
685 struct mt7915_dev *dev = phy->dev; in mt7915_ampdu_stat_read_phy()
686 bool ext_phy = phy != &dev->phy; in mt7915_ampdu_stat_read_phy()
688 u8 band = phy->mt76->band_idx; in mt7915_ampdu_stat_read_phy()
697 seq_printf(file, "\nPhy %d, Phy band %d\n", ext_phy, band); in mt7915_ampdu_stat_read_phy()
700 for (i = 0; i < ARRAY_SIZE(bound) - 1; i++) in mt7915_ampdu_stat_read_phy()
701 seq_printf(file, "%3d -%3d | ", in mt7915_ampdu_stat_read_phy()
706 seq_printf(file, "%8d | ", phy->mt76->aggr_stats[i]); in mt7915_ampdu_stat_read_phy()
709 seq_printf(file, "BA miss count: %d\n", phy->mib.ba_miss_cnt); in mt7915_ampdu_stat_read_phy()
713 mt7915_txbf_stat_read_phy(struct mt7915_phy *phy, struct seq_file *s) in mt7915_txbf_stat_read_phy() argument
715 struct mt76_mib_stats *mib = &phy->mib; in mt7915_txbf_stat_read_phy()
721 seq_puts(s, "\nTx Beamformer applied PPDU counts: "); in mt7915_txbf_stat_read_phy()
723 seq_printf(s, "iBF: %d, eBF: %d\n", in mt7915_txbf_stat_read_phy()
724 mib->tx_bf_ibf_ppdu_cnt, in mt7915_txbf_stat_read_phy()
725 mib->tx_bf_ebf_ppdu_cnt); in mt7915_txbf_stat_read_phy()
728 seq_puts(s, "Tx Beamformer Rx feedback statistics: "); in mt7915_txbf_stat_read_phy()
730 seq_printf(s, "All: %d, HE: %d, VHT: %d, HT: %d, ", in mt7915_txbf_stat_read_phy()
731 mib->tx_bf_rx_fb_all_cnt, in mt7915_txbf_stat_read_phy()
732 mib->tx_bf_rx_fb_he_cnt, in mt7915_txbf_stat_read_phy()
733 mib->tx_bf_rx_fb_vht_cnt, in mt7915_txbf_stat_read_phy()
734 mib->tx_bf_rx_fb_ht_cnt); in mt7915_txbf_stat_read_phy()
736 seq_printf(s, "%s, NC: %d, NR: %d\n", in mt7915_txbf_stat_read_phy()
737 bw[mib->tx_bf_rx_fb_bw], in mt7915_txbf_stat_read_phy()
738 mib->tx_bf_rx_fb_nc_cnt, in mt7915_txbf_stat_read_phy()
739 mib->tx_bf_rx_fb_nr_cnt); in mt7915_txbf_stat_read_phy()
742 seq_printf(s, "Tx Beamformee successful feedback frames: %d\n", in mt7915_txbf_stat_read_phy()
743 mib->tx_bf_fb_cpl_cnt); in mt7915_txbf_stat_read_phy()
744 seq_printf(s, "Tx Beamformee feedback triggered counts: %d\n", in mt7915_txbf_stat_read_phy()
745 mib->tx_bf_fb_trig_cnt); in mt7915_txbf_stat_read_phy()
748 seq_printf(s, "Tx multi-user Beamforming counts: %d\n", in mt7915_txbf_stat_read_phy()
749 mib->tx_bf_cnt); in mt7915_txbf_stat_read_phy()
750 seq_printf(s, "Tx multi-user MPDU counts: %d\n", mib->tx_mu_mpdu_cnt); in mt7915_txbf_stat_read_phy()
751 seq_printf(s, "Tx multi-user successful MPDU counts: %d\n", in mt7915_txbf_stat_read_phy()
752 mib->tx_mu_acked_mpdu_cnt); in mt7915_txbf_stat_read_phy()
753 seq_printf(s, "Tx single-user successful MPDU counts: %d\n", in mt7915_txbf_stat_read_phy()
754 mib->tx_su_acked_mpdu_cnt); in mt7915_txbf_stat_read_phy()
756 seq_puts(s, "\n"); in mt7915_txbf_stat_read_phy()
762 struct mt7915_phy *phy = file->private; in mt7915_tx_stats_show() local
763 struct mt7915_dev *dev = phy->dev; in mt7915_tx_stats_show()
764 struct mt76_mib_stats *mib = &phy->mib; in mt7915_tx_stats_show()
767 mutex_lock(&dev->mt76.mutex); in mt7915_tx_stats_show()
769 mt7915_ampdu_stat_read_phy(phy, file); in mt7915_tx_stats_show()
770 mt7915_mac_update_stats(phy); in mt7915_tx_stats_show()
771 mt7915_txbf_stat_read_phy(phy, file); in mt7915_tx_stats_show()
775 for (i = 0; i < ARRAY_SIZE(mib->tx_amsdu); i++) { in mt7915_tx_stats_show()
777 i + 1, mib->tx_amsdu[i]); in mt7915_tx_stats_show()
778 if (mib->tx_amsdu_cnt) in mt7915_tx_stats_show()
780 mib->tx_amsdu[i] * 100 / mib->tx_amsdu_cnt); in mt7915_tx_stats_show()
785 mutex_unlock(&dev->mt76.mutex); in mt7915_tx_stats_show()
793 mt7915_hw_queue_read(struct seq_file *s, u32 size, in mt7915_hw_queue_read() argument
796 struct mt7915_phy *phy = s->private; in mt7915_hw_queue_read() local
797 struct mt7915_dev *dev = phy->dev; in mt7915_hw_queue_read()
817 seq_printf(s, "\t%s: ", map[i].name); in mt7915_hw_queue_read()
818 seq_printf(s, "queued:0x%03x head:0x%03x tail:0x%03x\n", in mt7915_hw_queue_read()
826 struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv; in mt7915_sta_hw_queue_read()
827 struct mt7915_dev *dev = msta->vif->phy->dev; in mt7915_sta_hw_queue_read()
828 struct seq_file *s = data; in mt7915_sta_hw_queue_read() local
833 u32 idx = msta->wcid.idx >> 5; in mt7915_sta_hw_queue_read()
834 u8 offs = msta->wcid.idx & GENMASK(4, 0); in mt7915_sta_hw_queue_read()
842 mt76_wr(dev, MT_FL_Q0_CTRL, ctrl | msta->wcid.idx); in mt7915_sta_hw_queue_read()
845 seq_printf(s, "\tSTA %pM wcid %d: AC%d%d queued:%d\n", in mt7915_sta_hw_queue_read()
846 sta->addr, msta->wcid.idx, in mt7915_sta_hw_queue_read()
847 msta->vif->mt76.wmm_idx, ac, qlen); in mt7915_sta_hw_queue_read()
854 struct mt7915_phy *phy = file->private; in mt7915_hw_queues_show() local
855 struct mt7915_dev *dev = phy->dev; in mt7915_hw_queues_show()
904 seq_puts(file, "PLE non-empty queue info:\n"); in mt7915_hw_queues_show()
908 /* iterate per-sta ple queue */ in mt7915_hw_queues_show()
909 ieee80211_iterate_stations_atomic(phy->mt76->hw, in mt7915_hw_queues_show()
912 seq_puts(file, "PSE non-empty queue info:\n"); in mt7915_hw_queues_show()
924 struct mt7915_phy *phy = file->private; in mt7915_xmit_queues_show() local
925 struct mt7915_dev *dev = phy->dev; in mt7915_xmit_queues_show()
930 { phy->mt76->q_tx[MT_TXQ_BE], " MAIN" }, in mt7915_xmit_queues_show()
931 { dev->mt76.q_mcu[MT_MCUQ_WM], " MCUWM" }, in mt7915_xmit_queues_show()
932 { dev->mt76.q_mcu[MT_MCUQ_WA], " MCUWA" }, in mt7915_xmit_queues_show()
933 { dev->mt76.q_mcu[MT_MCUQ_FWDL], "MCUFWDL" }, in mt7915_xmit_queues_show()
937 seq_puts(file, " queue | hw-queued | head | tail |\n"); in mt7915_xmit_queues_show()
944 seq_printf(file, " %s | %9d | %9d | %9d |\n", in mt7915_xmit_queues_show()
945 queue_map[i].queue, q->queued, q->head, in mt7915_xmit_queues_show()
946 q->tail); in mt7915_xmit_queues_show()
956 len += scnprintf(buf + len, sz - len, "%-16s:", #rate " (TMAC)"); \
958 len += scnprintf(buf + len, sz - len, " %6d", txpwr[offs]); \
959 len += scnprintf(buf + len, sz - len, "\n"); \
976 struct mt7915_phy *phy = file->private_data; in mt7915_rate_txpower_get() local
977 struct mt7915_dev *dev = phy->dev; in mt7915_rate_txpower_get()
980 u8 band = phy->mt76->band_idx; in mt7915_rate_txpower_get()
988 return -ENOMEM; in mt7915_rate_txpower_get()
990 ret = mt7915_mcu_get_txpower_sku(phy, txpwr, sizeof(txpwr)); in mt7915_rate_txpower_get()
994 /* Txpower propagation path: TMAC -> TXV -> BBP */ in mt7915_rate_txpower_get()
995 len += scnprintf(buf + len, sz - len, in mt7915_rate_txpower_get()
997 phy != &dev->phy, phy->mt76->chandef.chan->hw_value); in mt7915_rate_txpower_get()
998 len += scnprintf(buf + len, sz - len, "%-16s %6s %6s %6s %6s\n", in mt7915_rate_txpower_get()
1002 len += scnprintf(buf + len, sz - len, in mt7915_rate_txpower_get()
1003 "%-16s %6s %6s %6s %6s %6s %6s %6s %6s\n", in mt7915_rate_txpower_get()
1008 len += scnprintf(buf + len, sz - len, in mt7915_rate_txpower_get()
1009 "%-16s %6s %6s %6s %6s %6s %6s %6s %6s\n", in mt7915_rate_txpower_get()
1014 len += scnprintf(buf + len, sz - len, in mt7915_rate_txpower_get()
1015 "%-16s %6s %6s %6s %6s %6s %6s %6s %6s %6s\n", in mt7915_rate_txpower_get()
1020 len += scnprintf(buf + len, sz - len, in mt7915_rate_txpower_get()
1021 "%-16s %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s\n", in mt7915_rate_txpower_get()
1036 reg = is_mt7915(&dev->mt76) ? MT_WF_PHY_TPC_CTRL_STAT(band) : in mt7915_rate_txpower_get()
1039 len += scnprintf(buf + len, sz - len, "\nTx power (bbp) : %6ld\n", in mt7915_rate_txpower_get()
1054 struct mt7915_phy *phy = file->private_data; in mt7915_rate_txpower_set() local
1055 struct mt7915_dev *dev = phy->dev; in mt7915_rate_txpower_set()
1056 struct mt76_phy *mphy = phy->mt76; in mt7915_rate_txpower_set()
1059 .band_idx = phy->mt76->band_idx, in mt7915_rate_txpower_set()
1066 return -EINVAL; in mt7915_rate_txpower_set()
1069 return -EFAULT; in mt7915_rate_txpower_set()
1071 if (count && buf[count - 1] == '\n') in mt7915_rate_txpower_set()
1072 buf[count - 1] = '\0'; in mt7915_rate_txpower_set()
1078 dev_warn(dev->mt76.dev, in mt7915_rate_txpower_set()
1080 return -EINVAL; in mt7915_rate_txpower_set()
1084 return -EINVAL; in mt7915_rate_txpower_set()
1087 pwr160 = mt7915_get_power_bound(phy, pwr160); in mt7915_rate_txpower_set()
1089 pwr80 = mt7915_get_power_bound(phy, pwr80); in mt7915_rate_txpower_set()
1091 pwr40 = mt7915_get_power_bound(phy, pwr40); in mt7915_rate_txpower_set()
1093 pwr20 = mt7915_get_power_bound(phy, pwr20); in mt7915_rate_txpower_set()
1096 return -EINVAL; in mt7915_rate_txpower_set()
1098 mutex_lock(&dev->mt76.mutex); in mt7915_rate_txpower_set()
1099 ret = mt7915_mcu_get_txpower_sku(phy, req.txpower_sku, in mt7915_rate_txpower_set()
1129 ret = mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(TX_POWER_FEATURE_CTRL), in mt7915_rate_txpower_set()
1135 mphy->txpower_cur = max3(mphy->txpower_cur, pwr160, pwr); in mt7915_rate_txpower_set()
1137 mutex_unlock(&dev->mt76.mutex); in mt7915_rate_txpower_set()
1151 mt7915_twt_stats(struct seq_file *s, void *data) in mt7915_twt_stats() argument
1153 struct mt7915_dev *dev = dev_get_drvdata(s->private); in mt7915_twt_stats()
1158 seq_puts(s, " wcid | id | flags | exp | mantissa"); in mt7915_twt_stats()
1159 seq_puts(s, " | duration | tsf |\n"); in mt7915_twt_stats()
1160 list_for_each_entry_rcu(iter, &dev->twt_list, list) in mt7915_twt_stats()
1161 seq_printf(s, in mt7915_twt_stats()
1163 iter->wcid, iter->id, in mt7915_twt_stats()
1164 iter->sched ? 's' : 'u', in mt7915_twt_stats()
1165 iter->protection ? 'p' : '-', in mt7915_twt_stats()
1166 iter->trigger ? 't' : '-', in mt7915_twt_stats()
1167 iter->flowtype ? '-' : 'a', in mt7915_twt_stats()
1168 iter->exp, iter->mantissa, in mt7915_twt_stats()
1169 iter->duration, iter->tsf); in mt7915_twt_stats()
1186 ret = mt7915_mcu_rf_regval(dev, dev->mt76.debugfs_reg, &regval, false); in mt7915_rf_regval_get()
1201 return mt7915_mcu_rf_regval(dev, dev->mt76.debugfs_reg, &val32, true); in mt7915_rf_regval_set()
1207 int mt7915_init_debugfs(struct mt7915_phy *phy) in mt7915_init_debugfs() argument
1209 struct mt7915_dev *dev = phy->dev; in mt7915_init_debugfs()
1210 bool ext_phy = phy != &dev->phy; in mt7915_init_debugfs()
1213 dir = mt76_register_debugfs_fops(phy->mt76, NULL); in mt7915_init_debugfs()
1215 return -ENOMEM; in mt7915_init_debugfs()
1217 debugfs_create_file("muru_stats", 0400, dir, phy, in mt7915_init_debugfs()
1219 debugfs_create_file("hw-queues", 0400, dir, phy, in mt7915_init_debugfs()
1221 debugfs_create_file("xmit-queues", 0400, dir, phy, in mt7915_init_debugfs()
1223 debugfs_create_file("tx_stats", 0400, dir, phy, &mt7915_tx_stats_fops); in mt7915_init_debugfs()
1224 debugfs_create_file("sys_recovery", 0600, dir, phy, in mt7915_init_debugfs()
1235 debugfs_create_file("txpower_sku", 0400, dir, phy, in mt7915_init_debugfs()
1237 debugfs_create_devm_seqfile(dev->mt76.dev, "twt_stats", dir, in mt7915_init_debugfs()
1241 if (!dev->dbdc_support || phy->mt76->band_idx) { in mt7915_init_debugfs()
1243 &dev->hw_pattern); in mt7915_init_debugfs()
1246 debugfs_create_devm_seqfile(dev->mt76.dev, "rdd_monitor", dir, in mt7915_init_debugfs()
1251 dev->debugfs_dir = dir; in mt7915_init_debugfs()
1265 dest = relay_reserve(dev->relay_fwlog, hdrlen + len + 4); in mt7915_debugfs_write_fwlog()
1276 relay_flush(dev->relay_fwlog); in mt7915_debugfs_write_fwlog()
1293 if (!dev->relay_fwlog) in mt7915_debugfs_rx_fw_monitor()
1306 if (dev->relay_fwlog) in mt7915_debugfs_rx_log()
1313 /** per-station debugfs **/
1319 struct ieee80211_sta *sta = file->private_data; in mt7915_sta_fixed_rate_set()
1320 struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv; in mt7915_sta_fixed_rate_set()
1321 struct mt7915_dev *dev = msta->vif->phy->dev; in mt7915_sta_fixed_rate_set()
1323 struct sta_phy phy = {}; in mt7915_sta_fixed_rate_set() local
1330 return -EINVAL; in mt7915_sta_fixed_rate_set()
1333 return -EFAULT; in mt7915_sta_fixed_rate_set()
1335 if (count && buf[count - 1] == '\n') in mt7915_sta_fixed_rate_set()
1336 buf[count - 1] = '\0'; in mt7915_sta_fixed_rate_set()
1340 /* mode - cck: 0, ofdm: 1, ht: 2, gf: 3, vht: 4, he_su: 8, he_er: 9 in mt7915_sta_fixed_rate_set()
1341 * bw - bw20: 0, bw40: 1, bw80: 2, bw160: 3 in mt7915_sta_fixed_rate_set()
1342 * nss - vht: 1~4, he: 1~4, others: ignore in mt7915_sta_fixed_rate_set()
1343 * mcs - cck: 0~4, ofdm: 0~7, ht: 0~32, vht: 0~9, he_su: 0~11, he_er: 0~2 in mt7915_sta_fixed_rate_set()
1344 * gi - (ht/vht) lgi: 0, sgi: 1; (he) 0.8us: 0, 1.6us: 1, 3.2us: 2 in mt7915_sta_fixed_rate_set()
1345 * ldpc - off: 0, on: 1 in mt7915_sta_fixed_rate_set()
1346 * stbc - off: 0, on: 1 in mt7915_sta_fixed_rate_set()
1347 * he_ltf - 1xltf: 0, 2xltf: 1, 4xltf: 2 in mt7915_sta_fixed_rate_set()
1350 &phy.type, &phy.bw, &phy.nss, &phy.mcs, &gi, in mt7915_sta_fixed_rate_set()
1351 &phy.ldpc, &phy.stbc, &he_ltf) != 8) { in mt7915_sta_fixed_rate_set()
1352 dev_warn(dev->mt76.dev, in mt7915_sta_fixed_rate_set()
1358 phy.ldpc = (phy.bw || phy.ldpc) * GENMASK(2, 0); in mt7915_sta_fixed_rate_set()
1359 for (i = 0; i <= phy.bw; i++) { in mt7915_sta_fixed_rate_set()
1360 phy.sgi |= gi << (i << sta->deflink.he_cap.has_he); in mt7915_sta_fixed_rate_set()
1361 phy.he_ltf |= he_ltf << (i << sta->deflink.he_cap.has_he); in mt7915_sta_fixed_rate_set()
1366 vif = container_of((void *)msta->vif, struct ieee80211_vif, drv_priv); in mt7915_sta_fixed_rate_set()
1367 ret = mt7915_mcu_set_fixed_rate_ctrl(dev, vif, sta, &phy, field); in mt7915_sta_fixed_rate_set()
1369 return -EFAULT; in mt7915_sta_fixed_rate_set()
1382 mt7915_queues_show(struct seq_file *s, void *data) in mt7915_queues_show() argument
1384 struct ieee80211_sta *sta = s->private; in mt7915_queues_show()
1386 mt7915_sta_hw_queue_read(s, sta); in mt7915_queues_show()
1397 debugfs_create_file("hw-queues", 0400, dir, sta, &mt7915_queues_fops); in mt7915_sta_add_debugfs()