diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 9df5b95c7390..5d7633d710a3 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -570,8 +570,26 @@ struct hwsim_radiotap_hdr { __le64 rt_tsft; u8 rt_flags; u8 rt_rate; + + __le16 tlv0_pad; + + __le16 tlv0_type; + __le16 tlv0_datalen; __le16 rt_channel; __le16 rt_chbitmask; + + __le16 tlv1_type; + __le16 tlv1_datalen; + u8 tlv1_data[10]; + u8 tlv1_pad[2]; + + __le16 tlv2_type; + __le16 tlv2_datalen; + u8 tlv2_oui[3]; + u8 tlv2_subtype; + __le16 tlv2_item; + __le16 tlv2_pad; + u8 tlv2_data[10]; } __packed; struct hwsim_radiotap_ack_hdr { @@ -855,7 +873,7 @@ static void mac80211_hwsim_monitor_rx(struct ieee80211_hw *hw, hdr->hdr.it_present = cpu_to_le32((1 << IEEE80211_RADIOTAP_FLAGS) | (1 << IEEE80211_RADIOTAP_RATE) | (1 << IEEE80211_RADIOTAP_TSFT) | - (1 << IEEE80211_RADIOTAP_CHANNEL)); + (1 << 28)); hdr->rt_tsft = __mac80211_hwsim_get_tsf(data); hdr->rt_flags = 0; hdr->rt_rate = txrate->bitrate / 5; @@ -867,6 +885,24 @@ static void mac80211_hwsim_monitor_rx(struct ieee80211_hw *hw, flags |= IEEE80211_CHAN_CCK; hdr->rt_chbitmask = cpu_to_le16(flags); + hdr->tlv0_type = cpu_to_le16(IEEE80211_RADIOTAP_CHANNEL); + hdr->tlv0_datalen = 4; + hdr->tlv0_pad = cpu_to_le16(0xbbbb); + + hdr->tlv1_type = cpu_to_le16(45); + hdr->tlv1_datalen = cpu_to_le16(10); + memset(hdr->tlv1_data, 0x22, sizeof(hdr->tlv1_data)); + memset(hdr->tlv1_pad, 0xFF, sizeof(hdr->tlv1_pad)); + + hdr->tlv2_type = 30; + hdr->tlv2_datalen = 8 + 10; + hdr->tlv2_oui[0] = 0x11; + hdr->tlv2_oui[1] = 0x22; + hdr->tlv2_oui[2] = 0x33; + hdr->tlv2_subtype = 0x44; + hdr->tlv2_item = cpu_to_le16(0x55); + memset(hdr->tlv2_data, 0x22, sizeof(hdr->tlv2_data)); + skb->dev = hwsim_mon; skb_reset_mac_header(skb); skb->ip_summed = CHECKSUM_UNNECESSARY;