提交 01abfbb2 编写于 作者: W Wey-Yi Guy 提交者: John W. Linville

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: NWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 47eef9bd
...@@ -2798,6 +2798,40 @@ static ssize_t show_statistics(struct device *d, ...@@ -2798,6 +2798,40 @@ static ssize_t show_statistics(struct device *d,
static DEVICE_ATTR(statistics, S_IRUGO, show_statistics, NULL); static DEVICE_ATTR(statistics, S_IRUGO, show_statistics, NULL);
static ssize_t show_rts_ht_protection(struct device *d,
struct device_attribute *attr, char *buf)
{
struct iwl_priv *priv = dev_get_drvdata(d);
return sprintf(buf, "%s\n",
priv->cfg->use_rts_for_ht ? "RTS/CTS" : "CTS-to-self");
}
static ssize_t store_rts_ht_protection(struct device *d,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct iwl_priv *priv = dev_get_drvdata(d);
unsigned long val;
int ret;
ret = strict_strtoul(buf, 10, &val);
if (ret)
IWL_INFO(priv, "Input is not in decimal form.\n");
else {
if (!iwl_is_associated(priv))
priv->cfg->use_rts_for_ht = val ? true : false;
else
IWL_ERR(priv, "Sta associated with AP - "
"Change protection mechanism is not allowed\n");
ret = count;
}
return ret;
}
static DEVICE_ATTR(rts_ht_protection, S_IWUSR | S_IRUGO,
show_rts_ht_protection, store_rts_ht_protection);
/***************************************************************************** /*****************************************************************************
* *
...@@ -2854,6 +2888,7 @@ static struct attribute *iwl_sysfs_entries[] = { ...@@ -2854,6 +2888,7 @@ static struct attribute *iwl_sysfs_entries[] = {
&dev_attr_statistics.attr, &dev_attr_statistics.attr,
&dev_attr_temperature.attr, &dev_attr_temperature.attr,
&dev_attr_tx_power.attr, &dev_attr_tx_power.attr,
&dev_attr_rts_ht_protection.attr,
#ifdef CONFIG_IWLWIFI_DEBUG #ifdef CONFIG_IWLWIFI_DEBUG
&dev_attr_debug_level.attr, &dev_attr_debug_level.attr,
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册