From 71b58823dd6702bf900e3d3362d247658d90a253 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Fri, 29 Mar 2019 00:39:08 +0100 Subject: [PATCH] Adoptations for using the driver on android/nethunter --- os_dep/linux/ioctl_cfg80211.c | 15 +-------------- os_dep/linux/ioctl_cfg80211.h | 4 ---- os_dep/linux/rtw_android.c | 2 +- os_dep/linux/rtw_cfgvendor.c | 9 +-------- 4 files changed, 3 insertions(+), 27 deletions(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index d919255..86aedd8 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -4662,15 +4662,7 @@ exit: return ret; } -static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev, -#if (CFG80211_API_LEVEL < KERNEL_VERSION(3, 16, 0)) - u8 *mac -#elif (CFG80211_API_LEVEL < KERNEL_VERSION(3, 19, 0)) - const u8 *mac -#else - struct station_del_parameters *params -#endif -) +static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev, struct station_del_parameters *params) { int ret = 0; _irqL irqL; @@ -4684,12 +4676,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev RTW_INFO("+"FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); - -#if (CFG80211_API_LEVEL < KERNEL_VERSION(3, 19, 0)) - target_mac = mac; -#else target_mac = params->mac; -#endif if (check_fwstate(pmlmepriv, (_FW_LINKED | WIFI_AP_STATE | WIFI_MESH_STATE)) != _TRUE) { RTW_INFO("%s, fw_state != FW_LINKED|WIFI_AP_STATE|WIFI_MESH_STATE\n", __func__); diff --git a/os_dep/linux/ioctl_cfg80211.h b/os_dep/linux/ioctl_cfg80211.h index 5dda257..8fe38f0 100644 --- a/os_dep/linux/ioctl_cfg80211.h +++ b/os_dep/linux/ioctl_cfg80211.h @@ -336,11 +336,7 @@ void rtw_cfg80211_deinit_rfkill(struct wiphy *wiphy); #define rtw_cfg80211_connect_result(wdev, bssid, req_ie, req_ie_len, resp_ie, resp_ie_len, status, gfp) cfg80211_connect_result(wdev_to_ndev(wdev), bssid, req_ie, req_ie_len, resp_ie, resp_ie_len, status, gfp) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0)) -#define rtw_cfg80211_disconnected(wdev, reason, ie, ie_len, locally_generated, gfp) cfg80211_disconnected(wdev_to_ndev(wdev), reason, ie, ie_len, gfp) -#else #define rtw_cfg80211_disconnected(wdev, reason, ie, ie_len, locally_generated, gfp) cfg80211_disconnected(wdev_to_ndev(wdev), reason, ie, ie_len, locally_generated, gfp) -#endif #ifdef CONFIG_RTW_80211R #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)) diff --git a/os_dep/linux/rtw_android.c b/os_dep/linux/rtw_android.c index 2e88e21..ab25828 100644 --- a/os_dep/linux/rtw_android.c +++ b/os_dep/linux/rtw_android.c @@ -1029,7 +1029,7 @@ void *wifi_get_country_code(char *ccode) if (!ccode) return NULL; if (wifi_control_data && wifi_control_data->get_country_code) - return wifi_control_data->get_country_code(ccode); + return wifi_control_data->get_country_code(ccode, 0); return NULL; } #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) */ diff --git a/os_dep/linux/rtw_cfgvendor.c b/os_dep/linux/rtw_cfgvendor.c index d3ab844..2b677ff 100644 --- a/os_dep/linux/rtw_cfgvendor.c +++ b/os_dep/linux/rtw_cfgvendor.c @@ -46,11 +46,7 @@ struct sk_buff *dbg_rtw_cfg80211_vendor_event_alloc(struct wiphy *wiphy, struct struct sk_buff *skb; unsigned int truesize = 0; -#if (CFG80211_API_LEVEL < KERNEL_VERSION(4, 1, 0)) - skb = cfg80211_vendor_event_alloc(wiphy, len, event_id, gfp); -#else skb = cfg80211_vendor_event_alloc(wiphy, wdev, len, event_id, gfp); -#endif if (skb) truesize = skb->truesize; @@ -145,11 +141,8 @@ struct sk_buff *rtw_cfg80211_vendor_event_alloc( { struct sk_buff *skb; -#if (CFG80211_API_LEVEL < KERNEL_VERSION(4, 1, 0)) - skb = cfg80211_vendor_event_alloc(wiphy, len, event_id, gfp); -#else skb = cfg80211_vendor_event_alloc(wiphy, wdev, len, event_id, gfp); -#endif + return skb; }