Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0d69f22 authored by Pavel Roskin's avatar Pavel Roskin Committed by Jeff Garzik
Browse files

[PATCH] sparse-annotate radiotap header



Document that all fields must be little endian.  Use annotated types
even in the comments.  Consistently use shorter type names (u8, s8).
Realign the comments.

Signed-off-by: default avatarPavel Roskin <proski@gnu.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d2f11e09
Loading
Loading
Loading
Loading
+29 −28
Original line number Original line Diff line number Diff line
@@ -66,7 +66,9 @@
 */
 */
#define IEEE80211_RADIOTAP_HDRLEN	64
#define IEEE80211_RADIOTAP_HDRLEN	64


/* The radio capture header precedes the 802.11 header. */
/* The radio capture header precedes the 802.11 header.
 * All data in the header is little endian on all platforms.
 */
struct ieee80211_radiotap_header {
struct ieee80211_radiotap_header {
	u8 it_version;		/* Version 0. Only increases
	u8 it_version;		/* Version 0. Only increases
				 * for drastic changes,
				 * for drastic changes,
@@ -74,12 +76,12 @@ struct ieee80211_radiotap_header {
				 * new fields does not count.
				 * new fields does not count.
				 */
				 */
	u8 it_pad;
	u8 it_pad;
	u16 it_len;		/* length of the whole
	__le16 it_len;		/* length of the whole
				 * header in bytes, including
				 * header in bytes, including
				 * it_version, it_pad,
				 * it_version, it_pad,
				 * it_len, and data fields.
				 * it_len, and data fields.
				 */
				 */
	u32 it_present;		/* A bitmap telling which
	__le32 it_present;	/* A bitmap telling which
				 * fields are present. Set bit 31
				 * fields are present. Set bit 31
				 * (0x80000000) to extend the
				 * (0x80000000) to extend the
				 * bitmap by another 32 bits.
				 * bitmap by another 32 bits.
@@ -91,17 +93,17 @@ struct ieee80211_radiotap_header {
/* Name                                 Data type    Units
/* Name                                 Data type    Units
 * ----                                 ---------    -----
 * ----                                 ---------    -----
 *
 *
 * IEEE80211_RADIOTAP_TSFT              u64       microseconds
 * IEEE80211_RADIOTAP_TSFT              __le64       microseconds
 *
 *
 *      Value in microseconds of the MAC's 64-bit 802.11 Time
 *      Value in microseconds of the MAC's 64-bit 802.11 Time
 *      Synchronization Function timer when the first bit of the
 *      Synchronization Function timer when the first bit of the
 *      MPDU arrived at the MAC. For received frames, only.
 *      MPDU arrived at the MAC. For received frames, only.
 *
 *
 * IEEE80211_RADIOTAP_CHANNEL           2 x u16   MHz, bitmap
 * IEEE80211_RADIOTAP_CHANNEL           2 x __le16   MHz, bitmap
 *
 *
 *      Tx/Rx frequency in MHz, followed by flags (see below).
 *      Tx/Rx frequency in MHz, followed by flags (see below).
 *
 *
 * IEEE80211_RADIOTAP_FHSS              u16       see below
 * IEEE80211_RADIOTAP_FHSS              __le16       see below
 *
 *
 *      For frequency-hopping radios, the hop set (first byte)
 *      For frequency-hopping radios, the hop set (first byte)
 *      and pattern (second byte).
 *      and pattern (second byte).
@@ -110,13 +112,13 @@ struct ieee80211_radiotap_header {
 *
 *
 *      Tx/Rx data rate
 *      Tx/Rx data rate
 *
 *
 * IEEE80211_RADIOTAP_DBM_ANTSIGNAL     int8_t          decibels from
 * IEEE80211_RADIOTAP_DBM_ANTSIGNAL     s8           decibels from
 *                                                   one milliwatt (dBm)
 *                                                   one milliwatt (dBm)
 *
 *
 *      RF signal power at the antenna, decibel difference from
 *      RF signal power at the antenna, decibel difference from
 *      one milliwatt.
 *      one milliwatt.
 *
 *
 * IEEE80211_RADIOTAP_DBM_ANTNOISE      int8_t          decibels from
 * IEEE80211_RADIOTAP_DBM_ANTNOISE      s8           decibels from
 *                                                   one milliwatt (dBm)
 *                                                   one milliwatt (dBm)
 *
 *
 *      RF noise power at the antenna, decibel difference from one
 *      RF noise power at the antenna, decibel difference from one
@@ -132,26 +134,26 @@ struct ieee80211_radiotap_header {
 *      RF noise power at the antenna, decibel difference from an
 *      RF noise power at the antenna, decibel difference from an
 *      arbitrary, fixed reference point.
 *      arbitrary, fixed reference point.
 *
 *
 * IEEE80211_RADIOTAP_LOCK_QUALITY      u16       unitless
 * IEEE80211_RADIOTAP_LOCK_QUALITY      __le16       unitless
 *
 *
 *      Quality of Barker code lock. Unitless. Monotonically
 *      Quality of Barker code lock. Unitless. Monotonically
 *      nondecreasing with "better" lock strength. Called "Signal
 *      nondecreasing with "better" lock strength. Called "Signal
 *      Quality" in datasheets.  (Is there a standard way to measure
 *      Quality" in datasheets.  (Is there a standard way to measure
 *      this?)
 *      this?)
 *
 *
 * IEEE80211_RADIOTAP_TX_ATTENUATION    u16       unitless
 * IEEE80211_RADIOTAP_TX_ATTENUATION    __le16       unitless
 *
 *
 *      Transmit power expressed as unitless distance from max
 *      Transmit power expressed as unitless distance from max
 *      power set at factory calibration.  0 is max power.
 *      power set at factory calibration.  0 is max power.
 *      Monotonically nondecreasing with lower power levels.
 *      Monotonically nondecreasing with lower power levels.
 *
 *
 * IEEE80211_RADIOTAP_DB_TX_ATTENUATION u16       decibels (dB)
 * IEEE80211_RADIOTAP_DB_TX_ATTENUATION __le16       decibels (dB)
 *
 *
 *      Transmit power expressed as decibel distance from max power
 *      Transmit power expressed as decibel distance from max power
 *      set at factory calibration.  0 is max power.  Monotonically
 *      set at factory calibration.  0 is max power.  Monotonically
 *      nondecreasing with lower power levels.
 *      nondecreasing with lower power levels.
 *
 *
 * IEEE80211_RADIOTAP_DBM_TX_POWER      int8_t          decibels from
 * IEEE80211_RADIOTAP_DBM_TX_POWER      s8           decibels from
 *                                                   one milliwatt (dBm)
 *                                                   one milliwatt (dBm)
 *
 *
 *      Transmit power expressed as dBm (decibels from a 1 milliwatt
 *      Transmit power expressed as dBm (decibels from a 1 milliwatt
@@ -168,24 +170,23 @@ struct ieee80211_radiotap_header {
 *      Unitless indication of the Rx/Tx antenna for this packet.
 *      Unitless indication of the Rx/Tx antenna for this packet.
 *      The first antenna is antenna 0.
 *      The first antenna is antenna 0.
 *
 *
 * IEEE80211_RADIOTAP_RX_FLAGS          u_int16_t       bitmap
 * IEEE80211_RADIOTAP_RX_FLAGS          __le16       bitmap
 *
 *
 *     Properties of received frames. See flags defined below.
 *     Properties of received frames. See flags defined below.
 *
 *
 * IEEE80211_RADIOTAP_TX_FLAGS          u_int16_t       bitmap
 * IEEE80211_RADIOTAP_TX_FLAGS          __le16       bitmap
 *
 *
 *     Properties of transmitted frames. See flags defined below.
 *     Properties of transmitted frames. See flags defined below.
 *
 *
 * IEEE80211_RADIOTAP_RTS_RETRIES       u_int8_t        data
 * IEEE80211_RADIOTAP_RTS_RETRIES       u8           data
 *
 *
 *     Number of rts retries a transmitted frame used.
 *     Number of rts retries a transmitted frame used.
 *
 *
 * IEEE80211_RADIOTAP_DATA_RETRIES      u_int8_t        data
 * IEEE80211_RADIOTAP_DATA_RETRIES      u8           data
 *
 *
 *     Number of unicast retries a transmitted frame used.
 *     Number of unicast retries a transmitted frame used.
 *
 *
 *
 * IEEE80211_RADIOTAP_FCS           	__le32       data
 * IEEE80211_RADIOTAP_FCS           	u32       data
 *
 *
 *	FCS from frame in network byte order.
 *	FCS from frame in network byte order.
 */
 */