mirror of
https://github.com/RinCat/RTL88x2BU-Linux-Driver.git
synced 2026-01-19 10:26:35 +00:00
Updated to 5.8.7.4
This commit is contained in:
@@ -14817,6 +14817,7 @@ void dump_hal_spec(void *sel, _adapter *adapter)
|
||||
int i;
|
||||
|
||||
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_cam_ent_num:%u\n", hal_spec->sec_cam_ent_num);
|
||||
|
||||
|
||||
164
hal/hal_intf.c
164
hal/hal_intf.c
@@ -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);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
_adapter *pri_adapter = GET_PRIMARY_ADAPTER(padapter);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,10 +25,10 @@ extern u32 array_length_mp_8822b_fw_ap;
|
||||
#endif
|
||||
|
||||
#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;
|
||||
#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;
|
||||
#endif /*CONFIG_WOWLAN*/
|
||||
#endif
|
||||
|
||||
@@ -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);
|
||||
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_CH_SW
|
||||
void rtl8822b_set_BcnEarly_C2H_Rpt_cmd(PADAPTER padapter, u8 enable);
|
||||
|
||||
@@ -308,6 +308,20 @@ void rtl8822b_set_fw_pwrmode_inips_cmd_wowlan(PADAPTER padapter, u8 ps_mode)
|
||||
}
|
||||
#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
|
||||
#define CLASS_FW_THERMAL_RPT 0x06
|
||||
#define CMD_ID_FW_THERMAL_RPT 0x0B
|
||||
|
||||
@@ -32,6 +32,7 @@ void rtl8822b_init_hal_spec(PADAPTER adapter)
|
||||
hal_spec->macid_num = 128;
|
||||
/* hal_spec->sec_cam_ent_num follow halmac setting */
|
||||
hal_spec->sec_cap = SEC_CAP_CHK_BMC;
|
||||
hal_spec->macid_cap = MACID_DROP;
|
||||
|
||||
hal_spec->rfpath_num_2g = 2;
|
||||
hal_spec->rfpath_num_5g = 2;
|
||||
@@ -70,6 +71,11 @@ void rtl8822b_init_hal_spec(PADAPTER adapter)
|
||||
, REG_MACID_SLEEP1_8822B
|
||||
, REG_MACID_SLEEP2_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)
|
||||
|
||||
Reference in New Issue
Block a user