Radiotap is a de facto standard for 802.11 frame injection and reception. Details of radiotap can be found on its new website.
Linux has started to embrace radiotap on its drivers and driver APIs. Relevant files:
XXX: move ieee80211_radiotap.h to kerneldoc
mac80211 supports receiving radiotap headers before the actual 802.11 frame. The driver informs mac80211 when it adds a radiotap header by enabling the RX_FLAG_RADIOTAP flag on flag member of struct ieee80211_rx_status. When a driver is done with a frame it passes it to mac80211 via ieee80211_rx.
mac80211 informs drivers it wants radiotap headers in its received skbs during ieee80211_open(), the device's open routine (dev→open). It does this when the type of interface being opened is of type NL80211_IFTYPE_MONITIR, a monitor interface. It informs the driver by enabling IEEE80211_CONF_RADIOTAP on struct ieee80211_hws struct ieee80211_conf flags Sequentially, mac80211 will disable this flag during ieee80211_stop() (dev→stop) for NL80211_IFTYPE_MONITOR interface types.