[PATCH 2/3] HE: add code to dynamically turn on TWT responder support

Jouni Malinen j at w1.fi
Tue Sep 10 03:54:52 PDT 2019


On Tue, Aug 13, 2019 at 04:16:24PM +0200, John Crispin wrote:
> This allows us to dynamically turn TWT on responder support using a nl80211
> attribute.

> diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c

> +int hostapd_get_he_twt_responder(struct hostapd_data *hapd)
> +{
> +	u8 *mac_cap = hapd->iface->current_mode->he_capab->mac_cap;

I'm not sure hapd->iface->current_mode has to be set here for all cases,
so would be good to confirm it is not NULL. Same for he_capab.

> +	return mac_cap[0] & HE_MACCAP_TWT_RESPONDER;

Should there be a define for that 0 (the first octet of the HE MAC
Capabilities Information field)?

> diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h

>  /* HE Capabilities Information defines */
>  
> +#define HE_MACCAP_TWT_RESPONDER			((u8) BIT(3))

Where does that BIT(3) come from? TWT Responder Support is B2 of the HE
MAC Capabilities Information field.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list