From 78dbffdf160b74abb1662666771ceb707a2d592b Mon Sep 17 00:00:00 2001 From: kimocoder Date: Sun, 7 Apr 2019 18:02:57 +0200 Subject: [PATCH] Fix radiotap header for RTL8814AU --- core/rtw_recv.c | 19 ++++++++++++------- hal/phydm/phydm_hwconfig.c | 8 ++++---- os_dep/linux/ioctl_cfg80211.c | 11 ++++++----- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/core/rtw_recv.c b/core/rtw_recv.c index ee51ced..4158f16 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -3964,6 +3964,12 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, rtap_hdr = (struct ieee80211_radiotap_header *)&hdr_buf[0]; 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.band_width & 0x03; +#endif + /* tsft */ if (pattrib->tsfl) { u64 tmp_64bit; @@ -4082,22 +4088,19 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, hdr_buf[rt_len] |= BIT1; /* MCS index known */ /* bandwidth */ -#ifdef CONFIG_RTL8814A - if(pattrib->physt) { - hdr_buf[rt_len] |= BIT0; - hdr_buf[rt_len+1] |= (pattrib->phy_info.band_width & 0x03); - } -#else hdr_buf[rt_len] |= BIT0; hdr_buf[rt_len + 1] |= (pattrib->bw & 0x03); -#endif /* guard interval */ +#ifndef CONFIG_RTL8814A hdr_buf[rt_len] |= BIT2; +#endif hdr_buf[rt_len + 1] |= (pattrib->sgi & 0x01) << 2; /* STBC */ +#ifndef CONFIG_RTL8814A hdr_buf[rt_len] |= BIT5; +#endif hdr_buf[rt_len + 1] |= (pattrib->stbc & 0x03) << 5; rt_len += 2; @@ -4132,7 +4135,9 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, hdr_buf[rt_len + 2] |= (pattrib->sgi & 0x01) << 2; /* LDPC extra OFDM symbol */ +#ifndef CONFIG_RTL8814A tmp_16bit |= BIT4; +#endif hdr_buf[rt_len + 2] |= (pattrib->ldpc & 0x01) << 4; memcpy(&hdr_buf[rt_len], &tmp_16bit, 2); diff --git a/hal/phydm/phydm_hwconfig.c b/hal/phydm/phydm_hwconfig.c index 69d3490..fd03fb3 100644 --- a/hal/phydm/phydm_hwconfig.c +++ b/hal/phydm/phydm_hwconfig.c @@ -299,13 +299,13 @@ odm_config_bb_with_header_file( /*if (p_dm->rfe_type == 0) READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type0); else if (dm->rfe_type == 2) - READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type2); + READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type2); else if (dm->rfe_type == 3) - READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type3); + READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type3); else if (dm->rfe_type == 4) - READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type4); + READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type4); else if (dm->rfe_type == 5) - READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type5); + READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type5); else if (dm->rfe_type == 7) READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type7); else if (dm->rfe_type == 8) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 738e3ea..e91d80c 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -3939,19 +3939,20 @@ int value; value = dbm; #endif -if(value < 0) +if (value < 0) value = 0; -if(value > 40) + +if (value > 40) value = 40; - if(type == NL80211_TX_POWER_FIXED) { + if (type == NL80211_TX_POWER_FIXED) { pHalData->CurrentTxPwrIdx = value; rtw_hal_set_tx_power_level(padapter, pHalData->current_channel); - } else + } else { return -EOPNOTSUPP; - + } return -EOPNOTSUPP; RTW_INFO("%s\n", __func__);