Lines Matching +full:d +full:- +full:phy
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()
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()
204 "\nSYS_RESET_COUNT: WM %d, WA %d\n", 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()
238 struct mt7996_dev *dev = dev_get_drvdata(s->private); in mt7996_rdd_monitor()
239 struct cfg80211_chan_def *chandef = &dev->rdd2_chandef; in mt7996_rdd_monitor()
243 mutex_lock(&dev->mt76.mutex); in mt7996_rdd_monitor()
246 ret = -EINVAL; in mt7996_rdd_monitor()
250 if (!dev->rdd2_phy) { in mt7996_rdd_monitor()
255 switch (chandef->width) { in mt7996_rdd_monitor()
273 seq_printf(s, "channel %d (%d MHz) width %s MHz center1: %d MHz\n", in mt7996_rdd_monitor()
274 chandef->chan->hw_value, chandef->chan->center_freq, in mt7996_rdd_monitor()
275 bw, chandef->center_freq1); in mt7996_rdd_monitor()
277 mutex_unlock(&dev->mt76.mutex); in mt7996_rdd_monitor()
297 dev->fw_debug_wm = val ? MCU_FW_LOG_TO_HOST : 0; in mt7996_fw_debug_wm_set()
299 if (dev->fw_debug_bin) in mt7996_fw_debug_wm_set()
302 val = dev->fw_debug_wm; in mt7996_fw_debug_wm_set()
304 tx = dev->fw_debug_wm || (dev->fw_debug_bin & BIT(1)); in mt7996_fw_debug_wm_set()
305 rx = dev->fw_debug_wm || (dev->fw_debug_bin & BIT(2)); in mt7996_fw_debug_wm_set()
306 en = dev->fw_debug_wm || (dev->fw_debug_bin & BIT(0)); in mt7996_fw_debug_wm_set()
334 *val = dev->fw_debug_wm; in mt7996_fw_debug_wm_get()
348 dev->fw_debug_wa = val ? MCU_FW_LOG_TO_HOST : 0; in mt7996_fw_debug_wa_set()
350 ret = mt7996_mcu_fw_log_2_host(dev, MCU_FW_LOG_WA, dev->fw_debug_wa); in mt7996_fw_debug_wa_set()
355 !!dev->fw_debug_wa, 0); in mt7996_fw_debug_wa_set()
363 *val = dev->fw_debug_wa; in mt7996_fw_debug_wa_get()
404 if (!dev->relay_fwlog) in mt7996_fw_debug_bin_set()
405 dev->relay_fwlog = relay_open("fwlog_data", dev->debugfs_dir, in mt7996_fw_debug_bin_set()
407 if (!dev->relay_fwlog) in mt7996_fw_debug_bin_set()
408 return -ENOMEM; in mt7996_fw_debug_bin_set()
410 dev->fw_debug_bin = val; in mt7996_fw_debug_bin_set()
412 relay_reset(dev->relay_fwlog); in mt7996_fw_debug_bin_set()
414 return mt7996_fw_debug_wm_set(dev, dev->fw_debug_wm); in mt7996_fw_debug_bin_set()
422 *val = dev->fw_debug_bin; in mt7996_fw_debug_bin_get()
433 struct mt7996_dev *dev = file->private; in mt7996_fw_util_wa_show()
435 if (dev->fw_debug_wa) in mt7996_fw_util_wa_show()
445 mt7996_ampdu_stat_read_phy(struct mt7996_phy *phy, struct seq_file *file) in mt7996_ampdu_stat_read_phy() argument
447 struct mt7996_dev *dev = phy->dev; in mt7996_ampdu_stat_read_phy()
449 u8 band_idx = phy->mt76->band_idx; in mt7996_ampdu_stat_read_phy()
458 seq_printf(file, "\nPhy %s, Phy band %d\n", in mt7996_ampdu_stat_read_phy()
459 wiphy_name(phy->mt76->hw->wiphy), band_idx); in mt7996_ampdu_stat_read_phy()
461 seq_printf(file, "Length: %8d | ", bound[0]); in mt7996_ampdu_stat_read_phy()
462 for (i = 0; i < ARRAY_SIZE(bound) - 1; i++) in mt7996_ampdu_stat_read_phy()
463 seq_printf(file, "%3d -%3d | ", in mt7996_ampdu_stat_read_phy()
468 seq_printf(file, "%8d | ", phy->mt76->aggr_stats[i]); in mt7996_ampdu_stat_read_phy()
471 seq_printf(file, "BA miss count: %d\n", phy->mib.ba_miss_cnt); in mt7996_ampdu_stat_read_phy()
475 mt7996_txbf_stat_read_phy(struct mt7996_phy *phy, struct seq_file *s) in mt7996_txbf_stat_read_phy() argument
477 struct mt76_mib_stats *mib = &phy->mib; in mt7996_txbf_stat_read_phy()
485 seq_printf(s, "iBF: %d, eBF: %d\n", in mt7996_txbf_stat_read_phy()
486 mib->tx_bf_ibf_ppdu_cnt, in mt7996_txbf_stat_read_phy()
487 mib->tx_bf_ebf_ppdu_cnt); in mt7996_txbf_stat_read_phy()
492 seq_printf(s, "All: %d, HE: %d, VHT: %d, HT: %d, ", in mt7996_txbf_stat_read_phy()
493 mib->tx_bf_rx_fb_all_cnt, in mt7996_txbf_stat_read_phy()
494 mib->tx_bf_rx_fb_he_cnt, in mt7996_txbf_stat_read_phy()
495 mib->tx_bf_rx_fb_vht_cnt, in mt7996_txbf_stat_read_phy()
496 mib->tx_bf_rx_fb_ht_cnt); in mt7996_txbf_stat_read_phy()
498 seq_printf(s, "%s, NC: %d, NR: %d\n", in mt7996_txbf_stat_read_phy()
499 bw[mib->tx_bf_rx_fb_bw], in mt7996_txbf_stat_read_phy()
500 mib->tx_bf_rx_fb_nc_cnt, in mt7996_txbf_stat_read_phy()
501 mib->tx_bf_rx_fb_nr_cnt); in mt7996_txbf_stat_read_phy()
504 seq_printf(s, "Tx Beamformee successful feedback frames: %d\n", in mt7996_txbf_stat_read_phy()
505 mib->tx_bf_fb_cpl_cnt); in mt7996_txbf_stat_read_phy()
506 seq_printf(s, "Tx Beamformee feedback triggered counts: %d\n", in mt7996_txbf_stat_read_phy()
507 mib->tx_bf_fb_trig_cnt); in mt7996_txbf_stat_read_phy()
510 seq_printf(s, "Tx multi-user Beamforming counts: %d\n", in mt7996_txbf_stat_read_phy()
511 mib->tx_mu_bf_cnt); in mt7996_txbf_stat_read_phy()
512 seq_printf(s, "Tx multi-user MPDU counts: %d\n", mib->tx_mu_mpdu_cnt); in mt7996_txbf_stat_read_phy()
513 seq_printf(s, "Tx multi-user successful MPDU counts: %d\n", in mt7996_txbf_stat_read_phy()
514 mib->tx_mu_acked_mpdu_cnt); in mt7996_txbf_stat_read_phy()
515 seq_printf(s, "Tx single-user successful MPDU counts: %d\n", in mt7996_txbf_stat_read_phy()
516 mib->tx_su_acked_mpdu_cnt); in mt7996_txbf_stat_read_phy()
524 struct mt7996_phy *phy = file->private; in mt7996_tx_stats_show() local
525 struct mt7996_dev *dev = phy->dev; in mt7996_tx_stats_show()
526 struct mt76_mib_stats *mib = &phy->mib; in mt7996_tx_stats_show()
530 mutex_lock(&dev->mt76.mutex); in mt7996_tx_stats_show()
532 mt7996_mac_update_stats(phy); in mt7996_tx_stats_show()
533 mt7996_ampdu_stat_read_phy(phy, file); in mt7996_tx_stats_show()
535 attempts = mib->tx_mpdu_attempts_cnt; in mt7996_tx_stats_show()
536 success = mib->tx_mpdu_success_cnt; in mt7996_tx_stats_show()
537 per = attempts ? 100 - success * 100 / attempts : 100; in mt7996_tx_stats_show()
542 mt7996_txbf_stat_read_phy(phy, file); in mt7996_tx_stats_show()
546 for (i = 0; i < ARRAY_SIZE(mib->tx_amsdu); i++) { in mt7996_tx_stats_show()
547 seq_printf(file, "AMSDU pack count of %d MSDU in TXD: %8d ", in mt7996_tx_stats_show()
548 i + 1, mib->tx_amsdu[i]); in mt7996_tx_stats_show()
549 if (mib->tx_amsdu_cnt) in mt7996_tx_stats_show()
550 seq_printf(file, "(%3d%%)\n", in mt7996_tx_stats_show()
551 mib->tx_amsdu[i] * 100 / mib->tx_amsdu_cnt); in mt7996_tx_stats_show()
556 mutex_unlock(&dev->mt76.mutex); in mt7996_tx_stats_show()
567 struct mt7996_phy *phy = s->private; in mt7996_hw_queue_read() local
568 struct mt7996_dev *dev = phy->dev; in mt7996_hw_queue_read()
597 struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv; in mt7996_sta_hw_queue_read()
598 struct mt7996_dev *dev = msta->vif->phy->dev; in mt7996_sta_hw_queue_read()
604 u32 idx = msta->wcid.idx >> 5; in mt7996_sta_hw_queue_read()
605 u8 offs = msta->wcid.idx & GENMASK(4, 0); in mt7996_sta_hw_queue_read()
613 mt76_wr(dev, MT_FL_Q0_CTRL, ctrl | msta->wcid.idx); in mt7996_sta_hw_queue_read()
616 seq_printf(s, "\tSTA %pM wcid %d: AC%d%d queued:%d\n", in mt7996_sta_hw_queue_read()
617 sta->addr, msta->wcid.idx, in mt7996_sta_hw_queue_read()
618 msta->vif->mt76.wmm_idx, ac, qlen); in mt7996_sta_hw_queue_read()
625 struct mt7996_phy *phy = file->private; in mt7996_hw_queues_show() local
626 struct mt7996_dev *dev = phy->dev; in mt7996_hw_queues_show()
675 seq_puts(file, "PLE non-empty queue info:\n"); in mt7996_hw_queues_show()
679 /* iterate per-sta ple queue */ in mt7996_hw_queues_show()
680 ieee80211_iterate_stations_atomic(phy->mt76->hw, in mt7996_hw_queues_show()
683 seq_puts(file, "PSE non-empty queue info:\n"); in mt7996_hw_queues_show()
695 struct mt7996_phy *phy = file->private; in mt7996_xmit_queues_show() local
696 struct mt7996_dev *dev = phy->dev; in mt7996_xmit_queues_show()
701 { phy->mt76->q_tx[MT_TXQ_BE], " MAIN" }, in mt7996_xmit_queues_show()
702 { dev->mt76.q_mcu[MT_MCUQ_WM], " MCUWM" }, in mt7996_xmit_queues_show()
703 { dev->mt76.q_mcu[MT_MCUQ_WA], " MCUWA" }, in mt7996_xmit_queues_show()
704 { dev->mt76.q_mcu[MT_MCUQ_FWDL], "MCUFWDL" }, in mt7996_xmit_queues_show()
708 seq_puts(file, " queue | hw-queued | head | tail |\n"); in mt7996_xmit_queues_show()
715 seq_printf(file, " %s | %9d | %9d | %9d |\n", in mt7996_xmit_queues_show()
716 queue_map[i].queue, q->queued, q->head, in mt7996_xmit_queues_show()
717 q->tail); in mt7996_xmit_queues_show()
728 struct mt7996_dev *dev = dev_get_drvdata(s->private); in mt7996_twt_stats()
735 list_for_each_entry_rcu(iter, &dev->twt_list, list) in mt7996_twt_stats()
737 "%9d | %8d | %5c%c%c%c | %8d | %8d | %8d | %14lld |\n", in mt7996_twt_stats()
738 iter->wcid, iter->id, in mt7996_twt_stats()
739 iter->sched ? 's' : 'u', in mt7996_twt_stats()
740 iter->protection ? 'p' : '-', in mt7996_twt_stats()
741 iter->trigger ? 't' : '-', in mt7996_twt_stats()
742 iter->flowtype ? '-' : 'a', in mt7996_twt_stats()
743 iter->exp, iter->mantissa, in mt7996_twt_stats()
744 iter->duration, iter->tsf); in mt7996_twt_stats()
761 ret = mt7996_mcu_rf_regval(dev, dev->mt76.debugfs_reg, ®val, false); in mt7996_rf_regval_get()
776 return mt7996_mcu_rf_regval(dev, dev->mt76.debugfs_reg, &val32, true); in mt7996_rf_regval_set()
782 int mt7996_init_debugfs(struct mt7996_phy *phy) in mt7996_init_debugfs() argument
784 struct mt7996_dev *dev = phy->dev; in mt7996_init_debugfs()
787 dir = mt76_register_debugfs_fops(phy->mt76, NULL); in mt7996_init_debugfs()
789 return -ENOMEM; in mt7996_init_debugfs()
790 debugfs_create_file("hw-queues", 0400, dir, phy, in mt7996_init_debugfs()
792 debugfs_create_file("xmit-queues", 0400, dir, phy, in mt7996_init_debugfs()
794 debugfs_create_file("tx_stats", 0400, dir, phy, &mt7996_tx_stats_fops); in mt7996_init_debugfs()
795 debugfs_create_file("sys_recovery", 0600, dir, phy, in mt7996_init_debugfs()
805 debugfs_create_devm_seqfile(dev->mt76.dev, "twt_stats", dir, in mt7996_init_debugfs()
809 if (phy->mt76->cap.has_5ghz) { in mt7996_init_debugfs()
811 &dev->hw_pattern); in mt7996_init_debugfs()
814 debugfs_create_devm_seqfile(dev->mt76.dev, "rdd_monitor", dir, in mt7996_init_debugfs()
818 if (phy == &dev->phy) in mt7996_init_debugfs()
819 dev->debugfs_dir = dir; in mt7996_init_debugfs()
833 dest = relay_reserve(dev->relay_fwlog, hdrlen + len + 4); in mt7996_debugfs_write_fwlog()
844 relay_flush(dev->relay_fwlog); in mt7996_debugfs_write_fwlog()
865 if (!dev->relay_fwlog) in mt7996_debugfs_rx_fw_monitor()
868 hdr.serial_id = cpu_to_le16(dev->fw_debug_seq++); in mt7996_debugfs_rx_fw_monitor()
879 if (dev->relay_fwlog) in mt7996_debugfs_rx_log()
886 /** per-station debugfs **/
894 struct ieee80211_sta *sta = file->private_data; in mt7996_sta_fixed_rate_set()
895 struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv; in mt7996_sta_fixed_rate_set()
896 struct mt7996_dev *dev = msta->vif->phy->dev; in mt7996_sta_fixed_rate_set()
897 struct ra_rate phy = {}; in mt7996_sta_fixed_rate_set() local
903 return -EINVAL; in mt7996_sta_fixed_rate_set()
906 return -EFAULT; in mt7996_sta_fixed_rate_set()
908 if (count && buf[count - 1] == '\n') in mt7996_sta_fixed_rate_set()
909 buf[count - 1] = '\0'; in mt7996_sta_fixed_rate_set()
913 /* 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()
914 * bw - bw20: 0, bw40: 1, bw80: 2, bw160: 3, BW320: 4 in mt7996_sta_fixed_rate_set()
915 * nss - vht: 1~4, he: 1~4, eht: 1~4, others: ignore in mt7996_sta_fixed_rate_set()
916 * 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()
917 * gi - (ht/vht) lgi: 0, sgi: 1; (he) 0.8us: 0, 1.6us: 1, 3.2us: 2 in mt7996_sta_fixed_rate_set()
918 * preamble - short: 1, long: 0 in mt7996_sta_fixed_rate_set()
919 * ldpc - off: 0, on: 1 in mt7996_sta_fixed_rate_set()
920 * stbc - off: 0, on: 1 in mt7996_sta_fixed_rate_set()
921 * ltf - 1xltf: 0, 2xltf: 1, 4xltf: 2 in mt7996_sta_fixed_rate_set()
924 &phy.mode, &phy.bw, &phy.mcs, &phy.nss, &gi, in mt7996_sta_fixed_rate_set()
925 &phy.preamble, &phy.stbc, &phy.ldpc, &phy.spe, <f) != 10) { in mt7996_sta_fixed_rate_set()
926 dev_warn(dev->mt76.dev, in mt7996_sta_fixed_rate_set()
931 phy.wlan_idx = cpu_to_le16(msta->wcid.idx); in mt7996_sta_fixed_rate_set()
932 phy.gi = cpu_to_le16(gi); in mt7996_sta_fixed_rate_set()
933 phy.ltf = cpu_to_le16(ltf); in mt7996_sta_fixed_rate_set()
934 phy.ldpc = phy.ldpc ? 7 : 0; in mt7996_sta_fixed_rate_set()
935 phy.preamble = phy.preamble ? SHORT_PREAMBLE : LONG_PREAMBLE; in mt7996_sta_fixed_rate_set()
937 ret = mt7996_mcu_set_fixed_rate_ctrl(dev, &phy, 0); in mt7996_sta_fixed_rate_set()
939 return -EFAULT; in mt7996_sta_fixed_rate_set()
955 struct ieee80211_sta *sta = s->private; in mt7996_queues_show()
968 debugfs_create_file("hw-queues", 0400, dir, sta, &mt7996_queues_fops); in mt7996_sta_add_debugfs()