diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 748dc31877bc..7707a2655994 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -653,6 +653,49 @@ static ssize_t iwl_dbgfs_thermal_throttling_read(struct file *file, | |||
653 | return ret; | 653 | return ret; |
654 | } | 654 | } |
655 | 655 | ||
656 | static ssize_t iwl_dbgfs_disable_ht40_write(struct file *file, | ||
657 | const char __user *user_buf, | ||
658 | size_t count, loff_t *ppos) | ||
659 | { | ||
660 | struct iwl_priv *priv = file->private_data; | ||
661 | char buf[8]; | ||
662 | int buf_size; | ||
663 | int ht40; | ||
664 | |||
665 | memset(buf, 0, sizeof(buf)); | ||
666 | buf_size = min(count, sizeof(buf) - 1); | ||
667 | if (copy_from_user(buf, user_buf, buf_size)) | ||
668 | return -EFAULT; | ||
669 | if (sscanf(buf, "%d", &ht40) != 1) | ||
670 | return -EFAULT; | ||
671 | if (!iwl_is_associated(priv)) | ||
672 | priv->disable_ht40 = ht40 ? true : false; | ||
673 | else { | ||
674 | IWL_ERR(priv, "Sta associated with AP - " | ||
675 | "Change to 40MHz channel support is not allowed\n"); | ||
676 | return -EINVAL; | ||
677 | } | ||
678 | |||
679 | return count; | ||
680 | } | ||
681 | |||
682 | static ssize_t iwl_dbgfs_disable_ht40_read(struct file *file, | ||
683 | char __user *user_buf, | ||
684 | size_t count, loff_t *ppos) | ||
685 | { | ||
686 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | ||
687 | char buf[100]; | ||
688 | int pos = 0; | ||
689 | const size_t bufsz = sizeof(buf); | ||
690 | ssize_t ret; | ||
691 | |||
692 | pos += scnprintf(buf + pos, bufsz - pos, | ||
693 | "11n 40MHz Mode: %s\n", | ||
694 | priv->disable_ht40 ? "Disabled" : "Enabled"); | ||
695 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | ||
696 | return ret; | ||
697 | } | ||
698 | |||
656 | DEBUGFS_READ_WRITE_FILE_OPS(sram); | 699 | DEBUGFS_READ_WRITE_FILE_OPS(sram); |
657 | DEBUGFS_WRITE_FILE_OPS(log_event); | 700 | DEBUGFS_WRITE_FILE_OPS(log_event); |
658 | DEBUGFS_READ_FILE_OPS(nvm); | 701 | DEBUGFS_READ_FILE_OPS(nvm); |
@@ -667,6 +710,7 @@ DEBUGFS_READ_FILE_OPS(qos); | |||
667 | DEBUGFS_READ_FILE_OPS(led); | 710 | DEBUGFS_READ_FILE_OPS(led); |
668 | #endif | 711 | #endif |
669 | DEBUGFS_READ_FILE_OPS(thermal_throttling); | 712 | DEBUGFS_READ_FILE_OPS(thermal_throttling); |
713 | DEBUGFS_READ_WRITE_FILE_OPS(disable_ht40); | ||
670 | 714 | ||
671 | /* | 715 | /* |
672 | * Create the debugfs files and directories | 716 | * Create the debugfs files and directories |
@@ -708,6 +752,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
708 | DEBUGFS_ADD_FILE(led, data); | 752 | DEBUGFS_ADD_FILE(led, data); |
709 | #endif | 753 | #endif |
710 | DEBUGFS_ADD_FILE(thermal_throttling, data); | 754 | DEBUGFS_ADD_FILE(thermal_throttling, data); |
755 | DEBUGFS_ADD_FILE(disable_ht40, data); | ||
711 | DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); | 756 | DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); |
712 | DEBUGFS_ADD_BOOL(disable_chain_noise, rf, | 757 | DEBUGFS_ADD_BOOL(disable_chain_noise, rf, |
713 | &priv->disable_chain_noise_cal); | 758 | &priv->disable_chain_noise_cal); |
@@ -747,6 +792,7 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv) | |||
747 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_led); | 792 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_led); |
748 | #endif | 793 | #endif |
749 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_thermal_throttling); | 794 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_thermal_throttling); |
795 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_disable_ht40); | ||
750 | DEBUGFS_REMOVE(priv->dbgfs->dir_data); | 796 | DEBUGFS_REMOVE(priv->dbgfs->dir_data); |
751 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity); | 797 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity); |
752 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise); | 798 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise); |