[PATCH v2] hostap: set ht_capab from wiphy when in P2P GO mode
Arik Nemtsov
arik
Fri Nov 25 01:01:25 PST 2011
On Thu, Nov 24, 2011 at 21:51, Jouni Malinen <j at w1.fi> wrote:
> On Tue, Aug 09, 2011 at 08:08:46AM +0300, Arik Nemtsov wrote:
>> Set the HT capabilities of a P2P GO according to the wiphy supported
>> ones. Mask-in a white-list of HT capabilities that won't cause problems
>> for non-supporting stations.
>
>> diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
>> @@ -101,8 +102,20 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
>
>> + ? ? ? ? ? ? ? ? ? ? /*
>> + ? ? ? ? ? ? ? ? ? ? ?* white-list capabilities that won't cause issues
>> + ? ? ? ? ? ? ? ? ? ? ?* to connecting stations.
>> + ? ? ? ? ? ? ? ? ? ? ?*/
>> + ? ? ? ? ? ? ? ? ? ? conf->ht_capab = mode->ht_capab &
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?(HT_CAP_INFO_GREEN_FIELD |
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?HT_CAP_INFO_SHORT_GI20MHZ |
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?HT_CAP_INFO_SHORT_GI40MHZ |
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?HT_CAP_INFO_RX_STBC_MASK |
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?HT_CAP_INFO_MAX_AMSDU_SIZE);
>
> This does not look safe.. Wouldn't that hardcode static SMPS to be
> enabled? The default value for ht_capab is HT_CAP_INFO_SMPS_DISABLED
> which seems to be getting cleared here. At minimum, this would need to
> OR that to conf->ht_capab after the AND.
Good catch. But maybe a better solution is to just add
HT_CAP_INFO_SMPS_MASK into the mask?
This will allow cards supports some mode of SMPS to declare themselves
as such. Cards not supporting SMPS presumably already have
HT_CAP_INFO_SMPS_DISABLED set (for working correctly as an AP in
hostapd mode).
Arik
More information about the Hostap
mailing list