diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c | 61 |
1 files changed, 6 insertions, 55 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c index 9b59e1d7ae71..2e90ff795c13 100644 --- a/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c +++ b/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c | |||
@@ -103,10 +103,6 @@ static void iwl_dbgfs_update_pm(struct iwl_mvm *mvm, | |||
103 | IWL_DEBUG_POWER(mvm, "tx_data_timeout=%d\n", val); | 103 | IWL_DEBUG_POWER(mvm, "tx_data_timeout=%d\n", val); |
104 | dbgfs_pm->tx_data_timeout = val; | 104 | dbgfs_pm->tx_data_timeout = val; |
105 | break; | 105 | break; |
106 | case MVM_DEBUGFS_PM_DISABLE_POWER_OFF: | ||
107 | IWL_DEBUG_POWER(mvm, "disable_power_off=%d\n", val); | ||
108 | dbgfs_pm->disable_power_off = val; | ||
109 | break; | ||
110 | case MVM_DEBUGFS_PM_LPRX_ENA: | 106 | case MVM_DEBUGFS_PM_LPRX_ENA: |
111 | IWL_DEBUG_POWER(mvm, "lprx %s\n", val ? "enabled" : "disabled"); | 107 | IWL_DEBUG_POWER(mvm, "lprx %s\n", val ? "enabled" : "disabled"); |
112 | dbgfs_pm->lprx_ena = val; | 108 | dbgfs_pm->lprx_ena = val; |
@@ -154,12 +150,6 @@ static ssize_t iwl_dbgfs_pm_params_write(struct ieee80211_vif *vif, char *buf, | |||
154 | if (sscanf(buf + 16, "%d", &val) != 1) | 150 | if (sscanf(buf + 16, "%d", &val) != 1) |
155 | return -EINVAL; | 151 | return -EINVAL; |
156 | param = MVM_DEBUGFS_PM_TX_DATA_TIMEOUT; | 152 | param = MVM_DEBUGFS_PM_TX_DATA_TIMEOUT; |
157 | } else if (!strncmp("disable_power_off=", buf, 18) && | ||
158 | !(mvm->fw->ucode_capa.flags & | ||
159 | IWL_UCODE_TLV_FLAGS_DEVICE_PS_CMD)) { | ||
160 | if (sscanf(buf + 18, "%d", &val) != 1) | ||
161 | return -EINVAL; | ||
162 | param = MVM_DEBUGFS_PM_DISABLE_POWER_OFF; | ||
163 | } else if (!strncmp("lprx=", buf, 5)) { | 153 | } else if (!strncmp("lprx=", buf, 5)) { |
164 | if (sscanf(buf + 5, "%d", &val) != 1) | 154 | if (sscanf(buf + 5, "%d", &val) != 1) |
165 | return -EINVAL; | 155 | return -EINVAL; |
@@ -185,7 +175,7 @@ static ssize_t iwl_dbgfs_pm_params_write(struct ieee80211_vif *vif, char *buf, | |||
185 | 175 | ||
186 | mutex_lock(&mvm->mutex); | 176 | mutex_lock(&mvm->mutex); |
187 | iwl_dbgfs_update_pm(mvm, vif, param, val); | 177 | iwl_dbgfs_update_pm(mvm, vif, param, val); |
188 | ret = iwl_mvm_power_update_mac(mvm, vif); | 178 | ret = iwl_mvm_power_update_mac(mvm); |
189 | mutex_unlock(&mvm->mutex); | 179 | mutex_unlock(&mvm->mutex); |
190 | 180 | ||
191 | return ret ?: count; | 181 | return ret ?: count; |
@@ -272,10 +262,9 @@ static ssize_t iwl_dbgfs_mac_params_read(struct file *file, | |||
272 | struct iwl_mvm_sta *mvm_sta = (void *)sta->drv_priv; | 262 | struct iwl_mvm_sta *mvm_sta = (void *)sta->drv_priv; |
273 | 263 | ||
274 | pos += scnprintf(buf+pos, bufsz-pos, | 264 | pos += scnprintf(buf+pos, bufsz-pos, |
275 | "ap_sta_id %d - reduced Tx power %d force %d\n", | 265 | "ap_sta_id %d - reduced Tx power %d\n", |
276 | ap_sta_id, | 266 | ap_sta_id, |
277 | mvm_sta->bt_reduced_txpower, | 267 | mvm_sta->bt_reduced_txpower); |
278 | mvm_sta->bt_reduced_txpower_dbg); | ||
279 | } | 268 | } |
280 | } | 269 | } |
281 | 270 | ||
@@ -293,41 +282,6 @@ static ssize_t iwl_dbgfs_mac_params_read(struct file *file, | |||
293 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 282 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
294 | } | 283 | } |
295 | 284 | ||
296 | static ssize_t iwl_dbgfs_reduced_txp_write(struct ieee80211_vif *vif, | ||
297 | char *buf, size_t count, | ||
298 | loff_t *ppos) | ||
299 | { | ||
300 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); | ||
301 | struct iwl_mvm *mvm = mvmvif->mvm; | ||
302 | struct iwl_mvm_sta *mvmsta; | ||
303 | bool reduced_tx_power; | ||
304 | int ret; | ||
305 | |||
306 | if (mvmvif->ap_sta_id >= ARRAY_SIZE(mvm->fw_id_to_mac_id)) | ||
307 | return -ENOTCONN; | ||
308 | |||
309 | if (strtobool(buf, &reduced_tx_power) != 0) | ||
310 | return -EINVAL; | ||
311 | |||
312 | mutex_lock(&mvm->mutex); | ||
313 | |||
314 | mvmsta = iwl_mvm_sta_from_staid_protected(mvm, mvmvif->ap_sta_id); | ||
315 | if (IS_ERR_OR_NULL(mvmsta)) { | ||
316 | mutex_unlock(&mvm->mutex); | ||
317 | return -ENOTCONN; | ||
318 | } | ||
319 | |||
320 | mvmsta->bt_reduced_txpower_dbg = false; | ||
321 | ret = iwl_mvm_bt_coex_reduced_txp(mvm, mvmvif->ap_sta_id, | ||
322 | reduced_tx_power); | ||
323 | if (!ret) | ||
324 | mvmsta->bt_reduced_txpower_dbg = true; | ||
325 | |||
326 | mutex_unlock(&mvm->mutex); | ||
327 | |||
328 | return ret ? : count; | ||
329 | } | ||
330 | |||
331 | static void iwl_dbgfs_update_bf(struct ieee80211_vif *vif, | 285 | static void iwl_dbgfs_update_bf(struct ieee80211_vif *vif, |
332 | enum iwl_dbgfs_bf_mask param, int value) | 286 | enum iwl_dbgfs_bf_mask param, int value) |
333 | { | 287 | { |
@@ -462,9 +416,9 @@ static ssize_t iwl_dbgfs_bf_params_write(struct ieee80211_vif *vif, char *buf, | |||
462 | mutex_lock(&mvm->mutex); | 416 | mutex_lock(&mvm->mutex); |
463 | iwl_dbgfs_update_bf(vif, param, value); | 417 | iwl_dbgfs_update_bf(vif, param, value); |
464 | if (param == MVM_DEBUGFS_BF_ENABLE_BEACON_FILTER && !value) | 418 | if (param == MVM_DEBUGFS_BF_ENABLE_BEACON_FILTER && !value) |
465 | ret = iwl_mvm_disable_beacon_filter(mvm, vif, CMD_SYNC); | 419 | ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0); |
466 | else | 420 | else |
467 | ret = iwl_mvm_enable_beacon_filter(mvm, vif, CMD_SYNC); | 421 | ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0); |
468 | mutex_unlock(&mvm->mutex); | 422 | mutex_unlock(&mvm->mutex); |
469 | 423 | ||
470 | return ret ?: count; | 424 | return ret ?: count; |
@@ -568,7 +522,6 @@ MVM_DEBUGFS_READ_FILE_OPS(mac_params); | |||
568 | MVM_DEBUGFS_READ_WRITE_FILE_OPS(pm_params, 32); | 522 | MVM_DEBUGFS_READ_WRITE_FILE_OPS(pm_params, 32); |
569 | MVM_DEBUGFS_READ_WRITE_FILE_OPS(bf_params, 256); | 523 | MVM_DEBUGFS_READ_WRITE_FILE_OPS(bf_params, 256); |
570 | MVM_DEBUGFS_READ_WRITE_FILE_OPS(low_latency, 10); | 524 | MVM_DEBUGFS_READ_WRITE_FILE_OPS(low_latency, 10); |
571 | MVM_DEBUGFS_WRITE_FILE_OPS(reduced_txp, 10); | ||
572 | 525 | ||
573 | void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | 526 | void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) |
574 | { | 527 | { |
@@ -592,8 +545,7 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
592 | return; | 545 | return; |
593 | } | 546 | } |
594 | 547 | ||
595 | if ((mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PM_CMD_SUPPORT) && | 548 | if (iwlmvm_mod_params.power_scheme != IWL_POWER_SCHEME_CAM && |
596 | iwlmvm_mod_params.power_scheme != IWL_POWER_SCHEME_CAM && | ||
597 | ((vif->type == NL80211_IFTYPE_STATION && !vif->p2p) || | 549 | ((vif->type == NL80211_IFTYPE_STATION && !vif->p2p) || |
598 | (vif->type == NL80211_IFTYPE_STATION && vif->p2p && | 550 | (vif->type == NL80211_IFTYPE_STATION && vif->p2p && |
599 | mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BSS_P2P_PS_DCM))) | 551 | mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BSS_P2P_PS_DCM))) |
@@ -601,7 +553,6 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
601 | S_IRUSR); | 553 | S_IRUSR); |
602 | 554 | ||
603 | MVM_DEBUGFS_ADD_FILE_VIF(mac_params, mvmvif->dbgfs_dir, S_IRUSR); | 555 | MVM_DEBUGFS_ADD_FILE_VIF(mac_params, mvmvif->dbgfs_dir, S_IRUSR); |
604 | MVM_DEBUGFS_ADD_FILE_VIF(reduced_txp, mvmvif->dbgfs_dir, S_IWUSR); | ||
605 | MVM_DEBUGFS_ADD_FILE_VIF(low_latency, mvmvif->dbgfs_dir, | 556 | MVM_DEBUGFS_ADD_FILE_VIF(low_latency, mvmvif->dbgfs_dir, |
606 | S_IRUSR | S_IWUSR); | 557 | S_IRUSR | S_IWUSR); |
607 | 558 | ||