aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-09-17 13:43:45 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-07 16:39:33 -0400
commit01abfbb282482d01e2ac2e6b00e75b248bf517c8 (patch)
tree43a0363adf63eda3d06313ab82a0d27fbee171ad /drivers/net/wireless/iwlwifi/iwl-agn.c
parent47eef9bd1079edbc3e6606309c733a2316ca5a72 (diff)
iwlwifi: allow user change protection mechanism for HT
Allow user to change protection mechanism for HT between RTS/CTS and CTS-to-self through sysfs: Show current protection mechanism for HT cat /sys/class/net/wlan0/device/rts_ht_protection Change protection mechanism for HT (only allowed while not-associated) CTS-to-self: echo 0 > /sys/class/net/wlan0/device/rts_ht_protection RTS/CTS: echo 1 > /sys/class/net/wlan0/device/rts_ht_protection Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c35
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 a3739628c1d..2a7cc4bdf3f 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
2799static DEVICE_ATTR(statistics, S_IRUGO, show_statistics, NULL); 2799static DEVICE_ATTR(statistics, S_IRUGO, show_statistics, NULL);
2800 2800
2801static 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
2810static 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
2832static 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