Updated to 5.8.7.4

This commit is contained in:
Rin Cat 2021-07-15 02:42:01 -04:00
parent d547cb694c
commit dddcdfdcb4
No known key found for this signature in database
GPG Key ID: 7E93675C2BDBB222
31 changed files with 23225 additions and 22815 deletions

2
Makefile Normal file → Executable file
View File

@ -74,7 +74,7 @@ CONFIG_80211W = y
CONFIG_REDUCE_TX_CPU_LOADING = n CONFIG_REDUCE_TX_CPU_LOADING = n
CONFIG_BR_EXT = y CONFIG_BR_EXT = y
CONFIG_TDLS = n CONFIG_TDLS = n
CONFIG_WIFI_MONITOR = y CONFIG_WIFI_MONITOR = y
CONFIG_MCC_MODE = n CONFIG_MCC_MODE = n
CONFIG_APPEND_VENDOR_IE_ENABLE = n CONFIG_APPEND_VENDOR_IE_ENABLE = n
CONFIG_RTW_NAPI = y CONFIG_RTW_NAPI = y

View File

@ -1,6 +1,6 @@
# REALTEK RTL88x2B USB Linux Driver # REALTEK RTL88x2B USB Linux Driver
**Current Driver Version**: 5.8.7.2 **Current Driver Version**: 5.8.7.4
**Support Kernel**: 2.6.24 ~ 5.12 (with unofficial patches) **Support Kernel**: 2.6.24 ~ 5.13 (with unofficial patches)
Official release note please check ReleaseNotes.pdf Official release note please check ReleaseNotes.pdf

View File

@ -3822,8 +3822,6 @@ u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reaso
psta->htpriv.candidate_tid_bitmap = 0x0;/* reset */ psta->htpriv.candidate_tid_bitmap = 0x0;/* reset */
#endif #endif
/* clear cam entry / key */
rtw_clearstakey_cmd(padapter, psta, enqueue);
_enter_critical_bh(&psta->lock, &irqL); _enter_critical_bh(&psta->lock, &irqL);
@ -3856,6 +3854,9 @@ u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reaso
report_del_sta_event(padapter, psta->cmn.mac_addr, reason, enqueue, _FALSE); report_del_sta_event(padapter, psta->cmn.mac_addr, reason, enqueue, _FALSE);
/* clear cam entry / key */
rtw_clearstakey_cmd(padapter, psta, enqueue);
return beacon_updated; return beacon_updated;
} }

View File

@ -3088,6 +3088,7 @@ void rtw_sta_mstatus_disc_rpt(_adapter *adapter, u8 mac_id)
, mac_id, id_is_shared ? " shared" : ""); , mac_id, id_is_shared ? " shared" : "");
if (!id_is_shared) { if (!id_is_shared) {
rtw_hal_macid_drop(adapter, mac_id);
rtw_hal_set_FwMediaStatusRpt_single_cmd(adapter, 0, 0, 0, 0, mac_id); rtw_hal_set_FwMediaStatusRpt_single_cmd(adapter, 0, 0, 0, 0, mac_id);
/* /*
* For safety, prevent from keeping macid sleep. * For safety, prevent from keeping macid sleep.

View File

@ -13983,11 +13983,12 @@ u8 disconnect_hdl(_adapter *padapter, unsigned char *pbuf)
} }
#endif #endif
rtw_sta_mstatus_report(padapter);
rtw_mlmeext_disconnect(padapter); rtw_mlmeext_disconnect(padapter);
rtw_free_uc_swdec_pending_queue(padapter); rtw_free_uc_swdec_pending_queue(padapter);
rtw_sta_mstatus_report(padapter);
return H2C_SUCCESS; return H2C_SUCCESS;
} }

View File

@ -2133,7 +2133,7 @@ BIP_exit:
#ifndef PLATFORM_FREEBSD #ifndef PLATFORM_FREEBSD
#if defined(CONFIG_TDLS) #if defined(CONFIG_TDLS)
/* compress 512-bits */ /* compress 512-bits */
static int sha256_compress(struct rtw_sha256_state *md, unsigned char *buf) static int sha256_compress(struct _sha256_state *md, unsigned char *buf)
{ {
u32 S[8], W[64], t0, t1; u32 S[8], W[64], t0, t1;
u32 t; u32 t;
@ -2181,7 +2181,7 @@ static int sha256_compress(struct rtw_sha256_state *md, unsigned char *buf)
} }
/* Initialize the hash state */ /* Initialize the hash state */
static void sha256_init(struct rtw_sha256_state *md) static void sha256_init(struct _sha256_state *md)
{ {
md->curlen = 0; md->curlen = 0;
md->length = 0; md->length = 0;
@ -2202,7 +2202,7 @@ static void sha256_init(struct rtw_sha256_state *md)
@param inlen The length of the data (octets) @param inlen The length of the data (octets)
@return CRYPT_OK if successful @return CRYPT_OK if successful
*/ */
static int sha256_process(struct rtw_sha256_state *md, unsigned char *in, static int sha256_process(struct _sha256_state *md, unsigned char *in,
unsigned long inlen) unsigned long inlen)
{ {
unsigned long n; unsigned long n;
@ -2243,7 +2243,7 @@ static int sha256_process(struct rtw_sha256_state *md, unsigned char *in,
@param out [out] The destination of the hash (32 bytes) @param out [out] The destination of the hash (32 bytes)
@return CRYPT_OK if successful @return CRYPT_OK if successful
*/ */
static int sha256_done(struct rtw_sha256_state *md, unsigned char *out) static int sha256_done(struct _sha256_state *md, unsigned char *out)
{ {
int i; int i;
@ -2293,7 +2293,7 @@ static int sha256_done(struct rtw_sha256_state *md, unsigned char *out)
static int sha256_vector(size_t num_elem, u8 *addr[], size_t *len, static int sha256_vector(size_t num_elem, u8 *addr[], size_t *len,
u8 *mac) u8 *mac)
{ {
struct rtw_sha256_state ctx; struct _sha256_state ctx;
size_t i; size_t i;
sha256_init(&ctx); sha256_init(&ctx);

View File

@ -3666,6 +3666,16 @@ void beacon_timing_control(_adapter *padapter)
rtw_hal_bcn_related_reg_setting(padapter); rtw_hal_bcn_related_reg_setting(padapter);
} }
inline bool _rtw_macid_ctl_chk_cap(_adapter *adapter, u8 cap)
{
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
struct macid_ctl_t *macid_ctl = &dvobj->macid_ctl;
if (macid_ctl->macid_cap & cap)
return _TRUE;
return _FALSE;
}
void dump_macid_map(void *sel, struct macid_bmp *map, u8 max_num) void dump_macid_map(void *sel, struct macid_bmp *map, u8 max_num)
{ {
RTW_PRINT_SEL(sel, "0x%08x\n", map->m0); RTW_PRINT_SEL(sel, "0x%08x\n", map->m0);
@ -3683,6 +3693,7 @@ void dump_macid_map(void *sel, struct macid_bmp *map, u8 max_num)
#endif #endif
} }
inline bool rtw_macid_is_set(struct macid_bmp *map, u8 id) inline bool rtw_macid_is_set(struct macid_bmp *map, u8 id)
{ {
if (id < 32) if (id < 32)
@ -4129,6 +4140,11 @@ inline void rtw_macid_ctl_init_sleep_reg(struct macid_ctl_t *macid_ctl, u16 reg_
macid_ctl->reg_sleep_ctrl = reg_ctrl; macid_ctl->reg_sleep_ctrl = reg_ctrl;
macid_ctl->reg_sleep_info = reg_info; macid_ctl->reg_sleep_info = reg_info;
} }
inline void rtw_macid_ctl_init_drop_reg(struct macid_ctl_t *macid_ctl, u16 reg_ctrl, u16 reg_info)
{
macid_ctl->reg_drop_ctrl = reg_ctrl;
macid_ctl->reg_drop_info = reg_info;
}
#else #else
inline void rtw_macid_ctl_init_sleep_reg(struct macid_ctl_t *macid_ctl, u16 m0, u16 m1, u16 m2, u16 m3) inline void rtw_macid_ctl_init_sleep_reg(struct macid_ctl_t *macid_ctl, u16 m0, u16 m1, u16 m2, u16 m3)
{ {
@ -4143,6 +4159,19 @@ inline void rtw_macid_ctl_init_sleep_reg(struct macid_ctl_t *macid_ctl, u16 m0,
macid_ctl->reg_sleep_m3 = m3; macid_ctl->reg_sleep_m3 = m3;
#endif #endif
} }
inline void rtw_macid_ctl_init_drop_reg(struct macid_ctl_t *macid_ctl, u16 m0, u16 m1, u16 m2, u16 m3)
{
macid_ctl->reg_drop_m0 = m0;
#if (MACID_NUM_SW_LIMIT > 32)
macid_ctl->reg_drop_m1 = m1;
#endif
#if (MACID_NUM_SW_LIMIT > 64)
macid_ctl->reg_drop_m2 = m2;
#endif
#if (MACID_NUM_SW_LIMIT > 96)
macid_ctl->reg_drop_m3 = m3;
#endif
}
#endif #endif
inline void rtw_macid_ctl_init(struct macid_ctl_t *macid_ctl) inline void rtw_macid_ctl_init(struct macid_ctl_t *macid_ctl)

View File

@ -4573,8 +4573,7 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
#ifdef CONFIG_MONITOR_MODE_XMIT #ifdef CONFIG_MONITOR_MODE_XMIT
int consume; int consume;
#endif /* CONFIG_MONITOR_MODE_XMIT */ #endif /* CONFIG_MONITOR_MODE_XMIT */
if (likely(skb)) rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize);
rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize);
#ifndef CONFIG_CUSTOMER_ALIBABA_GENERAL #ifndef CONFIG_CUSTOMER_ALIBABA_GENERAL
if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header))) if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header)))

View File

@ -14817,6 +14817,7 @@ void dump_hal_spec(void *sel, _adapter *adapter)
int i; int i;
RTW_PRINT_SEL(sel, "macid_num:%u\n", hal_spec->macid_num); RTW_PRINT_SEL(sel, "macid_num:%u\n", hal_spec->macid_num);
RTW_PRINT_SEL(sel, "macid_cap:%u\n", hal_spec->macid_cap);
RTW_PRINT_SEL(sel, "sec_cap:0x%02x\n", hal_spec->sec_cap); RTW_PRINT_SEL(sel, "sec_cap:0x%02x\n", hal_spec->sec_cap);
RTW_PRINT_SEL(sel, "sec_cam_ent_num:%u\n", hal_spec->sec_cam_ent_num); RTW_PRINT_SEL(sel, "sec_cam_ent_num:%u\n", hal_spec->sec_cam_ent_num);

View File

@ -1635,6 +1635,170 @@ inline s32 rtw_hal_macid_wakeup_all_used(_adapter *adapter)
return _rtw_hal_macid_bmp_sleep(adapter, &macid_ctl->used, 0); return _rtw_hal_macid_bmp_sleep(adapter, &macid_ctl->used, 0);
} }
static s32 _rtw_hal_macid_drop(_adapter *adapter, u8 macid, u8 drop)
{
struct macid_ctl_t *macid_ctl = adapter_to_macidctl(adapter);
#ifndef CONFIG_PROTSEL_MACSLEEP
u16 reg_drop = 0;
#else
u16 reg_drop_info = macid_ctl->reg_drop_info;
u16 reg_drop_ctrl = macid_ctl->reg_drop_ctrl;
const u32 sel_mask_sel = BIT(0) | BIT(1) | BIT(2);
#endif /* CONFIG_PROTSEL_MACSLEEP */
u8 bit_shift;
u32 val32;
s32 ret = _FAIL;
/* some IC doesn't have this register */
#ifndef REG_PKT_BUFF_ACCESS_CTRL
#define REG_PKT_BUFF_ACCESS_CTRL 0
#endif
if (macid >= macid_ctl->num) {
RTW_ERR(ADPT_FMT" %s invalid macid(%u)\n"
, ADPT_ARG(adapter), drop ? "drop" : "undrop" , macid);
goto exit;
}
if(_rtw_macid_ctl_chk_cap(adapter, MACID_DROP)) {
if (macid < 32) {
#ifndef CONFIG_PROTSEL_MACSLEEP
reg_drop = macid_ctl->reg_drop_m0;
#endif /* CONFIG_PROTSEL_MACSLEEP */
bit_shift = macid;
#if (MACID_NUM_SW_LIMIT > 32)
} else if (macid < 64) {
#ifndef CONFIG_PROTSEL_MACSLEEP
reg_drop = macid_ctl->reg_drop_m1;
#endif /* CONFIG_PROTSEL_MACSLEEP */
bit_shift = macid - 32;
#endif
#if (MACID_NUM_SW_LIMIT > 64)
} else if (macid < 96) {
#ifndef CONFIG_PROTSEL_MACSLEEP
reg_drop = macid_ctl->reg_drop_m2;
#endif /* CONFIG_PROTSEL_MACSLEEP */
bit_shift = macid - 64;
#endif
#if (MACID_NUM_SW_LIMIT > 96)
} else if (macid < 128) {
#ifndef CONFIG_PROTSEL_MACSLEEP
reg_drop = macid_ctl->reg_drop_m3;
#endif /* CONFIG_PROTSEL_MACSLEEP */
bit_shift = macid - 96;
#endif
} else {
rtw_warn_on(1);
goto exit;
}
#ifndef CONFIG_PROTSEL_MACSLEEP
if (!reg_drop) {
rtw_warn_on(1);
goto exit;
}
val32 = rtw_read32(adapter, reg_drop);
/*RTW_INFO(ADPT_FMT" %s macid=%d, ori reg_0x%03x=0x%08x \n"
, ADPT_ARG(adapter), drop ? "drop" : "undrop"
, macid, reg_drop, val32);*/
#else
if (!reg_drop_ctrl || !reg_drop_info) {
rtw_warn_on(1);
goto exit;
}
val32 = rtw_read32(adapter, reg_drop_ctrl);
val32 = (val32 &~sel_mask_sel) | ((macid / 32) & sel_mask_sel);
rtw_write32(adapter, reg_drop_ctrl, val32);
val32 = rtw_read32(adapter, reg_drop_info);
/*RTW_INFO(ADPT_FMT" %s macid=%d, ori reg_0x%03x=0x%08x\n"
, ADPT_ARG(adapter), drop ? "drop" : "undrop"
, macid, reg_drop_info, val32);*/
#endif /* CONFIG_PROTSEL_MACSLEEP */
ret = _SUCCESS;
if (drop) {
if (val32 & BIT(bit_shift))
goto exit;
val32 |= BIT(bit_shift);
} else {
if (!(val32 & BIT(bit_shift)))
goto exit;
val32 &= ~BIT(bit_shift);
}
#ifndef CONFIG_PROTSEL_MACSLEEP
rtw_write32(adapter, reg_drop, val32);
RTW_INFO(ADPT_FMT" %s macid=%d, done reg_0x%03x=0x%08x\n"
, ADPT_ARG(adapter), drop ? "drop" : "undrop"
, macid, reg_drop, val32);
#else
rtw_write32(adapter, reg_drop_info, val32);
RTW_INFO(ADPT_FMT" %s macid=%d, done reg_0x%03x=0x%08x\n"
, ADPT_ARG(adapter), drop ? "drop" : "undrop"
, macid, reg_drop_info, val32);
#endif /* CONFIG_PROTSEL_MACSLEEP */
} else if(_rtw_macid_ctl_chk_cap(adapter, MACID_DROP_INDIRECT)) {
u16 start_addr = macid_ctl->macid_txrpt/8;
u32 txrpt_h4b = 0;
u8 i;
/* each address means 1 byte */
start_addr += macid*(macid_ctl->macid_txrpt_pgsz/8);
/* select tx report buffer */
rtw_write8(adapter, REG_PKT_BUFF_ACCESS_CTRL, TXREPORT_BUF_SELECT);
/* set tx report buffer start address for reading */
rtw_write32(adapter, REG_PKTBUF_DBG_CTRL, start_addr);
txrpt_h4b = rtw_read32(adapter, REG_PKTBUF_DBG_DATA_H);
/* OFFSET5 BIT2 is BIT10 of high 4 bytes */
if (drop) {
if (txrpt_h4b & BIT(10))
goto exit;
txrpt_h4b |= BIT(10);
} else {
if (!(txrpt_h4b & BIT(10)))
goto exit;
txrpt_h4b &= ~BIT(10);
}
/* set to macid drop field */
rtw_write32(adapter, REG_PKTBUF_DBG_DATA_H, txrpt_h4b);
/* 0x20800000 only write BIT10 of tx report buf */
rtw_write32(adapter, REG_PKTBUF_DBG_CTRL, 0x20800000 | start_addr);
#if 0 /* some ICs doesn't clear the write done bit */
/* checking TX queue status */
for (i = 0 ; i < 50 ; i++) {
txrpt_h4b = rtw_read32(adapter, REG_PKTBUF_DBG_CTRL);
if (txrpt_h4b & BIT(23)) {
RTW_INFO("%s: wait to write TX RTP buf (%d)!\n", __func__, i);
rtw_mdelay_os(10);
} else {
RTW_INFO("%s: wait to write TX RTP buf done (%d)!\n", __func__, i);
break;
}
}
#endif
rtw_write32(adapter, REG_PKTBUF_DBG_CTRL, start_addr);
RTW_INFO("start_addr=%x, data_H:%08x, data_L:%08x, macid=%d, txrpt_h4b=%x\n", start_addr
,rtw_read32(adapter, REG_PKTBUF_DBG_DATA_H), rtw_read32(adapter, REG_PKTBUF_DBG_DATA_L), macid, txrpt_h4b);
} else {
RTW_INFO("There is no definition for camctl cap , please correct it\n");
}
exit:
return ret;
}
inline s32 rtw_hal_macid_drop(_adapter *adapter, u8 macid)
{
return _rtw_hal_macid_drop(adapter, macid, 1);
}
inline s32 rtw_hal_macid_undrop(_adapter *adapter, u8 macid)
{
return _rtw_hal_macid_drop(adapter, macid, 0);
}
s32 rtw_hal_fill_h2c_cmd(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer) s32 rtw_hal_fill_h2c_cmd(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer)
{ {
_adapter *pri_adapter = GET_PRIMARY_ADAPTER(padapter); _adapter *pri_adapter = GET_PRIMARY_ADAPTER(padapter);

File diff suppressed because it is too large Load Diff

View File

@ -25,10 +25,10 @@ extern u32 array_length_mp_8822b_fw_ap;
#endif #endif
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) || (DM_ODM_SUPPORT_TYPE & (ODM_CE)) #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) || (DM_ODM_SUPPORT_TYPE & (ODM_CE))
extern u8 array_mp_8822b_fw_nic[160504]; extern u8 array_mp_8822b_fw_nic[161240];
extern u32 array_length_mp_8822b_fw_nic; extern u32 array_length_mp_8822b_fw_nic;
#ifdef CONFIG_WOWLAN #ifdef CONFIG_WOWLAN
extern u8 array_mp_8822b_fw_wowlan[102944]; extern u8 array_mp_8822b_fw_wowlan[103328];
extern u32 array_length_mp_8822b_fw_wowlan; extern u32 array_length_mp_8822b_fw_wowlan;
#endif /*CONFIG_WOWLAN*/ #endif /*CONFIG_WOWLAN*/
#endif #endif

View File

@ -122,6 +122,10 @@ void rtl8822b_query_rx_desc(union recv_frame *, u8 *pdesc);
s32 rtl8822b_fillh2ccmd(PADAPTER, u8 id, u32 buf_len, u8 *pbuf); s32 rtl8822b_fillh2ccmd(PADAPTER, u8 id, u32 buf_len, u8 *pbuf);
void rtl8822b_set_FwPwrMode_cmd(PADAPTER, u8 psmode); void rtl8822b_set_FwPwrMode_cmd(PADAPTER, u8 psmode);
#ifdef CONFIG_USB_CONFIG_OFFLOAD_8822B
void rtl8822b_set_usb_config_offload(PADAPTER adapter);
#endif
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
#ifdef CONFIG_TDLS_CH_SW #ifdef CONFIG_TDLS_CH_SW
void rtl8822b_set_BcnEarly_C2H_Rpt_cmd(PADAPTER padapter, u8 enable); void rtl8822b_set_BcnEarly_C2H_Rpt_cmd(PADAPTER padapter, u8 enable);

View File

@ -308,6 +308,20 @@ void rtl8822b_set_fw_pwrmode_inips_cmd_wowlan(PADAPTER padapter, u8 ps_mode)
} }
#endif /* CONFIG_WOWLAN */ #endif /* CONFIG_WOWLAN */
#ifdef CONFIG_USB_CONFIG_OFFLOAD_8822B
void rtl8822b_set_usb_config_offload(PADAPTER padapter)
{
u8 h2c_data_bt_unknown[H2C_BT_UNKNOWN_DEVICE_WA_LEN] = {0};
s32 ret;
SET_H2CCMD_BT_UNKNOWN_DEVICE_WA_HANG_CHK_EN(h2c_data_bt_unknown, 1);
ret = rtw_hal_fill_h2c_cmd(padapter, H2C_BT_UNKNOWN_DEVICE_WA,
H2C_BT_UNKNOWN_DEVICE_WA_LEN, h2c_data_bt_unknown);
if (ret != _SUCCESS)
RTW_ERR("%s(): H2C failed\n", __func__);
}
#endif
#ifdef CONFIG_LPS_PWR_TRACKING #ifdef CONFIG_LPS_PWR_TRACKING
#define CLASS_FW_THERMAL_RPT 0x06 #define CLASS_FW_THERMAL_RPT 0x06
#define CMD_ID_FW_THERMAL_RPT 0x0B #define CMD_ID_FW_THERMAL_RPT 0x0B

View File

@ -32,6 +32,7 @@ void rtl8822b_init_hal_spec(PADAPTER adapter)
hal_spec->macid_num = 128; hal_spec->macid_num = 128;
/* hal_spec->sec_cam_ent_num follow halmac setting */ /* hal_spec->sec_cam_ent_num follow halmac setting */
hal_spec->sec_cap = SEC_CAP_CHK_BMC; hal_spec->sec_cap = SEC_CAP_CHK_BMC;
hal_spec->macid_cap = MACID_DROP;
hal_spec->rfpath_num_2g = 2; hal_spec->rfpath_num_2g = 2;
hal_spec->rfpath_num_5g = 2; hal_spec->rfpath_num_5g = 2;
@ -70,6 +71,11 @@ void rtl8822b_init_hal_spec(PADAPTER adapter)
, REG_MACID_SLEEP1_8822B , REG_MACID_SLEEP1_8822B
, REG_MACID_SLEEP2_8822B , REG_MACID_SLEEP2_8822B
, REG_MACID_SLEEP3_8822B); , REG_MACID_SLEEP3_8822B);
rtw_macid_ctl_init_drop_reg(adapter_to_macidctl(adapter)
, REG_MACID_DROP0_8822B
, REG_MACID_DROP1_8822B
, REG_MACID_DROP2_8822B
, REG_MACID_DROP3_8822B);
} }
u32 rtl8822b_power_on(PADAPTER adapter) u32 rtl8822b_power_on(PADAPTER adapter)

0
include/autoconf.h Executable file → Normal file
View File

View File

@ -773,6 +773,9 @@ struct rtw_traffic_statistics {
}; };
#define SEC_CAP_CHK_BMC BIT0 #define SEC_CAP_CHK_BMC BIT0
#define MACID_DROP BIT0
#define MACID_DROP_INDIRECT BIT1
#define SEC_STATUS_STA_PK_GK_CONFLICT_DIS_BMC_SEARCH BIT0 #define SEC_STATUS_STA_PK_GK_CONFLICT_DIS_BMC_SEARCH BIT0
@ -855,22 +858,31 @@ struct macid_ctl_t {
struct sta_info *sta[MACID_NUM_SW_LIMIT]; /* corresponding stainfo when macid is not shared */ struct sta_info *sta[MACID_NUM_SW_LIMIT]; /* corresponding stainfo when macid is not shared */
u8 macid_cap;
/* macid sleep registers */ /* macid sleep registers */
#ifdef CONFIG_PROTSEL_MACSLEEP #ifdef CONFIG_PROTSEL_MACSLEEP
u16 reg_sleep_ctrl; u16 reg_sleep_ctrl;
u16 reg_sleep_info; u16 reg_sleep_info;
u16 reg_drop_ctrl;
u16 reg_drop_info;
#else #else
u16 reg_sleep_m0; u16 reg_sleep_m0;
u16 reg_drop_m0;
#if (MACID_NUM_SW_LIMIT > 32) #if (MACID_NUM_SW_LIMIT > 32)
u16 reg_sleep_m1; u16 reg_sleep_m1;
u16 reg_drop_m1;
#endif #endif
#if (MACID_NUM_SW_LIMIT > 64) #if (MACID_NUM_SW_LIMIT > 64)
u16 reg_sleep_m2; u16 reg_sleep_m2;
u16 reg_drop_m2;
#endif #endif
#if (MACID_NUM_SW_LIMIT > 96) #if (MACID_NUM_SW_LIMIT > 96)
u16 reg_sleep_m3; u16 reg_sleep_m3;
u16 reg_drop_m3;
#endif #endif
#endif #endif
u16 macid_txrpt;
u8 macid_txrpt_pgsz;
}; };
/* used for rf_ctl_t.rate_bmp_cck_ofdm */ /* used for rf_ctl_t.rate_bmp_cck_ofdm */

View File

@ -120,6 +120,7 @@ enum h2c_cmd {
H2C_CUSTOMER_STR_W1 = 0xC6, H2C_CUSTOMER_STR_W1 = 0xC6,
H2C_CUSTOMER_STR_W2 = 0xC7, H2C_CUSTOMER_STR_W2 = 0xC7,
H2C_CUSTOMER_STR_W3 = 0xC8, H2C_CUSTOMER_STR_W3 = 0xC8,
H2C_BT_UNKNOWN_DEVICE_WA = 0xD1,
#ifdef DBG_FW_DEBUG_MSG_PKT #ifdef DBG_FW_DEBUG_MSG_PKT
H2C_FW_DBG_MSG_PKT = 0xE1, H2C_FW_DBG_MSG_PKT = 0xE1,
#endif /*DBG_FW_DEBUG_MSG_PKT*/ #endif /*DBG_FW_DEBUG_MSG_PKT*/
@ -185,6 +186,7 @@ enum h2c_cmd {
#define H2C_BTC_WL_PORT_ID_LEN 1 #define H2C_BTC_WL_PORT_ID_LEN 1
#endif #endif
#define H2C_BT_UNKNOWN_DEVICE_WA_LEN 1
#ifdef DBG_FW_DEBUG_MSG_PKT #ifdef DBG_FW_DEBUG_MSG_PKT
#define H2C_FW_DBG_MSG_PKT_LEN 2 #define H2C_FW_DBG_MSG_PKT_LEN 2
#endif /*DBG_FW_DEBUG_MSG_PKT*/ #endif /*DBG_FW_DEBUG_MSG_PKT*/
@ -566,6 +568,16 @@ s32 rtw_hal_customer_str_write(_adapter *adapter, const u8 *cs);
#define SET_H2CCMD_LPSPG_IQK_INFO_LOC(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd) + 3, 0, 8, __Value)/*Loc_IQK_result*/ #define SET_H2CCMD_LPSPG_IQK_INFO_LOC(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd) + 3, 0, 8, __Value)/*Loc_IQK_result*/
#endif #endif
/* BT_UNKNOWN_DEVICE_WA_0xD1 */
#define SET_H2CCMD_BT_UNKNOWN_DEVICE_WA_HANG_CHK_EN(__pH2CCmd, __Value) \
SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)
#define SET_H2CCMD_BT_UNKNOWN_DEVICE_WA_FORCE_IB_EN(__pH2CCmd, __Value) \
SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 1, __Value)
#define SET_H2CCMD_BT_UNKNOWN_DEVICE_WA_HWID_CHK_EN(__pH2CCmd, __Value) \
SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 1, __Value)
#define SET_H2CCMD_BT_UNKNOWN_DEVICE_WA_ONE_TIME_CHK(__pH2CCmd, __Value) \
SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 1, __Value)
#ifdef DBG_FW_DEBUG_MSG_PKT #ifdef DBG_FW_DEBUG_MSG_PKT
#define SET_H2CCMD_FW_DBG_MSG_PKT_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)/*sniffer_dbg_en*/ #define SET_H2CCMD_FW_DBG_MSG_PKT_EN(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 1, __Value)/*sniffer_dbg_en*/
#define SET_H2CCMD_RSVDPAGE_LOC_FW_DBG_MSG_PKT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value) /*loc_debug_packet*/ #define SET_H2CCMD_RSVDPAGE_LOC_FW_DBG_MSG_PKT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value) /*loc_debug_packet*/

View File

@ -22,6 +22,7 @@
/* 8188E PKT_BUFF_ACCESS_CTRL value */ /* 8188E PKT_BUFF_ACCESS_CTRL value */
#define TXPKT_BUF_SELECT 0x69 #define TXPKT_BUF_SELECT 0x69
#define TXREPORT_BUF_SELECT 0x7F
#define RXPKT_BUF_SELECT 0xA5 #define RXPKT_BUF_SELECT 0xA5
#define DISABLE_TRXPKT_BUF_ACCESS 0x0 #define DISABLE_TRXPKT_BUF_ACCESS 0x0

View File

@ -224,6 +224,9 @@ struct hal_spec_t {
u8 sec_cam_ent_num; u8 sec_cam_ent_num;
u8 sec_cap; u8 sec_cap;
u8 macid_cap;
u16 macid_txrpt;
u8 macid_txrpt_pgsz;
u8 rfpath_num_2g:4; /* used for tx power index path */ u8 rfpath_num_2g:4; /* used for tx power index path */
u8 rfpath_num_5g:4; /* used for tx power index path */ u8 rfpath_num_5g:4; /* used for tx power index path */

View File

@ -841,6 +841,8 @@ s32 rtw_hal_macid_sleep(_adapter *adapter, u8 macid);
s32 rtw_hal_macid_wakeup(_adapter *adapter, u8 macid); s32 rtw_hal_macid_wakeup(_adapter *adapter, u8 macid);
s32 rtw_hal_macid_sleep_all_used(_adapter *adapter); s32 rtw_hal_macid_sleep_all_used(_adapter *adapter);
s32 rtw_hal_macid_wakeup_all_used(_adapter *adapter); s32 rtw_hal_macid_wakeup_all_used(_adapter *adapter);
s32 rtw_hal_macid_drop(_adapter *adapter, u8 macid);
s32 rtw_hal_macid_undrop(_adapter *adapter, u8 macid);
s32 rtw_hal_fill_h2c_cmd(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer); s32 rtw_hal_fill_h2c_cmd(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer);
void rtw_hal_fill_fake_txdesc(_adapter *padapter, u8 *pDesc, u32 BufferLen, void rtw_hal_fill_fake_txdesc(_adapter *padapter, u8 *pDesc, u32 BufferLen,

View File

@ -351,13 +351,13 @@ __inline static _list *get_list_head(_queue *queue)
return &(queue->queue); return &(queue->queue);
} }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
static inline void timer_hdl(struct timer_list *in_timer) static inline void timer_hdl(struct timer_list *in_timer)
#else #else
static inline void timer_hdl(unsigned long cntx) static inline void timer_hdl(unsigned long cntx)
#endif #endif
{ {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
_timer *ptimer = from_timer(ptimer, in_timer, timer); _timer *ptimer = from_timer(ptimer, in_timer, timer);
#else #else
_timer *ptimer = (_timer *)cntx; _timer *ptimer = (_timer *)cntx;
@ -370,7 +370,7 @@ __inline static void _init_timer(_timer *ptimer, _nic_hdl nic_hdl, void *pfunc,
ptimer->function = pfunc; ptimer->function = pfunc;
ptimer->arg = cntx; ptimer->arg = cntx;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
timer_setup(&ptimer->timer, timer_hdl, 0); timer_setup(&ptimer->timer, timer_hdl, 0);
#else #else
/* setup_timer(ptimer, pfunc,(u32)cntx); */ /* setup_timer(ptimer, pfunc,(u32)cntx); */

View File

@ -842,6 +842,7 @@ u8 rtw_get_sec_camid(_adapter *adapter, u8 max_bk_key_num, u8 *sec_key_id);
struct macid_bmp; struct macid_bmp;
struct macid_ctl_t; struct macid_ctl_t;
bool _rtw_macid_ctl_chk_cap(_adapter *adapter, u8 cap);
void dump_macid_map(void *sel, struct macid_bmp *map, u8 max_num); void dump_macid_map(void *sel, struct macid_bmp *map, u8 max_num);
bool rtw_macid_is_set(struct macid_bmp *map, u8 id); bool rtw_macid_is_set(struct macid_bmp *map, u8 id);
void rtw_macid_map_clr(struct macid_bmp *map, u8 id); void rtw_macid_map_clr(struct macid_bmp *map, u8 id);
@ -861,8 +862,10 @@ void rtw_macid_ctl_set_rate_bmp0(struct macid_ctl_t *macid_ctl, u8 id, u32 bmp);
void rtw_macid_ctl_set_rate_bmp1(struct macid_ctl_t *macid_ctl, u8 id, u32 bmp); void rtw_macid_ctl_set_rate_bmp1(struct macid_ctl_t *macid_ctl, u8 id, u32 bmp);
#ifdef CONFIG_PROTSEL_MACSLEEP #ifdef CONFIG_PROTSEL_MACSLEEP
void rtw_macid_ctl_init_sleep_reg(struct macid_ctl_t *macid_ctl, u16 reg_ctrl, u16 reg_info); void rtw_macid_ctl_init_sleep_reg(struct macid_ctl_t *macid_ctl, u16 reg_ctrl, u16 reg_info);
void rtw_macid_ctl_init_drop_reg(struct macid_ctl_t *macid_ctl, u16 reg_ctrl, u16 reg_info);
#else #else
void rtw_macid_ctl_init_sleep_reg(struct macid_ctl_t *macid_ctl, u16 m0, u16 m1, u16 m2, u16 m3); void rtw_macid_ctl_init_sleep_reg(struct macid_ctl_t *macid_ctl, u16 m0, u16 m1, u16 m2, u16 m3);
void rtw_macid_ctl_init_drop_reg(struct macid_ctl_t *macid_ctl, u16 m0, u16 m1, u16 m2, u16 m3);
#endif #endif
void rtw_macid_ctl_init(struct macid_ctl_t *macid_ctl); void rtw_macid_ctl_init(struct macid_ctl_t *macid_ctl);
void rtw_macid_ctl_deinit(struct macid_ctl_t *macid_ctl); void rtw_macid_ctl_deinit(struct macid_ctl_t *macid_ctl);

View File

@ -251,7 +251,7 @@ struct security_priv {
#define SEC_IS_BIP_KEY_INSTALLED(sec) _FALSE #define SEC_IS_BIP_KEY_INSTALLED(sec) _FALSE
#endif #endif
struct rtw_sha256_state { struct _sha256_state {
u64 length; u64 length;
u32 state[8], curlen; u32 state[8], curlen;
u8 buf[64]; u8 buf[64];

View File

@ -1,2 +1,2 @@
#define DRIVERVERSION "v5.8.7.2_36899.20200819_COEX20191120-7777" #define DRIVERVERSION "v5.8.7.4_37264.20200922_COEX20191120-7777"
#define BTCOEXVERSION "COEX20191120-7777" #define BTCOEXVERSION "COEX20191120-7777"

View File

@ -68,7 +68,8 @@ struct xmit_frame;
struct xmit_buf; struct xmit_buf;
extern int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); extern int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev);
extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); extern inline netdev_tx_t rtw_xmit_entry(struct sk_buff *pkt,
struct net_device *pnetdev);
#endif /* PLATFORM_LINUX */ #endif /* PLATFORM_LINUX */

85
os_dep/linux/ioctl_cfg80211.c Normal file → Executable file
View File

@ -7776,7 +7776,6 @@ cancel_ps_deny:
exit: exit:
return ret; return ret;
} }
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)) #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
@ -7785,11 +7784,6 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
struct net_device *ndev, struct net_device *ndev,
#endif #endif
u16 frame_type, bool reg) u16 frame_type, bool reg)
#else
static void cfg80211_rtw_update_mgmt_frame_register(struct wiphy *wiphy,
struct wireless_dev *wdev,
struct mgmt_frame_regs *upd)
#endif
{ {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct net_device *ndev = wdev_to_ndev(wdev); struct net_device *ndev = wdev_to_ndev(wdev);
@ -7797,9 +7791,6 @@ static void cfg80211_rtw_update_mgmt_frame_register(struct wiphy *wiphy,
_adapter *adapter; _adapter *adapter;
struct rtw_wdev_priv *pwdev_priv; struct rtw_wdev_priv *pwdev_priv;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
u32 rtw_mask;
#endif
if (ndev == NULL) if (ndev == NULL)
goto exit; goto exit;
@ -7808,51 +7799,78 @@ static void cfg80211_rtw_update_mgmt_frame_register(struct wiphy *wiphy,
pwdev_priv = adapter_wdev_data(adapter); pwdev_priv = adapter_wdev_data(adapter);
#ifdef CONFIG_DEBUG_CFG80211 #ifdef CONFIG_DEBUG_CFG80211
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
RTW_INFO(FUNC_ADPT_FMT" frame_type:%x, reg:%d\n", FUNC_ADPT_ARG(adapter), RTW_INFO(FUNC_ADPT_FMT" frame_type:%x, reg:%d\n", FUNC_ADPT_ARG(adapter),
frame_type, reg); frame_type, reg);
#else
RTW_INFO(FUNC_ADPT_FMT" new_reg:%x, old_reg:%x\n", FUNC_ADPT_ARG(adapter),
pwdev_priv->mgmt_mask, upd->interface_stypes);
#endif
#endif #endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
rtw_mask = BIT(IEEE80211_STYPE_AUTH >> 4);
if ((upd->interface_stypes & rtw_mask)
== (pwdev_priv->mgmt_mask & rtw_mask))
return;
pwdev_priv->mgmt_mask = upd->interface_stypes;
#else
switch (frame_type) { switch (frame_type) {
case IEEE80211_STYPE_AUTH: /* 0x00B0 */ case IEEE80211_STYPE_AUTH: /* 0x00B0 */
if (reg > 0) if (reg > 0)
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_AUTH, reg); SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_AUTH);
else else
CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_AUTH, reg); CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_AUTH);
break; break;
#ifdef not_yet #ifdef not_yet
case IEEE80211_STYPE_PROBE_REQ: /* 0x0040 */ case IEEE80211_STYPE_PROBE_REQ: /* 0x0040 */
if (reg > 0) if (reg > 0)
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg); SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ);
else else
CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg); CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ);
break; break;
case IEEE80211_STYPE_ACTION: /* 0x00D0 */ case IEEE80211_STYPE_ACTION: /* 0x00D0 */
if (reg > 0) if (reg > 0)
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_ACTION, reg); SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_ACTION);
else else
CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_ACTION, reg); CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_ACTION);
break; break;
#endif #endif
default: default:
break; break;
} }
#endif
exit: exit:
return; return;
} }
#else
static void cfg80211_rtw_update_mgmt_frame_register(
struct wiphy *wiphy,
struct wireless_dev *wdev,
struct mgmt_frame_regs *upd)
{
struct net_device *ndev;
_adapter *padapter;
struct rtw_wdev_priv *pwdev_priv;
u32 rtw_stypes_mask = 0;
u32 rtw_mstypes_mask = 0;
ndev = wdev_to_ndev(wdev);
if (ndev == NULL)
goto exit;
padapter = (_adapter *)rtw_netdev_priv(ndev);
pwdev_priv = adapter_wdev_data(padapter);
rtw_stypes_mask = BIT(IEEE80211_STYPE_AUTH >> 4);
#ifdef CONFIG_DEBUG_CFG80211
RTW_INFO(FUNC_ADPT_FMT " global_stypes:0x%08x interface_stypes:0x%08x\n",
FUNC_ADPT_ARG(padapter), upd->global_stypes, upd->interface_stypes);
RTW_INFO(FUNC_ADPT_FMT " global_mcast_stypes:0x%08x interface_mcast_stypes:0x%08x\n",
FUNC_ADPT_ARG(padapter), upd->global_mcast_stypes, upd->interface_mcast_stypes);
RTW_INFO(FUNC_ADPT_FMT " old_regs:0x%08x new_regs:0x%08x\n",
FUNC_ADPT_ARG(padapter), pwdev_priv->mgmt_regs,
(upd->interface_stypes & rtw_stypes_mask));
#endif
if (pwdev_priv->mgmt_regs !=
(upd->interface_stypes & rtw_stypes_mask)) {
pwdev_priv->mgmt_regs = (upd->interface_stypes & rtw_stypes_mask);
}
exit:
return;
}
#endif
#if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)) #if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0))
static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy, static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy,
@ -10236,16 +10254,15 @@ static struct cfg80211_ops rtw_cfg80211_ops = {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
.mgmt_tx = cfg80211_rtw_mgmt_tx, .mgmt_tx = cfg80211_rtw_mgmt_tx,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
.mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
#else
.update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_register,
#endif
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
.action = cfg80211_rtw_mgmt_tx, .action = cfg80211_rtw_mgmt_tx,
#endif #endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
.update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_register,
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
.mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
#endif
#if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)) #if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0))
.tdls_mgmt = cfg80211_rtw_tdls_mgmt, .tdls_mgmt = cfg80211_rtw_tdls_mgmt,
.tdls_oper = cfg80211_rtw_tdls_oper, .tdls_oper = cfg80211_rtw_tdls_oper,

View File

@ -168,16 +168,19 @@ struct rtw_wdev_priv {
bool block_scan; bool block_scan;
bool power_mgmt; bool power_mgmt;
/* report mgmt_frame registered */ /**
u16 report_mgmt; * mgmt_regs: bitmap of management frame subtypes registered for the
* given interface
* mcast_mgmt_regs: mcast RX is needed on this interface for these
* subtypes
*/
u32 mgmt_regs;
/* u32 mcast_mgmt_regs; */
u8 is_mgmt_tx; u8 is_mgmt_tx;
u16 mgmt_tx_cookie; u16 mgmt_tx_cookie;
_mutex roch_mutex; _mutex roch_mutex;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
u32 mgmt_mask;
#endif
#ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_CONCURRENT_MODE
ATOMIC_T switch_ch_to; ATOMIC_T switch_ch_to;
@ -266,9 +269,13 @@ struct rtw_wiphy_data {
#define FUNC_WIPHY_FMT "%s("WIPHY_FMT")" #define FUNC_WIPHY_FMT "%s("WIPHY_FMT")"
#define FUNC_WIPHY_ARG(wiphy) __func__, WIPHY_ARG(wiphy) #define FUNC_WIPHY_ARG(wiphy) __func__, WIPHY_ARG(wiphy)
#define SET_CFG80211_REPORT_MGMT(w, t, v) (w->report_mgmt |= BIT(t >> 4)) #define SET_CFG80211_MGMT_REGS(w, t) (w |= BIT(t >> 4))
#define CLR_CFG80211_REPORT_MGMT(w, t, v) (w->report_mgmt &= (~BIT(t >> 4))) #define CLR_CFG80211_MGMT_REGS(w, t) (w &= (~BIT(t >> 4)))
#define GET_CFG80211_REPORT_MGMT(w, t) ((w->report_mgmt & BIT(t >> 4)) > 0) #define GET_CFG80211_MGMT_REGS(w, t) ((w & BIT(t >> 4)) > 0)
#define SET_CFG80211_REPORT_MGMT(w, t) (SET_CFG80211_MGMT_REGS(w->mgmt_regs, t))
#define CLR_CFG80211_REPORT_MGMT(w, t) (CLR_CFG80211_MGMT_REGS(w->mgmt_regs, t))
#define GET_CFG80211_REPORT_MGMT(w, t) (GET_CFG80211_MGMT_REGS(w->mgmt_regs, t))
struct wiphy *rtw_wiphy_alloc(_adapter *padapter, struct device *dev); struct wiphy *rtw_wiphy_alloc(_adapter *padapter, struct device *dev);
void rtw_wiphy_free(struct wiphy *wiphy); void rtw_wiphy_free(struct wiphy *wiphy);

View File

@ -166,7 +166,10 @@ int rtw_mp_read_reg(struct net_device *dev,
char *pextra = extra; char *pextra = extra;
int ret = 0; int ret = 0;
if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1))) if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
return -EFAULT;
if (wrqu->length > 128)
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, wrqu->length); _rtw_memset(input, 0, wrqu->length);
@ -361,6 +364,9 @@ int rtw_mp_read_rf(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length)) if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
return -EFAULT; return -EFAULT;
if (wrqu->length > 128)
return -EFAULT;
_rtw_memset(input, 0, wrqu->length); _rtw_memset(input, 0, wrqu->length);
if (copy_from_user(input, wrqu->pointer, wrqu->length)) { if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
@ -672,6 +678,9 @@ int rtw_mp_txpower_index(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1))) if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1)))
return -EFAULT; return -EFAULT;
if (wrqu->length > 128)
return -EFAULT;
_rtw_memset(input, 0, sizeof(input)); _rtw_memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) { if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
@ -749,8 +758,6 @@ int rtw_mp_txpower(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length)) if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) { if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
ret = -EFAULT; ret = -EFAULT;
goto exit; goto exit;
@ -1153,8 +1160,6 @@ int rtw_mp_arx(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length)) if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) { if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
ret = -EFAULT; ret = -EFAULT;
goto exit; goto exit;
@ -1354,8 +1359,6 @@ int rtw_mp_pwrtrk(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length)) if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) { if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
ret = -EFAULT; ret = -EFAULT;
goto exit; goto exit;
@ -1575,8 +1578,6 @@ int rtw_mp_dump(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length)) if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input));
pmp_priv = &padapter->mppriv; pmp_priv = &padapter->mppriv;
if (copy_from_user(input, wrqu->pointer, wrqu->length)) { if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
@ -1612,8 +1613,6 @@ int rtw_mp_phypara(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length)) if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) { if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
ret = -EFAULT; ret = -EFAULT;
goto exit; goto exit;
@ -1680,8 +1679,6 @@ int rtw_mp_SetRFPath(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length)) if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) { if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
ret = -EFAULT; ret = -EFAULT;
goto exit; goto exit;
@ -1735,11 +1732,9 @@ int rtw_mp_switch_rf_path(struct net_device *dev,
int bwlg = 1, bwla = 1, btg = 1, bbt=1; int bwlg = 1, bwla = 1, btg = 1, bbt=1;
int ret = 0; int ret = 0;
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length + 1)) if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) { if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
ret = -EFAULT; ret = -EFAULT;
goto exit; goto exit;
@ -1798,8 +1793,6 @@ int rtw_mp_QueryDrv(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->data.length)) if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->data.length))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length)) { if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length)) {
ret = -EFAULT; ret = -EFAULT;
goto exit; goto exit;
@ -1839,8 +1832,6 @@ int rtw_mp_PwrCtlDM(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length)) if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) { if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
ret = -EFAULT; ret = -EFAULT;
goto exit; goto exit;
@ -2968,8 +2959,6 @@ int rtw_mp_link(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length)) if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) { if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
ret = -EFAULT; ret = -EFAULT;
goto exit; goto exit;

View File

@ -2594,6 +2594,9 @@ u8 rtw_init_drv_sw(_adapter *padapter)
dvobj->macid_ctl.num = rtw_min(hal_spec->macid_num, MACID_NUM_SW_LIMIT); dvobj->macid_ctl.num = rtw_min(hal_spec->macid_num, MACID_NUM_SW_LIMIT);
dvobj->macid_ctl.macid_cap = hal_spec->macid_cap;
dvobj->macid_ctl.macid_txrpt = hal_spec->macid_txrpt;
dvobj->macid_ctl.macid_txrpt_pgsz = hal_spec->macid_txrpt_pgsz;
dvobj->cam_ctl.sec_cap = hal_spec->sec_cap; 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); dvobj->cam_ctl.num = rtw_min(hal_spec->sec_cam_ent_num, SEC_CAM_ENT_NUM_SW_LIMIT);

View File

@ -614,11 +614,11 @@ fail:
} }
#endif #endif
int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev) inline netdev_tx_t rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev)
{ {
_adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev); _adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
int ret = 0; netdev_tx_t ret = 0;
if (pkt) { if (pkt) {
#ifdef CONFIG_CUSTOMER_ALIBABA_GENERAL #ifdef CONFIG_CUSTOMER_ALIBABA_GENERAL