aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Mobarak <x@jason.mobarak.name>2014-09-01 04:23:36 (GMT)
committerJouni Malinen <j@w1.fi>2014-11-16 17:43:11 (GMT)
commit5cfb672ddef7c4e6a7bd424345c8f962a6f94dfc (patch)
tree74a187931616eedb4a53fd83e4b3b9e44704dda1 /src
parentc596f3f083d1638b72758f9106770b264ca40f84 (diff)
downloadhostap-5cfb672ddef7c4e6a7bd424345c8f962a6f94dfc.zip
hostap-5cfb672ddef7c4e6a7bd424345c8f962a6f94dfc.tar.gz
hostap-5cfb672ddef7c4e6a7bd424345c8f962a6f94dfc.tar.bz2
mesh: Enable mesh HT mode
Add a new option "mesh_ht_mode" that specifies the HT mode for the mesh, with this option on, mesh beacons, actions frames, and probe responses with include the appropriate HT information elements. [original implementation by Chun-Yeow Yeoh <yeohchunyeow@gmail.com>] [some fixes by Masashi Honma <masashi.honma@gmail.com>] Signed-off-by: Ashok Nagarajan <ashok.dragon@gmail.com> Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: Jason Mobarak <x@jason.mobarak.name>
Diffstat (limited to 'src')
-rw-r--r--src/common/defs.h11
-rw-r--r--src/drivers/driver.h1
-rw-r--r--src/drivers/driver_nl80211.c28
3 files changed, 39 insertions, 1 deletions
diff --git a/src/common/defs.h b/src/common/defs.h
index 2efb985..e1bbd50 100644
--- a/src/common/defs.h
+++ b/src/common/defs.h
@@ -308,6 +308,17 @@ enum wpa_ctrl_req_type {
/* Maximum number of EAP methods to store for EAP server user information */
#define EAP_MAX_METHODS 8
+/**
+ * enum ht_mode - channel width and offset
+ */
+enum ht_mode {
+ CHAN_UNDEFINED = 0,
+ CHAN_NO_HT,
+ CHAN_HT20,
+ CHAN_HT40PLUS,
+ CHAN_HT40MINUS,
+};
+
enum mesh_plink_state {
PLINK_LISTEN = 1,
PLINK_OPEN_SENT,
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 3476e8e..5be123b 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -945,6 +945,7 @@ struct wpa_driver_mesh_join_params {
const u8 *ies;
int ie_len;
int freq;
+ enum ht_mode ht_mode;
struct wpa_driver_mesh_bss_params conf;
#define WPA_DRIVER_MESH_FLAG_USER_MPM 0x00000001
#define WPA_DRIVER_MESH_FLAG_DRIVER_MPM 0x00000002
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index cf4e540..05d8ff5 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -8732,12 +8732,38 @@ wpa_driver_nl80211_join_mesh(void *priv,
nl80211_cmd(drv, msg, 0, NL80211_CMD_JOIN_MESH);
NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
- /* XXX: need chtype too in case we want HT */
if (params->freq) {
wpa_printf(MSG_DEBUG, " * freq=%d", params->freq);
NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, params->freq);
}
+ if (params->ht_mode) {
+ unsigned int ht_value;
+ char *ht_mode = "";
+
+ switch (params->ht_mode) {
+ default:
+ case CHAN_NO_HT:
+ ht_value = NL80211_CHAN_NO_HT;
+ ht_mode = "NOHT";
+ break;
+ case CHAN_HT20:
+ ht_value = NL80211_CHAN_HT20;
+ ht_mode = "HT20";
+ break;
+ case CHAN_HT40PLUS:
+ ht_value = NL80211_CHAN_HT40PLUS;
+ ht_mode = "HT40+";
+ break;
+ case CHAN_HT40MINUS:
+ ht_value = NL80211_CHAN_HT40MINUS;
+ ht_mode = "HT40-";
+ break;
+ }
+ wpa_printf(MSG_DEBUG, " * ht_mode=%s", ht_mode);
+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, ht_value);
+ }
+
if (params->basic_rates) {
u8 rates[NL80211_MAX_SUPP_RATES];
u8 rates_len = 0;