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>
This commit is contained in:
Jason Mobarak 2014-09-01 00:23:36 -04:00 committed by Jouni Malinen
parent c596f3f083
commit 5cfb672dde
10 changed files with 171 additions and 20 deletions

View file

@ -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,

View file

@ -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

View file

@ -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;