Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Feb 2012 12:12:34 -0800
From:      Adrian Chadd <adrian@freebsd.org>
To:        Bernhard Schmidt <bschmidt@freebsd.org>
Cc:        freebsd-wireless@freebsd.org
Subject:   Re: [net80211] support vendor bitmap entries; teach if_ath to export PHY error code in error frames
Message-ID:  <CAJ-Vmo=6xF8pWceBQVb4x3PYbLoGiiiAh9u2ZA8A=bAQdrOFdg@mail.gmail.com>
In-Reply-To: <201202062059.16816.bschmidt@freebsd.org>
References:  <CAJ-VmonSrcSQmZeENgH1fagnn6DOMhX6rC-n9=dOtypTabcSLg@mail.gmail.com> <CAAgh0_aAijDoguQCJO8jR=cZ5LrZGLfxpGruZWGsjGf987-zOw@mail.gmail.com> <CAJ-Vmon%2BpQ9U7-YEQ1pYVbHM=5D=cp-z6eoPGJhV_GU3r7hy8A@mail.gmail.com> <201202062059.16816.bschmidt@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 6 February 2012 11:59, Bernhard Schmidt <bschmidt@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmo=6xF8pWceBQVb4x3PYbLoGiiiAh9u2ZA8A=bAQdrOFdg>