1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-29 00:17:41 +00:00

Fix radiotap header for RTL8814AU

This commit is contained in:
Sergei Makarenkov 2017-03-14 23:01:10 +03:00
parent c7ea94ab57
commit 40492f01c1
2 changed files with 20 additions and 11 deletions

View File

@ -4011,6 +4011,12 @@ 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;
#ifdef CONFIG_RTL8814A
/* RTL8814AU rx descriptor has no bandwidth, ldpc, stbc and sgi info */
/* fixup bandwidth */
pattrib->bw = pattrib->phy_info.BandWidth & 0x03;
#endif
if(pHalData->NumTotalRFPath>0 && pattrib->physt) { 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);
@ -4165,21 +4171,19 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe)
hdr_buf[rt_len] |= BIT1; /* MCS index known */ hdr_buf[rt_len] |= BIT1; /* MCS index known */
/* bandwidth */ /* bandwidth */
#ifdef CONFIG_RTL8814A
if(pattrib->physt) {
hdr_buf[rt_len] |= BIT0;
hdr_buf[rt_len+1] |= (pattrib->phy_info.BandWidth & 0x03);
}
#else
hdr_buf[rt_len] |= BIT0; hdr_buf[rt_len] |= BIT0;
hdr_buf[rt_len+1] |= (pattrib->bw & 0x03); hdr_buf[rt_len+1] |= (pattrib->bw & 0x03);
#endif
/* guard interval */ /* guard interval */
#ifndef CONFIG_RTL8814A
hdr_buf[rt_len] |= BIT2; hdr_buf[rt_len] |= BIT2;
#endif
hdr_buf[rt_len+1] |= (pattrib->sgi & 0x01) << 2; hdr_buf[rt_len+1] |= (pattrib->sgi & 0x01) << 2;
/* STBC */ /* STBC */
#ifndef CONFIG_RTL8814A
hdr_buf[rt_len] |= BIT5; hdr_buf[rt_len] |= BIT5;
#endif
hdr_buf[rt_len+1] |= (pattrib->stbc & 0x03) << 5; hdr_buf[rt_len+1] |= (pattrib->stbc & 0x03) << 5;
rt_len += 2; rt_len += 2;
@ -4206,15 +4210,21 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe)
tmp_16bit |= BIT8; tmp_16bit |= BIT8;
/* STBC */ /* STBC */
#ifndef CONFIG_RTL8814A
tmp_16bit |= BIT0; tmp_16bit |= BIT0;
#endif
hdr_buf[rt_len+2] |= (pattrib->stbc & 0x01); hdr_buf[rt_len+2] |= (pattrib->stbc & 0x01);
/* Guard interval */ /* Guard interval */
#ifndef CONFIG_RTL8814A
tmp_16bit |= BIT2; tmp_16bit |= BIT2;
#endif
hdr_buf[rt_len+2] |= (pattrib->sgi & 0x01) << 2; hdr_buf[rt_len+2] |= (pattrib->sgi & 0x01) << 2;
/* LDPC extra OFDM symbol */ /* LDPC extra OFDM symbol */
#ifndef CONFIG_RTL8814A
tmp_16bit |= BIT4; tmp_16bit |= BIT4;
#endif
hdr_buf[rt_len+2] |= (pattrib->ldpc & 0x01) << 4; hdr_buf[rt_len+2] |= (pattrib->ldpc & 0x01) << 4;
memcpy(&hdr_buf[rt_len], &tmp_16bit, 2); memcpy(&hdr_buf[rt_len], &tmp_16bit, 2);
@ -4328,7 +4338,6 @@ int recv_frame_monitor(_adapter *padapter, union recv_frame *rframe)
_queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue; _queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
_pkt *pskb = NULL; _pkt *pskb = NULL;
/* fill radiotap header */ /* fill radiotap header */
if (fill_radiotap_hdr(padapter, rframe) == _FAIL) { if (fill_radiotap_hdr(padapter, rframe) == _FAIL) {
ret = _FAIL; ret = _FAIL;

View File

@ -1170,7 +1170,7 @@ odm_RxPhyBWJaguarSeries_Parsing(
) )
{ {
if(pPktinfo->DataRate <= ODM_RATE54M) { if(pPktinfo->DataRate > ODM_RATE54M) {
switch (pPhyStaRpt->r_RFMOD) { switch (pPhyStaRpt->r_RFMOD) {
case 1: case 1:
if (pPhyStaRpt->sub_chnl == 0) if (pPhyStaRpt->sub_chnl == 0)
@ -1193,8 +1193,8 @@ odm_RxPhyBWJaguarSeries_Parsing(
pPhyInfo->BandWidth = 0; pPhyInfo->BandWidth = 0;
break; break;
} }
} } else
pPhyInfo->BandWidth = 0;
} }
VOID VOID