rtl8723ds: Fix builds for kernel 4.14

Signed-off-by: Alexander Kaplan <alex@nextthing.co>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2017-10-14 09:31:11 -05:00
parent e87533e664
commit eb9c1aa49f
17 changed files with 420 additions and 421 deletions

View File

@ -4638,6 +4638,4 @@ void rtw_getrttbl_cmd_cmdrsp_callback(_adapter *padapter, struct cmd_obj *pcmd)
if (padapter->registrypriv.mp_mode == 1) if (padapter->registrypriv.mp_mode == 1)
padapter->mppriv.workparam.bcompleted = _TRUE; padapter->mppriv.workparam.bcompleted = _TRUE;
#endif #endif
} }

View File

@ -1067,7 +1067,7 @@ _adapter *rtw_get_iface_by_id(_adapter *padapter, u8 iface_id)
_adapter *iface = NULL; _adapter *iface = NULL;
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
if ((padapter == NULL) || (iface_id >= CONFIG_IFACE_NUMBER)) { if (iface_id >= CONFIG_IFACE_NUMBER) {
rtw_warn_on(1); rtw_warn_on(1);
return iface; return iface;
} }

View File

@ -2142,6 +2142,7 @@ void rtw_sta_media_status_rpt(_adapter *adapter, struct sta_info *sta, bool conn
role = H2C_MSR_ROLE_TDLS; role = H2C_MSR_ROLE_TDLS;
else else
#endif #endif
{
if (MLME_IS_STA(adapter)) { if (MLME_IS_STA(adapter)) {
if (MLME_IS_GC(adapter)) if (MLME_IS_GC(adapter))
role = H2C_MSR_ROLE_GO; role = H2C_MSR_ROLE_GO;
@ -2156,13 +2157,11 @@ void rtw_sta_media_status_rpt(_adapter *adapter, struct sta_info *sta, bool conn
role = H2C_MSR_ROLE_ADHOC; role = H2C_MSR_ROLE_ADHOC;
#ifdef CONFIG_WFD #ifdef CONFIG_WFD
if (role == H2C_MSR_ROLE_GC if (role == H2C_MSR_ROLE_GC || role == H2C_MSR_ROLE_GO ||
|| role == H2C_MSR_ROLE_GO role == H2C_MSR_ROLE_TDLS) {
|| role == H2C_MSR_ROLE_TDLS if (adapter->wfd_info.rtsp_ctrlport ||
) { adapter->wfd_info.tdls_rtsp_ctrlport ||
if (adapter->wfd_info.rtsp_ctrlport adapter->wfd_info.peer_rtsp_ctrlport)
|| adapter->wfd_info.tdls_rtsp_ctrlport
|| adapter->wfd_info.peer_rtsp_ctrlport)
rtw_wfd_st_switch(sta, 1); rtw_wfd_st_switch(sta, 1);
} }
#endif #endif
@ -2176,6 +2175,7 @@ void rtw_sta_media_status_rpt(_adapter *adapter, struct sta_info *sta, bool conn
, sta->mac_id , sta->mac_id
); );
} }
}
u8 rtw_sta_media_status_rpt_cmd(_adapter *adapter, struct sta_info *sta, bool connected) u8 rtw_sta_media_status_rpt_cmd(_adapter *adapter, struct sta_info *sta, bool connected)
{ {

View File

@ -2042,10 +2042,12 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
RTW_PUT_BE16(p2pie + p2pielen, pmlmepriv->p2p_sdt_scid[i]); RTW_PUT_BE16(p2pie + p2pielen, pmlmepriv->p2p_sdt_scid[i]);
p2pielen += 2; p2pielen += 2;
} }
} else } else {
#endif /* CONFIG_INTEL_WIDI */ #endif /* CONFIG_INTEL_WIDI */
p2pie[p2pielen++] = 0x00; /* No Secondary Device Type List */ p2pie[p2pielen++] = 0x00; /* No Secondary Device Type List */
#ifdef CONFIG_INTEL_WIDI
}
#endif
/* Device Name */ /* Device Name */
/* Type: */ /* Type: */
/* *(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); */ /* *(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); */

View File

@ -3216,7 +3216,7 @@ void rtw_reordering_ctrl_timeout_handler(void *pcontext)
_enter_critical_bh(&ppending_recvframe_queue->lock, &irql); _enter_critical_bh(&ppending_recvframe_queue->lock, &irql);
if (preorder_ctrl) // if (preorder_ctrl)
preorder_ctrl->bReorderWaiting = _FALSE; preorder_ctrl->bReorderWaiting = _FALSE;
if (recv_indicatepkts_in_order(padapter, preorder_ctrl, _TRUE) == _TRUE) if (recv_indicatepkts_in_order(padapter, preorder_ctrl, _TRUE) == _TRUE)

View File

@ -4673,7 +4673,11 @@ int rtw_dev_nlo_info_set(struct pno_nlo_info *nlo_info, pno_ssid_t *ssid,
source = rtw_zmalloc(2048); source = rtw_zmalloc(2048);
if (source != NULL) { if (source != NULL) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
len = kernel_read(fp, source, len, &pos);
#else
len = vfs_read(fp, source, len, &pos); len = vfs_read(fp, source, len, &pos);
#endif
rtw_parse_cipher_list(nlo_info, source); rtw_parse_cipher_list(nlo_info, source);
rtw_mfree(source, 2048); rtw_mfree(source, 2048);
} }

View File

@ -3833,7 +3833,8 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
struct ieee80211_radiotap_header *rtap_hdr; struct ieee80211_radiotap_header *rtap_hdr;
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev); _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
if (skb) if (!skb)
return 1;
rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize); rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize);
if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header))) if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header)))

View File

@ -58,13 +58,11 @@
/* Tx Power Tracking*/ /* Tx Power Tracking*/
void setIqkMatrix_8723D( void setIqkMatrix_8723D(PDM_ODM_T pDM_Odm,
PDM_ODM_T pDM_Odm,
u1Byte OFDM_index, u1Byte OFDM_index,
u1Byte RFPath, u1Byte RFPath,
s4Byte IqkResult_X, s4Byte IqkResult_X,
s4Byte IqkResult_Y s4Byte IqkResult_Y)
)
{ {
s4Byte ele_A = 0, ele_D = 0, ele_C = 0, value32, tmp; s4Byte ele_A = 0, ele_D = 0, ele_C = 0, value32, tmp;
s4Byte ele_A_ext = 0, ele_C_ext = 0, ele_D_ext = 0; s4Byte ele_A_ext = 0, ele_C_ext = 0, ele_D_ext = 0;
@ -75,7 +73,6 @@ void setIqkMatrix_8723D(
OFDM_index = 0; OFDM_index = 0;
if ((IqkResult_X != 0) && (*(pDM_Odm->pBandType) == ODM_BAND_2_4G)) { if ((IqkResult_X != 0) && (*(pDM_Odm->pBandType) == ODM_BAND_2_4G)) {
/* new element D */ /* new element D */
ele_D = (OFDMSwingTable_New[OFDM_index] & 0xFFC00000)>>22; ele_D = (OFDMSwingTable_New[OFDM_index] & 0xFFC00000)>>22;
ele_D_ext = (((IqkResult_X * ele_D)>>7)&0x01); ele_D_ext = (((IqkResult_X * ele_D)>>7)&0x01);
@ -104,7 +101,6 @@ void setIqkMatrix_8723D(
value32 = (ODM_GetBBReg(pDM_Odm, rOFDM0_ECCAThreshold, bMaskDWord)&(~(BIT31|BIT29|BIT28))) | value32; value32 = (ODM_GetBBReg(pDM_Odm, rOFDM0_ECCAThreshold, bMaskDWord)&(~(BIT31|BIT29|BIT28))) | value32;
ODM_SetBBReg(pDM_Odm, rOFDM0_ECCAThreshold, bMaskDWord, value32); ODM_SetBBReg(pDM_Odm, rOFDM0_ECCAThreshold, bMaskDWord, value32);
break; break;
case ODM_RF_PATH_B: case ODM_RF_PATH_B:
/*wirte new elements A, C, D to regCd0 and regCd4, element B is always 0*/ /*wirte new elements A, C, D to regCd0 and regCd4, element B is always 0*/
value32 = ele_D; value32 = ele_D;
@ -131,7 +127,6 @@ void setIqkMatrix_8723D(
value32 = ODM_GetBBReg(pDM_Odm, rOFDM0_ECCAThreshold, bMaskDWord)&(~(BIT31|BIT29|BIT28)); value32 = ODM_GetBBReg(pDM_Odm, rOFDM0_ECCAThreshold, bMaskDWord)&(~(BIT31|BIT29|BIT28));
ODM_SetBBReg(pDM_Odm, rOFDM0_ECCAThreshold, bMaskDWord, value32); ODM_SetBBReg(pDM_Odm, rOFDM0_ECCAThreshold, bMaskDWord, value32);
break; break;
case ODM_RF_PATH_B: case ODM_RF_PATH_B:
/*image S1:c80 to S0:Cd0 and Cd4*/ /*image S1:c80 to S0:Cd0 and Cd4*/
ODM_SetBBReg(pDM_Odm, 0xcd0, 0x000007FE, OFDMSwingTable_New[OFDM_index]&0x000003FF); ODM_SetBBReg(pDM_Odm, 0xcd0, 0x000007FE, OFDMSwingTable_New[OFDM_index]&0x000003FF);
@ -149,8 +144,13 @@ void setIqkMatrix_8723D(
break; break;
} }
} }
ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, ("TxPwrTracking path %c: X = 0x%x, Y = 0x%x ele_A = 0x%x ele_C = 0x%x ele_D = 0x%x ele_A_ext = 0x%x ele_C_ext = 0x%x ele_D_ext = 0x%x\n", ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
(RFPath == ODM_RF_PATH_A ? 'A' : 'B'), (u4Byte)IqkResult_X, (u4Byte)IqkResult_Y, (u4Byte)ele_A, (u4Byte)ele_C, (u4Byte)ele_D, (u4Byte)ele_A_ext, (u4Byte)ele_C_ext, (u4Byte)ele_D_ext)); ("TxPwrTracking path %c: X = 0x%x, Y = 0x%x ele_A = 0x%x ele_C = 0x%x ele_D = 0x%x ele_A_ext = 0x%x ele_C_ext = 0x%x ele_D_ext = 0x%x\n",
(RFPath == ODM_RF_PATH_A ? 'A' : 'B'),
(u4Byte)IqkResult_X, (u4Byte)IqkResult_Y,
(u4Byte)ele_A, (u4Byte)ele_C, (u4Byte)ele_D,
(u4Byte)ele_A_ext, (u4Byte)ele_C_ext,
(u4Byte)ele_D_ext));
} }
VOID VOID
@ -530,11 +530,6 @@ ODM_TxPwrTrackSetPwr_8723D(
ODM_SetBBReg(pDM_Odm, 0xab4, 0x000007FF, CCKSwingTable_Ch1_Ch14_8723D[PwrTrackingLimit_CCK]); ODM_SetBBReg(pDM_Odm, 0xab4, 0x000007FF, CCKSwingTable_Ch1_Ch14_8723D[PwrTrackingLimit_CCK]);
pRFCalibrateInfo->Modify_TxAGC_Flag_PathA_CCK = TRUE; pRFCalibrateInfo->Modify_TxAGC_Flag_PathA_CCK = TRUE;
/*Set TxAGC Page C{};*/
/* PHY_SetTxPowerIndexByRateSection(Adapter, ODM_RF_PATH_A, pHalData->CurrentChannel, CCK);
PHY_SetTxPowerIndexByRateSection(Adapter, ODM_RF_PATH_B, pHalData->CurrentChannel, CCK);*/
} else if (Final_CCK_Swing_Index < 0) { } else if (Final_CCK_Swing_Index < 0) {
pRFCalibrateInfo->Remnant_CCKSwingIdx = Final_CCK_Swing_Index; pRFCalibrateInfo->Remnant_CCKSwingIdx = Final_CCK_Swing_Index;
@ -1343,7 +1338,6 @@ phy_PathS0_IQK_8723D(
if (!(regEAC_S0 & BIT28) && if (!(regEAC_S0 & BIT28) &&
(((regE94_S0 & 0x03FF0000)>>16) != 0x142) && (((regE94_S0 & 0x03FF0000)>>16) != 0x142) &&
(((regE9C_S0 & 0x03FF0000)>>16) != 0x42)) (((regE9C_S0 & 0x03FF0000)>>16) != 0x42))
result |= 0x01; result |= 0x01;
else else
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("S0 TXIQK FAIL\n")); ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("S0 TXIQK FAIL\n"));
@ -1351,8 +1345,6 @@ phy_PathS0_IQK_8723D(
return result; return result;
} }
u1Byte u1Byte
phy_PathS0_RxIQK_8723D( phy_PathS0_RxIQK_8723D(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP) #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
@ -1468,10 +1460,9 @@ phy_PathS0_RxIQK_8723D(
if (!(regEAC_S0 & BIT28) && if (!(regEAC_S0 & BIT28) &&
(((regE94_S0 & 0x03FF0000)>>16) != 0x142) && (((regE94_S0 & 0x03FF0000)>>16) != 0x142) &&
(((regE9C_S0 & 0x03FF0000)>>16) != 0x42)) (((regE9C_S0 & 0x03FF0000)>>16) != 0x42)) {
result |= 0x01; result |= 0x01;
else { } else {
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("S0 RXIQK STEP1 FAIL\n")); ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("S0 RXIQK STEP1 FAIL\n"));
#if 1 #if 1
/*Restore GNT_WL/GNT_BT and Path owner*/ /*Restore GNT_WL/GNT_BT and Path owner*/
@ -2126,7 +2117,6 @@ phy_SimularityCompare_8723D(
SimularityBitMap = 0; SimularityBitMap = 0;
for (i = 0; i < bound; i++) { for (i = 0; i < bound; i++) {
if ((i == 1) || (i == 3) || (i == 5) || (i == 7)) { if ((i == 1) || (i == 3) || (i == 5) || (i == 7)) {
if ((result[c1][i] & 0x00000200) != 0) if ((result[c1][i] & 0x00000200) != 0)
tmp1 = result[c1][i] | 0xFFFFFC00; tmp1 = result[c1][i] | 0xFFFFFC00;
@ -2154,10 +2144,11 @@ phy_SimularityCompare_8723D(
final_candidate[(i/4)] = c1; final_candidate[(i/4)] = c1;
else else
SimularityBitMap = SimularityBitMap|(1<<i); SimularityBitMap = SimularityBitMap|(1<<i);
} else } else {
SimularityBitMap = SimularityBitMap|(1<<i); SimularityBitMap = SimularityBitMap|(1<<i);
} }
} }
}
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK:phy_SimularityCompare_8723D SimularityBitMap %x !!!\n", SimularityBitMap)); ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK:phy_SimularityCompare_8723D SimularityBitMap %x !!!\n", SimularityBitMap));
@ -2171,7 +2162,6 @@ phy_SimularityCompare_8723D(
} }
return bResult; return bResult;
} else { } else {
if (!(SimularityBitMap & 0x03)) { if (!(SimularityBitMap & 0x03)) {
for(i = 0; i < 2; i++) for(i = 0; i < 2; i++)
result[3][i] = result[c1][i]; result[3][i] = result[c1][i];
@ -2185,7 +2175,6 @@ phy_SimularityCompare_8723D(
if (!(SimularityBitMap & 0x30)) { if (!(SimularityBitMap & 0x30)) {
for(i = 4; i < 6; i++) for(i = 4; i < 6; i++)
result[3][i] = result[c1][i]; result[3][i] = result[c1][i];
} }
if (!(SimularityBitMap & 0xc0)) { if (!(SimularityBitMap & 0xc0)) {
@ -2195,13 +2184,8 @@ phy_SimularityCompare_8723D(
return FALSE; return FALSE;
} }
} }
VOID VOID
phy_IQCalibrate_8723D( phy_IQCalibrate_8723D(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP) #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
@ -2328,21 +2312,17 @@ phy_IQCalibrate_8723D(
ODM_SetBBReg(pDM_Odm, rRx_IQK, bMaskDWord, 0x01004800); ODM_SetBBReg(pDM_Odm, rRx_IQK, bMaskDWord, 0x01004800);
if (is2T) { if (is2T) {
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP) #if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
_PHY_PathBStandBy_8723D(pAdapter); _PHY_PathBStandBy_8723D(pAdapter);
_PHY_PathADDAOn_8723D(pAdapter, ADDA_REG, FALSE, is2T); _PHY_PathADDAOn_8723D(pAdapter, ADDA_REG, FALSE, is2T);
#else #else
_PHY_PathBStandBy_8723D(pDM_Odm); _PHY_PathBStandBy_8723D(pDM_Odm);
_PHY_PathADDAOn_8723D(pDM_Odm, ADDA_REG, FALSE, is2T); _PHY_PathADDAOn_8723D(pDM_Odm, ADDA_REG, FALSE, is2T);
#endif #endif
} }
#if 1 #if 1
for (i = 0 ; i < retryCount ; i++) { for (i = 0 ; i < retryCount ; i++) {
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP) #if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
@ -2521,8 +2501,6 @@ for (i = 0 ; i < retryCount ; i++) {
ODM_SetBBReg(pDM_Odm, rTx_IQK_Tone_A, bMaskDWord, 0x01008c00); ODM_SetBBReg(pDM_Odm, rTx_IQK_Tone_A, bMaskDWord, 0x01008c00);
ODM_SetBBReg(pDM_Odm, rRx_IQK_Tone_A, bMaskDWord, 0x01008c00); ODM_SetBBReg(pDM_Odm, rRx_IQK_Tone_A, bMaskDWord, 0x01008c00);
} }
pDM_Odm->nIQK_Cnt++; pDM_Odm->nIQK_Cnt++;
@ -2534,10 +2512,8 @@ for (i = 0 ; i < retryCount ; i++) {
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("phy_IQCalibrate_8723D() <==\n")); ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("phy_IQCalibrate_8723D() <==\n"));
} }
VOID VOID
phy_LCCalibrate_8723D( phy_LCCalibrate_8723D(
#if (DM_ODM_SUPPORT_TYPE & ODM_CE) #if (DM_ODM_SUPPORT_TYPE & ODM_CE)
@ -3516,13 +3492,13 @@ PHY_APCalibrate_8723D(
#endif #endif
return; return;
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP) #if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
phy_APCalibrate_8723D(pAdapter, delta, FALSE); phy_APCalibrate_8723D(pAdapter, delta, FALSE);
#else #else
phy_APCalibrate_8723D(pDM_Odm, delta, FALSE); phy_APCalibrate_8723D(pDM_Odm, delta, FALSE);
#endif #endif
} }
VOID phy_SetRFPathSwitch_8723D( VOID phy_SetRFPathSwitch_8723D(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP) #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
IN PDM_ODM_T pDM_Odm, IN PDM_ODM_T pDM_Odm,

View File

@ -27,10 +27,6 @@
#ifndef __DRV_TYPES_H__ #ifndef __DRV_TYPES_H__
#define __DRV_TYPES_H__ #define __DRV_TYPES_H__
#ifndef is_compat_task
#define is_compat_task() 0
#endif
#include <drv_conf.h> #include <drv_conf.h>
#include <basic_types.h> #include <basic_types.h>
#include <osdep_service.h> #include <osdep_service.h>
@ -55,6 +51,10 @@
#include <drv_types_linux.h> #include <drv_types_linux.h>
#endif #endif
#ifndef is_compat_task
#define is_compat_task() 0
#endif
enum _NIC_VERSION { enum _NIC_VERSION {
RTL8711_NIC, RTL8711_NIC,

View File

@ -57,6 +57,8 @@
#include <linux/kthread.h> #include <linux/kthread.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/signal.h>
#include <linux/sched/signal.h>
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 5, 41)) #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 5, 41))
#include <linux/tqueue.h> #include <linux/tqueue.h>

View File

@ -669,6 +669,10 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter)
#endif #endif
struct cfg80211_bss *bss = NULL; struct cfg80211_bss *bss = NULL;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
struct cfg80211_roam_info roam_info ={};
#endif
RTW_INFO(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter)); RTW_INFO(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
if (pwdev->iftype != NL80211_IFTYPE_STATION if (pwdev->iftype != NL80211_IFTYPE_STATION
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
@ -736,7 +740,15 @@ check_bss:
notify_channel = ieee80211_get_channel(wiphy, freq); notify_channel = ieee80211_get_channel(wiphy, freq);
#endif #endif
RTW_INFO(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter)); #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
roam_info.bssid = cur_network->network.MacAddress;
roam_info.req_ie = pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2;
roam_info.req_ie_len = pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2;
roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6;
roam_info.resp_ie_len = pmlmepriv->assoc_rsp_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 6;
cfg80211_roamed(padapter->pnetdev, &roam_info, GFP_ATOMIC);
#else
cfg80211_roamed(padapter->pnetdev cfg80211_roamed(padapter->pnetdev
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) || defined(COMPAT_KERNEL_RELEASE) #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) || defined(COMPAT_KERNEL_RELEASE)
, notify_channel , notify_channel
@ -747,6 +759,10 @@ check_bss:
, pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6 , pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6
, pmlmepriv->assoc_rsp_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 6 , pmlmepriv->assoc_rsp_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 6
, GFP_ATOMIC); , GFP_ATOMIC);
#endif /*LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)*/
RTW_INFO(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter));
#ifdef CONFIG_RTW_80211R #ifdef CONFIG_RTW_80211R
if ((rtw_to_roam(padapter) > 0) && rtw_chk_ft_flags(padapter, RTW_FT_SUPPORTED)) if ((rtw_to_roam(padapter) > 0) && rtw_chk_ft_flags(padapter, RTW_FT_SUPPORTED))
rtw_set_ft_status(padapter, RTW_FT_ASSOCIATED_STA); rtw_set_ft_status(padapter, RTW_FT_ASSOCIATED_STA);
@ -1728,7 +1744,10 @@ enum nl80211_iftype {
#endif #endif
static int cfg80211_rtw_change_iface(struct wiphy *wiphy, static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
struct net_device *ndev, struct net_device *ndev,
enum nl80211_iftype type, u32 *flags, enum nl80211_iftype type,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0))
u32 *flags,
#endif
struct vif_params *params) struct vif_params *params)
{ {
enum nl80211_iftype old_type; enum nl80211_iftype old_type;
@ -3783,7 +3802,11 @@ static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct ne
mon_ndev->type = ARPHRD_IEEE80211_RADIOTAP; mon_ndev->type = ARPHRD_IEEE80211_RADIOTAP;
strncpy(mon_ndev->name, name, IFNAMSIZ); strncpy(mon_ndev->name, name, IFNAMSIZ);
mon_ndev->name[IFNAMSIZ - 1] = 0; mon_ndev->name[IFNAMSIZ - 1] = 0;
#if (LINUX_VERSION_CODE > KERNEL_VERSION(4, 11, 8))
mon_ndev->priv_destructor = rtw_ndev_destructor;
#else
mon_ndev->destructor = rtw_ndev_destructor; mon_ndev->destructor = rtw_ndev_destructor;
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29))
mon_ndev->netdev_ops = &rtw_cfg80211_monitor_if_ops; mon_ndev->netdev_ops = &rtw_cfg80211_monitor_if_ops;
@ -3849,7 +3872,11 @@ static int
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
unsigned char name_assign_type, unsigned char name_assign_type,
#endif #endif
enum nl80211_iftype type, u32 *flags, struct vif_params *params) enum nl80211_iftype type,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0))
u32 *flags,
#endif
struct vif_params *params)
{ {
int ret = 0; int ret = 0;
struct wireless_dev *wdev = NULL; struct wireless_dev *wdev = NULL;
@ -6718,7 +6745,8 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *adapter, struct wiphy *wiphy)
/* wiphy->flags |= WIPHY_FLAG_OFFCHAN_TX | WIPHY_FLAG_HAVE_AP_SME; */ /* wiphy->flags |= WIPHY_FLAG_OFFCHAN_TX | WIPHY_FLAG_HAVE_AP_SME; */
#endif #endif
#if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)) #if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0) && \
LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0))
wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN;
#ifdef CONFIG_PNO_SUPPORT #ifdef CONFIG_PNO_SUPPORT
wiphy->max_sched_scan_ssids = MAX_PNO_LIST_COUNT; wiphy->max_sched_scan_ssids = MAX_PNO_LIST_COUNT;

View File

@ -552,6 +552,7 @@ static inline char *iwe_stream_rate_process(_adapter *padapter,
max_rate = vht_data_rate; max_rate = vht_data_rate;
else else
#endif #endif
{
if (ht_cap == _TRUE) { if (ht_cap == _TRUE) {
if (mcs_rate & 0x8000) /* MCS15 */ if (mcs_rate & 0x8000) /* MCS15 */
max_rate = (bw_40MHz) ? ((short_GI) ? 300 : 270) : ((short_GI) ? 144 : 130); max_rate = (bw_40MHz) ? ((short_GI) ? 300 : 270) : ((short_GI) ? 144 : 130);
@ -565,7 +566,7 @@ static inline char *iwe_stream_rate_process(_adapter *padapter,
max_rate = max_rate * 2; /* Mbps/2; */ max_rate = max_rate * 2; /* Mbps/2; */
} }
}
iwe->cmd = SIOCGIWRATE; iwe->cmd = SIOCGIWRATE;
iwe->u.bitrate.fixed = iwe->u.bitrate.disabled = 0; iwe->u.bitrate.fixed = iwe->u.bitrate.disabled = 0;
iwe->u.bitrate.value = max_rate * 500000; iwe->u.bitrate.value = max_rate * 500000;
@ -6539,11 +6540,10 @@ static int rtw_dbg_port(struct net_device *dev,
} }
break; break;
case 0x78: /* IOL test */ case 0x78: /* IOL test */
switch (minor_cmd) {
#ifdef CONFIG_IOL #ifdef CONFIG_IOL
switch (minor_cmd) {
case 0x04: { /* LLT table initialization test */ case 0x04: { /* LLT table initialization test */
u8 page_boundary = 0xf9; u8 page_boundary = 0xf9;
{
struct xmit_frame *xmit_frame; struct xmit_frame *xmit_frame;
xmit_frame = rtw_IOL_accquire_xmit_frame(padapter); xmit_frame = rtw_IOL_accquire_xmit_frame(padapter);
@ -6558,15 +6558,12 @@ static int rtw_dbg_port(struct net_device *dev,
if (_SUCCESS != rtw_IOL_exec_cmds_sync(padapter, xmit_frame, 500, 0)) if (_SUCCESS != rtw_IOL_exec_cmds_sync(padapter, xmit_frame, 500, 0))
ret = -EPERM; ret = -EPERM;
} }
}
break; break;
case 0x05: { /* blink LED test */ case 0x05: { /* blink LED test */
u16 reg = 0x4c; u16 reg = 0x4c;
u32 blink_num = 50; u32 blink_num = 50;
u32 blink_delay_ms = 200; u32 blink_delay_ms = 200;
int i; int i;
{
struct xmit_frame *xmit_frame; struct xmit_frame *xmit_frame;
xmit_frame = rtw_IOL_accquire_xmit_frame(padapter); xmit_frame = rtw_IOL_accquire_xmit_frame(padapter);
@ -6591,17 +6588,13 @@ static int rtw_dbg_port(struct net_device *dev,
if (_SUCCESS != rtw_IOL_exec_cmds_sync(padapter, xmit_frame, (blink_delay_ms * blink_num * 2) + 200, 0)) if (_SUCCESS != rtw_IOL_exec_cmds_sync(padapter, xmit_frame, (blink_delay_ms * blink_num * 2) + 200, 0))
ret = -EPERM; ret = -EPERM;
} }
}
break; break;
case 0x06: { /* continuous wirte byte test */ case 0x06: { /* continuous wirte byte test */
u16 reg = arg; u16 reg = arg;
u16 start_value = 0; u16 start_value = 0;
u32 write_num = extra_arg; u32 write_num = extra_arg;
int i; int i;
u8 final; u8 final;
{
struct xmit_frame *xmit_frame; struct xmit_frame *xmit_frame;
xmit_frame = rtw_IOL_accquire_xmit_frame(padapter); xmit_frame = rtw_IOL_accquire_xmit_frame(padapter);
@ -6619,7 +6612,6 @@ static int rtw_dbg_port(struct net_device *dev,
} }
if (_SUCCESS != rtw_IOL_exec_cmds_sync(padapter, xmit_frame, 5000, 0)) if (_SUCCESS != rtw_IOL_exec_cmds_sync(padapter, xmit_frame, 5000, 0))
ret = -EPERM; ret = -EPERM;
}
final = rtw_read8(padapter, reg); final = rtw_read8(padapter, reg);
if (start_value + write_num - 1 == final) if (start_value + write_num - 1 == final)
@ -6628,7 +6620,6 @@ static int rtw_dbg_port(struct net_device *dev,
RTW_INFO("continuous IOL_CMD_WB_REG to 0x%x %u times Fail, start:%u, final:%u\n", reg, write_num, start_value, final); RTW_INFO("continuous IOL_CMD_WB_REG to 0x%x %u times Fail, start:%u, final:%u\n", reg, write_num, start_value, final);
} }
break; break;
case 0x07: { /* continuous wirte word test */ case 0x07: { /* continuous wirte word test */
u16 reg = arg; u16 reg = arg;
u16 start_value = 200; u16 start_value = 200;
@ -6636,8 +6627,6 @@ static int rtw_dbg_port(struct net_device *dev,
int i; int i;
u16 final; u16 final;
{
struct xmit_frame *xmit_frame; struct xmit_frame *xmit_frame;
xmit_frame = rtw_IOL_accquire_xmit_frame(padapter); xmit_frame = rtw_IOL_accquire_xmit_frame(padapter);
@ -6655,7 +6644,6 @@ static int rtw_dbg_port(struct net_device *dev,
} }
if (_SUCCESS != rtw_IOL_exec_cmds_sync(padapter, xmit_frame, 5000, 0)) if (_SUCCESS != rtw_IOL_exec_cmds_sync(padapter, xmit_frame, 5000, 0))
ret = -EPERM; ret = -EPERM;
}
final = rtw_read16(padapter, reg); final = rtw_read16(padapter, reg);
if (start_value + write_num - 1 == final) if (start_value + write_num - 1 == final)
@ -6664,7 +6652,6 @@ static int rtw_dbg_port(struct net_device *dev,
RTW_INFO("continuous IOL_CMD_WW_REG to 0x%x %u times Fail, start:%u, final:%u\n", reg, write_num, start_value, final); RTW_INFO("continuous IOL_CMD_WW_REG to 0x%x %u times Fail, start:%u, final:%u\n", reg, write_num, start_value, final);
} }
break; break;
case 0x08: { /* continuous wirte dword test */ case 0x08: { /* continuous wirte dword test */
u16 reg = arg; u16 reg = arg;
u32 start_value = 0x110000c7; u32 start_value = 0x110000c7;
@ -6672,8 +6659,6 @@ static int rtw_dbg_port(struct net_device *dev,
int i; int i;
u32 final; u32 final;
{
struct xmit_frame *xmit_frame; struct xmit_frame *xmit_frame;
xmit_frame = rtw_IOL_accquire_xmit_frame(padapter); xmit_frame = rtw_IOL_accquire_xmit_frame(padapter);
@ -6692,8 +6677,6 @@ static int rtw_dbg_port(struct net_device *dev,
if (_SUCCESS != rtw_IOL_exec_cmds_sync(padapter, xmit_frame, 5000, 0)) if (_SUCCESS != rtw_IOL_exec_cmds_sync(padapter, xmit_frame, 5000, 0))
ret = -EPERM; ret = -EPERM;
}
final = rtw_read32(padapter, reg); final = rtw_read32(padapter, reg);
if (start_value + write_num - 1 == final) if (start_value + write_num - 1 == final)
RTW_INFO("continuous IOL_CMD_WD_REG to 0x%x %u times Success, start:%u, final:%u\n", reg, write_num, start_value, final); RTW_INFO("continuous IOL_CMD_WD_REG to 0x%x %u times Success, start:%u, final:%u\n", reg, write_num, start_value, final);
@ -6701,8 +6684,8 @@ static int rtw_dbg_port(struct net_device *dev,
RTW_INFO("continuous IOL_CMD_WD_REG to 0x%x %u times Fail, start:%u, final:%u\n", reg, write_num, start_value, final); RTW_INFO("continuous IOL_CMD_WD_REG to 0x%x %u times Fail, start:%u, final:%u\n", reg, write_num, start_value, final);
} }
break; break;
#endif /* CONFIG_IOL */
} }
#endif /* CONFIG_IOL */
break; break;
case 0x79: { case 0x79: {
/* /*
@ -6939,30 +6922,33 @@ static int rtw_dbg_port(struct net_device *dev,
struct registry_priv *pregpriv = &padapter->registrypriv; struct registry_priv *pregpriv = &padapter->registrypriv;
/* 0: disable, bit(0):enable 2.4g, bit(1):enable 5g, 0x3: enable both 2.4g and 5g */ /* 0: disable, bit(0):enable 2.4g, bit(1):enable 5g, 0x3: enable both 2.4g and 5g */
/* default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ */ /* default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ */
if (pregpriv && (extra_arg == 0 || extra_arg == 1 || extra_arg == 2 || extra_arg == 3)) { if (!pregpriv)
break;
if (extra_arg == 0 || extra_arg == 1 || extra_arg == 2 || extra_arg == 3) {
pregpriv->rx_stbc = extra_arg; pregpriv->rx_stbc = extra_arg;
RTW_INFO("set rx_stbc=%d\n", pregpriv->rx_stbc); RTW_INFO("set rx_stbc=%d\n", pregpriv->rx_stbc);
} else } else {
RTW_INFO("get rx_stbc=%d\n", pregpriv->rx_stbc); RTW_INFO("get rx_stbc=%d\n", pregpriv->rx_stbc);
}
} }
break; break;
case 0x13: { /* set ampdu_enable */ case 0x13: { /* set ampdu_enable */
struct registry_priv *pregpriv = &padapter->registrypriv; struct registry_priv *pregpriv = &padapter->registrypriv;
/* 0: disable, 0x1:enable */ /* 0: disable, 0x1:enable */
if (pregpriv && extra_arg < 2) { if (!pregpriv)
break;
if (extra_arg < 2) {
pregpriv->ampdu_enable = extra_arg; pregpriv->ampdu_enable = extra_arg;
RTW_INFO("set ampdu_enable=%d\n", pregpriv->ampdu_enable); RTW_INFO("set ampdu_enable=%d\n", pregpriv->ampdu_enable);
} else } else {
RTW_INFO("get ampdu_enable=%d\n", pregpriv->ampdu_enable); RTW_INFO("get ampdu_enable=%d\n", pregpriv->ampdu_enable);
}
} }
break; break;
#endif #endif
case 0x14: { /* get wifi_spec */ case 0x14: { /* get wifi_spec */
struct registry_priv *pregpriv = &padapter->registrypriv; struct registry_priv *pregpriv = &padapter->registrypriv;
RTW_INFO("get wifi_spec=%d\n", pregpriv->wifi_spec); RTW_INFO("get wifi_spec=%d\n", pregpriv->wifi_spec);
} }
break; break;
case 0x16: { case 0x16: {

View File

@ -1987,7 +1987,9 @@ static int readFile(struct file *fp, char *buf, int len)
return -EPERM; return -EPERM;
while (sum < len) { while (sum < len) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
rlen = kernel_read(fp, buf + sum, len - sum, &fp->f_pos);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
rlen = __vfs_read(fp, buf + sum, len - sum, &fp->f_pos); rlen = __vfs_read(fp, buf + sum, len - sum, &fp->f_pos);
#else #else
rlen = fp->f_op->read(fp, buf + sum, len - sum, &fp->f_pos); rlen = fp->f_op->read(fp, buf + sum, len - sum, &fp->f_pos);