aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshok Nagarajan <ashok@cozybit.com>2012-04-30 17:20:32 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-05-08 21:53:59 -0400
commit70c33eaae79e53f9e48324736c0cb85534d3f093 (patch)
tree103c59d0356e55341052adca0624b6256525ddbb
parentb91e64aad2c78b0477b9eb3a26335668b4032002 (diff)
{nl,cfg,mac}80211: Allow user to see/configure HT protection mode
This patch introduces a new mesh configuration parameter "ht_opmode" and will allow user to check the current HT protection mode selected. Users could configure the protection mode by the command "iw mesh_iface set mesh_param mesh_ht_protection_mode=2". The default protection mode of mesh is set to non-HT mixed mode. Signed-off-by: Ashok Nagarajan <ashok@cozybit.com> Reviewed-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--include/linux/nl80211.h3
-rw-r--r--include/net/cfg80211.h1
-rw-r--r--net/mac80211/cfg.c5
-rw-r--r--net/mac80211/mesh.c3
-rw-r--r--net/mac80211/mesh_plink.c1
-rw-r--r--net/wireless/mesh.c1
-rw-r--r--net/wireless/nl80211.c7
7 files changed, 20 insertions, 1 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 1335084b1c69..2540e86d99ab 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -2154,6 +2154,8 @@ enum nl80211_mntr_flags {
2154 * @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors 2154 * @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors
2155 * to synchronize to for 11s default synchronization method (see 11C.12.2.2) 2155 * to synchronize to for 11s default synchronization method (see 11C.12.2.2)
2156 * 2156 *
2157 * @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode.
2158 *
2157 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use 2159 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
2158 */ 2160 */
2159enum nl80211_meshconf_params { 2161enum nl80211_meshconf_params {
@@ -2179,6 +2181,7 @@ enum nl80211_meshconf_params {
2179 NL80211_MESHCONF_FORWARDING, 2181 NL80211_MESHCONF_FORWARDING,
2180 NL80211_MESHCONF_RSSI_THRESHOLD, 2182 NL80211_MESHCONF_RSSI_THRESHOLD,
2181 NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR, 2183 NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR,
2184 NL80211_MESHCONF_HT_OPMODE,
2182 2185
2183 /* keep last */ 2186 /* keep last */
2184 __NL80211_MESHCONF_ATTR_AFTER_LAST, 2187 __NL80211_MESHCONF_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 27f956101bbd..adb2320bccdf 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -821,6 +821,7 @@ struct mesh_config {
821 bool dot11MeshGateAnnouncementProtocol; 821 bool dot11MeshGateAnnouncementProtocol;
822 bool dot11MeshForwarding; 822 bool dot11MeshForwarding;
823 s32 rssi_threshold; 823 s32 rssi_threshold;
824 u16 ht_opmode;
824}; 825};
825 826
826/** 827/**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 39b1fffb24f4..0221270c0ddf 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1538,6 +1538,11 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy,
1538 return -ENOTSUPP; 1538 return -ENOTSUPP;
1539 conf->rssi_threshold = nconf->rssi_threshold; 1539 conf->rssi_threshold = nconf->rssi_threshold;
1540 } 1540 }
1541 if (_chg_mesh_attr(NL80211_MESHCONF_HT_OPMODE, mask)) {
1542 conf->ht_opmode = nconf->ht_opmode;
1543 sdata->vif.bss_conf.ht_operation_mode = nconf->ht_opmode;
1544 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_HT);
1545 }
1541 return 0; 1546 return 0;
1542} 1547}
1543 1548
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 0fabb8bae9fb..0a21e4e55f43 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -595,12 +595,15 @@ void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
595 set_bit(MESH_WORK_HOUSEKEEPING, &ifmsh->wrkq_flags); 595 set_bit(MESH_WORK_HOUSEKEEPING, &ifmsh->wrkq_flags);
596 ieee80211_mesh_root_setup(ifmsh); 596 ieee80211_mesh_root_setup(ifmsh);
597 ieee80211_queue_work(&local->hw, &sdata->work); 597 ieee80211_queue_work(&local->hw, &sdata->work);
598 sdata->vif.bss_conf.ht_operation_mode =
599 ifmsh->mshcfg.ht_opmode;
598 sdata->vif.bss_conf.beacon_int = MESH_DEFAULT_BEACON_INTERVAL; 600 sdata->vif.bss_conf.beacon_int = MESH_DEFAULT_BEACON_INTERVAL;
599 sdata->vif.bss_conf.basic_rates = 601 sdata->vif.bss_conf.basic_rates =
600 ieee80211_mandatory_rates(sdata->local, 602 ieee80211_mandatory_rates(sdata->local,
601 sdata->local->hw.conf.channel->band); 603 sdata->local->hw.conf.channel->band);
602 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON | 604 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON |
603 BSS_CHANGED_BEACON_ENABLED | 605 BSS_CHANGED_BEACON_ENABLED |
606 BSS_CHANGED_HT |
604 BSS_CHANGED_BASIC_RATES | 607 BSS_CHANGED_BASIC_RATES |
605 BSS_CHANGED_BEACON_INT); 608 BSS_CHANGED_BEACON_INT);
606} 609}
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 2e0ae7310697..8cc8461b48a0 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -157,6 +157,7 @@ out:
157 157
158 if (sdata->vif.bss_conf.ht_operation_mode != ht_opmode) { 158 if (sdata->vif.bss_conf.ht_operation_mode != ht_opmode) {
159 sdata->vif.bss_conf.ht_operation_mode = ht_opmode; 159 sdata->vif.bss_conf.ht_operation_mode = ht_opmode;
160 sdata->u.mesh.mshcfg.ht_opmode = ht_opmode;
160 changed = BSS_CHANGED_HT; 161 changed = BSS_CHANGED_HT;
161 mpl_dbg("mesh_plink %pM: protection mode changed to %d", 162 mpl_dbg("mesh_plink %pM: protection mode changed to %d",
162 sdata->vif.addr, ht_opmode); 163 sdata->vif.addr, ht_opmode);
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c
index 8c747fa9319b..2749cb86b462 100644
--- a/net/wireless/mesh.c
+++ b/net/wireless/mesh.c
@@ -61,6 +61,7 @@ const struct mesh_config default_mesh_config = {
61 .dot11MeshGateAnnouncementProtocol = false, 61 .dot11MeshGateAnnouncementProtocol = false,
62 .dot11MeshForwarding = true, 62 .dot11MeshForwarding = true,
63 .rssi_threshold = MESH_RSSI_THRESHOLD, 63 .rssi_threshold = MESH_RSSI_THRESHOLD,
64 .ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED,
64}; 65};
65 66
66const struct mesh_setup default_mesh_setup = { 67const struct mesh_setup default_mesh_setup = {
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index d5005c59c472..b67b1114e25a 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3390,7 +3390,9 @@ static int nl80211_get_mesh_config(struct sk_buff *skb,
3390 nla_put_u8(msg, NL80211_MESHCONF_FORWARDING, 3390 nla_put_u8(msg, NL80211_MESHCONF_FORWARDING,
3391 cur_params.dot11MeshForwarding) || 3391 cur_params.dot11MeshForwarding) ||
3392 nla_put_u32(msg, NL80211_MESHCONF_RSSI_THRESHOLD, 3392 nla_put_u32(msg, NL80211_MESHCONF_RSSI_THRESHOLD,
3393 cur_params.rssi_threshold)) 3393 cur_params.rssi_threshold) ||
3394 nla_put_u32(msg, NL80211_MESHCONF_HT_OPMODE,
3395 cur_params.ht_opmode))
3394 goto nla_put_failure; 3396 goto nla_put_failure;
3395 nla_nest_end(msg, pinfoattr); 3397 nla_nest_end(msg, pinfoattr);
3396 genlmsg_end(msg, hdr); 3398 genlmsg_end(msg, hdr);
@@ -3426,6 +3428,7 @@ static const struct nla_policy nl80211_meshconf_params_policy[NL80211_MESHCONF_A
3426 [NL80211_MESHCONF_GATE_ANNOUNCEMENTS] = { .type = NLA_U8 }, 3428 [NL80211_MESHCONF_GATE_ANNOUNCEMENTS] = { .type = NLA_U8 },
3427 [NL80211_MESHCONF_FORWARDING] = { .type = NLA_U8 }, 3429 [NL80211_MESHCONF_FORWARDING] = { .type = NLA_U8 },
3428 [NL80211_MESHCONF_RSSI_THRESHOLD] = { .type = NLA_U32}, 3430 [NL80211_MESHCONF_RSSI_THRESHOLD] = { .type = NLA_U32},
3431 [NL80211_MESHCONF_HT_OPMODE] = { .type = NLA_U16},
3429}; 3432};
3430 3433
3431static const struct nla_policy 3434static const struct nla_policy
@@ -3523,6 +3526,8 @@ do {\
3523 mask, NL80211_MESHCONF_FORWARDING, nla_get_u8); 3526 mask, NL80211_MESHCONF_FORWARDING, nla_get_u8);
3524 FILL_IN_MESH_PARAM_IF_SET(tb, cfg, rssi_threshold, 3527 FILL_IN_MESH_PARAM_IF_SET(tb, cfg, rssi_threshold,
3525 mask, NL80211_MESHCONF_RSSI_THRESHOLD, nla_get_u32); 3528 mask, NL80211_MESHCONF_RSSI_THRESHOLD, nla_get_u32);
3529 FILL_IN_MESH_PARAM_IF_SET(tb, cfg, ht_opmode,
3530 mask, NL80211_MESHCONF_HT_OPMODE, nla_get_u16);
3526 if (mask_out) 3531 if (mask_out)
3527 *mask_out = mask; 3532 *mask_out = mask;
3528 3533