From: Johannes Berg <johannes@sipsolutions.net>
To: Michael Wu <flamingice@sourmilk.net>
Cc: Jiri Benc <jbenc@suse.cz>,
linux-wireless@vger.kernel.org, Andy Green <andy@warmcat.com>
Subject: Re: [PATCH] mac80211: Add radiotap support
Date: Fri, 06 Apr 2007 10:11:14 +0200 [thread overview]
Message-ID: <1175847074.3489.56.camel@johannes.berg> (raw)
In-Reply-To: <200704060048.51524.flamingice@sourmilk.net>
[-- Attachment #1: Type: text/plain, Size: 1291 bytes --]
On Fri, 2007-04-06 at 00:48 -0400, Michael Wu wrote:
> @@ -3756,6 +3802,12 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
> struct ieee80211_txrx_data rx;
> u16 type;
> int multicast;
> + int radiotap_len = 0;
> +
> + if (status->flag & RX_FLAG_RADIOTAP) {
> + radiotap_len = ieee80211_get_radiotap_len(skb);
> + skb_pull(skb, radiotap_len);
> + }
>
> hdr = (struct ieee80211_hdr *) skb->data;
> memset(&rx, 0, sizeof(rx));
> @@ -3792,6 +3844,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
> goto end;
> skb = rx.skb;
>
> + skb_push(skb, radiotap_len);
I don't like this trick. It's so non-obvious. And inbetween, the only
thing we ever use is skb->data (once, to get hdr assigned) and skb->len
(which we could also load into a local variable.
> @@ -3800,7 +3853,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
> } else {
> struct ieee80211_sub_if_data *prev = NULL;
> struct sk_buff *skb_new;
> - u8 *bssid = ieee80211_get_bssid(hdr, skb->len);
> + u8 *bssid = ieee80211_get_bssid(hdr, skb->len - radiotap_len);
and here you still need to do the subtraction. If you had the local
variable, then you could just write frame_len or something.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
next prev parent reply other threads:[~2007-04-06 8:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-06 4:48 [PATCH] mac80211: Add radiotap support Michael Wu
2007-04-06 8:11 ` Johannes Berg [this message]
2007-04-06 13:26 ` Michael Wu
2007-04-06 13:52 ` 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=1175847074.3489.56.camel@johannes.berg \
--to=johannes@sipsolutions.net \
--cc=andy@warmcat.com \
--cc=flamingice@sourmilk.net \
--cc=jbenc@suse.cz \
--cc=linux-wireless@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox