[PATCH V3] hostapd: Add Operating Mode Notification support
Jouni Malinen
j
Thu Feb 6 06:29:43 PST 2014
On Mon, Feb 03, 2014 at 03:55:19PM +0100, Marek Kwaczynski wrote:
> Handling Operating Mode Notification received in Assoc Request.
> diff --git a/src/ap/ieee802_11_vht.c b/src/ap/ieee802_11_vht.c
> @@ -108,6 +108,32 @@ u16 copy_sta_vht_capab(struct hostapd_data *hapd, struct sta_info *sta,
> +u16 set_sta_vht_opmode(struct hostapd_data *hapd, struct sta_info *sta,
> + const u8 *vht_oper_notif, size_t vht_oper_notif_len)
> +{
> + channel_width = *vht_oper_notif & VHT_OPMODE_CHANNEL_WIDTH_MASK;
This would be otherwise fine, but that mask was defined as BIT(6)|BIT(7)
which does not match IEEE Std 802.11ac-2013 (Channel Width is in B0..B1
of the Operating Mode field).
> + if (channel_width != VHT_CHANWIDTH_USE_HT &&
> + channel_width != VHT_CHANWIDTH_80MHZ &&
> + channel_width != VHT_CHANWIDTH_160MHZ &&
> + channel_width != VHT_CHANWIDTH_80P80MHZ &&
> + (*vht_oper_notif & VHT_OPMODE_CHANNEL_RxNSS_MASK) > VHT_RX_NSS_MAX_STREAMS - 1) {
That use of VHT_OPMODE_CHANNEL_RxNSS_MASK does not look correct. That
mask was defined to be BIT(1)|BIT(2)|BIT(3) and have a shift of 4. The
shift value looks actually correct, but there is no shift operation
here.. Furthermore, the bits selected in that mask look pretty strange.
IEEe Std 802.11ac-2013 shows Rx NSS to be in B4..B6.
> diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c
> @@ -252,6 +252,10 @@ ParseRes ieee802_11_parse_elems(const u8 *start, size_t len,
> + case WLAN_EID_VHT_OPERATING_MODE_NOTIFICATION:
> + elems->vht_opmode_notif = pos;
> + elems->vht_opmode_notif_len = elen;
> + break;
It looks unnecessarily complex to include length field for a one-octet
information element.. I'd add "if (elen < 1) break" here and remove
vht_opmode_notif_len.
> diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
> @@ -764,6 +764,13 @@ struct ieee80211_vht_operation {
> +#define VHT_OPMODE_CHANNEL_WIDTH_MASK ((u8) BIT(6) | BIT(7))
> +#define VHT_OPMODE_CHANNEL_RxNSS_MASK ((u8) BIT(1) | BIT(2) | BIT(3))
These do not seem to match IEEE Std 802.11ac-2013.
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list