From 8eec8cd4a35d3a5497881a39066e2e2a978cf528 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Mon, 11 Nov 2019 02:04:51 +0100 Subject: [PATCH] Some overall fixes.. includes + various --- core/rtw_mlme_ext.c | 9 ++------- core/rtw_xmit.c | 8 +------- include/drv_types.h | 13 ++----------- os_dep/linux/ioctl_cfg80211.c | 6 +++++- os_dep/linux/os_intfs.c | 7 ------- 5 files changed, 10 insertions(+), 33 deletions(-) diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 1452983..c1ccd39 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -20,7 +20,6 @@ #endif /* CONFIG_IOCTL_CFG80211 */ #include - struct mlme_handler mlme_sta_tbl[] = { {WIFI_ASSOCREQ, "OnAssocReq", &OnAssocReq}, {WIFI_ASSOCRSP, "OnAssocRsp", &OnAssocRsp}, @@ -8619,7 +8618,6 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status pframe += sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); - if (psta) { /* for AP mode */ #ifdef CONFIG_NATIVEAP_MLME @@ -8627,18 +8625,15 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status _rtw_memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN); _rtw_memcpy(pwlanhdr->addr3, adapter_mac_addr(padapter), ETH_ALEN); - /* setting auth algo number */ val16 = (u16)psta->authalg; - if (status != _STATS_SUCCESSFUL_) - val16 = 0; - if (val16) { val16 = cpu_to_le16(val16); use_shared_key = 1; + } else { + val16 = 0; } - pframe = rtw_set_fixed_ie(pframe, _AUTH_ALGM_NUM_, (unsigned char *)&val16, &(pattrib->pktlen)); /* setting auth seq number */ diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index 80de669..f795600 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -16,11 +16,7 @@ #include #include - -#if defined(PLATFORM_LINUX) && defined (PLATFORM_WINDOWS) - #error "Shall be Linux or Windows, but not both!\n" -#endif - +#include static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 }; static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 }; @@ -32,11 +28,9 @@ static void _init_txservq(struct tx_servq *ptxservq) ptxservq->qcnt = 0; } - void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv) { - _rtw_memset((unsigned char *)psta_xmitpriv, 0, sizeof(struct sta_xmit_priv)); _rtw_spinlock_init(&psta_xmitpriv->lock); diff --git a/include/drv_types.h b/include/drv_types.h index 804129a..7ccd643 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -18,7 +18,6 @@ --------------------------------------------------------------------------------*/ - #ifndef __DRV_TYPES_H__ #define __DRV_TYPES_H__ @@ -34,14 +33,6 @@ #include #endif -#ifdef PLATFORM_OS_XP - #include -#endif - -#ifdef PLATFORM_OS_CE - #include -#endif - #ifdef PLATFORM_LINUX #include #endif @@ -91,7 +82,7 @@ typedef struct _ADAPTER _adapter, ADAPTER, *PADAPTER; #include #include #include -#include +#include #include #include "../hal/hal_dm.h" #include @@ -105,7 +96,7 @@ typedef struct _ADAPTER _adapter, ADAPTER, *PADAPTER; #include #include #include -#include +#include "sta_info.h" #include #include #include diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 65c8c65..688f824 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -4838,7 +4838,11 @@ static int cfg80211_rtw_del_virtual_intf(struct wiphy *wiphy, pwdev_priv = adapter_wdev_data(adapter); if (ndev == pwdev_priv->pmon_ndev) { - unregister_netdevice(ndev); + /* unregister only monitor device + * because only monitor can be added + */ + if(wdev->iftype == NL80211_IFTYPE_MONITOR) + unregister_netdevice(ndev); pwdev_priv->pmon_ndev = NULL; pwdev_priv->ifname_mon[0] = '\0'; RTW_INFO(FUNC_NDEV_FMT" remove monitor ndev\n", FUNC_NDEV_ARG(ndev)); diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index ae8df8e..2febe88 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -17,13 +17,6 @@ #include #include -#if defined(PLATFORM_LINUX) && defined (PLATFORM_WINDOWS) - - #error "Shall be Linux or Windows, but not both!\n" - -#endif - - MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Realtek Wireless Lan Driver"); MODULE_AUTHOR("Realtek Semiconductor Corp.");