[PATCH V4] hostapd: Add Operating Mode Notification support

Marek Kwaczynski marek.kwaczynski at tieto.com
Fri Jul 4 04:15:00 EDT 2014


Hi Jouni,

You are right this condition checking is not necessary:
+   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_OPMODE_NOTIF_RX_NSS_SHIFT) > VHT_RX_NSS_MAX_STREAMS - 1) {
> > +           sta->flags &= ~WLAN_STA_VHT_OPMODE_ENABLED;
> > +           return WLAN_STATUS_UNSPECIFIED_
FAILURE;
> > +   }


it will be enough:
channel_width = *vht_oper_notif & VHT_OPMODE_CHANNEL_WIDTH_MASK;

I'm sorry I missed it.
I will send a new patch.

Best regards,
Marek Kwaczyński

On 17 June 2014 23:44, Jouni Malinen <j at w1.fi> wrote:
> On Sat, Jun 14, 2014 at 12:54:43AM +0300, Jouni Malinen wrote:
>> On Mon, Feb 10, 2014 at 01:43:05PM +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,33 @@ 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)
>>
>> > +   channel_width = *vht_oper_notif & VHT_OPMODE_CHANNEL_WIDTH_MASK;
>> > +
>> > +   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_OPMODE_NOTIF_RX_NSS_SHIFT) > VHT_RX_NSS_MAX_STREAMS - 1) {
>> > +           sta->flags &= ~WLAN_STA_VHT_OPMODE_ENABLED;
>> > +           return WLAN_STATUS_UNSPECIFIED_FAILURE;
>> > +   }
>
>> I'm not sure what this is trying to do, but in practice, it does not do
>> anything. Was that last item supposed to be ORed with the channel_width
>> checks? If so, it would still not do anything with RxNSS mask, but at
>> least the channel_width checks would work. Or was this supposed to check
>> something else?
>
> I cannot make any sense from this. Even that channel width part cannot
> be invalid since it is a two-bit field without any way of encoding
> something else than the values 0..3. Furthermore, those VHT_CHANWIDTH_*
> defines do not match the bits defined for the Channel Width subfield in
> the Operating Mode field.
>
> Since this doesn't do anything now and I cannot think of what this could
> be trying to do, I'll just delete these lines. If someone can come up
> with an explanation of what should be checked here, a new patch to add
> such validation can be considered.
>
> --
> Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list