mirror of
https://github.com/torvalds/linux.git
synced 2024-11-20 11:01:38 +00:00
rtlwifi: rtl8723be: Update driver to match Realtek release of 06/28/14
This patch updates the driver to match the latest Realtek release, and it is an important step in getting the internal code source at Realtek to match the code in the kernel. The primary reason for this is to make it easier for Realtek to maintain the kernel source without requiring an intermediate like me. In this process of merging the two source repositories, there are a lot of changes in both, and this commit is rather large. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
0529c6b817
commit
5c99f04fec
@ -125,7 +125,7 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw,
|
||||
u32 rssi, total_rssi = 0;
|
||||
bool is_cck_rate;
|
||||
|
||||
is_cck_rate = RX_HAL_IS_CCK_RATE(pdesc);
|
||||
is_cck_rate = RX_HAL_IS_CCK_RATE(pdesc->rxmcs);
|
||||
pstats->packet_matchbssid = packet_match_bssid;
|
||||
pstats->packet_toself = packet_toself;
|
||||
pstats->is_cck = is_cck_rate;
|
||||
@ -361,7 +361,7 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw,
|
||||
stats->rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(pdesc);
|
||||
stats->is_ht = (bool)GET_RX_DESC_RXHT(pdesc);
|
||||
|
||||
stats->is_cck = RX_HAL_IS_CCK_RATE(pdesc);
|
||||
stats->is_cck = RX_HAL_IS_CCK_RATE(pdesc->rxmcs);
|
||||
|
||||
rx_status->freq = hw->conf.chandef.chan->center_freq;
|
||||
rx_status->band = hw->conf.chandef.chan->band;
|
||||
|
@ -786,7 +786,7 @@ static void _rtl92c_query_rxphystatus(struct ieee80211_hw *hw,
|
||||
bool is_cck_rate;
|
||||
u8 *pdesc = (u8 *)p_desc;
|
||||
|
||||
is_cck_rate = RX_HAL_IS_CCK_RATE(p_desc);
|
||||
is_cck_rate = RX_HAL_IS_CCK_RATE(p_desc->rxmcs);
|
||||
pstats->packet_matchbssid = packet_match_bssid;
|
||||
pstats->packet_toself = packet_toself;
|
||||
pstats->packet_beacon = packet_beacon;
|
||||
|
@ -127,7 +127,7 @@ static void _rtl92de_query_rxphystatus(struct ieee80211_hw *hw,
|
||||
u32 rssi, total_rssi = 0;
|
||||
bool is_cck_rate;
|
||||
|
||||
is_cck_rate = RX_HAL_IS_CCK_RATE(pdesc);
|
||||
is_cck_rate = RX_HAL_IS_CCK_RATE(pdesc->rxmcs);
|
||||
pstats->packet_matchbssid = packet_match_bssid;
|
||||
pstats->packet_toself = packet_toself;
|
||||
pstats->packet_beacon = packet_beacon;
|
||||
|
@ -34,7 +34,6 @@
|
||||
#define FW_8192C_END_ADDRESS 0x3FFF
|
||||
#define FW_8192C_PAGE_SIZE 4096
|
||||
#define FW_8192C_POLLING_DELAY 5
|
||||
#define FW_8192C_POLLING_TIMEOUT_COUNT 1000
|
||||
|
||||
#define IS_FW_HEADER_EXIST(_pfwhdr) \
|
||||
((_pfwhdr->signature&0xFFFF) == 0x2300 ||\
|
||||
|
@ -963,7 +963,7 @@ int rtl8723e_hw_init(struct ieee80211_hw *hw)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
err = rtl8723_download_fw(hw, false, FW_8192C_POLLING_TIMEOUT_COUNT);
|
||||
err = rtl8723_download_fw(hw, false, FW_8723A_POLLING_TIMEOUT_COUNT);
|
||||
if (err) {
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
|
||||
"Failed to download FW. Init HW without FW now..\n");
|
||||
|
@ -1157,16 +1157,6 @@ static bool _rtl8723e_phy_simularity_compare(struct ieee80211_hw *hw,
|
||||
|
||||
}
|
||||
|
||||
static void rtl8723_phy_save_adda_registers(struct ieee80211_hw *hw,
|
||||
u32 *addareg, u32 *addabackup,
|
||||
u32 registernum)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < registernum; i++)
|
||||
addabackup[i] = rtl_get_bbreg(hw, addareg[i], MASKDWORD);
|
||||
}
|
||||
|
||||
static void _rtl8723e_phy_iq_calibrate(struct ieee80211_hw *hw,
|
||||
long result[][8], u8 t, bool is2t)
|
||||
{
|
||||
@ -1192,8 +1182,8 @@ static void _rtl8723e_phy_iq_calibrate(struct ieee80211_hw *hw,
|
||||
if (t == 0) {
|
||||
bbvalue = rtl_get_bbreg(hw, 0x800, MASKDWORD);
|
||||
|
||||
rtl8723_phy_save_adda_registers(hw, adda_reg,
|
||||
rtlphy->adda_backup, 16);
|
||||
rtl8723_save_adda_registers(hw, adda_reg,
|
||||
rtlphy->adda_backup, 16);
|
||||
rtl8723_phy_save_mac_registers(hw, iqk_mac_reg,
|
||||
rtlphy->iqk_mac_backup);
|
||||
}
|
||||
@ -1472,8 +1462,8 @@ void rtl8723e_phy_iq_calibrate(struct ieee80211_hw *hw, bool b_recovery)
|
||||
rtl8723_phy_path_a_fill_iqk_matrix(hw, b_patha_ok, result,
|
||||
final_candidate,
|
||||
(reg_ea4 == 0));
|
||||
rtl8723_phy_save_adda_registers(hw, iqk_bb_reg,
|
||||
rtlphy->iqk_bb_backup, 10);
|
||||
rtl8723_save_adda_registers(hw, iqk_bb_reg,
|
||||
rtlphy->iqk_bb_backup, 10);
|
||||
}
|
||||
|
||||
void rtl8723e_phy_lc_calibrate(struct ieee80211_hw *hw)
|
||||
|
@ -463,7 +463,7 @@ bool rtl8723e_rx_query_desc(struct ieee80211_hw *hw,
|
||||
status->rx_is40Mhzpacket = (bool)GET_RX_DESC_BW(pdesc);
|
||||
status->is_ht = (bool)GET_RX_DESC_RXHT(pdesc);
|
||||
|
||||
status->is_cck = RTL8723E_RX_HAL_IS_CCK_RATE(status->rate);
|
||||
status->is_cck = RX_HAL_IS_CCK_RATE(status->rate);
|
||||
|
||||
rx_status->freq = hw->conf.chandef.chan->center_freq;
|
||||
rx_status->band = hw->conf.chandef.chan->band;
|
||||
|
@ -26,158 +26,24 @@
|
||||
#ifndef __RTL8723BE_DEF_H__
|
||||
#define __RTL8723BE_DEF_H__
|
||||
|
||||
#define HAL_RETRY_LIMIT_INFRA 48
|
||||
#define HAL_RETRY_LIMIT_AP_ADHOC 7
|
||||
|
||||
#define RESET_DELAY_8185 20
|
||||
|
||||
#define RT_IBSS_INT_MASKS (IMR_BCNINT | IMR_TBDOK | IMR_TBDER)
|
||||
#define RT_AC_INT_MASKS (IMR_VIDOK | IMR_VODOK | IMR_BEDOK|IMR_BKDOK)
|
||||
|
||||
#define NUM_OF_FIRMWARE_QUEUE 10
|
||||
#define NUM_OF_PAGES_IN_FW 0x100
|
||||
#define NUM_OF_PAGE_IN_FW_QUEUE_BK 0x07
|
||||
#define NUM_OF_PAGE_IN_FW_QUEUE_BE 0x07
|
||||
#define NUM_OF_PAGE_IN_FW_QUEUE_VI 0x07
|
||||
#define NUM_OF_PAGE_IN_FW_QUEUE_VO 0x07
|
||||
#define NUM_OF_PAGE_IN_FW_QUEUE_HCCA 0x0
|
||||
#define NUM_OF_PAGE_IN_FW_QUEUE_CMD 0x0
|
||||
#define NUM_OF_PAGE_IN_FW_QUEUE_MGNT 0x02
|
||||
#define NUM_OF_PAGE_IN_FW_QUEUE_HIGH 0x02
|
||||
#define NUM_OF_PAGE_IN_FW_QUEUE_BCN 0x2
|
||||
#define NUM_OF_PAGE_IN_FW_QUEUE_PUB 0xA1
|
||||
|
||||
#define NUM_OF_PAGE_IN_FW_QUEUE_BK_DTM 0x026
|
||||
#define NUM_OF_PAGE_IN_FW_QUEUE_BE_DTM 0x048
|
||||
#define NUM_OF_PAGE_IN_FW_QUEUE_VI_DTM 0x048
|
||||
#define NUM_OF_PAGE_IN_FW_QUEUE_VO_DTM 0x026
|
||||
#define NUM_OF_PAGE_IN_FW_QUEUE_PUB_DTM 0x00
|
||||
|
||||
#define MAX_LINES_HWCONFIG_TXT 1000
|
||||
#define MAX_BYTES_LINE_HWCONFIG_TXT 256
|
||||
|
||||
#define SW_THREE_WIRE 0
|
||||
#define HW_THREE_WIRE 2
|
||||
|
||||
#define BT_DEMO_BOARD 0
|
||||
#define BT_QA_BOARD 1
|
||||
#define BT_FPGA 2
|
||||
|
||||
#define HAL_PRIME_CHNL_OFFSET_DONT_CARE 0
|
||||
#define HAL_PRIME_CHNL_OFFSET_LOWER 1
|
||||
#define HAL_PRIME_CHNL_OFFSET_UPPER 2
|
||||
|
||||
#define MAX_H2C_QUEUE_NUM 10
|
||||
|
||||
#define RX_MPDU_QUEUE 0
|
||||
#define RX_CMD_QUEUE 1
|
||||
#define RX_MAX_QUEUE 2
|
||||
#define AC2QUEUEID(_AC) (_AC)
|
||||
#define CHIP_8723B (BIT(1) | BIT(2))
|
||||
#define NORMAL_CHIP BIT(3)
|
||||
#define CHIP_VENDOR_SMIC BIT(8)
|
||||
/* Currently only for RTL8723B */
|
||||
#define EXT_VENDOR_ID (BIT(18) | BIT(19))
|
||||
|
||||
#define C2H_RX_CMD_HDR_LEN 8
|
||||
#define GET_C2H_CMD_CMD_LEN(__prxhdr) \
|
||||
LE_BITS_TO_4BYTE((__prxhdr), 0, 16)
|
||||
#define GET_C2H_CMD_ELEMENT_ID(__prxhdr) \
|
||||
LE_BITS_TO_4BYTE((__prxhdr), 16, 8)
|
||||
#define GET_C2H_CMD_CMD_SEQ(__prxhdr) \
|
||||
LE_BITS_TO_4BYTE((__prxhdr), 24, 7)
|
||||
#define GET_C2H_CMD_CONTINUE(__prxhdr) \
|
||||
LE_BITS_TO_4BYTE((__prxhdr), 31, 1)
|
||||
#define GET_C2H_CMD_CONTENT(__prxhdr) \
|
||||
((u8 *)(__prxhdr) + C2H_RX_CMD_HDR_LEN)
|
||||
|
||||
#define GET_C2H_CMD_FEEDBACK_ELEMENT_ID(__pcmdfbhdr) \
|
||||
LE_BITS_TO_4BYTE((__pcmdfbhdr), 0, 8)
|
||||
#define GET_C2H_CMD_FEEDBACK_CCX_LEN(__pcmdfbhdr) \
|
||||
LE_BITS_TO_4BYTE((__pcmdfbhdr), 8, 8)
|
||||
#define GET_C2H_CMD_FEEDBACK_CCX_CMD_CNT(__pcmdfbhdr) \
|
||||
LE_BITS_TO_4BYTE((__pcmdfbhdr), 16, 16)
|
||||
#define GET_C2H_CMD_FEEDBACK_CCX_MAC_ID(__pcmdfbhdr) \
|
||||
LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 0, 5)
|
||||
#define GET_C2H_CMD_FEEDBACK_CCX_VALID(__pcmdfbhdr) \
|
||||
LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 7, 1)
|
||||
#define GET_C2H_CMD_FEEDBACK_CCX_RETRY_CNT(__pcmdfbhdr) \
|
||||
LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 8, 5)
|
||||
#define GET_C2H_CMD_FEEDBACK_CCX_TOK(__pcmdfbhdr) \
|
||||
LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 15, 1)
|
||||
#define GET_C2H_CMD_FEEDBACK_CCX_QSEL(__pcmdfbhdr) \
|
||||
LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 16, 4)
|
||||
#define GET_C2H_CMD_FEEDBACK_CCX_SEQ(__pcmdfbhdr) \
|
||||
LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 20, 12)
|
||||
|
||||
#define CHIP_BONDING_IDENTIFIER(_value) (((_value)>>22)&0x3)
|
||||
#define CHIP_BONDING_92C_1T2R 0x1
|
||||
|
||||
#define CHIP_8723 BIT(0)
|
||||
#define CHIP_8723B (BIT(1) | BIT(2))
|
||||
#define NORMAL_CHIP BIT(3)
|
||||
#define RF_TYPE_1T1R (~(BIT(4) | BIT(5) | BIT(6)))
|
||||
#define RF_TYPE_1T2R BIT(4)
|
||||
#define RF_TYPE_2T2R BIT(5)
|
||||
#define CHIP_VENDOR_UMC BIT(7)
|
||||
#define B_CUT_VERSION BIT(12)
|
||||
#define C_CUT_VERSION BIT(13)
|
||||
#define D_CUT_VERSION ((BIT(12) | BIT(13)))
|
||||
#define E_CUT_VERSION BIT(14)
|
||||
#define RF_RL_ID (BIT(31) | BIT(30) | BIT(29) | BIT(28))
|
||||
|
||||
/* MASK */
|
||||
#define IC_TYPE_MASK (BIT(0) | BIT(1) | BIT(2))
|
||||
#define CHIP_TYPE_MASK BIT(3)
|
||||
#define RF_TYPE_MASK (BIT(4) | BIT(5) | BIT(6))
|
||||
#define MANUFACTUER_MASK BIT(7)
|
||||
#define ROM_VERSION_MASK (BIT(11) | BIT(10) | BIT(9) | BIT(8))
|
||||
#define CUT_VERSION_MASK (BIT(15) | BIT(14) | BIT(13) | BIT(12))
|
||||
|
||||
/* Get element */
|
||||
#define GET_CVID_IC_TYPE(version) ((version) & IC_TYPE_MASK)
|
||||
#define GET_CVID_CHIP_TYPE(version) ((version) & CHIP_TYPE_MASK)
|
||||
#define GET_CVID_RF_TYPE(version) ((version) & RF_TYPE_MASK)
|
||||
#define GET_CVID_MANUFACTUER(version) ((version) & MANUFACTUER_MASK)
|
||||
#define GET_CVID_ROM_VERSION(version) ((version) & ROM_VERSION_MASK)
|
||||
#define GET_CVID_CUT_VERSION(version) ((version) & CUT_VERSION_MASK)
|
||||
|
||||
#define IS_92C_SERIAL(version) ((IS_81XXC(version) && IS_2T2R(version)) ?\
|
||||
true : false)
|
||||
#define IS_81XXC(version) ((GET_CVID_IC_TYPE(version) == 0) ?\
|
||||
true : false)
|
||||
#define IS_8723_SERIES(version) ((GET_CVID_IC_TYPE(version) == CHIP_8723) ?\
|
||||
true : false)
|
||||
#define IS_1T1R(version) ((GET_CVID_RF_TYPE(version)) ? false : true)
|
||||
#define IS_1T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T2R)\
|
||||
? true : false)
|
||||
#define IS_2T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_2T2R)\
|
||||
? true : false)
|
||||
enum rf_optype {
|
||||
RF_OP_BY_SW_3WIRE = 0,
|
||||
RF_OP_BY_FW,
|
||||
RF_OP_MAX
|
||||
};
|
||||
|
||||
enum rf_power_state {
|
||||
RF_ON,
|
||||
RF_OFF,
|
||||
RF_SLEEP,
|
||||
RF_SHUT_DOWN,
|
||||
};
|
||||
|
||||
enum power_save_mode {
|
||||
POWER_SAVE_MODE_ACTIVE,
|
||||
POWER_SAVE_MODE_SAVE,
|
||||
};
|
||||
|
||||
enum power_polocy_config {
|
||||
POWERCFG_MAX_POWER_SAVINGS,
|
||||
POWERCFG_GLOBAL_POWER_SAVINGS,
|
||||
POWERCFG_LOCAL_POWER_SAVINGS,
|
||||
POWERCFG_LENOVO,
|
||||
};
|
||||
|
||||
enum interface_select_pci {
|
||||
INTF_SEL1_MINICARD = 0,
|
||||
INTF_SEL0_PCIE = 1,
|
||||
INTF_SEL2_RSV = 2,
|
||||
INTF_SEL3_RSV = 3,
|
||||
enum rx_packet_type {
|
||||
NORMAL_RX,
|
||||
TX_REPORT1,
|
||||
TX_REPORT2,
|
||||
HIS_REPORT,
|
||||
C2H_PACKET,
|
||||
};
|
||||
|
||||
enum rtl_desc_qsel {
|
||||
@ -222,27 +88,5 @@ enum rtl_desc8723e_rate {
|
||||
DESC92C_RATEMCS13 = 0x19,
|
||||
DESC92C_RATEMCS14 = 0x1a,
|
||||
DESC92C_RATEMCS15 = 0x1b,
|
||||
DESC92C_RATEMCS15_SG = 0x1c,
|
||||
DESC92C_RATEMCS32 = 0x20,
|
||||
};
|
||||
|
||||
enum rx_packet_type {
|
||||
NORMAL_RX,
|
||||
TX_REPORT1,
|
||||
TX_REPORT2,
|
||||
HIS_REPORT,
|
||||
};
|
||||
|
||||
struct phy_sts_cck_8723e_t {
|
||||
u8 adc_pwdb_X[4];
|
||||
u8 sq_rpt;
|
||||
u8 cck_agc_rpt;
|
||||
};
|
||||
|
||||
struct h2c_cmd_8723e {
|
||||
u8 element_id;
|
||||
u32 cmd_len;
|
||||
u8 *p_cmdbuffer;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include "dm.h"
|
||||
#include "../rtl8723com/dm_common.h"
|
||||
#include "fw.h"
|
||||
#include "../rtl8723com/fw_common.h"
|
||||
#include "trx.h"
|
||||
#include "../btcoexist/rtl_btc.h"
|
||||
|
||||
@ -209,7 +208,7 @@ void rtl8723be_dm_txpower_track_adjust(struct ieee80211_hw *hw, u8 type,
|
||||
pwr_val = TXPWRTRACK_MAX_IDX;
|
||||
|
||||
*poutwrite_val = pwr_val | (pwr_val << 8) |
|
||||
(pwr_val << 16) | (pwr_val << 24);
|
||||
(pwr_val << 16) | (pwr_val << 24);
|
||||
}
|
||||
|
||||
static void rtl8723be_dm_diginit(struct ieee80211_hw *hw)
|
||||
@ -218,8 +217,7 @@ static void rtl8723be_dm_diginit(struct ieee80211_hw *hw)
|
||||
struct dig_t *dm_digtable = &rtlpriv->dm_digtable;
|
||||
|
||||
dm_digtable->dig_enable_flag = true;
|
||||
dm_digtable->cur_igvalue = rtl_get_bbreg(hw,
|
||||
ROFDM0_XAAGCCORE1, 0x7f);
|
||||
dm_digtable->cur_igvalue = rtl_get_bbreg(hw, ROFDM0_XAAGCCORE1, 0x7f);
|
||||
dm_digtable->rssi_lowthresh = DM_DIG_THRESH_LOW;
|
||||
dm_digtable->rssi_highthresh = DM_DIG_THRESH_HIGH;
|
||||
dm_digtable->fa_lowthresh = DM_FALSEALARM_THRESH_LOW;
|
||||
@ -234,8 +232,8 @@ static void rtl8723be_dm_diginit(struct ieee80211_hw *hw)
|
||||
dm_digtable->forbidden_igi = DM_DIG_MIN;
|
||||
dm_digtable->large_fa_hit = 0;
|
||||
dm_digtable->recover_cnt = 0;
|
||||
dm_digtable->dig_min_0 = DM_DIG_MIN;
|
||||
dm_digtable->dig_min_1 = DM_DIG_MIN;
|
||||
dm_digtable->dig_dynamic_min = DM_DIG_MIN;
|
||||
dm_digtable->dig_dynamic_min_1 = DM_DIG_MIN;
|
||||
dm_digtable->media_connect_0 = false;
|
||||
dm_digtable->media_connect_1 = false;
|
||||
rtlpriv->dm.dm_initialgain_enable = true;
|
||||
@ -245,18 +243,18 @@ static void rtl8723be_dm_diginit(struct ieee80211_hw *hw)
|
||||
void rtl8723be_dm_init_rate_adaptive_mask(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rate_adaptive *ra = &(rtlpriv->ra);
|
||||
struct rate_adaptive *p_ra = &rtlpriv->ra;
|
||||
|
||||
ra->ratr_state = DM_RATR_STA_INIT;
|
||||
ra->pre_ratr_state = DM_RATR_STA_INIT;
|
||||
p_ra->ratr_state = DM_RATR_STA_INIT;
|
||||
p_ra->pre_ratr_state = DM_RATR_STA_INIT;
|
||||
|
||||
if (rtlpriv->dm.dm_type == DM_TYPE_BYDRIVER)
|
||||
rtlpriv->dm.useramask = true;
|
||||
else
|
||||
rtlpriv->dm.useramask = false;
|
||||
|
||||
ra->high_rssi_thresh_for_ra = 50;
|
||||
ra->low_rssi_thresh_for_ra40m = 20;
|
||||
p_ra->high_rssi_thresh_for_ra = 50;
|
||||
p_ra->low_rssi_thresh_for_ra40m = 20;
|
||||
}
|
||||
|
||||
static void rtl8723be_dm_init_txpower_tracking(struct ieee80211_hw *hw)
|
||||
@ -279,7 +277,7 @@ static void rtl8723be_dm_init_txpower_tracking(struct ieee80211_hw *hw)
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
|
||||
" rtlpriv->dm.txpower_tracking = %d\n",
|
||||
rtlpriv->dm.txpower_tracking);
|
||||
rtlpriv->dm.txpower_tracking);
|
||||
}
|
||||
|
||||
static void rtl8723be_dm_init_dynamic_atc_switch(struct ieee80211_hw *hw)
|
||||
@ -287,6 +285,7 @@ static void rtl8723be_dm_init_dynamic_atc_switch(struct ieee80211_hw *hw)
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
|
||||
rtlpriv->dm.crystal_cap = rtlpriv->efuse.crystalcap;
|
||||
|
||||
rtlpriv->dm.atc_status = rtl_get_bbreg(hw, ROFDM1_CFOTRACKING, 0x800);
|
||||
rtlpriv->dm.cfo_threshold = CFO_THRESHOLD_XTAL;
|
||||
}
|
||||
@ -308,7 +307,7 @@ void rtl8723be_dm_init(struct ieee80211_hw *hw)
|
||||
static void rtl8723be_dm_find_minimum_rssi(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct dig_t *rtl_dm_dig = &(rtlpriv->dm_digtable);
|
||||
struct dig_t *rtl_dm_dig = &rtlpriv->dm_digtable;
|
||||
struct rtl_mac *mac = rtl_mac(rtlpriv);
|
||||
|
||||
/* Determine the minimum RSSI */
|
||||
@ -325,20 +324,20 @@ static void rtl8723be_dm_find_minimum_rssi(struct ieee80211_hw *hw)
|
||||
rtlpriv->dm.entry_min_undec_sm_pwdb;
|
||||
RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD,
|
||||
"AP Client PWDB = 0x%lx\n",
|
||||
rtlpriv->dm.entry_min_undec_sm_pwdb);
|
||||
rtlpriv->dm.entry_min_undec_sm_pwdb);
|
||||
} else {
|
||||
rtl_dm_dig->min_undec_pwdb_for_dm =
|
||||
rtlpriv->dm.undec_sm_pwdb;
|
||||
RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD,
|
||||
"STA Default Port PWDB = 0x%x\n",
|
||||
rtl_dm_dig->min_undec_pwdb_for_dm);
|
||||
rtl_dm_dig->min_undec_pwdb_for_dm);
|
||||
}
|
||||
} else {
|
||||
rtl_dm_dig->min_undec_pwdb_for_dm =
|
||||
rtlpriv->dm.entry_min_undec_sm_pwdb;
|
||||
RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD,
|
||||
"AP Ext Port or disconnet PWDB = 0x%x\n",
|
||||
rtl_dm_dig->min_undec_pwdb_for_dm);
|
||||
rtl_dm_dig->min_undec_pwdb_for_dm);
|
||||
}
|
||||
RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "MinUndecoratedPWDBForDM =%d\n",
|
||||
rtl_dm_dig->min_undec_pwdb_for_dm);
|
||||
@ -347,6 +346,7 @@ static void rtl8723be_dm_find_minimum_rssi(struct ieee80211_hw *hw)
|
||||
static void rtl8723be_dm_check_rssi_monitor(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct dig_t *dm_digtable = &rtlpriv->dm_digtable;
|
||||
struct rtl_sta_info *drv_priv;
|
||||
u8 h2c_parameter[3] = { 0 };
|
||||
long tmp_entry_max_pwdb = 0, tmp_entry_min_pwdb = 0xff;
|
||||
@ -367,69 +367,78 @@ static void rtl8723be_dm_check_rssi_monitor(struct ieee80211_hw *hw)
|
||||
|
||||
/* If associated entry is found */
|
||||
if (tmp_entry_max_pwdb != 0) {
|
||||
rtlpriv->dm.entry_max_undec_sm_pwdb = tmp_entry_max_pwdb;
|
||||
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
|
||||
"EntryMaxPWDB = 0x%lx(%ld)\n",
|
||||
rtlpriv->dm.entry_max_undec_sm_pwdb =
|
||||
tmp_entry_max_pwdb;
|
||||
RTPRINT(rtlpriv, FDM, DM_PWDB,
|
||||
"EntryMaxPWDB = 0x%lx(%ld)\n",
|
||||
tmp_entry_max_pwdb, tmp_entry_max_pwdb);
|
||||
} else {
|
||||
rtlpriv->dm.entry_max_undec_sm_pwdb = 0;
|
||||
}
|
||||
/* If associated entry is found */
|
||||
if (tmp_entry_min_pwdb != 0xff) {
|
||||
rtlpriv->dm.entry_min_undec_sm_pwdb = tmp_entry_min_pwdb;
|
||||
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
|
||||
"EntryMinPWDB = 0x%lx(%ld)\n",
|
||||
rtlpriv->dm.entry_min_undec_sm_pwdb =
|
||||
tmp_entry_min_pwdb;
|
||||
RTPRINT(rtlpriv, FDM, DM_PWDB,
|
||||
"EntryMinPWDB = 0x%lx(%ld)\n",
|
||||
tmp_entry_min_pwdb, tmp_entry_min_pwdb);
|
||||
} else {
|
||||
rtlpriv->dm.entry_min_undec_sm_pwdb = 0;
|
||||
}
|
||||
/* Indicate Rx signal strength to FW. */
|
||||
if (rtlpriv->dm.useramask) {
|
||||
h2c_parameter[2] = (u8) (rtlpriv->dm.undec_sm_pwdb & 0xFF);
|
||||
h2c_parameter[2] =
|
||||
(u8)(rtlpriv->dm.undec_sm_pwdb & 0xFF);
|
||||
h2c_parameter[1] = 0x20;
|
||||
h2c_parameter[0] = 0;
|
||||
rtl8723be_fill_h2c_cmd(hw, H2C_RSSI_REPORT, 3, h2c_parameter);
|
||||
rtl8723be_fill_h2c_cmd(hw, H2C_RSSIBE_REPORT, 3, h2c_parameter);
|
||||
} else {
|
||||
rtl_write_byte(rtlpriv, 0x4fe, rtlpriv->dm.undec_sm_pwdb);
|
||||
rtl_write_byte(rtlpriv, 0x4fe,
|
||||
rtlpriv->dm.undec_sm_pwdb);
|
||||
}
|
||||
rtl8723be_dm_find_minimum_rssi(hw);
|
||||
rtlpriv->dm_digtable.rssi_val_min =
|
||||
rtlpriv->dm_digtable.min_undec_pwdb_for_dm;
|
||||
dm_digtable->rssi_val_min =
|
||||
rtlpriv->dm_digtable.min_undec_pwdb_for_dm;
|
||||
}
|
||||
|
||||
void rtl8723be_dm_write_dig(struct ieee80211_hw *hw, u8 current_igi)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct dig_t *dm_digtable = &rtlpriv->dm_digtable;
|
||||
|
||||
if (rtlpriv->dm_digtable.cur_igvalue != current_igi) {
|
||||
if (dm_digtable->stop_dig)
|
||||
return;
|
||||
|
||||
if (dm_digtable->cur_igvalue != current_igi) {
|
||||
rtl_set_bbreg(hw, ROFDM0_XAAGCCORE1, 0x7f, current_igi);
|
||||
if (rtlpriv->phy.rf_type != RF_1T1R)
|
||||
rtl_set_bbreg(hw, ROFDM0_XBAGCCORE1, 0x7f, current_igi);
|
||||
rtl_set_bbreg(hw, ROFDM0_XBAGCCORE1,
|
||||
0x7f, current_igi);
|
||||
}
|
||||
rtlpriv->dm_digtable.pre_igvalue = rtlpriv->dm_digtable.cur_igvalue;
|
||||
rtlpriv->dm_digtable.cur_igvalue = current_igi;
|
||||
dm_digtable->pre_igvalue = dm_digtable->cur_igvalue;
|
||||
dm_digtable->cur_igvalue = current_igi;
|
||||
}
|
||||
|
||||
static void rtl8723be_dm_dig(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct dig_t *dm_digtable = &rtlpriv->dm_digtable;
|
||||
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
|
||||
struct dig_t *dm_digtable = &(rtlpriv->dm_digtable);
|
||||
u8 dig_dynamic_min, dig_maxofmin;
|
||||
bool firstconnect, firstdisconnect;
|
||||
bool bfirstconnect, bfirstdisconnect;
|
||||
u8 dm_dig_max, dm_dig_min;
|
||||
u8 current_igi = dm_digtable->cur_igvalue;
|
||||
u8 offset;
|
||||
|
||||
/* AP, BT */
|
||||
/* AP,BT */
|
||||
if (mac->act_scanning)
|
||||
return;
|
||||
|
||||
dig_dynamic_min = dm_digtable->dig_min_0;
|
||||
firstconnect = (mac->link_state >= MAC80211_LINKED) &&
|
||||
dig_dynamic_min = dm_digtable->dig_dynamic_min;
|
||||
bfirstconnect = (mac->link_state >= MAC80211_LINKED) &&
|
||||
!dm_digtable->media_connect_0;
|
||||
firstdisconnect = (mac->link_state < MAC80211_LINKED) &&
|
||||
dm_digtable->media_connect_0;
|
||||
bfirstdisconnect = (mac->link_state < MAC80211_LINKED) &&
|
||||
(dm_digtable->media_connect_0);
|
||||
|
||||
dm_dig_max = 0x5a;
|
||||
dm_dig_min = DM_DIG_MIN;
|
||||
@ -457,6 +466,7 @@ static void rtl8723be_dm_dig(struct ieee80211_hw *hw)
|
||||
} else {
|
||||
dig_dynamic_min = dm_dig_min;
|
||||
}
|
||||
|
||||
} else {
|
||||
dm_digtable->rx_gain_max = dm_dig_max;
|
||||
dig_dynamic_min = dm_dig_min;
|
||||
@ -506,7 +516,7 @@ static void rtl8723be_dm_dig(struct ieee80211_hw *hw)
|
||||
dm_digtable->rx_gain_min = dm_digtable->rx_gain_max;
|
||||
|
||||
if (mac->link_state >= MAC80211_LINKED) {
|
||||
if (firstconnect) {
|
||||
if (bfirstconnect) {
|
||||
if (dm_digtable->rssi_val_min <= dig_maxofmin)
|
||||
current_igi = dm_digtable->rssi_val_min;
|
||||
else
|
||||
@ -522,7 +532,7 @@ static void rtl8723be_dm_dig(struct ieee80211_hw *hw)
|
||||
current_igi -= 2;
|
||||
}
|
||||
} else {
|
||||
if (firstdisconnect) {
|
||||
if (bfirstdisconnect) {
|
||||
current_igi = dm_digtable->rx_gain_min;
|
||||
} else {
|
||||
if (rtlpriv->falsealm_cnt.cnt_all > 10000)
|
||||
@ -542,14 +552,15 @@ static void rtl8723be_dm_dig(struct ieee80211_hw *hw)
|
||||
rtl8723be_dm_write_dig(hw, current_igi);
|
||||
dm_digtable->media_connect_0 =
|
||||
((mac->link_state >= MAC80211_LINKED) ? true : false);
|
||||
dm_digtable->dig_min_0 = dig_dynamic_min;
|
||||
dm_digtable->dig_dynamic_min = dig_dynamic_min;
|
||||
}
|
||||
|
||||
static void rtl8723be_dm_false_alarm_counter_statistics(struct ieee80211_hw *hw)
|
||||
static void rtl8723be_dm_false_alarm_counter_statistics(
|
||||
struct ieee80211_hw *hw)
|
||||
{
|
||||
u32 ret_value;
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct false_alarm_statistics *falsealm_cnt = &(rtlpriv->falsealm_cnt);
|
||||
struct false_alarm_statistics *falsealm_cnt = &rtlpriv->falsealm_cnt;
|
||||
|
||||
rtl_set_bbreg(hw, DM_REG_OFDM_FA_HOLDC_11N, BIT(31), 1);
|
||||
rtl_set_bbreg(hw, DM_REG_OFDM_FA_RSTD_11N, BIT(31), 1);
|
||||
@ -615,16 +626,14 @@ static void rtl8723be_dm_false_alarm_counter_statistics(struct ieee80211_hw *hw)
|
||||
rtl_set_bbreg(hw, DM_REG_CCK_FA_RST_11N, BIT(15) | BIT(14), 2);
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE,
|
||||
"cnt_parity_fail = %d, cnt_rate_illegal = %d, "
|
||||
"cnt_crc8_fail = %d, cnt_mcs_fail = %d\n",
|
||||
"cnt_parity_fail = %d, cnt_rate_illegal = %d, cnt_crc8_fail = %d, cnt_mcs_fail = %d\n",
|
||||
falsealm_cnt->cnt_parity_fail,
|
||||
falsealm_cnt->cnt_rate_illegal,
|
||||
falsealm_cnt->cnt_crc8_fail,
|
||||
falsealm_cnt->cnt_mcs_fail);
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE,
|
||||
"cnt_ofdm_fail = %x, cnt_cck_fail = %x,"
|
||||
" cnt_all = %x\n",
|
||||
"cnt_ofdm_fail = %x, cnt_cck_fail = %x, cnt_all = %x\n",
|
||||
falsealm_cnt->cnt_ofdm_fail,
|
||||
falsealm_cnt->cnt_cck_fail,
|
||||
falsealm_cnt->cnt_all);
|
||||
@ -690,7 +699,7 @@ static void rtl8723be_dm_tx_power_track_set_power(struct ieee80211_hw *hw,
|
||||
u8 rfpath, u8 idx)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_phy *rtlphy = &(rtlpriv->phy);
|
||||
struct rtl_phy *rtlphy = &rtlpriv->phy;
|
||||
struct rtl_dm *rtldm = rtl_dm(rtl_priv(hw));
|
||||
u8 swing_idx_ofdm_limit = 36;
|
||||
|
||||
@ -762,7 +771,8 @@ static void rtl8723be_dm_tx_power_track_set_power(struct ieee80211_hw *hw,
|
||||
}
|
||||
}
|
||||
|
||||
static void txpwr_track_cb_therm(struct ieee80211_hw *hw)
|
||||
static void rtl8723be_dm_txpower_tracking_callback_thermalmeter(
|
||||
struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
|
||||
@ -773,30 +783,29 @@ static void txpwr_track_cb_therm(struct ieee80211_hw *hw)
|
||||
int i = 0;
|
||||
|
||||
u8 ofdm_min_index = 6;
|
||||
u8 index = 0;
|
||||
u8 index_for_channel = 0;
|
||||
|
||||
char delta_swing_table_idx_tup_a[] = {
|
||||
char delta_swing_table_idx_tup_a[TXSCALE_TABLE_SIZE] = {
|
||||
0, 0, 1, 2, 2, 2, 3, 3, 3, 4, 5,
|
||||
5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10,
|
||||
10, 11, 11, 12, 12, 13, 14, 15};
|
||||
char delta_swing_table_idx_tdown_a[] = {
|
||||
char delta_swing_table_idx_tdown_a[TXSCALE_TABLE_SIZE] = {
|
||||
0, 0, 1, 2, 2, 2, 3, 3, 3, 4, 5,
|
||||
5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 9,
|
||||
9, 10, 10, 11, 12, 13, 14, 15};
|
||||
|
||||
/*Initilization ( 7 steps in total)*/
|
||||
/*Initilization ( 7 steps in total )*/
|
||||
rtlpriv->dm.txpower_trackinginit = true;
|
||||
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
|
||||
"rtl8723be_dm_txpower_tracking"
|
||||
"_callback_thermalmeter\n");
|
||||
"rtl8723be_dm_txpower_tracking_callback_thermalmeter\n");
|
||||
|
||||
thermalvalue = (u8)rtl_get_rfreg(hw, RF90_PATH_A, RF_T_METER, 0xfc00);
|
||||
thermalvalue = (u8)rtl_get_rfreg(hw,
|
||||
RF90_PATH_A, RF_T_METER, 0xfc00);
|
||||
if (!rtlpriv->dm.txpower_track_control || thermalvalue == 0 ||
|
||||
rtlefuse->eeprom_thermalmeter == 0xFF)
|
||||
return;
|
||||
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
|
||||
"Readback Thermal Meter = 0x%x pre thermal meter 0x%x "
|
||||
"eeprom_thermalmeter 0x%x\n",
|
||||
"Readback Thermal Meter = 0x%x pre thermal meter 0x%x eeprom_thermalmeter 0x%x\n",
|
||||
thermalvalue, rtldm->thermalvalue,
|
||||
rtlefuse->eeprom_thermalmeter);
|
||||
/*3 Initialize ThermalValues of RFCalibrateInfo*/
|
||||
@ -833,9 +842,7 @@ static void txpwr_track_cb_therm(struct ieee80211_hw *hw)
|
||||
(rtlpriv->dm.thermalvalue_iqk - thermalvalue);
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
|
||||
"Readback Thermal Meter = 0x%x pre thermal meter 0x%x "
|
||||
"eeprom_thermalmeter 0x%x delta 0x%x "
|
||||
"delta_lck 0x%x delta_iqk 0x%x\n",
|
||||
"Readback Thermal Meter = 0x%x pre thermal meter 0x%x eeprom_thermalmeter 0x%x delta 0x%x delta_lck 0x%x delta_iqk 0x%x\n",
|
||||
thermalvalue, rtlpriv->dm.thermalvalue,
|
||||
rtlefuse->eeprom_thermalmeter, delta, delta_lck, delta_iqk);
|
||||
/* 6 If necessary, do LCK.*/
|
||||
@ -905,10 +912,10 @@ static void txpwr_track_cb_therm(struct ieee80211_hw *hw)
|
||||
rtldm->done_txpower = true;
|
||||
if (thermalvalue > rtlefuse->eeprom_thermalmeter)
|
||||
rtl8723be_dm_tx_power_track_set_power(hw, BBSWING, 0,
|
||||
index);
|
||||
index_for_channel);
|
||||
else
|
||||
rtl8723be_dm_tx_power_track_set_power(hw, BBSWING, 0,
|
||||
index);
|
||||
index_for_channel);
|
||||
|
||||
rtldm->swing_idx_cck_base = rtldm->swing_idx_cck;
|
||||
rtldm->swing_idx_ofdm_base[RF90_PATH_A] =
|
||||
@ -923,6 +930,7 @@ static void txpwr_track_cb_therm(struct ieee80211_hw *hw)
|
||||
|
||||
rtldm->txpowercount = 0;
|
||||
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "end\n");
|
||||
|
||||
}
|
||||
|
||||
void rtl8723be_dm_check_txpower_tracking(struct ieee80211_hw *hw)
|
||||
@ -943,7 +951,7 @@ void rtl8723be_dm_check_txpower_tracking(struct ieee80211_hw *hw)
|
||||
} else {
|
||||
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
|
||||
"Schedule TxPowerTracking !!\n");
|
||||
txpwr_track_cb_therm(hw);
|
||||
rtl8723be_dm_txpower_tracking_callback_thermalmeter(hw);
|
||||
tm_trigger = 0;
|
||||
}
|
||||
}
|
||||
@ -953,11 +961,11 @@ static void rtl8723be_dm_refresh_rate_adaptive_mask(struct ieee80211_hw *hw)
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
|
||||
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
|
||||
struct rate_adaptive *ra = &(rtlpriv->ra);
|
||||
struct ieee80211_sta *sta = NULL;
|
||||
u32 low_rssithresh_for_ra = ra->low2high_rssi_thresh_for_ra40m;
|
||||
u32 high_rssithresh_for_ra = ra->high_rssi_thresh_for_ra;
|
||||
struct rate_adaptive *p_ra = &rtlpriv->ra;
|
||||
u32 low_rssithresh_for_ra = p_ra->low2high_rssi_thresh_for_ra40m;
|
||||
u32 high_rssithresh_for_ra = p_ra->high_rssi_thresh_for_ra;
|
||||
u8 go_up_gap = 5;
|
||||
struct ieee80211_sta *sta = NULL;
|
||||
|
||||
if (is_hal_stop(rtlhal)) {
|
||||
RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD,
|
||||
@ -972,8 +980,8 @@ static void rtl8723be_dm_refresh_rate_adaptive_mask(struct ieee80211_hw *hw)
|
||||
}
|
||||
|
||||
if (mac->link_state == MAC80211_LINKED &&
|
||||
mac->opmode == NL80211_IFTYPE_STATION) {
|
||||
switch (ra->pre_ratr_state) {
|
||||
mac->opmode == NL80211_IFTYPE_STATION) {
|
||||
switch (p_ra->pre_ratr_state) {
|
||||
case DM_RATR_STA_MIDDLE:
|
||||
high_rssithresh_for_ra += go_up_gap;
|
||||
break;
|
||||
@ -987,31 +995,31 @@ static void rtl8723be_dm_refresh_rate_adaptive_mask(struct ieee80211_hw *hw)
|
||||
|
||||
if (rtlpriv->dm.undec_sm_pwdb >
|
||||
(long)high_rssithresh_for_ra)
|
||||
ra->ratr_state = DM_RATR_STA_HIGH;
|
||||
p_ra->ratr_state = DM_RATR_STA_HIGH;
|
||||
else if (rtlpriv->dm.undec_sm_pwdb >
|
||||
(long)low_rssithresh_for_ra)
|
||||
ra->ratr_state = DM_RATR_STA_MIDDLE;
|
||||
p_ra->ratr_state = DM_RATR_STA_MIDDLE;
|
||||
else
|
||||
ra->ratr_state = DM_RATR_STA_LOW;
|
||||
p_ra->ratr_state = DM_RATR_STA_LOW;
|
||||
|
||||
if (ra->pre_ratr_state != ra->ratr_state) {
|
||||
if (p_ra->pre_ratr_state != p_ra->ratr_state) {
|
||||
RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD,
|
||||
"RSSI = %ld\n",
|
||||
rtlpriv->dm.undec_sm_pwdb);
|
||||
RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD,
|
||||
"RSSI_LEVEL = %d\n", ra->ratr_state);
|
||||
"RSSI_LEVEL = %d\n", p_ra->ratr_state);
|
||||
RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD,
|
||||
"PreState = %d, CurState = %d\n",
|
||||
ra->pre_ratr_state, ra->ratr_state);
|
||||
p_ra->pre_ratr_state, p_ra->ratr_state);
|
||||
|
||||
rcu_read_lock();
|
||||
sta = rtl_find_sta(hw, mac->bssid);
|
||||
if (sta)
|
||||
rtlpriv->cfg->ops->update_rate_tbl(hw, sta,
|
||||
ra->ratr_state);
|
||||
p_ra->ratr_state);
|
||||
rcu_read_unlock();
|
||||
|
||||
ra->pre_ratr_state = ra->ratr_state;
|
||||
p_ra->pre_ratr_state = p_ra->ratr_state;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1020,10 +1028,6 @@ static bool rtl8723be_dm_is_edca_turbo_disable(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
|
||||
if (rtlpriv->cfg->ops->get_btc_status()) {
|
||||
if (rtlpriv->btcoexist.btc_ops->btc_is_disable_edca_turbo(rtlpriv))
|
||||
return true;
|
||||
}
|
||||
if (rtlpriv->mac80211.mode == WIRELESS_MODE_B)
|
||||
return true;
|
||||
|
||||
@ -1034,6 +1038,7 @@ static void rtl8723be_dm_check_edca_turbo(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
|
||||
|
||||
static u64 last_txok_cnt;
|
||||
static u64 last_rxok_cnt;
|
||||
u64 cur_txok_cnt = 0;
|
||||
@ -1042,22 +1047,22 @@ static void rtl8723be_dm_check_edca_turbo(struct ieee80211_hw *hw)
|
||||
u32 edca_be_dl = 0x6ea42b;/*not sure*/
|
||||
u32 edca_be = 0x5ea42b;
|
||||
u32 iot_peer = 0;
|
||||
bool is_cur_rdlstate;
|
||||
bool last_is_cur_rdlstate = false;
|
||||
bool bias_on_rx = false;
|
||||
bool edca_turbo_on = false;
|
||||
bool b_is_cur_rdlstate;
|
||||
bool b_last_is_cur_rdlstate = false;
|
||||
bool b_bias_on_rx = false;
|
||||
bool b_edca_turbo_on = false;
|
||||
|
||||
last_is_cur_rdlstate = rtlpriv->dm.is_cur_rdlstate;
|
||||
b_last_is_cur_rdlstate = rtlpriv->dm.is_cur_rdlstate;
|
||||
|
||||
cur_txok_cnt = rtlpriv->stats.txbytesunicast - last_txok_cnt;
|
||||
cur_rxok_cnt = rtlpriv->stats.rxbytesunicast - last_rxok_cnt;
|
||||
|
||||
iot_peer = rtlpriv->mac80211.vendor;
|
||||
bias_on_rx = (iot_peer == PEER_RAL || iot_peer == PEER_ATH) ?
|
||||
true : false;
|
||||
edca_turbo_on = ((!rtlpriv->dm.is_any_nonbepkts) &&
|
||||
(!rtlpriv->dm.disable_framebursting)) ?
|
||||
true : false;
|
||||
b_bias_on_rx = (iot_peer == PEER_RAL || iot_peer == PEER_ATH) ?
|
||||
true : false;
|
||||
b_edca_turbo_on = ((!rtlpriv->dm.is_any_nonbepkts) &&
|
||||
(!rtlpriv->dm.disable_framebursting)) ?
|
||||
true : false;
|
||||
|
||||
if ((iot_peer == PEER_CISCO) &&
|
||||
(mac->mode == WIRELESS_MODE_N_24G)) {
|
||||
@ -1067,23 +1072,23 @@ static void rtl8723be_dm_check_edca_turbo(struct ieee80211_hw *hw)
|
||||
if (rtl8723be_dm_is_edca_turbo_disable(hw))
|
||||
goto exit;
|
||||
|
||||
if (edca_turbo_on) {
|
||||
if (bias_on_rx)
|
||||
is_cur_rdlstate = (cur_txok_cnt > cur_rxok_cnt * 4) ?
|
||||
false : true;
|
||||
if (b_edca_turbo_on) {
|
||||
if (b_bias_on_rx)
|
||||
b_is_cur_rdlstate = (cur_txok_cnt > cur_rxok_cnt * 4) ?
|
||||
false : true;
|
||||
else
|
||||
is_cur_rdlstate = (cur_rxok_cnt > cur_txok_cnt * 4) ?
|
||||
true : false;
|
||||
b_is_cur_rdlstate = (cur_rxok_cnt > cur_txok_cnt * 4) ?
|
||||
true : false;
|
||||
|
||||
edca_be = (is_cur_rdlstate) ? edca_be_dl : edca_be_ul;
|
||||
edca_be = (b_is_cur_rdlstate) ? edca_be_dl : edca_be_ul;
|
||||
rtl_write_dword(rtlpriv, REG_EDCA_BE_PARAM, edca_be);
|
||||
rtlpriv->dm.is_cur_rdlstate = is_cur_rdlstate;
|
||||
rtlpriv->dm.is_cur_rdlstate = b_is_cur_rdlstate;
|
||||
rtlpriv->dm.current_turbo_edca = true;
|
||||
} else {
|
||||
if (rtlpriv->dm.current_turbo_edca) {
|
||||
u8 tmp = AC0_BE;
|
||||
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AC_PARAM,
|
||||
&tmp);
|
||||
(u8 *)(&tmp));
|
||||
}
|
||||
rtlpriv->dm.current_turbo_edca = false;
|
||||
}
|
||||
@ -1097,13 +1102,14 @@ exit:
|
||||
static void rtl8723be_dm_cck_packet_detection_thresh(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct dig_t *dm_digtable = &rtlpriv->dm_digtable;
|
||||
u8 cur_cck_cca_thresh;
|
||||
|
||||
if (rtlpriv->mac80211.link_state >= MAC80211_LINKED) {
|
||||
if (rtlpriv->dm_digtable.rssi_val_min > 25) {
|
||||
if (dm_digtable->rssi_val_min > 25) {
|
||||
cur_cck_cca_thresh = 0xcd;
|
||||
} else if ((rtlpriv->dm_digtable.rssi_val_min <= 25) &&
|
||||
(rtlpriv->dm_digtable.rssi_val_min > 10)) {
|
||||
} else if ((dm_digtable->rssi_val_min <= 25) &&
|
||||
(dm_digtable->rssi_val_min > 10)) {
|
||||
cur_cck_cca_thresh = 0x83;
|
||||
} else {
|
||||
if (rtlpriv->falsealm_cnt.cnt_cck_fail > 1000)
|
||||
@ -1118,14 +1124,13 @@ static void rtl8723be_dm_cck_packet_detection_thresh(struct ieee80211_hw *hw)
|
||||
cur_cck_cca_thresh = 0x40;
|
||||
}
|
||||
|
||||
if (rtlpriv->dm_digtable.cur_cck_cca_thres != cur_cck_cca_thresh)
|
||||
if (dm_digtable->cur_cck_cca_thres != cur_cck_cca_thresh)
|
||||
rtl_set_bbreg(hw, RCCK0_CCA, MASKBYTE2, cur_cck_cca_thresh);
|
||||
|
||||
rtlpriv->dm_digtable.pre_cck_cca_thres = rtlpriv->dm_digtable.cur_cck_cca_thres;
|
||||
rtlpriv->dm_digtable.cur_cck_cca_thres = cur_cck_cca_thresh;
|
||||
dm_digtable->pre_cck_cca_thres = dm_digtable->cur_cck_cca_thres;
|
||||
dm_digtable->cur_cck_cca_thres = cur_cck_cca_thresh;
|
||||
RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE,
|
||||
"CCK cca thresh hold =%x\n",
|
||||
rtlpriv->dm_digtable.cur_cck_cca_thres);
|
||||
"CCK cca thresh hold =%x\n", dm_digtable->cur_cck_cca_thres);
|
||||
}
|
||||
|
||||
static void rtl8723be_dm_dynamic_edcca(struct ieee80211_hw *hw)
|
||||
@ -1173,8 +1178,7 @@ static void rtl8723be_dm_dynamic_atc_switch(struct ieee80211_hw *hw)
|
||||
if (rtlpriv->cfg->ops->get_btc_status()) {
|
||||
if (!rtlpriv->btcoexist.btc_ops->btc_is_bt_disabled(rtlpriv)) {
|
||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
||||
"odm_DynamicATCSwitch(): Disable"
|
||||
" CFO tracking for BT!!\n");
|
||||
"odm_DynamicATCSwitch(): Disable CFO tracking for BT!!\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1207,9 +1211,8 @@ static void rtl8723be_dm_dynamic_atc_switch(struct ieee80211_hw *hw)
|
||||
if (cfo_ave_diff > 20 && rtldm->large_cfo_hit == 0) {
|
||||
rtldm->large_cfo_hit = 1;
|
||||
return;
|
||||
} else {
|
||||
} else
|
||||
rtldm->large_cfo_hit = 0;
|
||||
}
|
||||
|
||||
rtldm->cfo_ave_pre = cfo_ave;
|
||||
|
||||
@ -1263,20 +1266,20 @@ static void rtl8723be_dm_dynamic_atc_switch(struct ieee80211_hw *hw)
|
||||
static void rtl8723be_dm_common_info_self_update(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_sta_info *drv_priv;
|
||||
u8 cnt = 0;
|
||||
struct rtl_sta_info *drv_priv;
|
||||
|
||||
rtlpriv->dm.one_entry_only = false;
|
||||
|
||||
if (rtlpriv->mac80211.opmode == NL80211_IFTYPE_STATION &&
|
||||
rtlpriv->mac80211.link_state >= MAC80211_LINKED) {
|
||||
rtlpriv->mac80211.link_state >= MAC80211_LINKED) {
|
||||
rtlpriv->dm.one_entry_only = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (rtlpriv->mac80211.opmode == NL80211_IFTYPE_AP ||
|
||||
rtlpriv->mac80211.opmode == NL80211_IFTYPE_ADHOC ||
|
||||
rtlpriv->mac80211.opmode == NL80211_IFTYPE_MESH_POINT) {
|
||||
rtlpriv->mac80211.opmode == NL80211_IFTYPE_ADHOC ||
|
||||
rtlpriv->mac80211.opmode == NL80211_IFTYPE_MESH_POINT) {
|
||||
spin_lock_bh(&rtlpriv->locks.entry_list_lock);
|
||||
list_for_each_entry(drv_priv, &rtlpriv->entry_list, list) {
|
||||
cnt++;
|
||||
@ -1305,8 +1308,8 @@ void rtl8723be_dm_watchdog(struct ieee80211_hw *hw)
|
||||
fw_ps_awake = false;
|
||||
|
||||
if ((ppsc->rfpwr_state == ERFON) &&
|
||||
((!fw_current_inpsmode) && fw_ps_awake) &&
|
||||
(!ppsc->rfchange_inprogress)) {
|
||||
((!fw_current_inpsmode) && fw_ps_awake) &&
|
||||
(!ppsc->rfchange_inprogress)) {
|
||||
rtl8723be_dm_common_info_self_update(hw);
|
||||
rtl8723be_dm_false_alarm_counter_statistics(hw);
|
||||
rtl8723be_dm_check_rssi_monitor(hw);
|
||||
@ -1318,8 +1321,6 @@ void rtl8723be_dm_watchdog(struct ieee80211_hw *hw)
|
||||
rtl8723be_dm_dynamic_atc_switch(hw);
|
||||
rtl8723be_dm_check_txpower_tracking(hw);
|
||||
rtl8723be_dm_dynamic_txpower(hw);
|
||||
if (rtlpriv->cfg->ops->get_btc_status())
|
||||
rtlpriv->btcoexist.btc_ops->btc_periodical(rtlpriv);
|
||||
}
|
||||
rtlpriv->dm.dbginfo.num_qry_beacon_pkt = 0;
|
||||
}
|
||||
|
@ -141,7 +141,7 @@
|
||||
#define DM_REG_TX_CCK_BBON_11N 0xE78
|
||||
#define DM_REG_OFDM_RFON_11N 0xE7C
|
||||
#define DM_REG_OFDM_BBON_11N 0xE80
|
||||
#define DM_REG_TX2RX_11N 0xE84
|
||||
#define DM_REG_TX2RX_11N 0xE84
|
||||
#define DM_REG_TX2TX_11N 0xE88
|
||||
#define DM_REG_RX_CCK_11N 0xE8C
|
||||
#define DM_REG_RX_OFDM_11N 0xED0
|
||||
@ -202,6 +202,7 @@
|
||||
#define DM_DIG_BACKOFF_MIN -4
|
||||
#define DM_DIG_BACKOFF_DEFAULT 10
|
||||
|
||||
#define RXPATHSELECTION_SS_TH_LOW 30
|
||||
#define RXPATHSELECTION_DIFF_TH 18
|
||||
|
||||
#define DM_RATR_STA_INIT 0
|
||||
@ -212,6 +213,8 @@
|
||||
#define CTS2SELF_THVAL 30
|
||||
#define REGC38_TH 20
|
||||
|
||||
#define WAIOTTHVAL 25
|
||||
|
||||
#define TXHIGHPWRLEVEL_NORMAL 0
|
||||
#define TXHIGHPWRLEVEL_LEVEL1 1
|
||||
#define TXHIGHPWRLEVEL_LEVEL2 2
|
||||
@ -231,22 +234,6 @@
|
||||
#define CFO_THRESHOLD_XTAL 10 /* kHz */
|
||||
#define CFO_THRESHOLD_ATC 80 /* kHz */
|
||||
|
||||
enum FAT_STATE {
|
||||
FAT_NORMAL_STATE = 0,
|
||||
FAT_TRAINING_STATE = 1,
|
||||
};
|
||||
|
||||
enum tag_dynamic_init_gain_operation_type_definition {
|
||||
DIG_TYPE_THRESH_HIGH = 0,
|
||||
DIG_TYPE_THRESH_LOW = 1,
|
||||
DIG_TYPE_BACKOFF = 2,
|
||||
DIG_TYPE_RX_GAIN_MIN = 3,
|
||||
DIG_TYPE_RX_GAIN_MAX = 4,
|
||||
DIG_TYPE_ENABLE = 5,
|
||||
DIG_TYPE_DISABLE = 6,
|
||||
DIG_OP_TYPE_MAX
|
||||
};
|
||||
|
||||
enum dm_1r_cca_e {
|
||||
CCA_1R = 0,
|
||||
CCA_2R = 1,
|
||||
@ -292,12 +279,17 @@ enum pwr_track_control_method {
|
||||
#define BT_RSSI_STATE_SPECIAL_LOW BIT_OFFSET_LEN_MASK_32(2, 1)
|
||||
#define BT_RSSI_STATE_BG_EDCA_LOW BIT_OFFSET_LEN_MASK_32(3, 1)
|
||||
#define BT_RSSI_STATE_TXPOWER_LOW BIT_OFFSET_LEN_MASK_32(4, 1)
|
||||
#define GET_UNDECORATED_AVERAGE_RSSI(_priv) \
|
||||
((((struct rtl_priv *)(_priv))->mac80211.opmode == \
|
||||
NL80211_IFTYPE_ADHOC) ? \
|
||||
(((struct rtl_priv *)(_priv))->dm.entry_min_undecoratedsmoothed_pwdb) :\
|
||||
(((struct rtl_priv *)(_priv))->dm.undecorated_smoothed_pwdb))
|
||||
|
||||
void rtl8723be_dm_set_tx_ant_by_tx_info(struct ieee80211_hw *hw, u8 *pdesc,
|
||||
u32 mac_id);
|
||||
void rtl8723be_dm_ant_sel_statistics(struct ieee80211_hw *hw, u8 antsel_tr_mux,
|
||||
u32 mac_id, u32 rx_pwdb_all);
|
||||
void rtl8723be_dm_fast_antenna_trainning_callback(unsigned long data);
|
||||
void rtl8723be_dm_fast_antenna_training_callback(unsigned long data);
|
||||
void rtl8723be_dm_init(struct ieee80211_hw *hw);
|
||||
void rtl8723be_dm_watchdog(struct ieee80211_hw *hw);
|
||||
void rtl8723be_dm_write_dig(struct ieee80211_hw *hw, u8 current_igi);
|
||||
@ -305,6 +297,4 @@ void rtl8723be_dm_check_txpower_tracking(struct ieee80211_hw *hw);
|
||||
void rtl8723be_dm_init_rate_adaptive_mask(struct ieee80211_hw *hw);
|
||||
void rtl8723be_dm_txpower_track_adjust(struct ieee80211_hw *hw, u8 type,
|
||||
u8 *pdirection, u32 *poutwrite_val);
|
||||
void rtl8723be_dm_init_edca_turbo(struct ieee80211_hw *hw);
|
||||
|
||||
#endif
|
||||
|
@ -55,8 +55,8 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
|
||||
bool isfw_read = false;
|
||||
u8 buf_index = 0;
|
||||
bool bwrite_sucess = false;
|
||||
u8 wait_h2c_limit = 100;
|
||||
u8 wait_writeh2c_limit = 100;
|
||||
u8 wait_h2c_limmit = 100;
|
||||
u8 wait_writeh2c_limmit = 100;
|
||||
u8 boxcontent[4], boxextcontent[4];
|
||||
u32 h2c_waitcounter = 0;
|
||||
unsigned long flag;
|
||||
@ -68,8 +68,8 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
|
||||
spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag);
|
||||
if (rtlhal->h2c_setinprogress) {
|
||||
RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
|
||||
"H2C set in progress! Wait to set.."
|
||||
"element_id(%d).\n", element_id);
|
||||
"H2C set in progress! Wait to set..element_id(%d).\n",
|
||||
element_id);
|
||||
|
||||
while (rtlhal->h2c_setinprogress) {
|
||||
spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock,
|
||||
@ -92,14 +92,15 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
while (!bwrite_sucess) {
|
||||
wait_writeh2c_limit--;
|
||||
if (wait_writeh2c_limit == 0) {
|
||||
wait_writeh2c_limmit--;
|
||||
if (wait_writeh2c_limmit == 0) {
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
|
||||
"Write H2C fail because no trigger "
|
||||
"for FW INT!\n");
|
||||
"Write H2C fail because no trigger for FW INT!\n");
|
||||
break;
|
||||
}
|
||||
|
||||
boxnum = rtlhal->last_hmeboxnum;
|
||||
switch (boxnum) {
|
||||
case 0:
|
||||
@ -120,39 +121,43 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
|
||||
break;
|
||||
default:
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
|
||||
"switch case not processed\n");
|
||||
"switch case not process\n");
|
||||
break;
|
||||
}
|
||||
|
||||
isfw_read = _rtl8723be_check_fw_read_last_h2c(hw, boxnum);
|
||||
while (!isfw_read) {
|
||||
wait_h2c_limit--;
|
||||
if (wait_h2c_limit == 0) {
|
||||
wait_h2c_limmit--;
|
||||
if (wait_h2c_limmit == 0) {
|
||||
RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
|
||||
"Wating too long for FW read "
|
||||
"clear HMEBox(%d)!\n", boxnum);
|
||||
"Waiting too long for FW read clear HMEBox(%d)!\n",
|
||||
boxnum);
|
||||
break;
|
||||
}
|
||||
|
||||
udelay(10);
|
||||
|
||||
isfw_read = _rtl8723be_check_fw_read_last_h2c(hw,
|
||||
boxnum);
|
||||
u1b_tmp = rtl_read_byte(rtlpriv, 0x130);
|
||||
RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
|
||||
"Wating for FW read clear HMEBox(%d)!!! 0x130 = %2x\n",
|
||||
"Waiting for FW read clear HMEBox(%d)!!! 0x130 = %2x\n",
|
||||
boxnum, u1b_tmp);
|
||||
}
|
||||
|
||||
if (!isfw_read) {
|
||||
RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
|
||||
"Write H2C register BOX[%d] fail!!!!! "
|
||||
"Fw do not read.\n", boxnum);
|
||||
"Write H2C register BOX[%d] fail!!!!! Fw do not read.\n",
|
||||
boxnum);
|
||||
break;
|
||||
}
|
||||
|
||||
memset(boxcontent, 0, sizeof(boxcontent));
|
||||
memset(boxextcontent, 0, sizeof(boxextcontent));
|
||||
boxcontent[0] = element_id;
|
||||
RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
|
||||
"Write element_id box_reg(%4x) = %2x\n",
|
||||
box_reg, element_id);
|
||||
box_reg, element_id);
|
||||
|
||||
switch (cmd_len) {
|
||||
case 1:
|
||||
@ -181,6 +186,7 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
|
||||
rtl_write_byte(rtlpriv, box_extreg + idx,
|
||||
boxextcontent[idx]);
|
||||
}
|
||||
|
||||
for (idx = 0; idx < 4; idx++) {
|
||||
rtl_write_byte(rtlpriv, box_reg + idx,
|
||||
boxcontent[idx]);
|
||||
@ -191,6 +197,7 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
|
||||
"switch case not process\n");
|
||||
break;
|
||||
}
|
||||
|
||||
bwrite_sucess = true;
|
||||
|
||||
rtlhal->last_hmeboxnum = boxnum + 1;
|
||||
@ -199,8 +206,9 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
|
||||
"pHalData->last_hmeboxnum = %d\n",
|
||||
rtlhal->last_hmeboxnum);
|
||||
rtlhal->last_hmeboxnum);
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag);
|
||||
rtlhal->h2c_setinprogress = false;
|
||||
spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag);
|
||||
@ -219,6 +227,7 @@ void rtl8723be_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id,
|
||||
"return H2C cmd because of Fw download fail!!!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
memset(tmp_cmdbuf, 0, 8);
|
||||
memcpy(tmp_cmdbuf, p_cmdbuffer, cmd_len);
|
||||
_rtl8723be_fill_h2c_command(hw, element_id, cmd_len,
|
||||
@ -229,17 +238,17 @@ void rtl8723be_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id,
|
||||
void rtl8723be_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
u8 u1_h2c_set_pwrmode[H2C_8723BE_PWEMODE_LENGTH] = { 0 };
|
||||
u8 u1_h2c_set_pwrmode[H2C_PWEMODE_LENGTH] = { 0 };
|
||||
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
|
||||
u8 rlbm, power_state = 0;
|
||||
RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, "FW LPS mode = %d\n", mode);
|
||||
|
||||
SET_H2CCMD_PWRMODE_PARM_MODE(u1_h2c_set_pwrmode, ((mode) ? 1 : 0));
|
||||
rlbm = 0;/*YJ, temp, 120316. FW now not support RLBM = 2.*/
|
||||
rlbm = 0;/*YJ,temp,120316. FW now not support RLBM=2.*/
|
||||
SET_H2CCMD_PWRMODE_PARM_RLBM(u1_h2c_set_pwrmode, rlbm);
|
||||
SET_H2CCMD_PWRMODE_PARM_SMART_PS(u1_h2c_set_pwrmode,
|
||||
(rtlpriv->mac80211.p2p) ?
|
||||
ppsc->smart_ps : 1);
|
||||
ppsc->smart_ps : 1);
|
||||
SET_H2CCMD_PWRMODE_PARM_AWAKE_INTERVAL(u1_h2c_set_pwrmode,
|
||||
ppsc->reg_max_lps_awakeintvl);
|
||||
SET_H2CCMD_PWRMODE_PARM_ALL_QUEUE_UAPSD(u1_h2c_set_pwrmode, 0);
|
||||
@ -251,44 +260,26 @@ void rtl8723be_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode)
|
||||
|
||||
RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_DMESG,
|
||||
"rtl92c_set_fw_pwrmode(): u1_h2c_set_pwrmode\n",
|
||||
u1_h2c_set_pwrmode, H2C_8723BE_PWEMODE_LENGTH);
|
||||
rtl8723be_fill_h2c_cmd(hw, H2C_8723BE_SETPWRMODE,
|
||||
H2C_8723BE_PWEMODE_LENGTH,
|
||||
u1_h2c_set_pwrmode, H2C_PWEMODE_LENGTH);
|
||||
rtl8723be_fill_h2c_cmd(hw, H2C_8723B_SETPWRMODE, H2C_PWEMODE_LENGTH,
|
||||
u1_h2c_set_pwrmode);
|
||||
}
|
||||
|
||||
static bool _rtl8723be_cmd_send_packet(struct ieee80211_hw *hw,
|
||||
struct sk_buff *skb)
|
||||
void rtl8723be_set_fw_media_status_rpt_cmd(struct ieee80211_hw *hw, u8 mstatus)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
|
||||
struct rtl8192_tx_ring *ring;
|
||||
struct rtl_tx_desc *pdesc;
|
||||
struct sk_buff *pskb = NULL;
|
||||
u8 own;
|
||||
unsigned long flags;
|
||||
u8 parm[3] = { 0, 0, 0 };
|
||||
/* parm[0]: bit0=0-->Disconnect, bit0=1-->Connect
|
||||
* bit1=0-->update Media Status to MACID
|
||||
* bit1=1-->update Media Status from MACID to MACID_End
|
||||
* parm[1]: MACID, if this is INFRA_STA, MacID = 0
|
||||
* parm[2]: MACID_End
|
||||
*/
|
||||
SET_H2CCMD_MSRRPT_PARM_OPMODE(parm, mstatus);
|
||||
SET_H2CCMD_MSRRPT_PARM_MACID_IND(parm, 0);
|
||||
|
||||
ring = &rtlpci->tx_ring[BEACON_QUEUE];
|
||||
|
||||
pskb = __skb_dequeue(&ring->queue);
|
||||
if (pskb)
|
||||
kfree_skb(pskb);
|
||||
|
||||
spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags);
|
||||
|
||||
pdesc = &ring->desc[0];
|
||||
own = (u8) rtlpriv->cfg->ops->get_desc((u8 *)pdesc, true, HW_DESC_OWN);
|
||||
|
||||
rtlpriv->cfg->ops->fill_tx_cmddesc(hw, (u8 *)pdesc, 1, 1, skb);
|
||||
|
||||
__skb_queue_tail(&ring->queue, skb);
|
||||
|
||||
spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags);
|
||||
|
||||
rtlpriv->cfg->ops->tx_polling(hw, BEACON_QUEUE);
|
||||
|
||||
return true;
|
||||
rtl8723be_fill_h2c_cmd(hw, H2C_8723B_MSRRPT, 3, parm);
|
||||
}
|
||||
|
||||
#define BEACON_PG 0 /* ->1 */
|
||||
#define PSPOLL_PG 2
|
||||
#define NULL_PG 3
|
||||
@ -407,7 +398,7 @@ static u8 reserved_page_packet[TOTAL_RESERVED_PKT_LEN] = {
|
||||
};
|
||||
|
||||
void rtl8723be_set_fw_rsvdpagepkt(struct ieee80211_hw *hw,
|
||||
bool dl_finished)
|
||||
bool b_dl_finished)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
|
||||
@ -416,7 +407,7 @@ void rtl8723be_set_fw_rsvdpagepkt(struct ieee80211_hw *hw,
|
||||
u32 totalpacketlen;
|
||||
bool rtstatus;
|
||||
u8 u1rsvdpageloc[5] = { 0 };
|
||||
bool dlok = false;
|
||||
bool b_dlok = false;
|
||||
|
||||
u8 *beacon;
|
||||
u8 *p_pspoll;
|
||||
@ -466,43 +457,40 @@ void rtl8723be_set_fw_rsvdpagepkt(struct ieee80211_hw *hw,
|
||||
totalpacketlen = TOTAL_RESERVED_PKT_LEN;
|
||||
|
||||
RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_LOUD,
|
||||
"rtl8723be_set_fw_rsvdpagepkt(): "
|
||||
"HW_VAR_SET_TX_CMD: ALL\n",
|
||||
"rtl8723be_set_fw_rsvdpagepkt(): HW_VAR_SET_TX_CMD: ALL\n",
|
||||
&reserved_page_packet[0], totalpacketlen);
|
||||
RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_DMESG,
|
||||
"rtl8723be_set_fw_rsvdpagepkt(): "
|
||||
"HW_VAR_SET_TX_CMD: ALL\n", u1rsvdpageloc, 3);
|
||||
|
||||
"rtl8723be_set_fw_rsvdpagepkt(): HW_VAR_SET_TX_CMD: ALL\n",
|
||||
u1rsvdpageloc, 3);
|
||||
|
||||
skb = dev_alloc_skb(totalpacketlen);
|
||||
memcpy((u8 *)skb_put(skb, totalpacketlen),
|
||||
&reserved_page_packet, totalpacketlen);
|
||||
|
||||
rtstatus = _rtl8723be_cmd_send_packet(hw, skb);
|
||||
rtstatus = rtl8723_cmd_send_packet(hw, skb);
|
||||
|
||||
if (rtstatus)
|
||||
dlok = true;
|
||||
b_dlok = true;
|
||||
|
||||
if (dlok) {
|
||||
if (b_dlok) {
|
||||
RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
|
||||
"Set RSVD page location to Fw.\n");
|
||||
RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_DMESG, "H2C_RSVDPAGE:\n",
|
||||
u1rsvdpageloc, 3);
|
||||
rtl8723be_fill_h2c_cmd(hw, H2C_8723BE_RSVDPAGE,
|
||||
rtl8723be_fill_h2c_cmd(hw, H2C_8723B_RSVDPAGE,
|
||||
sizeof(u1rsvdpageloc), u1rsvdpageloc);
|
||||
} else {
|
||||
} else
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
|
||||
"Set RSVD page location to Fw FAIL!!!!!!.\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*Should check FW support p2p or not.*/
|
||||
static void rtl8723be_set_p2p_ctw_period_cmd(struct ieee80211_hw *hw,
|
||||
u8 ctwindow)
|
||||
{
|
||||
u8 u1_ctwindow_period[1] = {ctwindow};
|
||||
u8 u1_ctwindow_period[1] = { ctwindow};
|
||||
|
||||
rtl8723be_fill_h2c_cmd(hw, H2C_8723BE_P2P_PS_CTW_CMD, 1,
|
||||
rtl8723be_fill_h2c_cmd(hw, H2C_8723B_P2P_PS_CTW_CMD, 1,
|
||||
u1_ctwindow_period);
|
||||
}
|
||||
|
||||
@ -521,7 +509,7 @@ void rtl8723be_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw,
|
||||
switch (p2p_ps_state) {
|
||||
case P2P_PS_DISABLE:
|
||||
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_DISABLE\n");
|
||||
memset(p2p_ps_offload, 0, sizeof(struct p2p_ps_offload_t));
|
||||
memset(p2p_ps_offload, 0, sizeof(*p2p_ps_offload));
|
||||
break;
|
||||
case P2P_PS_ENABLE:
|
||||
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_ENABLE\n");
|
||||
@ -532,7 +520,7 @@ void rtl8723be_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw,
|
||||
rtl8723be_set_p2p_ctw_period_cmd(hw, ctwindow);
|
||||
}
|
||||
/* hw only support 2 set of NoA */
|
||||
for (i = 0; i < p2pinfo->noa_num; i++) {
|
||||
for (i = 0 ; i < p2pinfo->noa_num ; i++) {
|
||||
/* To control the register setting
|
||||
* for which NOA
|
||||
*/
|
||||
@ -563,6 +551,7 @@ void rtl8723be_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw,
|
||||
rtl_write_dword(rtlpriv, 0x5EC,
|
||||
p2pinfo->noa_count_type[i]);
|
||||
}
|
||||
|
||||
if ((p2pinfo->opp_ps == 1) ||
|
||||
(p2pinfo->noa_num > 0)) {
|
||||
/* rst p2p circuit */
|
||||
@ -591,30 +580,60 @@ void rtl8723be_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw,
|
||||
default:
|
||||
break;
|
||||
}
|
||||
rtl8723be_fill_h2c_cmd(hw, H2C_8723BE_P2P_PS_OFFLOAD, 1,
|
||||
|
||||
rtl8723be_fill_h2c_cmd(hw, H2C_8723B_P2P_PS_OFFLOAD, 1,
|
||||
(u8 *)p2p_ps_offload);
|
||||
}
|
||||
|
||||
void rtl8723be_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus)
|
||||
static void _rtl8723be_c2h_content_parsing(struct ieee80211_hw *hw,
|
||||
u8 c2h_cmd_id,
|
||||
u8 c2h_cmd_len, u8 *tmp_buf)
|
||||
{
|
||||
u8 u1_joinbssrpt_parm[1] = { 0 };
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
|
||||
SET_H2CCMD_JOINBSSRPT_PARM_OPMODE(u1_joinbssrpt_parm, mstatus);
|
||||
|
||||
rtl8723be_fill_h2c_cmd(hw, H2C_8723BE_JOINBSSRPT, 1,
|
||||
u1_joinbssrpt_parm);
|
||||
switch (c2h_cmd_id) {
|
||||
case C2H_8723B_DBG:
|
||||
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
|
||||
"[C2H], C2H_8723BE_DBG!!\n");
|
||||
break;
|
||||
case C2H_8723B_TX_REPORT:
|
||||
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
|
||||
"[C2H], C2H_8723BE_TX_REPORT!\n");
|
||||
break;
|
||||
case C2H_8723B_BT_INFO:
|
||||
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
|
||||
"[C2H], C2H_8723BE_BT_INFO!!\n");
|
||||
rtlpriv->btcoexist.btc_ops->btc_btinfo_notify(rtlpriv, tmp_buf,
|
||||
c2h_cmd_len);
|
||||
break;
|
||||
case C2H_8723B_BT_MP:
|
||||
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
|
||||
"[C2H], C2H_8723BE_BT_MP!!\n");
|
||||
break;
|
||||
default:
|
||||
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
|
||||
"[C2H], Unkown packet!! CmdId(%#X)!\n", c2h_cmd_id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void rtl8723be_set_fw_ap_off_load_cmd(struct ieee80211_hw *hw,
|
||||
u8 ap_offload_enable)
|
||||
void rtl8723be_c2h_packet_handler(struct ieee80211_hw *hw, u8 *buffer, u8 len)
|
||||
{
|
||||
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
|
||||
u8 u1_apoffload_parm[H2C_8723BE_AP_OFFLOAD_LENGTH] = { 0 };
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
u8 c2h_cmd_id = 0, c2h_cmd_seq = 0, c2h_cmd_len = 0;
|
||||
u8 *tmp_buf = NULL;
|
||||
|
||||
SET_H2CCMD_AP_OFFLOAD_ON(u1_apoffload_parm, ap_offload_enable);
|
||||
SET_H2CCMD_AP_OFFLOAD_HIDDEN(u1_apoffload_parm, mac->hiddenssid);
|
||||
SET_H2CCMD_AP_OFFLOAD_DENYANY(u1_apoffload_parm, 0);
|
||||
c2h_cmd_id = buffer[0];
|
||||
c2h_cmd_seq = buffer[1];
|
||||
c2h_cmd_len = len - 2;
|
||||
tmp_buf = buffer + 2;
|
||||
|
||||
rtl8723be_fill_h2c_cmd(hw, H2C_8723BE_AP_OFFLOAD,
|
||||
H2C_8723BE_AP_OFFLOAD_LENGTH, u1_apoffload_parm);
|
||||
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
|
||||
"[C2H packet], c2hCmdId=0x%x, c2hCmdSeq=0x%x, c2hCmdLen=%d\n",
|
||||
c2h_cmd_id, c2h_cmd_seq, c2h_cmd_len);
|
||||
|
||||
RT_PRINT_DATA(rtlpriv, COMP_FW, DBG_TRACE,
|
||||
"[C2H packet], Content Hex:\n", tmp_buf, c2h_cmd_len);
|
||||
|
||||
_rtl8723be_c2h_content_parsing(hw, c2h_cmd_id, c2h_cmd_len, tmp_buf);
|
||||
}
|
||||
|
@ -30,50 +30,23 @@
|
||||
#define FW_8192C_END_ADDRESS 0x5FFF
|
||||
#define FW_8192C_PAGE_SIZE 4096
|
||||
#define FW_8192C_POLLING_DELAY 5
|
||||
#define FW_8192C_POLLING_TIMEOUT_COUNT 6000
|
||||
|
||||
#define IS_FW_HEADER_EXIST(_pfwhdr) \
|
||||
((_pfwhdr->signature&0xFFF0) == 0x5300)
|
||||
#define USE_OLD_WOWLAN_DEBUG_FW 0
|
||||
|
||||
#define H2C_8723BE_RSVDPAGE_LOC_LEN 5
|
||||
#define H2C_8723BE_PWEMODE_LENGTH 5
|
||||
#define H2C_8723BE_JOINBSSRPT_LENGTH 1
|
||||
#define H2C_8723BE_AP_OFFLOAD_LENGTH 3
|
||||
#define H2C_8723BE_WOWLAN_LENGTH 3
|
||||
#define H2C_8723BE_KEEP_ALIVE_CTRL_LENGTH 3
|
||||
#if (USE_OLD_WOWLAN_DEBUG_FW == 0)
|
||||
#define H2C_8723BE_REMOTE_WAKE_CTRL_LEN 1
|
||||
#else
|
||||
#define H2C_8723BE_REMOTE_WAKE_CTRL_LEN 3
|
||||
#endif
|
||||
#define H2C_8723BE_AOAC_GLOBAL_INFO_LEN 2
|
||||
#define H2C_8723BE_AOAC_RSVDPAGE_LOC_LEN 7
|
||||
|
||||
#define H2C_PWEMODE_LENGTH 5
|
||||
|
||||
/* Fw PS state for RPWM.
|
||||
*BIT[2:0] = HW state
|
||||
*BIT[3] = Protocol PS state, 1: register active state , 0: register sleep state
|
||||
*BIT[4] = sub-state
|
||||
*/
|
||||
#define FW_PS_GO_ON BIT(0)
|
||||
#define FW_PS_TX_NULL BIT(1)
|
||||
#define FW_PS_RF_ON BIT(2)
|
||||
#define FW_PS_REGISTER_ACTIVE BIT(3)
|
||||
|
||||
#define FW_PS_DPS BIT(0)
|
||||
#define FW_PS_LCLK (FW_PS_DPS)
|
||||
#define FW_PS_RF_OFF BIT(1)
|
||||
#define FW_PS_ALL_ON BIT(2)
|
||||
#define FW_PS_ST_ACTIVE BIT(3)
|
||||
#define FW_PS_ISR_ENABLE BIT(4)
|
||||
#define FW_PS_IMR_ENABLE BIT(5)
|
||||
|
||||
|
||||
#define FW_PS_ACK BIT(6)
|
||||
#define FW_PS_TOGGLE BIT(7)
|
||||
|
||||
/* 88E RPWM value*/
|
||||
/* 8723BE RPWM value*/
|
||||
/* BIT[0] = 1: 32k, 0: 40M*/
|
||||
#define FW_PS_CLOCK_OFF BIT(0) /* 32k*/
|
||||
#define FW_PS_CLOCK_ON 0 /*40M*/
|
||||
@ -83,75 +56,61 @@
|
||||
/*ISR_ENABLE, IMR_ENABLE, and PS mode should be inherited.*/
|
||||
#define FW_PS_STATE_INT_MASK (0x3F)
|
||||
|
||||
#define FW_PS_STATE(x) (FW_PS_STATE_MASK & (x))
|
||||
#define FW_PS_STATE_HW(x) (FW_PS_STATE_HW_MASK & (x))
|
||||
#define FW_PS_STATE_INT(x) (FW_PS_STATE_INT_MASK & (x))
|
||||
#define FW_PS_ISR_VAL(x) ((x) & 0x70)
|
||||
#define FW_PS_IMR_MASK(x) ((x) & 0xDF)
|
||||
#define FW_PS_KEEP_IMR(x) ((x) & 0x20)
|
||||
|
||||
|
||||
#define FW_PS_STATE_S0 (FW_PS_DPS)
|
||||
#define FW_PS_STATE_S1 (FW_PS_LCLK)
|
||||
#define FW_PS_STATE_S2 (FW_PS_RF_OFF)
|
||||
#define FW_PS_STATE_S3 (FW_PS_ALL_ON)
|
||||
#define FW_PS_STATE_S4 ((FW_PS_ST_ACTIVE) | (FW_PS_ALL_ON))
|
||||
#define FW_PS_STATE(x) (FW_PS_STATE_MASK & (x))
|
||||
|
||||
/* ((FW_PS_RF_ON) | (FW_PS_REGISTER_ACTIVE))*/
|
||||
#define FW_PS_STATE_ALL_ON_88E (FW_PS_CLOCK_ON)
|
||||
#define FW_PS_STATE_ALL_ON (FW_PS_CLOCK_ON)
|
||||
/* (FW_PS_RF_ON)*/
|
||||
#define FW_PS_STATE_RF_ON_88E (FW_PS_CLOCK_ON)
|
||||
#define FW_PS_STATE_RF_ON (FW_PS_CLOCK_ON)
|
||||
/* 0x0*/
|
||||
#define FW_PS_STATE_RF_OFF_88E (FW_PS_CLOCK_ON)
|
||||
#define FW_PS_STATE_RF_OFF (FW_PS_CLOCK_ON)
|
||||
/* (FW_PS_STATE_RF_OFF)*/
|
||||
#define FW_PS_STATE_RF_OFF_LOW_PWR_88E (FW_PS_CLOCK_OFF)
|
||||
|
||||
#define FW_PS_STATE_ALL_ON_92C (FW_PS_STATE_S4)
|
||||
#define FW_PS_STATE_RF_ON_92C (FW_PS_STATE_S3)
|
||||
#define FW_PS_STATE_RF_OFF_92C (FW_PS_STATE_S2)
|
||||
#define FW_PS_STATE_RF_OFF_LOW_PWR_92C (FW_PS_STATE_S1)
|
||||
#define FW_PS_STATE_RF_OFF_LOW_PWR (FW_PS_CLOCK_OFF)
|
||||
|
||||
|
||||
/* For 88E H2C PwrMode Cmd ID 5.*/
|
||||
/* For 8723BE H2C PwrMode Cmd ID 5.*/
|
||||
#define FW_PWR_STATE_ACTIVE ((FW_PS_RF_ON) | (FW_PS_REGISTER_ACTIVE))
|
||||
#define FW_PWR_STATE_RF_OFF 0
|
||||
|
||||
#define FW_PS_IS_ACK(x) ((x) & FW_PS_ACK)
|
||||
#define FW_PS_IS_CLK_ON(x) ((x) & (FW_PS_RF_OFF | FW_PS_ALL_ON))
|
||||
#define FW_PS_IS_RF_ON(x) ((x) & (FW_PS_ALL_ON))
|
||||
#define FW_PS_IS_ACTIVE(x) ((x) & (FW_PS_ST_ACTIVE))
|
||||
#define FW_PS_IS_CPWM_INT(x) ((x) & 0x40)
|
||||
#define FW_PS_IS_ACK(x) ((x) & FW_PS_ACK)
|
||||
|
||||
#define FW_CLR_PS_STATE(x) ((x) = ((x) & (0xF0)))
|
||||
|
||||
#define IS_IN_LOW_POWER_STATE_88E(fwpsstate) \
|
||||
(FW_PS_STATE(fwpsstate) == FW_PS_CLOCK_OFF)
|
||||
#define IS_IN_LOW_POWER_STATE(__fwpsstate) \
|
||||
(FW_PS_STATE(__fwpsstate) == FW_PS_CLOCK_OFF)
|
||||
|
||||
#define FW_PWR_STATE_ACTIVE ((FW_PS_RF_ON) | (FW_PS_REGISTER_ACTIVE))
|
||||
#define FW_PWR_STATE_RF_OFF 0
|
||||
|
||||
#define pagenum_128(_len) (u32)(((_len)>>7) + ((_len)&0x7F ? 1 : 0))
|
||||
enum rtl8723b_h2c_cmd {
|
||||
H2C_8723B_RSVDPAGE = 0,
|
||||
H2C_8723B_MSRRPT = 1,
|
||||
H2C_8723B_SCAN = 2,
|
||||
H2C_8723B_KEEP_ALIVE_CTRL = 3,
|
||||
H2C_8723B_DISCONNECT_DECISION = 4,
|
||||
H2C_8723B_BCN_RSVDPAGE = 9,
|
||||
H2C_8723B_PROBERSP_RSVDPAGE = 10,
|
||||
|
||||
#define SET_88E_H2CCMD_WOWLAN_FUNC_ENABLE(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 1, __val)
|
||||
#define SET_88E_H2CCMD_WOWLAN_PATTERN_MATCH_ENABLE(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 1, 1, __val)
|
||||
#define SET_88E_H2CCMD_WOWLAN_MAGIC_PKT_ENABLE(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 2, 1, __val)
|
||||
#define SET_88E_H2CCMD_WOWLAN_UNICAST_PKT_ENABLE(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 3, 1, __val)
|
||||
#define SET_88E_H2CCMD_WOWLAN_ALL_PKT_DROP(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 4, 1, __val)
|
||||
#define SET_88E_H2CCMD_WOWLAN_GPIO_ACTIVE(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 5, 1, __val)
|
||||
#define SET_88E_H2CCMD_WOWLAN_REKEY_WAKE_UP(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 6, 1, __val)
|
||||
#define SET_88E_H2CCMD_WOWLAN_DISCONNECT_WAKE_UP(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 7, 1, __val)
|
||||
#define SET_88E_H2CCMD_WOWLAN_GPIONUM(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val)
|
||||
#define SET_88E_H2CCMD_WOWLAN_GPIO_DURATION(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val)
|
||||
H2C_8723B_SETPWRMODE = 0x20,
|
||||
H2C_8723B_PS_LPS_PARA = 0x23,
|
||||
H2C_8723B_P2P_PS_OFFLOAD = 0x24,
|
||||
|
||||
H2C_8723B_RA_MASK = 0x40,
|
||||
H2C_RSSIBE_REPORT = 0x42,
|
||||
/*Not defined CTW CMD for P2P yet*/
|
||||
H2C_8723B_P2P_PS_CTW_CMD,
|
||||
MAX_8723B_H2CCMD
|
||||
};
|
||||
|
||||
enum rtl8723b_c2h_evt {
|
||||
C2H_8723B_DBG = 0,
|
||||
C2H_8723B_LB = 1,
|
||||
C2H_8723B_TXBF = 2,
|
||||
C2H_8723B_TX_REPORT = 3,
|
||||
C2H_8723B_BT_INFO = 9,
|
||||
C2H_8723B_BT_MP = 11,
|
||||
MAX_8723B_C2HEVENT
|
||||
};
|
||||
|
||||
#define pagenum_128(_len) (u32)(((_len)>>7) + ((_len)&0x7F ? 1 : 0))
|
||||
|
||||
|
||||
#define SET_H2CCMD_PWRMODE_PARM_MODE(__ph2ccmd, __val) \
|
||||
@ -169,8 +128,11 @@
|
||||
#define GET_88E_H2CCMD_PWRMODE_PARM_MODE(__ph2ccmd) \
|
||||
LE_BITS_TO_1BYTE(__ph2ccmd, 0, 8)
|
||||
|
||||
#define SET_H2CCMD_JOINBSSRPT_PARM_OPMODE(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val)
|
||||
#define SET_H2CCMD_MSRRPT_PARM_OPMODE(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 1, __val)
|
||||
#define SET_H2CCMD_MSRRPT_PARM_MACID_IND(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 1, 1, __val)
|
||||
|
||||
#define SET_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val)
|
||||
#define SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(__ph2ccmd, __val) \
|
||||
@ -178,71 +140,13 @@
|
||||
#define SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val)
|
||||
|
||||
/* AP_OFFLOAD */
|
||||
#define SET_H2CCMD_AP_OFFLOAD_ON(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val)
|
||||
#define SET_H2CCMD_AP_OFFLOAD_HIDDEN(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val)
|
||||
#define SET_H2CCMD_AP_OFFLOAD_DENYANY(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val)
|
||||
#define SET_H2CCMD_AP_OFFLOAD_WAKEUP_EVT_RPT(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE((__ph2ccmd)+3, 0, 8, __val)
|
||||
|
||||
/* Keep Alive Control*/
|
||||
#define SET_88E_H2CCMD_KEEP_ALIVE_ENABLE(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 1, __val)
|
||||
#define SET_88E_H2CCMD_KEEP_ALIVE_ACCPEPT_USER_DEFINED(__ph2ccmd, __val)\
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 1, 1, __val)
|
||||
#define SET_88E_H2CCMD_KEEP_ALIVE_PERIOD(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val)
|
||||
|
||||
/*REMOTE_WAKE_CTRL */
|
||||
#define SET_88E_H2CCMD_REMOTE_WAKE_CTRL_EN(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 1, __val)
|
||||
#if (USE_OLD_WOWLAN_DEBUG_FW == 0)
|
||||
#define SET_88E_H2CCMD_REMOTE_WAKE_CTRL_ARP_OFFLOAD_EN(__ph2ccmd, __val)\
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 1, 1, __val)
|
||||
#define SET_88E_H2CCMD_REMOTE_WAKE_CTRL_NDP_OFFLOAD_EN(__ph2ccmd, __val)\
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 2, 1, __val)
|
||||
#define SET_88E_H2CCMD_REMOTE_WAKE_CTRL_GTK_OFFLOAD_EN(__ph2ccmd, __val)\
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 3, 1, __val)
|
||||
#else
|
||||
#define SET_88E_H2CCMD_REMOTE_WAKE_CTRL_PAIRWISE_ENC_ALG(__ph2ccmd, __val)\
|
||||
SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val)
|
||||
#define SET_88E_H2CCMD_REMOTE_WAKE_CTRL_GROUP_ENC_ALG(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val)
|
||||
#endif
|
||||
|
||||
/* GTK_OFFLOAD */
|
||||
#define SET_88E_H2CCMD_AOAC_GLOBAL_INFO_PAIRWISE_ENC_ALG(__ph2ccmd, __val)\
|
||||
SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val)
|
||||
#define SET_88E_H2CCMD_AOAC_GLOBAL_INFO_GROUP_ENC_ALG(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val)
|
||||
|
||||
/* AOAC_RSVDPAGE_LOC */
|
||||
#define SET_88E_H2CCMD_AOAC_RSVDPAGE_LOC_REM_WAKE_CTRL_INFO(__ph2ccmd, __val)\
|
||||
SET_BITS_TO_LE_1BYTE((__ph2ccmd), 0, 8, __val)
|
||||
#define SET_88E_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val)
|
||||
#define SET_88E_H2CCMD_AOAC_RSVDPAGE_LOC_NEIGHBOR_ADV(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val)
|
||||
#define SET_88E_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_RSP(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE((__ph2ccmd)+3, 0, 8, __val)
|
||||
#define SET_88E_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_INFO(__ph2ccmd, __val) \
|
||||
SET_BITS_TO_LE_1BYTE((__ph2ccmd)+4, 0, 8, __val)
|
||||
|
||||
void rtl8723be_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode);
|
||||
void rtl8723be_set_fw_ap_off_load_cmd(struct ieee80211_hw *hw,
|
||||
u8 ap_offload_enable);
|
||||
void rtl8723be_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id,
|
||||
u32 cmd_len, u8 *p_cmdbuffer);
|
||||
void rtl8723be_firmware_selfreset(struct ieee80211_hw *hw);
|
||||
void rtl8723be_set_fw_rsvdpagepkt(struct ieee80211_hw *hw,
|
||||
bool dl_finished);
|
||||
void rtl8723be_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus);
|
||||
int rtl8723be_download_fw(struct ieee80211_hw *hw,
|
||||
bool buse_wake_on_wlan_fw);
|
||||
void rtl8723be_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw,
|
||||
u8 p2p_ps_state);
|
||||
void rtl8723be_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode);
|
||||
void rtl8723be_set_fw_media_status_rpt_cmd(struct ieee80211_hw *hw, u8 mstatus);
|
||||
void rtl8723be_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished);
|
||||
void rtl8723be_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state);
|
||||
void rtl8723be_c2h_packet_handler(struct ieee80211_hw *hw, u8 *buffer, u8 len);
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -59,4 +59,5 @@ void rtl8723be_bt_reg_init(struct ieee80211_hw *hw);
|
||||
void rtl8723be_bt_hw_init(struct ieee80211_hw *hw);
|
||||
void rtl8723be_suspend(struct ieee80211_hw *hw);
|
||||
void rtl8723be_resume(struct ieee80211_hw *hw);
|
||||
|
||||
#endif
|
||||
|
@ -42,7 +42,7 @@ void rtl8723be_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD,
|
||||
"LedAddr:%X ledpin =%d\n", REG_LEDCFG2, pled->ledpin);
|
||||
"LedAddr:%X ledpin=%d\n", REG_LEDCFG2, pled->ledpin);
|
||||
|
||||
switch (pled->ledpin) {
|
||||
case LED_PIN_GPIO0:
|
||||
@ -71,7 +71,7 @@ void rtl8723be_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
|
||||
u8 ledcfg;
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD,
|
||||
"LedAddr:%X ledpin =%d\n", REG_LEDCFG2, pled->ledpin);
|
||||
"LedAddr:%X ledpin=%d\n", REG_LEDCFG2, pled->ledpin);
|
||||
|
||||
ledcfg = rtl_read_byte(rtlpriv, REG_LEDCFG2);
|
||||
|
||||
@ -100,7 +100,7 @@ void rtl8723be_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
|
||||
break;
|
||||
default:
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
|
||||
"switch case not processed\n");
|
||||
"switch case not process\n");
|
||||
break;
|
||||
}
|
||||
pled->ledon = false;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -26,22 +26,28 @@
|
||||
#ifndef __RTL8723BE_PHY_H__
|
||||
#define __RTL8723BE_PHY_H__
|
||||
|
||||
/*It must always set to 4, otherwise read efuse table secquence will be wrong.*/
|
||||
/* MAX_TX_COUNT must always set to 4, otherwise read efuse table sequence
|
||||
* will be wrong.
|
||||
*/
|
||||
#define MAX_TX_COUNT 4
|
||||
#define TX_1S 0
|
||||
#define TX_2S 1
|
||||
#define TX_3S 2
|
||||
#define TX_4S 3
|
||||
|
||||
#define MAX_POWER_INDEX 0x3F
|
||||
|
||||
#define MAX_PRECMD_CNT 16
|
||||
#define MAX_RFDEPENDCMD_CNT 16
|
||||
#define MAX_POSTCMD_CNT 16
|
||||
#define MAX_POSTCMD_CNT 16
|
||||
|
||||
#define MAX_DOZE_WAITING_TIMES_9x 64
|
||||
|
||||
#define RT_CANNOT_IO(hw) false
|
||||
#define HIGHPOWER_RADIOA_ARRAYLEN 22
|
||||
|
||||
#define TARGET_CHNL_NUM_2G_5G 59
|
||||
|
||||
#define IQK_ADDA_REG_NUM 16
|
||||
#define IQK_BB_REG_NUM 9
|
||||
#define MAX_TOLERANCE 5
|
||||
@ -83,104 +89,19 @@
|
||||
|
||||
#define RTL92C_MAX_PATH_NUM 2
|
||||
|
||||
enum hw90_block_e {
|
||||
HW90_BLOCK_MAC = 0,
|
||||
HW90_BLOCK_PHY0 = 1,
|
||||
HW90_BLOCK_PHY1 = 2,
|
||||
HW90_BLOCK_RF = 3,
|
||||
HW90_BLOCK_MAXIMUM = 4,
|
||||
};
|
||||
|
||||
enum baseband_config_type {
|
||||
BASEBAND_CONFIG_PHY_REG = 0,
|
||||
BASEBAND_CONFIG_AGC_TAB = 1,
|
||||
};
|
||||
|
||||
enum ra_offset_area {
|
||||
RA_OFFSET_LEGACY_OFDM1,
|
||||
RA_OFFSET_LEGACY_OFDM2,
|
||||
RA_OFFSET_HT_OFDM1,
|
||||
RA_OFFSET_HT_OFDM2,
|
||||
RA_OFFSET_HT_OFDM3,
|
||||
RA_OFFSET_HT_OFDM4,
|
||||
RA_OFFSET_HT_CCK,
|
||||
};
|
||||
|
||||
enum antenna_path {
|
||||
ANTENNA_NONE,
|
||||
ANTENNA_D,
|
||||
ANTENNA_C,
|
||||
ANTENNA_CD,
|
||||
ANTENNA_B,
|
||||
ANTENNA_BD,
|
||||
ANTENNA_BC,
|
||||
ANTENNA_BCD,
|
||||
ANTENNA_A,
|
||||
ANTENNA_AD,
|
||||
ANTENNA_AC,
|
||||
ANTENNA_ACD,
|
||||
ANTENNA_AB,
|
||||
ANTENNA_ABD,
|
||||
ANTENNA_ABC,
|
||||
ANTENNA_ABCD
|
||||
};
|
||||
|
||||
struct r_antenna_select_ofdm {
|
||||
u32 r_tx_antenna:4;
|
||||
u32 r_ant_l:4;
|
||||
u32 r_ant_non_ht:4;
|
||||
u32 r_ant_ht1:4;
|
||||
u32 r_ant_ht2:4;
|
||||
u32 r_ant_ht_s1:4;
|
||||
u32 r_ant_non_ht_s1:4;
|
||||
u32 ofdm_txsc:2;
|
||||
u32 reserved:2;
|
||||
};
|
||||
|
||||
struct r_antenna_select_cck {
|
||||
u8 r_cckrx_enable_2:2;
|
||||
u8 r_cckrx_enable:2;
|
||||
u8 r_ccktx_enable:4;
|
||||
};
|
||||
|
||||
|
||||
struct efuse_contents {
|
||||
u8 mac_addr[ETH_ALEN];
|
||||
u8 cck_tx_power_idx[6];
|
||||
u8 ht40_1s_tx_power_idx[6];
|
||||
u8 ht40_2s_tx_power_idx_diff[3];
|
||||
u8 ht20_tx_power_idx_diff[3];
|
||||
u8 ofdm_tx_power_idx_diff[3];
|
||||
u8 ht40_max_power_offset[3];
|
||||
u8 ht20_max_power_offset[3];
|
||||
u8 channel_plan;
|
||||
u8 thermal_meter;
|
||||
u8 rf_option[5];
|
||||
u8 version;
|
||||
u8 oem_id;
|
||||
u8 regulatory;
|
||||
};
|
||||
|
||||
struct tx_power_struct {
|
||||
u8 cck[RTL92C_MAX_PATH_NUM][CHANNEL_MAX_NUMBER];
|
||||
u8 ht40_1s[RTL92C_MAX_PATH_NUM][CHANNEL_MAX_NUMBER];
|
||||
u8 ht40_2s[RTL92C_MAX_PATH_NUM][CHANNEL_MAX_NUMBER];
|
||||
u8 ht20_diff[RTL92C_MAX_PATH_NUM][CHANNEL_MAX_NUMBER];
|
||||
u8 legacy_ht_diff[RTL92C_MAX_PATH_NUM][CHANNEL_MAX_NUMBER];
|
||||
u8 legacy_ht_txpowerdiff;
|
||||
u8 groupht20[RTL92C_MAX_PATH_NUM][CHANNEL_MAX_NUMBER];
|
||||
u8 groupht40[RTL92C_MAX_PATH_NUM][CHANNEL_MAX_NUMBER];
|
||||
u8 pwrgroup_cnt;
|
||||
u32 mcs_original_offset[4][16];
|
||||
};
|
||||
|
||||
enum _ANT_DIV_TYPE {
|
||||
NO_ANTDIV = 0xFF,
|
||||
CG_TRX_HW_ANTDIV = 0x01,
|
||||
CGCS_RX_HW_ANTDIV = 0x02,
|
||||
enum ant_div_type {
|
||||
NO_ANTDIV = 0xFF,
|
||||
CG_TRX_HW_ANTDIV = 0x01,
|
||||
CGCS_RX_HW_ANTDIV = 0x02,
|
||||
FIXED_HW_ANTDIV = 0x03,
|
||||
CG_TRX_SMART_ANTDIV = 0x04,
|
||||
CGCS_RX_SW_ANTDIV = 0x05,
|
||||
CG_TRX_SMART_ANTDIV = 0x04,
|
||||
CGCS_RX_SW_ANTDIV = 0x05,
|
||||
|
||||
};
|
||||
|
||||
u32 rtl8723be_phy_query_rf_reg(struct ieee80211_hw *hw,
|
||||
@ -206,7 +127,6 @@ void rtl8723be_phy_sw_chnl_callback(struct ieee80211_hw *hw);
|
||||
u8 rtl8723be_phy_sw_chnl(struct ieee80211_hw *hw);
|
||||
void rtl8723be_phy_iq_calibrate(struct ieee80211_hw *hw,
|
||||
bool b_recovery);
|
||||
void rtl23b_phy_ap_calibrate(struct ieee80211_hw *hw, char delta);
|
||||
void rtl8723be_phy_lc_calibrate(struct ieee80211_hw *hw);
|
||||
void rtl8723be_phy_set_rfpath_switch(struct ieee80211_hw *hw, bool bmain);
|
||||
bool rtl8723be_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
|
||||
|
@ -26,7 +26,9 @@
|
||||
#ifndef __RTL8723BE_PWRSEQ_H__
|
||||
#define __RTL8723BE_PWRSEQ_H__
|
||||
|
||||
/* Check document WM-20130425-JackieLau-RTL8723B_Power_Architecture v05.vsd
|
||||
#include "../pwrseqcmd.h"
|
||||
/**
|
||||
* Check document WM-20130425-JackieLau-RTL8723B_Power_Architecture v05.vsd
|
||||
* There are 6 HW Power States:
|
||||
* 0: POFF--Power Off
|
||||
* 1: PDN--Power Down
|
||||
@ -35,7 +37,7 @@
|
||||
* 4: LPS--Low Power State
|
||||
* 5: SUS--Suspend
|
||||
*
|
||||
* The transition from different states are defined below
|
||||
* The transision from different states are defined below
|
||||
* TRANS_CARDEMU_TO_ACT
|
||||
* TRANS_ACT_TO_CARDEMU
|
||||
* TRANS_CARDEMU_TO_SUS
|
||||
@ -57,203 +59,320 @@
|
||||
#define RTL8723B_TRANS_END_STEPS 1
|
||||
|
||||
#define RTL8723B_TRANS_CARDEMU_TO_ACT \
|
||||
/* format */ \
|
||||
/* comments here */ \
|
||||
/* {offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value}, */\
|
||||
/*0x20[0] = 1b'1 enable LDOA12 MACRO block for all interface*/ \
|
||||
{0x0020, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
|
||||
PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0)}, \
|
||||
/*0x67[0] = 0 to disable BT_GPS_SEL pins*/ \
|
||||
{0x0067, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
|
||||
PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0}, \
|
||||
/*Delay 1ms*/ \
|
||||
{0x0001, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
|
||||
PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_DELAY, 1, PWRSEQ_DELAY_MS}, \
|
||||
/*0x00[5] = 1b'0 release analog Ips to digital ,1:isolation*/ \
|
||||
{0x0000, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
|
||||
PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(5), 0}, \
|
||||
/* disable SW LPS 0x04[10]=0 and WLSUS_EN 0x04[11]=0*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, (BIT(4)|BIT(3)|BIT(2)), 0}, \
|
||||
{0x0075, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0) , 0}, \
|
||||
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), BIT(1)}, \
|
||||
/* Disable USB suspend */ \
|
||||
{0x0075, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0) , BIT(0)}, \
|
||||
/* wait till 0x04[17] = 1 power ready*/ \
|
||||
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), BIT(1)}, \
|
||||
/* Enable USB suspend */ \
|
||||
{0x0075, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0) , 0}, \
|
||||
/* release WLON reset 0x04[16]=1*/ \
|
||||
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0)}, \
|
||||
/* disable HWPDN 0x04[15]=0*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), 0}, \
|
||||
/* disable WL suspend*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, (BIT(4)|BIT(3)), 0}, \
|
||||
/* polling until return 0*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0)}, \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(0), 0}, \
|
||||
/* Enable WL control XTAL setting*/ \
|
||||
{0x0010, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(6), BIT(6)}, \
|
||||
/*Enable falling edge triggering interrupt*/ \
|
||||
{0x0049, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)}, \
|
||||
/*Enable GPIO9 interrupt mode*/ \
|
||||
{0x0063, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)}, \
|
||||
/*Enable GPIO9 input mode*/ \
|
||||
{0x0062, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), 0}, \
|
||||
/*Enable HSISR GPIO[C:0] interrupt*/ \
|
||||
{0x0058, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0)}, \
|
||||
/*Enable HSISR GPIO9 interrupt*/ \
|
||||
{0x005A, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)}, \
|
||||
/*For GPIO9 internal pull high setting by test chip*/ \
|
||||
{0x0068, PWR_CUT_TESTCHIP_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3), BIT(3)}, \
|
||||
/*For GPIO9 internal pull high setting*/ \
|
||||
{0x0069, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(6), BIT(6)},
|
||||
|
||||
#define RTL8723B_TRANS_ACT_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* comments here */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
|
||||
/*0x1F[7:0] = 0 turn off RF*/ \
|
||||
{0x001F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0}, \
|
||||
/*0x4C[24] = 0x4F[0] = 0, */ \
|
||||
/*switch DPDT_SEL_P output from register 0x65[2] */ \
|
||||
{0x004F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0}, \
|
||||
/*Enable rising edge triggering interrupt*/ \
|
||||
{0x0049, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), 0}, \
|
||||
/*0x04[9] = 1 turn off MAC by HW state machine*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)}, \
|
||||
/*wait till 0x04[9] = 0 polling until return 0 to disable*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), 0}, \
|
||||
/* Enable BT control XTAL setting*/ \
|
||||
{0x0010, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(6), 0}, \
|
||||
/*0x00[5] = 1b'1 analog Ips to digital ,1:isolation*/ \
|
||||
{0x0000, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
|
||||
PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, \
|
||||
PWR_CMD_WRITE, BIT(5), BIT(5)}, \
|
||||
/*0x20[0] = 1b'0 disable LDOA12 MACRO block*/ \
|
||||
{0x0020, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
|
||||
PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, \
|
||||
PWR_CMD_WRITE, BIT(0), 0},
|
||||
|
||||
#define RTL8723B_TRANS_CARDEMU_TO_SUS \
|
||||
/* format */ \
|
||||
/* comments here */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\
|
||||
/*0x04[12:11] = 2b'11 enable WL suspend for PCIe*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4) | BIT(3), (BIT(4) | BIT(3))}, \
|
||||
/*0x04[12:11] = 2b'01 enable WL suspend*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
|
||||
PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, \
|
||||
PWR_CMD_WRITE, BIT(3) | BIT(4), BIT(3)}, \
|
||||
/*0x23[4] = 1b'1 12H LDO enter sleep mode*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)}, \
|
||||
/*0x07[7:0] = 0x20 SDIO SOP option to disable BG/MB/ACK/SWR*/ \
|
||||
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x20}, \
|
||||
/*0x04[12:11] = 2b'11 enable WL suspend for PCIe*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3) | BIT(4), BIT(3) | BIT(4)},\
|
||||
/*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), BIT(0)}, \
|
||||
/*wait power state to suspend*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), 0},
|
||||
|
||||
#define RTL8723B_TRANS_SUS_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* comments here */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
|
||||
/*clear suspend enable and power down enable*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3) | BIT(7), 0}, \
|
||||
/*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), 0}, \
|
||||
/*wait power state to suspend*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), BIT(1)}, \
|
||||
/*0x23[4] = 1b'0 12H LDO enter normal mode*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0}, \
|
||||
/*0x04[12:11] = 2b'01enable WL suspend*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), 0},
|
||||
|
||||
#define RTL8723B_TRANS_CARDEMU_TO_CARDDIS \
|
||||
/* format */ \
|
||||
/* comments here */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
|
||||
/*0x07=0x20 , SOP option to disable BG/MB*/ \
|
||||
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x20}, \
|
||||
/*0x04[12:11] = 2b'01 enable WL suspend*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
|
||||
PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)}, \
|
||||
/*0x04[10] = 1, enable SW LPS*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(2), BIT(2)}, \
|
||||
/*0x48[16] = 1 to enable GPIO9 as EXT WAKEUP*/ \
|
||||
{0x004A, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 1}, \
|
||||
/*0x23[4] = 1b'1 12H LDO enter sleep mode*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)}, \
|
||||
/*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), BIT(0)}, \
|
||||
/*wait power state to suspend*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), 0},
|
||||
|
||||
#define RTL8723B_TRANS_CARDDIS_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* comments here */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
|
||||
/*clear suspend enable and power down enable*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3) | BIT(7), 0}, \
|
||||
/*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), 0}, \
|
||||
/*wait power state to suspend*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), BIT(1)}, \
|
||||
/*0x48[16] = 0 to disable GPIO9 as EXT WAKEUP*/ \
|
||||
{0x004A, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0}, \
|
||||
/*0x04[12:11] = 2b'01enable WL suspend*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), 0}, \
|
||||
/*0x23[4] = 1b'0 12H LDO enter normal mode*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0}, \
|
||||
/*PCIe DMA start*/ \
|
||||
{0x0301, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0},
|
||||
|
||||
#define RTL8723B_TRANS_CARDEMU_TO_PDN \
|
||||
/* format */ \
|
||||
/* comments here */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
|
||||
/*0x23[4] = 1b'1 12H LDO enter sleep mode*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)}, \
|
||||
/*0x07[7:0] = 0x20 SOP option to disable BG/MB/ACK/SWR*/ \
|
||||
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
|
||||
PWR_INTF_SDIO_MSK | PWR_INTF_USB_MSK, PWR_BASEADDR_MAC, \
|
||||
PWR_CMD_WRITE, 0xFF, 0x20}, \
|
||||
/* 0x04[16] = 0*/ \
|
||||
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0}, \
|
||||
/* 0x04[15] = 1*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), BIT(7)},
|
||||
|
||||
#define RTL8723B_TRANS_PDN_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* comments here */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
|
||||
/* 0x04[15] = 0*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), 0},
|
||||
|
||||
#define RTL8723B_TRANS_ACT_TO_LPS \
|
||||
/* format */ \
|
||||
/* comments here */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
|
||||
/*PCIe DMA stop*/ \
|
||||
{0x0301, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0xFF}, \
|
||||
/*Tx Pause*/ \
|
||||
{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0xFF}, \
|
||||
/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05F8, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0}, \
|
||||
/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05F9, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0}, \
|
||||
/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05FA, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0}, \
|
||||
/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05FB, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0}, \
|
||||
/*CCK and OFDM are disabled,and clock are gated*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0}, \
|
||||
/*Delay 1us*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_DELAY, 0, PWRSEQ_DELAY_US}, \
|
||||
/*Whole BB is reset*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), 0}, \
|
||||
/*Reset MAC TRX*/ \
|
||||
{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x03}, \
|
||||
/*check if removed later*/ \
|
||||
{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), 0}, \
|
||||
/*When driver enter Sus/ Disable, enable LOP for BT*/ \
|
||||
{0x0093, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x00}, \
|
||||
/*Respond TxOK to scheduler*/ \
|
||||
{0x0553, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(5), BIT(5)},
|
||||
|
||||
#define RTL8723B_TRANS_LPS_TO_ACT \
|
||||
/* format */ \
|
||||
/* comments here */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
|
||||
/*SDIO RPWM*/ \
|
||||
{0x0080, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
|
||||
PWR_BASEADDR_SDIO, PWR_CMD_WRITE, 0xFF, 0x84}, \
|
||||
PWR_BASEADDR_SDIO, PWR_CMD_WRITE, 0xFF, 0x84}, \
|
||||
/*USB RPWM*/ \
|
||||
{0xFE58, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x84}, \
|
||||
/*PCIe RPWM*/ \
|
||||
{0x0361, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x84}, \
|
||||
/*Delay*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_DELAY, 0, PWRSEQ_DELAY_MS}, \
|
||||
/*. 0x08[4] = 0 switch TSF to 40M*/ \
|
||||
{0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0}, \
|
||||
/*Polling 0x109[7]=0 TSF in 40M*/ \
|
||||
{0x0109, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(7), 0}, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(7), 0}, \
|
||||
/*. 0x29[7:6] = 2b'00 enable BB clock*/ \
|
||||
{0x0029, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(6)|BIT(7), 0}, \
|
||||
/*. 0x101[1] = 1*/ \
|
||||
{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)}, \
|
||||
/*. 0x100[7:0] = 0xFF enable WMAC TRX*/ \
|
||||
{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0xFF}, \
|
||||
/*. 0x02[1:0] = 2b'11 enable BB macro*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1) | BIT(0), BIT(1) | BIT(0)}, \
|
||||
/*. 0x522 = 0*/ \
|
||||
{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
|
||||
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0},
|
||||
|
||||
#define RTL8723B_TRANS_END \
|
||||
/* format */ \
|
||||
/* comments here */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
|
||||
{0xFFFF, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, 0, \
|
||||
PWR_CMD_END, 0, 0},
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -51,7 +51,7 @@ void rtl8723be_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
|
||||
rtlphy->rfreg_chnlval[0]);
|
||||
break;
|
||||
default:
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
|
||||
"unknown bandwidth: %#X\n", bandwidth);
|
||||
break;
|
||||
}
|
||||
@ -93,18 +93,20 @@ void rtl8723be_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw,
|
||||
(ppowerlevel[idx1] << 16) |
|
||||
(ppowerlevel[idx1] << 24);
|
||||
}
|
||||
|
||||
if (rtlefuse->eeprom_regulatory == 0) {
|
||||
tmpval =
|
||||
(rtlphy->mcs_offset[0][6]) +
|
||||
(rtlphy->mcs_offset[0][7] << 8);
|
||||
(rtlphy->mcs_txpwrlevel_origoffset[0][6]) +
|
||||
(rtlphy->mcs_txpwrlevel_origoffset[0][7] << 8);
|
||||
tx_agc[RF90_PATH_A] += tmpval;
|
||||
|
||||
tmpval = (rtlphy->mcs_offset[0][14]) +
|
||||
(rtlphy->mcs_offset[0][15] <<
|
||||
tmpval = (rtlphy->mcs_txpwrlevel_origoffset[0][14]) +
|
||||
(rtlphy->mcs_txpwrlevel_origoffset[0][15] <<
|
||||
24);
|
||||
tx_agc[RF90_PATH_B] += tmpval;
|
||||
}
|
||||
}
|
||||
|
||||
for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) {
|
||||
ptr = (u8 *)(&(tx_agc[idx1]));
|
||||
for (idx2 = 0; idx2 < 4; idx2++) {
|
||||
@ -124,30 +126,32 @@ void rtl8723be_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw,
|
||||
tmpval = tx_agc[RF90_PATH_A] & 0xff;
|
||||
rtl_set_bbreg(hw, RTXAGC_A_CCK1_MCS32, MASKBYTE1, tmpval);
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
||||
"CCK PWR 1M (rf-A) = 0x%x (reg 0x%x)\n", tmpval,
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
"CCK PWR 1M (rf-A) = 0x%x (reg 0x%x)\n", tmpval,
|
||||
RTXAGC_A_CCK1_MCS32);
|
||||
|
||||
tmpval = tx_agc[RF90_PATH_A] >> 8;
|
||||
|
||||
/*tmpval = tmpval & 0xff00ffff;*/
|
||||
|
||||
rtl_set_bbreg(hw, RTXAGC_B_CCK11_A_CCK2_11, 0xffffff00, tmpval);
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
||||
"CCK PWR 2~11M (rf-A) = 0x%x (reg 0x%x)\n", tmpval,
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
"CCK PWR 2~11M (rf-A) = 0x%x (reg 0x%x)\n", tmpval,
|
||||
RTXAGC_B_CCK11_A_CCK2_11);
|
||||
|
||||
tmpval = tx_agc[RF90_PATH_B] >> 24;
|
||||
rtl_set_bbreg(hw, RTXAGC_B_CCK11_A_CCK2_11, MASKBYTE0, tmpval);
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
||||
"CCK PWR 11M (rf-B) = 0x%x (reg 0x%x)\n", tmpval,
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
"CCK PWR 11M (rf-B) = 0x%x (reg 0x%x)\n", tmpval,
|
||||
RTXAGC_B_CCK11_A_CCK2_11);
|
||||
|
||||
tmpval = tx_agc[RF90_PATH_B] & 0x00ffffff;
|
||||
rtl_set_bbreg(hw, RTXAGC_B_CCK1_55_MCS32, 0xffffff00, tmpval);
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
||||
"CCK PWR 1~5.5M (rf-B) = 0x%x (reg 0x%x)\n", tmpval,
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
"CCK PWR 1~5.5M (rf-B) = 0x%x (reg 0x%x)\n", tmpval,
|
||||
RTXAGC_B_CCK1_55_MCS32);
|
||||
}
|
||||
|
||||
@ -169,8 +173,8 @@ static void rtl8723be_phy_get_power_base(struct ieee80211_hw *hw,
|
||||
powerbase0 = (powerbase0 << 24) | (powerbase0 << 16) |
|
||||
(powerbase0 << 8) | powerbase0;
|
||||
*(ofdmbase + i) = powerbase0;
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
||||
" [OFDM power base index rf(%c) = 0x%x]\n",
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
" [OFDM power base index rf(%c) = 0x%x]\n",
|
||||
((i == 0) ? 'A' : 'B'), *(ofdmbase + i));
|
||||
}
|
||||
|
||||
@ -179,27 +183,30 @@ static void rtl8723be_phy_get_power_base(struct ieee80211_hw *hw,
|
||||
powerlevel[i] = ppowerlevel_bw20[i];
|
||||
else
|
||||
powerlevel[i] = ppowerlevel_bw40[i];
|
||||
|
||||
powerbase1 = powerlevel[i];
|
||||
powerbase1 = (powerbase1 << 24) | (powerbase1 << 16) |
|
||||
(powerbase1 << 8) | powerbase1;
|
||||
|
||||
*(mcsbase + i) = powerbase1;
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
" [MCS power base index rf(%c) = 0x%x]\n",
|
||||
((i == 0) ? 'A' : 'B'), *(mcsbase + i));
|
||||
((i == 0) ? 'A' : 'B'), *(mcsbase + i));
|
||||
}
|
||||
}
|
||||
|
||||
static void txpwr_by_regulatory(struct ieee80211_hw *hw, u8 channel, u8 index,
|
||||
u32 *powerbase0, u32 *powerbase1,
|
||||
u32 *p_outwriteval)
|
||||
static void _rtl8723be_get_txpower_writeval_by_regulatory(
|
||||
struct ieee80211_hw *hw,
|
||||
u8 channel, u8 index,
|
||||
u32 *powerbase0,
|
||||
u32 *powerbase1,
|
||||
u32 *p_outwriteval)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_phy *rtlphy = &(rtlpriv->phy);
|
||||
struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
|
||||
u8 i, chnlgroup = 0, pwr_diff_limit[4];
|
||||
u8 pwr_diff = 0, customer_pwr_diff;
|
||||
u8 i, chnlgroup = 0, pwr_diff_limit[4], pwr_diff = 0, customer_pwr_diff;
|
||||
u32 writeval, customer_limit, rf;
|
||||
|
||||
for (rf = 0; rf < 2; rf++) {
|
||||
@ -208,13 +215,13 @@ static void txpwr_by_regulatory(struct ieee80211_hw *hw, u8 channel, u8 index,
|
||||
chnlgroup = 0;
|
||||
|
||||
writeval =
|
||||
rtlphy->mcs_offset[chnlgroup][index + (rf ? 8 : 0)]
|
||||
rtlphy->mcs_txpwrlevel_origoffset[chnlgroup][index +
|
||||
(rf ? 8 : 0)]
|
||||
+ ((index < 2) ? powerbase0[rf] : powerbase1[rf]);
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
||||
"RTK better performance, "
|
||||
"writeval(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'), writeval);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
"RTK better performance, writeval(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'), writeval);
|
||||
break;
|
||||
case 1:
|
||||
if (rtlphy->pwrgroup_cnt == 1) {
|
||||
@ -233,43 +240,41 @@ static void txpwr_by_regulatory(struct ieee80211_hw *hw, u8 channel, u8 index,
|
||||
else if (channel == 14)
|
||||
chnlgroup = 5;
|
||||
}
|
||||
writeval = rtlphy->mcs_offset[chnlgroup]
|
||||
|
||||
writeval =
|
||||
rtlphy->mcs_txpwrlevel_origoffset[chnlgroup]
|
||||
[index + (rf ? 8 : 0)] + ((index < 2) ?
|
||||
powerbase0[rf] :
|
||||
powerbase1[rf]);
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
||||
"Realtek regulatory, 20MHz, "
|
||||
"writeval(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'), writeval);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
"Realtek regulatory, 20MHz, writeval(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'), writeval);
|
||||
|
||||
break;
|
||||
case 2:
|
||||
writeval =
|
||||
((index < 2) ? powerbase0[rf] : powerbase1[rf]);
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
||||
"Better regulatory, "
|
||||
"writeval(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'), writeval);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
"Better regulatory, writeval(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'), writeval);
|
||||
break;
|
||||
case 3:
|
||||
chnlgroup = 0;
|
||||
|
||||
if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) {
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
||||
"customer's limit, 40MHz "
|
||||
"rf(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'),
|
||||
rtlefuse->pwrgroup_ht40[rf]
|
||||
[channel-1]);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
"customer's limit, 40MHz rf(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'),
|
||||
rtlefuse->pwrgroup_ht40
|
||||
[rf][channel - 1]);
|
||||
} else {
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
||||
"customer's limit, 20MHz "
|
||||
"rf(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'),
|
||||
rtlefuse->pwrgroup_ht20[rf]
|
||||
[channel-1]);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
"customer's limit, 20MHz rf(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'),
|
||||
rtlefuse->pwrgroup_ht20
|
||||
[rf][channel - 1]);
|
||||
}
|
||||
|
||||
if (index < 2)
|
||||
@ -294,9 +299,9 @@ static void txpwr_by_regulatory(struct ieee80211_hw *hw, u8 channel, u8 index,
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
pwr_diff_limit[i] =
|
||||
(u8)((rtlphy->mcs_offset
|
||||
[chnlgroup][index + (rf ? 8 : 0)] &
|
||||
(0x7f << (i * 8))) >> (i * 8));
|
||||
(u8)((rtlphy->mcs_txpwrlevel_origoffset
|
||||
[chnlgroup][index + (rf ? 8 : 0)] &
|
||||
(0x7f << (i * 8))) >> (i * 8));
|
||||
|
||||
if (pwr_diff_limit[i] > pwr_diff)
|
||||
pwr_diff_limit[i] = pwr_diff;
|
||||
@ -307,29 +312,28 @@ static void txpwr_by_regulatory(struct ieee80211_hw *hw, u8 channel, u8 index,
|
||||
(pwr_diff_limit[1] << 8) |
|
||||
(pwr_diff_limit[0]);
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
"Customer's limit rf(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'), customer_limit);
|
||||
((rf == 0) ? 'A' : 'B'), customer_limit);
|
||||
|
||||
writeval = customer_limit + ((index < 2) ?
|
||||
powerbase0[rf] :
|
||||
powerbase1[rf]);
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
||||
"Customer, writeval rf(%c)= 0x%x\n",
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
"Customer, writeval rf(%c)= 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'), writeval);
|
||||
break;
|
||||
default:
|
||||
chnlgroup = 0;
|
||||
writeval =
|
||||
rtlphy->mcs_offset[chnlgroup]
|
||||
rtlphy->mcs_txpwrlevel_origoffset[chnlgroup]
|
||||
[index + (rf ? 8 : 0)]
|
||||
+ ((index < 2) ? powerbase0[rf] : powerbase1[rf]);
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
||||
"RTK better performance, writeval "
|
||||
"rf(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'), writeval);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
"RTK better performance, writeval rf(%c) = 0x%x\n",
|
||||
((rf == 0) ? 'A' : 'B'), writeval);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -343,7 +347,7 @@ static void txpwr_by_regulatory(struct ieee80211_hw *hw, u8 channel, u8 index,
|
||||
}
|
||||
|
||||
static void _rtl8723be_write_ofdm_power_reg(struct ieee80211_hw *hw,
|
||||
u8 index, u32 *value)
|
||||
u8 index, u32 *pvalue)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
u16 regoffset_a[6] = {
|
||||
@ -361,9 +365,9 @@ static void _rtl8723be_write_ofdm_power_reg(struct ieee80211_hw *hw,
|
||||
u16 regoffset;
|
||||
|
||||
for (rf = 0; rf < 2; rf++) {
|
||||
writeval = value[rf];
|
||||
writeval = pvalue[rf];
|
||||
for (i = 0; i < 4; i++) {
|
||||
pwr_val[i] = (u8) ((writeval & (0x7f <<
|
||||
pwr_val[i] = (u8)((writeval & (0x7f <<
|
||||
(i * 8))) >> (i * 8));
|
||||
|
||||
if (pwr_val[i] > RF6052_MAX_TX_PWR)
|
||||
@ -378,8 +382,8 @@ static void _rtl8723be_write_ofdm_power_reg(struct ieee80211_hw *hw,
|
||||
regoffset = regoffset_b[index];
|
||||
rtl_set_bbreg(hw, regoffset, MASKDWORD, writeval);
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
|
||||
"Set 0x%x = %08x\n", regoffset, writeval);
|
||||
RTPRINT(rtlpriv, FPHY, PHY_TXPWR,
|
||||
"Set 0x%x = %08x\n", regoffset, writeval);
|
||||
}
|
||||
}
|
||||
|
||||
@ -400,8 +404,11 @@ void rtl8723be_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw,
|
||||
rtl8723be_dm_txpower_track_adjust(hw, 1, &direction, &pwrtrac_value);
|
||||
|
||||
for (index = 0; index < 6; index++) {
|
||||
txpwr_by_regulatory(hw, channel, index, &powerbase0[0],
|
||||
&powerbase1[0], &writeval[0]);
|
||||
_rtl8723be_get_txpower_writeval_by_regulatory(hw,
|
||||
channel, index,
|
||||
&powerbase0[0],
|
||||
&powerbase1[0],
|
||||
&writeval[0]);
|
||||
if (direction == 1) {
|
||||
writeval[0] += pwrtrac_value;
|
||||
writeval[1] += pwrtrac_value;
|
||||
@ -424,16 +431,17 @@ bool rtl8723be_phy_rf6052_config(struct ieee80211_hw *hw)
|
||||
rtlphy->num_total_rfpath = 2;
|
||||
|
||||
return _rtl8723be_phy_rf6052_config_parafile(hw);
|
||||
|
||||
}
|
||||
|
||||
static bool _rtl8723be_phy_rf6052_config_parafile(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_phy *rtlphy = &(rtlpriv->phy);
|
||||
struct bb_reg_def *pphyreg;
|
||||
u32 u4_regvalue = 0;
|
||||
u8 rfpath;
|
||||
bool rtstatus = true;
|
||||
struct bb_reg_def *pphyreg;
|
||||
|
||||
for (rfpath = 0; rfpath < rtlphy->num_total_rfpath; rfpath++) {
|
||||
pphyreg = &rtlphy->phyreg_def[rfpath];
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "phy.h"
|
||||
#include "../rtl8723com/phy_common.h"
|
||||
#include "dm.h"
|
||||
#include "../rtl8723com/dm_common.h"
|
||||
#include "hw.h"
|
||||
#include "fw.h"
|
||||
#include "../rtl8723com/fw_common.h"
|
||||
@ -101,6 +102,8 @@ int rtl8723be_init_sw_vars(struct ieee80211_hw *hw)
|
||||
rtlpriv->dm.thermalvalue = 0;
|
||||
rtlpci->transmit_config = CFENDFORM | BIT(15) | BIT(24) | BIT(25);
|
||||
|
||||
rtlpriv->phy.lck_inprogress = false;
|
||||
|
||||
mac->ht_enable = true;
|
||||
|
||||
/* compatible 5G band 88ce just 2.4G band & smsp */
|
||||
@ -137,12 +140,19 @@ int rtl8723be_init_sw_vars(struct ieee80211_hw *hw)
|
||||
|
||||
rtlpci->irq_mask[1] = (u32)(IMR_RXFOVW | 0);
|
||||
|
||||
rtlpci->sys_irq_mask = (u32)(HSIMR_PDN_INT_EN |
|
||||
HSIMR_RON_INT_EN |
|
||||
0);
|
||||
|
||||
/* for debug level */
|
||||
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
|
||||
/* for LPS & IPS */
|
||||
rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
|
||||
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
|
||||
rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps;
|
||||
rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
|
||||
if (rtlpriv->cfg->mod_params->disable_watchdog)
|
||||
pr_info("watchdog disabled\n");
|
||||
rtlpriv->psc.reg_fwctrl_lps = 3;
|
||||
rtlpriv->psc.reg_max_lps_awakeintvl = 5;
|
||||
/* for ASPM, you can close aspm through
|
||||
@ -157,6 +167,11 @@ int rtl8723be_init_sw_vars(struct ieee80211_hw *hw)
|
||||
else if (rtlpriv->psc.reg_fwctrl_lps == 3)
|
||||
rtlpriv->psc.fwctrl_psmode = FW_PS_DTIM_MODE;
|
||||
|
||||
/*low power: Disable 32k */
|
||||
rtlpriv->psc.low_power_enable = false;
|
||||
|
||||
rtlpriv->rtlhal.earlymode_enable = false;
|
||||
|
||||
/* for firmware buf */
|
||||
rtlpriv->rtlhal.pfirmware = vzalloc(0x8000);
|
||||
if (!rtlpriv->rtlhal.pfirmware) {
|
||||
@ -182,8 +197,6 @@ void rtl8723be_deinit_sw_vars(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
|
||||
if (rtlpriv->cfg->ops->get_btc_status())
|
||||
rtlpriv->btcoexist.btc_ops->btc_halt_notify();
|
||||
if (rtlpriv->rtlhal.pfirmware) {
|
||||
vfree(rtlpriv->rtlhal.pfirmware);
|
||||
rtlpriv->rtlhal.pfirmware = NULL;
|
||||
@ -245,6 +258,7 @@ static struct rtl_hal_ops rtl8723be_hal_ops = {
|
||||
.set_rfreg = rtl8723be_phy_set_rf_reg,
|
||||
.fill_h2c_cmd = rtl8723be_fill_h2c_cmd,
|
||||
.get_btc_status = rtl8723be_get_btc_status,
|
||||
.rx_command_packet = rtl8723be_rx_command_packet,
|
||||
.is_fw_header = is_fw_header,
|
||||
};
|
||||
|
||||
@ -253,8 +267,6 @@ static struct rtl_mod_params rtl8723be_mod_params = {
|
||||
.inactiveps = true,
|
||||
.swctrl_lps = false,
|
||||
.fwctrl_lps = true,
|
||||
.msi_support = false,
|
||||
.debug = DBG_EMERG,
|
||||
};
|
||||
|
||||
static struct rtl_hal_cfg rtl8723be_hal_cfg = {
|
||||
@ -272,6 +284,9 @@ static struct rtl_hal_cfg rtl8723be_hal_cfg = {
|
||||
.maps[MAC_RCR_ACRC32] = ACRC32,
|
||||
.maps[MAC_RCR_ACF] = ACF,
|
||||
.maps[MAC_RCR_AAP] = AAP,
|
||||
.maps[MAC_HIMR] = REG_HIMR,
|
||||
.maps[MAC_HIMRE] = REG_HIMRE,
|
||||
.maps[MAC_HSISR] = REG_HSISR,
|
||||
|
||||
.maps[EFUSE_ACCESS] = REG_EFUSE_ACCESS,
|
||||
|
||||
@ -305,6 +320,7 @@ static struct rtl_hal_cfg rtl8723be_hal_cfg = {
|
||||
.maps[RTL_IMR_BCNDMAINT3] = IMR_BCNDMAINT3,
|
||||
.maps[RTL_IMR_BCNDMAINT2] = IMR_BCNDMAINT2,
|
||||
.maps[RTL_IMR_BCNDMAINT1] = IMR_BCNDMAINT1,
|
||||
/* .maps[RTL_IMR_BCNDOK8] = IMR_BCNDOK8, */ /*need check*/
|
||||
.maps[RTL_IMR_BCNDOK7] = IMR_BCNDOK7,
|
||||
.maps[RTL_IMR_BCNDOK6] = IMR_BCNDOK6,
|
||||
.maps[RTL_IMR_BCNDOK5] = IMR_BCNDOK5,
|
||||
@ -312,6 +328,8 @@ static struct rtl_hal_cfg rtl8723be_hal_cfg = {
|
||||
.maps[RTL_IMR_BCNDOK3] = IMR_BCNDOK3,
|
||||
.maps[RTL_IMR_BCNDOK2] = IMR_BCNDOK2,
|
||||
.maps[RTL_IMR_BCNDOK1] = IMR_BCNDOK1,
|
||||
/* .maps[RTL_IMR_TIMEOUT2] = IMR_TIMEOUT2,*/
|
||||
/* .maps[RTL_IMR_TIMEOUT1] = IMR_TIMEOUT1,*/
|
||||
|
||||
.maps[RTL_IMR_TXFOVW] = IMR_TXFOVW,
|
||||
.maps[RTL_IMR_PSTIMEOUT] = IMR_PSTIMEOUT,
|
||||
@ -329,6 +347,7 @@ static struct rtl_hal_cfg rtl8723be_hal_cfg = {
|
||||
.maps[RTL_IMR_VIDOK] = IMR_VIDOK,
|
||||
.maps[RTL_IMR_VODOK] = IMR_VODOK,
|
||||
.maps[RTL_IMR_ROK] = IMR_ROK,
|
||||
.maps[RTL_IMR_HSISR_IND] = IMR_HSISR_IND_ON_INT,
|
||||
.maps[RTL_IBSS_INT_MASKS] = (IMR_BCNDMAINT0 | IMR_TBDOK | IMR_TBDER),
|
||||
|
||||
.maps[RTL_RC_CCK_RATE1M] = DESC92C_RATE1M,
|
||||
@ -348,12 +367,12 @@ static struct rtl_hal_cfg rtl8723be_hal_cfg = {
|
||||
.maps[RTL_RC_HT_RATEMCS15] = DESC92C_RATEMCS15,
|
||||
};
|
||||
|
||||
static const struct pci_device_id rtl8723be_pci_id[] = {
|
||||
{RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0xb723, rtl8723be_hal_cfg)},
|
||||
static struct pci_device_id rtl8723be_pci_ids[] = {
|
||||
{RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0xB723, rtl8723be_hal_cfg)},
|
||||
{},
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(pci, rtl8723be_pci_id);
|
||||
MODULE_DEVICE_TABLE(pci, rtl8723be_pci_ids);
|
||||
|
||||
MODULE_AUTHOR("PageHe <page_he@realsil.com.cn>");
|
||||
MODULE_AUTHOR("Realtek WlanFAE <wlanfae@realtek.com>");
|
||||
@ -366,21 +385,22 @@ module_param_named(debug, rtl8723be_mod_params.debug, int, 0444);
|
||||
module_param_named(ips, rtl8723be_mod_params.inactiveps, bool, 0444);
|
||||
module_param_named(swlps, rtl8723be_mod_params.swctrl_lps, bool, 0444);
|
||||
module_param_named(fwlps, rtl8723be_mod_params.fwctrl_lps, bool, 0444);
|
||||
module_param_named(msi, rtl8723be_mod_params.msi_support, bool, 0444);
|
||||
module_param_named(disable_watchdog, rtl8723be_mod_params.disable_watchdog,
|
||||
bool, 0444);
|
||||
MODULE_PARM_DESC(swenc, "using hardware crypto (default 0 [hardware])\n");
|
||||
MODULE_PARM_DESC(ips, "using no link power save (default 1 is open)\n");
|
||||
MODULE_PARM_DESC(fwlps, "using linked fw control power save (default 1 is open)\n");
|
||||
MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 0)\n");
|
||||
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
|
||||
MODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n");
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);
|
||||
|
||||
static struct pci_driver rtl8723be_driver = {
|
||||
.name = KBUILD_MODNAME,
|
||||
.id_table = rtl8723be_pci_id,
|
||||
.id_table = rtl8723be_pci_ids,
|
||||
.probe = rtl_pci_probe,
|
||||
.remove = rtl_pci_disconnect,
|
||||
|
||||
.driver.pm = &rtlwifi_pm_ops,
|
||||
};
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -35,7 +35,7 @@ extern u32 RTL8723BEPHY_REG_1TARRAY[];
|
||||
extern u32 RTL8723BEPHY_REG_ARRAY_PG[];
|
||||
#define RTL8723BE_RADIOA_1TARRAYLEN 206
|
||||
extern u32 RTL8723BE_RADIOA_1TARRAY[];
|
||||
#define RTL8723BEMAC_1T_ARRAYLEN 194
|
||||
#define RTL8723BEMAC_1T_ARRAYLEN 196
|
||||
extern u32 RTL8723BEMAC_1T_ARRAY[];
|
||||
#define RTL8723BEAGCTAB_1TARRAYLEN 260
|
||||
extern u32 RTL8723BEAGCTAB_1TARRAY[];
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "trx.h"
|
||||
#include "led.h"
|
||||
#include "dm.h"
|
||||
#include "fw.h"
|
||||
|
||||
static u8 _rtl8723be_map_hwqueue_to_fwqueue(struct sk_buff *skb, u8 hw_queue)
|
||||
{
|
||||
@ -207,196 +208,150 @@ static int _rtl8723be_rate_mapping(struct ieee80211_hw *hw,
|
||||
static void _rtl8723be_query_rxphystatus(struct ieee80211_hw *hw,
|
||||
struct rtl_stats *pstatus, u8 *pdesc,
|
||||
struct rx_fwinfo_8723be *p_drvinfo,
|
||||
bool packet_match_bssid,
|
||||
bool packet_toself,
|
||||
bool bpacket_match_bssid,
|
||||
bool bpacket_toself,
|
||||
bool packet_beacon)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_ps_ctl *ppsc = rtl_psc(rtlpriv);
|
||||
struct phy_sts_cck_8723e_t *cck_buf;
|
||||
struct phy_status_rpt *p_phystrpt = (struct phy_status_rpt *)p_drvinfo;
|
||||
struct rtl_dm *rtldm = rtl_dm(rtl_priv(hw));
|
||||
char rx_pwr_all = 0, rx_pwr[4];
|
||||
u8 rf_rx_num = 0, evm, pwdb_all;
|
||||
u8 rf_rx_num = 0, evm, pwdb_all, pwdb_all_bt = 0;
|
||||
u8 i, max_spatial_stream;
|
||||
u32 rssi, total_rssi = 0;
|
||||
bool is_cck = pstatus->is_cck;
|
||||
u8 lan_idx, vga_idx;
|
||||
|
||||
/* Record it for next packet processing */
|
||||
pstatus->packet_matchbssid = packet_match_bssid;
|
||||
pstatus->packet_toself = packet_toself;
|
||||
pstatus->packet_matchbssid = bpacket_match_bssid;
|
||||
pstatus->packet_toself = bpacket_toself;
|
||||
pstatus->packet_beacon = packet_beacon;
|
||||
pstatus->rx_mimo_sig_qual[0] = -1;
|
||||
pstatus->rx_mimo_sig_qual[1] = -1;
|
||||
pstatus->rx_mimo_signalquality[0] = -1;
|
||||
pstatus->rx_mimo_signalquality[1] = -1;
|
||||
|
||||
if (is_cck) {
|
||||
u8 cck_highpwr;
|
||||
u8 cck_agc_rpt;
|
||||
/* CCK Driver info Structure is not the same as OFDM packet. */
|
||||
cck_buf = (struct phy_sts_cck_8723e_t *)p_drvinfo;
|
||||
cck_agc_rpt = cck_buf->cck_agc_rpt;
|
||||
|
||||
/* (1)Hardware does not provide RSSI for CCK
|
||||
* (2)PWDB, Average PWDB cacluated by
|
||||
cck_agc_rpt = p_phystrpt->cck_agc_rpt_ofdm_cfosho_a;
|
||||
|
||||
/* (1)Hardware does not provide RSSI for CCK */
|
||||
/* (2)PWDB, Average PWDB cacluated by
|
||||
* hardware (for rate adaptive)
|
||||
*/
|
||||
if (ppsc->rfpwr_state == ERFON)
|
||||
cck_highpwr = (u8) rtl_get_bbreg(hw,
|
||||
RFPGA0_XA_HSSIPARAMETER2,
|
||||
BIT(9));
|
||||
else
|
||||
cck_highpwr = false;
|
||||
cck_highpwr = (u8)rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2,
|
||||
BIT(9));
|
||||
|
||||
lan_idx = ((cck_agc_rpt & 0xE0) >> 5);
|
||||
vga_idx = (cck_agc_rpt & 0x1f);
|
||||
|
||||
switch (lan_idx) {
|
||||
case 7:
|
||||
if (vga_idx <= 27)/*VGA_idx = 27~2*/
|
||||
rx_pwr_all = -100 + 2 * (27 - vga_idx);
|
||||
else
|
||||
rx_pwr_all = -100;
|
||||
/* 46 53 73 95 201301231630 */
|
||||
/* 46 53 77 99 201301241630 */
|
||||
case 6:
|
||||
rx_pwr_all = -34 - (2 * vga_idx);
|
||||
break;
|
||||
case 6:/*VGA_idx = 2~0*/
|
||||
rx_pwr_all = -48 + 2 * (2 - vga_idx);
|
||||
break;
|
||||
case 5:/*VGA_idx = 7~5*/
|
||||
rx_pwr_all = -42 + 2 * (7 - vga_idx);
|
||||
break;
|
||||
case 4:/*VGA_idx = 7~4*/
|
||||
rx_pwr_all = -36 + 2 * (7 - vga_idx);
|
||||
break;
|
||||
case 3:/*VGA_idx = 7~0*/
|
||||
rx_pwr_all = -24 + 2 * (7 - vga_idx);
|
||||
break;
|
||||
case 2:
|
||||
if (cck_highpwr)/*VGA_idx = 5~0*/
|
||||
rx_pwr_all = -12 + 2 * (5 - vga_idx);
|
||||
else
|
||||
rx_pwr_all = -6 + 2 * (5 - vga_idx);
|
||||
case 4:
|
||||
rx_pwr_all = -14 - (2 * vga_idx);
|
||||
break;
|
||||
case 1:
|
||||
rx_pwr_all = 8 - 2 * vga_idx;
|
||||
rx_pwr_all = 6 - (2 * vga_idx);
|
||||
break;
|
||||
case 0:
|
||||
rx_pwr_all = 14 - 2 * vga_idx;
|
||||
rx_pwr_all = 16 - (2 * vga_idx);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
rx_pwr_all += 6;
|
||||
|
||||
pwdb_all = rtl_query_rxpwrpercentage(rx_pwr_all);
|
||||
/* CCK gain is smaller than OFDM/MCS gain, */
|
||||
/* so we add gain diff by experiences,
|
||||
* the val is 6
|
||||
*/
|
||||
pwdb_all += 6;
|
||||
if (pwdb_all > 100)
|
||||
pwdb_all = 100;
|
||||
/* modify the offset to make the same gain index with OFDM. */
|
||||
if (pwdb_all > 34 && pwdb_all <= 42)
|
||||
pwdb_all -= 2;
|
||||
else if (pwdb_all > 26 && pwdb_all <= 34)
|
||||
pwdb_all -= 6;
|
||||
else if (pwdb_all > 14 && pwdb_all <= 26)
|
||||
pwdb_all -= 8;
|
||||
else if (pwdb_all > 4 && pwdb_all <= 14)
|
||||
pwdb_all -= 4;
|
||||
if (!cck_highpwr) {
|
||||
if (pwdb_all >= 80)
|
||||
pwdb_all = ((pwdb_all - 80) << 1) +
|
||||
((pwdb_all - 80) >> 1) + 80;
|
||||
else if ((pwdb_all <= 78) && (pwdb_all >= 20))
|
||||
pwdb_all += 3;
|
||||
if (pwdb_all > 100)
|
||||
pwdb_all = 100;
|
||||
}
|
||||
|
||||
pstatus->rx_pwdb_all = pwdb_all;
|
||||
pstatus->bt_rx_rssi_percentage = pwdb_all;
|
||||
pstatus->recvsignalpower = rx_pwr_all;
|
||||
|
||||
/* (3) Get Signal Quality (EVM) */
|
||||
if (packet_match_bssid) {
|
||||
u8 sq;
|
||||
|
||||
if (bpacket_match_bssid) {
|
||||
u8 sq, sq_rpt;
|
||||
if (pstatus->rx_pwdb_all > 40) {
|
||||
sq = 100;
|
||||
} else {
|
||||
sq = cck_buf->sq_rpt;
|
||||
if (sq > 64)
|
||||
sq_rpt = p_phystrpt->cck_sig_qual_ofdm_pwdb_all;
|
||||
if (sq_rpt > 64)
|
||||
sq = 0;
|
||||
else if (sq < 20)
|
||||
else if (sq_rpt < 20)
|
||||
sq = 100;
|
||||
else
|
||||
sq = ((64 - sq) * 100) / 44;
|
||||
sq = ((64 - sq_rpt) * 100) / 44;
|
||||
}
|
||||
|
||||
pstatus->signalquality = sq;
|
||||
pstatus->rx_mimo_sig_qual[0] = sq;
|
||||
pstatus->rx_mimo_sig_qual[1] = -1;
|
||||
pstatus->rx_mimo_signalquality[0] = sq;
|
||||
pstatus->rx_mimo_signalquality[1] = -1;
|
||||
}
|
||||
} else {
|
||||
rtlpriv->dm.rfpath_rxenable[0] = true;
|
||||
rtlpriv->dm.rfpath_rxenable[1] = true;
|
||||
|
||||
/* (1)Get RSSI for HT rate */
|
||||
for (i = RF90_PATH_A; i < RF6052_MAX_PATH; i++) {
|
||||
/* we will judge RF RX path now. */
|
||||
if (rtlpriv->dm.rfpath_rxenable[i])
|
||||
rf_rx_num++;
|
||||
|
||||
rx_pwr[i] = ((p_drvinfo->gain_trsw[i] & 0x3f)*2) - 110;
|
||||
rx_pwr[i] = ((p_phystrpt->path_agc[i].gain & 0x3f) * 2)
|
||||
- 110;
|
||||
|
||||
pstatus->rx_pwr[i] = rx_pwr[i];
|
||||
/* Translate DBM to percentage. */
|
||||
rssi = rtl_query_rxpwrpercentage(rx_pwr[i]);
|
||||
total_rssi += rssi;
|
||||
|
||||
/* Get Rx snr value in DB */
|
||||
rtlpriv->stats.rx_snr_db[i] =
|
||||
(long)(p_drvinfo->rxsnr[i] / 2);
|
||||
|
||||
/* Record Signal Strength for next packet */
|
||||
if (packet_match_bssid)
|
||||
pstatus->rx_mimo_signalstrength[i] = (u8) rssi;
|
||||
pstatus->rx_mimo_signalstrength[i] = (u8)rssi;
|
||||
}
|
||||
|
||||
/* (2)PWDB, Avg cacluated by hardware (for rate adaptive) */
|
||||
rx_pwr_all = ((p_drvinfo->pwdb_all >> 1) & 0x7f) - 110;
|
||||
/* (2)PWDB, Average PWDB cacluated by
|
||||
* hardware (for rate adaptive)
|
||||
*/
|
||||
rx_pwr_all = ((p_phystrpt->cck_sig_qual_ofdm_pwdb_all >> 1) &
|
||||
0x7f) - 110;
|
||||
|
||||
pwdb_all = rtl_query_rxpwrpercentage(rx_pwr_all);
|
||||
pwdb_all_bt = pwdb_all;
|
||||
pstatus->rx_pwdb_all = pwdb_all;
|
||||
pstatus->bt_rx_rssi_percentage = pwdb_all_bt;
|
||||
pstatus->rxpower = rx_pwr_all;
|
||||
pstatus->recvsignalpower = rx_pwr_all;
|
||||
|
||||
/* (3)EVM of HT rate */
|
||||
if (pstatus->is_ht && pstatus->rate >= DESC92C_RATEMCS8 &&
|
||||
if (pstatus->rate >= DESC92C_RATEMCS8 &&
|
||||
pstatus->rate <= DESC92C_RATEMCS15)
|
||||
max_spatial_stream = 2;
|
||||
else
|
||||
max_spatial_stream = 1;
|
||||
|
||||
for (i = 0; i < max_spatial_stream; i++) {
|
||||
evm = rtl_evm_db_to_percentage(p_drvinfo->rxevm[i]);
|
||||
evm = rtl_evm_db_to_percentage(
|
||||
p_phystrpt->stream_rxevm[i]);
|
||||
|
||||
if (packet_match_bssid) {
|
||||
if (bpacket_match_bssid) {
|
||||
/* Fill value in RFD, Get the first
|
||||
* spatial stream only
|
||||
*/
|
||||
if (i == 0)
|
||||
pstatus->signalquality =
|
||||
(u8) (evm & 0xff);
|
||||
pstatus->rx_mimo_sig_qual[i] =
|
||||
(u8) (evm & 0xff);
|
||||
(u8)(evm & 0xff);
|
||||
pstatus->rx_mimo_signalquality[i] =
|
||||
(u8)(evm & 0xff);
|
||||
}
|
||||
}
|
||||
if (packet_match_bssid) {
|
||||
|
||||
if (bpacket_match_bssid) {
|
||||
for (i = RF90_PATH_A; i <= RF90_PATH_B; i++)
|
||||
rtl_priv(hw)->dm.cfo_tail[i] =
|
||||
(char)p_phystrpt->path_cfotail[i];
|
||||
(int)p_phystrpt->path_cfotail[i];
|
||||
|
||||
rtl_priv(hw)->dm.packet_count++;
|
||||
if (rtl_priv(hw)->dm.packet_count == 0xffffffff)
|
||||
rtl_priv(hw)->dm.packet_count = 0;
|
||||
else
|
||||
rtl_priv(hw)->dm.packet_count++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -409,10 +364,6 @@ static void _rtl8723be_query_rxphystatus(struct ieee80211_hw *hw,
|
||||
else if (rf_rx_num != 0)
|
||||
pstatus->signalstrength = (u8)(rtl_signal_scale_mapping(hw,
|
||||
total_rssi /= rf_rx_num));
|
||||
/*HW antenna diversity*/
|
||||
rtldm->fat_table.antsel_rx_keep_0 = p_phystrpt->ant_sel;
|
||||
rtldm->fat_table.antsel_rx_keep_1 = p_phystrpt->ant_sel_b;
|
||||
rtldm->fat_table.antsel_rx_keep_2 = p_phystrpt->antsel_rx_keep_2;
|
||||
}
|
||||
|
||||
static void _rtl8723be_translate_rx_signal_stuff(struct ieee80211_hw *hw,
|
||||
@ -440,14 +391,14 @@ static void _rtl8723be_translate_rx_signal_stuff(struct ieee80211_hw *hw,
|
||||
memcpy(pstatus->psaddr, psaddr, ETH_ALEN);
|
||||
|
||||
packet_matchbssid = ((IEEE80211_FTYPE_CTL != type) &&
|
||||
(!ether_addr_equal(mac->bssid, (fc & IEEE80211_FCTL_TODS) ?
|
||||
hdr->addr1 : (fc & IEEE80211_FCTL_FROMDS) ?
|
||||
hdr->addr2 : hdr->addr3)) &&
|
||||
(!pstatus->hwerror) &&
|
||||
(!pstatus->crc) && (!pstatus->icv));
|
||||
(ether_addr_equal(mac->bssid, (fc & IEEE80211_FCTL_TODS) ?
|
||||
hdr->addr1 : (fc & IEEE80211_FCTL_FROMDS) ?
|
||||
hdr->addr2 : hdr->addr3)) &&
|
||||
(!pstatus->hwerror) &&
|
||||
(!pstatus->crc) && (!pstatus->icv));
|
||||
|
||||
packet_toself = packet_matchbssid &&
|
||||
(!ether_addr_equal(praddr, rtlefuse->dev_addr));
|
||||
(ether_addr_equal(praddr, rtlefuse->dev_addr));
|
||||
|
||||
/* YP: packet_beacon is not initialized,
|
||||
* this assignment is neccesary,
|
||||
@ -531,30 +482,33 @@ bool rtl8723be_rx_query_desc(struct ieee80211_hw *hw,
|
||||
struct ieee80211_hdr *hdr;
|
||||
|
||||
u32 phystatus = GET_RX_DESC_PHYST(pdesc);
|
||||
status->packet_report_type = (u8)GET_RX_STATUS_DESC_RPT_SEL(pdesc);
|
||||
if (status->packet_report_type == TX_REPORT2)
|
||||
status->length = (u16) GET_RX_RPT2_DESC_PKT_LEN(pdesc);
|
||||
else
|
||||
status->length = (u16) GET_RX_DESC_PKT_LEN(pdesc);
|
||||
status->rx_drvinfo_size = (u8) GET_RX_DESC_DRV_INFO_SIZE(pdesc) *
|
||||
|
||||
status->length = (u16)GET_RX_DESC_PKT_LEN(pdesc);
|
||||
status->rx_drvinfo_size = (u8)GET_RX_DESC_DRV_INFO_SIZE(pdesc) *
|
||||
RX_DRV_INFO_SIZE_UNIT;
|
||||
status->rx_bufshift = (u8) (GET_RX_DESC_SHIFT(pdesc) & 0x03);
|
||||
status->rx_bufshift = (u8)(GET_RX_DESC_SHIFT(pdesc) & 0x03);
|
||||
status->icv = (u16) GET_RX_DESC_ICV(pdesc);
|
||||
status->crc = (u16) GET_RX_DESC_CRC32(pdesc);
|
||||
status->hwerror = (status->crc | status->icv);
|
||||
status->decrypted = !GET_RX_DESC_SWDEC(pdesc);
|
||||
status->rate = (u8) GET_RX_DESC_RXMCS(pdesc);
|
||||
status->shortpreamble = (u16) GET_RX_DESC_SPLCP(pdesc);
|
||||
status->isampdu = (bool) (GET_RX_DESC_PAGGR(pdesc) == 1);
|
||||
status->isfirst_ampdu = (bool) (GET_RX_DESC_PAGGR(pdesc) == 1);
|
||||
if (status->packet_report_type == NORMAL_RX)
|
||||
status->timestamp_low = GET_RX_DESC_TSFL(pdesc);
|
||||
status->rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(pdesc);
|
||||
status->rate = (u8)GET_RX_DESC_RXMCS(pdesc);
|
||||
status->shortpreamble = (u16)GET_RX_DESC_SPLCP(pdesc);
|
||||
status->isampdu = (bool)(GET_RX_DESC_PAGGR(pdesc) == 1);
|
||||
status->isfirst_ampdu = (bool)(GET_RX_DESC_PAGGR(pdesc) == 1);
|
||||
status->timestamp_low = GET_RX_DESC_TSFL(pdesc);
|
||||
status->rx_is40Mhzpacket = (bool)GET_RX_DESC_BW(pdesc);
|
||||
status->bandwidth = (u8)GET_RX_DESC_BW(pdesc);
|
||||
status->macid = GET_RX_DESC_MACID(pdesc);
|
||||
status->is_ht = (bool)GET_RX_DESC_RXHT(pdesc);
|
||||
|
||||
status->is_cck = RTL8723E_RX_HAL_IS_CCK_RATE(status->rate);
|
||||
status->is_cck = RX_HAL_IS_CCK_RATE(status->rate);
|
||||
|
||||
if (GET_RX_STATUS_DESC_RPT_SEL(pdesc))
|
||||
status->packet_report_type = C2H_PACKET;
|
||||
else
|
||||
status->packet_report_type = NORMAL_RX;
|
||||
|
||||
|
||||
status->macid = GET_RX_DESC_MACID(pdesc);
|
||||
if (GET_RX_STATUS_DESC_MAGIC_MATCH(pdesc))
|
||||
status->wake_match = BIT(2);
|
||||
else if (GET_RX_STATUS_DESC_MAGIC_MATCH(pdesc))
|
||||
@ -565,12 +519,11 @@ bool rtl8723be_rx_query_desc(struct ieee80211_hw *hw,
|
||||
status->wake_match = 0;
|
||||
if (status->wake_match)
|
||||
RT_TRACE(rtlpriv, COMP_RXDESC, DBG_LOUD,
|
||||
"GGGGGGGGGGGGGet Wakeup Packet!! WakeMatch=%d\n",
|
||||
status->wake_match);
|
||||
"GGGGGGGGGGGGGet Wakeup Packet!! WakeMatch=%d\n",
|
||||
status->wake_match);
|
||||
rx_status->freq = hw->conf.chandef.chan->center_freq;
|
||||
rx_status->band = hw->conf.chandef.chan->band;
|
||||
|
||||
|
||||
hdr = (struct ieee80211_hdr *)(skb->data + status->rx_drvinfo_size +
|
||||
status->rx_bufshift);
|
||||
|
||||
@ -596,22 +549,21 @@ bool rtl8723be_rx_query_desc(struct ieee80211_hw *hw,
|
||||
if (status->decrypted) {
|
||||
if (!hdr) {
|
||||
WARN_ON_ONCE(true);
|
||||
pr_err("decrypted is true but hdr NULL in skb %p\n",
|
||||
pr_err("decrypted is true but hdr NULL, from skb %p\n",
|
||||
rtl_get_hdr(skb));
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((_ieee80211_is_robust_mgmt_frame(hdr)) &&
|
||||
if ((!_ieee80211_is_robust_mgmt_frame(hdr)) &&
|
||||
(ieee80211_has_protected(hdr->frame_control)))
|
||||
rx_status->flag &= ~RX_FLAG_DECRYPTED;
|
||||
else
|
||||
rx_status->flag |= RX_FLAG_DECRYPTED;
|
||||
else
|
||||
rx_status->flag &= ~RX_FLAG_DECRYPTED;
|
||||
}
|
||||
|
||||
/* rate_idx: index of data rate into band's
|
||||
* supported rates or MCS index if HT rates
|
||||
* are use (RX_FLAG_HT)
|
||||
* Notice: this is diff with windows define
|
||||
*/
|
||||
rx_status->rate_idx = _rtl8723be_rate_mapping(hw, status->is_ht,
|
||||
status->rate);
|
||||
@ -624,21 +576,19 @@ bool rtl8723be_rx_query_desc(struct ieee80211_hw *hw,
|
||||
_rtl8723be_translate_rx_signal_stuff(hw, skb, status,
|
||||
pdesc, p_drvinfo);
|
||||
}
|
||||
|
||||
/*rx_status->qual = status->signal; */
|
||||
rx_status->signal = status->recvsignalpower + 10;
|
||||
if (status->packet_report_type == TX_REPORT2) {
|
||||
status->macid_valid_entry[0] =
|
||||
GET_RX_RPT2_DESC_MACID_VALID_1(pdesc);
|
||||
GET_RX_RPT2_DESC_MACID_VALID_1(pdesc);
|
||||
status->macid_valid_entry[1] =
|
||||
GET_RX_RPT2_DESC_MACID_VALID_2(pdesc);
|
||||
GET_RX_RPT2_DESC_MACID_VALID_2(pdesc);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void rtl8723be_tx_fill_desc(struct ieee80211_hw *hw,
|
||||
struct ieee80211_hdr *hdr, u8 *pdesc_tx,
|
||||
u8 *pbd_desc_tx, struct ieee80211_tx_info *info,
|
||||
u8 *txbd, struct ieee80211_tx_info *info,
|
||||
struct ieee80211_sta *sta, struct sk_buff *skb,
|
||||
u8 hw_queue, struct rtl_tcb_desc *ptcb_desc)
|
||||
{
|
||||
@ -646,16 +596,16 @@ void rtl8723be_tx_fill_desc(struct ieee80211_hw *hw,
|
||||
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
|
||||
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
|
||||
struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
|
||||
u8 *pdesc = pdesc_tx;
|
||||
u8 *pdesc = (u8 *)pdesc_tx;
|
||||
u16 seq_number;
|
||||
__le16 fc = hdr->frame_control;
|
||||
unsigned int buf_len = 0;
|
||||
unsigned int skb_len = skb->len;
|
||||
u8 fw_qsel = _rtl8723be_map_hwqueue_to_fwqueue(skb, hw_queue);
|
||||
bool firstseg = ((hdr->seq_ctrl &
|
||||
cpu_to_le16(IEEE80211_SCTL_FRAG)) == 0);
|
||||
cpu_to_le16(IEEE80211_SCTL_FRAG)) == 0);
|
||||
bool lastseg = ((hdr->frame_control &
|
||||
cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)) == 0);
|
||||
cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)) == 0);
|
||||
dma_addr_t mapping;
|
||||
u8 bw_40 = 0;
|
||||
u8 short_gi = 0;
|
||||
@ -736,7 +686,7 @@ void rtl8723be_tx_fill_desc(struct ieee80211_hw *hw,
|
||||
SET_TX_DESC_NAV_USE_HDR(pdesc, 1);
|
||||
|
||||
if (bw_40) {
|
||||
if (ptcb_desc->packet_bw) {
|
||||
if (ptcb_desc->packet_bw == HT_CHANNEL_WIDTH_20_40) {
|
||||
SET_TX_DESC_DATA_BW(pdesc, 1);
|
||||
SET_TX_DESC_TX_SUB_CARRIER(pdesc, 3);
|
||||
} else {
|
||||
@ -776,9 +726,12 @@ void rtl8723be_tx_fill_desc(struct ieee80211_hw *hw,
|
||||
SET_TX_DESC_DATA_RATE_FB_LIMIT(pdesc, 0x1F);
|
||||
SET_TX_DESC_RTS_RATE_FB_LIMIT(pdesc, 0xF);
|
||||
SET_TX_DESC_DISABLE_FB(pdesc, ptcb_desc->disable_ratefallback ?
|
||||
1 : 0);
|
||||
1 : 0);
|
||||
SET_TX_DESC_USE_RATE(pdesc, ptcb_desc->use_driver_rate ? 1 : 0);
|
||||
|
||||
/* Set TxRate and RTSRate in TxDesc */
|
||||
/* This prevent Tx initial rate of new-coming packets */
|
||||
/* from being overwritten by retried packet rate.*/
|
||||
if (ieee80211_is_data_qos(fc)) {
|
||||
if (mac->rdg_en) {
|
||||
RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
|
||||
@ -793,9 +746,14 @@ void rtl8723be_tx_fill_desc(struct ieee80211_hw *hw,
|
||||
SET_TX_DESC_LAST_SEG(pdesc, (lastseg ? 1 : 0));
|
||||
SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16) buf_len);
|
||||
SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping);
|
||||
SET_TX_DESC_RATE_ID(pdesc, ptcb_desc->ratr_index);
|
||||
SET_TX_DESC_MACID(pdesc, ptcb_desc->mac_id);
|
||||
|
||||
/* if (rtlpriv->dm.useramask) { */
|
||||
if (1) {
|
||||
SET_TX_DESC_RATE_ID(pdesc, ptcb_desc->ratr_index);
|
||||
SET_TX_DESC_MACID(pdesc, ptcb_desc->mac_id);
|
||||
} else {
|
||||
SET_TX_DESC_RATE_ID(pdesc, 0xC + ptcb_desc->ratr_index);
|
||||
SET_TX_DESC_MACID(pdesc, ptcb_desc->mac_id);
|
||||
}
|
||||
if (!ieee80211_is_data_qos(fc)) {
|
||||
SET_TX_DESC_HWSEQ_EN(pdesc, 1);
|
||||
SET_TX_DESC_HWSEQ_SEL(pdesc, 0);
|
||||
@ -805,11 +763,12 @@ void rtl8723be_tx_fill_desc(struct ieee80211_hw *hw,
|
||||
is_broadcast_ether_addr(ieee80211_get_DA(hdr))) {
|
||||
SET_TX_DESC_BMC(pdesc, 1);
|
||||
}
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, "\n");
|
||||
}
|
||||
|
||||
void rtl8723be_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
|
||||
bool b_firstseg, bool b_lastseg,
|
||||
bool firstseg, bool lastseg,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
@ -849,16 +808,19 @@ void rtl8723be_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
|
||||
|
||||
SET_TX_DESC_OWN(pdesc, 1);
|
||||
|
||||
SET_TX_DESC_PKT_SIZE(pdesc, (u16)(skb->len));
|
||||
SET_TX_DESC_PKT_SIZE((u8 *)pdesc, (u16)(skb->len));
|
||||
|
||||
SET_TX_DESC_FIRST_SEG(pdesc, 1);
|
||||
SET_TX_DESC_LAST_SEG(pdesc, 1);
|
||||
|
||||
SET_TX_DESC_USE_RATE(pdesc, 1);
|
||||
|
||||
RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_LOUD,
|
||||
"H2C Tx Cmd Content\n", pdesc, TX_DESC_SIZE);
|
||||
}
|
||||
|
||||
void rtl8723be_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
|
||||
u8 desc_name, u8 *val)
|
||||
void rtl8723be_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
|
||||
bool istx, u8 desc_name, u8 *val)
|
||||
{
|
||||
if (istx) {
|
||||
switch (desc_name) {
|
||||
@ -870,7 +832,7 @@ void rtl8723be_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
|
||||
break;
|
||||
default:
|
||||
RT_ASSERT(false, "ERR txdesc :%d not process\n",
|
||||
desc_name);
|
||||
desc_name);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@ -889,7 +851,7 @@ void rtl8723be_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
|
||||
break;
|
||||
default:
|
||||
RT_ASSERT(false, "ERR rxdesc :%d not process\n",
|
||||
desc_name);
|
||||
desc_name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -909,7 +871,7 @@ u32 rtl8723be_get_desc(u8 *pdesc, bool istx, u8 desc_name)
|
||||
break;
|
||||
default:
|
||||
RT_ASSERT(false, "ERR txdesc :%d not process\n",
|
||||
desc_name);
|
||||
desc_name);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@ -920,6 +882,9 @@ u32 rtl8723be_get_desc(u8 *pdesc, bool istx, u8 desc_name)
|
||||
case HW_DESC_RXPKT_LEN:
|
||||
ret = GET_RX_DESC_PKT_LEN(pdesc);
|
||||
break;
|
||||
case HW_DESC_RXBUFF_ADDR:
|
||||
ret = GET_RX_DESC_BUFF_ADDR(pdesc);
|
||||
break;
|
||||
default:
|
||||
RT_ASSERT(false, "ERR rxdesc :%d not process\n",
|
||||
desc_name);
|
||||
@ -935,16 +900,15 @@ bool rtl8723be_is_tx_desc_closed(struct ieee80211_hw *hw,
|
||||
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
|
||||
struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[hw_queue];
|
||||
u8 *entry = (u8 *)(&ring->desc[ring->idx]);
|
||||
u8 own = (u8) rtl8723be_get_desc(entry, true, HW_DESC_OWN);
|
||||
u8 own = (u8)rtl8723be_get_desc(entry, true, HW_DESC_OWN);
|
||||
|
||||
/*beacon packet will only use the first
|
||||
*descriptor by default, and the own may not
|
||||
*descriptor defautly,and the own may not
|
||||
*be cleared by the hardware
|
||||
*/
|
||||
if (own)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void rtl8723be_tx_polling(struct ieee80211_hw *hw, u8 hw_queue)
|
||||
@ -957,3 +921,28 @@ void rtl8723be_tx_polling(struct ieee80211_hw *hw, u8 hw_queue)
|
||||
BIT(0) << (hw_queue));
|
||||
}
|
||||
}
|
||||
|
||||
u32 rtl8723be_rx_command_packet(struct ieee80211_hw *hw,
|
||||
struct rtl_stats status,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
u32 result = 0;
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
|
||||
switch (status.packet_report_type) {
|
||||
case NORMAL_RX:
|
||||
result = 0;
|
||||
break;
|
||||
case C2H_PACKET:
|
||||
rtl8723be_c2h_packet_handler(hw, skb->data,
|
||||
(u8)skb->len);
|
||||
result = 1;
|
||||
break;
|
||||
default:
|
||||
RT_TRACE(rtlpriv, COMP_RECV, DBG_TRACE,
|
||||
"No this packet type!!\n");
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -415,21 +415,25 @@ struct phy_status_rpt {
|
||||
} __packed;
|
||||
|
||||
struct rx_fwinfo_8723be {
|
||||
u8 gain_trsw[4];
|
||||
u8 gain_trsw[2];
|
||||
u16 chl_num:10;
|
||||
u16 sub_chnl:4;
|
||||
u16 r_rfmod:2;
|
||||
u8 pwdb_all;
|
||||
u8 cfosho[4];
|
||||
u8 cfotail[4];
|
||||
char rxevm[2];
|
||||
char rxsnr[4];
|
||||
char rxsnr[2];
|
||||
u8 pcts_msk_rpt[2];
|
||||
u8 pdsnr[2];
|
||||
u8 csi_current[2];
|
||||
u8 csi_target[2];
|
||||
u8 rx_gain_c;
|
||||
u8 rx_gain_d;
|
||||
u8 sigevm;
|
||||
u8 max_ex_pwr;
|
||||
u8 ex_intf_flag:1;
|
||||
u8 sgi_en:1;
|
||||
u8 rxsc:2;
|
||||
u8 reserve:4;
|
||||
u8 resvd_0;
|
||||
u8 antidx_anta:3;
|
||||
u8 antidx_antb:3;
|
||||
u8 resvd_1:2;
|
||||
} __packed;
|
||||
|
||||
struct tx_desc_8723be {
|
||||
@ -597,21 +601,25 @@ struct rx_desc_8723be {
|
||||
} __packed;
|
||||
|
||||
void rtl8723be_tx_fill_desc(struct ieee80211_hw *hw,
|
||||
struct ieee80211_hdr *hdr, u8 *pdesc,
|
||||
u8 *pbd_desc_tx, struct ieee80211_tx_info *info,
|
||||
struct ieee80211_hdr *hdr,
|
||||
u8 *pdesc_tx, u8 *txbd,
|
||||
struct ieee80211_tx_info *info,
|
||||
struct ieee80211_sta *sta, struct sk_buff *skb,
|
||||
u8 hw_queue, struct rtl_tcb_desc *ptcb_desc);
|
||||
bool rtl8723be_rx_query_desc(struct ieee80211_hw *hw,
|
||||
struct rtl_stats *status,
|
||||
struct ieee80211_rx_status *rx_status,
|
||||
u8 *pdesc, struct sk_buff *skb);
|
||||
void rtl8723be_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
|
||||
u8 desc_name, u8 *val);
|
||||
void rtl8723be_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
|
||||
bool istx, u8 desc_name, u8 *val);
|
||||
u32 rtl8723be_get_desc(u8 *pdesc, bool istx, u8 desc_name);
|
||||
bool rtl8723be_is_tx_desc_closed(struct ieee80211_hw *hw,
|
||||
u8 hw_queue, u16 index);
|
||||
void rtl8723be_tx_polling(struct ieee80211_hw *hw, u8 hw_queue);
|
||||
void rtl8723be_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
|
||||
bool b_firstseg, bool b_lastseg,
|
||||
bool firstseg, bool lastseg,
|
||||
struct sk_buff *skb);
|
||||
u32 rtl8723be_rx_command_packet(struct ieee80211_hw *hw,
|
||||
struct rtl_stats status,
|
||||
struct sk_buff *skb);
|
||||
#endif
|
||||
|
@ -267,7 +267,7 @@ int rtl8723_download_fw(struct ieee80211_hw *hw,
|
||||
pfwdata = rtlhal->pfirmware;
|
||||
fwsize = rtlhal->fwsize;
|
||||
|
||||
if (rtlhal->hw_type == HARDWARE_TYPE_RTL8723AE)
|
||||
if (!is_8723be)
|
||||
max_page = 6;
|
||||
else
|
||||
max_page = 8;
|
||||
@ -275,10 +275,10 @@ int rtl8723_download_fw(struct ieee80211_hw *hw,
|
||||
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
|
||||
"Firmware Version(%d), Signature(%#x), Size(%d)\n",
|
||||
pfwheader->version, pfwheader->signature,
|
||||
(int)sizeof(struct rtl92c_firmware_header));
|
||||
(int)sizeof(struct rtl8723e_firmware_header));
|
||||
|
||||
pfwdata = pfwdata + sizeof(struct rtl92c_firmware_header);
|
||||
fwsize = fwsize - sizeof(struct rtl92c_firmware_header);
|
||||
pfwdata = pfwdata + sizeof(struct rtl8723e_firmware_header);
|
||||
fwsize = fwsize - sizeof(struct rtl8723e_firmware_header);
|
||||
}
|
||||
|
||||
if (rtl_read_byte(rtlpriv, REG_MCUFWDL)&BIT(7)) {
|
||||
|
@ -30,7 +30,8 @@
|
||||
#define REG_MCUFWDL 0x0080
|
||||
#define FW_8192C_START_ADDRESS 0x1000
|
||||
#define FW_8192C_PAGE_SIZE 4096
|
||||
#define FW_8723A_POLLING_TIMEOUT_COUNT 6000
|
||||
#define FW_8723A_POLLING_TIMEOUT_COUNT 1000
|
||||
#define FW_8723B_POLLING_TIMEOUT_COUNT 6000
|
||||
#define FW_8192C_POLLING_DELAY 5
|
||||
|
||||
#define MCUFWDL_RDY BIT(1)
|
||||
@ -99,25 +100,6 @@ enum rtl8723be_cmd {
|
||||
MAX_8723BE_H2CCMD
|
||||
};
|
||||
|
||||
struct rtl92c_firmware_header {
|
||||
u16 signature;
|
||||
u8 category;
|
||||
u8 function;
|
||||
u16 version;
|
||||
u8 subversion;
|
||||
u8 rsvd1;
|
||||
u8 month;
|
||||
u8 date;
|
||||
u8 hour;
|
||||
u8 minute;
|
||||
u16 ramcodesize;
|
||||
u16 rsvd2;
|
||||
u32 svnindex;
|
||||
u32 rsvd3;
|
||||
u32 rsvd4;
|
||||
u32 rsvd5;
|
||||
};
|
||||
|
||||
void rtl8723ae_firmware_selfreset(struct ieee80211_hw *hw);
|
||||
void rtl8723be_firmware_selfreset(struct ieee80211_hw *hw);
|
||||
void rtl8723_enable_fw_download(struct ieee80211_hw *hw, bool enable);
|
||||
|
@ -96,7 +96,7 @@ u32 rtl8723_phy_rf_serial_read(struct ieee80211_hw *hw,
|
||||
u8 rfpi_enable = 0;
|
||||
u32 retvalue;
|
||||
|
||||
offset &= 0x3f;
|
||||
offset &= 0xff;
|
||||
newoffset = offset;
|
||||
if (RT_CANNOT_IO(hw)) {
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "return all one\n");
|
||||
@ -150,7 +150,7 @@ void rtl8723_phy_rf_serial_write(struct ieee80211_hw *hw,
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "stop\n");
|
||||
return;
|
||||
}
|
||||
offset &= 0x3f;
|
||||
offset &= 0xff;
|
||||
newoffset = offset;
|
||||
data_and_addr = ((newoffset << 20) | (data & 0x000fffff)) & 0x0fffffff;
|
||||
rtl_set_bbreg(hw, pphyreg->rf3wire_offset, MASKDWORD, data_and_addr);
|
||||
@ -390,14 +390,21 @@ EXPORT_SYMBOL_GPL(rtl8723_phy_reload_mac_registers);
|
||||
void rtl8723_phy_path_adda_on(struct ieee80211_hw *hw, u32 *addareg,
|
||||
bool is_patha_on, bool is2t)
|
||||
{
|
||||
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
|
||||
u32 pathon;
|
||||
u32 i;
|
||||
|
||||
pathon = is_patha_on ? 0x04db25a4 : 0x0b1b25a4;
|
||||
if (!is2t) {
|
||||
pathon = 0x0bdb25a0;
|
||||
rtl_set_bbreg(hw, addareg[0], MASKDWORD, 0x0b1b25a0);
|
||||
if (rtlhal->hw_type == HARDWARE_TYPE_RTL8723AE) {
|
||||
pathon = is_patha_on ? 0x04db25a4 : 0x0b1b25a4;
|
||||
if (!is2t) {
|
||||
pathon = 0x0bdb25a0;
|
||||
rtl_set_bbreg(hw, addareg[0], MASKDWORD, 0x0b1b25a0);
|
||||
} else {
|
||||
rtl_set_bbreg(hw, addareg[0], MASKDWORD, pathon);
|
||||
}
|
||||
} else {
|
||||
/* rtl8723be */
|
||||
pathon = 0x01c00014;
|
||||
rtl_set_bbreg(hw, addareg[0], MASKDWORD, pathon);
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,9 @@ static void _rtl8821ae_return_beacon_queue_skb(struct ieee80211_hw *hw)
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
|
||||
struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[BEACON_QUEUE];
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags);
|
||||
while (skb_queue_len(&ring->queue)) {
|
||||
struct rtl_tx_desc *entry = &ring->desc[ring->idx];
|
||||
struct sk_buff *skb = __skb_dequeue(&ring->queue);
|
||||
@ -60,6 +62,7 @@ static void _rtl8821ae_return_beacon_queue_skb(struct ieee80211_hw *hw)
|
||||
kfree_skb(skb);
|
||||
ring->idx = (ring->idx + 1) % ring->entries;
|
||||
}
|
||||
spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags);
|
||||
}
|
||||
|
||||
static void _rtl8821ae_set_bcn_ctrl_reg(struct ieee80211_hw *hw,
|
||||
|
@ -330,13 +330,7 @@ enum hardware_type {
|
||||
#define IS_HARDWARE_TYPE_8723(rtlhal) \
|
||||
(IS_HARDWARE_TYPE_8723E(rtlhal) || IS_HARDWARE_TYPE_8723U(rtlhal))
|
||||
|
||||
#define RX_HAL_IS_CCK_RATE(_pdesc)\
|
||||
(_pdesc->rxmcs == DESC92_RATE1M || \
|
||||
_pdesc->rxmcs == DESC92_RATE2M || \
|
||||
_pdesc->rxmcs == DESC92_RATE5_5M || \
|
||||
_pdesc->rxmcs == DESC92_RATE11M)
|
||||
|
||||
#define RTL8723E_RX_HAL_IS_CCK_RATE(rxmcs) \
|
||||
#define RX_HAL_IS_CCK_RATE(rxmcs) \
|
||||
((rxmcs) == DESC92_RATE1M || \
|
||||
(rxmcs) == DESC92_RATE2M || \
|
||||
(rxmcs) == DESC92_RATE5_5M || \
|
||||
|
Loading…
Reference in New Issue
Block a user