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:
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2017 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2017 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2017 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2017 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2017 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2017 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2017 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2017 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -460,6 +460,15 @@ static enum halmac_ret_status
|
||||
chk_pinmux_valid_8822b(struct halmac_adapter *adapter,
|
||||
enum halmac_gpio_func gpio_func);
|
||||
|
||||
static enum halmac_ret_status
|
||||
pinmux_switch_8822b(struct halmac_adapter *adapter,
|
||||
const struct halmac_gpio_pimux_list *list, u32 size,
|
||||
u32 gpio_id, enum halmac_gpio_func gpio_func);
|
||||
|
||||
static enum halmac_ret_status
|
||||
pinmux_record_8822b(struct halmac_adapter *adapter,
|
||||
enum halmac_gpio_func gpio_func, u8 val);
|
||||
|
||||
/**
|
||||
* pinmux_get_func_8822b() -get current gpio status
|
||||
* @adapter : the adapter of halmac
|
||||
@@ -559,12 +568,12 @@ pinmux_set_func_8822b(struct halmac_adapter *adapter,
|
||||
if (status != HALMAC_RET_SUCCESS)
|
||||
return status;
|
||||
|
||||
status = pinmux_switch_88xx(adapter, list, list_size, gpio_id,
|
||||
gpio_func);
|
||||
status = pinmux_switch_8822b(adapter, list, list_size, gpio_id,
|
||||
gpio_func);
|
||||
if (status != HALMAC_RET_SUCCESS)
|
||||
return status;
|
||||
|
||||
status = pinmux_record_88xx(adapter, gpio_func, 1);
|
||||
status = pinmux_record_8822b(adapter, gpio_func, 1);
|
||||
if (status != HALMAC_RET_SUCCESS)
|
||||
return status;
|
||||
|
||||
@@ -646,6 +655,13 @@ pinmux_free_func_8822b(struct halmac_adapter *adapter,
|
||||
case HALMAC_GPIO_FUNC_SW_IO_15:
|
||||
info->sw_io_15 = 0;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_S0_PAPE:
|
||||
case HALMAC_GPIO_FUNC_S0_TRSW:
|
||||
case HALMAC_GPIO_FUNC_S0_TRSWB:
|
||||
case HALMAC_GPIO_FUNC_S1_PAPE:
|
||||
case HALMAC_GPIO_FUNC_S1_TRSW:
|
||||
case HALMAC_GPIO_FUNC_S1_TRSWB:
|
||||
return HALMAC_RET_PINMUX_NOT_SUPPORT;
|
||||
default:
|
||||
return HALMAC_RET_SWITCH_CASE_ERROR;
|
||||
}
|
||||
@@ -747,6 +763,13 @@ get_pinmux_list_8822b(struct halmac_adapter *adapter,
|
||||
*list_size = ARRAY_SIZE(PINMUX_LIST_GPIO15_8822B);
|
||||
*gpio_id = HALMAC_GPIO15;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_S0_PAPE:
|
||||
case HALMAC_GPIO_FUNC_S0_TRSW:
|
||||
case HALMAC_GPIO_FUNC_S0_TRSWB:
|
||||
case HALMAC_GPIO_FUNC_S1_PAPE:
|
||||
case HALMAC_GPIO_FUNC_S1_TRSW:
|
||||
case HALMAC_GPIO_FUNC_S1_TRSWB:
|
||||
return HALMAC_RET_PINMUX_NOT_SUPPORT;
|
||||
default:
|
||||
return HALMAC_RET_SWITCH_CASE_ERROR;
|
||||
}
|
||||
@@ -842,6 +865,13 @@ chk_pinmux_valid_8822b(struct halmac_adapter *adapter,
|
||||
if (info->sw_io_15 == 1)
|
||||
status = HALMAC_RET_PINMUX_USED;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_S0_PAPE:
|
||||
case HALMAC_GPIO_FUNC_S0_TRSW:
|
||||
case HALMAC_GPIO_FUNC_S0_TRSWB:
|
||||
case HALMAC_GPIO_FUNC_S1_PAPE:
|
||||
case HALMAC_GPIO_FUNC_S1_TRSW:
|
||||
case HALMAC_GPIO_FUNC_S1_TRSWB:
|
||||
return HALMAC_RET_PINMUX_NOT_SUPPORT;
|
||||
default:
|
||||
return HALMAC_RET_SWITCH_CASE_ERROR;
|
||||
}
|
||||
@@ -852,4 +882,171 @@ chk_pinmux_valid_8822b(struct halmac_adapter *adapter,
|
||||
return status;
|
||||
}
|
||||
|
||||
static enum halmac_ret_status
|
||||
pinmux_switch_8822b(struct halmac_adapter *adapter,
|
||||
const struct halmac_gpio_pimux_list *list, u32 size,
|
||||
u32 gpio_id, enum halmac_gpio_func gpio_func)
|
||||
{
|
||||
u32 i;
|
||||
u8 value8;
|
||||
u16 switch_func;
|
||||
const struct halmac_gpio_pimux_list *cur_list = list;
|
||||
enum halmac_gpio_cfg_state *state;
|
||||
struct halmac_api *api = (struct halmac_api *)adapter->halmac_api;
|
||||
|
||||
state = &adapter->halmac_state.gpio_cfg_state;
|
||||
|
||||
if (*state == HALMAC_GPIO_CFG_STATE_BUSY)
|
||||
return HALMAC_RET_BUSY_STATE;
|
||||
|
||||
switch (gpio_func) {
|
||||
case HALMAC_GPIO_FUNC_WL_LED:
|
||||
switch_func = HALMAC_WL_LED;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SDIO_INT:
|
||||
switch_func = HALMAC_SDIO_INT;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_BT_HOST_WAKE1:
|
||||
case HALMAC_GPIO_FUNC_BT_DEV_WAKE1:
|
||||
switch_func = HALMAC_GPIO13_14_WL_CTRL_EN;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_0:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_1:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_2:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_3:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_4:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_5:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_6:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_7:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_8:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_9:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_10:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_11:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_12:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_13:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_14:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_15:
|
||||
switch_func = HALMAC_SW_IO;
|
||||
break;
|
||||
default:
|
||||
return HALMAC_RET_SWITCH_CASE_ERROR;
|
||||
}
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
if (gpio_id != cur_list->id) {
|
||||
PLTFM_MSG_ERR("[ERR]offset:%X, value:%X, func:%X\n",
|
||||
cur_list->offset, cur_list->value,
|
||||
cur_list->func);
|
||||
PLTFM_MSG_ERR("[ERR]id1 : %X, id2 : %X\n",
|
||||
gpio_id, cur_list->id);
|
||||
return HALMAC_RET_GET_PINMUX_ERR;
|
||||
}
|
||||
|
||||
if (switch_func == cur_list->func)
|
||||
break;
|
||||
|
||||
cur_list++;
|
||||
}
|
||||
|
||||
if (i == size) {
|
||||
PLTFM_MSG_ERR("[ERR]gpio func error:%X %X\n",
|
||||
gpio_id, cur_list->id);
|
||||
return HALMAC_RET_GET_PINMUX_ERR;
|
||||
}
|
||||
|
||||
*state = HALMAC_GPIO_CFG_STATE_BUSY;
|
||||
|
||||
cur_list = list;
|
||||
for (i = 0; i < size; i++) {
|
||||
value8 = HALMAC_REG_R8(cur_list->offset);
|
||||
value8 &= ~(cur_list->msk);
|
||||
|
||||
if (switch_func == cur_list->func) {
|
||||
value8 |= (cur_list->value & cur_list->msk);
|
||||
HALMAC_REG_W8(cur_list->offset, value8);
|
||||
break;
|
||||
}
|
||||
|
||||
value8 |= (~cur_list->value & cur_list->msk);
|
||||
HALMAC_REG_W8(cur_list->offset, value8);
|
||||
|
||||
cur_list++;
|
||||
}
|
||||
|
||||
*state = HALMAC_GPIO_CFG_STATE_IDLE;
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
static enum halmac_ret_status
|
||||
pinmux_record_8822b(struct halmac_adapter *adapter,
|
||||
enum halmac_gpio_func gpio_func, u8 val)
|
||||
{
|
||||
switch (gpio_func) {
|
||||
case HALMAC_GPIO_FUNC_WL_LED:
|
||||
adapter->pinmux_info.wl_led = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SDIO_INT:
|
||||
adapter->pinmux_info.sdio_int = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_BT_HOST_WAKE1:
|
||||
adapter->pinmux_info.bt_host_wake = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_BT_DEV_WAKE1:
|
||||
adapter->pinmux_info.bt_dev_wake = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_0:
|
||||
adapter->pinmux_info.sw_io_0 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_1:
|
||||
adapter->pinmux_info.sw_io_1 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_2:
|
||||
adapter->pinmux_info.sw_io_2 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_3:
|
||||
adapter->pinmux_info.sw_io_3 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_4:
|
||||
adapter->pinmux_info.sw_io_4 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_5:
|
||||
adapter->pinmux_info.sw_io_5 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_6:
|
||||
adapter->pinmux_info.sw_io_6 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_7:
|
||||
adapter->pinmux_info.sw_io_7 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_8:
|
||||
adapter->pinmux_info.sw_io_8 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_9:
|
||||
adapter->pinmux_info.sw_io_9 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_10:
|
||||
adapter->pinmux_info.sw_io_10 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_11:
|
||||
adapter->pinmux_info.sw_io_11 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_12:
|
||||
adapter->pinmux_info.sw_io_12 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_13:
|
||||
adapter->pinmux_info.sw_io_13 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_14:
|
||||
adapter->pinmux_info.sw_io_14 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_15:
|
||||
adapter->pinmux_info.sw_io_15 = val;
|
||||
break;
|
||||
default:
|
||||
return HALMAC_RET_GET_PINMUX_ERR;
|
||||
}
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
#endif /* HALMAC_8822B_SUPPORT */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -359,6 +359,8 @@ mount_api_8822b(struct halmac_adapter *adapter)
|
||||
|
||||
if (adapter->intf == HALMAC_INTERFACE_SDIO) {
|
||||
#if HALMAC_SDIO_SUPPORT
|
||||
api->halmac_init_interface_cfg = init_sdio_cfg_8822b;
|
||||
api->halmac_init_sdio_cfg = init_sdio_cfg_8822b;
|
||||
api->halmac_mac_power_switch = mac_pwr_switch_sdio_8822b;
|
||||
api->halmac_phy_cfg = phy_cfg_sdio_8822b;
|
||||
api->halmac_pcie_switch = pcie_switch_sdio_8822b;
|
||||
@@ -417,6 +419,8 @@ init_trx_cfg_8822b(struct halmac_adapter *adapter, enum halmac_trx_mode mode)
|
||||
u8 value8;
|
||||
struct halmac_api *api = (struct halmac_api *)adapter->halmac_api;
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
u8 en_fwff;
|
||||
u16 value16;
|
||||
|
||||
adapter->trx_mode = mode;
|
||||
|
||||
@@ -428,10 +432,22 @@ init_trx_cfg_8822b(struct halmac_adapter *adapter, enum halmac_trx_mode mode)
|
||||
return status;
|
||||
}
|
||||
|
||||
en_fwff = HALMAC_REG_R8(REG_WMAC_FWPKT_CR) & BIT_FWEN;
|
||||
if (en_fwff) {
|
||||
HALMAC_REG_W8_CLR(REG_WMAC_FWPKT_CR, BIT_FWEN);
|
||||
if (fwff_is_empty_88xx(adapter) != HALMAC_RET_SUCCESS)
|
||||
PLTFM_MSG_ERR("[ERR]fwff is not empty\n");
|
||||
}
|
||||
value8 = 0;
|
||||
HALMAC_REG_W8(REG_CR, value8);
|
||||
value16 = HALMAC_REG_R16(REG_FWFF_PKT_INFO);
|
||||
HALMAC_REG_W16(REG_FWFF_CTRL, value16);
|
||||
|
||||
value8 = MAC_TRX_ENABLE;
|
||||
HALMAC_REG_W8(REG_CR, value8);
|
||||
if (en_fwff)
|
||||
HALMAC_REG_W8_SET(REG_WMAC_FWPKT_CR, BIT_FWEN);
|
||||
|
||||
HALMAC_REG_W32(REG_H2CQ_CSR, BIT(31));
|
||||
|
||||
status = priority_queue_cfg_8822b(adapter, mode);
|
||||
@@ -701,13 +717,15 @@ init_system_cfg_8822b(struct halmac_adapter *adapter)
|
||||
struct halmac_api *api = (struct halmac_api *)adapter->halmac_api;
|
||||
u32 tmp = 0;
|
||||
u32 value32;
|
||||
u8 value8;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
value32 = HALMAC_REG_R32(REG_CPU_DMEM_CON) | BIT_WL_PLATFORM_RST;
|
||||
HALMAC_REG_W32(REG_CPU_DMEM_CON, value32);
|
||||
|
||||
HALMAC_REG_W8(REG_SYS_FUNC_EN + 1, SYS_FUNC_EN);
|
||||
value8 = HALMAC_REG_R8(REG_SYS_FUNC_EN + 1) | SYS_FUNC_EN;
|
||||
HALMAC_REG_W8(REG_SYS_FUNC_EN + 1, value8);
|
||||
|
||||
/*disable boot-from-flash for driver's DL FW*/
|
||||
tmp = HALMAC_REG_R32(REG_MCUFW_CTRL);
|
||||
@@ -890,6 +908,10 @@ init_wmac_cfg_8822b(struct halmac_adapter *adapter)
|
||||
HALMAC_REG_W8(REG_TCR + 2, WLAN_TX_FUNC_CFG2);
|
||||
HALMAC_REG_W8(REG_TCR + 1, WLAN_TX_FUNC_CFG1);
|
||||
|
||||
HALMAC_REG_W8_SET(REG_WMAC_TRXPTCL_CTL + 4, BIT(1));
|
||||
|
||||
HALMAC_REG_W8_SET(REG_SND_PTCL_CTRL, BIT_R_DISABLE_CHECK_VHTSIGB_CRC);
|
||||
|
||||
HALMAC_REG_W32(REG_WMAC_OPTION_FUNCTION + 8, WLAN_MAC_OPT_FUNC2);
|
||||
|
||||
if (adapter->hw_cfg_info.trx_mode == HALMAC_TRNSFER_NORMAL)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -42,7 +42,7 @@ struct halmac_intf_phy_para usb2_phy_param_8822b[] = {
|
||||
{0xFFFF, 0x00,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_ALL,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
};
|
||||
|
||||
struct halmac_intf_phy_para usb3_phy_param_8822b[] = {
|
||||
@@ -50,11 +50,11 @@ struct halmac_intf_phy_para usb3_phy_param_8822b[] = {
|
||||
{0x0001, 0xA841,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_D,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0xFFFF, 0x0000,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_ALL,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
};
|
||||
|
||||
struct halmac_intf_phy_para pcie_gen1_phy_param_8822b[] = {
|
||||
@@ -62,47 +62,51 @@ struct halmac_intf_phy_para pcie_gen1_phy_param_8822b[] = {
|
||||
{0x0001, 0xA841,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x0002, 0x60C6,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x0008, 0x3596,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x0009, 0x321C,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x000A, 0x9623,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x001B, 0xE029,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_ALL,
|
||||
HALMAC_INTF_PHY_PLATFORM_ASUS},
|
||||
{0x0020, 0x94FF,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x0021, 0xFFCF,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x0026, 0xC006,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x0029, 0xFF0E,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x002A, 0x1840,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0xFFFF, 0x0000,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_ALL,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
};
|
||||
|
||||
struct halmac_intf_phy_para pcie_gen2_phy_param_8822b[] = {
|
||||
@@ -110,47 +114,47 @@ struct halmac_intf_phy_para pcie_gen2_phy_param_8822b[] = {
|
||||
{0x0001, 0xA841,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x0002, 0x60C6,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x0008, 0x3597,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x0009, 0x321C,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x000A, 0x9623,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x0020, 0x94FF,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x0021, 0xFFCF,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x0026, 0xC006,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x0029, 0xFF0E,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0x002A, 0x3040,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_C,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
{0xFFFF, 0x0000,
|
||||
HALMAC_IP_INTF_PHY,
|
||||
HALMAC_INTF_PHY_CUT_ALL,
|
||||
HALMAC_INTF_PHY_PLATFORM_ALL},
|
||||
HALMAC_INTF_PHY_PLATFORM_FOR_ALL},
|
||||
};
|
||||
|
||||
#endif /* HALMAC_8822B_SUPPORT */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -58,6 +58,16 @@ static struct halmac_wlan_pwr_cfg TRANS_CARDDIS_TO_CARDEMU_8822B[] = {
|
||||
|
||||
static struct halmac_wlan_pwr_cfg TRANS_CARDEMU_TO_ACT_8822B[] = {
|
||||
/* { offset, cut_msk, interface_msk, base|cmd, msk, value } */
|
||||
{0xFF0A,
|
||||
HALMAC_PWR_CUT_ALL_MSK,
|
||||
HALMAC_PWR_INTF_USB_MSK,
|
||||
HALMAC_PWR_ADDR_MAC,
|
||||
HALMAC_PWR_CMD_WRITE, 0xFF, 0},
|
||||
{0xFF0B,
|
||||
HALMAC_PWR_CUT_ALL_MSK,
|
||||
HALMAC_PWR_INTF_USB_MSK,
|
||||
HALMAC_PWR_ADDR_MAC,
|
||||
HALMAC_PWR_CMD_WRITE, 0xFF, 0},
|
||||
{0x0012,
|
||||
HALMAC_PWR_CUT_ALL_MSK,
|
||||
HALMAC_PWR_INTF_ALL_MSK,
|
||||
@@ -440,16 +450,6 @@ static struct halmac_wlan_pwr_cfg TRANS_CARDEMU_TO_SUS_8822B[] = {
|
||||
|
||||
static struct halmac_wlan_pwr_cfg TRANS_SUS_TO_CARDEMU_8822B[] = {
|
||||
/* { offset, cut_msk, interface_msk, base|cmd, msk, value } */
|
||||
{0xFF0A,
|
||||
HALMAC_PWR_CUT_ALL_MSK,
|
||||
HALMAC_PWR_INTF_USB_MSK,
|
||||
HALMAC_PWR_ADDR_MAC,
|
||||
HALMAC_PWR_CMD_WRITE, 0xFF, 0},
|
||||
{0xFF0B,
|
||||
HALMAC_PWR_CUT_ALL_MSK,
|
||||
HALMAC_PWR_INTF_USB_MSK,
|
||||
HALMAC_PWR_ADDR_MAC,
|
||||
HALMAC_PWR_CMD_WRITE, 0xFF, 0},
|
||||
{0x0005,
|
||||
HALMAC_PWR_CUT_ALL_MSK,
|
||||
HALMAC_PWR_INTF_ALL_MSK,
|
||||
@@ -690,32 +690,32 @@ static struct halmac_wlan_pwr_cfg TRANS_ACT_TO_DEEP_LPS_8822B[] = {
|
||||
HALMAC_PWR_CUT_ALL_MSK,
|
||||
HALMAC_PWR_INTF_PCI_MSK,
|
||||
HALMAC_PWR_ADDR_MAC,
|
||||
HALMAC_PWR_CMD_WRITE, 0xFF, 0xDE},
|
||||
HALMAC_PWR_CMD_WRITE, 0xFF, 0xDC},
|
||||
{0x0092,
|
||||
HALMAC_PWR_CUT_ALL_MSK,
|
||||
HALMAC_PWR_INTF_PCI_MSK,
|
||||
HALMAC_PWR_ADDR_MAC,
|
||||
HALMAC_PWR_CMD_WRITE, 0xFF, 0x60},
|
||||
HALMAC_PWR_CMD_WRITE, 0xFF, 0x20},
|
||||
{0x0093,
|
||||
HALMAC_PWR_CUT_ALL_MSK,
|
||||
HALMAC_PWR_INTF_USB_MSK,
|
||||
HALMAC_PWR_ADDR_MAC,
|
||||
HALMAC_PWR_CMD_WRITE, 0xFF, 0x9B},
|
||||
HALMAC_PWR_CMD_WRITE, 0xFF, 0x8},
|
||||
{0x0092,
|
||||
HALMAC_PWR_CUT_ALL_MSK,
|
||||
HALMAC_PWR_INTF_USB_MSK,
|
||||
HALMAC_PWR_ADDR_MAC,
|
||||
HALMAC_PWR_CMD_WRITE, 0xFF, 0x60},
|
||||
HALMAC_PWR_CMD_WRITE, 0xFF, 0x20},
|
||||
{0x0093,
|
||||
HALMAC_PWR_CUT_ALL_MSK,
|
||||
HALMAC_PWR_INTF_SDIO_MSK,
|
||||
HALMAC_PWR_ADDR_MAC,
|
||||
HALMAC_PWR_CMD_WRITE, 0xFF, 0xA},
|
||||
HALMAC_PWR_CMD_WRITE, 0xFF, 0x8},
|
||||
{0x0092,
|
||||
HALMAC_PWR_CUT_ALL_MSK,
|
||||
HALMAC_PWR_INTF_SDIO_MSK,
|
||||
HALMAC_PWR_ADDR_MAC,
|
||||
HALMAC_PWR_CMD_WRITE, 0xFF, 0x60},
|
||||
HALMAC_PWR_CMD_WRITE, 0xFF, 0x20},
|
||||
{0x0090,
|
||||
HALMAC_PWR_CUT_ALL_MSK,
|
||||
HALMAC_PWR_INTF_ALL_MSK,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#if HALMAC_8822B_SUPPORT
|
||||
|
||||
#define HALMAC_8822B_PWR_SEQ_VER "V30"
|
||||
#define HALMAC_8822B_PWR_SEQ_VER "V31"
|
||||
|
||||
extern struct halmac_wlan_pwr_cfg *card_en_flow_8822b[];
|
||||
extern struct halmac_wlan_pwr_cfg *card_dis_flow_8822b[];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -38,7 +38,7 @@ mac_pwr_switch_usb_8822b(struct halmac_adapter *adapter,
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s\n", __func__);
|
||||
PLTFM_MSG_TRACE("[TRACE]%x\n", pwr);
|
||||
PLTFM_MSG_TRACE("[TRACE]8821C pwr seq ver = %s\n",
|
||||
PLTFM_MSG_TRACE("[TRACE]8822B pwr seq ver = %s\n",
|
||||
HALMAC_8822B_PWR_SEQ_VER);
|
||||
|
||||
adapter->rpwm = HALMAC_REG_R8(0xFE58);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -588,10 +588,10 @@ cfg_bw_88xx(struct halmac_adapter *adapter, enum halmac_bw bw)
|
||||
|
||||
switch (bw) {
|
||||
case HALMAC_BW_80:
|
||||
value32 |= BIT(8);
|
||||
value32 = value32 | BIT(8);
|
||||
break;
|
||||
case HALMAC_BW_40:
|
||||
value32 |= BIT(7);
|
||||
value32 = value32 | BIT(7);
|
||||
break;
|
||||
case HALMAC_BW_20:
|
||||
case HALMAC_BW_10:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -90,6 +90,9 @@ get_c2h_dbg_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size);
|
||||
static enum halmac_ret_status
|
||||
get_h2c_ack_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size);
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_scan_ch_notify_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size);
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_scan_rpt_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size);
|
||||
|
||||
@@ -99,6 +102,14 @@ get_h2c_ack_cfg_param_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size);
|
||||
static enum halmac_ret_status
|
||||
get_h2c_ack_update_pkt_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size);
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_h2c_ack_send_scan_pkt_88xx(struct halmac_adapter *adapter, u8 *buf,
|
||||
u32 size);
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_h2c_ack_drop_scan_pkt_88xx(struct halmac_adapter *adapter, u8 *buf,
|
||||
u32 size);
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_h2c_ack_update_datapkt_88xx(struct halmac_adapter *adapter, u8 *buf,
|
||||
u32 size);
|
||||
@@ -138,6 +149,14 @@ static enum halmac_ret_status
|
||||
send_h2c_update_packet_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_packet_id pkt_id, u8 *pkt, u32 size);
|
||||
|
||||
static enum halmac_ret_status
|
||||
send_h2c_send_scan_packet_88xx(struct halmac_adapter *adapter,
|
||||
u8 index, u8 *pkt, u32 size);
|
||||
|
||||
static enum halmac_ret_status
|
||||
send_h2c_drop_scan_packet_88xx(struct halmac_adapter *adapter,
|
||||
struct halmac_drop_pkt_option *option);
|
||||
|
||||
static enum halmac_ret_status
|
||||
send_bt_coex_cmd_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size,
|
||||
u8 ack);
|
||||
@@ -172,6 +191,14 @@ static enum halmac_ret_status
|
||||
get_update_packet_status_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_cmd_process_status *proc_status);
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_send_scan_packet_status_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_cmd_process_status *proc_status);
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_drop_scan_packet_status_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_cmd_process_status *proc_status);
|
||||
|
||||
static enum halmac_ret_status
|
||||
pwr_sub_seq_parser_88xx(struct halmac_adapter *adapter, u8 cut, u8 intf,
|
||||
struct halmac_wlan_pwr_cfg *cmd);
|
||||
@@ -216,6 +243,9 @@ static enum halmac_packet_id
|
||||
get_real_pkt_id_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_packet_id pkt_id);
|
||||
|
||||
static u32
|
||||
get_update_packet_page_size(struct halmac_adapter *adapter, u32 size);
|
||||
|
||||
/**
|
||||
* ofld_func_cfg_88xx() - config offload function
|
||||
* @adapter : the adapter of halmac
|
||||
@@ -535,6 +565,40 @@ set_hw_value_88xx(struct halmac_adapter *adapter, enum halmac_hw_id hw_id,
|
||||
case HALMAC_HW_TXFIFO_LIFETIME:
|
||||
cfg_txfifo_lt_88xx(adapter,
|
||||
(struct halmac_txfifo_lifetime_cfg *)value);
|
||||
break;
|
||||
default:
|
||||
return HALMAC_RET_PARA_NOT_SUPPORT;
|
||||
}
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* get_watcher_88xx() -get watcher value
|
||||
* @adapter : the adapter of halmac
|
||||
* @sel : id for driver to config
|
||||
* @value : value, reference table to get data type
|
||||
* Author :
|
||||
* Return : enum halmac_ret_status
|
||||
* More details of status code can be found in prototype document
|
||||
*/
|
||||
enum halmac_ret_status
|
||||
get_watcher_88xx(struct halmac_adapter *adapter, enum halmac_watcher_sel sel,
|
||||
void *value)
|
||||
{
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
if (!value) {
|
||||
PLTFM_MSG_ERR("[ERR]null ptr-set hw value\n");
|
||||
return HALMAC_RET_NULL_POINTER;
|
||||
}
|
||||
|
||||
switch (sel) {
|
||||
case HALMAC_WATCHER_SDIO_RN_FOOL_PROOFING:
|
||||
*(u32 *)value = adapter->watcher.get_watcher.sdio_rn_not_align;
|
||||
break;
|
||||
default:
|
||||
return HALMAC_RET_PARA_NOT_SUPPORT;
|
||||
}
|
||||
@@ -694,6 +758,9 @@ parse_c2h_pkt_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
case C2H_SUB_CMD_ID_EFUSE_DATA:
|
||||
status = get_efuse_data_88xx(adapter, c2h_pkt, c2h_size);
|
||||
break;
|
||||
case C2H_SUB_CMD_ID_SCAN_CH_NOTIFY:
|
||||
status = get_scan_ch_notify_88xx(adapter, c2h_pkt, c2h_size);
|
||||
break;
|
||||
default:
|
||||
PLTFM_MSG_WARN("[WARN]Sub cmd id!!\n");
|
||||
status = HALMAC_RET_C2H_NOT_HANDLED;
|
||||
@@ -800,6 +867,12 @@ get_h2c_ack_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
case H2C_SUB_CMD_ID_UPDATE_PKT_ACK:
|
||||
status = get_h2c_ack_update_pkt_88xx(adapter, buf, size);
|
||||
break;
|
||||
case H2C_SUB_CMD_ID_SEND_SCAN_PKT_ACK:
|
||||
status = get_h2c_ack_send_scan_pkt_88xx(adapter, buf, size);
|
||||
break;
|
||||
case H2C_SUB_CMD_ID_DROP_SCAN_PKT_ACK:
|
||||
status = get_h2c_ack_drop_scan_pkt_88xx(adapter, buf, size);
|
||||
break;
|
||||
case H2C_SUB_CMD_ID_UPDATE_DATAPACK_ACK:
|
||||
status = get_h2c_ack_update_datapkt_88xx(adapter, buf, size);
|
||||
break;
|
||||
@@ -828,11 +901,56 @@ get_h2c_ack_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
return status;
|
||||
}
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_scan_ch_notify_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
{
|
||||
struct halmac_scan_rpt_info *scan_rpt_info = &adapter->scan_rpt_info;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]scan mode:%d\n", adapter->ch_sw_info.scan_mode);
|
||||
|
||||
if (adapter->ch_sw_info.scan_mode == 1) {
|
||||
if (scan_rpt_info->avl_buf_size < 12) {
|
||||
PLTFM_MSG_ERR("[ERR]ch_notify buffer full!!\n");
|
||||
return HALMAC_RET_CH_SW_NO_BUF;
|
||||
}
|
||||
|
||||
SCAN_CH_NOTIFY_SET_CH_NUM(scan_rpt_info->buf_wptr,
|
||||
(u8)SCAN_CH_NOTIFY_GET_CH_NUM(buf));
|
||||
SCAN_CH_NOTIFY_SET_NOTIFY_ID(scan_rpt_info->buf_wptr,
|
||||
SCAN_CH_NOTIFY_GET_NOTIFY_ID(buf));
|
||||
SCAN_CH_NOTIFY_SET_STATUS(scan_rpt_info->buf_wptr,
|
||||
(u8)SCAN_CH_NOTIFY_GET_STATUS(buf));
|
||||
SCAN_CH_NOTIFY_SET_TSF_0(scan_rpt_info->buf_wptr,
|
||||
(u8)SCAN_CH_NOTIFY_GET_TSF_0(buf));
|
||||
SCAN_CH_NOTIFY_SET_TSF_1(scan_rpt_info->buf_wptr,
|
||||
(u8)SCAN_CH_NOTIFY_GET_TSF_1(buf));
|
||||
SCAN_CH_NOTIFY_SET_TSF_2(scan_rpt_info->buf_wptr,
|
||||
(u8)SCAN_CH_NOTIFY_GET_TSF_2(buf));
|
||||
SCAN_CH_NOTIFY_SET_TSF_3(scan_rpt_info->buf_wptr,
|
||||
(u8)SCAN_CH_NOTIFY_GET_TSF_3(buf));
|
||||
SCAN_CH_NOTIFY_SET_TSF_4(scan_rpt_info->buf_wptr,
|
||||
(u8)SCAN_CH_NOTIFY_GET_TSF_4(buf));
|
||||
SCAN_CH_NOTIFY_SET_TSF_5(scan_rpt_info->buf_wptr,
|
||||
(u8)SCAN_CH_NOTIFY_GET_TSF_5(buf));
|
||||
SCAN_CH_NOTIFY_SET_TSF_6(scan_rpt_info->buf_wptr,
|
||||
(u8)SCAN_CH_NOTIFY_GET_TSF_6(buf));
|
||||
SCAN_CH_NOTIFY_SET_TSF_7(scan_rpt_info->buf_wptr,
|
||||
(u8)SCAN_CH_NOTIFY_GET_TSF_7(buf));
|
||||
|
||||
scan_rpt_info->avl_buf_size = scan_rpt_info->avl_buf_size - 12;
|
||||
scan_rpt_info->total_size = scan_rpt_info->total_size + 12;
|
||||
scan_rpt_info->buf_wptr = scan_rpt_info->buf_wptr + 12;
|
||||
}
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_scan_rpt_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
{
|
||||
u8 fw_rc;
|
||||
enum halmac_cmd_process_status proc_status;
|
||||
struct halmac_scan_rpt_info *scan_rpt_info = &adapter->scan_rpt_info;
|
||||
|
||||
fw_rc = (u8)SCAN_STATUS_RPT_GET_H2C_RETURN_CODE(buf);
|
||||
proc_status = (HALMAC_H2C_RETURN_SUCCESS ==
|
||||
@@ -843,6 +961,19 @@ get_scan_rpt_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
|
||||
adapter->halmac_state.scan_state.proc_status = proc_status;
|
||||
|
||||
if (adapter->ch_sw_info.scan_mode == 1) {
|
||||
scan_rpt_info->rpt_tsf_low =
|
||||
((SCAN_STATUS_RPT_GET_TSF_3(buf) << 24) |
|
||||
(SCAN_STATUS_RPT_GET_TSF_2(buf) << 16) |
|
||||
(SCAN_STATUS_RPT_GET_TSF_1(buf) << 8) |
|
||||
(SCAN_STATUS_RPT_GET_TSF_0(buf)));
|
||||
scan_rpt_info->rpt_tsf_high =
|
||||
((SCAN_STATUS_RPT_GET_TSF_7(buf) << 24) |
|
||||
(SCAN_STATUS_RPT_GET_TSF_6(buf) << 16) |
|
||||
(SCAN_STATUS_RPT_GET_TSF_5(buf) << 8) |
|
||||
(SCAN_STATUS_RPT_GET_TSF_4(buf)));
|
||||
}
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]scan : %X\n", proc_status);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
@@ -946,24 +1077,13 @@ get_h2c_ack_update_pkt_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
}
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_h2c_ack_update_datapkt_88xx(struct halmac_adapter *adapter, u8 *buf,
|
||||
u32 size)
|
||||
{
|
||||
return HALMAC_RET_NOT_SUPPORT;
|
||||
}
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_h2c_ack_run_datapkt_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
{
|
||||
return HALMAC_RET_NOT_SUPPORT;
|
||||
}
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_h2c_ack_ch_switch_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
get_h2c_ack_send_scan_pkt_88xx(struct halmac_adapter *adapter,
|
||||
u8 *buf, u32 size)
|
||||
{
|
||||
u8 seq_num;
|
||||
u8 fw_rc;
|
||||
struct halmac_scan_state *state = &adapter->halmac_state.scan_state;
|
||||
struct halmac_scan_pkt_state *state =
|
||||
&adapter->halmac_state.scan_pkt_state;
|
||||
enum halmac_cmd_process_status proc_status;
|
||||
|
||||
seq_num = (u8)H2C_ACK_HDR_GET_H2C_SEQ(buf);
|
||||
@@ -983,6 +1103,115 @@ get_h2c_ack_ch_switch_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
fw_rc = (u8)H2C_ACK_HDR_GET_H2C_RETURN_CODE(buf);
|
||||
state->fw_rc = fw_rc;
|
||||
|
||||
if (HALMAC_H2C_RETURN_SUCCESS == (enum halmac_h2c_return_code)fw_rc) {
|
||||
proc_status = HALMAC_CMD_PROCESS_DONE;
|
||||
state->proc_status = proc_status;
|
||||
PLTFM_EVENT_SIG(HALMAC_FEATURE_SEND_SCAN_PACKET, proc_status,
|
||||
NULL, 0);
|
||||
} else {
|
||||
proc_status = HALMAC_CMD_PROCESS_ERROR;
|
||||
state->proc_status = proc_status;
|
||||
PLTFM_EVENT_SIG(HALMAC_FEATURE_SEND_SCAN_PACKET, proc_status,
|
||||
&state->fw_rc, 1);
|
||||
}
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_h2c_ack_drop_scan_pkt_88xx(struct halmac_adapter *adapter,
|
||||
u8 *buf, u32 size)
|
||||
{
|
||||
u8 seq_num;
|
||||
u8 fw_rc;
|
||||
struct halmac_drop_pkt_state *state =
|
||||
&adapter->halmac_state.drop_pkt_state;
|
||||
enum halmac_cmd_process_status proc_status;
|
||||
|
||||
seq_num = (u8)H2C_ACK_HDR_GET_H2C_SEQ(buf);
|
||||
PLTFM_MSG_TRACE("[TRACE]Seq num : h2c->%d c2h->%d\n",
|
||||
state->seq_num, seq_num);
|
||||
if (seq_num != state->seq_num) {
|
||||
PLTFM_MSG_ERR("[ERR]Seq num mismatch : h2c->%d c2h->%d\n",
|
||||
state->seq_num, seq_num);
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
if (state->proc_status != HALMAC_CMD_PROCESS_SENDING) {
|
||||
PLTFM_MSG_ERR("[ERR]not cmd sending\n");
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
fw_rc = (u8)H2C_ACK_HDR_GET_H2C_RETURN_CODE(buf);
|
||||
state->fw_rc = fw_rc;
|
||||
|
||||
if (HALMAC_H2C_RETURN_SUCCESS == (enum halmac_h2c_return_code)fw_rc) {
|
||||
proc_status = HALMAC_CMD_PROCESS_DONE;
|
||||
state->proc_status = proc_status;
|
||||
PLTFM_EVENT_SIG(HALMAC_FEATURE_DROP_SCAN_PACKET, proc_status,
|
||||
NULL, 0);
|
||||
} else {
|
||||
proc_status = HALMAC_CMD_PROCESS_ERROR;
|
||||
state->proc_status = proc_status;
|
||||
PLTFM_EVENT_SIG(HALMAC_FEATURE_DROP_SCAN_PACKET, proc_status,
|
||||
&state->fw_rc, 1);
|
||||
}
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_h2c_ack_update_datapkt_88xx(struct halmac_adapter *adapter, u8 *buf,
|
||||
u32 size)
|
||||
{
|
||||
return HALMAC_RET_NOT_SUPPORT;
|
||||
}
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_h2c_ack_run_datapkt_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
{
|
||||
return HALMAC_RET_NOT_SUPPORT;
|
||||
}
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_h2c_ack_ch_switch_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
{
|
||||
u8 seq_num;
|
||||
u8 fw_rc;
|
||||
struct halmac_scan_state *state = &adapter->halmac_state.scan_state;
|
||||
struct halmac_scan_rpt_info *scan_rpt_info = &adapter->scan_rpt_info;
|
||||
enum halmac_cmd_process_status proc_status;
|
||||
|
||||
seq_num = (u8)H2C_ACK_HDR_GET_H2C_SEQ(buf);
|
||||
PLTFM_MSG_TRACE("[TRACE]Seq num : h2c->%d c2h->%d\n",
|
||||
state->seq_num, seq_num);
|
||||
if (seq_num != state->seq_num) {
|
||||
PLTFM_MSG_ERR("[ERR]Seq num mismatch : h2c->%d c2h->%d\n",
|
||||
state->seq_num, seq_num);
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
if (state->proc_status != HALMAC_CMD_PROCESS_SENDING) {
|
||||
PLTFM_MSG_ERR("[ERR]not cmd sending\n");
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
fw_rc = (u8)H2C_ACK_HDR_GET_H2C_RETURN_CODE(buf);
|
||||
state->fw_rc = fw_rc;
|
||||
|
||||
if (adapter->ch_sw_info.scan_mode == 1) {
|
||||
scan_rpt_info->ack_tsf_low =
|
||||
((CH_SWITCH_ACK_GET_TSF_3(buf) << 24) |
|
||||
(CH_SWITCH_ACK_GET_TSF_2(buf) << 16) |
|
||||
(CH_SWITCH_ACK_GET_TSF_1(buf) << 8) |
|
||||
(CH_SWITCH_ACK_GET_TSF_0(buf)));
|
||||
scan_rpt_info->ack_tsf_high =
|
||||
((CH_SWITCH_ACK_GET_TSF_7(buf) << 24) |
|
||||
(CH_SWITCH_ACK_GET_TSF_6(buf) << 16) |
|
||||
(CH_SWITCH_ACK_GET_TSF_5(buf) << 8) |
|
||||
(CH_SWITCH_ACK_GET_TSF_4(buf)));
|
||||
}
|
||||
|
||||
if ((enum halmac_h2c_return_code)fw_rc == HALMAC_H2C_RETURN_SUCCESS) {
|
||||
proc_status = HALMAC_CMD_PROCESS_RCVD;
|
||||
state->proc_status = proc_status;
|
||||
@@ -1442,6 +1671,7 @@ update_packet_88xx(struct halmac_adapter *adapter, enum halmac_packet_id pkt_id,
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
enum halmac_cmd_process_status *proc_status =
|
||||
&adapter->halmac_state.update_pkt_state.proc_status;
|
||||
u8 *used_page = &adapter->halmac_state.update_pkt_state.used_page;
|
||||
|
||||
if (halmac_fw_validate(adapter) != HALMAC_RET_SUCCESS)
|
||||
return HALMAC_RET_NO_DLFW;
|
||||
@@ -1468,6 +1698,8 @@ update_packet_88xx(struct halmac_adapter *adapter, enum halmac_packet_id pkt_id,
|
||||
return status;
|
||||
}
|
||||
|
||||
*used_page = (u8)get_update_packet_page_size(adapter, size);
|
||||
|
||||
if (packet_in_nlo_88xx(adapter, pkt_id)) {
|
||||
*proc_status = HALMAC_CMD_PROCESS_DONE;
|
||||
adapter->nlo_flag = 1;
|
||||
@@ -1503,7 +1735,7 @@ send_h2c_update_packet_88xx(struct halmac_adapter *adapter,
|
||||
UPDATE_PKT_SET_LOC(h2c_buf, pg_offset);
|
||||
|
||||
hdr_info.sub_cmd_id = SUB_CMD_ID_UPDATE_PKT;
|
||||
hdr_info.content_size = 8;
|
||||
hdr_info.content_size = 4;
|
||||
if (packet_in_nlo_88xx(adapter, pkt_id))
|
||||
hdr_info.ack = 0;
|
||||
else
|
||||
@@ -1522,6 +1754,147 @@ send_h2c_update_packet_88xx(struct halmac_adapter *adapter,
|
||||
return status;
|
||||
}
|
||||
|
||||
enum halmac_ret_status
|
||||
send_scan_packet_88xx(struct halmac_adapter *adapter, u8 index,
|
||||
u8 *pkt, u32 size)
|
||||
{
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
enum halmac_cmd_process_status *proc_status =
|
||||
&adapter->halmac_state.scan_pkt_state.proc_status;
|
||||
|
||||
if (halmac_fw_validate(adapter) != HALMAC_RET_SUCCESS)
|
||||
return HALMAC_RET_NO_DLFW;
|
||||
|
||||
if (adapter->fw_ver.h2c_version < 13)
|
||||
return HALMAC_RET_FW_NO_SUPPORT;
|
||||
|
||||
if (size > UPDATE_PKT_RSVDPG_SIZE)
|
||||
return HALMAC_RET_RSVD_PG_OVERFLOW_FAIL;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
if (*proc_status == HALMAC_CMD_PROCESS_SENDING) {
|
||||
PLTFM_MSG_TRACE("[TRACE]Wait event(send_scan)\n");
|
||||
return HALMAC_RET_BUSY_STATE;
|
||||
}
|
||||
|
||||
*proc_status = HALMAC_CMD_PROCESS_SENDING;
|
||||
|
||||
status = send_h2c_send_scan_packet_88xx(adapter, index, pkt, size);
|
||||
if (status != HALMAC_RET_SUCCESS)
|
||||
return status;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
static enum halmac_ret_status
|
||||
send_h2c_send_scan_packet_88xx(struct halmac_adapter *adapter,
|
||||
u8 index, u8 *pkt, u32 size)
|
||||
{
|
||||
u8 h2c_buf[H2C_PKT_SIZE_88XX] = { 0 };
|
||||
u16 seq_num = 0;
|
||||
u16 pg_addr = adapter->txff_alloc.rsvd_h2c_info_addr;
|
||||
u16 pg_offset;
|
||||
struct halmac_h2c_header_info hdr_info;
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
|
||||
status = dl_rsvd_page_88xx(adapter, pg_addr, pkt, size);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_ERR("[ERR]dl rsvd pg!!\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
pg_offset = pg_addr - adapter->txff_alloc.rsvd_boundary;
|
||||
SEND_SCAN_PKT_SET_SIZE(h2c_buf, size +
|
||||
adapter->hw_cfg_info.txdesc_size);
|
||||
SEND_SCAN_PKT_SET_INDEX(h2c_buf, index);
|
||||
SEND_SCAN_PKT_SET_LOC(h2c_buf, pg_offset);
|
||||
|
||||
hdr_info.sub_cmd_id = SUB_CMD_ID_SEND_SCAN_PKT;
|
||||
hdr_info.content_size = 8;
|
||||
hdr_info.ack = 1;
|
||||
set_h2c_pkt_hdr_88xx(adapter, h2c_buf, &hdr_info, &seq_num);
|
||||
adapter->halmac_state.scan_pkt_state.seq_num = seq_num;
|
||||
|
||||
status = send_h2c_pkt_88xx(adapter, h2c_buf);
|
||||
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_ERR("[ERR]send h2c!!\n");
|
||||
reset_ofld_feature_88xx(adapter,
|
||||
HALMAC_FEATURE_SEND_SCAN_PACKET);
|
||||
return status;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
enum halmac_ret_status
|
||||
drop_scan_packet_88xx(struct halmac_adapter *adapter,
|
||||
struct halmac_drop_pkt_option *option)
|
||||
{
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
enum halmac_cmd_process_status *proc_status =
|
||||
&adapter->halmac_state.drop_pkt_state.proc_status;
|
||||
|
||||
if (halmac_fw_validate(adapter) != HALMAC_RET_SUCCESS)
|
||||
return HALMAC_RET_NO_DLFW;
|
||||
|
||||
if (adapter->fw_ver.h2c_version < 13)
|
||||
return HALMAC_RET_FW_NO_SUPPORT;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
if (*proc_status == HALMAC_CMD_PROCESS_SENDING) {
|
||||
PLTFM_MSG_TRACE("[TRACE]Wait event(drop_scan)\n");
|
||||
return HALMAC_RET_BUSY_STATE;
|
||||
}
|
||||
|
||||
*proc_status = HALMAC_CMD_PROCESS_SENDING;
|
||||
|
||||
status = send_h2c_drop_scan_packet_88xx(adapter, option);
|
||||
if (status != HALMAC_RET_SUCCESS)
|
||||
return status;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
static enum halmac_ret_status
|
||||
send_h2c_drop_scan_packet_88xx(struct halmac_adapter *adapter,
|
||||
struct halmac_drop_pkt_option *option)
|
||||
{
|
||||
u8 h2c_buf[H2C_PKT_SIZE_88XX] = { 0 };
|
||||
u16 seq_num = 0;
|
||||
struct halmac_h2c_header_info hdr_info;
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s\n", __func__);
|
||||
|
||||
DROP_SCAN_PKT_SET_DROP_ALL(h2c_buf, option->drop_all);
|
||||
DROP_SCAN_PKT_SET_DROP_SINGLE(h2c_buf, option->drop_single);
|
||||
DROP_SCAN_PKT_SET_DROP_IDX(h2c_buf, option->drop_index);
|
||||
|
||||
hdr_info.sub_cmd_id = SUB_CMD_ID_DROP_SCAN_PKT;
|
||||
hdr_info.content_size = 8;
|
||||
hdr_info.ack = 1;
|
||||
set_h2c_pkt_hdr_88xx(adapter, h2c_buf, &hdr_info, &seq_num);
|
||||
adapter->halmac_state.drop_pkt_state.seq_num = seq_num;
|
||||
|
||||
status = send_h2c_pkt_88xx(adapter, h2c_buf);
|
||||
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_ERR("[ERR]send h2c!!\n");
|
||||
reset_ofld_feature_88xx(adapter,
|
||||
HALMAC_FEATURE_DROP_SCAN_PACKET);
|
||||
return status;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
enum halmac_ret_status
|
||||
bcn_ie_filter_88xx(struct halmac_adapter *adapter,
|
||||
struct halmac_bcn_ie_info *info)
|
||||
@@ -1954,6 +2327,12 @@ ctrl_ch_switch_88xx(struct halmac_adapter *adapter,
|
||||
if (adapter->fw_ver.h2c_version < 4)
|
||||
return HALMAC_RET_FW_NO_SUPPORT;
|
||||
|
||||
if (adapter->ch_sw_info.total_size +
|
||||
(adapter->halmac_state.update_pkt_state.used_page <<
|
||||
TX_PAGE_SIZE_SHIFT_88XX) >
|
||||
(u32)adapter->txff_alloc.rsvd_pg_num << TX_PAGE_SIZE_SHIFT_88XX)
|
||||
return HALMAC_RET_RSVD_PG_OVERFLOW_FAIL;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
if (opt->switch_en == 0)
|
||||
@@ -1997,6 +2376,7 @@ proc_ctrl_ch_switch_88xx(struct halmac_adapter *adapter,
|
||||
u16 seq_num = 0;
|
||||
u16 pg_addr = adapter->txff_alloc.rsvd_h2c_info_addr;
|
||||
struct halmac_h2c_header_info hdr_info;
|
||||
struct halmac_scan_rpt_info *scan_rpt_info = &adapter->scan_rpt_info;
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
enum halmac_cmd_process_status *proc_status;
|
||||
|
||||
@@ -2004,7 +2384,8 @@ proc_ctrl_ch_switch_88xx(struct halmac_adapter *adapter,
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
if (opt->nlo_en == 1 && adapter->nlo_flag != 1)
|
||||
if (adapter->halmac_state.update_pkt_state.used_page > 0 &&
|
||||
opt->nlo_en == 1 && adapter->nlo_flag != 1)
|
||||
PLTFM_MSG_WARN("[WARN]probe req is NOT nlo pkt!!\n");
|
||||
|
||||
if (cnv_scan_state_88xx(adapter, HALMAC_CMD_CNSTR_H2C_SENT) !=
|
||||
@@ -2014,6 +2395,7 @@ proc_ctrl_ch_switch_88xx(struct halmac_adapter *adapter,
|
||||
*proc_status = HALMAC_CMD_PROCESS_SENDING;
|
||||
|
||||
if (opt->switch_en != 0) {
|
||||
pg_addr += adapter->halmac_state.update_pkt_state.used_page;
|
||||
status = dl_rsvd_page_88xx(adapter, pg_addr,
|
||||
adapter->ch_sw_info.buf,
|
||||
adapter->ch_sw_info.total_size);
|
||||
@@ -2021,6 +2403,7 @@ proc_ctrl_ch_switch_88xx(struct halmac_adapter *adapter,
|
||||
PLTFM_MSG_ERR("[ERR]dl rsvd pg!!\n");
|
||||
return status;
|
||||
}
|
||||
adapter->halmac_state.update_pkt_state.used_page = 0;
|
||||
}
|
||||
|
||||
CH_SWITCH_SET_START(h2c_buf, opt->switch_en);
|
||||
@@ -2038,6 +2421,7 @@ proc_ctrl_ch_switch_88xx(struct halmac_adapter *adapter,
|
||||
CH_SWITCH_SET_SLOW_PERIOD(h2c_buf, opt->phase_2_period);
|
||||
CH_SWITCH_SET_NORMAL_PERIOD_SEL(h2c_buf, opt->normal_period_sel);
|
||||
CH_SWITCH_SET_SLOW_PERIOD_SEL(h2c_buf, opt->phase_2_period_sel);
|
||||
CH_SWITCH_SET_SCAN_MODE(h2c_buf, opt->scan_mode_en);
|
||||
CH_SWITCH_SET_INFO_SIZE(h2c_buf, adapter->ch_sw_info.total_size);
|
||||
|
||||
hdr_info.sub_cmd_id = SUB_CMD_ID_CH_SWITCH;
|
||||
@@ -2046,6 +2430,36 @@ proc_ctrl_ch_switch_88xx(struct halmac_adapter *adapter,
|
||||
hdr_info.ack = 0;
|
||||
else
|
||||
hdr_info.ack = 1;
|
||||
|
||||
if (opt->scan_mode_en == 1) {
|
||||
adapter->ch_sw_info.scan_mode = 1;
|
||||
if (!scan_rpt_info->buf) {
|
||||
scan_rpt_info->buf =
|
||||
(u8 *)PLTFM_MALLOC(SCAN_INFO_RSVDPG_SIZE);
|
||||
if (!scan_rpt_info->buf)
|
||||
return HALMAC_RET_NULL_POINTER;
|
||||
} else {
|
||||
PLTFM_MEMSET(scan_rpt_info->buf, 0,
|
||||
SCAN_INFO_RSVDPG_SIZE);
|
||||
}
|
||||
scan_rpt_info->buf_wptr = scan_rpt_info->buf;
|
||||
scan_rpt_info->buf_size = SCAN_INFO_RSVDPG_SIZE;
|
||||
scan_rpt_info->avl_buf_size = SCAN_INFO_RSVDPG_SIZE;
|
||||
scan_rpt_info->total_size = 0;
|
||||
scan_rpt_info->ack_tsf_high = 0;
|
||||
scan_rpt_info->ack_tsf_low = 0;
|
||||
scan_rpt_info->rpt_tsf_high = 0;
|
||||
scan_rpt_info->rpt_tsf_low = 0;
|
||||
} else {
|
||||
adapter->ch_sw_info.scan_mode = 0;
|
||||
if (!scan_rpt_info->buf)
|
||||
PLTFM_FREE(scan_rpt_info->buf, scan_rpt_info->buf_size);
|
||||
scan_rpt_info->buf_wptr = NULL;
|
||||
scan_rpt_info->buf_size = 0;
|
||||
scan_rpt_info->avl_buf_size = 0;
|
||||
scan_rpt_info->total_size = 0;
|
||||
}
|
||||
|
||||
set_h2c_pkt_hdr_88xx(adapter, h2c_buf, &hdr_info, &seq_num);
|
||||
adapter->halmac_state.scan_state.seq_num = seq_num;
|
||||
|
||||
@@ -2121,6 +2535,7 @@ enum halmac_ret_status
|
||||
chk_txdesc_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
{
|
||||
u32 mac_clk = 0;
|
||||
u8 value8;
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
struct halmac_api *api = (struct halmac_api *)adapter->halmac_api;
|
||||
|
||||
@@ -2146,6 +2561,14 @@ chk_txdesc_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
status = HALMAC_RET_TXDESC_SET_FAIL;
|
||||
}
|
||||
|
||||
if (GET_TX_DESC_USE_MAX_TIME_EN(buf) == 1) {
|
||||
value8 = (u8)GET_TX_DESC_AMPDU_MAX_TIME(buf);
|
||||
if (value8 > HALMAC_REG_R8(REG_AMPDU_MAX_TIME_V1)) {
|
||||
PLTFM_MSG_ERR("[ERR]txdesc - ampdu_max_time\n");
|
||||
status = HALMAC_RET_TXDESC_SET_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
switch (BIT_GET_MAC_CLK_SEL(HALMAC_REG_R32(REG_AFE_CTRL1))) {
|
||||
case 0x0:
|
||||
mac_clk = 80;
|
||||
@@ -2401,12 +2824,23 @@ query_status_88xx(struct halmac_adapter *adapter,
|
||||
status = get_dump_log_efuse_status_88xx(adapter, proc_status,
|
||||
data, size);
|
||||
break;
|
||||
case HALMAC_FEATURE_DUMP_LOGICAL_EFUSE_MASK:
|
||||
status = get_dump_log_efuse_mask_status_88xx(adapter,
|
||||
proc_status,
|
||||
data, size);
|
||||
break;
|
||||
case HALMAC_FEATURE_CHANNEL_SWITCH:
|
||||
status = get_ch_switch_status_88xx(adapter, proc_status);
|
||||
break;
|
||||
case HALMAC_FEATURE_UPDATE_PACKET:
|
||||
status = get_update_packet_status_88xx(adapter, proc_status);
|
||||
break;
|
||||
case HALMAC_FEATURE_SEND_SCAN_PACKET:
|
||||
status = get_send_scan_packet_status_88xx(adapter, proc_status);
|
||||
break;
|
||||
case HALMAC_FEATURE_DROP_SCAN_PACKET:
|
||||
status = get_drop_scan_packet_status_88xx(adapter, proc_status);
|
||||
break;
|
||||
case HALMAC_FEATURE_IQK:
|
||||
status = get_iqk_status_88xx(adapter, proc_status);
|
||||
break;
|
||||
@@ -2453,6 +2887,24 @@ get_update_packet_status_88xx(struct halmac_adapter *adapter,
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_send_scan_packet_status_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_cmd_process_status *proc_status)
|
||||
{
|
||||
*proc_status = adapter->halmac_state.scan_pkt_state.proc_status;
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
static enum halmac_ret_status
|
||||
get_drop_scan_packet_status_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_cmd_process_status *proc_status)
|
||||
{
|
||||
*proc_status = adapter->halmac_state.drop_pkt_state.proc_status;
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* cfg_drv_rsvd_pg_num_88xx() -config reserved page number for driver
|
||||
* @adapter : the adapter of halmac
|
||||
@@ -2963,4 +3415,19 @@ get_real_pkt_id_88xx(struct halmac_adapter *adapter,
|
||||
return real_pkt_id;
|
||||
}
|
||||
|
||||
static u32
|
||||
get_update_packet_page_size(struct halmac_adapter *adapter, u32 size)
|
||||
{
|
||||
struct halmac_api *api = (struct halmac_api *)adapter->halmac_api;
|
||||
u32 txdesc_size;
|
||||
u32 total;
|
||||
|
||||
api->halmac_get_hw_value(adapter, HALMAC_HW_TX_DESC_SIZE, &txdesc_size);
|
||||
|
||||
total = size + txdesc_size;
|
||||
return (total & 0x7f) > 0 ?
|
||||
(total >> TX_PAGE_SIZE_SHIFT_88XX) + 1 :
|
||||
total >> TX_PAGE_SIZE_SHIFT_88XX;
|
||||
}
|
||||
|
||||
#endif /* HALMAC_88XX_SUPPORT */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -42,6 +42,10 @@ enum halmac_ret_status
|
||||
set_hw_value_88xx(struct halmac_adapter *adapter, enum halmac_hw_id hw_id,
|
||||
void *value);
|
||||
|
||||
enum halmac_ret_status
|
||||
get_watcher_88xx(struct halmac_adapter *adapter, enum halmac_watcher_sel sel,
|
||||
void *value);
|
||||
|
||||
enum halmac_ret_status
|
||||
set_h2c_pkt_hdr_88xx(struct halmac_adapter *adapter, u8 *hdr,
|
||||
struct halmac_h2c_header_info *info, u16 *seq_num);
|
||||
@@ -66,6 +70,14 @@ enum halmac_ret_status
|
||||
update_packet_88xx(struct halmac_adapter *adapter, enum halmac_packet_id pkt_id,
|
||||
u8 *pkt, u32 size);
|
||||
|
||||
enum halmac_ret_status
|
||||
send_scan_packet_88xx(struct halmac_adapter *adapter, u8 index,
|
||||
u8 *pkt, u32 size);
|
||||
|
||||
enum halmac_ret_status
|
||||
drop_scan_packet_88xx(struct halmac_adapter *adapter,
|
||||
struct halmac_drop_pkt_option *option);
|
||||
|
||||
enum halmac_ret_status
|
||||
bcn_ie_filter_88xx(struct halmac_adapter *adapter,
|
||||
struct halmac_bcn_ie_info *info);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -24,6 +24,7 @@
|
||||
#define RSVD_CS_EFUSE_SIZE 24
|
||||
#define FEATURE_DUMP_PHY_EFUSE HALMAC_FEATURE_DUMP_PHYSICAL_EFUSE
|
||||
#define FEATURE_DUMP_LOG_EFUSE HALMAC_FEATURE_DUMP_LOGICAL_EFUSE
|
||||
#define FEATURE_DUMP_LOG_EFUSE_MASK HALMAC_FEATURE_DUMP_LOGICAL_EFUSE_MASK
|
||||
|
||||
static enum halmac_cmd_construct_state
|
||||
efuse_cmd_cnstr_state_88xx(struct halmac_adapter *adapter);
|
||||
@@ -533,6 +534,84 @@ dump_log_efuse_map_88xx(struct halmac_adapter *adapter,
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
enum halmac_ret_status
|
||||
dump_log_efuse_mask_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_efuse_read_cfg cfg)
|
||||
{
|
||||
u8 *map = NULL;
|
||||
u32 size = adapter->hw_cfg_info.eeprom_size;
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
enum halmac_cmd_process_status *proc_status;
|
||||
|
||||
proc_status = &adapter->halmac_state.efuse_state.proc_status;
|
||||
|
||||
if (cfg == HALMAC_EFUSE_R_FW &&
|
||||
halmac_fw_validate(adapter) != HALMAC_RET_SUCCESS)
|
||||
return HALMAC_RET_NO_DLFW;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
PLTFM_MSG_TRACE("[TRACE]cfg = %d\n", cfg);
|
||||
|
||||
if (*proc_status == HALMAC_CMD_PROCESS_SENDING) {
|
||||
PLTFM_MSG_WARN("[WARN]Wait event(efuse)\n");
|
||||
return HALMAC_RET_BUSY_STATE;
|
||||
}
|
||||
|
||||
if (efuse_cmd_cnstr_state_88xx(adapter) != HALMAC_CMD_CNSTR_IDLE) {
|
||||
PLTFM_MSG_WARN("[WARN]Not idle(efuse)\n");
|
||||
return HALMAC_RET_ERROR_STATE;
|
||||
}
|
||||
|
||||
if (adapter->halmac_state.mac_pwr == HALMAC_MAC_POWER_OFF)
|
||||
PLTFM_MSG_ERR("[ERR]Dump efuse in suspend\n");
|
||||
|
||||
*proc_status = HALMAC_CMD_PROCESS_IDLE;
|
||||
adapter->evnt.log_efuse_mask = 1;
|
||||
|
||||
status = switch_efuse_bank_88xx(adapter, HALMAC_EFUSE_BANK_WIFI);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_ERR("[ERR]switch efuse bank\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = proc_dump_efuse_88xx(adapter, cfg);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_ERR("[ERR]dump efuse\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
if (adapter->efuse_map_valid == 1) {
|
||||
*proc_status = HALMAC_CMD_PROCESS_DONE;
|
||||
|
||||
map = (u8 *)PLTFM_MALLOC(size);
|
||||
if (!map) {
|
||||
PLTFM_MSG_ERR("[ERR]malloc map\n");
|
||||
return HALMAC_RET_MALLOC_FAIL;
|
||||
}
|
||||
PLTFM_MEMSET(map, 0xFF, size);
|
||||
|
||||
if (eeprom_mask_parser_88xx(adapter, adapter->efuse_map, map) !=
|
||||
HALMAC_RET_SUCCESS) {
|
||||
PLTFM_FREE(map, size);
|
||||
return HALMAC_RET_EEPROM_PARSING_FAIL;
|
||||
}
|
||||
|
||||
PLTFM_EVENT_SIG(HALMAC_FEATURE_DUMP_LOGICAL_EFUSE_MASK,
|
||||
*proc_status, map, size);
|
||||
adapter->evnt.log_efuse_mask = 0;
|
||||
|
||||
PLTFM_FREE(map, size);
|
||||
}
|
||||
|
||||
if (cnv_efuse_state_88xx(adapter, HALMAC_CMD_CNSTR_IDLE) !=
|
||||
HALMAC_RET_SUCCESS)
|
||||
return HALMAC_RET_ERROR_STATE;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* read_logical_efuse_88xx() - read logical efuse map 1 byte
|
||||
* @adapter : the adapter of halmac
|
||||
@@ -1075,6 +1154,92 @@ eeprom_parser_88xx(struct halmac_adapter *adapter, u8 *phy_map, u8 *log_map)
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
enum halmac_ret_status
|
||||
eeprom_mask_parser_88xx(struct halmac_adapter *adapter, u8 *phy_map,
|
||||
u8 *log_mask)
|
||||
{
|
||||
u8 i;
|
||||
u8 value8;
|
||||
u8 blk_idx;
|
||||
u8 word_en;
|
||||
u8 valid;
|
||||
u8 hdr;
|
||||
u8 hdr2 = 0;
|
||||
u32 eeprom_idx;
|
||||
u32 efuse_idx = 0;
|
||||
u32 prtct_efuse_size = adapter->hw_cfg_info.prtct_efuse_size;
|
||||
struct halmac_hw_cfg_info *hw_info = &adapter->hw_cfg_info;
|
||||
|
||||
PLTFM_MEMSET(log_mask, 0xFF, hw_info->eeprom_size);
|
||||
|
||||
do {
|
||||
value8 = *(phy_map + efuse_idx);
|
||||
hdr = value8;
|
||||
|
||||
if ((hdr & 0x1f) == 0x0f) {
|
||||
efuse_idx++;
|
||||
value8 = *(phy_map + efuse_idx);
|
||||
hdr2 = value8;
|
||||
if (hdr2 == 0xff)
|
||||
break;
|
||||
blk_idx = ((hdr2 & 0xF0) >> 1) | ((hdr >> 5) & 0x07);
|
||||
word_en = hdr2 & 0x0F;
|
||||
} else {
|
||||
blk_idx = (hdr & 0xF0) >> 4;
|
||||
word_en = hdr & 0x0F;
|
||||
}
|
||||
|
||||
if (hdr == 0xff)
|
||||
break;
|
||||
|
||||
efuse_idx++;
|
||||
|
||||
if (efuse_idx >= hw_info->efuse_size - prtct_efuse_size - 1)
|
||||
return HALMAC_RET_EEPROM_PARSING_FAIL;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
valid = (u8)((~(word_en >> i)) & BIT(0));
|
||||
if (valid == 1) {
|
||||
eeprom_idx = (blk_idx << 3) + (i << 1);
|
||||
|
||||
if ((eeprom_idx + 1) > hw_info->eeprom_size) {
|
||||
PLTFM_MSG_ERR("[ERR]efuse idx:0x%X\n",
|
||||
efuse_idx - 1);
|
||||
|
||||
PLTFM_MSG_ERR("[ERR]read hdr:0x%X\n",
|
||||
hdr);
|
||||
|
||||
PLTFM_MSG_ERR("[ERR]read hdr2:0x%X\n",
|
||||
hdr2);
|
||||
|
||||
return HALMAC_RET_EEPROM_PARSING_FAIL;
|
||||
}
|
||||
|
||||
*(log_mask + eeprom_idx) = 0x00;
|
||||
|
||||
eeprom_idx++;
|
||||
efuse_idx++;
|
||||
|
||||
if (efuse_idx > hw_info->efuse_size -
|
||||
prtct_efuse_size - 1)
|
||||
return HALMAC_RET_EEPROM_PARSING_FAIL;
|
||||
|
||||
*(log_mask + eeprom_idx) = 0x00;
|
||||
|
||||
efuse_idx++;
|
||||
|
||||
if (efuse_idx > hw_info->efuse_size -
|
||||
prtct_efuse_size)
|
||||
return HALMAC_RET_EEPROM_PARSING_FAIL;
|
||||
}
|
||||
}
|
||||
} while (1);
|
||||
|
||||
adapter->efuse_end = efuse_idx;
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
static enum halmac_ret_status
|
||||
read_log_efuse_map_88xx(struct halmac_adapter *adapter, u8 *map)
|
||||
{
|
||||
@@ -1755,6 +1920,19 @@ get_efuse_data_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
map, eeprom_size);
|
||||
adapter->evnt.log_efuse_map = 0;
|
||||
}
|
||||
|
||||
if (adapter->evnt.log_efuse_mask == 1) {
|
||||
if (eeprom_mask_parser_88xx(adapter, adapter->efuse_map,
|
||||
map)
|
||||
!= HALMAC_RET_SUCCESS) {
|
||||
PLTFM_FREE(map, eeprom_size);
|
||||
return HALMAC_RET_EEPROM_PARSING_FAIL;
|
||||
}
|
||||
PLTFM_EVENT_SIG(FEATURE_DUMP_LOG_EFUSE_MASK,
|
||||
proc_status, map, eeprom_size);
|
||||
adapter->evnt.log_efuse_mask = 0;
|
||||
}
|
||||
|
||||
} else {
|
||||
proc_status = HALMAC_CMD_PROCESS_ERROR;
|
||||
state->proc_status = proc_status;
|
||||
@@ -1770,6 +1948,12 @@ get_efuse_data_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
&state->fw_rc, 1);
|
||||
adapter->evnt.log_efuse_map = 0;
|
||||
}
|
||||
|
||||
if (adapter->evnt.log_efuse_mask == 1) {
|
||||
PLTFM_EVENT_SIG(FEATURE_DUMP_LOG_EFUSE_MASK,
|
||||
proc_status, &state->fw_rc, 1);
|
||||
adapter->evnt.log_efuse_mask = 0;
|
||||
}
|
||||
}
|
||||
|
||||
PLTFM_FREE(map, eeprom_size);
|
||||
@@ -1810,6 +1994,9 @@ get_dump_phy_efuse_status_88xx(struct halmac_adapter *adapter,
|
||||
}
|
||||
PLTFM_MEMSET(map, 0xFF, efuse_size);
|
||||
PLTFM_MUTEX_LOCK(&adapter->efuse_mutex);
|
||||
#if HALMAC_PLATFORM_WINDOWS
|
||||
PLTFM_MEMCPY(map, adapter->efuse_map, efuse_size);
|
||||
#else
|
||||
PLTFM_MEMCPY(map, adapter->efuse_map,
|
||||
efuse_size - prtct_efuse_size);
|
||||
PLTFM_MEMCPY(map + efuse_size - prtct_efuse_size +
|
||||
@@ -1818,6 +2005,7 @@ get_dump_phy_efuse_status_88xx(struct halmac_adapter *adapter,
|
||||
prtct_efuse_size + RSVD_CS_EFUSE_SIZE,
|
||||
prtct_efuse_size - RSVD_EFUSE_SIZE -
|
||||
RSVD_CS_EFUSE_SIZE);
|
||||
#endif
|
||||
PLTFM_MUTEX_UNLOCK(&adapter->efuse_mutex);
|
||||
|
||||
PLTFM_MEMCPY(data, map, *size);
|
||||
@@ -1874,6 +2062,52 @@ get_dump_log_efuse_status_88xx(struct halmac_adapter *adapter,
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
enum halmac_ret_status
|
||||
get_dump_log_efuse_mask_status_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_cmd_process_status *proc_status,
|
||||
u8 *data, u32 *size)
|
||||
{
|
||||
u8 *map = NULL;
|
||||
u32 eeprom_size = adapter->hw_cfg_info.eeprom_size;
|
||||
struct halmac_efuse_state *state = &adapter->halmac_state.efuse_state;
|
||||
|
||||
*proc_status = state->proc_status;
|
||||
|
||||
if (!data)
|
||||
return HALMAC_RET_NULL_POINTER;
|
||||
|
||||
if (!size)
|
||||
return HALMAC_RET_NULL_POINTER;
|
||||
|
||||
if (*proc_status == HALMAC_CMD_PROCESS_DONE) {
|
||||
if (*size < eeprom_size) {
|
||||
*size = eeprom_size;
|
||||
return HALMAC_RET_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
*size = eeprom_size;
|
||||
|
||||
map = (u8 *)PLTFM_MALLOC(eeprom_size);
|
||||
if (!map) {
|
||||
PLTFM_MSG_ERR("[ERR]malloc map\n");
|
||||
return HALMAC_RET_MALLOC_FAIL;
|
||||
}
|
||||
PLTFM_MEMSET(map, 0xFF, eeprom_size);
|
||||
|
||||
if (eeprom_mask_parser_88xx(adapter, adapter->efuse_map, map) !=
|
||||
HALMAC_RET_SUCCESS) {
|
||||
PLTFM_FREE(map, eeprom_size);
|
||||
return HALMAC_RET_EEPROM_PARSING_FAIL;
|
||||
}
|
||||
|
||||
PLTFM_MEMCPY(data, map, *size);
|
||||
|
||||
PLTFM_FREE(map, eeprom_size);
|
||||
}
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
enum halmac_ret_status
|
||||
get_h2c_ack_phy_efuse_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
{
|
||||
@@ -1907,4 +2141,118 @@ get_rsvd_efuse_size_88xx(struct halmac_adapter *adapter)
|
||||
return adapter->hw_cfg_info.prtct_efuse_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* write_wifi_phy_efuse_88xx() - write wifi physical efuse
|
||||
* @adapter : the adapter of halmac
|
||||
* @offset : the efuse offset to be written
|
||||
* @value : the value to be written
|
||||
* Author : Yong-Ching Lin
|
||||
* Return : enum halmac_ret_status
|
||||
* More details of status code can be found in prototype document
|
||||
*/
|
||||
enum halmac_ret_status
|
||||
write_wifi_phy_efuse_88xx(struct halmac_adapter *adapter, u32 offset, u8 value)
|
||||
{
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
enum halmac_cmd_process_status *proc_status;
|
||||
|
||||
proc_status = &adapter->halmac_state.efuse_state.proc_status;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
if (offset >= adapter->hw_cfg_info.efuse_size) {
|
||||
PLTFM_MSG_ERR("[ERR]Offset is too large\n");
|
||||
return HALMAC_RET_EFUSE_SIZE_INCORRECT;
|
||||
}
|
||||
|
||||
if (*proc_status == HALMAC_CMD_PROCESS_SENDING) {
|
||||
PLTFM_MSG_WARN("[WARN]Wait event(efuse)\n");
|
||||
return HALMAC_RET_BUSY_STATE;
|
||||
}
|
||||
|
||||
if (efuse_cmd_cnstr_state_88xx(adapter) != HALMAC_CMD_CNSTR_IDLE) {
|
||||
PLTFM_MSG_WARN("[WARN]Not idle(efuse)\n");
|
||||
return HALMAC_RET_ERROR_STATE;
|
||||
}
|
||||
|
||||
status = switch_efuse_bank_88xx(adapter, HALMAC_EFUSE_BANK_WIFI);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_ERR("[ERR]switch efuse bank\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = write_hw_efuse_88xx(adapter, offset, value);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_ERR("[ERR]write physical efuse\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
if (cnv_efuse_state_88xx(adapter, HALMAC_CMD_CNSTR_IDLE) !=
|
||||
HALMAC_RET_SUCCESS)
|
||||
return HALMAC_RET_ERROR_STATE;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* read_wifi_phy_efuse_88xx() - read wifi physical efuse
|
||||
* @adapter : the adapter of halmac
|
||||
* @offset : the efuse offset to be read
|
||||
* @size : the length to be read
|
||||
* @value : pointer to the pre-allocated space where
|
||||
the efuse content is to be copied
|
||||
* Author : Yong-Ching Lin
|
||||
* Return : enum halmac_ret_status
|
||||
* More details of status code can be found in prototype document
|
||||
*/
|
||||
enum halmac_ret_status
|
||||
read_wifi_phy_efuse_88xx(struct halmac_adapter *adapter, u32 offset, u32 size,
|
||||
u8 *value)
|
||||
{
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
enum halmac_cmd_process_status *proc_status;
|
||||
|
||||
proc_status = &adapter->halmac_state.efuse_state.proc_status;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
if (offset >= adapter->hw_cfg_info.efuse_size ||
|
||||
offset + size >= adapter->hw_cfg_info.efuse_size) {
|
||||
PLTFM_MSG_ERR("[ERR] Wrong efuse index\n");
|
||||
return HALMAC_RET_EFUSE_SIZE_INCORRECT;
|
||||
}
|
||||
|
||||
if (*proc_status == HALMAC_CMD_PROCESS_SENDING) {
|
||||
PLTFM_MSG_WARN("[WARN]Wait event(efuse)\n");
|
||||
return HALMAC_RET_BUSY_STATE;
|
||||
}
|
||||
|
||||
if (efuse_cmd_cnstr_state_88xx(adapter) != HALMAC_CMD_CNSTR_IDLE) {
|
||||
PLTFM_MSG_WARN("[WARN]Not idle(efuse)\n");
|
||||
return HALMAC_RET_ERROR_STATE;
|
||||
}
|
||||
|
||||
status = switch_efuse_bank_88xx(adapter, HALMAC_EFUSE_BANK_WIFI);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_ERR("[ERR]switch efuse bank\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = read_hw_efuse_88xx(adapter, offset, size, value);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_ERR("[ERR]read hw efuse\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
if (cnv_efuse_state_88xx(adapter, HALMAC_CMD_CNSTR_IDLE) !=
|
||||
HALMAC_RET_SUCCESS)
|
||||
return HALMAC_RET_ERROR_STATE;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
#endif /* HALMAC_88XX_SUPPORT */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -27,6 +27,10 @@ dump_efuse_map_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_ret_status
|
||||
eeprom_parser_88xx(struct halmac_adapter *adapter, u8 *phy_map, u8 *log_map);
|
||||
|
||||
enum halmac_ret_status
|
||||
eeprom_mask_parser_88xx(struct halmac_adapter *adapter, u8 *phy_map,
|
||||
u8 *log_mask);
|
||||
|
||||
enum halmac_ret_status
|
||||
dump_efuse_map_bt_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_efuse_bank bank, u32 size, u8 *map);
|
||||
@@ -54,6 +58,9 @@ get_log_efuse_size_88xx(struct halmac_adapter *adapter, u32 *size);
|
||||
enum halmac_ret_status
|
||||
dump_log_efuse_map_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_efuse_read_cfg cfg);
|
||||
enum halmac_ret_status
|
||||
dump_log_efuse_mask_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_efuse_read_cfg cfg);
|
||||
|
||||
enum halmac_ret_status
|
||||
read_logical_efuse_88xx(struct halmac_adapter *adapter, u32 offset, u8 *value);
|
||||
@@ -97,12 +104,24 @@ get_dump_log_efuse_status_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_cmd_process_status *proc_status,
|
||||
u8 *data, u32 *size);
|
||||
|
||||
enum halmac_ret_status
|
||||
get_dump_log_efuse_mask_status_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_cmd_process_status *proc_status,
|
||||
u8 *data, u32 *size);
|
||||
|
||||
enum halmac_ret_status
|
||||
get_h2c_ack_phy_efuse_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size);
|
||||
|
||||
u32
|
||||
get_rsvd_efuse_size_88xx(struct halmac_adapter *adapter);
|
||||
|
||||
enum halmac_ret_status
|
||||
write_wifi_phy_efuse_88xx(struct halmac_adapter *adapter, u32 offset, u8 value);
|
||||
|
||||
enum halmac_ret_status
|
||||
read_wifi_phy_efuse_88xx(struct halmac_adapter *adapter, u32 offset, u32 size,
|
||||
u8 *value);
|
||||
|
||||
#endif /* HALMAC_88XX_SUPPORT */
|
||||
|
||||
#endif/* _HALMAC_EFUSE_88XX_H_ */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2017 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2017 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -43,6 +43,7 @@ download_flash_88xx(struct halmac_adapter *adapter, u8 *fw_bin, u32 size,
|
||||
u16 h2c_info_offset;
|
||||
u32 pkt_size;
|
||||
u32 mem_offset;
|
||||
u32 cnt;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
@@ -105,12 +106,14 @@ download_flash_88xx(struct halmac_adapter *adapter, u8 *fw_bin, u32 size,
|
||||
mem_offset += pkt_size;
|
||||
size -= pkt_size;
|
||||
|
||||
while (((HALMAC_REG_R8(REG_MCUTST_I)) & BIT(0)) != 0)
|
||||
cnt = 1000;
|
||||
while (((HALMAC_REG_R8(REG_MCUTST_I)) & BIT(0)) != 0) {
|
||||
if (cnt == 0) {
|
||||
PLTFM_MSG_ERR("[ERR]dl flash!!\n");
|
||||
return HALMAC_RET_DLFW_FAIL;
|
||||
}
|
||||
cnt--;
|
||||
PLTFM_DELAY_US(1000);
|
||||
|
||||
if (((HALMAC_REG_R8(REG_MCUTST_I)) & BIT(0)) != 0) {
|
||||
PLTFM_MSG_ERR("[ERR]dl flash!!\n");
|
||||
return HALMAC_RET_DLFW_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +134,7 @@ download_flash_88xx(struct halmac_adapter *adapter, u8 *fw_bin, u32 size,
|
||||
* More details of status code can be found in prototype document
|
||||
*/
|
||||
enum halmac_ret_status
|
||||
read_flash_88xx(struct halmac_adapter *adapter, u32 addr, u32 length)
|
||||
read_flash_88xx(struct halmac_adapter *adapter, u32 addr, u32 length, u8 *data)
|
||||
{
|
||||
struct halmac_api *api = (struct halmac_api *)adapter->halmac_api;
|
||||
enum halmac_ret_status status;
|
||||
@@ -140,8 +143,10 @@ read_flash_88xx(struct halmac_adapter *adapter, u32 addr, u32 length)
|
||||
u8 restore[3];
|
||||
u8 h2c_buf[H2C_PKT_SIZE_88XX] = {0};
|
||||
u16 seq_num = 0;
|
||||
u16 h2c_info_addr = adapter->txff_alloc.rsvd_h2c_info_addr;
|
||||
u16 h2c_pg_addr = adapter->txff_alloc.rsvd_h2c_info_addr;
|
||||
u16 rsvd_pg_addr = adapter->txff_alloc.rsvd_boundary;
|
||||
u16 h2c_info_addr;
|
||||
u32 cnt;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
@@ -160,14 +165,14 @@ read_flash_88xx(struct halmac_adapter *adapter, u32 addr, u32 length)
|
||||
value8 = (u8)(value8 & ~(BIT(6)));
|
||||
HALMAC_REG_W8(REG_FWHW_TXQ_CTRL + 2, value8);
|
||||
|
||||
HALMAC_REG_W16(REG_FIFOPAGE_CTRL_2, h2c_info_addr);
|
||||
HALMAC_REG_W16(REG_FIFOPAGE_CTRL_2, h2c_pg_addr);
|
||||
value8 = HALMAC_REG_R8(REG_MCUTST_I);
|
||||
value8 |= BIT(0);
|
||||
HALMAC_REG_W8(REG_MCUTST_I, value8);
|
||||
|
||||
/* Construct H2C Content */
|
||||
DOWNLOAD_FLASH_SET_SPI_CMD(h2c_buf, 0x03);
|
||||
DOWNLOAD_FLASH_SET_LOCATION(h2c_buf, h2c_info_addr - rsvd_pg_addr);
|
||||
DOWNLOAD_FLASH_SET_LOCATION(h2c_buf, h2c_pg_addr - rsvd_pg_addr);
|
||||
DOWNLOAD_FLASH_SET_SIZE(h2c_buf, length);
|
||||
DOWNLOAD_FLASH_SET_START_ADDR(h2c_buf, addr);
|
||||
|
||||
@@ -185,14 +190,30 @@ read_flash_88xx(struct halmac_adapter *adapter, u32 addr, u32 length)
|
||||
return status;
|
||||
}
|
||||
|
||||
while (((HALMAC_REG_R8(REG_MCUTST_I)) & BIT(0)) != 0)
|
||||
cnt = 5000;
|
||||
while (((HALMAC_REG_R8(REG_MCUTST_I)) & BIT(0)) != 0) {
|
||||
if (cnt == 0) {
|
||||
PLTFM_MSG_ERR("[ERR]read flash!!\n");
|
||||
return HALMAC_RET_FAIL;
|
||||
}
|
||||
cnt--;
|
||||
PLTFM_DELAY_US(1000);
|
||||
}
|
||||
|
||||
HALMAC_REG_W8_CLR(REG_MCUTST_I, BIT(0));
|
||||
|
||||
HALMAC_REG_W16(REG_FIFOPAGE_CTRL_2, rsvd_pg_addr);
|
||||
HALMAC_REG_W8(REG_FWHW_TXQ_CTRL + 2, restore[2]);
|
||||
HALMAC_REG_W8(REG_BCN_CTRL, restore[1]);
|
||||
HALMAC_REG_W8(REG_CR + 1, restore[0]);
|
||||
|
||||
h2c_info_addr = h2c_pg_addr << TX_PAGE_SIZE_SHIFT_88XX;
|
||||
status = dump_fifo_88xx(adapter, HAL_FIFO_SEL_TX, h2c_info_addr,
|
||||
length, data);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_ERR("[ERR]dump fifo!!\n");
|
||||
return status;
|
||||
}
|
||||
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
@@ -274,9 +295,12 @@ check_flash_88xx(struct halmac_adapter *adapter, u8 *fw_bin, u32 size,
|
||||
u32 pkt_size;
|
||||
u32 start_page;
|
||||
u32 cnt;
|
||||
u8 *data;
|
||||
|
||||
pg_addr = adapter->txff_alloc.rsvd_h2c_info_addr;
|
||||
|
||||
data = (u8 *)PLTFM_MALLOC(4096);
|
||||
|
||||
while (size != 0) {
|
||||
start_page = ((pg_addr << 7) >> 12) + 0x780;
|
||||
residue = (pg_addr << 7) & (4096 - 1);
|
||||
@@ -286,7 +310,7 @@ check_flash_88xx(struct halmac_adapter *adapter, u8 *fw_bin, u32 size,
|
||||
else
|
||||
pkt_size = size;
|
||||
|
||||
read_flash_88xx(adapter, addr, 4096);
|
||||
read_flash_88xx(adapter, addr, 4096, data);
|
||||
|
||||
cnt = 0;
|
||||
while (cnt < pkt_size) {
|
||||
@@ -295,6 +319,7 @@ check_flash_88xx(struct halmac_adapter *adapter, u8 *fw_bin, u32 size,
|
||||
value8 = HALMAC_REG_R8(i);
|
||||
if (*fw_bin != value8) {
|
||||
PLTFM_MSG_ERR("[ERR]check flash!!\n");
|
||||
PLTFM_FREE(data, 4096);
|
||||
return HALMAC_RET_FAIL;
|
||||
}
|
||||
|
||||
@@ -310,6 +335,8 @@ check_flash_88xx(struct halmac_adapter *adapter, u8 *fw_bin, u32 size,
|
||||
size -= pkt_size;
|
||||
}
|
||||
|
||||
PLTFM_FREE(data, 4096);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2017 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2017 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -25,7 +25,7 @@ download_flash_88xx(struct halmac_adapter *adapter, u8 *fw_bin, u32 size,
|
||||
u32 rom_addr);
|
||||
|
||||
enum halmac_ret_status
|
||||
read_flash_88xx(struct halmac_adapter *adapter, u32 addr, u32 length);
|
||||
read_flash_88xx(struct halmac_adapter *adapter, u32 addr, u32 length, u8 *data);
|
||||
|
||||
enum halmac_ret_status
|
||||
erase_flash_88xx(struct halmac_adapter *adapter, u8 erase_cmd, u32 addr);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -475,13 +475,24 @@ DL_FREE_FW_END:
|
||||
enum halmac_ret_status
|
||||
reset_wifi_fw_88xx(struct halmac_adapter *adapter)
|
||||
{
|
||||
enum halmac_ret_status status;
|
||||
u32 lte_coex_backup = 0;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
status = ltecoex_reg_read_88xx(adapter, 0x38, <e_coex_backup);
|
||||
if (status != HALMAC_RET_SUCCESS)
|
||||
return status;
|
||||
|
||||
wlan_cpu_en_88xx(adapter, 0);
|
||||
pltfm_reset_88xx(adapter);
|
||||
init_ofld_feature_state_machine_88xx(adapter);
|
||||
wlan_cpu_en_88xx(adapter, 1);
|
||||
|
||||
status = ltecoex_reg_write_88xx(adapter, 0x38, lte_coex_backup);
|
||||
if (status != HALMAC_RET_SUCCESS)
|
||||
return status;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
@@ -1015,6 +1026,7 @@ get_cpu_mode_88xx(struct halmac_adapter *adapter,
|
||||
|
||||
if (HALMAC_REG_R8(REG_MCU_TST_CFG) == ID_CHECK_ENETR_CPU_SLEEP) {
|
||||
*mode = HALMAC_WLCPU_SLEEP;
|
||||
*cur_mode = HALMAC_WLCPU_SLEEP;
|
||||
HALMAC_REG_W8(REG_MCU_TST_CFG, 0);
|
||||
} else {
|
||||
*mode = HALMAC_WLCPU_ENTER_SLEEP;
|
||||
@@ -1038,6 +1050,7 @@ send_general_info_88xx(struct halmac_adapter *adapter,
|
||||
u8 h2cq_ele[4] = {0};
|
||||
u32 h2cq_addr;
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
u8 cnt;
|
||||
|
||||
if (halmac_fw_validate(adapter) != HALMAC_RET_SUCCESS)
|
||||
return HALMAC_RET_NO_DLFW;
|
||||
@@ -1045,6 +1058,9 @@ send_general_info_88xx(struct halmac_adapter *adapter,
|
||||
if (adapter->fw_ver.h2c_version < 4)
|
||||
return HALMAC_RET_FW_NO_SUPPORT;
|
||||
|
||||
if (adapter->fw_ver.h2c_version < 14)
|
||||
PLTFM_MSG_WARN("[WARN]the H2C ver. does not match halmac\n");
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
if (adapter->halmac_state.dlfw_state == HALMAC_DLFW_NONE) {
|
||||
@@ -1066,17 +1082,26 @@ send_general_info_88xx(struct halmac_adapter *adapter,
|
||||
|
||||
h2cq_addr = adapter->txff_alloc.rsvd_h2cq_addr;
|
||||
h2cq_addr <<= TX_PAGE_SIZE_SHIFT_88XX;
|
||||
status = dump_fifo_88xx(adapter, HAL_FIFO_SEL_TX,
|
||||
h2cq_addr, 4, h2cq_ele);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_ERR("[ERR]dump h2cq!!\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
if ((h2cq_ele[0] & 0x7F) != 0x01 || h2cq_ele[1] != 0xFF) {
|
||||
PLTFM_MSG_ERR("[ERR]h2cq compare!!\n");
|
||||
return HALMAC_RET_SEND_H2C_FAIL;
|
||||
}
|
||||
cnt = 100;
|
||||
do {
|
||||
status = dump_fifo_88xx(adapter, HAL_FIFO_SEL_TX,
|
||||
h2cq_addr, 4, h2cq_ele);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_ERR("[ERR]dump h2cq!!\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
if ((h2cq_ele[0] & 0x7F) == 0x01 && h2cq_ele[1] == 0xFF)
|
||||
break;
|
||||
|
||||
cnt--;
|
||||
if (cnt == 0) {
|
||||
PLTFM_MSG_ERR("[ERR]h2cq compare!!\n");
|
||||
return HALMAC_RET_SEND_H2C_FAIL;
|
||||
}
|
||||
PLTFM_DELAY_US(5);
|
||||
} while (1);
|
||||
|
||||
if (adapter->halmac_state.dlfw_state == HALMAC_DLFW_DONE)
|
||||
adapter->halmac_state.dlfw_state = HALMAC_GEN_INFO_SENT;
|
||||
@@ -1130,6 +1155,9 @@ proc_send_phydm_info_88xx(struct halmac_adapter *adapter,
|
||||
PHYDM_INFO_SET_CUT_VER(h2c_buf, adapter->chip_ver);
|
||||
PHYDM_INFO_SET_RX_ANT_STATUS(h2c_buf, info->rx_ant_status);
|
||||
PHYDM_INFO_SET_TX_ANT_STATUS(h2c_buf, info->tx_ant_status);
|
||||
PHYDM_INFO_SET_EXT_PA(h2c_buf, info->ext_pa);
|
||||
PHYDM_INFO_SET_PACKAGE_TYPE(h2c_buf, info->package_type);
|
||||
PHYDM_INFO_SET_MP_MODE(h2c_buf, info->mp_mode);
|
||||
|
||||
hdr_info.sub_cmd_id = SUB_CMD_ID_PHYDM_INFO;
|
||||
hdr_info.content_size = 8;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -249,173 +249,5 @@ pinmux_parser_88xx(struct halmac_adapter *adapter,
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
enum halmac_ret_status
|
||||
pinmux_switch_88xx(struct halmac_adapter *adapter,
|
||||
const struct halmac_gpio_pimux_list *list, u32 size,
|
||||
u32 gpio_id, enum halmac_gpio_func gpio_func)
|
||||
{
|
||||
u32 i;
|
||||
u8 value8;
|
||||
u16 switch_func;
|
||||
const struct halmac_gpio_pimux_list *cur_list = list;
|
||||
enum halmac_gpio_cfg_state *state;
|
||||
struct halmac_api *api = (struct halmac_api *)adapter->halmac_api;
|
||||
|
||||
state = &adapter->halmac_state.gpio_cfg_state;
|
||||
|
||||
if (*state == HALMAC_GPIO_CFG_STATE_BUSY)
|
||||
return HALMAC_RET_BUSY_STATE;
|
||||
|
||||
switch (gpio_func) {
|
||||
case HALMAC_GPIO_FUNC_WL_LED:
|
||||
switch_func = HALMAC_WL_LED;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SDIO_INT:
|
||||
switch_func = HALMAC_SDIO_INT;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_BT_HOST_WAKE1:
|
||||
case HALMAC_GPIO_FUNC_BT_DEV_WAKE1:
|
||||
switch_func = HALMAC_GPIO13_14_WL_CTRL_EN;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_0:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_1:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_2:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_3:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_4:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_5:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_6:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_7:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_8:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_9:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_10:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_11:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_12:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_13:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_14:
|
||||
case HALMAC_GPIO_FUNC_SW_IO_15:
|
||||
switch_func = HALMAC_SW_IO;
|
||||
break;
|
||||
default:
|
||||
return HALMAC_RET_SWITCH_CASE_ERROR;
|
||||
}
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
if (gpio_id != cur_list->id) {
|
||||
PLTFM_MSG_ERR("[ERR]offset:%X, value:%X, func:%X\n",
|
||||
cur_list->offset, cur_list->value,
|
||||
cur_list->func);
|
||||
PLTFM_MSG_ERR("[ERR]id1 : %X, id2 : %X\n",
|
||||
gpio_id, cur_list->id);
|
||||
return HALMAC_RET_GET_PINMUX_ERR;
|
||||
}
|
||||
|
||||
if (switch_func == cur_list->func)
|
||||
break;
|
||||
|
||||
cur_list++;
|
||||
}
|
||||
|
||||
if (i == size) {
|
||||
PLTFM_MSG_ERR("[ERR]gpio func error:%X %X\n",
|
||||
gpio_id, cur_list->id);
|
||||
return HALMAC_RET_GET_PINMUX_ERR;
|
||||
}
|
||||
|
||||
*state = HALMAC_GPIO_CFG_STATE_BUSY;
|
||||
|
||||
cur_list = list;
|
||||
for (i = 0; i < size; i++) {
|
||||
value8 = HALMAC_REG_R8(cur_list->offset);
|
||||
value8 &= ~(cur_list->msk);
|
||||
|
||||
if (switch_func == cur_list->func) {
|
||||
value8 |= (cur_list->value & cur_list->msk);
|
||||
HALMAC_REG_W8(cur_list->offset, value8);
|
||||
break;
|
||||
}
|
||||
|
||||
value8 |= (~cur_list->value & cur_list->msk);
|
||||
HALMAC_REG_W8(cur_list->offset, value8);
|
||||
|
||||
cur_list++;
|
||||
}
|
||||
|
||||
*state = HALMAC_GPIO_CFG_STATE_IDLE;
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
enum halmac_ret_status
|
||||
pinmux_record_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_gpio_func gpio_func, u8 val)
|
||||
{
|
||||
switch (gpio_func) {
|
||||
case HALMAC_GPIO_FUNC_WL_LED:
|
||||
adapter->pinmux_info.wl_led = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SDIO_INT:
|
||||
adapter->pinmux_info.sdio_int = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_BT_HOST_WAKE1:
|
||||
adapter->pinmux_info.bt_host_wake = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_BT_DEV_WAKE1:
|
||||
adapter->pinmux_info.bt_dev_wake = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_0:
|
||||
adapter->pinmux_info.sw_io_0 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_1:
|
||||
adapter->pinmux_info.sw_io_1 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_2:
|
||||
adapter->pinmux_info.sw_io_2 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_3:
|
||||
adapter->pinmux_info.sw_io_3 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_4:
|
||||
adapter->pinmux_info.sw_io_4 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_5:
|
||||
adapter->pinmux_info.sw_io_5 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_6:
|
||||
adapter->pinmux_info.sw_io_6 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_7:
|
||||
adapter->pinmux_info.sw_io_7 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_8:
|
||||
adapter->pinmux_info.sw_io_8 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_9:
|
||||
adapter->pinmux_info.sw_io_9 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_10:
|
||||
adapter->pinmux_info.sw_io_10 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_11:
|
||||
adapter->pinmux_info.sw_io_11 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_12:
|
||||
adapter->pinmux_info.sw_io_12 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_13:
|
||||
adapter->pinmux_info.sw_io_13 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_14:
|
||||
adapter->pinmux_info.sw_io_14 = val;
|
||||
break;
|
||||
case HALMAC_GPIO_FUNC_SW_IO_15:
|
||||
adapter->pinmux_info.sw_io_15 = val;
|
||||
break;
|
||||
default:
|
||||
return HALMAC_RET_GET_PINMUX_ERR;
|
||||
}
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
#endif /* HALMAC_88XX_SUPPORT */
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -45,15 +45,6 @@ pinmux_parser_88xx(struct halmac_adapter *adapter,
|
||||
const struct halmac_gpio_pimux_list *list, u32 size,
|
||||
u32 gpio_id, u32 *cur_func);
|
||||
|
||||
enum halmac_ret_status
|
||||
pinmux_switch_88xx(struct halmac_adapter *adapter,
|
||||
const struct halmac_gpio_pimux_list *list, u32 size,
|
||||
u32 gpio_id, enum halmac_gpio_func gpio_func);
|
||||
|
||||
enum halmac_ret_status
|
||||
pinmux_record_88xx(struct halmac_adapter *adapter,
|
||||
enum halmac_gpio_func gpio_func, u8 val);
|
||||
|
||||
#endif /* HALMAC_88XX_SUPPORT */
|
||||
|
||||
#endif/* _HALMAC_GPIO_88XX_H_ */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -132,13 +132,16 @@ init_adapter_param_88xx(struct halmac_adapter *adapter)
|
||||
|
||||
adapter->sdio_cmd53_4byte = HALMAC_SDIO_CMD53_4BYTE_MODE_DISABLE;
|
||||
adapter->sdio_hw_info.io_hi_speed_flag = 0;
|
||||
adapter->sdio_hw_info.io_indir_flag = 0;
|
||||
adapter->sdio_hw_info.io_indir_flag = 1;
|
||||
adapter->sdio_hw_info.io_warn_flag = 0;
|
||||
adapter->sdio_hw_info.spec_ver = HALMAC_SDIO_SPEC_VER_2_00;
|
||||
adapter->sdio_hw_info.clock_speed = 50;
|
||||
adapter->sdio_hw_info.block_size = 512;
|
||||
adapter->sdio_hw_info.tx_seq = 1;
|
||||
adapter->sdio_fs.macid_map = (u8 *)NULL;
|
||||
|
||||
adapter->watcher.get_watcher.sdio_rn_not_align = 0;
|
||||
|
||||
adapter->pinmux_info.wl_led = 0;
|
||||
adapter->pinmux_info.sdio_int = 0;
|
||||
adapter->pinmux_info.sw_io_0 = 0;
|
||||
@@ -218,6 +221,7 @@ mount_api_88xx(struct halmac_adapter *adapter)
|
||||
api->halmac_read_efuse_bt = read_efuse_bt_88xx;
|
||||
api->halmac_cfg_efuse_auto_check = cfg_efuse_auto_check_88xx;
|
||||
api->halmac_dump_logical_efuse_map = dump_log_efuse_map_88xx;
|
||||
api->halmac_dump_logical_efuse_mask = dump_log_efuse_mask_88xx;
|
||||
api->halmac_pg_efuse_by_map = pg_efuse_by_map_88xx;
|
||||
api->halmac_mask_logical_efuse = mask_log_efuse_88xx;
|
||||
api->halmac_get_efuse_size = get_efuse_size_88xx;
|
||||
@@ -229,6 +233,9 @@ mount_api_88xx(struct halmac_adapter *adapter)
|
||||
api->halmac_write_logical_efuse = write_log_efuse_88xx;
|
||||
api->halmac_read_logical_efuse = read_logical_efuse_88xx;
|
||||
|
||||
api->halmac_write_wifi_phy_efuse = write_wifi_phy_efuse_88xx;
|
||||
api->halmac_read_wifi_phy_efuse = read_wifi_phy_efuse_88xx;
|
||||
|
||||
api->halmac_ofld_func_cfg = ofld_func_cfg_88xx;
|
||||
api->halmac_h2c_lb = h2c_lb_88xx;
|
||||
api->halmac_debug = mac_debug_88xx;
|
||||
@@ -258,6 +265,8 @@ mount_api_88xx(struct halmac_adapter *adapter)
|
||||
api->halmac_p2pps = p2pps_88xx;
|
||||
api->halmac_clear_ch_info = clear_ch_info_88xx;
|
||||
api->halmac_send_general_info = send_general_info_88xx;
|
||||
api->halmac_send_scan_packet = send_scan_packet_88xx;
|
||||
api->halmac_drop_scan_packet = drop_scan_packet_88xx;
|
||||
|
||||
api->halmac_start_iqk = start_iqk_88xx;
|
||||
api->halmac_ctrl_pwr_tracking = ctrl_pwr_tracking_88xx;
|
||||
@@ -307,13 +316,12 @@ mount_api_88xx(struct halmac_adapter *adapter)
|
||||
api->halmac_enter_cpu_sleep_mode = enter_cpu_sleep_mode_88xx;
|
||||
api->halmac_get_cpu_mode = get_cpu_mode_88xx;
|
||||
api->halmac_drv_fwctrl = drv_fwctrl_88xx;
|
||||
api->halmac_get_watcher = get_watcher_88xx;
|
||||
|
||||
if (adapter->intf == HALMAC_INTERFACE_SDIO) {
|
||||
#if HALMAC_SDIO_SUPPORT
|
||||
api->halmac_init_sdio_cfg = init_sdio_cfg_88xx;
|
||||
api->halmac_deinit_sdio_cfg = deinit_sdio_cfg_88xx;
|
||||
api->halmac_cfg_rx_aggregation = cfg_sdio_rx_agg_88xx;
|
||||
api->halmac_init_interface_cfg = init_sdio_cfg_88xx;
|
||||
api->halmac_deinit_interface_cfg = deinit_sdio_cfg_88xx;
|
||||
api->halmac_cfg_tx_agg_align = cfg_txagg_sdio_align_88xx;
|
||||
api->halmac_set_bulkout_num = set_sdio_bulkout_num_88xx;
|
||||
@@ -322,6 +330,7 @@ mount_api_88xx(struct halmac_adapter *adapter)
|
||||
api->halmac_reg_sdio_cmd53_read_n = sdio_reg_rn_88xx;
|
||||
api->halmac_sdio_cmd53_4byte = sdio_cmd53_4byte_88xx;
|
||||
api->halmac_sdio_hw_info = sdio_hw_info_88xx;
|
||||
api->halmac_en_ref_autok_pcie = en_ref_autok_sdio_88xx;
|
||||
|
||||
#endif
|
||||
} else if (adapter->intf == HALMAC_INTERFACE_USB) {
|
||||
@@ -344,6 +353,7 @@ mount_api_88xx(struct halmac_adapter *adapter)
|
||||
api->halmac_reg_write_32 = reg_w32_usb_88xx;
|
||||
api->halmac_reg_read_indirect_32 = usb_indirect_reg_r32_88xx;
|
||||
api->halmac_reg_sdio_cmd53_read_n = usb_reg_rn_88xx;
|
||||
api->halmac_en_ref_autok_pcie = en_ref_autok_usb_88xx;
|
||||
#endif
|
||||
} else if (adapter->intf == HALMAC_INTERFACE_PCIE) {
|
||||
#if HALMAC_PCIE_SUPPORT
|
||||
@@ -365,7 +375,7 @@ mount_api_88xx(struct halmac_adapter *adapter)
|
||||
api->halmac_reg_write_32 = reg_w32_pcie_88xx;
|
||||
api->halmac_reg_read_indirect_32 = pcie_indirect_reg_r32_88xx;
|
||||
api->halmac_reg_sdio_cmd53_read_n = pcie_reg_rn_88xx;
|
||||
api->halmac_en_ref_autok_pcie = en_ref_autok_88xx;
|
||||
api->halmac_en_ref_autok_pcie = en_ref_autok_pcie_88xx;
|
||||
#endif
|
||||
} else {
|
||||
PLTFM_MSG_ERR("[ERR]Set halmac io function Error!!\n");
|
||||
@@ -548,6 +558,7 @@ reset_ofld_feature_88xx(struct halmac_adapter *adapter,
|
||||
break;
|
||||
case HALMAC_FEATURE_DUMP_PHYSICAL_EFUSE:
|
||||
case HALMAC_FEATURE_DUMP_LOGICAL_EFUSE:
|
||||
case HALMAC_FEATURE_DUMP_LOGICAL_EFUSE_MASK:
|
||||
state->efuse_state.proc_status = HALMAC_CMD_PROCESS_IDLE;
|
||||
state->efuse_state.cmd_cnstr_state = HALMAC_CMD_CNSTR_IDLE;
|
||||
break;
|
||||
@@ -558,6 +569,12 @@ reset_ofld_feature_88xx(struct halmac_adapter *adapter,
|
||||
case HALMAC_FEATURE_UPDATE_PACKET:
|
||||
state->update_pkt_state.proc_status = HALMAC_CMD_PROCESS_IDLE;
|
||||
break;
|
||||
case HALMAC_FEATURE_SEND_SCAN_PACKET:
|
||||
state->scan_pkt_state.proc_status = HALMAC_CMD_PROCESS_IDLE;
|
||||
break;
|
||||
case HALMAC_FEATURE_DROP_SCAN_PACKET:
|
||||
state->drop_pkt_state.proc_status = HALMAC_CMD_PROCESS_IDLE;
|
||||
break;
|
||||
case HALMAC_FEATURE_IQK:
|
||||
state->iqk_state.proc_status = HALMAC_CMD_PROCESS_IDLE;
|
||||
break;
|
||||
@@ -579,6 +596,8 @@ reset_ofld_feature_88xx(struct halmac_adapter *adapter,
|
||||
state->scan_state.proc_status = HALMAC_CMD_PROCESS_IDLE;
|
||||
state->scan_state.cmd_cnstr_state = HALMAC_CMD_CNSTR_IDLE;
|
||||
state->update_pkt_state.proc_status = HALMAC_CMD_PROCESS_IDLE;
|
||||
state->scan_pkt_state.proc_status = HALMAC_CMD_PROCESS_IDLE;
|
||||
state->drop_pkt_state.proc_status = HALMAC_CMD_PROCESS_IDLE;
|
||||
state->iqk_state.proc_status = HALMAC_CMD_PROCESS_IDLE;
|
||||
state->pwr_trk_state.proc_status = HALMAC_CMD_PROCESS_IDLE;
|
||||
state->psd_state.proc_status = HALMAC_CMD_PROCESS_IDLE;
|
||||
@@ -867,4 +886,23 @@ rqpn_parser_88xx(struct halmac_adapter *adapter, enum halmac_trx_mode mode,
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
enum halmac_ret_status
|
||||
fwff_is_empty_88xx(struct halmac_adapter *adapter)
|
||||
{
|
||||
struct halmac_api *api = (struct halmac_api *)adapter->halmac_api;
|
||||
u32 cnt;
|
||||
|
||||
cnt = 5000;
|
||||
while (HALMAC_REG_R16(REG_FWFF_CTRL) !=
|
||||
HALMAC_REG_R16(REG_FWFF_PKT_INFO)) {
|
||||
if (cnt == 0) {
|
||||
PLTFM_MSG_ERR("[ERR]polling fwff empty fail\n");
|
||||
return HALMAC_RET_FWFF_NO_EMPTY;
|
||||
}
|
||||
cnt--;
|
||||
PLTFM_DELAY_US(50);
|
||||
}
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
#endif /* HALMAC_88XX_SUPPORT */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -57,6 +57,9 @@ rqpn_parser_88xx(struct halmac_adapter *adapter, enum halmac_trx_mode mode,
|
||||
void
|
||||
init_ofld_feature_state_machine_88xx(struct halmac_adapter *adapter);
|
||||
|
||||
enum halmac_ret_status
|
||||
fwff_is_empty_88xx(struct halmac_adapter *adapter);
|
||||
|
||||
#endif /* HALMAC_88XX_SUPPORT */
|
||||
|
||||
#endif/* _HALMAC_INIT_88XX_H_ */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#define TXBF_CTRL_CFG (BIT_R_ENABLE_NDPA | BIT_USE_NDPA_PARAMETER | \
|
||||
BIT_R_EN_NDPA_INT | BIT_DIS_NDP_BFEN)
|
||||
#define CSI_RATE_MAP 0x292911
|
||||
#define CSI_RATE_MAP 0x55
|
||||
|
||||
static void
|
||||
cfg_mu_bfee_88xx(struct halmac_adapter *adapter,
|
||||
@@ -63,8 +63,10 @@ cfg_txbf_88xx(struct halmac_adapter *adapter, u8 userid, enum halmac_bw bw,
|
||||
switch (bw) {
|
||||
case HALMAC_BW_80:
|
||||
tmp42c |= BIT_R_TXBF0_80M;
|
||||
/* fall through */
|
||||
case HALMAC_BW_40:
|
||||
tmp42c |= BIT_R_TXBF0_40M;
|
||||
/* fall through */
|
||||
case HALMAC_BW_20:
|
||||
tmp42c |= BIT_R_TXBF0_20M;
|
||||
break;
|
||||
@@ -234,7 +236,7 @@ cfg_sounding_88xx(struct halmac_adapter *adapter, enum halmac_snd_role role,
|
||||
{
|
||||
struct halmac_api *api = (struct halmac_api *)adapter->halmac_api;
|
||||
u32 tmp6dc = 0;
|
||||
u8 csi_rsc = 0x1;
|
||||
u8 csi_rsc = 0x0;
|
||||
|
||||
/*use ndpa rx rate to decide csi rate*/
|
||||
tmp6dc = HALMAC_REG_R32(REG_BBPSF_CTRL) | BIT_WMAC_USE_NDPARATE
|
||||
@@ -244,13 +246,12 @@ cfg_sounding_88xx(struct halmac_adapter *adapter, enum halmac_snd_role role,
|
||||
case HAL_BFER:
|
||||
HALMAC_REG_W32_SET(REG_TXBF_CTRL, TXBF_CTRL_CFG);
|
||||
HALMAC_REG_W8(REG_NDPA_RATE, rate);
|
||||
HALMAC_REG_W8_CLR(REG_NDPA_OPT_CTRL, BIT(0) | BIT(1));
|
||||
HALMAC_REG_W8(REG_SND_PTCL_CTRL + 1, 0x2 | BIT(7));
|
||||
HALMAC_REG_W8(REG_SND_PTCL_CTRL + 2, 0x2);
|
||||
break;
|
||||
case HAL_BFEE:
|
||||
HALMAC_REG_W8(REG_SND_PTCL_CTRL, 0xDB);
|
||||
HALMAC_REG_W8(REG_SND_PTCL_CTRL + 3, 0x26);
|
||||
HALMAC_REG_W8(REG_SND_PTCL_CTRL + 3, 0x3A);
|
||||
HALMAC_REG_W8_CLR(REG_RXFLTMAP1, BIT(4));
|
||||
HALMAC_REG_W8_CLR(REG_RXFLTMAP4, BIT(4));
|
||||
#if (HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
@@ -619,14 +620,15 @@ mu_bfer_entry_del_88xx(struct halmac_adapter *adapter)
|
||||
*/
|
||||
enum halmac_ret_status
|
||||
cfg_csi_rate_88xx(struct halmac_adapter *adapter, u8 rssi, u8 cur_rate,
|
||||
u8 fixrate_en, u8 *new_rate)
|
||||
u8 fixrate_en, u8 *new_rate, u8 *bmp_ofdm54)
|
||||
{
|
||||
u32 csi_cfg;
|
||||
u16 cur_rrsr;
|
||||
struct halmac_api *api = (struct halmac_api *)adapter->halmac_api;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
*bmp_ofdm54 = 0xFF;
|
||||
|
||||
#if HALMAC_8821C_SUPPORT
|
||||
if (adapter->chip_id == HALMAC_CHIP_ID_8821C && fixrate_en) {
|
||||
csi_cfg = HALMAC_REG_R32(REG_BBPSF_CTRL) & ~BITS_WMAC_CSI_RATE;
|
||||
@@ -643,22 +645,24 @@ cfg_csi_rate_88xx(struct halmac_adapter *adapter, u8 rssi, u8 cur_rate,
|
||||
csi_cfg = HALMAC_REG_R32(REG_BBPSF_CTRL) & ~BITS_WMAC_CSI_RATE;
|
||||
#endif
|
||||
|
||||
cur_rrsr = HALMAC_REG_R16(REG_RRSR);
|
||||
#if (HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
if (adapter->chip_id == HALMAC_CHIP_ID_8822C ||
|
||||
adapter->chip_id == HALMAC_CHIP_ID_8812F)
|
||||
HALMAC_REG_W32_SET(REG_BBPSF_CTRL, BIT(15));
|
||||
#endif
|
||||
|
||||
if (rssi >= 40) {
|
||||
if (cur_rate != HALMAC_OFDM54) {
|
||||
cur_rrsr |= BIT(HALMAC_OFDM54);
|
||||
csi_cfg |= BIT_WMAC_CSI_RATE(HALMAC_OFDM54);
|
||||
HALMAC_REG_W16(REG_RRSR, cur_rrsr);
|
||||
HALMAC_REG_W32(REG_BBPSF_CTRL, csi_cfg);
|
||||
*bmp_ofdm54 = 1;
|
||||
}
|
||||
*new_rate = HALMAC_OFDM54;
|
||||
} else {
|
||||
if (cur_rate != HALMAC_OFDM24) {
|
||||
cur_rrsr &= ~(BIT(HALMAC_OFDM54));
|
||||
csi_cfg |= BIT_WMAC_CSI_RATE(HALMAC_OFDM24);
|
||||
HALMAC_REG_W16(REG_RRSR, cur_rrsr);
|
||||
HALMAC_REG_W32(REG_BBPSF_CTRL, csi_cfg);
|
||||
*bmp_ofdm54 = 0;
|
||||
}
|
||||
*new_rate = HALMAC_OFDM24;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -64,7 +64,7 @@ mu_bfer_entry_del_88xx(struct halmac_adapter *adapter);
|
||||
|
||||
enum halmac_ret_status
|
||||
cfg_csi_rate_88xx(struct halmac_adapter *adapter, u8 rssi, u8 cur_rate,
|
||||
u8 fixrate_en, u8 *new_rate);
|
||||
u8 fixrate_en, u8 *new_rate, u8 *bmp_ofdm54);
|
||||
|
||||
enum halmac_ret_status
|
||||
fw_snding_88xx(struct halmac_adapter *adapter,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -517,4 +517,9 @@ usbphy_read_88xx(struct halmac_adapter *adapter, u8 addr, u8 speed)
|
||||
return value;
|
||||
}
|
||||
|
||||
enum halmac_ret_status
|
||||
en_ref_autok_usb_88xx(struct halmac_adapter *adapter, u8 en)
|
||||
{
|
||||
return HALMAC_RET_NOT_SUPPORT;
|
||||
}
|
||||
#endif /* HALMAC_88XX_SUPPORT */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* 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
|
||||
@@ -82,6 +82,9 @@ usbphy_write_88xx(struct halmac_adapter *adapter, u8 addr, u16 data, u8 speed);
|
||||
u16
|
||||
usbphy_read_88xx(struct halmac_adapter *adapter, u8 addr, u8 speed);
|
||||
|
||||
enum halmac_ret_status
|
||||
en_ref_autok_usb_88xx(struct halmac_adapter *adapter, u8 en);
|
||||
|
||||
#endif /* HALMAC_88XX_SUPPORT */
|
||||
|
||||
#endif/* _HALMAC_API_88XX_USB_H_ */
|
||||
|
||||
Reference in New Issue
Block a user