diff options
author | Johannes Berg <johannes.berg@intel.com> | 2015-01-09 08:15:32 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-01-22 10:54:03 -0500 |
commit | e39c1b5f5e8b157fdae0007523ffad270bcbcc3a (patch) | |
tree | dba247e149d87d7316df0a602daea608e46f687c | |
parent | 0294d9eece86dbe9bde7b21b097825106e3a3b4f (diff) |
iwlwifi: mvm: add debugfs file for misbehaving U-APSD AP
As this functionality relies on getting a firmware notification
it is difficult to test. Allow accessing the data for it from
debugfs to be able to trigger all kinds of scenarios to test.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c index 8dc3ca9f4904..5fe14591e1c4 100644 --- a/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c +++ b/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c | |||
@@ -517,6 +517,34 @@ static ssize_t iwl_dbgfs_low_latency_read(struct file *file, | |||
517 | return simple_read_from_buffer(user_buf, count, ppos, buf, sizeof(buf)); | 517 | return simple_read_from_buffer(user_buf, count, ppos, buf, sizeof(buf)); |
518 | } | 518 | } |
519 | 519 | ||
520 | static ssize_t iwl_dbgfs_uapsd_misbehaving_read(struct file *file, | ||
521 | char __user *user_buf, | ||
522 | size_t count, loff_t *ppos) | ||
523 | { | ||
524 | struct ieee80211_vif *vif = file->private_data; | ||
525 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); | ||
526 | char buf[20]; | ||
527 | int len; | ||
528 | |||
529 | len = sprintf(buf, "%pM\n", mvmvif->uapsd_misbehaving_bssid); | ||
530 | return simple_read_from_buffer(user_buf, count, ppos, buf, len); | ||
531 | } | ||
532 | |||
533 | static ssize_t iwl_dbgfs_uapsd_misbehaving_write(struct ieee80211_vif *vif, | ||
534 | char *buf, size_t count, | ||
535 | loff_t *ppos) | ||
536 | { | ||
537 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); | ||
538 | struct iwl_mvm *mvm = mvmvif->mvm; | ||
539 | bool ret; | ||
540 | |||
541 | mutex_lock(&mvm->mutex); | ||
542 | ret = mac_pton(buf, mvmvif->uapsd_misbehaving_bssid); | ||
543 | mutex_unlock(&mvm->mutex); | ||
544 | |||
545 | return ret ? count : -EINVAL; | ||
546 | } | ||
547 | |||
520 | #define MVM_DEBUGFS_WRITE_FILE_OPS(name, bufsz) \ | 548 | #define MVM_DEBUGFS_WRITE_FILE_OPS(name, bufsz) \ |
521 | _MVM_DEBUGFS_WRITE_FILE_OPS(name, bufsz, struct ieee80211_vif) | 549 | _MVM_DEBUGFS_WRITE_FILE_OPS(name, bufsz, struct ieee80211_vif) |
522 | #define MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz) \ | 550 | #define MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz) \ |
@@ -531,6 +559,7 @@ MVM_DEBUGFS_READ_FILE_OPS(mac_params); | |||
531 | MVM_DEBUGFS_READ_WRITE_FILE_OPS(pm_params, 32); | 559 | MVM_DEBUGFS_READ_WRITE_FILE_OPS(pm_params, 32); |
532 | MVM_DEBUGFS_READ_WRITE_FILE_OPS(bf_params, 256); | 560 | MVM_DEBUGFS_READ_WRITE_FILE_OPS(bf_params, 256); |
533 | MVM_DEBUGFS_READ_WRITE_FILE_OPS(low_latency, 10); | 561 | MVM_DEBUGFS_READ_WRITE_FILE_OPS(low_latency, 10); |
562 | MVM_DEBUGFS_READ_WRITE_FILE_OPS(uapsd_misbehaving, 20); | ||
534 | 563 | ||
535 | void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | 564 | void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) |
536 | { | 565 | { |
@@ -564,6 +593,8 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
564 | MVM_DEBUGFS_ADD_FILE_VIF(mac_params, mvmvif->dbgfs_dir, S_IRUSR); | 593 | MVM_DEBUGFS_ADD_FILE_VIF(mac_params, mvmvif->dbgfs_dir, S_IRUSR); |
565 | MVM_DEBUGFS_ADD_FILE_VIF(low_latency, mvmvif->dbgfs_dir, | 594 | MVM_DEBUGFS_ADD_FILE_VIF(low_latency, mvmvif->dbgfs_dir, |
566 | S_IRUSR | S_IWUSR); | 595 | S_IRUSR | S_IWUSR); |
596 | MVM_DEBUGFS_ADD_FILE_VIF(uapsd_misbehaving, mvmvif->dbgfs_dir, | ||
597 | S_IRUSR | S_IWUSR); | ||
567 | 598 | ||
568 | if (vif->type == NL80211_IFTYPE_STATION && !vif->p2p && | 599 | if (vif->type == NL80211_IFTYPE_STATION && !vif->p2p && |
569 | mvmvif == mvm->bf_allowed_vif) | 600 | mvmvif == mvm->bf_allowed_vif) |