diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index a3739628c1d6..2a7cc4bdf3fd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2798,6 +2798,40 @@ static ssize_t show_statistics(struct device *d, | |||
2798 | 2798 | ||
2799 | static DEVICE_ATTR(statistics, S_IRUGO, show_statistics, NULL); | 2799 | static DEVICE_ATTR(statistics, S_IRUGO, show_statistics, NULL); |
2800 | 2800 | ||
2801 | static ssize_t show_rts_ht_protection(struct device *d, | ||
2802 | struct device_attribute *attr, char *buf) | ||
2803 | { | ||
2804 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
2805 | |||
2806 | return sprintf(buf, "%s\n", | ||
2807 | priv->cfg->use_rts_for_ht ? "RTS/CTS" : "CTS-to-self"); | ||
2808 | } | ||
2809 | |||
2810 | static ssize_t store_rts_ht_protection(struct device *d, | ||
2811 | struct device_attribute *attr, | ||
2812 | const char *buf, size_t count) | ||
2813 | { | ||
2814 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
2815 | unsigned long val; | ||
2816 | int ret; | ||
2817 | |||
2818 | ret = strict_strtoul(buf, 10, &val); | ||
2819 | if (ret) | ||
2820 | IWL_INFO(priv, "Input is not in decimal form.\n"); | ||
2821 | else { | ||
2822 | if (!iwl_is_associated(priv)) | ||
2823 | priv->cfg->use_rts_for_ht = val ? true : false; | ||
2824 | else | ||
2825 | IWL_ERR(priv, "Sta associated with AP - " | ||
2826 | "Change protection mechanism is not allowed\n"); | ||
2827 | ret = count; | ||
2828 | } | ||
2829 | return ret; | ||
2830 | } | ||
2831 | |||
2832 | static DEVICE_ATTR(rts_ht_protection, S_IWUSR | S_IRUGO, | ||
2833 | show_rts_ht_protection, store_rts_ht_protection); | ||
2834 | |||
2801 | 2835 | ||
2802 | /***************************************************************************** | 2836 | /***************************************************************************** |
2803 | * | 2837 | * |
@@ -2854,6 +2888,7 @@ static struct attribute *iwl_sysfs_entries[] = { | |||
2854 | &dev_attr_statistics.attr, | 2888 | &dev_attr_statistics.attr, |
2855 | &dev_attr_temperature.attr, | 2889 | &dev_attr_temperature.attr, |
2856 | &dev_attr_tx_power.attr, | 2890 | &dev_attr_tx_power.attr, |
2891 | &dev_attr_rts_ht_protection.attr, | ||
2857 | #ifdef CONFIG_IWLWIFI_DEBUG | 2892 | #ifdef CONFIG_IWLWIFI_DEBUG |
2858 | &dev_attr_debug_level.attr, | 2893 | &dev_attr_debug_level.attr, |
2859 | #endif | 2894 | #endif |