mirror of
https://github.com/RinCat/RTL88x2BU-Linux-Driver.git
synced 2026-01-19 10:26:35 +00:00
Update to 5.8.7.1
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2019 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -175,9 +175,6 @@ struct rtw_wdev_priv {
|
||||
u16 mgmt_tx_cookie;
|
||||
|
||||
_mutex roch_mutex;
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
|
||||
u32 mgmt_mask;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
ATOMIC_T switch_ch_to;
|
||||
@@ -242,6 +239,9 @@ struct rtw_wiphy_data {
|
||||
#if defined(RTW_DEDICATED_P2P_DEVICE)
|
||||
struct wireless_dev *pd_wdev; /* P2P device wdev */
|
||||
#endif
|
||||
|
||||
s16 txpwr_total_lmt_mbm;
|
||||
s16 txpwr_total_target_mbm;
|
||||
};
|
||||
|
||||
#define rtw_wiphy_priv(wiphy) ((struct rtw_wiphy_data *)wiphy_priv(wiphy))
|
||||
@@ -285,6 +285,8 @@ int rtw_cfg80211_dev_res_alloc(struct dvobj_priv *dvobj);
|
||||
void rtw_cfg80211_dev_res_free(struct dvobj_priv *dvobj);
|
||||
int rtw_cfg80211_dev_res_register(struct dvobj_priv *dvobj);
|
||||
void rtw_cfg80211_dev_res_unregister(struct dvobj_priv *dvobj);
|
||||
s16 rtw_cfg80211_dev_get_total_txpwr_lmt_mbm(struct dvobj_priv *dvobj);
|
||||
s16 rtw_cfg80211_dev_get_total_txpwr_target_mbm(struct dvobj_priv *dvobj);
|
||||
|
||||
void rtw_cfg80211_init_wdev_data(_adapter *padapter);
|
||||
void rtw_cfg80211_init_wiphy(_adapter *padapter);
|
||||
@@ -294,7 +296,7 @@ void rtw_cfg80211_surveydone_event_callback(_adapter *padapter);
|
||||
struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_network *pnetwork);
|
||||
int rtw_cfg80211_check_bss(_adapter *padapter);
|
||||
void rtw_cfg80211_ibss_indicate_connect(_adapter *padapter);
|
||||
void rtw_cfg80211_indicate_connect(_adapter *padapter);
|
||||
int rtw_cfg80211_indicate_connect(_adapter *padapter);
|
||||
void rtw_cfg80211_indicate_disconnect(_adapter *padapter, u16 reason, u8 locally_generated);
|
||||
void rtw_cfg80211_indicate_scan_done(_adapter *adapter, bool aborted);
|
||||
u32 rtw_cfg80211_wait_scan_req_empty(_adapter *adapter, u32 timeout_ms);
|
||||
@@ -405,8 +407,10 @@ void rtw_cfg80211_deinit_rfkill(struct wiphy *wiphy);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0))
|
||||
#define rtw_cfg80211_notify_new_peer_candidate(wdev, addr, ie, ie_len, gfp) cfg80211_notify_new_peer_candidate(wdev_to_ndev(wdev), addr, ie, ie_len, gfp)
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0))
|
||||
#define rtw_cfg80211_notify_new_peer_candidate(wdev, addr, ie, ie_len, sig_dbm, gfp) cfg80211_notify_new_peer_candidate(wdev_to_ndev(wdev), addr, ie, ie_len, sig_dbm, gfp)
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0))
|
||||
#define rtw_cfg80211_notify_new_peer_candidate(wdev, addr, ie, ie_len, sig_dbm, gfp) cfg80211_notify_new_peer_candidate(wdev_to_ndev(wdev), addr, ie, ie_len, gfp)
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0))
|
||||
@@ -426,6 +430,13 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8
|
||||
(band == BAND_ON_2_4G) ? NL80211_BAND_2GHZ : \
|
||||
(band == BAND_ON_5G) ? NL80211_BAND_5GHZ : NUM_NL80211_BANDS
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36))
|
||||
#define NL80211_TX_POWER_AUTOMATIC TX_POWER_AUTOMATIC
|
||||
#define NL80211_TX_POWER_LIMITED TX_POWER_LIMITED
|
||||
#define NL80211_TX_POWER_FIXED TX_POWER_FIXED
|
||||
#endif
|
||||
|
||||
#include "wifi_regd.h"
|
||||
#include "rtw_cfgvendor.h"
|
||||
|
||||
#endif /* __IOCTL_CFG80211_H__ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2019 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -54,20 +54,30 @@ void Linkdown_workitem_callback(struct work_struct *work)
|
||||
extern void rtw_indicate_wx_assoc_event(_adapter *padapter);
|
||||
extern void rtw_indicate_wx_disassoc_event(_adapter *padapter);
|
||||
|
||||
void rtw_os_indicate_connect(_adapter *adapter)
|
||||
int rtw_os_indicate_connect(_adapter *adapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
|
||||
int err = 0;
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE) ||
|
||||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE))
|
||||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE)) {
|
||||
rtw_cfg80211_ibss_indicate_connect(adapter);
|
||||
else
|
||||
rtw_cfg80211_indicate_connect(adapter);
|
||||
} else {
|
||||
err = rtw_cfg80211_indicate_connect(adapter);
|
||||
if (err)
|
||||
return -1;
|
||||
}
|
||||
#endif /* CONFIG_IOCTL_CFG80211 */
|
||||
|
||||
rtw_indicate_wx_assoc_event(adapter);
|
||||
rtw_netif_carrier_on(adapter->pnetdev);
|
||||
|
||||
#ifdef CONFIG_RTW_MESH
|
||||
#if CONFIG_RTW_MESH_CTO_MGATE_CARRIER
|
||||
if (!rtw_mesh_cto_mgate_required(adapter))
|
||||
#endif
|
||||
#endif
|
||||
rtw_netif_carrier_on(adapter->pnetdev);
|
||||
|
||||
if (adapter->pid[2] != 0)
|
||||
rtw_signal_process(adapter->pid[2], SIGALRM);
|
||||
@@ -76,7 +86,7 @@ void rtw_os_indicate_connect(_adapter *adapter)
|
||||
_set_workitem(&adapter->mlmepriv.Linkup_workitem);
|
||||
#endif
|
||||
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
extern void indicate_wx_scan_complete_event(_adapter *padapter);
|
||||
@@ -167,9 +177,7 @@ void rtw_os_indicate_disconnect(_adapter *adapter, u16 reason, u8 locally_gener
|
||||
_set_workitem(&adapter->mlmepriv.Linkdown_workitem);
|
||||
#endif
|
||||
/* modify for CONFIG_IEEE80211W, none 11w also can use the same command */
|
||||
rtw_reset_securitypriv_cmd(adapter);
|
||||
|
||||
|
||||
rtw_reset_securitypriv(adapter);
|
||||
}
|
||||
|
||||
void rtw_report_sec_ie(_adapter *adapter, u8 authmode, u8 *sec_ie)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2019 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -17,13 +17,6 @@
|
||||
#include <drv_types.h>
|
||||
#include <hal_data.h>
|
||||
|
||||
#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.");
|
||||
@@ -34,7 +27,7 @@ int rtw_chip_version = 0x00;
|
||||
int rtw_rfintfs = HWPI;
|
||||
int rtw_lbkmode = 0;/* RTL8712_AIR_TRX; */
|
||||
#ifdef DBG_LA_MODE
|
||||
int rtw_la_mode_en=1;
|
||||
int rtw_la_mode_en=0;
|
||||
module_param(rtw_la_mode_en, int, 0644);
|
||||
#endif
|
||||
int rtw_network_mode = Ndis802_11IBSS;/* Ndis802_11Infrastructure; */ /* infra, ad-hoc, auto */
|
||||
@@ -50,35 +43,54 @@ int rtw_preamble = PREAMBLE_LONG;/* long, short, auto */
|
||||
int rtw_scan_mode = 1;/* active, passive */
|
||||
/* int smart_ps = 1; */
|
||||
#ifdef CONFIG_POWER_SAVING
|
||||
/* IPS configuration */
|
||||
int rtw_ips_mode = RTW_IPS_MODE;
|
||||
|
||||
/* LPS configuration */
|
||||
/* RTW_LPS_MODE=0:disable, 1:LPS , 2:LPS with clock gating, 3: power gating */
|
||||
#if (RTW_LPS_MODE > 0)
|
||||
int rtw_power_mgnt = PS_MODE_MAX;
|
||||
#ifdef CONFIG_IPS_LEVEL_2
|
||||
int rtw_ips_mode = IPS_LEVEL_2;
|
||||
#else
|
||||
int rtw_ips_mode = IPS_NORMAL;
|
||||
#endif /*CONFIG_IPS_LEVEL_2*/
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
int rtw_lps_level = LPS_NORMAL; /*USB default LPS level*/
|
||||
#else /*SDIO,PCIE*/
|
||||
#if defined(CONFIG_LPS_PG)
|
||||
/*int rtw_lps_level = LPS_PG;*//*FW not support yet*/
|
||||
int rtw_lps_level = LPS_LCLK;
|
||||
#elif defined(CONFIG_LPS_PG_DDMA)
|
||||
int rtw_lps_level = LPS_PG;
|
||||
#elif defined(CONFIG_LPS_LCLK)
|
||||
int rtw_lps_level = LPS_LCLK;
|
||||
#else
|
||||
int rtw_lps_level = LPS_NORMAL;
|
||||
#endif
|
||||
int rtw_lps_level = (RTW_LPS_MODE - 1);
|
||||
#endif/*CONFIG_USB_HCI*/
|
||||
int rtw_lps_chk_by_tp = 1;
|
||||
#else /* !CONFIG_POWER_SAVING */
|
||||
#else
|
||||
int rtw_power_mgnt = PS_MODE_ACTIVE;
|
||||
int rtw_lps_level = LPS_NORMAL;
|
||||
#endif
|
||||
|
||||
int rtw_lps_chk_by_tp = 1;
|
||||
|
||||
/* WOW LPS configuration */
|
||||
#ifdef CONFIG_WOWLAN
|
||||
/* RTW_WOW_LPS_MODE=0:disable, 1:LPS , 2:LPS with clock gating, 3: power gating */
|
||||
#if (RTW_WOW_LPS_MODE > 0)
|
||||
int rtw_wow_power_mgnt = PS_MODE_MAX;
|
||||
int rtw_wow_lps_level = (RTW_WOW_LPS_MODE - 1);
|
||||
#else
|
||||
int rtw_wow_power_mgnt = PS_MODE_ACTIVE;
|
||||
int rtw_wow_lps_level = LPS_NORMAL;
|
||||
#endif
|
||||
#endif /* CONFIG_WOWLAN */
|
||||
|
||||
#else /* !CONFIG_POWER_SAVING */
|
||||
int rtw_ips_mode = IPS_NONE;
|
||||
int rtw_power_mgnt = PS_MODE_ACTIVE;
|
||||
int rtw_lps_level = LPS_NORMAL;
|
||||
int rtw_lps_chk_by_tp = 0;
|
||||
#ifdef CONFIG_WOWLAN
|
||||
int rtw_wow_power_mgnt = PS_MODE_ACTIVE;
|
||||
int rtw_wow_lps_level = LPS_NORMAL;
|
||||
#endif /* CONFIG_WOWLAN */
|
||||
#endif /* CONFIG_POWER_SAVING */
|
||||
|
||||
#ifdef CONFIG_NARROWBAND_SUPPORTING
|
||||
int rtw_nb_config = CONFIG_NB_VALUE;
|
||||
module_param(rtw_nb_config, int, 0644);
|
||||
MODULE_PARM_DESC(rtw_nb_config, "5M/10M/Normal bandwidth configuration");
|
||||
#endif
|
||||
|
||||
module_param(rtw_ips_mode, int, 0644);
|
||||
MODULE_PARM_DESC(rtw_ips_mode, "The default IPS mode");
|
||||
@@ -86,8 +98,26 @@ MODULE_PARM_DESC(rtw_ips_mode, "The default IPS mode");
|
||||
module_param(rtw_lps_level, int, 0644);
|
||||
MODULE_PARM_DESC(rtw_lps_level, "The default LPS level");
|
||||
|
||||
#ifdef CONFIG_LPS_1T1R
|
||||
int rtw_lps_1t1r = RTW_LPS_1T1R;
|
||||
module_param(rtw_lps_1t1r, int, 0644);
|
||||
MODULE_PARM_DESC(rtw_lps_1t1r, "The default LPS 1T1R setting");
|
||||
#endif
|
||||
|
||||
module_param(rtw_lps_chk_by_tp, int, 0644);
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
module_param(rtw_wow_power_mgnt, int, 0644);
|
||||
MODULE_PARM_DESC(rtw_wow_power_mgnt, "The default WOW LPS mode");
|
||||
module_param(rtw_wow_lps_level, int, 0644);
|
||||
MODULE_PARM_DESC(rtw_wow_lps_level, "The default WOW LPS level");
|
||||
#ifdef CONFIG_LPS_1T1R
|
||||
int rtw_wow_lps_1t1r = RTW_WOW_LPS_1T1R;
|
||||
module_param(rtw_wow_lps_1t1r, int, 0644);
|
||||
MODULE_PARM_DESC(rtw_wow_lps_1t1r, "The default WOW LPS 1T1R setting");
|
||||
#endif
|
||||
#endif /* CONFIG_WOWLAN */
|
||||
|
||||
/* LPS:
|
||||
* rtw_smart_ps = 0 => TX: pwr bit = 1, RX: PS_Poll
|
||||
* rtw_smart_ps = 1 => TX: pwr bit = 0, RX: PS_Poll
|
||||
@@ -162,13 +192,38 @@ int rtw_uapsd_ac_enable = 0x0;
|
||||
|
||||
#if defined(CONFIG_RTL8814A)
|
||||
int rtw_pwrtrim_enable = 2; /* disable kfree , rename to power trim disable */
|
||||
#elif defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822B)
|
||||
#elif defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8822C)
|
||||
/*PHYDM API, must enable by default*/
|
||||
int rtw_pwrtrim_enable = 1;
|
||||
#else
|
||||
int rtw_pwrtrim_enable = 0; /* Default Enalbe power trim by efuse config */
|
||||
#endif
|
||||
|
||||
#if CONFIG_TX_AC_LIFETIME
|
||||
uint rtw_tx_aclt_flags = CONFIG_TX_ACLT_FLAGS;
|
||||
module_param(rtw_tx_aclt_flags, uint, 0644);
|
||||
MODULE_PARM_DESC(rtw_tx_aclt_flags, "device TX AC queue packet lifetime control flags");
|
||||
|
||||
static uint rtw_tx_aclt_conf_default[3] = CONFIG_TX_ACLT_CONF_DEFAULT;
|
||||
static uint rtw_tx_aclt_conf_default_num = 0;
|
||||
module_param_array(rtw_tx_aclt_conf_default, uint, &rtw_tx_aclt_conf_default_num, 0644);
|
||||
MODULE_PARM_DESC(rtw_tx_aclt_conf_default, "device TX AC queue lifetime config for default status");
|
||||
|
||||
#ifdef CONFIG_TX_MCAST2UNI
|
||||
static uint rtw_tx_aclt_conf_ap_m2u[3] = CONFIG_TX_ACLT_CONF_AP_M2U;
|
||||
static uint rtw_tx_aclt_conf_ap_m2u_num = 0;
|
||||
module_param_array(rtw_tx_aclt_conf_ap_m2u, uint, &rtw_tx_aclt_conf_ap_m2u_num, 0644);
|
||||
MODULE_PARM_DESC(rtw_tx_aclt_conf_ap_m2u, "device TX AC queue lifetime config for AP mode M2U status");
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTW_MESH
|
||||
static uint rtw_tx_aclt_conf_mesh[3] = CONFIG_TX_ACLT_CONF_MESH;
|
||||
static uint rtw_tx_aclt_conf_mesh_num = 0;
|
||||
module_param_array(rtw_tx_aclt_conf_mesh, uint, &rtw_tx_aclt_conf_mesh_num, 0644);
|
||||
MODULE_PARM_DESC(rtw_tx_aclt_conf_mesh, "device TX AC queue lifetime config for MESH status");
|
||||
#endif
|
||||
#endif /* CONFIG_TX_AC_LIFETIME */
|
||||
|
||||
uint rtw_tx_bw_mode = 0x21;
|
||||
module_param(rtw_tx_bw_mode, uint, 0644);
|
||||
MODULE_PARM_DESC(rtw_tx_bw_mode, "The max tx bw for 2.4G and 5G. format is the same as rtw_bw_mode");
|
||||
@@ -190,9 +245,9 @@ int rtw_bw_mode = 0x21;
|
||||
#endif
|
||||
int rtw_ampdu_enable = 1;/* for enable tx_ampdu , */ /* 0: disable, 0x1:enable */
|
||||
int rtw_rx_stbc = 1;/* 0: disable, bit(0):enable 2.4g, bit(1):enable 5g, default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ */
|
||||
#if (defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8822B)) && defined(CONFIG_PCI_HCI)
|
||||
#if (defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8814B) || defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8822C)) && defined(CONFIG_PCI_HCI)
|
||||
int rtw_rx_ampdu_amsdu = 2;/* 0: disabled, 1:enabled, 2:auto . There is an IOT issu with DLINK DIR-629 when the flag turn on */
|
||||
#elif (defined(CONFIG_RTL8822B) && defined(CONFIG_SDIO_HCI))
|
||||
#elif ((defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8822C)) && defined(CONFIG_SDIO_HCI))
|
||||
int rtw_rx_ampdu_amsdu = 1;
|
||||
#else
|
||||
int rtw_rx_ampdu_amsdu;/* 0: disabled, 1:enabled, 2:auto . There is an IOT issu with DLINK DIR-629 when the flag turn on */
|
||||
@@ -262,8 +317,6 @@ MODULE_PARM_DESC(rtw_vht_rx_mcs_map, "VHT RX MCS map");
|
||||
|
||||
int rtw_lowrate_two_xmit = 1;/* Use 2 path Tx to transmit MCS0~7 and legacy mode */
|
||||
|
||||
int rtw_rf_config = RF_TYPE_MAX;
|
||||
module_param(rtw_rf_config, int, 0644);
|
||||
|
||||
/* 0: not check in watch dog, 1: check in watch dog */
|
||||
int rtw_check_hw_status = 0;
|
||||
@@ -271,7 +324,22 @@ int rtw_check_hw_status = 0;
|
||||
int rtw_low_power = 0;
|
||||
int rtw_wifi_spec = 0;
|
||||
|
||||
int rtw_special_rf_path = 0; /* 0: 2T2R ,1: only turn on path A 1T1R */
|
||||
#ifdef CONFIG_SPECIAL_RF_PATH /* configure Nss/xTxR IC to 1ss/1T1R */
|
||||
int rtw_rf_path = RF_1T1R;
|
||||
int rtw_tx_nss = 1;
|
||||
int rtw_rx_nss = 1;
|
||||
#elif defined(CONFIG_CUSTOMER01_SMART_ANTENNA)
|
||||
int rtw_rf_path = RF_2T2R;
|
||||
int rtw_tx_nss = 1;
|
||||
int rtw_rx_nss = 1;
|
||||
#else
|
||||
int rtw_rf_path = RF_TYPE_MAX;
|
||||
int rtw_tx_nss = 0;
|
||||
int rtw_rx_nss = 0;
|
||||
#endif
|
||||
module_param(rtw_rf_path, int, 0644);
|
||||
module_param(rtw_tx_nss, int, 0644);
|
||||
module_param(rtw_rx_nss, int, 0644);
|
||||
|
||||
char rtw_country_unspecified[] = {0xFF, 0xFF, 0x00};
|
||||
char *rtw_country_code = rtw_country_unspecified;
|
||||
@@ -357,6 +425,29 @@ int rtw_pci_aspm_enable = 0x5;
|
||||
int rtw_pci_aspm_enable;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* BIT [15:12] mask of ps mode
|
||||
* BIT [11:8] val of ps mode
|
||||
* BIT [7:4] mask of perf mode
|
||||
* BIT [3:0] val of perf mode
|
||||
*
|
||||
* L0s:BIT[+0] L1:BIT[+1]
|
||||
*
|
||||
* 0x0030: change value only if perf mode
|
||||
* 0x3300: change value only if ps mode
|
||||
* 0x3330: change value in both perf and ps mode
|
||||
*/
|
||||
#ifdef CONFIG_PCI_DYNAMIC_ASPM
|
||||
#ifdef CONFIG_PCI_ASPM
|
||||
int rtw_pci_dynamic_aspm_linkctrl = 0x3330;
|
||||
#else
|
||||
int rtw_pci_dynamic_aspm_linkctrl = 0x0030;
|
||||
#endif
|
||||
#else
|
||||
int rtw_pci_dynamic_aspm_linkctrl = 0x0000;
|
||||
#endif
|
||||
module_param(rtw_pci_dynamic_aspm_linkctrl, int, 0644);
|
||||
|
||||
#ifdef CONFIG_QOS_OPTIMIZATION
|
||||
int rtw_qos_opt_enable = 1; /* 0: disable,1:enable */
|
||||
#else
|
||||
@@ -400,6 +491,13 @@ char *rtw_initmac = 0; /* temp mac address if users want to use instead of the
|
||||
int rtw_virtual_iface_num = 1;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
int rtw_sel_p2p_iface = IFACE_ID1;
|
||||
|
||||
module_param(rtw_sel_p2p_iface, int, 0644);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#ifdef CONFIG_AP_MODE
|
||||
u8 rtw_bmc_tx_rate = MGN_UNKNOWN;
|
||||
@@ -412,7 +510,6 @@ int rtw_wowlan_sta_mix_mode = 0;
|
||||
module_param(rtw_wowlan_sta_mix_mode, int, 0644);
|
||||
module_param(rtw_pwrtrim_enable, int, 0644);
|
||||
module_param(rtw_initmac, charp, 0644);
|
||||
module_param(rtw_special_rf_path, int, 0644);
|
||||
module_param(rtw_chip_version, int, 0644);
|
||||
module_param(rtw_rfintfs, int, 0644);
|
||||
module_param(rtw_lbkmode, int, 0644);
|
||||
@@ -612,7 +709,7 @@ int rtw_tx_pwr_by_rate = CONFIG_TXPWR_BY_RATE_EN;
|
||||
module_param(rtw_tx_pwr_by_rate, int, 0644);
|
||||
MODULE_PARM_DESC(rtw_tx_pwr_by_rate, "0:Disable, 1:Enable, 2: Depend on efuse");
|
||||
|
||||
#ifdef CONFIG_TXPWR_LIMIT
|
||||
#if CONFIG_TXPWR_LIMIT
|
||||
int rtw_tx_pwr_lmt_enable = CONFIG_TXPWR_LIMIT_EN;
|
||||
module_param(rtw_tx_pwr_lmt_enable, int, 0644);
|
||||
MODULE_PARM_DESC(rtw_tx_pwr_lmt_enable, "0:Disable, 1:Enable, 2: Depend on efuse");
|
||||
@@ -638,7 +735,7 @@ static int rtw_target_tx_pwr_2g_d_num = 0;
|
||||
module_param_array(rtw_target_tx_pwr_2g_d, int, &rtw_target_tx_pwr_2g_d_num, 0644);
|
||||
MODULE_PARM_DESC(rtw_target_tx_pwr_2g_d, "2.4G target tx power (unit:dBm) of RF path D for each rate section, should match the real calibrate power, -1: undefined");
|
||||
|
||||
#ifdef CONFIG_IEEE80211_BAND_5GHZ
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
static int rtw_target_tx_pwr_5g_a[RATE_SECTION_NUM - 1] = CONFIG_RTW_TARGET_TX_PWR_5G_A;
|
||||
static int rtw_target_tx_pwr_5g_a_num = 0;
|
||||
module_param_array(rtw_target_tx_pwr_5g_a, int, &rtw_target_tx_pwr_5g_a_num, 0644);
|
||||
@@ -660,6 +757,21 @@ module_param_array(rtw_target_tx_pwr_5g_d, int, &rtw_target_tx_pwr_5g_d_num, 064
|
||||
MODULE_PARM_DESC(rtw_target_tx_pwr_5g_d, "5G target tx power (unit:dBm) of RF path D for each rate section, should match the real calibrate power, -1: undefined");
|
||||
#endif /* CONFIG_IEEE80211_BAND_5GHZ */
|
||||
|
||||
#ifdef CONFIG_RTW_TX_NPATH_EN
|
||||
/*0:disable ,1: 2path*/
|
||||
int rtw_tx_npath_enable = 1;
|
||||
module_param(rtw_tx_npath_enable, int, 0644);
|
||||
MODULE_PARM_DESC(rtw_tx_npath_enable, "0:Disable, 1:TX-2PATH");
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTW_PATH_DIV
|
||||
/*0:disable ,1: path diversity*/
|
||||
int rtw_path_div_enable = 1;
|
||||
module_param(rtw_path_div_enable, int, 0644);
|
||||
MODULE_PARM_DESC(rtw_path_div_enable, "0:Disable, 1:Enable path diversity");
|
||||
#endif
|
||||
|
||||
|
||||
int rtw_tsf_update_pause_factor = CONFIG_TSF_UPDATE_PAUSE_FACTOR;
|
||||
module_param(rtw_tsf_update_pause_factor, int, 0644);
|
||||
MODULE_PARM_DESC(rtw_tsf_update_pause_factor, "num of bcn intervals to stay TSF update pause status");
|
||||
@@ -720,6 +832,23 @@ module_param(rtw_dynamic_soml_delay, int, 0644);
|
||||
MODULE_PARM_DESC(rtw_dynamic_soml_delay, "SOML training delay");
|
||||
#endif
|
||||
|
||||
uint rtw_phydm_ability = 0xffffffff;
|
||||
module_param(rtw_phydm_ability, uint, 0644);
|
||||
|
||||
uint rtw_halrf_ability = 0xffffffff;
|
||||
module_param(rtw_halrf_ability, uint, 0644);
|
||||
|
||||
#ifdef CONFIG_RTW_MESH
|
||||
uint rtw_peer_alive_based_preq = 1;
|
||||
module_param(rtw_peer_alive_based_preq, uint, 0644);
|
||||
MODULE_PARM_DESC(rtw_peer_alive_based_preq,
|
||||
"On demand PREQ will reference peer alive status. 0: Off, 1: On");
|
||||
#endif
|
||||
|
||||
int rtw_vht_2g4 = RTW_VHT_2G4;
|
||||
module_param(rtw_vht_2g4, int, 0644);
|
||||
MODULE_PARM_DESC(rtw_vht_2g4, "Allow VHT rate on 2.4G channel." \
|
||||
"(0 for deny and 1 for allow)");
|
||||
|
||||
int _netdev_open(struct net_device *pnetdev);
|
||||
int netdev_open(struct net_device *pnetdev);
|
||||
@@ -742,6 +871,11 @@ int rtw_mcc_single_tx_cri = MCC_SINGLE_TX_CRITERIA;
|
||||
int rtw_mcc_policy_table_idx = 0;
|
||||
int rtw_mcc_duration = 0;
|
||||
int rtw_mcc_enable_runtime_duration = 1;
|
||||
#ifdef CONFIG_MCC_PHYDM_OFFLOAD
|
||||
int rtw_mcc_phydm_offload = 1;
|
||||
#else
|
||||
int rtw_mcc_phydm_offload = 0;
|
||||
#endif
|
||||
module_param(rtw_en_mcc, int, 0644);
|
||||
module_param(rtw_mcc_single_tx_cri, int, 0644);
|
||||
module_param(rtw_mcc_ap_bw20_target_tx_tp, int, 0644);
|
||||
@@ -752,6 +886,7 @@ module_param(rtw_mcc_sta_bw40_target_tx_tp, int, 0644);
|
||||
module_param(rtw_mcc_sta_bw80_target_tx_tp, int, 0644);
|
||||
module_param(rtw_mcc_policy_table_idx, int, 0644);
|
||||
module_param(rtw_mcc_duration, int, 0644);
|
||||
module_param(rtw_mcc_phydm_offload, int, 0644);
|
||||
#endif /*CONFIG_MCC_MODE */
|
||||
|
||||
#ifdef CONFIG_RTW_NAPI
|
||||
@@ -795,6 +930,19 @@ int rtw_fw_param_init = 1;
|
||||
module_param(rtw_fw_param_init, int, 0644);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TDMADIG
|
||||
int rtw_tdmadig_en = 1;
|
||||
/*
|
||||
1:MODE_PERFORMANCE
|
||||
2:MODE_COVERAGE
|
||||
*/
|
||||
int rtw_tdmadig_mode = 1;
|
||||
int rtw_dynamic_tdmadig = 0;
|
||||
module_param(rtw_tdmadig_en, int, 0644);
|
||||
module_param(rtw_tdmadig_mode, int, 0644);
|
||||
module_param(rtw_dynamic_tdmadig, int, 0644);
|
||||
#endif/*CONFIG_TDMADIG*/
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
/*
|
||||
* bit[0]: magic packet wake up
|
||||
@@ -812,6 +960,39 @@ uint rtw_suspend_type = RTW_SUSPEND_TYPE;
|
||||
module_param(rtw_suspend_type, uint, 0644);
|
||||
#endif
|
||||
|
||||
#if CONFIG_TX_AC_LIFETIME
|
||||
static void rtw_regsty_load_tx_ac_lifetime(struct registry_priv *regsty)
|
||||
{
|
||||
int i, j;
|
||||
struct tx_aclt_conf_t *conf;
|
||||
uint *parm;
|
||||
|
||||
regsty->tx_aclt_flags = (u8)rtw_tx_aclt_flags;
|
||||
|
||||
for (i = 0; i < TX_ACLT_CONF_NUM; i++) {
|
||||
conf = ®sty->tx_aclt_confs[i];
|
||||
if (i == TX_ACLT_CONF_DEFAULT)
|
||||
parm = rtw_tx_aclt_conf_default;
|
||||
#ifdef CONFIG_TX_MCAST2UNI
|
||||
else if (i == TX_ACLT_CONF_AP_M2U)
|
||||
parm = rtw_tx_aclt_conf_ap_m2u;
|
||||
#endif
|
||||
#ifdef CONFIG_RTW_MESH
|
||||
else if (i == TX_ACLT_CONF_MESH)
|
||||
parm = rtw_tx_aclt_conf_mesh;
|
||||
#endif
|
||||
else
|
||||
parm = NULL;
|
||||
|
||||
if (parm) {
|
||||
conf->en = parm[0] & 0xF;
|
||||
conf->vo_vi = parm[1];
|
||||
conf->be_bk = parm[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void rtw_regsty_load_target_tx_power(struct registry_priv *regsty)
|
||||
{
|
||||
int path, rs;
|
||||
@@ -831,7 +1012,7 @@ void rtw_regsty_load_target_tx_power(struct registry_priv *regsty)
|
||||
regsty->target_tx_pwr_2g[path][rs] = target_tx_pwr[rs];
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IEEE80211_BAND_5GHZ
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
for (path = RF_PATH_A; path < RF_PATH_MAX; path++) {
|
||||
if (path == RF_PATH_A)
|
||||
target_tx_pwr = rtw_target_tx_pwr_5g_a;
|
||||
@@ -904,6 +1085,10 @@ uint loadparam(_adapter *padapter)
|
||||
registry_par->ssid.SsidLength = 3;
|
||||
|
||||
registry_par->channel = (u8)rtw_channel;
|
||||
#ifdef CONFIG_NARROWBAND_SUPPORTING
|
||||
if (rtw_nb_config != RTW_NB_CONFIG_NONE)
|
||||
rtw_wireless_mode &= ~WIRELESS_11B;
|
||||
#endif
|
||||
registry_par->wireless_mode = (u8)rtw_wireless_mode;
|
||||
|
||||
if (IsSupported24G(registry_par->wireless_mode) && (!is_supported_5g(registry_par->wireless_mode))
|
||||
@@ -921,10 +1106,28 @@ uint loadparam(_adapter *padapter)
|
||||
registry_par->scan_mode = (u8)rtw_scan_mode;
|
||||
registry_par->smart_ps = (u8)rtw_smart_ps;
|
||||
registry_par->check_fw_ps = (u8)rtw_check_fw_ps;
|
||||
registry_par->power_mgnt = (u8)rtw_power_mgnt;
|
||||
registry_par->ips_mode = (u8)rtw_ips_mode;
|
||||
#ifdef CONFIG_TDMADIG
|
||||
registry_par->tdmadig_en = (u8)rtw_tdmadig_en;
|
||||
registry_par->tdmadig_mode = (u8)rtw_tdmadig_mode;
|
||||
registry_par->tdmadig_dynamic = (u8) rtw_dynamic_tdmadig;
|
||||
registry_par->power_mgnt = PS_MODE_ACTIVE;
|
||||
registry_par->ips_mode = IPS_NONE;
|
||||
#else
|
||||
registry_par->power_mgnt = (u8)rtw_power_mgnt;
|
||||
registry_par->ips_mode = (u8)rtw_ips_mode;
|
||||
#endif/*CONFIG_TDMADIG*/
|
||||
registry_par->lps_level = (u8)rtw_lps_level;
|
||||
#ifdef CONFIG_LPS_1T1R
|
||||
registry_par->lps_1t1r = (u8)(rtw_lps_1t1r ? 1 : 0);
|
||||
#endif
|
||||
registry_par->lps_chk_by_tp = (u8)rtw_lps_chk_by_tp;
|
||||
#ifdef CONFIG_WOWLAN
|
||||
registry_par->wow_power_mgnt = (u8)rtw_wow_power_mgnt;
|
||||
registry_par->wow_lps_level = (u8)rtw_wow_lps_level;
|
||||
#ifdef CONFIG_LPS_1T1R
|
||||
registry_par->wow_lps_1t1r = (u8)(rtw_wow_lps_1t1r ? 1 : 0);
|
||||
#endif
|
||||
#endif /* CONFIG_WOWLAN */
|
||||
registry_par->radio_enable = (u8)rtw_radio_enable;
|
||||
registry_par->long_retry_lmt = (u8)rtw_long_retry_lmt;
|
||||
registry_par->short_retry_lmt = (u8)rtw_short_retry_lmt;
|
||||
@@ -955,11 +1158,19 @@ uint loadparam(_adapter *padapter)
|
||||
|
||||
registry_par->RegPwrTrimEnable = (u8)rtw_pwrtrim_enable;
|
||||
|
||||
#if CONFIG_TX_AC_LIFETIME
|
||||
rtw_regsty_load_tx_ac_lifetime(registry_par);
|
||||
#endif
|
||||
|
||||
registry_par->tx_bw_mode = (u8)rtw_tx_bw_mode;
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
registry_par->ht_enable = (u8)rtw_ht_enable;
|
||||
if (registry_par->ht_enable && is_supported_ht(registry_par->wireless_mode)) {
|
||||
#ifdef CONFIG_NARROWBAND_SUPPORTING
|
||||
if (rtw_nb_config != RTW_NB_CONFIG_NONE)
|
||||
rtw_bw_mode = 0;
|
||||
#endif
|
||||
registry_par->bw_mode = (u8)rtw_bw_mode;
|
||||
registry_par->ampdu_enable = (u8)rtw_ampdu_enable;
|
||||
registry_par->rx_stbc = (u8)rtw_rx_stbc;
|
||||
@@ -969,13 +1180,14 @@ uint loadparam(_adapter *padapter)
|
||||
registry_par->ldpc_cap = (u8)rtw_ldpc_cap;
|
||||
#if defined(CONFIG_CUSTOMER01_SMART_ANTENNA)
|
||||
rtw_stbc_cap = 0x0;
|
||||
#elif defined(CONFIG_RTW_TX_2PATH_EN)
|
||||
rtw_stbc_cap &= ~(BIT1|BIT5);
|
||||
#endif
|
||||
#ifdef CONFIG_RTW_TX_NPATH_EN
|
||||
registry_par->tx_npath = (u8)rtw_tx_npath_enable;
|
||||
#endif
|
||||
#ifdef CONFIG_RTW_PATH_DIV
|
||||
registry_par->path_div = (u8)rtw_path_div_enable;
|
||||
#endif
|
||||
registry_par->stbc_cap = (u8)rtw_stbc_cap;
|
||||
#if defined(CONFIG_RTW_TX_2PATH_EN)
|
||||
rtw_beamform_cap &= ~(BIT0|BIT2|BIT4);
|
||||
#endif
|
||||
registry_par->beamform_cap = (u8)rtw_beamform_cap;
|
||||
registry_par->beamformer_rf_num = (u8)rtw_bfer_rf_number;
|
||||
registry_par->beamformee_rf_num = (u8)rtw_bfee_rf_number;
|
||||
@@ -985,6 +1197,10 @@ uint loadparam(_adapter *padapter)
|
||||
#ifdef DBG_LA_MODE
|
||||
registry_par->la_mode_en = (u8)rtw_la_mode_en;
|
||||
#endif
|
||||
#ifdef CONFIG_NARROWBAND_SUPPORTING
|
||||
registry_par->rtw_nb_config = (u8)rtw_nb_config;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
registry_par->vht_enable = (u8)rtw_vht_enable;
|
||||
registry_par->ampdu_factor = (u8)rtw_ampdu_factor;
|
||||
@@ -996,7 +1212,9 @@ uint loadparam(_adapter *padapter)
|
||||
registry_par->early_mode = (u8)rtw_early_mode;
|
||||
#endif
|
||||
registry_par->lowrate_two_xmit = (u8)rtw_lowrate_two_xmit;
|
||||
registry_par->rf_config = (u8)rtw_rf_config;
|
||||
registry_par->rf_path = (u8)rtw_rf_path; /*rf_config/rtw_rf_config*/
|
||||
registry_par->tx_nss = (u8)rtw_tx_nss;
|
||||
registry_par->rx_nss = (u8)rtw_rx_nss;
|
||||
registry_par->low_power = (u8)rtw_low_power;
|
||||
|
||||
registry_par->check_hw_status = (u8)rtw_check_hw_status;
|
||||
@@ -1016,8 +1234,6 @@ uint loadparam(_adapter *padapter)
|
||||
registry_par->channel_plan = (u8)rtw_channel_plan;
|
||||
rtw_regsty_load_excl_chs(registry_par);
|
||||
|
||||
registry_par->special_rf_path = (u8)rtw_special_rf_path;
|
||||
|
||||
registry_par->full_ch_in_p2p_handshake = (u8)rtw_full_ch_in_p2p_handshake;
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
registry_par->btcoex = (u8)rtw_btcoex_enable;
|
||||
@@ -1054,9 +1270,6 @@ uint loadparam(_adapter *padapter)
|
||||
|
||||
#ifdef CONFIG_LAYER2_ROAMING
|
||||
registry_par->max_roaming_times = (u8)rtw_max_roaming_times;
|
||||
#ifdef CONFIG_INTEL_WIDI
|
||||
registry_par->max_roaming_times = (u8)rtw_max_roaming_times + 2;
|
||||
#endif /* CONFIG_INTEL_WIDI */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IOL
|
||||
@@ -1074,10 +1287,14 @@ uint loadparam(_adapter *padapter)
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
registry_par->virtual_iface_num = (u8)rtw_virtual_iface_num;
|
||||
#ifdef CONFIG_P2P
|
||||
registry_par->sel_p2p_iface = (u8)rtw_sel_p2p_iface;
|
||||
RTW_INFO("%s, Select P2P interface: iface_id:%d\n", __func__, registry_par->sel_p2p_iface);
|
||||
#endif
|
||||
#endif
|
||||
registry_par->pll_ref_clk_sel = (u8)rtw_pll_ref_clk_sel;
|
||||
|
||||
#ifdef CONFIG_TXPWR_LIMIT
|
||||
#if CONFIG_TXPWR_LIMIT
|
||||
registry_par->RegEnableTxPowerLimit = (u8)rtw_tx_pwr_lmt_enable;
|
||||
#endif
|
||||
registry_par->RegEnableTxPowerByRate = (u8)rtw_tx_pwr_by_rate;
|
||||
@@ -1118,6 +1335,7 @@ uint loadparam(_adapter *padapter)
|
||||
|
||||
registry_par->boffefusemask = (u8)rtw_OffEfuseMask;
|
||||
registry_par->bFileMaskEfuse = (u8)rtw_FileMaskEfuse;
|
||||
registry_par->bBTFileMaskEfuse = (u8)rtw_FileMaskEfuse;
|
||||
|
||||
#ifdef CONFIG_RTW_ACS
|
||||
registry_par->acs_mode = (u8)rtw_acs;
|
||||
@@ -1147,6 +1365,7 @@ uint loadparam(_adapter *padapter)
|
||||
registry_par->rtw_mcc_policy_table_idx = rtw_mcc_policy_table_idx;
|
||||
registry_par->rtw_mcc_duration = (u8)rtw_mcc_duration;
|
||||
registry_par->rtw_mcc_enable_runtime_duration = rtw_mcc_enable_runtime_duration;
|
||||
registry_par->rtw_mcc_phydm_offload = rtw_mcc_phydm_offload;
|
||||
#endif /*CONFIG_MCC_MODE */
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
@@ -1161,6 +1380,7 @@ uint loadparam(_adapter *padapter)
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
registry_par->pci_aspm_config = rtw_pci_aspm_enable;
|
||||
registry_par->pci_dynamic_aspm_linkctrl = rtw_pci_dynamic_aspm_linkctrl;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTW_NAPI
|
||||
@@ -1196,6 +1416,13 @@ uint loadparam(_adapter *padapter)
|
||||
#ifdef CONFIG_FW_HANDLE_TXBCN
|
||||
registry_par->fw_tbtt_rpt = rtw_tbtt_rpt;
|
||||
#endif
|
||||
registry_par->phydm_ability = rtw_phydm_ability;
|
||||
registry_par->halrf_ability = rtw_halrf_ability;
|
||||
#ifdef CONFIG_RTW_MESH
|
||||
registry_par->peer_alive_based_preq = rtw_peer_alive_based_preq;
|
||||
#endif
|
||||
|
||||
registry_par->vht_2g4 = (u8)rtw_vht_2g4;
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -1499,19 +1726,9 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
|
||||
_adapter *padapter = rtw_netdev_priv(pnetdev);
|
||||
struct net_device *TargetNetdev = NULL;
|
||||
_adapter *TargetAdapter = NULL;
|
||||
struct net *devnet = NULL;
|
||||
|
||||
if (padapter->bDongle == 1) {
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
|
||||
TargetNetdev = dev_get_by_name("wlan0");
|
||||
#else
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26))
|
||||
devnet = pnetdev->nd_net;
|
||||
#else
|
||||
devnet = dev_net(pnetdev);
|
||||
#endif
|
||||
TargetNetdev = dev_get_by_name(devnet, "wlan0");
|
||||
#endif
|
||||
TargetNetdev = rtw_get_same_net_ndev_by_name(pnetdev, "wlan0");
|
||||
if (TargetNetdev) {
|
||||
RTW_INFO("Force onboard module driver disappear !!!\n");
|
||||
TargetAdapter = rtw_netdev_priv(TargetNetdev);
|
||||
@@ -1585,7 +1802,7 @@ struct net_device *rtw_init_netdev(_adapter *old_padapter)
|
||||
#endif /* CONFIG_CONCURRENT_MODE */
|
||||
|
||||
|
||||
#ifdef CONFIG_TX_CSUM_OFFLOAD
|
||||
#ifdef CONFIG_TCP_CSUM_OFFLOAD_TX
|
||||
pnetdev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)
|
||||
pnetdev->hw_features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
|
||||
@@ -2123,6 +2340,7 @@ struct dvobj_priv *devobj_init(void)
|
||||
_rtw_mutex_init(&pdvobj->setch_mutex);
|
||||
_rtw_mutex_init(&pdvobj->setbw_mutex);
|
||||
_rtw_mutex_init(&pdvobj->rf_read_reg_mutex);
|
||||
_rtw_mutex_init(&pdvobj->ioctrl_mutex);
|
||||
#ifdef CONFIG_SDIO_INDIRECT_ACCESS
|
||||
_rtw_mutex_init(&pdvobj->sd_indirect_access_mutex);
|
||||
#endif
|
||||
@@ -2133,6 +2351,15 @@ struct dvobj_priv *devobj_init(void)
|
||||
_rtw_mutex_init(&pdvobj->customer_str_mutex);
|
||||
_rtw_memset(pdvobj->customer_str, 0xFF, RTW_CUSTOMER_STR_LEN);
|
||||
#endif
|
||||
#ifdef CONFIG_PROTSEL_PORT
|
||||
_rtw_mutex_init(&pdvobj->protsel_port.mutex);
|
||||
#endif
|
||||
#ifdef CONFIG_PROTSEL_ATIMDTIM
|
||||
_rtw_mutex_init(&pdvobj->protsel_atimdtim.mutex);
|
||||
#endif
|
||||
#ifdef CONFIG_PROTSEL_MACSLEEP
|
||||
_rtw_mutex_init(&pdvobj->protsel_macsleep.mutex);
|
||||
#endif
|
||||
|
||||
pdvobj->processing_dev_remove = _FALSE;
|
||||
|
||||
@@ -2169,6 +2396,7 @@ struct dvobj_priv *devobj_init(void)
|
||||
#ifdef CONFIG_MCC_MODE
|
||||
_rtw_mutex_init(&(pdvobj->mcc_objpriv.mcc_mutex));
|
||||
_rtw_mutex_init(&(pdvobj->mcc_objpriv.mcc_tsf_req_mutex));
|
||||
_rtw_mutex_init(&(pdvobj->mcc_objpriv.mcc_dbg_reg_mutex));
|
||||
_rtw_spinlock_init(&pdvobj->mcc_objpriv.mcc_lock);
|
||||
#endif /* CONFIG_MCC_MODE */
|
||||
|
||||
@@ -2201,6 +2429,7 @@ void devobj_deinit(struct dvobj_priv *pdvobj)
|
||||
#ifdef CONFIG_MCC_MODE
|
||||
_rtw_mutex_free(&(pdvobj->mcc_objpriv.mcc_mutex));
|
||||
_rtw_mutex_free(&(pdvobj->mcc_objpriv.mcc_tsf_req_mutex));
|
||||
_rtw_mutex_free(&(pdvobj->mcc_objpriv.mcc_dbg_reg_mutex));
|
||||
_rtw_spinlock_free(&pdvobj->mcc_objpriv.mcc_lock);
|
||||
#endif /* CONFIG_MCC_MODE */
|
||||
|
||||
@@ -2210,10 +2439,20 @@ void devobj_deinit(struct dvobj_priv *pdvobj)
|
||||
#ifdef CONFIG_RTW_CUSTOMER_STR
|
||||
_rtw_mutex_free(&pdvobj->customer_str_mutex);
|
||||
#endif
|
||||
#ifdef CONFIG_PROTSEL_PORT
|
||||
_rtw_mutex_free(&pdvobj->protsel_port.mutex);
|
||||
#endif
|
||||
#ifdef CONFIG_PROTSEL_ATIMDTIM
|
||||
_rtw_mutex_free(&pdvobj->protsel_atimdtim.mutex);
|
||||
#endif
|
||||
#ifdef CONFIG_PROTSEL_MACSLEEP
|
||||
_rtw_mutex_free(&pdvobj->protsel_macsleep.mutex);
|
||||
#endif
|
||||
|
||||
_rtw_mutex_free(&pdvobj->setch_mutex);
|
||||
_rtw_mutex_free(&pdvobj->setbw_mutex);
|
||||
_rtw_mutex_free(&pdvobj->rf_read_reg_mutex);
|
||||
_rtw_mutex_free(&pdvobj->ioctrl_mutex);
|
||||
#ifdef CONFIG_SDIO_INDIRECT_ACCESS
|
||||
_rtw_mutex_free(&pdvobj->sd_indirect_access_mutex);
|
||||
#endif
|
||||
@@ -2345,6 +2584,38 @@ u8 rtw_init_drv_sw(_adapter *padapter)
|
||||
padapter->client_port = CLT_PORT_INVALID;
|
||||
#endif
|
||||
|
||||
if (is_primary_adapter(padapter)) {
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
|
||||
struct hal_spec_t *hal_spec = GET_HAL_SPEC(padapter);
|
||||
|
||||
dvobj->macid_ctl.num = rtw_min(hal_spec->macid_num, MACID_NUM_SW_LIMIT);
|
||||
|
||||
dvobj->cam_ctl.sec_cap = hal_spec->sec_cap;
|
||||
dvobj->cam_ctl.num = rtw_min(hal_spec->sec_cam_ent_num, SEC_CAM_ENT_NUM_SW_LIMIT);
|
||||
|
||||
#if CONFIG_TX_AC_LIFETIME
|
||||
{
|
||||
struct registry_priv *regsty = adapter_to_regsty(padapter);
|
||||
int i;
|
||||
|
||||
dvobj->tx_aclt_flags = regsty->tx_aclt_flags;
|
||||
for (i = 0; i < TX_ACLT_CONF_NUM; i++) {
|
||||
dvobj->tx_aclt_confs[i].en = regsty->tx_aclt_confs[i].en;
|
||||
dvobj->tx_aclt_confs[i].vo_vi
|
||||
= regsty->tx_aclt_confs[i].vo_vi / (hal_spec->tx_aclt_unit_factor * 32);
|
||||
if (dvobj->tx_aclt_confs[i].vo_vi > 0xFFFF)
|
||||
dvobj->tx_aclt_confs[i].vo_vi = 0xFFFF;
|
||||
dvobj->tx_aclt_confs[i].be_bk
|
||||
= regsty->tx_aclt_confs[i].be_bk / (hal_spec->tx_aclt_unit_factor * 32);
|
||||
if (dvobj->tx_aclt_confs[i].be_bk > 0xFFFF)
|
||||
dvobj->tx_aclt_confs[i].be_bk = 0xFFFF;
|
||||
}
|
||||
|
||||
dvobj->tx_aclt_force_val.en = 0xFF;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
ret8 = rtw_init_default_value(padapter);
|
||||
|
||||
if ((rtw_init_cmd_priv(&padapter->cmdpriv)) == _FAIL) {
|
||||
@@ -2362,6 +2633,17 @@ u8 rtw_init_drv_sw(_adapter *padapter)
|
||||
if (is_primary_adapter(padapter))
|
||||
rtw_rfctl_init(padapter);
|
||||
|
||||
if (is_primary_adapter(padapter)) {
|
||||
if (rtw_hal_rfpath_init(padapter) == _FAIL) {
|
||||
ret8 = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
if (rtw_hal_trxnss_init(padapter) == _FAIL) {
|
||||
ret8 = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (rtw_init_mlme_priv(padapter) == _FAIL) {
|
||||
ret8 = _FAIL;
|
||||
goto exit;
|
||||
@@ -2454,14 +2736,6 @@ u8 rtw_init_drv_sw(_adapter *padapter)
|
||||
rtw_hal_sreset_init(padapter);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INTEL_WIDI
|
||||
if (rtw_init_intel_widi(padapter) == _FAIL) {
|
||||
RTW_INFO("Can't rtw_init_intel_widi\n");
|
||||
ret8 = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
#endif /* CONFIG_INTEL_WIDI */
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
padapter->WapiSupport = true; /* set true temp, will revise according to Efuse or Registry value later. */
|
||||
rtw_wapi_init(padapter);
|
||||
@@ -2588,10 +2862,6 @@ u8 rtw_free_drv_sw(_adapter *padapter)
|
||||
_rtw_spinlock_free(&padapter->br_ext_lock);
|
||||
#endif /* CONFIG_BR_EXT */
|
||||
|
||||
#ifdef CONFIG_INTEL_WIDI
|
||||
rtw_free_intel_widi(padapter);
|
||||
#endif /* CONFIG_INTEL_WIDI */
|
||||
|
||||
free_mlme_ext_priv(&padapter->mlmeextpriv);
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
@@ -3238,37 +3508,29 @@ void netdev_br_init(struct net_device *netdev)
|
||||
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
|
||||
rcu_read_lock();
|
||||
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) */
|
||||
#endif
|
||||
|
||||
/* if(check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == _TRUE) */
|
||||
{
|
||||
/* struct net_bridge *br = netdev->br_port->br; */ /* ->dev->dev_addr; */
|
||||
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
|
||||
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
|
||||
if (netdev->br_port)
|
||||
#else /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
|
||||
#else
|
||||
if (rcu_dereference(adapter->pnetdev->rx_handler_data))
|
||||
#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
|
||||
#endif
|
||||
{
|
||||
struct net_device *br_netdev;
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
|
||||
br_netdev = dev_get_by_name(CONFIG_BR_EXT_BRNAME);
|
||||
#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) */
|
||||
struct net *devnet = NULL;
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26))
|
||||
devnet = netdev->nd_net;
|
||||
#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)) */
|
||||
devnet = dev_net(netdev);
|
||||
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)) */
|
||||
|
||||
br_netdev = dev_get_by_name(devnet, CONFIG_BR_EXT_BRNAME);
|
||||
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) */
|
||||
|
||||
br_netdev = rtw_get_bridge_ndev_by_name(CONFIG_BR_EXT_BRNAME);
|
||||
if (br_netdev) {
|
||||
memcpy(adapter->br_mac, br_netdev->dev_addr, ETH_ALEN);
|
||||
dev_put(br_netdev);
|
||||
} else
|
||||
printk("%s()-%d: dev_get_by_name(%s) failed!", __FUNCTION__, __LINE__, CONFIG_BR_EXT_BRNAME);
|
||||
RTW_INFO(FUNC_NDEV_FMT" bind bridge dev "NDEV_FMT"("MAC_FMT")\n"
|
||||
, FUNC_NDEV_ARG(netdev), NDEV_ARG(br_netdev), MAC_ARG(br_netdev->dev_addr));
|
||||
} else {
|
||||
RTW_INFO(FUNC_NDEV_FMT" can't get bridge dev by name \"%s\"\n"
|
||||
, FUNC_NDEV_ARG(netdev), CONFIG_BR_EXT_BRNAME);
|
||||
}
|
||||
}
|
||||
|
||||
adapter->ethBrExtInfo.addPPPoETag = 1;
|
||||
@@ -3276,7 +3538,7 @@ void netdev_br_init(struct net_device *netdev)
|
||||
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
|
||||
rcu_read_unlock();
|
||||
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) */
|
||||
#endif
|
||||
}
|
||||
#endif /* CONFIG_BR_EXT */
|
||||
|
||||
@@ -3365,8 +3627,9 @@ int _netdev_open(struct net_device *pnetdev)
|
||||
pwrctrlpriv->bips_processing = _FALSE;
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
netdev_open_normal_process:
|
||||
#endif
|
||||
RTW_INFO(FUNC_NDEV_FMT" Success (bup=%d)\n", FUNC_NDEV_ARG(pnetdev), padapter->bup);
|
||||
return 0;
|
||||
|
||||
@@ -3497,8 +3760,9 @@ int _netdev_open(struct net_device *pnetdev)
|
||||
RTW_INFO("CONFIG_BT_COEXIST: VIRTUAL_ADAPTER\n");
|
||||
#endif /* CONFIG_BT_COEXIST_SOCKET_TRX */
|
||||
|
||||
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
netdev_open_normal_process:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
{
|
||||
@@ -3742,8 +4006,9 @@ int _pm_netdev_open(_adapter *padapter)
|
||||
pwrctrlpriv->bips_processing = _FALSE;
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
netdev_open_normal_process:
|
||||
#endif
|
||||
RTW_INFO(FUNC_NDEV_FMT" Success (bup=%d)\n", FUNC_NDEV_ARG(pnetdev), padapter->bup);
|
||||
return 0;
|
||||
|
||||
@@ -4370,7 +4635,6 @@ int rtw_suspend_wow(_adapter *padapter)
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct wowlan_ioctl_param poidparam;
|
||||
u8 ps_mode;
|
||||
int ret = _SUCCESS;
|
||||
|
||||
RTW_INFO("==> "FUNC_ADPT_FMT" entry....\n", FUNC_ADPT_ARG(padapter));
|
||||
@@ -4423,6 +4687,7 @@ int rtw_suspend_wow(_adapter *padapter)
|
||||
}
|
||||
#endif
|
||||
|
||||
rtw_wow_lps_level_decide(padapter, _TRUE);
|
||||
poidparam.subcode = WOWLAN_ENABLE;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_WOWLAN, (u8 *)&poidparam);
|
||||
if (rtw_chk_roam_flags(padapter, RTW_ROAM_ON_RESUME)) {
|
||||
@@ -4480,9 +4745,8 @@ int rtw_suspend_wow(_adapter *padapter)
|
||||
}
|
||||
#ifdef CONFIG_LPS
|
||||
else {
|
||||
if (!(pwrpriv->wowlan_dis_lps)) {
|
||||
rtw_wow_lps_level_decide(padapter, _TRUE);
|
||||
rtw_set_ps_mode(padapter, PS_MODE_MAX, 0, 0, "WOWLAN");
|
||||
if(pwrpriv->wowlan_power_mgmt != PS_MODE_ACTIVE) {
|
||||
rtw_set_ps_mode(padapter, pwrpriv->wowlan_power_mgmt, 0, 0, "WOWLAN");
|
||||
}
|
||||
}
|
||||
#endif /* #ifdef CONFIG_LPS */
|
||||
@@ -4501,7 +4765,6 @@ int rtw_suspend_ap_wow(_adapter *padapter)
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct wowlan_ioctl_param poidparam;
|
||||
u8 ps_mode;
|
||||
int ret = _SUCCESS;
|
||||
|
||||
RTW_INFO("==> "FUNC_ADPT_FMT" entry....\n", FUNC_ADPT_ARG(padapter));
|
||||
@@ -4541,6 +4804,7 @@ int rtw_suspend_ap_wow(_adapter *padapter)
|
||||
}
|
||||
#endif
|
||||
|
||||
rtw_wow_lps_level_decide(padapter, _TRUE);
|
||||
poidparam.subcode = WOWLAN_AP_ENABLE;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_WOWLAN, (u8 *)&poidparam);
|
||||
|
||||
@@ -4582,9 +4846,8 @@ int rtw_suspend_ap_wow(_adapter *padapter)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LPS
|
||||
if (!(pwrpriv->wowlan_dis_lps)) {
|
||||
rtw_wow_lps_level_decide(padapter, _TRUE);
|
||||
rtw_set_ps_mode(padapter, PS_MODE_MIN, 0, 0, "AP-WOWLAN");
|
||||
if(pwrpriv->wowlan_power_mgmt != PS_MODE_ACTIVE) {
|
||||
rtw_set_ps_mode(padapter, pwrpriv->wowlan_power_mgmt, 0, 0, "AP-WOWLAN");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -4672,6 +4935,7 @@ int rtw_suspend_common(_adapter *padapter)
|
||||
pdbgpriv->dbg_suspend_error_cnt++;
|
||||
goto exit;
|
||||
}
|
||||
rtw_mi_scan_abort(padapter, _TRUE);
|
||||
rtw_ps_deny(padapter, PS_DENY_SUSPEND);
|
||||
|
||||
rtw_mi_cancel_all_timer(padapter);
|
||||
@@ -4755,16 +5019,11 @@ int rtw_resume_process_wow(_adapter *padapter)
|
||||
if (pwrpriv->wowlan_pno_enable)
|
||||
rtw_set_fw_in_ips_mode(padapter, _FALSE);
|
||||
#endif /* CONFIG_FWLPS_IN_IPS */
|
||||
#if defined(CONFIG_LPS_LCLK) && defined(RTW_HALMAC)
|
||||
if (pwrpriv->wowlan_pno_enable)
|
||||
rtw_set_fw_config_32k(padapter, _FALSE);
|
||||
|
||||
#endif
|
||||
#endif/* CONFIG_PNO_SUPPORT */
|
||||
|
||||
if (pwrpriv->wowlan_mode == _TRUE) {
|
||||
#ifdef CONFIG_LPS
|
||||
if (!(pwrpriv->wowlan_dis_lps)) {
|
||||
if(pwrpriv->wowlan_power_mgmt != PS_MODE_ACTIVE) {
|
||||
rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0, "WOWLAN");
|
||||
rtw_wow_lps_level_decide(padapter, _FALSE);
|
||||
}
|
||||
@@ -4911,7 +5170,7 @@ int rtw_resume_process_ap_wow(_adapter *padapter)
|
||||
|
||||
|
||||
#ifdef CONFIG_LPS
|
||||
if (!(pwrpriv->wowlan_dis_lps)) {
|
||||
if(pwrpriv->wowlan_power_mgmt != PS_MODE_ACTIVE) {
|
||||
rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0, "AP-WOWLAN");
|
||||
rtw_wow_lps_level_decide(padapter, _FALSE);
|
||||
}
|
||||
@@ -5118,13 +5377,16 @@ int rtw_resume_common(_adapter *padapter)
|
||||
systime start_time = rtw_get_current_time();
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
|
||||
if (pwrpriv == NULL)
|
||||
return 0;
|
||||
|
||||
if (pwrpriv->bInSuspend == _FALSE)
|
||||
return 0;
|
||||
|
||||
RTW_PRINT("resume start\n");
|
||||
RTW_INFO("==> %s (%s:%d)\n", __FUNCTION__, current->comm, current->pid);
|
||||
|
||||
if (rtw_mi_check_status(padapter, WIFI_AP_STATE) == _FALSE) {
|
||||
if (rtw_mi_check_status(padapter, MI_AP_MODE) == _FALSE) {
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if (pwrpriv->wowlan_mode == _TRUE)
|
||||
rtw_resume_process_wow(padapter);
|
||||
@@ -5132,7 +5394,7 @@ int rtw_resume_common(_adapter *padapter)
|
||||
#endif
|
||||
rtw_resume_process_normal(padapter);
|
||||
|
||||
} else if (rtw_mi_check_status(padapter, WIFI_AP_STATE)) {
|
||||
} else if (rtw_mi_check_status(padapter, MI_AP_MODE)) {
|
||||
#ifdef CONFIG_AP_WOWLAN
|
||||
rtw_resume_process_ap_wow(padapter);
|
||||
#else
|
||||
@@ -5140,10 +5402,9 @@ int rtw_resume_common(_adapter *padapter)
|
||||
#endif /* CONFIG_AP_WOWLAN */
|
||||
}
|
||||
|
||||
if (pwrpriv) {
|
||||
pwrpriv->bInSuspend = _FALSE;
|
||||
pwrpriv->wowlan_in_resume = _FALSE;
|
||||
}
|
||||
pwrpriv->bInSuspend = _FALSE;
|
||||
pwrpriv->wowlan_in_resume = _FALSE;
|
||||
|
||||
RTW_PRINT("%s:%d in %d ms\n", __FUNCTION__ , ret,
|
||||
rtw_get_passing_time_ms(start_time));
|
||||
|
||||
|
||||
@@ -433,7 +433,7 @@ void rtw_os_recv_indicate_pkt(_adapter *padapter, _pkt *pkt, union recv_frame *r
|
||||
|
||||
DBG_COUNTER(padapter->rx_logs.os_indicate);
|
||||
|
||||
if (MLME_IS_AP(padapter)) {
|
||||
if (MLME_IS_AP(padapter) && !pmlmepriv->ap_isolate) {
|
||||
_pkt *pskb2 = NULL;
|
||||
struct sta_info *psta = NULL;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
@@ -702,7 +702,6 @@ int rtw_recv_indicatepkt(_adapter *padapter, union recv_frame *precv_frame)
|
||||
|
||||
rtw_os_recv_indicate_pkt(padapter, precv_frame->u.hdr.pkt, precv_frame);
|
||||
|
||||
_recv_indicatepkt_end:
|
||||
precv_frame->u.hdr.pkt = NULL;
|
||||
rtw_free_recvframe(precv_frame, pfree_recv_queue);
|
||||
return _SUCCESS;
|
||||
@@ -715,9 +714,8 @@ _recv_indicatepkt_drop:
|
||||
|
||||
void rtw_os_read_port(_adapter *padapter, struct recv_buf *precvbuf)
|
||||
{
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
|
||||
precvbuf->ref_cnt--;
|
||||
|
||||
|
||||
@@ -973,7 +973,7 @@ response:
|
||||
exit:
|
||||
rtw_unlock_suspend();
|
||||
if (command)
|
||||
rtw_mfree(command, priv_cmd.total_len);
|
||||
rtw_mfree(command, priv_cmd.total_len + 1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1074,13 +1074,21 @@ int wifi_get_mac_addr(unsigned char *buf)
|
||||
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)) */
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) || defined(COMPAT_KERNEL_RELEASE)
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
|
||||
void *wifi_get_country_code(char *ccode, u32 flags)
|
||||
#else /* Linux kernel < 3.18 */
|
||||
void *wifi_get_country_code(char *ccode)
|
||||
#endif /* Linux kernel < 3.18 */
|
||||
{
|
||||
RTW_INFO("%s\n", __FUNCTION__);
|
||||
if (!ccode)
|
||||
return NULL;
|
||||
if (wifi_control_data && wifi_control_data->get_country_code)
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
|
||||
return wifi_control_data->get_country_code(ccode, flags);
|
||||
#else /* Linux kernel < 3.18 */
|
||||
return wifi_control_data->get_country_code(ccode);
|
||||
#endif /* Linux kernel < 3.18 */
|
||||
return NULL;
|
||||
}
|
||||
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) */
|
||||
|
||||
@@ -245,13 +245,11 @@ int rtw_dev_get_feature_set(struct net_device *dev)
|
||||
{
|
||||
_adapter *adapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
HAL_DATA_TYPE *HalData = GET_HAL_DATA(adapter);
|
||||
HAL_VERSION *hal_ver = &HalData->version_id;
|
||||
|
||||
int feature_set = 0;
|
||||
|
||||
feature_set |= WIFI_FEATURE_INFRA;
|
||||
|
||||
#ifdef CONFIG_IEEE80211_BAND_5GHZ
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
if (is_supported_5g(adapter_to_regsty(adapter)->wireless_mode))
|
||||
feature_set |= WIFI_FEATURE_INFRA_5G;
|
||||
#endif
|
||||
@@ -1596,7 +1594,11 @@ void rtw_hal_set_hw_mac_addr(PADAPTER adapter, u8 *mac_addr)
|
||||
rtw_ps_deny(adapter, PS_DENY_IOCTL);
|
||||
LeaveAllPowerSaveModeDirect(adapter);
|
||||
|
||||
#ifdef CONFIG_MI_WITH_MBSSID_CAM
|
||||
rtw_hal_change_macaddr_mbid(adapter, mac_addr);
|
||||
#else
|
||||
rtw_hal_set_hwreg(adapter, HW_VAR_MAC_ADDR, mac_addr);
|
||||
#endif
|
||||
#ifdef CONFIG_RTW_DEBUG
|
||||
rtw_hal_dump_macaddr(RTW_DBGDUMP, adapter);
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,7 @@
|
||||
|
||||
#define RTW_PROC_HDL_TYPE_SEQ 0
|
||||
#define RTW_PROC_HDL_TYPE_SSEQ 1
|
||||
#define RTW_PROC_HDL_TYPE_SZSEQ 2
|
||||
|
||||
struct rtw_proc_hdl {
|
||||
char *name;
|
||||
@@ -27,6 +28,10 @@ struct rtw_proc_hdl {
|
||||
union {
|
||||
int (*show)(struct seq_file *, void *);
|
||||
struct seq_operations *seq_op;
|
||||
struct {
|
||||
int (*show)(struct seq_file *, void *);
|
||||
size_t size;
|
||||
} sz;
|
||||
} u;
|
||||
ssize_t (*write)(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
|
||||
};
|
||||
@@ -37,9 +42,11 @@ struct rtw_proc_hdl {
|
||||
#define RTW_PROC_HDL_SSEQ(_name, _show, _write) \
|
||||
{ .name = _name, .type = RTW_PROC_HDL_TYPE_SSEQ, .u.show = _show, .write = _write}
|
||||
|
||||
#define RTW_PROC_HDL_SZSEQ(_name, _show, _write, _size) \
|
||||
{ .name = _name, .type = RTW_PROC_HDL_TYPE_SZSEQ, .u.sz.show = _show, .write = _write, .u.sz.size = _size}
|
||||
|
||||
#ifdef CONFIG_PROC_DEBUG
|
||||
|
||||
struct proc_dir_entry *get_rtw_drv_proc(void);
|
||||
int rtw_drv_proc_init(void);
|
||||
void rtw_drv_proc_deinit(void);
|
||||
struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev);
|
||||
@@ -48,10 +55,9 @@ void rtw_adapter_proc_replace(struct net_device *dev);
|
||||
|
||||
#else /* !CONFIG_PROC_DEBUG */
|
||||
|
||||
#define get_rtw_drv_proc() NULL
|
||||
#define rtw_drv_proc_init() 0
|
||||
static inline int rtw_drv_proc_init(void) {return _FAIL;}
|
||||
#define rtw_drv_proc_deinit() do {} while (0)
|
||||
#define rtw_adapter_proc_init(dev) NULL
|
||||
static inline struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev) {return NULL;}
|
||||
#define rtw_adapter_proc_deinit(dev) do {} while (0)
|
||||
#define rtw_adapter_proc_replace(dev) do {} while (0)
|
||||
|
||||
|
||||
@@ -19,7 +19,10 @@
|
||||
|
||||
int rtw_rhashtable_walk_enter(rtw_rhashtable *ht, rtw_rhashtable_iter *iter)
|
||||
{
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0))
|
||||
rhashtable_walk_enter((ht), (iter));
|
||||
return 0;
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
|
||||
return rhashtable_walk_init((ht), (iter), GFP_ATOMIC);
|
||||
#else
|
||||
/* kernel >= 4.4.0 rhashtable_walk_init use GFP_KERNEL to alloc, spin_lock for assignment */
|
||||
|
||||
@@ -40,7 +40,11 @@ typedef struct rhashtable_iter rtw_rhashtable_iter;
|
||||
|
||||
int rtw_rhashtable_walk_enter(rtw_rhashtable *ht, rtw_rhashtable_iter *iter);
|
||||
#define rtw_rhashtable_walk_exit(iter) rhashtable_walk_exit(iter)
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 16, 0))
|
||||
#define rtw_rhashtable_walk_start(iter) rhashtable_walk_start_check(iter)
|
||||
#else
|
||||
#define rtw_rhashtable_walk_start(iter) rhashtable_walk_start(iter)
|
||||
#endif
|
||||
#define rtw_rhashtable_walk_next(iter) rhashtable_walk_next(iter)
|
||||
#define rtw_rhashtable_walk_stop(iter) rhashtable_walk_stop(iter)
|
||||
|
||||
|
||||
111
os_dep/linux/usb_intf.c
Normal file → Executable file
111
os_dep/linux/usb_intf.c
Normal file → Executable file
@@ -23,10 +23,6 @@
|
||||
#error "CONFIG_USB_HCI shall be on!\n"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
|
||||
#error "Shall be Linux or Windows, but not both!\n"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
extern int rtw_ht_enable;
|
||||
extern int rtw_bw_mode;
|
||||
@@ -242,16 +238,6 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xB812, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Default ID for USB Single-function, WiFi only */
|
||||
/*=== Customer ID ===*/
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x13b1, 0x0043, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Alpha - Alpha*/
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0115, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TP-Link Archer T4U V3 */
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x012D, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TP-Link Archer T3U */
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0138, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TP-Link Archer T3U Plus */
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xB822, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Edimax EW-7822ULC */
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xC822, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Edimax EW-7822UTC */
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x0b05, 0x1841, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* ASUS AC1300 USB-AC55 B1 */
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x0b05, 0x184C, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* ASUS U2*/
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x331c, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Dlink - DWA-182*/
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x331e, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Dlink - DWA-181*/
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x0846, 0x9055, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* NetGear A6150 */
|
||||
#endif /* CONFIG_RTL8822B */
|
||||
|
||||
#ifdef CONFIG_RTL8723D
|
||||
@@ -262,6 +248,7 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
|
||||
#ifdef CONFIG_RTL8192F
|
||||
/*=== Realtek demoboard ===*/
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xF192, 0xff, 0xff, 0xff), .driver_info = RTL8192F}, /* 8192FU 2*2 */
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xA725, 0xff, 0xff, 0xff), .driver_info = RTL8192F}, /* 8725AU 2*2 */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8821C
|
||||
@@ -282,6 +269,19 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xB711, 0xff, 0xff, 0xff), .driver_info = RTL8710B}, /* 8710B = 8188GU 1*1 */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8822C
|
||||
/*=== Realtek demoboard ===*/
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xC82C, 0xff, 0xff, 0xff), .driver_info = RTL8822C}, /* Default ID for USB multi-function */
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xC812, 0xff, 0xff, 0xff), .driver_info = RTL8822C}, /* Default ID for USB Single-function, WiFi only */
|
||||
/*=== Customer ID ===*/
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x13b1, 0x0043, 0xff, 0xff, 0xff), .driver_info = RTL8822C}, /* Alpha - Alpha*/
|
||||
#endif /* CONFIG_RTL8822C */
|
||||
|
||||
#ifdef CONFIG_RTL8814B
|
||||
/*=== Realtek demoboard ===*/
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xB814, 0xff, 0xff, 0xff), .driver_info = RTL8814B}, /* Default ID for USB multi-function */
|
||||
#endif /* CONFIG_RTL8814B */
|
||||
|
||||
{} /* Terminating entry */
|
||||
};
|
||||
|
||||
@@ -477,6 +477,16 @@ static void rtw_decide_chip_type_by_usb_info(struct dvobj_priv *pdvobjpriv, cons
|
||||
if (pdvobjpriv->chip_type == RTL8192F)
|
||||
rtl8192fu_set_hw_type(pdvobjpriv);
|
||||
#endif /* CONFIG_RTL8192F */
|
||||
|
||||
#ifdef CONFIG_RTL8822C
|
||||
if (pdvobjpriv->chip_type == RTL8822C)
|
||||
rtl8822cu_set_hw_type(pdvobjpriv);
|
||||
#endif /* CONFIG_RTL8822C */
|
||||
|
||||
#ifdef CONFIG_RTL8814B
|
||||
if (pdvobjpriv->chip_type == RTL8814B)
|
||||
rtl8814bu_set_hw_type(pdvobjpriv);
|
||||
#endif /* CONFIG_RTL8814B */
|
||||
}
|
||||
|
||||
static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf, const struct usb_device_id *pdid)
|
||||
@@ -533,38 +543,12 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf, const s
|
||||
phost_conf = pusbd->actconfig;
|
||||
pconf_desc = &phost_conf->desc;
|
||||
|
||||
#if 0
|
||||
RTW_INFO("\n8712_usb_configuration_descriptor:\n");
|
||||
RTW_INFO("bLength=%x\n", pconf_desc->bLength);
|
||||
RTW_INFO("bDescriptorType=%x\n", pconf_desc->bDescriptorType);
|
||||
RTW_INFO("wTotalLength=%x\n", pconf_desc->wTotalLength);
|
||||
RTW_INFO("bNumInterfaces=%x\n", pconf_desc->bNumInterfaces);
|
||||
RTW_INFO("bConfigurationValue=%x\n", pconf_desc->bConfigurationValue);
|
||||
RTW_INFO("iConfiguration=%x\n", pconf_desc->iConfiguration);
|
||||
RTW_INFO("bmAttributes=%x\n", pconf_desc->bmAttributes);
|
||||
RTW_INFO("bMaxPower=%x\n", pconf_desc->bMaxPower);
|
||||
#endif
|
||||
|
||||
/* RTW_INFO("\n***** num of altsetting = (%d) *****\n", pusb_interface->num_altsetting); */
|
||||
|
||||
phost_iface = &usb_intf->altsetting[0];
|
||||
piface_desc = &phost_iface->desc;
|
||||
|
||||
#if 0
|
||||
RTW_INFO("\n8712_usb_interface_descriptor:\n");
|
||||
RTW_INFO("bLength=%x\n", piface_desc->bLength);
|
||||
RTW_INFO("bDescriptorType=%x\n", piface_desc->bDescriptorType);
|
||||
RTW_INFO("bInterfaceNumber=%x\n", piface_desc->bInterfaceNumber);
|
||||
RTW_INFO("bAlternateSetting=%x\n", piface_desc->bAlternateSetting);
|
||||
RTW_INFO("bNumEndpoints=%x\n", piface_desc->bNumEndpoints);
|
||||
RTW_INFO("bInterfaceClass=%x\n", piface_desc->bInterfaceClass);
|
||||
RTW_INFO("bInterfaceSubClass=%x\n", piface_desc->bInterfaceSubClass);
|
||||
RTW_INFO("bInterfaceProtocol=%x\n", piface_desc->bInterfaceProtocol);
|
||||
RTW_INFO("iInterface=%x\n", piface_desc->iInterface);
|
||||
#endif
|
||||
|
||||
pdvobjpriv->NumInterfaces = pconf_desc->bNumInterfaces;
|
||||
pdvobjpriv->InterfaceNumber = piface_desc->bInterfaceNumber;
|
||||
pdvobjpriv->nr_endpoint = piface_desc->bNumEndpoints;
|
||||
|
||||
/* RTW_INFO("\ndump usb_endpoint_descriptor:\n"); */
|
||||
@@ -668,19 +652,7 @@ static void usb_dvobj_deinit(struct usb_interface *usb_intf)
|
||||
|
||||
usb_set_intfdata(usb_intf, NULL);
|
||||
if (dvobj) {
|
||||
/* Modify condition for 92DU DMDP 2010.11.18, by Thomas */
|
||||
if ((dvobj->NumInterfaces != 2 && dvobj->NumInterfaces != 3)
|
||||
|| (dvobj->InterfaceNumber == 1)) {
|
||||
if (interface_to_usbdev(usb_intf)->state != USB_STATE_NOTATTACHED) {
|
||||
/* If we didn't unplug usb dongle and remove/insert modlue, driver fails on sitesurvey for the first time when device is up . */
|
||||
/* Reset usb port for sitesurvey fail issue. 2009.8.13, by Thomas */
|
||||
RTW_INFO("usb attached..., try to reset usb device\n");
|
||||
usb_reset_device(interface_to_usbdev(usb_intf));
|
||||
}
|
||||
}
|
||||
|
||||
rtw_deinit_intf_priv(dvobj);
|
||||
|
||||
devobj_deinit(dvobj);
|
||||
}
|
||||
|
||||
@@ -782,6 +754,17 @@ u8 rtw_set_hal_ops(_adapter *padapter)
|
||||
rtl8192fu_set_hal_ops(padapter);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8822C
|
||||
if (rtw_get_chip_type(padapter) == RTL8822C)
|
||||
rtl8822cu_set_hal_ops(padapter);
|
||||
#endif /* CONFIG_RTL8822C */
|
||||
|
||||
#ifdef CONFIG_RTL8814B
|
||||
if (rtw_get_chip_type(padapter) == RTL8814B)
|
||||
rtl8814bu_set_hal_ops(padapter);
|
||||
#endif /* CONFIG_RTL8814B */
|
||||
|
||||
|
||||
if (_FAIL == rtw_hal_ops_check(padapter))
|
||||
return _FAIL;
|
||||
|
||||
@@ -905,7 +888,7 @@ int rtw_hw_suspend(_adapter *padapter)
|
||||
|
||||
#ifdef CONFIG_LPS
|
||||
/* donnot enqueue cmd */
|
||||
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_DISCONNECT, 0);
|
||||
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_DISCONNECT, RTW_CMDF_DIRECTLY);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1259,9 +1242,6 @@ extern void rtd2885_wlan_netlink_sendMsg(char *action_string, char *name);
|
||||
* notes: drv_init() is called when the bus driver has located a card for us to support.
|
||||
* We accept the new device by returning 0.
|
||||
*/
|
||||
|
||||
_adapter *rtw_sw_export = NULL;
|
||||
|
||||
_adapter *rtw_usb_primary_adapter_init(struct dvobj_priv *dvobj,
|
||||
struct usb_interface *pusb_intf)
|
||||
{
|
||||
@@ -1507,10 +1487,6 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INTEL_PROXIM
|
||||
rtw_sw_export = padapter;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_GLOBAL_UI_PID
|
||||
if (ui_pid[1] != 0) {
|
||||
RTW_INFO("ui_pid[1]:%d\n", ui_pid[1]);
|
||||
@@ -1622,12 +1598,6 @@ static void rtw_dev_remove(struct usb_interface *pusb_intf)
|
||||
|
||||
RTW_INFO("-r871xu_dev_remove, done\n");
|
||||
|
||||
|
||||
#ifdef CONFIG_INTEL_PROXIM
|
||||
rtw_sw_export = NULL;
|
||||
#endif
|
||||
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
@@ -1697,14 +1667,5 @@ static void __exit rtw_drv_halt(void)
|
||||
rtw_mstat_dump(RTW_DBGDUMP);
|
||||
}
|
||||
|
||||
|
||||
module_init(rtw_drv_entry);
|
||||
module_exit(rtw_drv_halt);
|
||||
|
||||
#ifdef CONFIG_INTEL_PROXIM
|
||||
_adapter *rtw_usb_get_sw_pointer(void)
|
||||
{
|
||||
return rtw_sw_export;
|
||||
}
|
||||
EXPORT_SYMBOL(rtw_usb_get_sw_pointer);
|
||||
#endif /* CONFIG_INTEL_PROXIM */
|
||||
|
||||
@@ -38,7 +38,7 @@ int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 inde
|
||||
u8 *pIo_buf;
|
||||
int vendorreq_times = 0;
|
||||
|
||||
#if (defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C))
|
||||
#if (defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C)) || defined(CONFIG_RTL8822C)
|
||||
#define REG_ON_SEC 0x00
|
||||
#define REG_OFF_SEC 0x01
|
||||
#define REG_LOCAL_SEC 0x02
|
||||
@@ -115,8 +115,25 @@ int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 inde
|
||||
_rtw_memcpy(pdata, pIo_buf, len);
|
||||
}
|
||||
} else { /* error cases */
|
||||
RTW_INFO("reg 0x%x, usb %s %u fail, status:%d value=0x%x, vendorreq_times:%d\n"
|
||||
, value, (requesttype == 0x01) ? "read" : "write" , len, status, *(u32 *)pdata, vendorreq_times);
|
||||
switch (len) {
|
||||
case 1:
|
||||
RTW_INFO("reg 0x%x, usb %s %u fail, status:%d value=0x%x, vendorreq_times:%d\n"
|
||||
, value, (requesttype == 0x01) ? "read" : "write" , len, status, *(u8 *)pdata, vendorreq_times);
|
||||
break;
|
||||
case 2:
|
||||
RTW_INFO("reg 0x%x, usb %s %u fail, status:%d value=0x%x, vendorreq_times:%d\n"
|
||||
, value, (requesttype == 0x01) ? "read" : "write" , len, status, *(u16 *)pdata, vendorreq_times);
|
||||
break;
|
||||
case 4:
|
||||
RTW_INFO("reg 0x%x, usb %s %u fail, status:%d value=0x%x, vendorreq_times:%d\n"
|
||||
, value, (requesttype == 0x01) ? "read" : "write" , len, status, *(u32 *)pdata, vendorreq_times);
|
||||
break;
|
||||
default:
|
||||
RTW_INFO("reg 0x%x, usb %s %u fail, status:%d, vendorreq_times:%d\n"
|
||||
, value, (requesttype == 0x01) ? "read" : "write" , len, status, vendorreq_times);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (status < 0) {
|
||||
if (status == (-ESHUTDOWN) || status == -ENODEV)
|
||||
@@ -151,9 +168,9 @@ int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 inde
|
||||
|
||||
}
|
||||
|
||||
#if (defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C))
|
||||
#if (defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C)) || defined(CONFIG_RTL8822C)
|
||||
if (value < 0xFE00) {
|
||||
if (0x00 <= value && value <= 0xff)
|
||||
if (value <= 0xff)
|
||||
current_reg_sec = REG_ON_SEC;
|
||||
else if (0x1000 <= value && value <= 0x10ff)
|
||||
current_reg_sec = REG_ON_SEC;
|
||||
@@ -278,7 +295,8 @@ unsigned int ffaddr2pipehdl(struct dvobj_priv *pdvobj, u32 addr)
|
||||
|
||||
#ifdef RTW_HALMAC
|
||||
/* halmac already translate queue id to bulk out id (addr 0~3) */
|
||||
else if (addr < 4) {
|
||||
/* 8814BU bulk out id range is 0~6 */
|
||||
else if (addr < MAX_BULKOUT_NUM) {
|
||||
ep_num = pdvobj->RtOutPipe[addr];
|
||||
pipe = usb_sndbulkpipe(pusbd, ep_num);
|
||||
}
|
||||
@@ -299,7 +317,7 @@ struct zero_bulkout_context {
|
||||
void *pirp;
|
||||
void *padapter;
|
||||
};
|
||||
|
||||
#if 0
|
||||
static void usb_bulkout_zero_complete(struct urb *purb, struct pt_regs *regs)
|
||||
{
|
||||
struct zero_bulkout_context *pcontext = (struct zero_bulkout_context *)purb->context;
|
||||
@@ -375,7 +393,7 @@ static u32 usb_bulkout_zero(struct intf_hdl *pintfhdl, u32 addr)
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
void usb_read_mem(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
|
||||
{
|
||||
|
||||
|
||||
@@ -16,242 +16,6 @@
|
||||
#include <drv_types.h>
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
|
||||
#include <rtw_wifi_regd.h>
|
||||
|
||||
static struct country_code_to_enum_rd allCountries[] = {
|
||||
{COUNTRY_CODE_USER, "RD"},
|
||||
};
|
||||
|
||||
/*
|
||||
* REG_RULE(freq start, freq end, bandwidth, max gain, eirp, reg_flags)
|
||||
*/
|
||||
|
||||
/*
|
||||
*Only these channels all allow active
|
||||
*scan on all world regulatory domains
|
||||
*/
|
||||
|
||||
/* 2G chan 01 - chan 11 */
|
||||
#define RTW_2GHZ_CH01_11 \
|
||||
REG_RULE(2412-10, 2462+10, 40, 0, 20, 0)
|
||||
|
||||
/*
|
||||
*We enable active scan on these a case
|
||||
*by case basis by regulatory domain
|
||||
*/
|
||||
|
||||
/* 2G chan 12 - chan 13, PASSIV SCAN */
|
||||
#define RTW_2GHZ_CH12_13 \
|
||||
REG_RULE(2467-10, 2472+10, 40, 0, 20, \
|
||||
NL80211_RRF_PASSIVE_SCAN)
|
||||
|
||||
/* 2G chan 14, PASSIVS SCAN, NO OFDM (B only) */
|
||||
#define RTW_2GHZ_CH14 \
|
||||
REG_RULE(2484-10, 2484+10, 40, 0, 20, \
|
||||
NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_OFDM)
|
||||
|
||||
/* 5G chan 36 - chan 64 */
|
||||
#define RTW_5GHZ_5150_5350 \
|
||||
REG_RULE(5150-10, 5350+10, 40, 0, 30, \
|
||||
NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
|
||||
|
||||
/* 5G chan 100 - chan 165 */
|
||||
#define RTW_5GHZ_5470_5850 \
|
||||
REG_RULE(5470-10, 5850+10, 40, 0, 30, \
|
||||
NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
|
||||
|
||||
/* 5G chan 149 - chan 165 */
|
||||
#define RTW_5GHZ_5725_5850 \
|
||||
REG_RULE(5725-10, 5850+10, 40, 0, 30, \
|
||||
NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
|
||||
|
||||
/* 5G chan 36 - chan 165 */
|
||||
#define RTW_5GHZ_5150_5850 \
|
||||
REG_RULE(5150-10, 5850+10, 40, 0, 30, \
|
||||
NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
|
||||
|
||||
static const struct ieee80211_regdomain rtw_regdom_rd = {
|
||||
.n_reg_rules = 3,
|
||||
.alpha2 = "99",
|
||||
.reg_rules = {
|
||||
RTW_2GHZ_CH01_11,
|
||||
RTW_2GHZ_CH12_13,
|
||||
RTW_5GHZ_5150_5850,
|
||||
}
|
||||
};
|
||||
|
||||
static const struct ieee80211_regdomain rtw_regdom_11 = {
|
||||
.n_reg_rules = 1,
|
||||
.alpha2 = "99",
|
||||
.reg_rules = {
|
||||
RTW_2GHZ_CH01_11,
|
||||
}
|
||||
};
|
||||
|
||||
static const struct ieee80211_regdomain rtw_regdom_12_13 = {
|
||||
.n_reg_rules = 2,
|
||||
.alpha2 = "99",
|
||||
.reg_rules = {
|
||||
RTW_2GHZ_CH01_11,
|
||||
RTW_2GHZ_CH12_13,
|
||||
}
|
||||
};
|
||||
|
||||
static const struct ieee80211_regdomain rtw_regdom_no_midband = {
|
||||
.n_reg_rules = 3,
|
||||
.alpha2 = "99",
|
||||
.reg_rules = {
|
||||
RTW_2GHZ_CH01_11,
|
||||
RTW_5GHZ_5150_5350,
|
||||
RTW_5GHZ_5725_5850,
|
||||
}
|
||||
};
|
||||
|
||||
static const struct ieee80211_regdomain rtw_regdom_60_64 = {
|
||||
.n_reg_rules = 3,
|
||||
.alpha2 = "99",
|
||||
.reg_rules = {
|
||||
RTW_2GHZ_CH01_11,
|
||||
RTW_2GHZ_CH12_13,
|
||||
RTW_5GHZ_5725_5850,
|
||||
}
|
||||
};
|
||||
|
||||
static const struct ieee80211_regdomain rtw_regdom_14_60_64 = {
|
||||
.n_reg_rules = 4,
|
||||
.alpha2 = "99",
|
||||
.reg_rules = {
|
||||
RTW_2GHZ_CH01_11,
|
||||
RTW_2GHZ_CH12_13,
|
||||
RTW_2GHZ_CH14,
|
||||
RTW_5GHZ_5725_5850,
|
||||
}
|
||||
};
|
||||
|
||||
static const struct ieee80211_regdomain rtw_regdom_14 = {
|
||||
.n_reg_rules = 3,
|
||||
.alpha2 = "99",
|
||||
.reg_rules = {
|
||||
RTW_2GHZ_CH01_11,
|
||||
RTW_2GHZ_CH12_13,
|
||||
RTW_2GHZ_CH14,
|
||||
}
|
||||
};
|
||||
|
||||
#if 0
|
||||
static struct rtw_regulatory *rtw_regd;
|
||||
#endif
|
||||
|
||||
#if 0 /* not_yet */
|
||||
static void _rtw_reg_apply_beaconing_flags(struct wiphy *wiphy,
|
||||
enum nl80211_reg_initiator initiator)
|
||||
{
|
||||
enum nl80211_band band;
|
||||
struct ieee80211_supported_band *sband;
|
||||
const struct ieee80211_reg_rule *reg_rule;
|
||||
struct ieee80211_channel *ch;
|
||||
unsigned int i;
|
||||
u32 bandwidth = 0;
|
||||
int r;
|
||||
|
||||
for (band = 0; band < NUM_NL80211_BANDS; band++) {
|
||||
|
||||
if (!wiphy->bands[band])
|
||||
continue;
|
||||
|
||||
sband = wiphy->bands[band];
|
||||
|
||||
for (i = 0; i < sband->n_channels; i++) {
|
||||
ch = &sband->channels[i];
|
||||
if (rtw_is_dfs_ch(ch->hw_value) ||
|
||||
(ch->flags & IEEE80211_CHAN_RADAR))
|
||||
continue;
|
||||
if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) {
|
||||
r = freq_reg_info(wiphy, ch->center_freq,
|
||||
bandwidth, ®_rule);
|
||||
if (r)
|
||||
continue;
|
||||
|
||||
/*
|
||||
*If 11d had a rule for this channel ensure
|
||||
*we enable adhoc/beaconing if it allows us to
|
||||
*use it. Note that we would have disabled it
|
||||
*by applying our static world regdomain by
|
||||
*default during init, prior to calling our
|
||||
*regulatory_hint().
|
||||
*/
|
||||
|
||||
if (!(reg_rule->flags & NL80211_RRF_NO_IBSS))
|
||||
ch->flags &= ~IEEE80211_CHAN_NO_IBSS;
|
||||
if (!
|
||||
(reg_rule->flags &
|
||||
NL80211_RRF_PASSIVE_SCAN))
|
||||
ch->flags &=
|
||||
~IEEE80211_CHAN_PASSIVE_SCAN;
|
||||
} else {
|
||||
if (ch->beacon_found)
|
||||
ch->flags &= ~(IEEE80211_CHAN_NO_IBSS |
|
||||
IEEE80211_CHAN_PASSIVE_SCAN);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Allows active scan scan on Ch 12 and 13 */
|
||||
static void _rtw_reg_apply_active_scan_flags(struct wiphy *wiphy,
|
||||
enum nl80211_reg_initiator
|
||||
initiator)
|
||||
{
|
||||
struct ieee80211_supported_band *sband;
|
||||
struct ieee80211_channel *ch;
|
||||
const struct ieee80211_reg_rule *reg_rule;
|
||||
u32 bandwidth = 0;
|
||||
int r;
|
||||
|
||||
if (!wiphy->bands[NL80211_BAND_2GHZ])
|
||||
return;
|
||||
sband = wiphy->bands[NL80211_BAND_2GHZ];
|
||||
|
||||
/*
|
||||
* If no country IE has been received always enable active scan
|
||||
* on these channels. This is only done for specific regulatory SKUs
|
||||
*/
|
||||
if (initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) {
|
||||
ch = &sband->channels[11]; /* CH 12 */
|
||||
if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
|
||||
ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
|
||||
ch = &sband->channels[12]; /* CH 13 */
|
||||
if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
|
||||
ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* If a country IE has been received check its rule for this
|
||||
* channel first before enabling active scan. The passive scan
|
||||
* would have been enforced by the initial processing of our
|
||||
* custom regulatory domain.
|
||||
*/
|
||||
|
||||
ch = &sband->channels[11]; /* CH 12 */
|
||||
r = freq_reg_info(wiphy, ch->center_freq, bandwidth, ®_rule);
|
||||
if (!r) {
|
||||
if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
|
||||
if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
|
||||
ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
|
||||
}
|
||||
|
||||
ch = &sband->channels[12]; /* CH 13 */
|
||||
r = freq_reg_info(wiphy, ch->center_freq, bandwidth, ®_rule);
|
||||
if (!r) {
|
||||
if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
|
||||
if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
|
||||
ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void rtw_regd_apply_flags(struct wiphy *wiphy)
|
||||
{
|
||||
struct dvobj_priv *dvobj = wiphy_to_dvobj(wiphy);
|
||||
@@ -268,14 +32,13 @@ void rtw_regd_apply_flags(struct wiphy *wiphy)
|
||||
/* all channels disable */
|
||||
for (i = 0; i < NUM_NL80211_BANDS; i++) {
|
||||
sband = wiphy->bands[i];
|
||||
|
||||
if (sband) {
|
||||
for (j = 0; j < sband->n_channels; j++) {
|
||||
ch = &sband->channels[j];
|
||||
|
||||
if (ch)
|
||||
ch->flags = IEEE80211_CHAN_DISABLED;
|
||||
}
|
||||
if (!sband)
|
||||
continue;
|
||||
for (j = 0; j < sband->n_channels; j++) {
|
||||
ch = &sband->channels[j];
|
||||
if (!ch)
|
||||
continue;
|
||||
ch->flags = IEEE80211_CHAN_DISABLED;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,56 +46,33 @@ void rtw_regd_apply_flags(struct wiphy *wiphy)
|
||||
for (i = 0; i < max_chan_nums; i++) {
|
||||
channel = channel_set[i].ChannelNum;
|
||||
freq = rtw_ch2freq(channel);
|
||||
|
||||
ch = ieee80211_get_channel(wiphy, freq);
|
||||
if (!ch)
|
||||
continue;
|
||||
|
||||
if (channel_set[i].ScanType == SCAN_PASSIVE
|
||||
#if defined(CONFIG_DFS_MASTER)
|
||||
&& rtw_odm_dfs_domain_unknown(dvobj)
|
||||
#endif
|
||||
) {
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
|
||||
ch->flags = (IEEE80211_CHAN_NO_IBSS | IEEE80211_CHAN_PASSIVE_SCAN);
|
||||
#else
|
||||
ch->flags = IEEE80211_CHAN_NO_IR;
|
||||
#endif
|
||||
} else
|
||||
ch->flags = 0;
|
||||
/* enable */
|
||||
ch->flags = 0;
|
||||
|
||||
#ifdef CONFIG_DFS
|
||||
if (rtw_is_dfs_ch(ch->hw_value)
|
||||
#if defined(CONFIG_DFS_MASTER)
|
||||
&& rtw_odm_dfs_domain_unknown(dvobj)
|
||||
#endif
|
||||
) {
|
||||
ch->flags |= IEEE80211_CHAN_RADAR;
|
||||
if (channel_set[i].dfs) {
|
||||
/*
|
||||
* before integrating with nl80211 flow
|
||||
* bypass IEEE80211_CHAN_RADAR when configured with radar detection
|
||||
* to prevent from hostapd blocking DFS channels
|
||||
*/
|
||||
if (rtw_rfctl_dfs_domain_unknown(rfctl))
|
||||
ch->flags |= IEEE80211_CHAN_RADAR;
|
||||
}
|
||||
|
||||
if (channel_set[i].ScanType == SCAN_PASSIVE) {
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
|
||||
ch->flags |= (IEEE80211_CHAN_NO_IBSS | IEEE80211_CHAN_PASSIVE_SCAN);
|
||||
ch->flags |= IEEE80211_CHAN_NO_IBSS | IEEE80211_CHAN_PASSIVE_SCAN;
|
||||
#else
|
||||
ch->flags |= IEEE80211_CHAN_NO_IR;
|
||||
#endif
|
||||
}
|
||||
#endif /* CONFIG_DFS */
|
||||
}
|
||||
}
|
||||
|
||||
static const struct ieee80211_regdomain *_rtw_regdomain_select(struct
|
||||
rtw_regulatory
|
||||
*reg)
|
||||
{
|
||||
#if 0
|
||||
switch (reg->country_code) {
|
||||
case COUNTRY_CODE_USER:
|
||||
default:
|
||||
return &rtw_regdom_rd;
|
||||
}
|
||||
#else
|
||||
return &rtw_regdom_rd;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
|
||||
{
|
||||
switch (request->initiator) {
|
||||
@@ -363,10 +103,8 @@ static int rtw_reg_notifier_return(struct wiphy *wiphy, struct regulatory_reques
|
||||
}
|
||||
#endif
|
||||
|
||||
static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg, struct wiphy *wiphy)
|
||||
int rtw_regd_init(struct wiphy *wiphy)
|
||||
{
|
||||
const struct ieee80211_regdomain *regd;
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0))
|
||||
wiphy->reg_notifier = rtw_reg_notifier_return;
|
||||
#else
|
||||
@@ -383,41 +121,7 @@ static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg, struct wiphy *wiphy
|
||||
wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS;
|
||||
#endif
|
||||
|
||||
regd = _rtw_regdomain_select(reg);
|
||||
wiphy_apply_custom_regulatory(wiphy, regd);
|
||||
|
||||
rtw_regd_apply_flags(wiphy);
|
||||
}
|
||||
|
||||
static struct country_code_to_enum_rd *_rtw_regd_find_country(u16 countrycode)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(allCountries); i++) {
|
||||
if (allCountries[i].countrycode == countrycode)
|
||||
return &allCountries[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int rtw_regd_init(struct wiphy *wiphy)
|
||||
{
|
||||
#if 0
|
||||
if (rtw_regd == NULL) {
|
||||
rtw_regd = (struct rtw_regulatory *)
|
||||
rtw_malloc(sizeof(struct rtw_regulatory));
|
||||
|
||||
rtw_regd->alpha2[0] = '9';
|
||||
rtw_regd->alpha2[1] = '9';
|
||||
|
||||
rtw_regd->country_code = COUNTRY_CODE_USER;
|
||||
}
|
||||
|
||||
RTW_INFO("%s: Country alpha2 being used: %c%c\n",
|
||||
__func__, rtw_regd->alpha2[0], rtw_regd->alpha2[1]);
|
||||
#endif
|
||||
|
||||
_rtw_regd_init_wiphy(NULL, wiphy);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
22
os_dep/linux/wifi_regd.h
Normal file
22
os_dep/linux/wifi_regd.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2009-2010 - 2017 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __WIFI_REGD_H__
|
||||
#define __WIFI_REGD_H__
|
||||
|
||||
void rtw_regd_apply_flags(struct wiphy *wiphy);
|
||||
int rtw_regd_init(struct wiphy *wiphy);
|
||||
|
||||
#endif /* __WIFI_REGD_H__ */
|
||||
@@ -65,7 +65,7 @@ sint rtw_endofpktfile(struct pkt_file *pfile)
|
||||
|
||||
void rtw_set_tx_chksum_offload(_pkt *pkt, struct pkt_attrib *pattrib)
|
||||
{
|
||||
#ifdef CONFIG_TX_CSUM_OFFLOAD
|
||||
#ifdef CONFIG_TCP_CSUM_OFFLOAD_TX
|
||||
struct sk_buff *skb = (struct sk_buff *)pkt;
|
||||
struct iphdr *iph = NULL;
|
||||
struct ipv6hdr *i6ph = NULL;
|
||||
@@ -82,6 +82,13 @@ void rtw_set_tx_chksum_offload(_pkt *pkt, struct pkt_attrib *pattrib)
|
||||
} else
|
||||
{}
|
||||
|
||||
/* HW unable to compute CSUM if header & payload was be encrypted by SW(cause TXDMA error) */
|
||||
if (pattrib->bswenc == _TRUE) {
|
||||
if (skb->ip_summed == CHECKSUM_PARTIAL)
|
||||
skb_checksum_help(skb);
|
||||
return;
|
||||
}
|
||||
|
||||
/* For HW rule, clear ipv4_csum & UDP/TCP_csum if it is UDP/TCP packet */
|
||||
switch (protocol) {
|
||||
case IPPROTO_UDP:
|
||||
@@ -281,10 +288,11 @@ void rtw_os_xmit_complete(_adapter *padapter, struct xmit_frame *pxframe)
|
||||
void rtw_os_xmit_schedule(_adapter *padapter)
|
||||
{
|
||||
#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
||||
_adapter *pri_adapter = GET_PRIMARY_ADAPTER(padapter);
|
||||
_adapter *pri_adapter;
|
||||
|
||||
if (!padapter)
|
||||
return;
|
||||
pri_adapter = GET_PRIMARY_ADAPTER(padapter);
|
||||
|
||||
if (_rtw_queue_empty(&padapter->xmitpriv.pending_xmitbuf_queue) == _FALSE)
|
||||
_rtw_up_sema(&pri_adapter->xmitpriv.xmit_sema);
|
||||
@@ -451,7 +459,7 @@ int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev)
|
||||
#ifdef CONFIG_TX_MCAST2UNI
|
||||
extern int rtw_mc2u_disable;
|
||||
#endif /* CONFIG_TX_MCAST2UNI */
|
||||
#ifdef CONFIG_TX_CSUM_OFFLOAD
|
||||
#ifdef CONFIG_TCP_CSUM_OFFLOAD_TX
|
||||
struct sk_buff *skb = pkt;
|
||||
struct sk_buff *segs, *nskb;
|
||||
netdev_features_t features = padapter->pnetdev->features;
|
||||
@@ -497,7 +505,7 @@ int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev)
|
||||
}
|
||||
#endif /* CONFIG_TX_MCAST2UNI */
|
||||
|
||||
#ifdef CONFIG_TX_CSUM_OFFLOAD
|
||||
#ifdef CONFIG_TCP_CSUM_OFFLOAD_TX
|
||||
if (skb_shinfo(skb)->gso_size) {
|
||||
/* split a big(65k) skb into several small(1.5k) skbs */
|
||||
features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
|
||||
@@ -544,6 +552,68 @@ exit:
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CUSTOMER_ALIBABA_GENERAL
|
||||
int check_alibaba_meshpkt(struct sk_buff *skb)
|
||||
{
|
||||
u16 protocol;
|
||||
|
||||
if (skb)
|
||||
return (htons(skb->protocol) == ETH_P_ALL);
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
s32 rtw_alibaba_mesh_xmit_entry(_pkt *pkt, struct net_device *ndev)
|
||||
{
|
||||
u16 frame_ctl;
|
||||
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
|
||||
struct pkt_file pktfile;
|
||||
struct rtw_ieee80211_hdr *pwlanhdr;
|
||||
struct pkt_attrib *pattrib;
|
||||
struct xmit_frame *pmgntframe;
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
|
||||
unsigned char *pframe;
|
||||
struct sk_buff *skb = (struct sk_buff *)pkt;
|
||||
int len = skb->len;
|
||||
|
||||
rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize);
|
||||
|
||||
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
|
||||
if (pmgntframe == NULL) {
|
||||
goto fail;
|
||||
return -1;
|
||||
}
|
||||
|
||||
pattrib = &pmgntframe->attrib;
|
||||
update_mgntframe_attrib(padapter, pattrib);
|
||||
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
|
||||
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
|
||||
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
|
||||
|
||||
_rtw_open_pktfile(pkt, &pktfile);
|
||||
_rtw_pktfile_read(&pktfile, pframe, len);
|
||||
|
||||
pattrib->type = pframe[0] & 0x0C;
|
||||
pattrib->subtype = pframe[0] & 0xF0;
|
||||
pattrib->raid = rtw_get_mgntframe_raid(padapter, WIRELESS_11G);
|
||||
pattrib->rate = MGN_24M;
|
||||
pattrib->pktlen = len;
|
||||
SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
|
||||
pmlmeext->mgnt_seq++;
|
||||
|
||||
RTW_DBG_DUMP("rtw_alibaba_mesh_xmit_entry payload:", skb->data, len);
|
||||
|
||||
pattrib->last_txcmdsz = pattrib->pktlen;
|
||||
dump_mgntframe(padapter, pmgntframe);
|
||||
|
||||
fail:
|
||||
rtw_skb_free(skb);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev)
|
||||
{
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev);
|
||||
@@ -551,6 +621,11 @@ int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev)
|
||||
int ret = 0;
|
||||
|
||||
if (pkt) {
|
||||
#ifdef CONFIG_CUSTOMER_ALIBABA_GENERAL
|
||||
if (check_alibaba_meshpkt(pkt)) {
|
||||
return rtw_alibaba_mesh_xmit_entry(pkt, pnetdev);
|
||||
}
|
||||
#endif
|
||||
if (check_fwstate(pmlmepriv, WIFI_MONITOR_STATE) == _TRUE) {
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24))
|
||||
rtw_monitor_xmit_entry((struct sk_buff *)pkt, pnetdev);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2019 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -444,9 +444,6 @@ void rtw_mstat_dump(void *sel)
|
||||
int value_f[4][mstat_ff_idx(MSTAT_FUNC_MAX)];
|
||||
#endif
|
||||
|
||||
int vir_alloc, vir_peak, vir_alloc_err, phy_alloc, phy_peak, phy_alloc_err;
|
||||
int tx_alloc, tx_peak, tx_alloc_err, rx_alloc, rx_peak, rx_alloc_err;
|
||||
|
||||
for (i = 0; i < mstat_tf_idx(MSTAT_TYPE_MAX); i++) {
|
||||
value_t[0][i] = ATOMIC_READ(&(rtw_mem_type_stat[i].alloc));
|
||||
value_t[1][i] = ATOMIC_READ(&(rtw_mem_type_stat[i].peak));
|
||||
@@ -1264,12 +1261,20 @@ u32 _rtw_down_sema(_sema *sema)
|
||||
{
|
||||
|
||||
#ifdef PLATFORM_LINUX
|
||||
|
||||
#if 0
|
||||
if (down_interruptible(sema))
|
||||
return _FAIL;
|
||||
else
|
||||
return _SUCCESS;
|
||||
#else
|
||||
int res;
|
||||
|
||||
res = down_interruptible(sema);
|
||||
if (res)
|
||||
RTW_ERR("%s: unexpected interrupted! res=%d\n",
|
||||
__FUNCTION__, res);
|
||||
return _SUCCESS;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef PLATFORM_FREEBSD
|
||||
sema_wait(sema);
|
||||
@@ -1625,8 +1630,7 @@ void rtw_sleep_schedulable(int ms)
|
||||
delta = 1;/* 1 ms */
|
||||
}
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
if (schedule_timeout(delta) != 0)
|
||||
return ;
|
||||
schedule_timeout(delta);
|
||||
return;
|
||||
|
||||
#endif
|
||||
@@ -2166,11 +2170,21 @@ static int writeFile(struct file *fp, char *buf, int len)
|
||||
{
|
||||
int wlen = 0, sum = 0;
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
|
||||
if (!(fp->f_mode & FMODE_CAN_WRITE))
|
||||
#else
|
||||
if (!fp->f_op || !fp->f_op->write)
|
||||
#endif
|
||||
return -EPERM;
|
||||
|
||||
while (sum < len) {
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
|
||||
wlen = kernel_write(fp, buf + sum, len - sum, &fp->f_pos);
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
|
||||
wlen = __vfs_write(fp, buf + sum, len - sum, &fp->f_pos);
|
||||
#else
|
||||
wlen = fp->f_op->write(fp, buf + sum, len - sum, &fp->f_pos);
|
||||
#endif
|
||||
if (wlen > 0)
|
||||
sum += wlen;
|
||||
else if (0 != wlen)
|
||||
@@ -2183,6 +2197,20 @@ static int writeFile(struct file *fp, char *buf, int len)
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Test if the specifi @param pathname is a direct and readable
|
||||
* If readable, @param sz is not used
|
||||
* @param pathname the name of the path to test
|
||||
* @return Linux specific error code
|
||||
*/
|
||||
static int isDirReadable(const char *pathname, u32 *sz)
|
||||
{
|
||||
struct path path;
|
||||
int error = 0;
|
||||
|
||||
return kern_path(pathname, LOOKUP_FOLLOW, &path);
|
||||
}
|
||||
|
||||
/*
|
||||
* Test if the specifi @param path is a file and readable
|
||||
* If readable, @param sz is got
|
||||
@@ -2303,6 +2331,24 @@ static int storeToFile(const char *path, u8 *buf, u32 sz)
|
||||
}
|
||||
#endif /* PLATFORM_LINUX */
|
||||
|
||||
/*
|
||||
* Test if the specifi @param path is a direct and readable
|
||||
* @param path the path of the direct to test
|
||||
* @return _TRUE or _FALSE
|
||||
*/
|
||||
int rtw_is_dir_readable(const char *path)
|
||||
{
|
||||
#ifdef PLATFORM_LINUX
|
||||
if (isDirReadable(path, NULL) == 0)
|
||||
return _TRUE;
|
||||
else
|
||||
return _FALSE;
|
||||
#else
|
||||
/* Todo... */
|
||||
return _FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Test if the specifi @param path is a file and readable
|
||||
* @param path the path of the file to test
|
||||
@@ -2340,6 +2386,25 @@ int rtw_is_file_readable_with_size(const char *path, u32 *sz)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Test if the specifi @param path is a readable file with valid size.
|
||||
* If readable, @param sz is got
|
||||
* @param path the path of the file to test
|
||||
* @return _TRUE or _FALSE
|
||||
*/
|
||||
int rtw_readable_file_sz_chk(const char *path, u32 sz)
|
||||
{
|
||||
u32 fsz;
|
||||
|
||||
if (rtw_is_file_readable_with_size(path, &fsz) == _FALSE)
|
||||
return _FALSE;
|
||||
|
||||
if (fsz > sz)
|
||||
return _FALSE;
|
||||
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Open the file with @param path and retrive the file content into memory starting from @param buf for @param sz at most
|
||||
* @param path the path of the file to open and read
|
||||
@@ -2897,7 +2962,6 @@ int rtw_blacklist_add(_queue *blist, const u8 *addr, u32 timeout_ms)
|
||||
|
||||
exit_critical_bh(&blist->lock);
|
||||
|
||||
exit:
|
||||
return (exist == _TRUE && timeout == _FALSE) ? RTW_ALREADY : (ent ? _SUCCESS : _FAIL);
|
||||
}
|
||||
|
||||
@@ -2929,7 +2993,6 @@ int rtw_blacklist_del(_queue *blist, const u8 *addr)
|
||||
|
||||
exit_critical_bh(&blist->lock);
|
||||
|
||||
exit:
|
||||
return exist == _TRUE ? _SUCCESS : RTW_ALREADY;
|
||||
}
|
||||
|
||||
@@ -2963,7 +3026,6 @@ int rtw_blacklist_search(_queue *blist, const u8 *addr)
|
||||
|
||||
exit_critical_bh(&blist->lock);
|
||||
|
||||
exit:
|
||||
return exist;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user