1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-26 07:04:12 +00:00

Report correct band in RX radiotap

This commit is contained in:
kimocoder 2020-02-01 07:17:49 +01:00
parent 19890f07a4
commit 658d3a5168

View File

@ -4103,16 +4103,25 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
tmp_16bit = 0;
rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_CHANNEL);
tmp_16bit = CHAN2FREQ(rtw_get_oper_ch(padapter));
/*tmp_16bit = CHAN2FREQ(pHalData->current_channel);*/
memcpy(&hdr_buf[rt_len], &tmp_16bit, 2);
rt_len += 2;
/* channel flags */
tmp_16bit = 0;
if (pHalData->current_band_type == 0)
if (pHalData->current_band_type == BAND_ON_2_4G) {
tmp_16bit = 0;
tmp_16bit |= cpu_to_le16(IEEE80211_CHAN_2GHZ);
else
} else if (pHalData->current_band_type == BAND_ON_5G) {
tmp_16bit = 0;
tmp_16bit |= cpu_to_le16(IEEE80211_CHAN_5GHZ);
} else {
if (tmp_16bit >= 5000) {
tmp_16bit = 0;
tmp_16bit |= cpu_to_le16(IEEE80211_CHAN_5GHZ);
} else {
tmp_16bit = 0;
tmp_16bit |= cpu_to_le16(IEEE80211_CHAN_2GHZ);
}
}
if (pattrib->data_rate <= DESC_RATE54M) {
if (pattrib->data_rate <= DESC_RATE11M) {
@ -4122,8 +4131,9 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
/* OFDM */
tmp_16bit |= cpu_to_le16(IEEE80211_CHAN_OFDM);
}
} else
} else {
tmp_16bit |= cpu_to_le16(IEEE80211_CHAN_DYN);
}
memcpy(&hdr_buf[rt_len], &tmp_16bit, 2);
rt_len += 2;