mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
Enable cfg80211 support
This commit is contained in:
committed by
popcornmix
parent
1391b28c57
commit
c0bed35bb1
@@ -43,7 +43,7 @@ extern void indicate_wx_scan_complete_event(_adapter *padapter);
|
|||||||
(addr[4] == 0xff) && (addr[5] == 0xff) ) ? _TRUE : _FALSE \
|
(addr[4] == 0xff) && (addr[5] == 0xff) ) ? _TRUE : _FALSE \
|
||||||
)
|
)
|
||||||
|
|
||||||
u8 rtw_validate_bssid(u8 *bssid)
|
u8 rtw_validate_bssid(const u8 *bssid)
|
||||||
{
|
{
|
||||||
u8 ret = _TRUE;
|
u8 ret = _TRUE;
|
||||||
|
|
||||||
@@ -535,7 +535,8 @@ _func_exit_;
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 rtw_set_802_11_connect(_adapter* padapter, u8 *bssid, NDIS_802_11_SSID *ssid)
|
u8 rtw_set_802_11_connect(_adapter *padapter, const u8 *bssid
|
||||||
|
, NDIS_802_11_SSID *ssid)
|
||||||
{
|
{
|
||||||
_irqL irqL;
|
_irqL irqL;
|
||||||
u8 status = _SUCCESS;
|
u8 status = _SUCCESS;
|
||||||
|
|||||||
@@ -685,7 +685,7 @@ _func_exit_;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* any station allocated can be searched by hash list */
|
/* any station allocated can be searched by hash list */
|
||||||
struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr)
|
||||||
{
|
{
|
||||||
|
|
||||||
_irqL irqL;
|
_irqL irqL;
|
||||||
@@ -696,7 +696,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
|||||||
|
|
||||||
u32 index;
|
u32 index;
|
||||||
|
|
||||||
u8 *addr;
|
const u8 *addr;
|
||||||
|
|
||||||
u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
|
u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||||
|
|
||||||
|
|||||||
@@ -31,10 +31,11 @@
|
|||||||
|
|
||||||
#define PLATFORM_LINUX 1
|
#define PLATFORM_LINUX 1
|
||||||
|
|
||||||
//#define CONFIG_IOCTL_CFG80211 1
|
#define CONFIG_IOCTL_CFG80211 1
|
||||||
#ifdef CONFIG_IOCTL_CFG80211
|
#ifdef CONFIG_IOCTL_CFG80211
|
||||||
//#define RTW_USE_CFG80211_STA_EVENT /* Indecate new sta asoc through cfg80211_new_sta */
|
/* Indicate new sta asoc through cfg80211_new_sta */
|
||||||
#define CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER
|
#define RTW_USE_CFG80211_STA_EVENT
|
||||||
|
/*#define CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER*/
|
||||||
//#define CONFIG_DEBUG_CFG80211 1
|
//#define CONFIG_DEBUG_CFG80211 1
|
||||||
//#define CONFIG_DRV_ISSUE_PROV_REQ // IOT FOR S2
|
//#define CONFIG_DRV_ISSUE_PROV_REQ // IOT FOR S2
|
||||||
#define CONFIG_SET_SCAN_DENY_TIMER
|
#define CONFIG_SET_SCAN_DENY_TIMER
|
||||||
@@ -324,7 +325,7 @@
|
|||||||
|
|
||||||
//#define DBG_MEMORY_LEAK 1
|
//#define DBG_MEMORY_LEAK 1
|
||||||
|
|
||||||
#define DBG_CONFIG_ERROR_DETECT
|
/*#define DBG_CONFIG_ERROR_DETECT*/
|
||||||
//#define DBG_CONFIG_ERROR_RESET
|
//#define DBG_CONFIG_ERROR_RESET
|
||||||
|
|
||||||
//TX use 1 urb
|
//TX use 1 urb
|
||||||
|
|||||||
@@ -149,8 +149,15 @@ bool rtw_cfg80211_pwr_mgmt(_adapter *adapter);
|
|||||||
#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, buf, len, gfp)
|
#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, buf, len, gfp)
|
||||||
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
|
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
|
||||||
#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, sig_dbm, buf, len, gfp)
|
#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, sig_dbm, buf, len, gfp)
|
||||||
#else
|
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0))
|
||||||
#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, gfp)
|
#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, gfp)
|
||||||
|
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0))
|
||||||
|
/* 3.12 added a flags argument which is just set to zero*/
|
||||||
|
#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) \
|
||||||
|
cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, 0, gfp)
|
||||||
|
#else
|
||||||
|
#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) \
|
||||||
|
cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) && !defined(COMPAT_KERNEL_RELEASE)
|
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) && !defined(COMPAT_KERNEL_RELEASE)
|
||||||
|
|||||||
@@ -1395,8 +1395,8 @@ void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_a
|
|||||||
extern void* rtw_malloc2d(int h, int w, int size);
|
extern void* rtw_malloc2d(int h, int w, int size);
|
||||||
extern void rtw_mfree2d(void *pbuf, int h, int w, int size);
|
extern void rtw_mfree2d(void *pbuf, int h, int w, int size);
|
||||||
|
|
||||||
extern void _rtw_memcpy(void* dec, void* sour, u32 sz);
|
extern void _rtw_memcpy(void *dec, const void *sour, u32 sz);
|
||||||
extern int _rtw_memcmp(void *dst, void *src, u32 sz);
|
extern int _rtw_memcmp(const void *dst, const void *src, u32 sz);
|
||||||
extern void _rtw_memset(void *pbuf, int c, u32 sz);
|
extern void _rtw_memset(void *pbuf, int c, u32 sz);
|
||||||
|
|
||||||
extern void _rtw_init_listhead(_list *list);
|
extern void _rtw_init_listhead(_list *list);
|
||||||
|
|||||||
@@ -63,10 +63,11 @@ u8 rtw_set_802_11_bssid_list_scan(_adapter* padapter, NDIS_802_11_SSID *pssid, i
|
|||||||
u8 rtw_set_802_11_infrastructure_mode(_adapter * padapter, NDIS_802_11_NETWORK_INFRASTRUCTURE networktype);
|
u8 rtw_set_802_11_infrastructure_mode(_adapter * padapter, NDIS_802_11_NETWORK_INFRASTRUCTURE networktype);
|
||||||
u8 rtw_set_802_11_remove_wep(_adapter * padapter, u32 keyindex);
|
u8 rtw_set_802_11_remove_wep(_adapter * padapter, u32 keyindex);
|
||||||
u8 rtw_set_802_11_ssid(_adapter * padapter, NDIS_802_11_SSID * ssid);
|
u8 rtw_set_802_11_ssid(_adapter * padapter, NDIS_802_11_SSID * ssid);
|
||||||
u8 rtw_set_802_11_connect(_adapter* padapter, u8 *bssid, NDIS_802_11_SSID *ssid);
|
u8 rtw_set_802_11_connect(_adapter *padapter, const u8 *bssid
|
||||||
|
, NDIS_802_11_SSID *ssid);
|
||||||
u8 rtw_set_802_11_remove_key(_adapter * padapter, NDIS_802_11_REMOVE_KEY * key);
|
u8 rtw_set_802_11_remove_key(_adapter * padapter, NDIS_802_11_REMOVE_KEY * key);
|
||||||
|
|
||||||
u8 rtw_validate_bssid(u8 *bssid);
|
u8 rtw_validate_bssid(const u8 *bssid);
|
||||||
u8 rtw_validate_ssid(NDIS_802_11_SSID *ssid);
|
u8 rtw_validate_ssid(NDIS_802_11_SSID *ssid);
|
||||||
|
|
||||||
u16 rtw_get_cur_max_rate(_adapter *adapter);
|
u16 rtw_get_cur_max_rate(_adapter *adapter);
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ struct sta_priv {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
__inline static u32 wifi_mac_hash(u8 *mac)
|
__inline static u32 wifi_mac_hash(const u8 *mac)
|
||||||
{
|
{
|
||||||
u32 x;
|
u32 x;
|
||||||
|
|
||||||
@@ -423,7 +423,7 @@ struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int offset)
|
|||||||
extern struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr);
|
extern struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr);
|
||||||
extern u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta);
|
extern u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta);
|
||||||
extern void rtw_free_all_stainfo(_adapter *padapter);
|
extern void rtw_free_all_stainfo(_adapter *padapter);
|
||||||
extern struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr);
|
extern struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr);
|
||||||
extern u32 rtw_init_bcmc_stainfo(_adapter* padapter);
|
extern u32 rtw_init_bcmc_stainfo(_adapter* padapter);
|
||||||
extern struct sta_info* rtw_get_bcmc_stainfo(_adapter* padapter);
|
extern struct sta_info* rtw_get_bcmc_stainfo(_adapter* padapter);
|
||||||
extern u8 rtw_access_ctrl(_adapter *padapter, u8 *mac_addr);
|
extern u8 rtw_access_ctrl(_adapter *padapter, u8 *mac_addr);
|
||||||
|
|||||||
@@ -425,7 +425,7 @@ enum WIFI_REG_DOMAIN {
|
|||||||
(addr[4] == 0xff) && (addr[5] == 0xff) ) ? _TRUE : _FALSE \
|
(addr[4] == 0xff) && (addr[5] == 0xff) ) ? _TRUE : _FALSE \
|
||||||
)
|
)
|
||||||
|
|
||||||
__inline static int IS_MCAST(unsigned char *da)
|
__inline static int IS_MCAST(const unsigned char *da)
|
||||||
{
|
{
|
||||||
if ((*da) & 0x01)
|
if ((*da) & 0x01)
|
||||||
return _TRUE;
|
return _TRUE;
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ static int rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_network *pnet
|
|||||||
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, *pbuf;
|
||||||
size_t len,bssinf_len=0;
|
size_t len,bssinf_len=0;
|
||||||
struct rtw_ieee80211_hdr *pwlanhdr;
|
struct rtw_ieee80211_hdr *pwlanhdr;
|
||||||
unsigned short *fctrl;
|
unsigned short *fctrl;
|
||||||
@@ -459,6 +459,7 @@ static int rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_network *pnet
|
|||||||
DBG_8192C("notify_timestamp: %#018llx\n", notify_timestamp);
|
DBG_8192C("notify_timestamp: %#018llx\n", notify_timestamp);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
buf = rtw_zmalloc(MAX_BSSINFO_LEN);
|
||||||
pbuf = buf;
|
pbuf = buf;
|
||||||
|
|
||||||
pwlanhdr = (struct rtw_ieee80211_hdr *)pbuf;
|
pwlanhdr = (struct rtw_ieee80211_hdr *)pbuf;
|
||||||
@@ -486,6 +487,8 @@ static int rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_network *pnet
|
|||||||
_rtw_memcpy(pbuf, pnetwork->network.IEs, pnetwork->network.IELength);
|
_rtw_memcpy(pbuf, pnetwork->network.IEs, pnetwork->network.IELength);
|
||||||
len += pnetwork->network.IELength;
|
len += pnetwork->network.IELength;
|
||||||
|
|
||||||
|
rtw_mfree(buf, MAX_BSSINFO_LEN);
|
||||||
|
|
||||||
//#ifdef CONFIG_P2P
|
//#ifdef CONFIG_P2P
|
||||||
//if(rtw_get_p2p_ie(pnetwork->network.IEs+12, pnetwork->network.IELength-12, NULL, NULL))
|
//if(rtw_get_p2p_ie(pnetwork->network.IEs+12, pnetwork->network.IELength-12, NULL, NULL))
|
||||||
//{
|
//{
|
||||||
@@ -577,7 +580,11 @@ int rtw_cfg80211_check_bss(_adapter *padapter)
|
|||||||
bss = cfg80211_get_bss(padapter->rtw_wdev->wiphy, notify_channel,
|
bss = cfg80211_get_bss(padapter->rtw_wdev->wiphy, notify_channel,
|
||||||
pnetwork->MacAddress, pnetwork->Ssid.Ssid,
|
pnetwork->MacAddress, pnetwork->Ssid.Ssid,
|
||||||
pnetwork->Ssid.SsidLength,
|
pnetwork->Ssid.SsidLength,
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)
|
||||||
WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
|
WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
|
||||||
|
#else
|
||||||
|
IEEE80211_BSS_TYPE_ESS, IEEE80211_PRIVACY_ANY);
|
||||||
|
#endif
|
||||||
|
|
||||||
return (bss!=NULL);
|
return (bss!=NULL);
|
||||||
}
|
}
|
||||||
@@ -700,13 +707,16 @@ void rtw_cfg80211_indicate_disconnect(_adapter *padapter)
|
|||||||
if (!padapter->mlmepriv.not_indic_disco) {
|
if (!padapter->mlmepriv.not_indic_disco) {
|
||||||
DBG_8192C("pwdev->sme_state(b)=%d\n", pwdev->sme_state);
|
DBG_8192C("pwdev->sme_state(b)=%d\n", pwdev->sme_state);
|
||||||
|
|
||||||
if(pwdev->sme_state==CFG80211_SME_CONNECTING)
|
if (check_fwstate(pmlmepriv, WIFI_UNDER_LINKING)) {
|
||||||
cfg80211_connect_result(padapter->pnetdev, NULL, NULL, 0, NULL, 0,
|
cfg80211_connect_result(padapter->pnetdev, NULL, NULL, 0, NULL, 0,
|
||||||
WLAN_STATUS_UNSPECIFIED_FAILURE, GFP_ATOMIC/*GFP_KERNEL*/);
|
WLAN_STATUS_UNSPECIFIED_FAILURE, GFP_ATOMIC/*GFP_KERNEL*/);
|
||||||
else if(pwdev->sme_state==CFG80211_SME_CONNECTED)
|
} else {
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
|
||||||
cfg80211_disconnected(padapter->pnetdev, 0, NULL, 0, GFP_ATOMIC);
|
cfg80211_disconnected(padapter->pnetdev, 0, NULL, 0, GFP_ATOMIC);
|
||||||
//else
|
#else
|
||||||
//DBG_8192C("pwdev->sme_state=%d\n", pwdev->sme_state);
|
cfg80211_disconnected(padapter->pnetdev, 0, NULL, 0, false, GFP_ATOMIC);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
DBG_8192C("pwdev->sme_state(a)=%d\n", pwdev->sme_state);
|
DBG_8192C("pwdev->sme_state(a)=%d\n", pwdev->sme_state);
|
||||||
}
|
}
|
||||||
@@ -1549,7 +1559,7 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
|
|||||||
|
|
||||||
static int cfg80211_rtw_get_station(struct wiphy *wiphy,
|
static int cfg80211_rtw_get_station(struct wiphy *wiphy,
|
||||||
struct net_device *ndev,
|
struct net_device *ndev,
|
||||||
u8 *mac, struct station_info *sinfo)
|
const u8 *mac, struct station_info *sinfo)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
_adapter *padapter = wiphy_to_adapter(wiphy);
|
_adapter *padapter = wiphy_to_adapter(wiphy);
|
||||||
@@ -1589,16 +1599,32 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy,
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
|
||||||
|
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
|
||||||
|
#else
|
||||||
sinfo->filled |= STATION_INFO_SIGNAL;
|
sinfo->filled |= STATION_INFO_SIGNAL;
|
||||||
|
#endif
|
||||||
sinfo->signal = translate_percentage_to_dbm(padapter->recvpriv.signal_strength);
|
sinfo->signal = translate_percentage_to_dbm(padapter->recvpriv.signal_strength);
|
||||||
|
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
|
||||||
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
|
||||||
|
#else
|
||||||
sinfo->filled |= STATION_INFO_TX_BITRATE;
|
sinfo->filled |= STATION_INFO_TX_BITRATE;
|
||||||
|
#endif
|
||||||
sinfo->txrate.legacy = rtw_get_cur_max_rate(padapter);
|
sinfo->txrate.legacy = rtw_get_cur_max_rate(padapter);
|
||||||
|
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
|
||||||
|
sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS);
|
||||||
|
#else
|
||||||
sinfo->filled |= STATION_INFO_RX_PACKETS;
|
sinfo->filled |= STATION_INFO_RX_PACKETS;
|
||||||
|
#endif
|
||||||
sinfo->rx_packets = sta_rx_data_pkts(psta);
|
sinfo->rx_packets = sta_rx_data_pkts(psta);
|
||||||
|
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
|
||||||
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_PACKETS);
|
||||||
|
#else
|
||||||
sinfo->filled |= STATION_INFO_TX_PACKETS;
|
sinfo->filled |= STATION_INFO_TX_PACKETS;
|
||||||
|
#endif
|
||||||
sinfo->tx_packets = psta->sta_stats.tx_pkts;
|
sinfo->tx_packets = psta->sta_stats.tx_pkts;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2419,7 +2445,7 @@ static int rtw_cfg80211_set_key_mgt(struct security_priv *psecuritypriv, u32 key
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_cfg80211_set_wpa_ie(_adapter *padapter, u8 *pie, size_t ielen)
|
static int rtw_cfg80211_set_wpa_ie(_adapter *padapter, const u8 *pie, size_t ielen)
|
||||||
{
|
{
|
||||||
u8 *buf=NULL, *pos=NULL;
|
u8 *buf=NULL, *pos=NULL;
|
||||||
u32 left;
|
u32 left;
|
||||||
@@ -3089,7 +3115,9 @@ void rtw_cfg80211_indicate_sta_assoc(_adapter *padapter, u8 *pmgmt_frame, uint f
|
|||||||
ie_offset = _REASOCREQ_IE_OFFSET_;
|
ie_offset = _REASOCREQ_IE_OFFSET_;
|
||||||
|
|
||||||
sinfo.filled = 0;
|
sinfo.filled = 0;
|
||||||
|
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0))
|
||||||
sinfo.filled = STATION_INFO_ASSOC_REQ_IES;
|
sinfo.filled = STATION_INFO_ASSOC_REQ_IES;
|
||||||
|
#endif
|
||||||
sinfo.assoc_req_ies = pmgmt_frame + WLAN_HDR_A3_LEN + ie_offset;
|
sinfo.assoc_req_ies = pmgmt_frame + WLAN_HDR_A3_LEN + ie_offset;
|
||||||
sinfo.assoc_req_ies_len = frame_len - WLAN_HDR_A3_LEN - ie_offset;
|
sinfo.assoc_req_ies_len = frame_len - WLAN_HDR_A3_LEN - ie_offset;
|
||||||
cfg80211_new_sta(ndev, GetAddr2Ptr(pmgmt_frame), &sinfo, GFP_ATOMIC);
|
cfg80211_new_sta(ndev, GetAddr2Ptr(pmgmt_frame), &sinfo, GFP_ATOMIC);
|
||||||
@@ -3387,7 +3415,11 @@ static const struct net_device_ops rtw_cfg80211_monitor_if_ops = {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0))
|
||||||
|
static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, unsigned char name_assign_type, struct net_device **ndev)
|
||||||
|
#else
|
||||||
static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct net_device **ndev)
|
static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct net_device **ndev)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
struct net_device* mon_ndev = NULL;
|
struct net_device* mon_ndev = NULL;
|
||||||
@@ -3418,6 +3450,9 @@ 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,1,0))
|
||||||
|
mon_ndev->name_assign_type = name_assign_type;
|
||||||
|
#endif
|
||||||
mon_ndev->destructor = rtw_ndev_destructor;
|
mon_ndev->destructor = rtw_ndev_destructor;
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
|
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
|
||||||
@@ -3482,6 +3517,9 @@ static int
|
|||||||
#else
|
#else
|
||||||
char *name,
|
char *name,
|
||||||
#endif
|
#endif
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0))
|
||||||
|
unsigned char name_assign_type,
|
||||||
|
#endif
|
||||||
enum nl80211_iftype type, u32 *flags, struct vif_params *params)
|
enum nl80211_iftype type, u32 *flags, struct vif_params *params)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@@ -3499,7 +3537,11 @@ static int
|
|||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
break;
|
break;
|
||||||
case NL80211_IFTYPE_MONITOR:
|
case NL80211_IFTYPE_MONITOR:
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0))
|
||||||
|
ret = rtw_cfg80211_add_monitor_if(padapter, (char *)name, name_assign_type, &ndev);
|
||||||
|
#else
|
||||||
ret = rtw_cfg80211_add_monitor_if(padapter, (char *)name, &ndev);
|
ret = rtw_cfg80211_add_monitor_if(padapter, (char *)name, &ndev);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#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)
|
||||||
@@ -3760,7 +3802,7 @@ static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
|
|||||||
#endif //(LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
|
#endif //(LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
|
||||||
|
|
||||||
static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev,
|
static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev,
|
||||||
u8 *mac, struct station_parameters *params)
|
const u8 *mac, struct station_parameters *params)
|
||||||
{
|
{
|
||||||
DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
|
DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
|
||||||
|
|
||||||
@@ -3768,8 +3810,15 @@ static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev,
|
static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev,
|
||||||
u8 *mac)
|
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0))
|
||||||
|
u8 *mac) {
|
||||||
|
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0))
|
||||||
|
const u8 *mac) {
|
||||||
|
#else
|
||||||
|
struct station_del_parameters *params)
|
||||||
{
|
{
|
||||||
|
const u8 *mac = params->mac;
|
||||||
|
#endif
|
||||||
int ret=0;
|
int ret=0;
|
||||||
_irqL irqL;
|
_irqL irqL;
|
||||||
_list *phead, *plist;
|
_list *phead, *plist;
|
||||||
@@ -3859,7 +3908,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev,
|
static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev,
|
||||||
u8 *mac, struct station_parameters *params)
|
const u8 *mac, struct station_parameters *params)
|
||||||
{
|
{
|
||||||
DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
|
DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
|
||||||
|
|
||||||
@@ -4643,6 +4692,9 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
|
|||||||
#else
|
#else
|
||||||
struct net_device *ndev,
|
struct net_device *ndev,
|
||||||
#endif
|
#endif
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
|
||||||
|
struct cfg80211_mgmt_tx_params *params,
|
||||||
|
#else
|
||||||
struct ieee80211_channel *chan,
|
struct ieee80211_channel *chan,
|
||||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
|
||||||
bool offchan,
|
bool offchan,
|
||||||
@@ -4662,9 +4714,16 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
|
|||||||
#endif
|
#endif
|
||||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
|
||||||
bool dont_wait_for_ack,
|
bool dont_wait_for_ack,
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
u64 *cookie)
|
u64 *cookie)
|
||||||
{
|
{
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
|
||||||
|
struct ieee80211_channel *chan = params->chan;
|
||||||
|
const u8 *buf = params->buf;
|
||||||
|
size_t len = params->len;
|
||||||
|
#endif
|
||||||
|
|
||||||
_adapter *padapter = (_adapter *)wiphy_to_adapter(wiphy);
|
_adapter *padapter = (_adapter *)wiphy_to_adapter(wiphy);
|
||||||
struct rtw_wdev_priv *pwdev_priv = wdev_to_priv(padapter->rtw_wdev);
|
struct rtw_wdev_priv *pwdev_priv = wdev_to_priv(padapter->rtw_wdev);
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|||||||
@@ -790,7 +790,7 @@ void rtw_mfree2d(void *pbuf, int h, int w, int size)
|
|||||||
rtw_mfree((u8 *)pbuf, h*sizeof(void*) + w*h*size);
|
rtw_mfree((u8 *)pbuf, h*sizeof(void*) + w*h*size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _rtw_memcpy(void* dst, void* src, u32 sz)
|
void _rtw_memcpy(void* dst, const void* src, u32 sz)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if defined (PLATFORM_LINUX)|| defined (PLATFORM_FREEBSD)
|
#if defined (PLATFORM_LINUX)|| defined (PLATFORM_FREEBSD)
|
||||||
@@ -807,7 +807,7 @@ void _rtw_memcpy(void* dst, void* src, u32 sz)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int _rtw_memcmp(void *dst, void *src, u32 sz)
|
int _rtw_memcmp(const void *dst, const void *src, u32 sz)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if defined (PLATFORM_LINUX)|| defined (PLATFORM_FREEBSD)
|
#if defined (PLATFORM_LINUX)|| defined (PLATFORM_FREEBSD)
|
||||||
|
|||||||
Reference in New Issue
Block a user