radiotap->oui[0] = 0xf6;
radiotap->oui[1] = 0x54;
radiotap->oui[2] = 0x25;
- /* radiotap sniffer config sub-namespace */
+ /* Intel OUI default radiotap subtype */
radiotap->oui_subtype = 1;
+ /* Sniffer config element type */
radiotap->vendor_type = 0;
/* fill the data now */
}
#endif
+static void iwl_mld_add_rtap_sniffer_phy_data(struct iwl_mld *mld,
+ struct sk_buff *skb,
+ struct iwl_rx_phy_air_sniffer_ntfy *ntfy)
+{
+ struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
+ struct ieee80211_radiotap_vendor_content *radiotap;
+ const u16 vendor_data_len = sizeof(*ntfy);
+
+ radiotap =
+ iwl_mld_radiotap_put_tlv(skb,
+ IEEE80211_RADIOTAP_VENDOR_NAMESPACE,
+ sizeof(*radiotap) + vendor_data_len);
+
+ /* Intel OUI */
+ radiotap->oui[0] = 0xf6;
+ radiotap->oui[1] = 0x54;
+ radiotap->oui[2] = 0x25;
+ /* Intel OUI default radiotap subtype */
+ radiotap->oui_subtype = 1;
+ /* PHY data element type */
+ radiotap->vendor_type = cpu_to_le16(1);
+
+ /* fill the data now */
+ memcpy(radiotap->data, ntfy, vendor_data_len);
+
+ rx_status->flag |= RX_FLAG_RADIOTAP_TLV_AT_END;
+}
+
static void
iwl_mld_set_rx_nonlegacy_rate_info(u32 rate_n_flags,
struct ieee80211_rx_status *rx_status)
}
}
#endif
+
+ if (phy_data->ntfy)
+ iwl_mld_add_rtap_sniffer_phy_data(mld, skb, phy_data->ntfy);
}
/* iwl_mld_create_skb adds the rxb to a new skb */
u32 mpdu_len;
enum iwl_mld_reorder_result reorder_res;
struct ieee80211_rx_status *rx_status;
+ unsigned int alloc_size = 128;
if (unlikely(mld->fw_status.in_hw_restart))
return;
/* Don't use dev_alloc_skb(), we'll have enough headroom once
* ieee80211_hdr pulled.
+ *
+ * For monitor mode we need more space to include the full PHY
+ * notification data.
*/
- skb = alloc_skb(128, GFP_ATOMIC);
+ if (unlikely(mld->monitor.on) && phy_data.ntfy)
+ alloc_size += sizeof(struct iwl_rx_phy_air_sniffer_ntfy);
+ skb = alloc_skb(alloc_size, GFP_ATOMIC);
if (!skb) {
IWL_ERR(mld, "alloc_skb failed\n");
return;
u32 format = phy_data.rate_n_flags & RATE_MCS_MOD_TYPE_MSK;
struct sk_buff *skb;
- skb = alloc_skb(128, GFP_ATOMIC);
+ skb = alloc_skb(128 + sizeof(struct iwl_rx_phy_air_sniffer_ntfy),
+ GFP_ATOMIC);
if (!skb)
return;