Re: [PATCH] ipw2200 1.1.4 broke radiotap header
Zhu Yi <[email protected]>
| Newsgroups | gmane.linux.drivers.ipw2100.devel |
|---|---|
| Organization | Intel Corp. |
| Message-ID | <[email protected]> |
On Tue, 2006-08-22 at 23:24 +0200, Stefan Rompf wrote:
> the radiotap headers created by 1.1.4 are currently broken. the TSFT flag has
> been removed from rt_hdr.it_present. However, as the radiotap header is
> variable length it is also necessary to remove the disabled field. The
> attached patch accomplishes that.
Yup, I made a mistake. The ipw2200 BSS firmware actually passes on the
TSF information within ipw_rx_frame, but monitor firmware doesn't. I add
back the IEEE80211_RADIOTAP_TSFT flags so that we can get the MAC
timestamp if we use the rtap interface. We will see the MAC timestamp
equals to zero if we capture the packets with a monitor mode interface.
But this is the expected behaviour. See attached patch.
> Another oddity is that a noise field has been added to the ipw_rt, but it
> is left unitialized in ipw_handle_data_packet_monitor(), and returns a
> positive value in ipw_handle_promiscous_rx(). May be a substraction of
> IPW_RSSI_TO_DBM is missing here, however, this results in -112dBm for me which
> seems quite low with the notebook positioned next to the DECT station...
Attached patch fixes this by assigning the frame->noise value to the
radiotap field in monitor mode. But AFAIK, the noise value is not passed
on by either the BSS nor the monitor firmware. So it will always be zero
for current (v3.0) firmware. It might be fixed by further firmware
releases.
BTW, I found I need this patch to make ethereal show the radiotap +
802.11 packet correctly. It was not in any ethereal releases yet :(
http://anonsvn.ethereal.com/viewcvs/viewcvs.py?rev=18020&view=rev
Thanks,
-yi
> --- ipw2200-1.1.4/ipw2200.h.old 2006-08-21 04:38:32.000000000 +0200
> +++ ipw2200-1.1.4/ipw2200.h 2006-08-22 22:53:14.000000000 +0200
> @@ -1158,7 +1158,6 @@ struct ipw_prom_priv {
> */
> struct ipw_rt_hdr {
> struct ieee80211_radiotap_header rt_hdr;
> - u64 rt_tsf; /* TSF */
> u8 rt_flags; /* radiotap packet flags */
> u8 rt_rate; /* rate in 500kb/s */
> u16 rt_channel; /* channel in mhz */
> --- ipw2200-1.1.4/ipw2200.c.old 2006-08-21 14:22:53.000000000 +0200
> +++ ipw2200-1.1.4/ipw2200.c 2006-08-22 22:54:02.000000000 +0200
> @@ -7766,7 +7766,6 @@ static void ipw_handle_data_packet_monit
>
> /* Zero the flags, we'll add to them as we go */
> ipw_rt->rt_flags = 0;
> - ipw_rt->rt_tsf = 0ULL;
>
> /* Convert signal to DBM */
> ipw_rt->rt_dbmsignal = antsignal;
> @@ -7978,7 +7977,6 @@ static void ipw_handle_promiscuous_rx(st
>
> /* Zero the flags, we'll add to them as we go */
> ipw_rt->rt_flags = 0;
> - ipw_rt->rt_tsf = 0ULL;
>
> /* Convert to DBM */
> ipw_rt->rt_dbmsignal = signal;
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
ipw2100-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ipw2100-devel
ipw2200-1.1.4-it.patch
(text/x-patch, 1.9 KB)
diff -urp ipw2200-1.1.4/ipw2200.c ipw2200-1.1.4-it/ipw2200.c --- ipw2200-1.1.4/ipw2200.c 2006-08-21 10:38:32.000000000 +0800 +++ ipw2200-1.1.4-it/ipw2200.c 2006-08-29 15:19:46.000000000 +0800 @@ -7757,7 +7757,8 @@ static void ipw_handle_data_packet_monit /* Big bitfield of all the fields we provide in radiotap */ ipw_rt->rt_hdr.it_present = - ((1 << IEEE80211_RADIOTAP_FLAGS) | + ((1 << IEEE80211_RADIOTAP_TSFT) | + (1 << IEEE80211_RADIOTAP_FLAGS) | (1 << IEEE80211_RADIOTAP_RATE) | (1 << IEEE80211_RADIOTAP_CHANNEL) | (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | @@ -7766,10 +7767,14 @@ static void ipw_handle_data_packet_monit /* Zero the flags, we'll add to them as we go */ ipw_rt->rt_flags = 0; - ipw_rt->rt_tsf = 0ULL; + ipw_rt->rt_tsf = (u64)(frame->parent_tsf[3] << 24 | + frame->parent_tsf[2] << 16 | + frame->parent_tsf[1] << 8 | + frame->parent_tsf[0]); /* Convert signal to DBM */ ipw_rt->rt_dbmsignal = antsignal; + ipw_rt->rt_dbmnoise = frame->noise; /* Convert the channel data and set the flags */ ipw_rt->rt_channel = cpu_to_le16(ieee80211chan2mhz(received_channel)); @@ -7969,7 +7974,8 @@ static void ipw_handle_promiscuous_rx(st /* Big bitfield of all the fields we provide in radiotap */ ipw_rt->rt_hdr.it_present = - ((1 << IEEE80211_RADIOTAP_FLAGS) | + ((1 << IEEE80211_RADIOTAP_TSFT) | + (1 << IEEE80211_RADIOTAP_FLAGS) | (1 << IEEE80211_RADIOTAP_RATE) | (1 << IEEE80211_RADIOTAP_CHANNEL) | (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | @@ -7978,7 +7984,10 @@ static void ipw_handle_promiscuous_rx(st /* Zero the flags, we'll add to them as we go */ ipw_rt->rt_flags = 0; - ipw_rt->rt_tsf = 0ULL; + ipw_rt->rt_tsf = (u64)(frame->parent_tsf[3] << 24 | + frame->parent_tsf[2] << 16 | + frame->parent_tsf[1] << 8 | + frame->parent_tsf[0]); /* Convert to DBM */ ipw_rt->rt_dbmsignal = signal;