Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build for kernel 4.13 and later from quickreflex patch #244

Open
wants to merge 1 commit into
base: v4.1.8_9499
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/rtw_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1830,7 +1830,7 @@ static void traffic_status_watchdog(struct adapter *padapter)
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8 ) ||
(pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2))
bEnterPS = false;
else
else
bEnterPS = true;

/* LeisurePS only work in infra mode. */
Expand Down
3 changes: 2 additions & 1 deletion core/rtw_iol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
printk("%02x-",*(pbuf+i));

if (j%32 == 0) printk("\n");j++;
if (j%32 == 0) printk("\n");
j++;
}
printk("\n");
printk("============= ioreg_cmd len = %d ===============\n", buf_len);
Expand Down
4 changes: 2 additions & 2 deletions core/rtw_pwrctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void _ips_enter(struct adapter * padapter)
if (rf_off == pwrpriv->change_rfpwrstate )
{
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)
pwrpriv->bkeepfwalive = true;
Expand Down Expand Up @@ -88,7 +88,7 @@ int _ips_leave(struct adapter * padapter)
if ((result = rtw_ips_pwr_up(padapter)) == _SUCCESS) {
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));
pwrpriv->bips_processing = false;
Expand Down
2 changes: 1 addition & 1 deletion core/rtw_wlan_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -2003,7 +2003,7 @@ void update_bmc_sta_support_rate(struct adapter *padapter, u32 mac_id)
}
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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion hal/HalPhyRf_8188e.c
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ phy_IQCalibrate_8188E(
#endif
if ( *(pDM_Odm->mp_mode) == 1)
retryCount = 9;
else
else
retryCount = 2;
/* Note: IQ calibration must be performed after loading */
/* PHY_REG.txt , and radio_a, radio_b.txt */
Expand Down
4 changes: 3 additions & 1 deletion hal/rtl8188e_hal_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,9 @@ static s32 iol_read_efuse(
s32 rtl8188e_iol_efuse_patch(struct adapter *padapter)
{
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)) {
iol_mode_enable(padapter, 1);
Expand Down
4 changes: 4 additions & 0 deletions include/osdep_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@

#include <drv_conf.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 _SUCCESS 1
Expand Down
62 changes: 48 additions & 14 deletions os_dep/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl
u8 *notify_ie;
size_t notify_ielen;
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;
struct rtw_ieee80211_hdr *pwlanhdr;
__le16 *fctrl;
Expand Down Expand Up @@ -416,6 +417,8 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl
} else {
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;

pwlanhdr = (struct rtw_ieee80211_hdr *)pbuf;
Expand Down Expand Up @@ -497,6 +500,8 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl
#endif

exit:
if (buf)
kfree(buf);
return bss;

}
Expand Down Expand Up @@ -674,6 +679,9 @@ void rtw_cfg80211_indicate_connect(struct adapter *padapter)
struct ieee80211_channel *notify_channel;
u32 freq;
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)
freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ);
Expand All @@ -684,16 +692,27 @@ void rtw_cfg80211_indicate_connect(struct adapter *padapter)
#endif

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
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) || defined(COMPAT_KERNEL_RELEASE)
, notify_channel
#endif
, cur_network->network.MacAddress
, pmlmepriv->assoc_req+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_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6
, GFP_ATOMIC);
, cur_network->network.MacAddress
, pmlmepriv->assoc_req+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_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6
, GFP_ATOMIC);
#endif

} else {
cfg80211_connect_result(padapter->pnetdev, cur_network->network.MacAddress
, pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2
Expand Down Expand Up @@ -851,7 +870,6 @@ static int set_group_key(struct adapter *padapter, u8 *key, u8 alg, int keyid)
res = rtw_enqueue_cmd(pcmdpriv, pcmd);

exit:

return res;


Expand Down Expand Up @@ -1641,13 +1659,20 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy,

extern int netdev_open(struct net_device *pnetdev);

static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
struct net_device *ndev,
enum nl80211_iftype type, u32 *flags,
struct vif_params *params)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
struct net_device *ndev,
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 NDIS_802_11_NETWORK_INFRASTRUCTURE networkType ;
enum NDIS_802_11_NETWORK_INFRASTRUCTURE networkType;
struct adapter *padapter = wiphy_to_adapter(wiphy);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct wireless_dev *rtw_wdev = wiphy_to_wdev(wiphy);
Expand Down Expand Up @@ -3189,7 +3214,12 @@ static int rtw_cfg80211_add_monitor_if (struct adapter *padapter, char *name, st
mon_ndev->type = ARPHRD_IEEE80211_RADIOTAP;
strncpy(mon_ndev->name, name, IFNAMSIZ);
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))
mon_ndev->netdev_ops = &rtw_cfg80211_monitor_if_ops;
Expand Down Expand Up @@ -3256,7 +3286,11 @@ static int
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
unsigned char name_assign_type,
#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)
#endif
{
int ret = 0;
struct net_device* ndev = NULL;
Expand Down