1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-09 23:57:00 +00:00

Only place signal strength into radiotap header if available

This commit is contained in:
kimocoder 2018-08-04 21:01:06 +02:00
parent 2ae015fb87
commit f1dce475a4

View File

@ -3676,7 +3676,7 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
rtap_hdr = (struct ieee80211_radiotap_header *)&hdr_buf[0]; rtap_hdr = (struct ieee80211_radiotap_header *)&hdr_buf[0];
rtap_hdr->it_version = PKTHDR_RADIOTAP_VERSION; rtap_hdr->it_version = PKTHDR_RADIOTAP_VERSION;
if(pHalData->NumTotalRFPath>0) { if(pHalData->NumTotalRFPath>0 && pattrib->physt) {
rtap_hdr->it_present |= (1<<IEEE80211_RADIOTAP_EXT) | rtap_hdr->it_present |= (1<<IEEE80211_RADIOTAP_EXT) |
(1<<IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE); (1<<IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE);
if(pHalData->NumTotalRFPath>1) { if(pHalData->NumTotalRFPath>1) {
@ -3776,10 +3776,11 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
memcpy(&hdr_buf[rt_len], &tmp_16bit, 2); memcpy(&hdr_buf[rt_len], &tmp_16bit, 2);
rt_len += 2; rt_len += 2;
/* dBm Antenna Signal */ if(pattrib->physt) {
rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL); /* dBm Antenna Signal */
hdr_buf[rt_len] = pattrib->phy_info.recv_signal_power; rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL);
rt_len += 1; hdr_buf[rt_len] = pattrib->phy_info.recv_signal_power;
rt_len += 1;
#if 0 #if 0
/* dBm Antenna Noise */ /* dBm Antenna Noise */
@ -3787,7 +3788,10 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
hdr_buf[rt_len] = 0; hdr_buf[rt_len] = 0;
rt_len += 1; rt_len += 1;
#endif #endif
rt_len++; // alignment
rt_len++; // alignment
}
/* Signal Quality */ /* Signal Quality */
rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_LOCK_QUALITY); rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_LOCK_QUALITY);
tmp_16bit = cpu_to_le16(pattrib->phy_info.signal_quality); tmp_16bit = cpu_to_le16(pattrib->phy_info.signal_quality);
@ -3906,11 +3910,13 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
rt_len += 2; rt_len += 2;
} }
for(i=0; i<pHalData->NumTotalRFPath; i++) { if (pattrib->physt) {
hdr_buf[rt_len] = pattrib->phy_info.rx_pwr[i]; for(i=0; i<pHalData->NumTotalRFPath; i++) {
rt_len ++; hdr_buf[rt_len] = pattrib->phy_info.rx_pwr[i];
hdr_buf[rt_len] = i; rt_len ++;
rt_len ++; hdr_buf[rt_len] = i;
rt_len ++;
}
} }
/* push to skb */ /* push to skb */