From: David Young <dyoung-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
To: radiotap-eZodSLrBbDpBDgjK7y7TUQ@public.gmane.org
Subject: Re: rfc: "canonical" radiotap parser
Date: Sat, 8 Dec 2007 15:06:45 -0600 [thread overview]
Message-ID: <20071208210645.GX3568@che.ojctech.com> (raw)
In-Reply-To: <1197110397.4171.46.camel-YfaajirXv214zXjbi5bjpg@public.gmane.org>
On Sat, Dec 08, 2007 at 11:39:57AM +0100, Johannes Berg wrote:
> Hi Dave,
>
> I just took a quick look at the parser, it looks pretty good. Andy has
> done something similar and was willing to relicense it under BSD last I
> asked him, his code is part of the Linux kernel right now:
>
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=net/wireless/radiotap.c;hb=HEAD
I will take a look at that.
> Small question on the code: why did you declare that radiotap_field is
> aligned? It can potentially come from anywhere unaligned, no?
I was trying to give the compiler a hint to help it generate better
code on architectures, such as ARM, where unaligned loads may take
many instructions. Making the whole structure 64-bit aligned doesn't
sit very well with me. I believe this is better,
union radiotap_field {
int8_t f_i8[8];
uint8_t f_u8[8];
uint16_t f_u16[4];
uint32_t f_u32[2];
uint64_t f_u64;
struct radiotap_xchan {
uint32_t xc_flags;
uint16_t xc_mhz;
uint8_t xc_chan;
int8_t xc_dbm;
} f_xchan __attribute__((__packed__, __aligned__(4)));
struct radiotap_chan {
uint16_t c_mhz;
uint16_t c_flags;
} f_chan __attribute__((__packed__, __aligned__(2)));
};
Dave
--
David Young OJC Technologies
dyoung-eZodSLrBbDpBDgjK7y7TUQ@public.gmane.org Urbana, IL * (217) 278-3933 ext 24
next prev parent reply other threads:[~2007-12-08 21:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-07 4:55 rfc: "canonical" radiotap parser David Young
[not found] ` <20071207045545.GO3568-eZ+MEZF6i8Dc+919tysfdA@public.gmane.org>
2007-12-08 10:39 ` Johannes Berg
[not found] ` <1197110397.4171.46.camel-YfaajirXv214zXjbi5bjpg@public.gmane.org>
2007-12-08 21:06 ` David Young [this message]
[not found] ` <20071208210645.GX3568-eZ+MEZF6i8Dc+919tysfdA@public.gmane.org>
2007-12-10 12:37 ` Johannes Berg
[not found] ` <1197290250.6035.69.camel-YfaajirXv214zXjbi5bjpg@public.gmane.org>
2007-12-10 19:18 ` David Young
[not found] ` <20071210191815.GE3568-eZ+MEZF6i8Dc+919tysfdA@public.gmane.org>
2007-12-11 13:32 ` Johannes Berg
2007-12-11 21:38 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071208210645.GX3568@che.ojctech.com \
--to=dyoung-e+axbwqsrlaavxtiumwx3w@public.gmane.org \
--cc=radiotap-eZodSLrBbDpBDgjK7y7TUQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.