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

1 // SPDX-License-Identifier: ISC
31 dev->ibf = !!val; in mt7996_implicit_txbf_set()
41 *val = dev->ibf; in mt7996_implicit_txbf_get()
54 struct mt7996_phy *phy = file->private_data; in mt7996_sys_recovery_set() local
55 struct mt7996_dev *dev = phy->dev; in mt7996_sys_recovery_set()
56 bool band = phy->mt76->band_idx; in mt7996_sys_recovery_set()
62 return -EINVAL; in mt7996_sys_recovery_set()
65 return -EFAULT; in mt7996_sys_recovery_set()
67 if (count && buf[count - 1] == '\n') in mt7996_sys_recovery_set()
68 buf[count - 1] = '\0'; in mt7996_sys_recovery_set()
73 return -EINVAL; in mt7996_sys_recovery_set()
108 dev->recovery.state |= MT_MCU_CMD_WDT_MASK; in mt7996_sys_recovery_set()
129 struct mt7996_phy *phy = file->private_data; in mt7996_sys_recovery_get() local
130 struct mt7996_dev *dev = phy->dev; in mt7996_sys_recovery_get()
138 return -ENOMEM; in mt7996_sys_recovery_get()
141 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
143 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
145 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
147 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
149 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
151 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
153 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
155 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
157 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
159 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
161 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
165 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
166 "\nlet's dump firmware SER statistics...\n"); in mt7996_sys_recovery_get()
167 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
170 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
173 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
176 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
179 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
182 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
185 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
188 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
191 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
194 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
197 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
200 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
203 desc += scnprintf(buff + desc, bufsz - desc, in mt7996_sys_recovery_get()
205 dev->recovery.wm_reset_count, in mt7996_sys_recovery_get()
206 dev->recovery.wa_reset_count); in mt7996_sys_recovery_get()
226 return -EINVAL; in mt7996_radar_trigger()
228 if (val == MT_RX_SEL2 && !dev->rdd2_phy) { in mt7996_radar_trigger()
229 dev_err(dev->mt76.dev, "Background radar is not enabled\n"); in mt7996_radar_trigger()
230 return -EINVAL; in mt7996_radar_trigger()
241 mt7996_rdd_monitor(struct seq_file *s, void *data) in mt7996_rdd_monitor() argument
243 struct mt7996_dev *dev = dev_get_drvdata(s->private); in mt7996_rdd_monitor()
244 struct cfg80211_chan_def *chandef = &dev->rdd2_chandef; in mt7996_rdd_monitor()
248 mutex_lock(&dev->mt76.mutex); in mt7996_rdd_monitor()
251 ret = -EINVAL; in mt7996_rdd_monitor()
255 if (!dev->rdd2_phy) { in mt7996_rdd_monitor()
256 seq_puts(s, "not running\n"); in mt7996_rdd_monitor()
260 switch (chandef->width) { in mt7996_rdd_monitor()
278 seq_printf(s, "channel %d (%d MHz) width %s MHz center1: %d MHz\n", in mt7996_rdd_monitor()
279 chandef->chan->hw_value, chandef->chan->center_freq, in mt7996_rdd_monitor()
280 bw, chandef->center_freq1); in mt7996_rdd_monitor()
282 mutex_unlock(&dev->mt76.mutex); in mt7996_rdd_monitor()
302 dev->fw_debug_wm = val ? MCU_FW_LOG_TO_HOST : 0; in mt7996_fw_debug_wm_set()
304 if (dev->fw_debug_bin) in mt7996_fw_debug_wm_set()
307 val = dev->fw_debug_wm; in mt7996_fw_debug_wm_set()
309 tx = dev->fw_debug_wm || (dev->fw_debug_bin & BIT(1)); in mt7996_fw_debug_wm_set()
310 rx = dev->fw_debug_wm || (dev->fw_debug_bin & BIT(2)); in mt7996_fw_debug_wm_set()
311 en = dev->fw_debug_wm || (dev->fw_debug_bin & BIT(0)); in mt7996_fw_debug_wm_set()
339 *val = dev->fw_debug_wm; in mt7996_fw_debug_wm_get()
353 dev->fw_debug_wa = val ? MCU_FW_LOG_TO_HOST : 0; in mt7996_fw_debug_wa_set()
355 ret = mt7996_mcu_fw_log_2_host(dev, MCU_FW_LOG_WA, dev->fw_debug_wa); in mt7996_fw_debug_wa_set()
360 !!dev->fw_debug_wa, 0); in mt7996_fw_debug_wa_set()
368 *val = dev->fw_debug_wa; in mt7996_fw_debug_wa_get()
409 if (!dev->relay_fwlog) in mt7996_fw_debug_bin_set()
410 dev->relay_fwlog = relay_open("fwlog_data", dev->debugfs_dir, in mt7996_fw_debug_bin_set()
412 if (!dev->relay_fwlog) in mt7996_fw_debug_bin_set()
413 return -ENOMEM; in mt7996_fw_debug_bin_set()
415 dev->fw_debug_bin = val; in mt7996_fw_debug_bin_set()
417 relay_reset(dev->relay_fwlog); in mt7996_fw_debug_bin_set()
419 return mt7996_fw_debug_wm_set(dev, dev->fw_debug_wm); in mt7996_fw_debug_bin_set()
427 *val = dev->fw_debug_bin; in mt7996_fw_debug_bin_get()
438 struct mt7996_dev *dev = file->private; in mt7996_fw_util_wa_show()
440 if (dev->fw_debug_wa) in mt7996_fw_util_wa_show()
450 mt7996_ampdu_stat_read_phy(struct mt7996_phy *phy, struct seq_file *file) in mt7996_ampdu_stat_read_phy() argument
452 struct mt7996_dev *dev = phy->dev; in mt7996_ampdu_stat_read_phy()
454 u8 band_idx = phy->mt76->band_idx; in mt7996_ampdu_stat_read_phy()
463 seq_printf(file, "\nPhy %s, Phy band %d\n", in mt7996_ampdu_stat_read_phy()
464 wiphy_name(phy->mt76->hw->wiphy), band_idx); in mt7996_ampdu_stat_read_phy()
467 for (i = 0; i < ARRAY_SIZE(bound) - 1; i++) in mt7996_ampdu_stat_read_phy()
468 seq_printf(file, "%3d -%3d | ", in mt7996_ampdu_stat_read_phy()
473 seq_printf(file, "%8d | ", phy->mt76->aggr_stats[i]); in mt7996_ampdu_stat_read_phy()
476 seq_printf(file, "BA miss count: %d\n", phy->mib.ba_miss_cnt); in mt7996_ampdu_stat_read_phy()
480 mt7996_txbf_stat_read_phy(struct mt7996_phy *phy, struct seq_file *s) in mt7996_txbf_stat_read_phy() argument
482 struct mt76_mib_stats *mib = &phy->mib; in mt7996_txbf_stat_read_phy()
488 seq_puts(s, "\nTx Beamformer applied PPDU counts: "); in mt7996_txbf_stat_read_phy()
490 seq_printf(s, "iBF: %d, eBF: %d\n", in mt7996_txbf_stat_read_phy()
491 mib->tx_bf_ibf_ppdu_cnt, in mt7996_txbf_stat_read_phy()
492 mib->tx_bf_ebf_ppdu_cnt); in mt7996_txbf_stat_read_phy()
495 seq_puts(s, "Tx Beamformer Rx feedback statistics: "); in mt7996_txbf_stat_read_phy()
497 seq_printf(s, "All: %d, EHT: %d, HE: %d, VHT: %d, HT: %d, ", in mt7996_txbf_stat_read_phy()
498 mib->tx_bf_rx_fb_all_cnt, in mt7996_txbf_stat_read_phy()
499 mib->tx_bf_rx_fb_eht_cnt, in mt7996_txbf_stat_read_phy()
500 mib->tx_bf_rx_fb_he_cnt, in mt7996_txbf_stat_read_phy()
501 mib->tx_bf_rx_fb_vht_cnt, in mt7996_txbf_stat_read_phy()
502 mib->tx_bf_rx_fb_ht_cnt); in mt7996_txbf_stat_read_phy()
504 seq_printf(s, "%s, NC: %d, NR: %d\n", in mt7996_txbf_stat_read_phy()
505 bw[mib->tx_bf_rx_fb_bw], in mt7996_txbf_stat_read_phy()
506 mib->tx_bf_rx_fb_nc_cnt, in mt7996_txbf_stat_read_phy()
507 mib->tx_bf_rx_fb_nr_cnt); in mt7996_txbf_stat_read_phy()
510 seq_printf(s, "Tx Beamformee successful feedback frames: %d\n", in mt7996_txbf_stat_read_phy()
511 mib->tx_bf_fb_cpl_cnt); in mt7996_txbf_stat_read_phy()
512 seq_printf(s, "Tx Beamformee feedback triggered counts: %d\n", in mt7996_txbf_stat_read_phy()
513 mib->tx_bf_fb_trig_cnt); in mt7996_txbf_stat_read_phy()
516 seq_printf(s, "Tx multi-user Beamforming counts: %d\n", in mt7996_txbf_stat_read_phy()
517 mib->tx_mu_bf_cnt); in mt7996_txbf_stat_read_phy()
518 seq_printf(s, "Tx multi-user MPDU counts: %d\n", mib->tx_mu_mpdu_cnt); in mt7996_txbf_stat_read_phy()
519 seq_printf(s, "Tx multi-user successful MPDU counts: %d\n", in mt7996_txbf_stat_read_phy()
520 mib->tx_mu_acked_mpdu_cnt); in mt7996_txbf_stat_read_phy()
521 seq_printf(s, "Tx single-user successful MPDU counts: %d\n", in mt7996_txbf_stat_read_phy()
522 mib->tx_su_acked_mpdu_cnt); in mt7996_txbf_stat_read_phy()
524 seq_puts(s, "\n"); in mt7996_txbf_stat_read_phy()
530 struct mt7996_phy *phy = file->private; in mt7996_tx_stats_show() local
531 struct mt7996_dev *dev = phy->dev; in mt7996_tx_stats_show()
532 struct mt76_mib_stats *mib = &phy->mib; in mt7996_tx_stats_show()
536 mutex_lock(&dev->mt76.mutex); in mt7996_tx_stats_show()
538 mt7996_mac_update_stats(phy); in mt7996_tx_stats_show()
539 mt7996_ampdu_stat_read_phy(phy, file); in mt7996_tx_stats_show()
541 attempts = mib->tx_mpdu_attempts_cnt; in mt7996_tx_stats_show()
542 success = mib->tx_mpdu_success_cnt; in mt7996_tx_stats_show()
543 per = attempts ? 100 - success * 100 / attempts : 100; in mt7996_tx_stats_show()
548 mt7996_txbf_stat_read_phy(phy, file); in mt7996_tx_stats_show()
552 for (i = 0; i < ARRAY_SIZE(mib->tx_amsdu); i++) { in mt7996_tx_stats_show()
554 i + 1, mib->tx_amsdu[i]); in mt7996_tx_stats_show()
555 if (mib->tx_amsdu_cnt) in mt7996_tx_stats_show()
557 mib->tx_amsdu[i] * 100 / mib->tx_amsdu_cnt); in mt7996_tx_stats_show()
562 mutex_unlock(&dev->mt76.mutex); in mt7996_tx_stats_show()
570 mt7996_hw_queue_read(struct seq_file *s, u32 size, in mt7996_hw_queue_read() argument
573 struct mt7996_phy *phy = s->private; in mt7996_hw_queue_read() local
574 struct mt7996_dev *dev = phy->dev; in mt7996_hw_queue_read()
594 seq_printf(s, "\t%s: ", map[i].name); in mt7996_hw_queue_read()
595 seq_printf(s, "queued:0x%03x head:0x%03x tail:0x%03x\n", in mt7996_hw_queue_read()
603 struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv; in mt7996_sta_hw_queue_read()
604 struct mt7996_dev *dev = msta->vif->phy->dev; in mt7996_sta_hw_queue_read()
605 struct seq_file *s = data; in mt7996_sta_hw_queue_read() local
610 u32 idx = msta->wcid.idx >> 5; in mt7996_sta_hw_queue_read()
611 u8 offs = msta->wcid.idx & GENMASK(4, 0); in mt7996_sta_hw_queue_read()
619 mt76_wr(dev, MT_FL_Q0_CTRL, ctrl | msta->wcid.idx); in mt7996_sta_hw_queue_read()
622 seq_printf(s, "\tSTA %pM wcid %d: AC%d%d queued:%d\n", in mt7996_sta_hw_queue_read()
623 sta->addr, msta->wcid.idx, in mt7996_sta_hw_queue_read()
624 msta->vif->mt76.wmm_idx, ac, qlen); in mt7996_sta_hw_queue_read()
631 struct mt7996_phy *phy = file->private; in mt7996_hw_queues_show() local
632 struct mt7996_dev *dev = phy->dev; in mt7996_hw_queues_show()
681 seq_puts(file, "PLE non-empty queue info:\n"); in mt7996_hw_queues_show()
685 /* iterate per-sta ple queue */ in mt7996_hw_queues_show()
686 ieee80211_iterate_stations_atomic(phy->mt76->hw, in mt7996_hw_queues_show()
689 seq_puts(file, "PSE non-empty queue info:\n"); in mt7996_hw_queues_show()
701 struct mt7996_phy *phy = file->private; in mt7996_xmit_queues_show() local
702 struct mt7996_dev *dev = phy->dev; in mt7996_xmit_queues_show()
707 { phy->mt76->q_tx[MT_TXQ_BE], " MAIN" }, in mt7996_xmit_queues_show()
708 { dev->mt76.q_mcu[MT_MCUQ_WM], " MCUWM" }, in mt7996_xmit_queues_show()
709 { dev->mt76.q_mcu[MT_MCUQ_WA], " MCUWA" }, in mt7996_xmit_queues_show()
710 { dev->mt76.q_mcu[MT_MCUQ_FWDL], "MCUFWDL" }, in mt7996_xmit_queues_show()
714 seq_puts(file, " queue | hw-queued | head | tail |\n"); in mt7996_xmit_queues_show()
721 seq_printf(file, " %s | %9d | %9d | %9d |\n", in mt7996_xmit_queues_show()
722 queue_map[i].queue, q->queued, q->head, in mt7996_xmit_queues_show()
723 q->tail); in mt7996_xmit_queues_show()
732 mt7996_twt_stats(struct seq_file *s, void *data) in mt7996_twt_stats() argument
734 struct mt7996_dev *dev = dev_get_drvdata(s->private); in mt7996_twt_stats()
739 seq_puts(s, " wcid | id | flags | exp | mantissa"); in mt7996_twt_stats()
740 seq_puts(s, " | duration | tsf |\n"); in mt7996_twt_stats()
741 list_for_each_entry_rcu(iter, &dev->twt_list, list) in mt7996_twt_stats()
742 seq_printf(s, in mt7996_twt_stats()
744 iter->wcid, iter->id, in mt7996_twt_stats()
745 iter->sched ? 's' : 'u', in mt7996_twt_stats()
746 iter->protection ? 'p' : '-', in mt7996_twt_stats()
747 iter->trigger ? 't' : '-', in mt7996_twt_stats()
748 iter->flowtype ? '-' : 'a', in mt7996_twt_stats()
749 iter->exp, iter->mantissa, in mt7996_twt_stats()
750 iter->duration, iter->tsf); in mt7996_twt_stats()
767 ret = mt7996_mcu_rf_regval(dev, dev->mt76.debugfs_reg, &regval, false); in mt7996_rf_regval_get()
782 return mt7996_mcu_rf_regval(dev, dev->mt76.debugfs_reg, &val32, true); in mt7996_rf_regval_set()
788 int mt7996_init_debugfs(struct mt7996_phy *phy) in mt7996_init_debugfs() argument
790 struct mt7996_dev *dev = phy->dev; in mt7996_init_debugfs()
793 dir = mt76_register_debugfs_fops(phy->mt76, NULL); in mt7996_init_debugfs()
795 return -ENOMEM; in mt7996_init_debugfs()
796 debugfs_create_file("hw-queues", 0400, dir, phy, in mt7996_init_debugfs()
798 debugfs_create_file("xmit-queues", 0400, dir, phy, in mt7996_init_debugfs()
800 debugfs_create_file("tx_stats", 0400, dir, phy, &mt7996_tx_stats_fops); in mt7996_init_debugfs()
801 debugfs_create_file("sys_recovery", 0600, dir, phy, in mt7996_init_debugfs()
811 debugfs_create_devm_seqfile(dev->mt76.dev, "twt_stats", dir, in mt7996_init_debugfs()
815 if (phy->mt76->cap.has_5ghz) { in mt7996_init_debugfs()
817 &dev->hw_pattern); in mt7996_init_debugfs()
820 debugfs_create_devm_seqfile(dev->mt76.dev, "rdd_monitor", dir, in mt7996_init_debugfs()
824 if (phy == &dev->phy) in mt7996_init_debugfs()
825 dev->debugfs_dir = dir; in mt7996_init_debugfs()
839 dest = relay_reserve(dev->relay_fwlog, hdrlen + len + 4); in mt7996_debugfs_write_fwlog()
850 relay_flush(dev->relay_fwlog); in mt7996_debugfs_write_fwlog()
871 if (!dev->relay_fwlog) in mt7996_debugfs_rx_fw_monitor()
874 hdr.serial_id = cpu_to_le16(dev->fw_debug_seq++); in mt7996_debugfs_rx_fw_monitor()
885 if (dev->relay_fwlog) in mt7996_debugfs_rx_log()
892 /** per-station debugfs **/
900 struct ieee80211_sta *sta = file->private_data; in mt7996_sta_fixed_rate_set()
901 struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv; in mt7996_sta_fixed_rate_set()
902 struct mt7996_dev *dev = msta->vif->phy->dev; in mt7996_sta_fixed_rate_set()
903 struct ra_rate phy = {}; in mt7996_sta_fixed_rate_set() local
909 return -EINVAL; in mt7996_sta_fixed_rate_set()
912 return -EFAULT; in mt7996_sta_fixed_rate_set()
914 if (count && buf[count - 1] == '\n') in mt7996_sta_fixed_rate_set()
915 buf[count - 1] = '\0'; in mt7996_sta_fixed_rate_set()
919 /* mode - cck: 0, ofdm: 1, ht: 2, gf: 3, vht: 4, he_su: 8, he_er: 9 EHT: 15 in mt7996_sta_fixed_rate_set()
920 * bw - bw20: 0, bw40: 1, bw80: 2, bw160: 3, BW320: 4 in mt7996_sta_fixed_rate_set()
921 * nss - vht: 1~4, he: 1~4, eht: 1~4, others: ignore in mt7996_sta_fixed_rate_set()
922 * mcs - cck: 0~4, ofdm: 0~7, ht: 0~32, vht: 0~9, he_su: 0~11, he_er: 0~2, eht: 0~13 in mt7996_sta_fixed_rate_set()
923 * gi - (ht/vht) lgi: 0, sgi: 1; (he) 0.8us: 0, 1.6us: 1, 3.2us: 2 in mt7996_sta_fixed_rate_set()
924 * preamble - short: 1, long: 0 in mt7996_sta_fixed_rate_set()
925 * ldpc - off: 0, on: 1 in mt7996_sta_fixed_rate_set()
926 * stbc - off: 0, on: 1 in mt7996_sta_fixed_rate_set()
927 * ltf - 1xltf: 0, 2xltf: 1, 4xltf: 2 in mt7996_sta_fixed_rate_set()
930 &phy.mode, &phy.bw, &phy.mcs, &phy.nss, &gi, in mt7996_sta_fixed_rate_set()
931 &phy.preamble, &phy.stbc, &phy.ldpc, &phy.spe, &ltf) != 10) { in mt7996_sta_fixed_rate_set()
932 dev_warn(dev->mt76.dev, in mt7996_sta_fixed_rate_set()
937 phy.wlan_idx = cpu_to_le16(msta->wcid.idx); in mt7996_sta_fixed_rate_set()
938 phy.gi = cpu_to_le16(gi); in mt7996_sta_fixed_rate_set()
939 phy.ltf = cpu_to_le16(ltf); in mt7996_sta_fixed_rate_set()
940 phy.ldpc = phy.ldpc ? 7 : 0; in mt7996_sta_fixed_rate_set()
941 phy.preamble = phy.preamble ? SHORT_PREAMBLE : LONG_PREAMBLE; in mt7996_sta_fixed_rate_set()
943 ret = mt7996_mcu_set_fixed_rate_ctrl(dev, &phy, 0); in mt7996_sta_fixed_rate_set()
945 return -EFAULT; in mt7996_sta_fixed_rate_set()
959 mt7996_queues_show(struct seq_file *s, void *data) in mt7996_queues_show() argument
961 struct ieee80211_sta *sta = s->private; in mt7996_queues_show()
963 mt7996_sta_hw_queue_read(s, sta); in mt7996_queues_show()
974 debugfs_create_file("hw-queues", 0400, dir, sta, &mt7996_queues_fops); in mt7996_sta_add_debugfs()