From 86edaffd71580c856d2af994a66e0f30e79b426c Mon Sep 17 00:00:00 2001 From: kimocoder Date: Wed, 19 Dec 2018 17:59:51 +0100 Subject: [PATCH] Fixed frame injection by @svpcom + possible VHT fix --- Makefile | 2 +- core/rtw_mlme_ext.c | 4 +-- dkms.conf | 2 +- hal/rtl8812a/usb/rtl8812au_xmit.c | 54 ++++++++++++++++--------------- hal/rtl8814a/usb/rtl8814au_xmit.c | 52 +++++++++++++++-------------- 5 files changed, 59 insertions(+), 55 deletions(-) diff --git a/Makefile b/Makefile index 5bfa307..551a90e 100755 --- a/Makefile +++ b/Makefile @@ -112,7 +112,7 @@ CONFIG_AP_WOWLAN = n ######### Notify SDIO Host Keep Power During Syspend ########## CONFIG_RTW_SDIO_PM_KEEP_POWER = y ###################### MP HW TX MODE FOR VHT ####################### -CONFIG_MP_VHT_HW_TX_MODE = y +CONFIG_MP_VHT_HW_TX_MODE = n ###################### Platform Related ####################### CONFIG_PLATFORM_I386_PC = y CONFIG_PLATFORM_ARM_RPI = n diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 41c4395..367fa5b 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -11844,8 +11844,8 @@ static void rtw_mlmeext_disconnect(_adapter *padapter) self_action = MLME_ADHOC_STOPPED; else if (MLME_IS_NULL(padapter)) self_action = MLME_ACTION_NONE; - else - rtw_warn_on(1); + //else + // rtw_warn_on(1); /* set_opmode_cmd(padapter, infra_client_with_mlme); */ diff --git a/dkms.conf b/dkms.conf index 281f073..f2d53b4 100644 --- a/dkms.conf +++ b/dkms.conf @@ -1,5 +1,5 @@ PACKAGE_NAME="realtek-rtl88xxau" -PACKAGE_VERSION="5.2.20.2~20181213" +PACKAGE_VERSION="5.2.20.2~20181219" CLEAN="'make' clean" BUILT_MODULE_NAME[0]=88XXau PROCS_NUM=`nproc` diff --git a/hal/rtl8812a/usb/rtl8812au_xmit.c b/hal/rtl8812a/usb/rtl8812au_xmit.c index 0a743de..d3327f7 100644 --- a/hal/rtl8812a/usb/rtl8812au_xmit.c +++ b/hal/rtl8812a/usb/rtl8812au_xmit.c @@ -118,7 +118,34 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz , u8 ba } else SET_TX_DESC_SEQ_8812(ptxdesc, pattrib->seqnum); - if ((pxmitframe->frame_tag & 0x0f) == DATA_FRAMETAG) { + /* injected frame */ + if(pattrib->inject == 0xa5) { + SET_TX_DESC_RETRY_LIMIT_ENABLE_8812(ptxdesc, 1); + if (pattrib->retry_ctrl == _TRUE) { + SET_TX_DESC_DATA_RETRY_LIMIT_8812(ptxdesc, 6); + } else { + SET_TX_DESC_DATA_RETRY_LIMIT_8812(ptxdesc, 0); + } + if(pattrib->sgi == _TRUE) { + SET_TX_DESC_DATA_SHORT_8812(ptxdesc, 1); + } else { + SET_TX_DESC_DATA_SHORT_8812(ptxdesc, 0); + } + + SET_TX_DESC_DISABLE_FB_8812(ptxdesc, 1); // svpcom: ? + SET_TX_DESC_USE_RATE_8812(ptxdesc, 1); + SET_TX_DESC_TX_RATE_8812(ptxdesc, MRateToHwRate(pattrib->rate)); + + if (pattrib->ldpc) + SET_TX_DESC_DATA_LDPC_8812(ptxdesc, 1); + SET_TX_DESC_DATA_STBC_8812(ptxdesc, pattrib->stbc & 3); + //SET_TX_DESC_GF_8812(ptxdesc, 1); // no MCS rates if sets, GreenField? + //SET_TX_DESC_LSIG_TXOP_EN_8812(ptxdesc, 1); + //SET_TX_DESC_HTC_8812(ptxdesc, 1); + //SET_TX_DESC_NO_ACM_8812(ptxdesc, 1); + SET_TX_DESC_DATA_BW_8812(ptxdesc, pattrib->bwmode); // 0 - 20 MHz, 1 - 40 MHz, 2 - 80 MHz + + } else if ((pxmitframe->frame_tag & 0x0f) == DATA_FRAMETAG) { /* RTW_INFO("pxmitframe->frame_tag == DATA_FRAMETAG\n"); */ rtl8812a_fill_txdesc_sectype(pattrib, ptxdesc); @@ -326,31 +353,6 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz , u8 ba SET_TX_DESC_GID_8812(ptxdesc, pattrib->txbf_g_id); SET_TX_DESC_PAID_8812(ptxdesc, pattrib->txbf_p_aid); #endif -/* injected frame */ - if(pattrib->inject == 0xa5) { - SET_TX_DESC_RETRY_LIMIT_ENABLE_8812(ptxdesc, 1); - if (pattrib->retry_ctrl == _TRUE) { - SET_TX_DESC_DATA_RETRY_LIMIT_8812(ptxdesc, 6); - } else { - SET_TX_DESC_DATA_RETRY_LIMIT_8812(ptxdesc, 0); - } - if(pattrib->sgi == _TRUE) { - SET_TX_DESC_DATA_SHORT_8812(ptxdesc, 1); - } else { - SET_TX_DESC_DATA_SHORT_8812(ptxdesc, 0); - } - SET_TX_DESC_USE_RATE_8812(ptxdesc, 1); - SET_TX_DESC_TX_RATE_8812(ptxdesc, MRateToHwRate(pattrib->rate)); - if (pattrib->ldpc) - SET_TX_DESC_DATA_LDPC_8812(ptxdesc, 1); - SET_TX_DESC_DATA_STBC_8812(ptxdesc, pattrib->stbc & 3); - //SET_TX_DESC_GF_8812(ptxdesc, 1); // no MCS rates if sets, GreenField? - //SET_TX_DESC_LSIG_TXOP_EN_8812(ptxdesc, 1); - //SET_TX_DESC_HTC_8812(ptxdesc, 1); - //SET_TX_DESC_NO_ACM_8812(ptxdesc, 1); - SET_TX_DESC_DATA_BW_8812(ptxdesc, pattrib->bwmode); // 0 - 20 MHz, 1 - 40 MHz, 2 - 80 MHz - } - rtl8812a_cal_txdesc_chksum(ptxdesc); _dbg_dump_tx_info(padapter, pxmitframe->frame_tag, ptxdesc); return pull; diff --git a/hal/rtl8814a/usb/rtl8814au_xmit.c b/hal/rtl8814a/usb/rtl8814au_xmit.c index 68b3121..be88b81 100644 --- a/hal/rtl8814a/usb/rtl8814au_xmit.c +++ b/hal/rtl8814a/usb/rtl8814au_xmit.c @@ -125,7 +125,33 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag SET_TX_DESC_SEQ_8814A(ptxdesc, pattrib->seqnum); } - if((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG) + /* injected frame */ + if(pattrib->inject == 0xa5) { + SET_TX_DESC_RETRY_LIMIT_ENABLE_8814A(ptxdesc, 1); + if (pattrib->retry_ctrl == _TRUE) { + SET_TX_DESC_DATA_RETRY_LIMIT_8814A(ptxdesc, 6); + } else { + SET_TX_DESC_DATA_RETRY_LIMIT_8814A(ptxdesc, 0); + } + if(pattrib->sgi == _TRUE) { + SET_TX_DESC_DATA_SHORT_8814A(ptxdesc, 1); + } else { + SET_TX_DESC_DATA_SHORT_8814A(ptxdesc, 0); + } + + DriverFixedRate = 0x01; + SET_TX_DESC_DISABLE_FB_8814A(ptxdesc, 1); // svpcom: ? + SET_TX_DESC_USE_RATE_8814A(ptxdesc, 1); + SET_TX_DESC_TX_RATE_8814A(ptxdesc, MRateToHwRate(pattrib->rate)); + if (pattrib->ldpc) { + SET_TX_DESC_DATA_LDPC_8814A(ptxdesc, 1); + } else { + SET_TX_DESC_DATA_LDPC_8814A(ptxdesc, 0); + } + SET_TX_DESC_DATA_STBC_8814A(ptxdesc, pattrib->stbc & 3); + SET_TX_DESC_DATA_BW_8814A(ptxdesc, pattrib->bwmode); // 0 - 20 MHz, 1 - 40 MHz, 2 - 80 MHz + } + else if((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG) { //RTW_INFO("pxmitframe->frame_tag == DATA_FRAMETAG\n"); @@ -310,30 +336,6 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag SET_TX_DESC_GID_8814A(ptxdesc, pattrib->txbf_g_id); SET_TX_DESC_PAID_8814A(ptxdesc, pattrib->txbf_p_aid); -/* injected frame */ - if(pattrib->inject == 0xa5) { - SET_TX_DESC_RETRY_LIMIT_ENABLE_8814A(ptxdesc, 1); - if (pattrib->retry_ctrl == _TRUE) { - SET_TX_DESC_DATA_RETRY_LIMIT_8814A(ptxdesc, 6); - } else { - SET_TX_DESC_DATA_RETRY_LIMIT_8814A(ptxdesc, 0); - } - if(pattrib->sgi == _TRUE) { - SET_TX_DESC_DATA_SHORT_8814A(ptxdesc, 1); - } else { - SET_TX_DESC_DATA_SHORT_8814A(ptxdesc, 0); - } - SET_TX_DESC_USE_RATE_8814A(ptxdesc, 1); - SET_TX_DESC_TX_RATE_8814A(ptxdesc, MRateToHwRate(pattrib->rate)); - if (pattrib->ldpc) { - SET_TX_DESC_DATA_LDPC_8814A(ptxdesc, 1); - } else { - SET_TX_DESC_DATA_LDPC_8814A(ptxdesc, 0); - } - SET_TX_DESC_DATA_STBC_8814A(ptxdesc, pattrib->stbc & 3); - SET_TX_DESC_DATA_BW_8814A(ptxdesc, pattrib->bwmode); // 0 - 20 MHz, 1 - 40 MHz, 2 - 80 MHz - } - rtl8814a_cal_txdesc_chksum(ptxdesc); _dbg_dump_tx_info(padapter,pxmitframe->frame_tag,ptxdesc); return pull;