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

Fix FCS on 8812 and 8814

This commit is contained in:
kimocoder 2019-11-13 21:16:57 +01:00
parent d867a451d3
commit 10bb71aafb
2 changed files with 21 additions and 24 deletions

View File

@ -17,13 +17,6 @@
#include <drv_types.h> #include <drv_types.h>
#include <hal_data.h> #include <hal_data.h>
#if defined(PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
#error "Shall be Linux or Windows, but not both!\n"
#endif
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
static void rtw_signal_stat_timer_hdl(void *ctx); static void rtw_signal_stat_timer_hdl(void *ctx);
@ -4048,9 +4041,15 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
if (pattrib->mfrag) if (pattrib->mfrag)
hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_FRAG; hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_FRAG;
/* always append FCS */ #ifdef CONFIG_RX_PACKET_APPEND_FCS
hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_FCS; // Start by always indicating FCS is there:
hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_FCS;
// Next, test for prior conditions that will remove FCS, and update flag accordingly:
if(check_fwstate(&padapter->mlmepriv,WIFI_MONITOR_STATE) == _FALSE)
if((pattrib->pkt_rpt_type == NORMAL_RX) && (pHalData->ReceiveConfig & RCR_APPFCS))
hdr_buf[rt_len] &= ~IEEE80211_RADIOTAP_F_FCS;
#endif
if (0) if (0)
hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_DATAPAD; hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_DATAPAD;

View File

@ -46,7 +46,6 @@ void interrupt_handler_8814au(_adapter *padapter, u16 pkt_len, u8 *pbuf)
} }
#endif #endif
#ifdef CONFIG_LPS_LCLK #ifdef CONFIG_LPS_LCLK
if (pHalData->IntArray[0] & IMR_CPWM_88E) { if (pHalData->IntArray[0] & IMR_CPWM_88E) {
_rtw_memcpy(&pwr_rpt.state, &(pbuf[USB_INTR_CONTENT_CPWM1_OFFSET]), 1); _rtw_memcpy(&pwr_rpt.state, &(pbuf[USB_INTR_CONTENT_CPWM1_OFFSET]), 1);
@ -76,7 +75,6 @@ void interrupt_handler_8814au(_adapter *padapter, u16 pkt_len, u8 *pbuf)
if (pHalData->IntArray[0] & IMR_TBDER_88E) if (pHalData->IntArray[0] & IMR_TBDER_88E)
RTW_INFO("%s: HISR_TXBCNERR\n", __func__); RTW_INFO("%s: HISR_TXBCNERR\n", __func__);
#endif /* 0 */ #endif /* 0 */
if(check_fwstate(pmlmepriv, WIFI_AP_STATE)) if(check_fwstate(pmlmepriv, WIFI_AP_STATE))
{ {
@ -184,8 +182,9 @@ int recvbuf2recvframe(PADAPTER padapter, void *ptr)
} }
#ifdef CONFIG_RX_PACKET_APPEND_FCS #ifdef CONFIG_RX_PACKET_APPEND_FCS
if(pattrib->pkt_rpt_type == NORMAL_RX) if (check_fwstate(&padapter->mlmepriv, WIFI_MONITOR_STATE) == _FALSE)
pattrib->pkt_len -= IEEE80211_FCS_LEN; if ((pattrib->pkt_rpt_type == NORMAL_RX) && (pHalData->ReceiveConfig & RCR_APPFCS))
pattrib->pkt_len -= IEEE80211_FCS_LEN;
#endif #endif
if (rtw_os_alloc_recvframe(padapter, precvframe, if (rtw_os_alloc_recvframe(padapter, precvframe,
(pbuf + pattrib->shift_sz + pattrib->drvinfo_sz + RXDESC_SIZE), pskb) == _FAIL) { (pbuf + pattrib->shift_sz + pattrib->drvinfo_sz + RXDESC_SIZE), pskb) == _FAIL) {
@ -249,7 +248,7 @@ _exit_recvbuf2recvframe:
#endif #endif
void rtl8814au_xmit_tasklet(void *priv) void rtl8814au_xmit_tasklet(void *priv)
{ {
int ret = _FALSE; int ret = _FALSE;
_adapter *padapter = (_adapter*)priv; _adapter *padapter = (_adapter*)priv;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
@ -269,31 +268,31 @@ void rtl8814au_xmit_tasklet(void *priv)
if(ret==_FALSE) if(ret==_FALSE)
break; break;
} }
} }
void rtl8814au_set_intf_ops(struct _io_ops *pops) void rtl8814au_set_intf_ops(struct _io_ops *pops)
{ {
_rtw_memset((u8 *)pops, 0, sizeof(struct _io_ops)); _rtw_memset((u8 *)pops, 0, sizeof(struct _io_ops));
pops->_read8 = &usb_read8; pops->_read8 = &usb_read8;
pops->_read16 = &usb_read16; pops->_read16 = &usb_read16;
pops->_read32 = &usb_read32; pops->_read32 = &usb_read32;
pops->_read_mem = &usb_read_mem; pops->_read_mem = &usb_read_mem;
pops->_read_port = &usb_read_port; pops->_read_port = &usb_read_port;
pops->_write8 = &usb_write8; pops->_write8 = &usb_write8;
pops->_write16 = &usb_write16; pops->_write16 = &usb_write16;
pops->_write32 = &usb_write32; pops->_write32 = &usb_write32;
pops->_writeN = &usb_writeN; pops->_writeN = &usb_writeN;
#ifdef CONFIG_USB_SUPPORT_ASYNC_VDN_REQ #ifdef CONFIG_USB_SUPPORT_ASYNC_VDN_REQ
pops->_write8_async= &usb_async_write8; pops->_write8_async= &usb_async_write8;
pops->_write16_async = &usb_async_write16; pops->_write16_async = &usb_async_write16;
pops->_write32_async = &usb_async_write32; pops->_write32_async = &usb_async_write32;
#endif #endif
pops->_write_mem = &usb_write_mem; pops->_write_mem = &usb_write_mem;
pops->_write_port = &usb_write_port; pops->_write_port = &usb_write_port;
@ -311,4 +310,3 @@ void rtl8814au_set_hw_type(struct dvobj_priv *pdvobj)
pdvobj->HardwareType = HARDWARE_TYPE_RTL8814AU; pdvobj->HardwareType = HARDWARE_TYPE_RTL8814AU;
RTW_INFO("CHIP TYPE: RTL8814\n"); RTW_INFO("CHIP TYPE: RTL8814\n");
} }