Fix a minor in kernel 5.10 support

This commit is contained in:
kimocoder
2020-12-28 19:40:46 +01:00
parent e83ab1dff4
commit 783b361591
12 changed files with 23 additions and 55 deletions

View File

@@ -1,6 +1,6 @@
config RTL8188EU
tristate "Realtek 8188E USB WiFi"
depends on USB
---help---
help
Help message of RTL8188EU

0
Makefile Executable file → Normal file
View File

View File

@@ -45,9 +45,7 @@ static u8 SNAP_ETH_TYPE_APPLETALK_AARP[2] = {0x80, 0xf3};
static u8 SNAP_ETH_TYPE_TDLS[2] = {0x89, 0x0d};
#endif
#ifdef CONFIG_CUSTOMER_ALIBABA_GENERAL
int recv_frame_monitor(_adapter *padapter, union recv_frame *rframe);
#endif
void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)
{
@@ -1395,14 +1393,12 @@ sint ap2sta_data_frame(
RTW_INFO("DBG_RX_DROP_FRAME "FUNC_ADPT_FMT" BSSID="MAC_FMT", mybssid="MAC_FMT"\n"
, FUNC_ADPT_ARG(adapter), MAC_ARG(pattrib->bssid), MAC_ARG(mybssid));
#endif
#ifndef CONFIG_CUSTOMER_ALIBABA_GENERAL
if (!bmcast
&& !IS_RADAR_DETECTED(adapter_to_rfctl(adapter))
) {
RTW_INFO(ADPT_FMT" -issue_deauth to the nonassociated ap=" MAC_FMT " for the reason(7)\n", ADPT_ARG(adapter), MAC_ARG(pattrib->bssid));
issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
}
#endif
ret = _FAIL;
goto exit;
}
@@ -1509,10 +1505,8 @@ sint sta2ap_data_frame(
*psta = rtw_get_stainfo(pstapriv, pattrib->ta);
if (*psta == NULL) {
if (!IS_RADAR_DETECTED(adapter_to_rfctl(adapter))) {
#ifndef CONFIG_CUSTOMER_ALIBABA_GENERAL
RTW_INFO("issue_deauth to sta=" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->src));
issue_deauth(adapter, pattrib->src, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
#endif
}
ret = RTW_RX_HANDLED;
@@ -1556,10 +1550,8 @@ sint sta2ap_data_frame(
ret = RTW_RX_HANDLED;
goto exit;
}
#ifndef CONFIG_CUSTOMER_ALIBABA_GENERAL
RTW_INFO("issue_deauth to sta=" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->src));
issue_deauth(adapter, pattrib->src, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
#endif
ret = RTW_RX_HANDLED;
goto exit;
}
@@ -4112,14 +4104,13 @@ int recv_frame_monitor(_adapter *padapter, union recv_frame *rframe)
pskb->data = rframe->u.hdr.rx_data;
skb_set_tail_pointer(pskb, rframe->u.hdr.len);
#ifndef CONFIG_CUSTOMER_ALIBABA_GENERAL
/* fill radiotap header */
if (fill_radiotap_hdr(padapter, rframe, (u8 *)pskb) == _FAIL) {
ret = _FAIL;
rtw_free_recvframe(rframe, pfree_recv_queue); /* free this recv_frame */
goto exit;
}
#endif
/* write skb information to recv frame */
skb_reset_mac_header(pskb);
rframe->u.hdr.len = pskb->len;
@@ -4298,10 +4289,8 @@ int recv_func(_adapter *padapter, union recv_frame *rframe)
struct recv_priv *recvpriv = &padapter->recvpriv;
struct security_priv *psecuritypriv = &padapter->securitypriv;
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
#ifdef CONFIG_CUSTOMER_ALIBABA_GENERAL
u8 type;
u8 *ptr = rframe->u.hdr.rx_data;
#endif
if (check_fwstate(mlmepriv, WIFI_MONITOR_STATE)) {
/* monitor mode */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24))
@@ -4311,7 +4300,6 @@ int recv_func(_adapter *padapter, union recv_frame *rframe)
goto exit;
} else
{}
#ifdef CONFIG_CUSTOMER_ALIBABA_GENERAL
type = GetFrameType(ptr);
if ((type == WIFI_DATA_TYPE)&& check_fwstate(mlmepriv, WIFI_STATION_STATE)) {
struct wlan_network *cur_network = &(mlmepriv->cur_network);
@@ -4321,7 +4309,6 @@ int recv_func(_adapter *padapter, union recv_frame *rframe)
goto exit;
}
}
#endif
/* check if need to handle uc_swdec_pending_queue*/
if (check_fwstate(mlmepriv, WIFI_STATION_STATE) && psecuritypriv->busetkipkey) {
union recv_frame *pending_frame;

View File

@@ -4456,7 +4456,6 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize);
#ifndef CONFIG_CUSTOMER_ALIBABA_GENERAL
if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header)))
goto fail;
@@ -4480,7 +4479,7 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
}
_rtw_pktfile_read(&pktfile, dummybuf, rtap_len-sizeof(struct ieee80211_radiotap_header));
len = len - rtap_len;
#endif
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
if (pmgntframe == NULL) {
rtw_udelay_os(500);

View File

@@ -1,5 +1,5 @@
PACKAGE_NAME="realtek-rtl8188eus"
PACKAGE_VERSION="5.7.6.1~20200205"
PACKAGE_VERSION="5.7.6.1~20201228"
CLEAN="'make' clean"
BUILT_MODULE_NAME[0]=8188eu
PROCS_NUM=`nproc`

View File

@@ -102,7 +102,7 @@ void rtw_sw_led_blink_uc_trx_only(LED_DATA *led)
led->BlinkingLedState = RTW_LED_OFF;
else
led->BlinkingLedState = RTW_LED_ON;
if (bStopBlinking) {
led->CurrLedState = RTW_LED_OFF;
led->bLedBlinkInProgress = _FALSE;
@@ -225,7 +225,7 @@ void rtw_led_set_iface_en_mask(_adapter *adapter, u8 mask)
void rtw_led_set_ctl_en_mask(_adapter *adapter, u32 ctl_mask)
{
struct led_priv *ledpriv = adapter_to_led(adapter);
#if CONFIG_RTW_SW_LED_TRX_DA_CLASSIFY
if (ctl_mask & BIT(LED_CTL_TX))
ctl_mask |= BIT(LED_CTL_UC_TX) | BIT(LED_CTL_BMC_TX);

View File

@@ -1073,7 +1073,7 @@ SwLedBlink9(
if (adapter_to_pwrctl(Adapter)->rf_pwrstate != rf_on && adapter_to_pwrctl(Adapter)->rfoff_reason > RF_CHANGE_BY_PS)
SwLedOff(Adapter, pLed);
else {
if (IS_HARDWARE_TYPE_8812AU(Adapter)) {
if (IS_HARDWARE_TYPE_8188E(Adapter)) {
pLed->BlinkingLedState = RTW_LED_ON;
pLed->CurrLedState = LED_BLINK_ALWAYS_ON;
} else {
@@ -1091,7 +1091,7 @@ SwLedBlink9(
if (adapter_to_pwrctl(Adapter)->rf_pwrstate != rf_on && adapter_to_pwrctl(Adapter)->rfoff_reason > RF_CHANGE_BY_PS) {
SwLedOff(Adapter, pLed);
} else {
if (IS_HARDWARE_TYPE_8812AU(Adapter))
if (IS_HARDWARE_TYPE_8188E(Adapter))
pLed->BlinkingLedState = RTW_LED_ON;
else {
if (pLed->bLedOn)
@@ -1273,7 +1273,7 @@ SwLedBlink10(
if (adapter_to_pwrctl(Adapter)->rf_pwrstate != rf_on && adapter_to_pwrctl(Adapter)->rfoff_reason > RF_CHANGE_BY_PS)
SwLedOff(Adapter, pLed);
else {
if (IS_HARDWARE_TYPE_8812AU(Adapter)) {
if (IS_HARDWARE_TYPE_8188E(Adapter)) {
pLed->BlinkingLedState = RTW_LED_ON;
pLed->CurrLedState = LED_BLINK_ALWAYS_ON;
} else {
@@ -1291,7 +1291,7 @@ SwLedBlink10(
if (adapter_to_pwrctl(Adapter)->rf_pwrstate != rf_on && adapter_to_pwrctl(Adapter)->rfoff_reason > RF_CHANGE_BY_PS) {
SwLedOff(Adapter, pLed);
} else {
if (IS_HARDWARE_TYPE_8812AU(Adapter))
if (IS_HARDWARE_TYPE_8188E(Adapter))
pLed->BlinkingLedState = RTW_LED_ON;
else {
if (pLed->bLedOn)
@@ -1574,13 +1574,13 @@ SwLedBlink14(
else {
if (pLed->bLedOn) {
pLed->BlinkingLedState = RTW_LED_OFF;
if (IS_HARDWARE_TYPE_8812AU(Adapter))
if (IS_HARDWARE_TYPE_8188E(Adapter))
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LINK_INTERVAL_ALPHA);
else
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
} else {
pLed->BlinkingLedState = RTW_LED_ON;
if (IS_HARDWARE_TYPE_8812AU(Adapter))
if (IS_HARDWARE_TYPE_8188E(Adapter))
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
else
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
@@ -3171,7 +3171,7 @@ SwLedControlMode9(
}
pLed->bLedNoLinkBlinkInProgress = _TRUE;
if (IS_HARDWARE_TYPE_8812AU(Adapter)) {
if (IS_HARDWARE_TYPE_8188E(Adapter)) {
if (LedAction == LED_CTL_LINK) {
pLed->BlinkingLedState = RTW_LED_ON;
pLed->CurrLedState = LED_BLINK_SLOWLY;
@@ -3936,7 +3936,7 @@ SwLedControlMode14(
case LED_CTL_LINK:
case LED_CTL_NO_LINK:
if (IS_HARDWARE_TYPE_8812AU(Adapter))
if (IS_HARDWARE_TYPE_8188E(Adapter))
SwLedOn(Adapter, pLed);
break;
@@ -3948,13 +3948,13 @@ SwLedControlMode14(
pLed->BlinkTimes = 2;
if (pLed->bLedOn) {
pLed->BlinkingLedState = RTW_LED_OFF;
if (IS_HARDWARE_TYPE_8812AU(Adapter))
if (IS_HARDWARE_TYPE_8188E(Adapter))
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LINK_INTERVAL_ALPHA);
else
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
} else {
pLed->BlinkingLedState = RTW_LED_ON;
if (IS_HARDWARE_TYPE_8812AU(Adapter))
if (IS_HARDWARE_TYPE_8188E(Adapter))
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
else
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);

View File

@@ -3363,15 +3363,14 @@ static void hw_var_set_monitor(PADAPTER Adapter, u8 variable, u8 *val)
struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv);
if (*((u8 *)val) == _HW_STATE_MONITOR_) {
#ifdef CONFIG_CUSTOMER_ALIBABA_GENERAL
rcr_bits = RCR_AAP | RCR_APM | RCR_AM | RCR_AB | RCR_APWRMGT | RCR_ADF | RCR_AMF | RCR_APP_PHYST_RXFF;
#else
/* Receive all type */
rcr_bits = RCR_AAP | RCR_APM | RCR_AM | RCR_AB | RCR_APWRMGT | RCR_ADF | RCR_ACF | RCR_AMF | RCR_APP_PHYST_RXFF;
/* Append FCS */
rcr_bits |= RCR_APPFCS;
#endif
#if 0
/*
CRC and ICV packet will drop in recvbuf2recvframe()

View File

@@ -119,19 +119,7 @@
#endif
#ifdef CONFIG_WIFI_MONITOR
/* #define CONFIG_MONITOR_MODE_XMIT */
#endif
#ifdef CONFIG_CUSTOMER_ALIBABA_GENERAL
#ifndef CONFIG_WIFI_MONITOR
#define CONFIG_WIFI_MONITOR
#endif
#ifndef CONFIG_MONITOR_MODE_XMIT
#define CONFIG_MONITOR_MODE_XMIT
#endif
#ifdef CONFIG_POWER_SAVING
#undef CONFIG_POWER_SAVING
#endif
#endif
#ifdef CONFIG_CUSTOMER01_SMART_ANTENNA
@@ -144,6 +132,7 @@
#endif
#ifdef CONFIG_AP_MODE
/* #define CONFIG_LIMITED_AP_NUM 1 */
#define CONFIG_TX_MCAST2UNI /* AP mode support IP multicast->unicast */
#endif

View File

@@ -87,7 +87,7 @@ typedef struct _ADAPTER _adapter, ADAPTER, *PADAPTER;
#include <rtw_sreset.h>
#include <hal_intf.h>
#include <hal_com.h>
#include<hal_com_h2c.h>
#include <hal_com_h2c.h>
#include <hal_com_led.h>
#include "../hal/hal_dm.h"
#include <rtw_qos.h>

View File

@@ -712,17 +712,11 @@ static int rtw_cfg80211_sync_iftype(_adapter *adapter)
static u64 rtw_get_systime_us(void)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
struct timespec64 ts;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0))
return ktime_to_us(ktime_get_boottime());
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
struct timespec ts;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
getboottime64(&ts);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0))
getboottime(&ts);
#else
get_monotonic_boottime(&ts);
#endif
return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000;
#else
struct timeval tv;

View File

@@ -2245,7 +2245,7 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
if (0 == ret) {
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0))
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs();
set_fs(KERNEL_DS);
#endif