[net80211] support vendor bitmap entries; teach if_ath to export PHY error code in error frames

Adrian Chadd adrian at freebsd.org
Mon Feb 6 20:12:36 UTC 2012


On 6 February 2012 11:59, Bernhard Schmidt <bschmidt at freebsd.org> wrote:


> Given that the calculation of the offsets is totally unrelated to the length of the actually vendor specific data, couldn't you just add the length of the additional ext field + padding based on the presents of VENDOREXT?

Well, the problem is the lack of documented alignment requirements for
a variable-length vendor data chunk.

I'm aligning the vendor header @ a 4 byte boundary (which wireshark
seems to accept) and johannes' reference radiotap parser comes with
vendor chunks which are also 4 byte aligned. But:

* the vendor header is 6 bytes, so
* there's two bytes between it and the next 4 / 8 byte boundary;
* there's no requirement for the vendor header to be 8 byte aligned,
so you can't store uint64_t's inside the vendor data blob and assume
they'll be "naturally aligned."

For now I've just added a 2 byte pad (1 byte version, one byte rx
chainmask) to pad it out to a 4 byte array, then all my sub-fields
assume 4 byte alignment. Along with plenty of comments about alignment
assumptions.

I haven't yet tested my patch out on MIPS to ensure that I haven't
busted alignment constraints. I'll do that before I finally commit it.


Adrian


More information about the freebsd-wireless mailing list