Disabling SMPS (Spatial multiplexing power save) when 802.11n is not used

Jose Blanquicet blanquicet at gmail.com
Fri Mar 18 09:13:28 PDT 2016


I am using the Marvell driver sd8887 without any particular wpa_supplicant
configuration.

I also agree that your fix is more appropriated. I tried it and it
works also with
Marvell driver. I think that mac80211_hwsim does not take into account
smps_mode parameter when ht is disabled, which is right. But instead,
Marvell driver and maybe others report error -22 (Invalid argument) if they
receive smps_mode and it is set to a value different than OFF; of course
when disable_ht=1.

On the other hand, I would like to make a question (I do not know if it should
be done in another discussion, if so let me know and I will create a new one).
The fact is that I have been able to use a, g, n and ac 802.11 modes but not
b. I get 802.11n or ac using disable_ht and disable_vht parameters.
Additionally, if I disable both parameters I get 802.11g mode and if I also set
frequency to a channel in 5GHz I get 802.11a mode. But I do not know how
to properly set the network parameters to enable 802.11b mode. How can I
do this?

Thanks for your help!

On Fri, Mar 18, 2016 at 3:16 PM, Jouni Malinen <j at w1.fi> wrote:
> On Fri, Mar 18, 2016 at 02:11:13PM +0100, Jose Blanquicet wrote:
>> You are probably right, the problem could be that smps attribute is added
>> without verify if it is going to do HT. In function wpa_driver_nl80211_set_ap:
>>
>> if (nla_put_u32(msg, NL80211_ATTR_SMPS_MODE, smps_mode))
>>            goto fail;
>>
>> When I set it to HT_CAP_INFO_SMPS_DISABLED, nl80211 shoul ignore it
>> and that's the reason why it works.
>
> Which driver are you using when testing this and what kind of
> wpa_supplicant configuration? I was unable to reproduce the error
> message with mac80211_hwsim, i.e., the AP did come up with HT disabled
> when configuring the network with disable_ht=1.
>
> That said, the attribute should not be there and the proper fix would
> likely look like this:
>
>
> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> index 5fb6652..b4c3462 100644
> --- a/src/drivers/driver_nl80211.c
> +++ b/src/drivers/driver_nl80211.c
> @@ -3526,24 +3526,26 @@ static int wpa_driver_nl80211_set_ap(void *priv,
>             nla_put_u32(msg, NL80211_ATTR_CIPHER_SUITE_GROUP, suite))
>                 goto fail;
>
> -       switch (params->smps_mode) {
> -       case HT_CAP_INFO_SMPS_DYNAMIC:
> -               wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - dynamic");
> -               smps_mode = NL80211_SMPS_DYNAMIC;
> -               break;
> -       case HT_CAP_INFO_SMPS_STATIC:
> -               wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - static");
> -               smps_mode = NL80211_SMPS_STATIC;
> -               break;
> -       default:
> -               /* invalid - fallback to smps off */
> -       case HT_CAP_INFO_SMPS_DISABLED:
> -               wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - off");
> -               smps_mode = NL80211_SMPS_OFF;
> -               break;
> +       if (params->ht_opmode != -1) {
> +               switch (params->smps_mode) {
> +               case HT_CAP_INFO_SMPS_DYNAMIC:
> +                       wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - dynamic");
> +                       smps_mode = NL80211_SMPS_DYNAMIC;
> +                       break;
> +               case HT_CAP_INFO_SMPS_STATIC:
> +                       wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - static");
> +                       smps_mode = NL80211_SMPS_STATIC;
> +                       break;
> +               default:
> +                       /* invalid - fallback to smps off */
> +               case HT_CAP_INFO_SMPS_DISABLED:
> +                       wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - off");
> +                       smps_mode = NL80211_SMPS_OFF;
> +                       break;
> +               }
> +               if (nla_put_u32(msg, NL80211_ATTR_SMPS_MODE, smps_mode))
> +                       goto fail;
>         }
> -       if (nla_put_u32(msg, NL80211_ATTR_SMPS_MODE, smps_mode))
> -               goto fail;
>
>         if (params->beacon_ies) {
>                 wpa_hexdump_buf(MSG_DEBUG, "nl80211: beacon_ies",
>
>
> --
> Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list