Date: Mon, 25 Jun 2012 22:19:20 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r237577 - user/adrian/ath_radar_stuff/lib/libradarpkt Message-ID: <201206252219.q5PMJKcq098879@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Mon Jun 25 22:19:20 2012 New Revision: 237577 URL: http://svn.freebsd.org/changeset/base/237577 Log: Add some notes about how to interpret the TSF values. Modified: user/adrian/ath_radar_stuff/lib/libradarpkt/ar5416_radar.c user/adrian/ath_radar_stuff/lib/libradarpkt/ar9280_radar.c Modified: user/adrian/ath_radar_stuff/lib/libradarpkt/ar5416_radar.c ============================================================================== --- user/adrian/ath_radar_stuff/lib/libradarpkt/ar5416_radar.c Mon Jun 25 22:14:24 2012 (r237576) +++ user/adrian/ath_radar_stuff/lib/libradarpkt/ar5416_radar.c Mon Jun 25 22:19:20 2012 (r237577) @@ -89,6 +89,18 @@ ar5416_radar_decode(struct ieee80211_rad */ re->re_rssi = rssi; + /* + * XXX TODO: + * + * The radar event is timestamped by the MAC the end of the event. + * To work around this particular issue, a "best guess" of the event + * start time involves its duration. + * + * For the AR5416 we can fake this as we know that in 5GHz mode + * the MAC clock is 40MHz, so we can just convert the duration to + * a microsecond value and subtract that from the TSF. + */ + re->re_timestamp = tsf; /* XXX TODO: re->re_freq */ re->re_dur = pkt[len - 1] & 0xff; Modified: user/adrian/ath_radar_stuff/lib/libradarpkt/ar9280_radar.c ============================================================================== --- user/adrian/ath_radar_stuff/lib/libradarpkt/ar9280_radar.c Mon Jun 25 22:14:24 2012 (r237576) +++ user/adrian/ath_radar_stuff/lib/libradarpkt/ar9280_radar.c Mon Jun 25 22:19:20 2012 (r237577) @@ -99,6 +99,27 @@ ar9280_radar_decode(struct ieee80211_rad ); #endif + /* + * XXX TODO: + * + * The radar event is timestamped by the MAC the end of the event. + * To work around this particular issue, a "best guess" of the event + * start time involves its duration. + * + * For the AR5416 we can fake this as we know that in 5GHz mode + * the MAC clock is 40MHz, so we can just convert the duration to + * a microsecond value and subtract that from the TSF. + * This also holds true for the AR9130/AR9160 in 5GHz mode. + * + * However, for the AR9280, 5GHz operation may be in "fast clock" + * mode, where the duration is actually not 0.8uS, but slightly + * smaller. + * + * Since there's currently no way to record this information in + * the vendor radiotap header (but there should be, hint hint) + * should have a flags field somewhere which includes (among other + * things) whether the pulse duration is based on 40MHz or 44MHz. + */ re->re_timestamp = tsf; re->re_rssi = pri_rssi; /* XXX extension rssi? */ re->re_dur = pkt[len - 3]; /* XXX extension duration? */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206252219.q5PMJKcq098879>