Lines Matching refs:mvm

23 	struct iwl_mvm *mvm = file->private_data;  in iwl_dbgfs_ctdp_budget_read()  local
27 if (!iwl_mvm_is_ctdp_supported(mvm)) in iwl_dbgfs_ctdp_budget_read()
30 if (!iwl_mvm_firmware_running(mvm) || in iwl_dbgfs_ctdp_budget_read()
31 mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR) in iwl_dbgfs_ctdp_budget_read()
34 mutex_lock(&mvm->mutex); in iwl_dbgfs_ctdp_budget_read()
35 budget = iwl_mvm_ctdp_command(mvm, CTDP_CMD_OPERATION_REPORT, 0); in iwl_dbgfs_ctdp_budget_read()
36 mutex_unlock(&mvm->mutex); in iwl_dbgfs_ctdp_budget_read()
46 static ssize_t iwl_dbgfs_stop_ctdp_write(struct iwl_mvm *mvm, char *buf, in iwl_dbgfs_stop_ctdp_write() argument
51 if (!iwl_mvm_is_ctdp_supported(mvm)) in iwl_dbgfs_stop_ctdp_write()
54 if (!iwl_mvm_firmware_running(mvm) || in iwl_dbgfs_stop_ctdp_write()
55 mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR) in iwl_dbgfs_stop_ctdp_write()
58 mutex_lock(&mvm->mutex); in iwl_dbgfs_stop_ctdp_write()
59 ret = iwl_mvm_ctdp_command(mvm, CTDP_CMD_OPERATION_STOP, 0); in iwl_dbgfs_stop_ctdp_write()
60 mutex_unlock(&mvm->mutex); in iwl_dbgfs_stop_ctdp_write()
65 static ssize_t iwl_dbgfs_force_ctkill_write(struct iwl_mvm *mvm, char *buf, in iwl_dbgfs_force_ctkill_write() argument
68 if (!iwl_mvm_firmware_running(mvm) || in iwl_dbgfs_force_ctkill_write()
69 mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR) in iwl_dbgfs_force_ctkill_write()
72 iwl_mvm_enter_ctkill(mvm); in iwl_dbgfs_force_ctkill_write()
77 static ssize_t iwl_dbgfs_tx_flush_write(struct iwl_mvm *mvm, char *buf, in iwl_dbgfs_tx_flush_write() argument
83 if (!iwl_mvm_firmware_running(mvm) || in iwl_dbgfs_tx_flush_write()
84 mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR) in iwl_dbgfs_tx_flush_write()
90 if (iwl_mvm_has_new_tx_api(mvm)) { in iwl_dbgfs_tx_flush_write()
91 IWL_DEBUG_TX_QUEUES(mvm, in iwl_dbgfs_tx_flush_write()
94 mutex_lock(&mvm->mutex); in iwl_dbgfs_tx_flush_write()
95 ret = iwl_mvm_flush_sta_tids(mvm, flush_arg, 0xFFFF) in iwl_dbgfs_tx_flush_write()
97 mutex_unlock(&mvm->mutex); in iwl_dbgfs_tx_flush_write()
101 IWL_DEBUG_TX_QUEUES(mvm, "FLUSHING queues mask to flush = 0x%x\n", in iwl_dbgfs_tx_flush_write()
104 mutex_lock(&mvm->mutex); in iwl_dbgfs_tx_flush_write()
105 ret = iwl_mvm_flush_tx_path(mvm, flush_arg) ? : count; in iwl_dbgfs_tx_flush_write()
106 mutex_unlock(&mvm->mutex); in iwl_dbgfs_tx_flush_write()
111 static ssize_t iwl_dbgfs_sta_drain_write(struct iwl_mvm *mvm, char *buf, in iwl_dbgfs_sta_drain_write() argument
117 if (!iwl_mvm_firmware_running(mvm) || in iwl_dbgfs_sta_drain_write()
118 mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR) in iwl_dbgfs_sta_drain_write()
123 if (sta_id < 0 || sta_id >= mvm->fw->ucode_capa.num_stations) in iwl_dbgfs_sta_drain_write()
128 mutex_lock(&mvm->mutex); in iwl_dbgfs_sta_drain_write()
130 mvmsta = iwl_mvm_sta_from_staid_protected(mvm, sta_id); in iwl_dbgfs_sta_drain_write()
135 ret = iwl_mvm_drain_sta(mvm, mvmsta, drain) ? : count; in iwl_dbgfs_sta_drain_write()
137 mutex_unlock(&mvm->mutex); in iwl_dbgfs_sta_drain_write()
145 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_sram_read() local
151 if (!iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_sram_read()
155 img = &mvm->fw->img[mvm->fwrt.cur_fw_img]; in iwl_dbgfs_sram_read()
159 if (mvm->dbgfs_sram_len) { in iwl_dbgfs_sram_read()
160 ofs = mvm->dbgfs_sram_offset; in iwl_dbgfs_sram_read()
161 len = mvm->dbgfs_sram_len; in iwl_dbgfs_sram_read()
168 iwl_trans_read_mem_bytes(mvm->trans, ofs, ptr, len); in iwl_dbgfs_sram_read()
177 static ssize_t iwl_dbgfs_sram_write(struct iwl_mvm *mvm, char *buf, in iwl_dbgfs_sram_write() argument
184 if (!iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_sram_write()
187 img = &mvm->fw->img[mvm->fwrt.cur_fw_img]; in iwl_dbgfs_sram_write()
198 mvm->dbgfs_sram_offset = offset; in iwl_dbgfs_sram_write()
199 mvm->dbgfs_sram_len = len; in iwl_dbgfs_sram_write()
201 mvm->dbgfs_sram_offset = 0; in iwl_dbgfs_sram_write()
202 mvm->dbgfs_sram_len = 0; in iwl_dbgfs_sram_write()
212 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_set_nic_temperature_read() local
216 if (!mvm->temperature_test) in iwl_dbgfs_set_nic_temperature_read()
219 pos = scnprintf(buf , sizeof(buf), "%d\n", mvm->temperature); in iwl_dbgfs_set_nic_temperature_read()
231 static ssize_t iwl_dbgfs_set_nic_temperature_write(struct iwl_mvm *mvm, in iwl_dbgfs_set_nic_temperature_write() argument
237 if (!iwl_mvm_firmware_running(mvm) && !mvm->temperature_test) in iwl_dbgfs_set_nic_temperature_write()
248 mutex_lock(&mvm->mutex); in iwl_dbgfs_set_nic_temperature_write()
250 if (!mvm->temperature_test) in iwl_dbgfs_set_nic_temperature_write()
253 mvm->temperature_test = false; in iwl_dbgfs_set_nic_temperature_write()
258 mvm->temperature = 0; in iwl_dbgfs_set_nic_temperature_write()
260 mvm->temperature_test = true; in iwl_dbgfs_set_nic_temperature_write()
261 mvm->temperature = temperature; in iwl_dbgfs_set_nic_temperature_write()
263 IWL_DEBUG_TEMP(mvm, "%sabling debug set temperature (temp = %d)\n", in iwl_dbgfs_set_nic_temperature_write()
264 mvm->temperature_test ? "En" : "Dis" , in iwl_dbgfs_set_nic_temperature_write()
265 mvm->temperature); in iwl_dbgfs_set_nic_temperature_write()
267 iwl_mvm_tt_handler(mvm); in iwl_dbgfs_set_nic_temperature_write()
270 mutex_unlock(&mvm->mutex); in iwl_dbgfs_set_nic_temperature_write()
279 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_nic_temp_read() local
284 if (!iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_nic_temp_read()
287 mutex_lock(&mvm->mutex); in iwl_dbgfs_nic_temp_read()
288 ret = iwl_mvm_get_temp(mvm, &temp); in iwl_dbgfs_nic_temp_read()
289 mutex_unlock(&mvm->mutex); in iwl_dbgfs_nic_temp_read()
304 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_sar_geo_profile_read() local
310 if (!iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_sar_geo_profile_read()
313 mutex_lock(&mvm->mutex); in iwl_dbgfs_sar_geo_profile_read()
314 tbl_idx = iwl_mvm_get_sar_geo_profile(mvm); in iwl_dbgfs_sar_geo_profile_read()
316 mutex_unlock(&mvm->mutex); in iwl_dbgfs_sar_geo_profile_read()
328 mvm->fwrt.geo_profiles[tbl_idx - 1].bands[0].chains[0], in iwl_dbgfs_sar_geo_profile_read()
329 mvm->fwrt.geo_profiles[tbl_idx - 1].bands[0].chains[1], in iwl_dbgfs_sar_geo_profile_read()
330 mvm->fwrt.geo_profiles[tbl_idx - 1].bands[0].max); in iwl_dbgfs_sar_geo_profile_read()
333 mvm->fwrt.geo_profiles[tbl_idx - 1].bands[1].chains[0], in iwl_dbgfs_sar_geo_profile_read()
334 mvm->fwrt.geo_profiles[tbl_idx - 1].bands[1].chains[1], in iwl_dbgfs_sar_geo_profile_read()
335 mvm->fwrt.geo_profiles[tbl_idx - 1].bands[1].max); in iwl_dbgfs_sar_geo_profile_read()
337 mutex_unlock(&mvm->mutex); in iwl_dbgfs_sar_geo_profile_read()
346 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_stations_read() local
351 mutex_lock(&mvm->mutex); in iwl_dbgfs_stations_read()
353 for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) { in iwl_dbgfs_stations_read()
355 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], in iwl_dbgfs_stations_read()
356 lockdep_is_held(&mvm->mutex)); in iwl_dbgfs_stations_read()
367 mutex_unlock(&mvm->mutex); in iwl_dbgfs_stations_read()
378 struct iwl_mvm *mvm = lq_sta->pers.drv; in iwl_dbgfs_rs_data_read() local
388 mutex_lock(&mvm->mutex); in iwl_dbgfs_rs_data_read()
400 (iwl_mvm_get_valid_tx_ant(mvm) & ANT_A) ? "ANT_A," : "", in iwl_dbgfs_rs_data_read()
401 (iwl_mvm_get_valid_tx_ant(mvm) & ANT_B) ? "ANT_B," : ""); in iwl_dbgfs_rs_data_read()
410 mutex_unlock(&mvm->mutex); in iwl_dbgfs_rs_data_read()
465 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_disable_power_off_read() local
471 mvm->disable_power_off); in iwl_dbgfs_disable_power_off_read()
473 mvm->disable_power_off_d3); in iwl_dbgfs_disable_power_off_read()
478 static ssize_t iwl_dbgfs_disable_power_off_write(struct iwl_mvm *mvm, char *buf, in iwl_dbgfs_disable_power_off_write() argument
483 if (!iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_disable_power_off_write()
489 mvm->disable_power_off = val; in iwl_dbgfs_disable_power_off_write()
493 mvm->disable_power_off_d3 = val; in iwl_dbgfs_disable_power_off_write()
498 mutex_lock(&mvm->mutex); in iwl_dbgfs_disable_power_off_write()
499 ret = iwl_mvm_power_update_device(mvm); in iwl_dbgfs_disable_power_off_write()
500 mutex_unlock(&mvm->mutex); in iwl_dbgfs_disable_power_off_write()
568 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_bt_notif_read() local
569 struct iwl_bt_coex_profile_notif *notif = &mvm->last_bt_notif; in iwl_dbgfs_bt_notif_read()
577 mutex_lock(&mvm->mutex); in iwl_dbgfs_bt_notif_read()
600 mutex_unlock(&mvm->mutex); in iwl_dbgfs_bt_notif_read()
612 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_bt_cmd_read() local
613 struct iwl_bt_coex_ci_cmd *cmd = &mvm->last_bt_ci_cmd; in iwl_dbgfs_bt_cmd_read()
618 mutex_lock(&mvm->mutex); in iwl_dbgfs_bt_cmd_read()
628 mutex_unlock(&mvm->mutex); in iwl_dbgfs_bt_cmd_read()
634 iwl_dbgfs_bt_tx_prio_write(struct iwl_mvm *mvm, char *buf, in iwl_dbgfs_bt_tx_prio_write() argument
644 mvm->bt_tx_prio = bt_tx_prio; in iwl_dbgfs_bt_tx_prio_write()
650 iwl_dbgfs_bt_force_ant_write(struct iwl_mvm *mvm, char *buf, in iwl_dbgfs_bt_force_ant_write() argument
667 mutex_lock(&mvm->mutex); in iwl_dbgfs_bt_force_ant_write()
668 if (mvm->bt_force_ant_mode == bt_force_ant_mode) in iwl_dbgfs_bt_force_ant_write()
671 mvm->bt_force_ant_mode = bt_force_ant_mode; in iwl_dbgfs_bt_force_ant_write()
672 IWL_DEBUG_COEX(mvm, "Force mode: %s\n", in iwl_dbgfs_bt_force_ant_write()
673 modes_str[mvm->bt_force_ant_mode]); in iwl_dbgfs_bt_force_ant_write()
675 if (iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_bt_force_ant_write()
676 ret = iwl_mvm_send_bt_init_conf(mvm); in iwl_dbgfs_bt_force_ant_write()
681 mutex_unlock(&mvm->mutex); in iwl_dbgfs_bt_force_ant_write()
688 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_fw_ver_read() local
701 mvm->trans->cfg->fw_name_pre); in iwl_dbgfs_fw_ver_read()
703 mvm->fwrt.fw->human_readable); in iwl_dbgfs_fw_ver_read()
705 mvm->fwrt.trans->name); in iwl_dbgfs_fw_ver_read()
707 mvm->fwrt.dev->bus->name); in iwl_dbgfs_fw_ver_read()
719 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_phy_integration_ver_read() local
725 bufsz = mvm->fw->phy_integration_ver_len + 2; in iwl_dbgfs_phy_integration_ver_read()
730 pos = scnprintf(buf, bufsz, "%.*s\n", mvm->fw->phy_integration_ver_len, in iwl_dbgfs_phy_integration_ver_read()
731 mvm->fw->phy_integration_ver); in iwl_dbgfs_phy_integration_ver_read()
748 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_fw_rx_stats_read() local
756 if (iwl_mvm_has_new_rx_stats_api(mvm)) in iwl_dbgfs_fw_rx_stats_read()
768 mutex_lock(&mvm->mutex); in iwl_dbgfs_fw_rx_stats_read()
770 if (iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_fw_rx_stats_read()
771 iwl_mvm_request_statistics(mvm, false); in iwl_dbgfs_fw_rx_stats_read()
775 if (!iwl_mvm_has_new_rx_stats_api(mvm)) { in iwl_dbgfs_fw_rx_stats_read()
776 struct mvm_statistics_rx_phy_v2 *ofdm = &mvm->rx_stats_v3.ofdm; in iwl_dbgfs_fw_rx_stats_read()
799 struct mvm_statistics_rx_phy *ofdm = &mvm->rx_stats.ofdm; in iwl_dbgfs_fw_rx_stats_read()
810 if (!iwl_mvm_has_new_rx_stats_api(mvm)) { in iwl_dbgfs_fw_rx_stats_read()
811 struct mvm_statistics_rx_phy_v2 *cck = &mvm->rx_stats_v3.cck; in iwl_dbgfs_fw_rx_stats_read()
834 struct mvm_statistics_rx_phy *cck = &mvm->rx_stats.cck; in iwl_dbgfs_fw_rx_stats_read()
845 if (!iwl_mvm_has_new_rx_stats_api(mvm)) { in iwl_dbgfs_fw_rx_stats_read()
847 &mvm->rx_stats_v3.general; in iwl_dbgfs_fw_rx_stats_read()
875 &mvm->rx_stats.general; in iwl_dbgfs_fw_rx_stats_read()
901 if (!iwl_mvm_has_new_rx_stats_api(mvm)) { in iwl_dbgfs_fw_rx_stats_read()
903 &mvm->rx_stats_v3.ofdm_ht; in iwl_dbgfs_fw_rx_stats_read()
917 &mvm->rx_stats.ofdm_ht; in iwl_dbgfs_fw_rx_stats_read()
925 mutex_unlock(&mvm->mutex); in iwl_dbgfs_fw_rx_stats_read()
934 static ssize_t iwl_dbgfs_frame_stats_read(struct iwl_mvm *mvm, in iwl_dbgfs_frame_stats_read() argument
948 spin_lock_bh(&mvm->drv_stats_lock); in iwl_dbgfs_frame_stats_read()
993 spin_unlock_bh(&mvm->drv_stats_lock); in iwl_dbgfs_frame_stats_read()
1005 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_drv_rx_stats_read() local
1007 return iwl_dbgfs_frame_stats_read(mvm, user_buf, count, ppos, in iwl_dbgfs_drv_rx_stats_read()
1008 &mvm->drv_rx_stats); in iwl_dbgfs_drv_rx_stats_read()
1011 static ssize_t iwl_dbgfs_fw_restart_write(struct iwl_mvm *mvm, char *buf, in iwl_dbgfs_fw_restart_write() argument
1016 if (!iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_fw_restart_write()
1019 mutex_lock(&mvm->mutex); in iwl_dbgfs_fw_restart_write()
1022 if (mvm->fw_restart >= 0) in iwl_dbgfs_fw_restart_write()
1023 mvm->fw_restart++; in iwl_dbgfs_fw_restart_write()
1026 set_bit(IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE, &mvm->status); in iwl_dbgfs_fw_restart_write()
1027 set_bit(STATUS_SUPPRESS_CMD_ERROR_ONCE, &mvm->trans->status); in iwl_dbgfs_fw_restart_write()
1031 ret = iwl_mvm_send_cmd_pdu(mvm, in iwl_dbgfs_fw_restart_write()
1035 mutex_unlock(&mvm->mutex); in iwl_dbgfs_fw_restart_write()
1040 static ssize_t iwl_dbgfs_fw_nmi_write(struct iwl_mvm *mvm, char *buf, in iwl_dbgfs_fw_nmi_write() argument
1043 if (!iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_fw_nmi_write()
1047 set_bit(IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE, &mvm->status); in iwl_dbgfs_fw_nmi_write()
1049 iwl_force_nmi(mvm->trans); in iwl_dbgfs_fw_nmi_write()
1059 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_scan_ant_rxchain_read() local
1066 if (mvm->scan_rx_ant & ANT_A) in iwl_dbgfs_scan_ant_rxchain_read()
1068 if (mvm->scan_rx_ant & ANT_B) in iwl_dbgfs_scan_ant_rxchain_read()
1070 pos += scnprintf(buf + pos, bufsz - pos, " (%hhx)\n", mvm->scan_rx_ant); in iwl_dbgfs_scan_ant_rxchain_read()
1076 iwl_dbgfs_scan_ant_rxchain_write(struct iwl_mvm *mvm, char *buf, in iwl_dbgfs_scan_ant_rxchain_write() argument
1081 if (!iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_scan_ant_rxchain_write()
1088 if (scan_rx_ant & ~(iwl_mvm_get_valid_rx_ant(mvm))) in iwl_dbgfs_scan_ant_rxchain_write()
1091 if (mvm->scan_rx_ant != scan_rx_ant) { in iwl_dbgfs_scan_ant_rxchain_write()
1092 mvm->scan_rx_ant = scan_rx_ant; in iwl_dbgfs_scan_ant_rxchain_write()
1093 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_dbgfs_scan_ant_rxchain_write()
1095 iwl_mvm_config_scan(mvm); in iwl_dbgfs_scan_ant_rxchain_write()
1101 static ssize_t iwl_dbgfs_indirection_tbl_write(struct iwl_mvm *mvm, in iwl_dbgfs_indirection_tbl_write() argument
1137 mutex_lock(&mvm->mutex); in iwl_dbgfs_indirection_tbl_write()
1138 if (iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_indirection_tbl_write()
1139 ret = iwl_mvm_send_cmd_pdu(mvm, RSS_CONFIG_CMD, 0, in iwl_dbgfs_indirection_tbl_write()
1143 mutex_unlock(&mvm->mutex); in iwl_dbgfs_indirection_tbl_write()
1148 static ssize_t iwl_dbgfs_inject_packet_write(struct iwl_mvm *mvm, in iwl_dbgfs_inject_packet_write() argument
1152 struct iwl_op_mode *opmode = container_of((void *)mvm, in iwl_dbgfs_inject_packet_write()
1164 if (!iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_inject_packet_write()
1168 if (!mvm->trans->trans_cfg->mq_rx_supported) in iwl_dbgfs_inject_packet_write()
1196 static int _iwl_dbgfs_inject_beacon_ie(struct iwl_mvm *mvm, char *bin, int len) in _iwl_dbgfs_inject_beacon_ie() argument
1212 if (!iwl_mvm_firmware_running(mvm)) in _iwl_dbgfs_inject_beacon_ie()
1215 if (!iwl_mvm_has_new_tx_api(mvm) && in _iwl_dbgfs_inject_beacon_ie()
1216 !fw_has_api(&mvm->fw->ucode_capa, in _iwl_dbgfs_inject_beacon_ie()
1220 mutex_lock(&mvm->mutex); in _iwl_dbgfs_inject_beacon_ie()
1223 vif = iwl_mvm_rcu_dereference_vif_id(mvm, i, false); in _iwl_dbgfs_inject_beacon_ie()
1234 mvm->hw->extra_beacon_tailroom = len; in _iwl_dbgfs_inject_beacon_ie()
1236 beacon = ieee80211_beacon_get_template(mvm->hw, vif, NULL); in _iwl_dbgfs_inject_beacon_ie()
1245 mvm->beacon_inject_active = true; in _iwl_dbgfs_inject_beacon_ie()
1252 cpu_to_le16(iwl_mvm_mac_ctxt_get_beacon_flags(mvm->fw, rate)); in _iwl_dbgfs_inject_beacon_ie()
1256 iwl_mvm_mac_ctxt_set_tim(mvm, &beacon_cmd.tim_idx, in _iwl_dbgfs_inject_beacon_ie()
1260 iwl_mvm_mac_ctxt_send_beacon_cmd(mvm, beacon, &beacon_cmd, in _iwl_dbgfs_inject_beacon_ie()
1262 mutex_unlock(&mvm->mutex); in _iwl_dbgfs_inject_beacon_ie()
1269 mutex_unlock(&mvm->mutex); in _iwl_dbgfs_inject_beacon_ie()
1273 static ssize_t iwl_dbgfs_inject_beacon_ie_write(struct iwl_mvm *mvm, in iwl_dbgfs_inject_beacon_ie_write() argument
1277 int ret = _iwl_dbgfs_inject_beacon_ie(mvm, buf, count); in iwl_dbgfs_inject_beacon_ie_write()
1279 mvm->hw->extra_beacon_tailroom = 0; in iwl_dbgfs_inject_beacon_ie_write()
1283 static ssize_t iwl_dbgfs_inject_beacon_ie_restore_write(struct iwl_mvm *mvm, in iwl_dbgfs_inject_beacon_ie_restore_write() argument
1288 int ret = _iwl_dbgfs_inject_beacon_ie(mvm, NULL, 0); in iwl_dbgfs_inject_beacon_ie_restore_write()
1290 mvm->hw->extra_beacon_tailroom = 0; in iwl_dbgfs_inject_beacon_ie_restore_write()
1291 mvm->beacon_inject_active = false; in iwl_dbgfs_inject_beacon_ie_restore_write()
1299 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_fw_dbg_conf_read() local
1305 mutex_lock(&mvm->mutex); in iwl_dbgfs_fw_dbg_conf_read()
1306 conf = mvm->fwrt.dump.conf; in iwl_dbgfs_fw_dbg_conf_read()
1307 mutex_unlock(&mvm->mutex); in iwl_dbgfs_fw_dbg_conf_read()
1314 static ssize_t iwl_dbgfs_fw_dbg_conf_write(struct iwl_mvm *mvm, in iwl_dbgfs_fw_dbg_conf_write() argument
1321 if (!iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_fw_dbg_conf_write()
1331 mutex_lock(&mvm->mutex); in iwl_dbgfs_fw_dbg_conf_write()
1332 ret = iwl_fw_start_dbg_conf(&mvm->fwrt, conf_id); in iwl_dbgfs_fw_dbg_conf_write()
1333 mutex_unlock(&mvm->mutex); in iwl_dbgfs_fw_dbg_conf_write()
1338 static ssize_t iwl_dbgfs_fw_dbg_collect_write(struct iwl_mvm *mvm, in iwl_dbgfs_fw_dbg_collect_write() argument
1345 iwl_dbg_tlv_time_point(&mvm->fwrt, IWL_FW_INI_TIME_POINT_USER_TRIGGER, in iwl_dbgfs_fw_dbg_collect_write()
1348 iwl_fw_dbg_collect(&mvm->fwrt, FW_DBG_TRIGGER_USER, buf, in iwl_dbgfs_fw_dbg_collect_write()
1354 static ssize_t iwl_dbgfs_dbg_time_point_write(struct iwl_mvm *mvm, in iwl_dbgfs_dbg_time_point_write() argument
1367 iwl_dbg_tlv_time_point(&mvm->fwrt, timepoint, NULL); in iwl_dbgfs_dbg_time_point_write()
1377 debugfs_create_file(alias, mode, parent, mvm, \
1400 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_prph_reg_read() local
1405 if (!mvm->dbgfs_prph_reg_addr) in iwl_dbgfs_prph_reg_read()
1409 mvm->dbgfs_prph_reg_addr, in iwl_dbgfs_prph_reg_read()
1410 iwl_read_prph(mvm->trans, mvm->dbgfs_prph_reg_addr)); in iwl_dbgfs_prph_reg_read()
1416 iwl_dbgfs_prph_reg_write(struct iwl_mvm *mvm, char *buf, in iwl_dbgfs_prph_reg_write() argument
1422 args = sscanf(buf, "%i %i", &mvm->dbgfs_prph_reg_addr, &value); in iwl_dbgfs_prph_reg_write()
1431 iwl_write_prph(mvm->trans, mvm->dbgfs_prph_reg_addr, value); in iwl_dbgfs_prph_reg_write()
1438 iwl_dbgfs_send_echo_cmd_write(struct iwl_mvm *mvm, char *buf, in iwl_dbgfs_send_echo_cmd_write() argument
1443 if (!iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_send_echo_cmd_write()
1446 mutex_lock(&mvm->mutex); in iwl_dbgfs_send_echo_cmd_write()
1447 ret = iwl_mvm_send_cmd_pdu(mvm, ECHO_CMD, 0, 0, NULL); in iwl_dbgfs_send_echo_cmd_write()
1448 mutex_unlock(&mvm->mutex); in iwl_dbgfs_send_echo_cmd_write()
1454 struct iwl_mvm *mvm; member
1464 apply->mvm->cur_aid = cpu_to_le16(apply->aid); in iwl_mvm_sniffer_apply()
1465 memcpy(apply->mvm->cur_bssid, apply->bssid, in iwl_mvm_sniffer_apply()
1466 sizeof(apply->mvm->cur_bssid)); in iwl_mvm_sniffer_apply()
1472 iwl_dbgfs_he_sniffer_params_write(struct iwl_mvm *mvm, char *buf, in iwl_dbgfs_he_sniffer_params_write() argument
1478 .mvm = mvm, in iwl_dbgfs_he_sniffer_params_write()
1486 if (!iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_he_sniffer_params_write()
1501 mutex_lock(&mvm->mutex); in iwl_dbgfs_he_sniffer_params_write()
1512 iwl_init_notification_wait(&mvm->notif_wait, &wait, in iwl_dbgfs_he_sniffer_params_write()
1516 ret = iwl_mvm_send_cmd_pdu(mvm, in iwl_dbgfs_he_sniffer_params_write()
1522 iwl_remove_notification(&mvm->notif_wait, &wait); in iwl_dbgfs_he_sniffer_params_write()
1524 mutex_unlock(&mvm->mutex); in iwl_dbgfs_he_sniffer_params_write()
1533 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_he_sniffer_params_read() local
1539 le16_to_cpu(mvm->cur_aid), mvm->cur_bssid[0], in iwl_dbgfs_he_sniffer_params_read()
1540 mvm->cur_bssid[1], mvm->cur_bssid[2], mvm->cur_bssid[3], in iwl_dbgfs_he_sniffer_params_read()
1541 mvm->cur_bssid[4], mvm->cur_bssid[5]); in iwl_dbgfs_he_sniffer_params_read()
1550 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_uapsd_noagg_bssids_read() local
1556 mutex_lock(&mvm->mutex); in iwl_dbgfs_uapsd_noagg_bssids_read()
1560 mvm->uapsd_noagg_bssids[i].addr); in iwl_dbgfs_uapsd_noagg_bssids_read()
1562 mutex_unlock(&mvm->mutex); in iwl_dbgfs_uapsd_noagg_bssids_read()
1568 iwl_dbgfs_ltr_config_write(struct iwl_mvm *mvm, in iwl_dbgfs_ltr_config_write() argument
1574 if (!iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_ltr_config_write()
1588 mutex_lock(&mvm->mutex); in iwl_dbgfs_ltr_config_write()
1589 ret = iwl_mvm_send_cmd_pdu(mvm, LTR_CONFIG, 0, sizeof(ltr_config), in iwl_dbgfs_ltr_config_write()
1591 mutex_unlock(&mvm->mutex); in iwl_dbgfs_ltr_config_write()
1594 IWL_ERR(mvm, "failed to send ltr configuration cmd\n"); in iwl_dbgfs_ltr_config_write()
1599 static ssize_t iwl_dbgfs_rfi_freq_table_write(struct iwl_mvm *mvm, char *buf, in iwl_dbgfs_rfi_freq_table_write() argument
1610 mutex_lock(&mvm->mutex); in iwl_dbgfs_rfi_freq_table_write()
1611 ret = iwl_rfi_send_config_cmd(mvm, NULL); in iwl_dbgfs_rfi_freq_table_write()
1612 mutex_unlock(&mvm->mutex); in iwl_dbgfs_rfi_freq_table_write()
1632 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_rfi_freq_table_read() local
1638 resp = iwl_rfi_get_freq_table(mvm); in iwl_dbgfs_rfi_freq_table_read()
1716 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_mem_read() local
1727 if (!iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_mem_read()
1739 mutex_lock(&mvm->mutex); in iwl_dbgfs_mem_read()
1740 ret = iwl_mvm_send_cmd(mvm, &hcmd); in iwl_dbgfs_mem_read()
1741 mutex_unlock(&mvm->mutex); in iwl_dbgfs_mem_read()
1772 struct iwl_mvm *mvm = file->private_data; in iwl_dbgfs_mem_write() local
1781 if (!iwl_mvm_firmware_running(mvm)) in iwl_dbgfs_mem_write()
1813 mutex_lock(&mvm->mutex); in iwl_dbgfs_mem_write()
1814 ret = iwl_mvm_send_cmd(mvm, &hcmd); in iwl_dbgfs_mem_write()
1815 mutex_unlock(&mvm->mutex); in iwl_dbgfs_mem_write()
1848 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); in iwl_mvm_sta_add_debugfs() local
1850 if (iwl_mvm_has_tlc_offload(mvm)) { in iwl_mvm_sta_add_debugfs()
1856 void iwl_mvm_dbgfs_register(struct iwl_mvm *mvm) in iwl_mvm_dbgfs_register() argument
1860 spin_lock_init(&mvm->drv_stats_lock); in iwl_mvm_dbgfs_register()
1862 MVM_DEBUGFS_ADD_FILE(tx_flush, mvm->debugfs_dir, 0200); in iwl_mvm_dbgfs_register()
1863 MVM_DEBUGFS_ADD_FILE(sta_drain, mvm->debugfs_dir, 0200); in iwl_mvm_dbgfs_register()
1864 MVM_DEBUGFS_ADD_FILE(sram, mvm->debugfs_dir, 0600); in iwl_mvm_dbgfs_register()
1865 MVM_DEBUGFS_ADD_FILE(set_nic_temperature, mvm->debugfs_dir, 0600); in iwl_mvm_dbgfs_register()
1866 MVM_DEBUGFS_ADD_FILE(nic_temp, mvm->debugfs_dir, 0400); in iwl_mvm_dbgfs_register()
1867 MVM_DEBUGFS_ADD_FILE(ctdp_budget, mvm->debugfs_dir, 0400); in iwl_mvm_dbgfs_register()
1868 MVM_DEBUGFS_ADD_FILE(stop_ctdp, mvm->debugfs_dir, 0200); in iwl_mvm_dbgfs_register()
1869 MVM_DEBUGFS_ADD_FILE(force_ctkill, mvm->debugfs_dir, 0200); in iwl_mvm_dbgfs_register()
1870 MVM_DEBUGFS_ADD_FILE(stations, mvm->debugfs_dir, 0400); in iwl_mvm_dbgfs_register()
1871 MVM_DEBUGFS_ADD_FILE(bt_notif, mvm->debugfs_dir, 0400); in iwl_mvm_dbgfs_register()
1872 MVM_DEBUGFS_ADD_FILE(bt_cmd, mvm->debugfs_dir, 0400); in iwl_mvm_dbgfs_register()
1873 MVM_DEBUGFS_ADD_FILE(disable_power_off, mvm->debugfs_dir, 0600); in iwl_mvm_dbgfs_register()
1874 MVM_DEBUGFS_ADD_FILE(fw_ver, mvm->debugfs_dir, 0400); in iwl_mvm_dbgfs_register()
1875 MVM_DEBUGFS_ADD_FILE(fw_rx_stats, mvm->debugfs_dir, 0400); in iwl_mvm_dbgfs_register()
1876 MVM_DEBUGFS_ADD_FILE(drv_rx_stats, mvm->debugfs_dir, 0400); in iwl_mvm_dbgfs_register()
1877 MVM_DEBUGFS_ADD_FILE(fw_restart, mvm->debugfs_dir, 0200); in iwl_mvm_dbgfs_register()
1878 MVM_DEBUGFS_ADD_FILE(fw_nmi, mvm->debugfs_dir, 0200); in iwl_mvm_dbgfs_register()
1879 MVM_DEBUGFS_ADD_FILE(bt_tx_prio, mvm->debugfs_dir, 0200); in iwl_mvm_dbgfs_register()
1880 MVM_DEBUGFS_ADD_FILE(bt_force_ant, mvm->debugfs_dir, 0200); in iwl_mvm_dbgfs_register()
1881 MVM_DEBUGFS_ADD_FILE(scan_ant_rxchain, mvm->debugfs_dir, 0600); in iwl_mvm_dbgfs_register()
1882 MVM_DEBUGFS_ADD_FILE(prph_reg, mvm->debugfs_dir, 0600); in iwl_mvm_dbgfs_register()
1883 MVM_DEBUGFS_ADD_FILE(fw_dbg_conf, mvm->debugfs_dir, 0600); in iwl_mvm_dbgfs_register()
1884 MVM_DEBUGFS_ADD_FILE(fw_dbg_collect, mvm->debugfs_dir, 0200); in iwl_mvm_dbgfs_register()
1885 MVM_DEBUGFS_ADD_FILE(dbg_time_point, mvm->debugfs_dir, 0200); in iwl_mvm_dbgfs_register()
1886 MVM_DEBUGFS_ADD_FILE(send_echo_cmd, mvm->debugfs_dir, 0200); in iwl_mvm_dbgfs_register()
1887 MVM_DEBUGFS_ADD_FILE(indirection_tbl, mvm->debugfs_dir, 0200); in iwl_mvm_dbgfs_register()
1888 MVM_DEBUGFS_ADD_FILE(inject_packet, mvm->debugfs_dir, 0200); in iwl_mvm_dbgfs_register()
1889 MVM_DEBUGFS_ADD_FILE(inject_beacon_ie, mvm->debugfs_dir, 0200); in iwl_mvm_dbgfs_register()
1890 MVM_DEBUGFS_ADD_FILE(inject_beacon_ie_restore, mvm->debugfs_dir, 0200); in iwl_mvm_dbgfs_register()
1891 MVM_DEBUGFS_ADD_FILE(rfi_freq_table, mvm->debugfs_dir, 0600); in iwl_mvm_dbgfs_register()
1893 if (mvm->fw->phy_integration_ver) in iwl_mvm_dbgfs_register()
1894 MVM_DEBUGFS_ADD_FILE(phy_integration_ver, mvm->debugfs_dir, 0400); in iwl_mvm_dbgfs_register()
1896 MVM_DEBUGFS_ADD_FILE(sar_geo_profile, mvm->debugfs_dir, 0400); in iwl_mvm_dbgfs_register()
1898 MVM_DEBUGFS_ADD_FILE(he_sniffer_params, mvm->debugfs_dir, 0600); in iwl_mvm_dbgfs_register()
1900 if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_SET_LTR_GEN2)) in iwl_mvm_dbgfs_register()
1901 MVM_DEBUGFS_ADD_FILE(ltr_config, mvm->debugfs_dir, 0200); in iwl_mvm_dbgfs_register()
1904 mvm->debugfs_dir, &mvm->scan_iter_notif_enabled); in iwl_mvm_dbgfs_register()
1905 debugfs_create_bool("drop_bcn_ap_mode", 0600, mvm->debugfs_dir, in iwl_mvm_dbgfs_register()
1906 &mvm->drop_bcn_ap_mode); in iwl_mvm_dbgfs_register()
1908 MVM_DEBUGFS_ADD_FILE(uapsd_noagg_bssids, mvm->debugfs_dir, S_IRUSR); in iwl_mvm_dbgfs_register()
1911 MVM_DEBUGFS_ADD_FILE(d3_test, mvm->debugfs_dir, 0400); in iwl_mvm_dbgfs_register()
1912 debugfs_create_bool("d3_wake_sysassert", 0600, mvm->debugfs_dir, in iwl_mvm_dbgfs_register()
1913 &mvm->d3_wake_sysassert); in iwl_mvm_dbgfs_register()
1914 debugfs_create_u32("last_netdetect_scans", 0400, mvm->debugfs_dir, in iwl_mvm_dbgfs_register()
1915 &mvm->last_netdetect_scans); in iwl_mvm_dbgfs_register()
1918 debugfs_create_u8("ps_disabled", 0400, mvm->debugfs_dir, in iwl_mvm_dbgfs_register()
1919 &mvm->ps_disabled); in iwl_mvm_dbgfs_register()
1920 debugfs_create_blob("nvm_hw", 0400, mvm->debugfs_dir, in iwl_mvm_dbgfs_register()
1921 &mvm->nvm_hw_blob); in iwl_mvm_dbgfs_register()
1922 debugfs_create_blob("nvm_sw", 0400, mvm->debugfs_dir, in iwl_mvm_dbgfs_register()
1923 &mvm->nvm_sw_blob); in iwl_mvm_dbgfs_register()
1924 debugfs_create_blob("nvm_calib", 0400, mvm->debugfs_dir, in iwl_mvm_dbgfs_register()
1925 &mvm->nvm_calib_blob); in iwl_mvm_dbgfs_register()
1926 debugfs_create_blob("nvm_prod", 0400, mvm->debugfs_dir, in iwl_mvm_dbgfs_register()
1927 &mvm->nvm_prod_blob); in iwl_mvm_dbgfs_register()
1928 debugfs_create_blob("nvm_phy_sku", 0400, mvm->debugfs_dir, in iwl_mvm_dbgfs_register()
1929 &mvm->nvm_phy_sku_blob); in iwl_mvm_dbgfs_register()
1931 mvm->debugfs_dir, &mvm->nvm_reg_blob); in iwl_mvm_dbgfs_register()
1933 debugfs_create_file("mem", 0600, mvm->debugfs_dir, mvm, in iwl_mvm_dbgfs_register()
1940 if (!IS_ERR(mvm->debugfs_dir)) { in iwl_mvm_dbgfs_register()
1943 snprintf(buf, 100, "../../%pd2", mvm->debugfs_dir->d_parent); in iwl_mvm_dbgfs_register()
1944 debugfs_create_symlink("iwlwifi", mvm->hw->wiphy->debugfsdir, in iwl_mvm_dbgfs_register()