mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-22 12:33:40 +00:00
Fix build for kernel 4.13 and later from quickreflex patch
This commit is contained in:
parent
c459fddba4
commit
172e344ac2
8 changed files with 62 additions and 21 deletions
|
@ -1830,7 +1830,7 @@ static void traffic_status_watchdog(struct adapter *padapter)
|
||||||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8 ) ||
|
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8 ) ||
|
||||||
(pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2))
|
(pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2))
|
||||||
bEnterPS = false;
|
bEnterPS = false;
|
||||||
else
|
else
|
||||||
bEnterPS = true;
|
bEnterPS = true;
|
||||||
|
|
||||||
/* LeisurePS only work in infra mode. */
|
/* LeisurePS only work in infra mode. */
|
||||||
|
|
|
@ -236,7 +236,8 @@ void rtw_IOL_cmd_buf_dump(struct adapter *Adapter, int buf_len, u8 *pbuf)
|
||||||
for (i =0;i< buf_len;i++) {
|
for (i =0;i< buf_len;i++) {
|
||||||
printk("%02x-",*(pbuf+i));
|
printk("%02x-",*(pbuf+i));
|
||||||
|
|
||||||
if (j%32 == 0) printk("\n");j++;
|
if (j%32 == 0) printk("\n");
|
||||||
|
j++;
|
||||||
}
|
}
|
||||||
printk("\n");
|
printk("\n");
|
||||||
printk("============= ioreg_cmd len = %d ===============\n", buf_len);
|
printk("============= ioreg_cmd len = %d ===============\n", buf_len);
|
||||||
|
|
|
@ -52,7 +52,7 @@ void _ips_enter(struct adapter * padapter)
|
||||||
if (rf_off == pwrpriv->change_rfpwrstate )
|
if (rf_off == pwrpriv->change_rfpwrstate )
|
||||||
{
|
{
|
||||||
pwrpriv->bpower_saving = true;
|
pwrpriv->bpower_saving = true;
|
||||||
DBG_88E_LEVEL(_drv_always_, "nolinked power save enter\n");
|
DBG_88E_LEVEL(_drv_info_, "nolinked power save enter\n");
|
||||||
|
|
||||||
if (pwrpriv->ips_mode == IPS_LEVEL_2)
|
if (pwrpriv->ips_mode == IPS_LEVEL_2)
|
||||||
pwrpriv->bkeepfwalive = true;
|
pwrpriv->bkeepfwalive = true;
|
||||||
|
@ -88,7 +88,7 @@ int _ips_leave(struct adapter * padapter)
|
||||||
if ((result = rtw_ips_pwr_up(padapter)) == _SUCCESS) {
|
if ((result = rtw_ips_pwr_up(padapter)) == _SUCCESS) {
|
||||||
pwrpriv->rf_pwrstate = rf_on;
|
pwrpriv->rf_pwrstate = rf_on;
|
||||||
}
|
}
|
||||||
DBG_88E_LEVEL(_drv_always_, "nolinked power save leave\n");
|
DBG_88E_LEVEL(_drv_info_, "nolinked power save leave\n");
|
||||||
|
|
||||||
DBG_88E("==> ips_leave.....LED(0x%08x)...\n", rtw_read32(padapter, 0x4c));
|
DBG_88E("==> ips_leave.....LED(0x%08x)...\n", rtw_read32(padapter, 0x4c));
|
||||||
pwrpriv->bips_processing = false;
|
pwrpriv->bips_processing = false;
|
||||||
|
|
|
@ -2003,7 +2003,7 @@ void update_bmc_sta_support_rate(struct adapter *padapter, u32 mac_id)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
memcpy((pmlmeinfo->FW_sta_info[mac_id].SupportedRates), rtw_basic_rate_ofdm, 4);
|
memcpy((pmlmeinfo->FW_sta_info[mac_id].SupportedRates), rtw_basic_rate_ofdm, 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1251,7 +1251,7 @@ phy_IQCalibrate_8188E(
|
||||||
#endif
|
#endif
|
||||||
if ( *(pDM_Odm->mp_mode) == 1)
|
if ( *(pDM_Odm->mp_mode) == 1)
|
||||||
retryCount = 9;
|
retryCount = 9;
|
||||||
else
|
else
|
||||||
retryCount = 2;
|
retryCount = 2;
|
||||||
/* Note: IQ calibration must be performed after loading */
|
/* Note: IQ calibration must be performed after loading */
|
||||||
/* PHY_REG.txt , and radio_a, radio_b.txt */
|
/* PHY_REG.txt , and radio_a, radio_b.txt */
|
||||||
|
|
|
@ -406,7 +406,9 @@ static s32 iol_read_efuse(
|
||||||
s32 rtl8188e_iol_efuse_patch(struct adapter *padapter)
|
s32 rtl8188e_iol_efuse_patch(struct adapter *padapter)
|
||||||
{
|
{
|
||||||
s32 result = _SUCCESS;
|
s32 result = _SUCCESS;
|
||||||
printk("==> %s\n",__FUNCTION__);
|
|
||||||
|
/* deleted because it prints every 7s when not associated */
|
||||||
|
/* printk("==> %s\n",__FUNCTION__); */
|
||||||
|
|
||||||
if (rtw_IOL_applied(padapter)) {
|
if (rtw_IOL_applied(padapter)) {
|
||||||
iol_mode_enable(padapter, 1);
|
iol_mode_enable(padapter, 1);
|
||||||
|
|
|
@ -22,6 +22,10 @@
|
||||||
|
|
||||||
#include <drv_conf.h>
|
#include <drv_conf.h>
|
||||||
#include <basic_types.h>
|
#include <basic_types.h>
|
||||||
|
#include <linux/version.h>
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
|
||||||
|
#include <linux/sched/signal.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define _FAIL 0
|
#define _FAIL 0
|
||||||
#define _SUCCESS 1
|
#define _SUCCESS 1
|
||||||
|
|
|
@ -335,7 +335,8 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl
|
||||||
u8 *notify_ie;
|
u8 *notify_ie;
|
||||||
size_t notify_ielen;
|
size_t notify_ielen;
|
||||||
s32 notify_signal;
|
s32 notify_signal;
|
||||||
u8 buf[MAX_BSSINFO_LEN], *pbuf;
|
//u8 buf[MAX_BSSINFO_LEN], *pbuf;
|
||||||
|
u8 *buf=NULL, *pbuf=NULL;
|
||||||
size_t len,bssinf_len=0;
|
size_t len,bssinf_len=0;
|
||||||
struct rtw_ieee80211_hdr *pwlanhdr;
|
struct rtw_ieee80211_hdr *pwlanhdr;
|
||||||
__le16 *fctrl;
|
__le16 *fctrl;
|
||||||
|
@ -416,6 +417,8 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl
|
||||||
} else {
|
} else {
|
||||||
notify_signal = 100*translate_percentage_to_dbm(pnetwork->network.PhyInfo.SignalStrength);/* dbm */
|
notify_signal = 100*translate_percentage_to_dbm(pnetwork->network.PhyInfo.SignalStrength);/* dbm */
|
||||||
}
|
}
|
||||||
|
if (!(buf=(u8 *)kzalloc(MAX_BSSINFO_LEN, GFP_KERNEL)))
|
||||||
|
goto exit;
|
||||||
pbuf = buf;
|
pbuf = buf;
|
||||||
|
|
||||||
pwlanhdr = (struct rtw_ieee80211_hdr *)pbuf;
|
pwlanhdr = (struct rtw_ieee80211_hdr *)pbuf;
|
||||||
|
@ -497,6 +500,8 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
if (buf)
|
||||||
|
kfree(buf);
|
||||||
return bss;
|
return bss;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -674,6 +679,9 @@ check_bss:
|
||||||
struct ieee80211_channel *notify_channel;
|
struct ieee80211_channel *notify_channel;
|
||||||
u32 freq;
|
u32 freq;
|
||||||
u16 channel = cur_network->network.Configuration.DSConfig;
|
u16 channel = cur_network->network.Configuration.DSConfig;
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||||
|
struct cfg80211_roam_info roam_info = {};
|
||||||
|
#endif
|
||||||
|
|
||||||
if (channel <= RTW_CH_MAX_2G_CHANNEL)
|
if (channel <= RTW_CH_MAX_2G_CHANNEL)
|
||||||
freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ);
|
freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ);
|
||||||
|
@ -684,16 +692,27 @@ check_bss:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DBG_88E(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter));
|
DBG_88E(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter));
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||||
|
roam_info.channel = notify_channel;
|
||||||
|
roam_info.bssid = cur_network->network.MacAddress;
|
||||||
|
roam_info.req_ie = pmlmepriv->assoc_req+sizeof(struct ieee80211_hdr_3addr)+2;
|
||||||
|
roam_info.req_ie_len = pmlmepriv->assoc_req_len-sizeof(struct ieee80211_hdr_3addr)-2;
|
||||||
|
roam_info.resp_ie = pmlmepriv->assoc_rsp+sizeof(struct ieee80211_hdr_3addr)+6;
|
||||||
|
roam_info.resp_ie_len = pmlmepriv->assoc_rsp_len-sizeof(struct 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
|
||||||
#endif
|
#endif
|
||||||
, cur_network->network.MacAddress
|
, cur_network->network.MacAddress
|
||||||
, pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2
|
, pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2
|
||||||
, pmlmepriv->assoc_req_len-sizeof(struct rtw_ieee80211_hdr_3addr)-2
|
, pmlmepriv->assoc_req_len-sizeof(struct rtw_ieee80211_hdr_3addr)-2
|
||||||
, 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
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
cfg80211_connect_result(padapter->pnetdev, cur_network->network.MacAddress
|
cfg80211_connect_result(padapter->pnetdev, cur_network->network.MacAddress
|
||||||
, pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2
|
, pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2
|
||||||
|
@ -851,7 +870,6 @@ static int set_group_key(struct adapter *padapter, u8 *key, u8 alg, int keyid)
|
||||||
res = rtw_enqueue_cmd(pcmdpriv, pcmd);
|
res = rtw_enqueue_cmd(pcmdpriv, pcmd);
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1641,13 +1659,20 @@ exit:
|
||||||
|
|
||||||
extern int netdev_open(struct net_device *pnetdev);
|
extern int netdev_open(struct net_device *pnetdev);
|
||||||
|
|
||||||
static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||||
struct net_device *ndev,
|
static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
|
||||||
enum nl80211_iftype type, u32 *flags,
|
struct net_device *ndev,
|
||||||
struct vif_params *params)
|
enum nl80211_iftype type,
|
||||||
|
struct vif_params *params)
|
||||||
|
#else
|
||||||
|
static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
|
||||||
|
struct net_device *ndev,
|
||||||
|
enum nl80211_iftype type, u32 *flags,
|
||||||
|
struct vif_params *params)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
enum nl80211_iftype old_type;
|
enum nl80211_iftype old_type;
|
||||||
enum NDIS_802_11_NETWORK_INFRASTRUCTURE networkType ;
|
enum NDIS_802_11_NETWORK_INFRASTRUCTURE networkType;
|
||||||
struct adapter *padapter = wiphy_to_adapter(wiphy);
|
struct adapter *padapter = wiphy_to_adapter(wiphy);
|
||||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||||
struct wireless_dev *rtw_wdev = wiphy_to_wdev(wiphy);
|
struct wireless_dev *rtw_wdev = wiphy_to_wdev(wiphy);
|
||||||
|
@ -3189,7 +3214,12 @@ static int rtw_cfg80211_add_monitor_if (struct adapter *padapter, char *name, st
|
||||||
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;
|
||||||
mon_ndev->destructor = rtw_ndev_destructor;
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 9))
|
||||||
|
mon_ndev->needs_free_netdev = false;
|
||||||
|
mon_ndev->priv_destructor = rtw_ndev_destructor;
|
||||||
|
#else
|
||||||
|
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;
|
||||||
|
@ -3256,7 +3286,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
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0))
|
||||||
|
enum nl80211_iftype type, struct vif_params *params)
|
||||||
|
#else
|
||||||
enum nl80211_iftype type, u32 *flags, struct vif_params *params)
|
enum nl80211_iftype type, u32 *flags, struct vif_params *params)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
struct net_device* ndev = NULL;
|
struct net_device* ndev = NULL;
|
||||||
|
|
Loading…
Reference in a new issue