Search Linux Wireless

Re: [PATCH 2/2] mac80211: make rx radiotap header more flexible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday 26 April 2008 22:51:50 Johannes Berg wrote:
> > +static void
> > +ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
> > +				 struct sk_buff *skb,
> > +				 struct ieee80211_rx_status *status,
> > +				 struct ieee80211_rate *rate,
> > +				 int rtap_len)
> > +{
> > +	struct ieee80211_radiotap_header *rthdr;
> > +	unsigned char *pos;
> > +
> > +	rthdr = (struct ieee80211_radiotap_header *)skb_push(skb, rtap_len);
> > +	memset(rthdr, 0, rtap_len);
> > +
> > +	/* radiotap header, set always present flags */
> > +	rthdr->it_present =
> > +		cpu_to_le32((1 << IEEE80211_RADIOTAP_FLAGS) |
> > +			    (1 << IEEE80211_RADIOTAP_RATE) |
> > +			    (1 << IEEE80211_RADIOTAP_CHANNEL) |
> > +			    (1 << IEEE80211_RADIOTAP_ANTENNA) |
> > +			    (1 << IEEE80211_RADIOTAP_RX_FLAGS));
>
> Is all this alignment-safe now? Not sure it was before but it'd be nice
> if we could fix it up.
>
> Radiotap explicitly allows you to have a longer length than you need so
> maybe we should just make sure to align things?

are you talking about the alignment of the radiotap header itself? no, i just 
took care about the alignment requirements of the radiotap fields, relative 
to the start of radiotap. but it would be easy to add some additional length 
in ieee80211_rx_radiotap_len() and just leave that empty at the end.

i think i don't understand all alignment requirements though...

bruno
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux