[PATCH] hostapd: take configured antenna set into consideration

Jouni Malinen j at w1.fi
Thu Dec 24 10:41:57 PST 2015

On Sun, Dec 20, 2015 at 01:54:27PM -0800, Ben Greear wrote:
> On 12/20/2015 12:12 PM, Jouni Malinen wrote:
> >On Wed, Dec 09, 2015 at 12:20:33PM -0800, greearb at candelatech.com wrote:
> >>If user has configured TX antennas to be less than what
> >>hardware advertises, the MCS reported by hardware will
> >>be too large.  So, remove MCS sets accordingly.
> >
> >The nl80211 related changes seem mostly reasonable, but I'm not sure I
> >understood what exactly the HT/VHT changes were supposed to do. Why are
> >they different? HT uses tx_ant & rx_ant and masks values from
> >cap->supported_mcs_set[] until the highest 1 bit is found. VHT masks
> >values separately for TX and RX and does this with |= 0x3 << i. Is that
> >really correct? Should i be "i * 2"? Why is there difference in the
> >configured bitmap checks (BIT(i) vs. BIT(i - 1) and different i > 0 vs.
> >i >= 0 condition)?
> There might be several ways to make the math work.  I think my math
> was proper enough, but maybe though more dumb luck than theoretical correctness.

When I tested this with mac80211_hwsim and max 8 streams from the driver
configured to use only two antennas, the VHT elements did look at all
correct to me..

> And, I'm not really sure what to do when tx-antenna doesn't match
> rx-antenna.

> As far as I know, there is no valid tx/rx mask that is not contiguous
> for any driver.

Where is this documented? I could not find any real details on how the
iw "set antenna" command is supposed to be used.. That allows completely
independent bitmaps of antennas for TX and RX and there is no
requirements of being contiguous or identical between TX and RX ..
Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list