提交 7ea47240 编写于 作者: L Larry Finger 提交者: John W. Linville

rtlwifi: Modify some rtl8192ce routines for merging rtl8192cu

Modify some rtl8192ce routines for merging with rtl8192cu. In addition,
remove some usage of Hungarian notation.
Signed-off-by: NLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 0e80b9d1
...@@ -399,21 +399,21 @@ static void _rtl_query_protection_mode(struct ieee80211_hw *hw, ...@@ -399,21 +399,21 @@ static void _rtl_query_protection_mode(struct ieee80211_hw *hw,
u8 rate_flag = info->control.rates[0].flags; u8 rate_flag = info->control.rates[0].flags;
/* Common Settings */ /* Common Settings */
tcb_desc->b_rts_stbc = false; tcb_desc->rts_stbc = false;
tcb_desc->b_cts_enable = false; tcb_desc->cts_enable = false;
tcb_desc->rts_sc = 0; tcb_desc->rts_sc = 0;
tcb_desc->b_rts_bw = false; tcb_desc->rts_bw = false;
tcb_desc->b_rts_use_shortpreamble = false; tcb_desc->rts_use_shortpreamble = false;
tcb_desc->b_rts_use_shortgi = false; tcb_desc->rts_use_shortgi = false;
if (rate_flag & IEEE80211_TX_RC_USE_CTS_PROTECT) { if (rate_flag & IEEE80211_TX_RC_USE_CTS_PROTECT) {
/* Use CTS-to-SELF in protection mode. */ /* Use CTS-to-SELF in protection mode. */
tcb_desc->b_rts_enable = true; tcb_desc->rts_enable = true;
tcb_desc->b_cts_enable = true; tcb_desc->cts_enable = true;
tcb_desc->rts_rate = rtlpriv->cfg->maps[RTL_RC_OFDM_RATE24M]; tcb_desc->rts_rate = rtlpriv->cfg->maps[RTL_RC_OFDM_RATE24M];
} else if (rate_flag & IEEE80211_TX_RC_USE_RTS_CTS) { } else if (rate_flag & IEEE80211_TX_RC_USE_RTS_CTS) {
/* Use RTS-CTS in protection mode. */ /* Use RTS-CTS in protection mode. */
tcb_desc->b_rts_enable = true; tcb_desc->rts_enable = true;
tcb_desc->rts_rate = rtlpriv->cfg->maps[RTL_RC_OFDM_RATE24M]; tcb_desc->rts_rate = rtlpriv->cfg->maps[RTL_RC_OFDM_RATE24M];
} }
...@@ -429,7 +429,7 @@ static void _rtl_txrate_selectmode(struct ieee80211_hw *hw, ...@@ -429,7 +429,7 @@ static void _rtl_txrate_selectmode(struct ieee80211_hw *hw,
if (mac->opmode == NL80211_IFTYPE_STATION) if (mac->opmode == NL80211_IFTYPE_STATION)
tcb_desc->ratr_index = 0; tcb_desc->ratr_index = 0;
else if (mac->opmode == NL80211_IFTYPE_ADHOC) { else if (mac->opmode == NL80211_IFTYPE_ADHOC) {
if (tcb_desc->b_multicast || tcb_desc->b_broadcast) { if (tcb_desc->multicast || tcb_desc->broadcast) {
tcb_desc->hw_rate = tcb_desc->hw_rate =
rtlpriv->cfg->maps[RTL_RC_CCK_RATE2M]; rtlpriv->cfg->maps[RTL_RC_CCK_RATE2M];
tcb_desc->use_driver_rate = 1; tcb_desc->use_driver_rate = 1;
...@@ -439,7 +439,7 @@ static void _rtl_txrate_selectmode(struct ieee80211_hw *hw, ...@@ -439,7 +439,7 @@ static void _rtl_txrate_selectmode(struct ieee80211_hw *hw,
} }
} }
if (rtlpriv->dm.b_useramask) { if (rtlpriv->dm.useramask) {
/* TODO we will differentiate adhoc and station futrue */ /* TODO we will differentiate adhoc and station futrue */
tcb_desc->mac_id = 0; tcb_desc->mac_id = 0;
...@@ -461,19 +461,19 @@ static void _rtl_query_bandwidth_mode(struct ieee80211_hw *hw, ...@@ -461,19 +461,19 @@ static void _rtl_query_bandwidth_mode(struct ieee80211_hw *hw,
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
tcb_desc->b_packet_bw = false; tcb_desc->packet_bw = false;
if (!mac->bw_40 || !mac->ht_enable) if (!mac->bw_40 || !mac->ht_enable)
return; return;
if (tcb_desc->b_multicast || tcb_desc->b_broadcast) if (tcb_desc->multicast || tcb_desc->broadcast)
return; return;
/*use legency rate, shall use 20MHz */ /*use legency rate, shall use 20MHz */
if (tcb_desc->hw_rate <= rtlpriv->cfg->maps[RTL_RC_OFDM_RATE54M]) if (tcb_desc->hw_rate <= rtlpriv->cfg->maps[RTL_RC_OFDM_RATE54M])
return; return;
tcb_desc->b_packet_bw = true; tcb_desc->packet_bw = true;
} }
static u8 _rtl_get_highest_n_rate(struct ieee80211_hw *hw) static u8 _rtl_get_highest_n_rate(struct ieee80211_hw *hw)
...@@ -545,9 +545,9 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw, ...@@ -545,9 +545,9 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw,
} }
if (is_multicast_ether_addr(ieee80211_get_DA(hdr))) if (is_multicast_ether_addr(ieee80211_get_DA(hdr)))
tcb_desc->b_multicast = 1; tcb_desc->multicast = 1;
else if (is_broadcast_ether_addr(ieee80211_get_DA(hdr))) else if (is_broadcast_ether_addr(ieee80211_get_DA(hdr)))
tcb_desc->b_broadcast = 1; tcb_desc->broadcast = 1;
_rtl_txrate_selectmode(hw, tcb_desc); _rtl_txrate_selectmode(hw, tcb_desc);
_rtl_query_bandwidth_mode(hw, tcb_desc); _rtl_query_bandwidth_mode(hw, tcb_desc);
...@@ -777,10 +777,10 @@ void rtl_watchdog_wq_callback(void *data) ...@@ -777,10 +777,10 @@ void rtl_watchdog_wq_callback(void *data)
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
bool b_busytraffic = false; bool busytraffic = false;
bool b_higher_busytraffic = false; bool higher_busytraffic = false;
bool b_higher_busyrxtraffic = false; bool higher_busyrxtraffic = false;
bool b_higher_busytxtraffic = false; bool higher_busytxtraffic = false;
u8 idx = 0; u8 idx = 0;
u32 rx_cnt_inp4eriod = 0; u32 rx_cnt_inp4eriod = 0;
...@@ -788,7 +788,7 @@ void rtl_watchdog_wq_callback(void *data) ...@@ -788,7 +788,7 @@ void rtl_watchdog_wq_callback(void *data)
u32 aver_rx_cnt_inperiod = 0; u32 aver_rx_cnt_inperiod = 0;
u32 aver_tx_cnt_inperiod = 0; u32 aver_tx_cnt_inperiod = 0;
bool benter_ps = false; bool enter_ps = false;
if (is_hal_stop(rtlhal)) if (is_hal_stop(rtlhal))
return; return;
...@@ -832,29 +832,29 @@ void rtl_watchdog_wq_callback(void *data) ...@@ -832,29 +832,29 @@ void rtl_watchdog_wq_callback(void *data)
/* (2) check traffic busy */ /* (2) check traffic busy */
if (aver_rx_cnt_inperiod > 100 || aver_tx_cnt_inperiod > 100) if (aver_rx_cnt_inperiod > 100 || aver_tx_cnt_inperiod > 100)
b_busytraffic = true; busytraffic = true;
/* Higher Tx/Rx data. */ /* Higher Tx/Rx data. */
if (aver_rx_cnt_inperiod > 4000 || if (aver_rx_cnt_inperiod > 4000 ||
aver_tx_cnt_inperiod > 4000) { aver_tx_cnt_inperiod > 4000) {
b_higher_busytraffic = true; higher_busytraffic = true;
/* Extremely high Rx data. */ /* Extremely high Rx data. */
if (aver_rx_cnt_inperiod > 5000) if (aver_rx_cnt_inperiod > 5000)
b_higher_busyrxtraffic = true; higher_busyrxtraffic = true;
else else
b_higher_busytxtraffic = false; higher_busytxtraffic = false;
} }
if (((rtlpriv->link_info.num_rx_inperiod + if (((rtlpriv->link_info.num_rx_inperiod +
rtlpriv->link_info.num_tx_inperiod) > 8) || rtlpriv->link_info.num_tx_inperiod) > 8) ||
(rtlpriv->link_info.num_rx_inperiod > 2)) (rtlpriv->link_info.num_rx_inperiod > 2))
benter_ps = false; enter_ps = false;
else else
benter_ps = true; enter_ps = true;
/* LeisurePS only work in infra mode. */ /* LeisurePS only work in infra mode. */
if (benter_ps) if (enter_ps)
rtl_lps_enter(hw); rtl_lps_enter(hw);
else else
rtl_lps_leave(hw); rtl_lps_leave(hw);
...@@ -863,9 +863,9 @@ void rtl_watchdog_wq_callback(void *data) ...@@ -863,9 +863,9 @@ void rtl_watchdog_wq_callback(void *data)
rtlpriv->link_info.num_rx_inperiod = 0; rtlpriv->link_info.num_rx_inperiod = 0;
rtlpriv->link_info.num_tx_inperiod = 0; rtlpriv->link_info.num_tx_inperiod = 0;
rtlpriv->link_info.b_busytraffic = b_busytraffic; rtlpriv->link_info.busytraffic = busytraffic;
rtlpriv->link_info.b_higher_busytraffic = b_higher_busytraffic; rtlpriv->link_info.higher_busytraffic = higher_busytraffic;
rtlpriv->link_info.b_higher_busyrxtraffic = b_higher_busyrxtraffic; rtlpriv->link_info.higher_busyrxtraffic = higher_busyrxtraffic;
} }
......
...@@ -666,7 +666,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw, ...@@ -666,7 +666,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_BASIC_RATE, rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_BASIC_RATE,
(u8 *) (&basic_rates)); (u8 *) (&basic_rates));
if (rtlpriv->dm.b_useramask) if (rtlpriv->dm.useramask)
rtlpriv->cfg->ops->update_rate_mask(hw, 0); rtlpriv->cfg->ops->update_rate_mask(hw, 0);
else else
rtlpriv->cfg->ops->update_rate_table(hw); rtlpriv->cfg->ops->update_rate_table(hw);
...@@ -681,7 +681,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw, ...@@ -681,7 +681,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
*/ */
if (changed & BSS_CHANGED_ASSOC) { if (changed & BSS_CHANGED_ASSOC) {
if (bss_conf->assoc) { if (bss_conf->assoc) {
if (ppsc->b_fwctrl_lps) { if (ppsc->fwctrl_lps) {
u8 mstatus = RT_MEDIA_CONNECT; u8 mstatus = RT_MEDIA_CONNECT;
rtlpriv->cfg->ops->set_hw_reg(hw, rtlpriv->cfg->ops->set_hw_reg(hw,
HW_VAR_H2C_FW_JOINBSSRPT, HW_VAR_H2C_FW_JOINBSSRPT,
...@@ -689,7 +689,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw, ...@@ -689,7 +689,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
ppsc->report_linked = true; ppsc->report_linked = true;
} }
} else { } else {
if (ppsc->b_fwctrl_lps) { if (ppsc->fwctrl_lps) {
u8 mstatus = RT_MEDIA_DISCONNECT; u8 mstatus = RT_MEDIA_DISCONNECT;
rtlpriv->cfg->ops->set_hw_reg(hw, rtlpriv->cfg->ops->set_hw_reg(hw,
HW_VAR_H2C_FW_JOINBSSRPT, HW_VAR_H2C_FW_JOINBSSRPT,
...@@ -818,7 +818,7 @@ static void rtl_op_sw_scan_complete(struct ieee80211_hw *hw) ...@@ -818,7 +818,7 @@ static void rtl_op_sw_scan_complete(struct ieee80211_hw *hw)
/* fix fwlps issue */ /* fix fwlps issue */
rtlpriv->cfg->ops->set_network_type(hw, mac->opmode); rtlpriv->cfg->ops->set_network_type(hw, mac->opmode);
if (rtlpriv->dm.b_useramask) if (rtlpriv->dm.useramask)
rtlpriv->cfg->ops->update_rate_mask(hw, 0); rtlpriv->cfg->ops->update_rate_mask(hw, 0);
else else
rtlpriv->cfg->ops->update_rate_table(hw); rtlpriv->cfg->ops->update_rate_table(hw);
......
...@@ -50,7 +50,7 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw) ...@@ -50,7 +50,7 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw)
u8 pcibridge_vendor = pcipriv->ndis_adapter.pcibridge_vendor; u8 pcibridge_vendor = pcipriv->ndis_adapter.pcibridge_vendor;
ppsc->reg_rfps_level = 0; ppsc->reg_rfps_level = 0;
ppsc->b_support_aspm = 0; ppsc->support_aspm = 0;
/*Update PCI ASPM setting */ /*Update PCI ASPM setting */
ppsc->const_amdpci_aspm = rtlpci->const_amdpci_aspm; ppsc->const_amdpci_aspm = rtlpci->const_amdpci_aspm;
...@@ -115,29 +115,29 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw) ...@@ -115,29 +115,29 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw)
switch (rtlpci->const_support_pciaspm) { switch (rtlpci->const_support_pciaspm) {
case 0:{ case 0:{
/*Not support ASPM. */ /*Not support ASPM. */
bool b_support_aspm = false; bool support_aspm = false;
ppsc->b_support_aspm = b_support_aspm; ppsc->support_aspm = support_aspm;
break; break;
} }
case 1:{ case 1:{
/*Support ASPM. */ /*Support ASPM. */
bool b_support_aspm = true; bool support_aspm = true;
bool b_support_backdoor = true; bool support_backdoor = true;
ppsc->b_support_aspm = b_support_aspm; ppsc->support_aspm = support_aspm;
/*if(priv->oem_id == RT_CID_TOSHIBA && /*if(priv->oem_id == RT_CID_TOSHIBA &&
!priv->ndis_adapter.amd_l1_patch) !priv->ndis_adapter.amd_l1_patch)
b_support_backdoor = false; */ support_backdoor = false; */
ppsc->b_support_backdoor = b_support_backdoor; ppsc->support_backdoor = support_backdoor;
break; break;
} }
case 2: case 2:
/*ASPM value set by chipset. */ /*ASPM value set by chipset. */
if (pcibridge_vendor == PCI_BRIDGE_VENDOR_INTEL) { if (pcibridge_vendor == PCI_BRIDGE_VENDOR_INTEL) {
bool b_support_aspm = true; bool support_aspm = true;
ppsc->b_support_aspm = b_support_aspm; ppsc->support_aspm = support_aspm;
} }
break; break;
default: default:
...@@ -585,7 +585,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -585,7 +585,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
hdr = (struct ieee80211_hdr *)(skb->data); hdr = (struct ieee80211_hdr *)(skb->data);
fc = le16_to_cpu(hdr->frame_control); fc = le16_to_cpu(hdr->frame_control);
if (!stats.b_crc) { if (!stats.crc) {
memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, memcpy(IEEE80211_SKB_RXCB(skb), &rx_status,
sizeof(rx_status)); sizeof(rx_status));
...@@ -890,17 +890,17 @@ static void _rtl_pci_init_struct(struct ieee80211_hw *hw, ...@@ -890,17 +890,17 @@ static void _rtl_pci_init_struct(struct ieee80211_hw *hw,
rtlhal->hw = hw; rtlhal->hw = hw;
rtlpci->pdev = pdev; rtlpci->pdev = pdev;
ppsc->b_inactiveps = false; ppsc->inactiveps = false;
ppsc->b_leisure_ps = true; ppsc->leisure_ps = true;
ppsc->b_fwctrl_lps = true; ppsc->fwctrl_lps = true;
ppsc->b_reg_fwctrl_lps = 3; ppsc->reg_fwctrl_lps = 3;
ppsc->reg_max_lps_awakeintvl = 5; ppsc->reg_max_lps_awakeintvl = 5;
if (ppsc->b_reg_fwctrl_lps == 1) if (ppsc->reg_fwctrl_lps == 1)
ppsc->fwctrl_psmode = FW_PS_MIN_MODE; ppsc->fwctrl_psmode = FW_PS_MIN_MODE;
else if (ppsc->b_reg_fwctrl_lps == 2) else if (ppsc->reg_fwctrl_lps == 2)
ppsc->fwctrl_psmode = FW_PS_MAX_MODE; ppsc->fwctrl_psmode = FW_PS_MAX_MODE;
else if (ppsc->b_reg_fwctrl_lps == 3) else if (ppsc->reg_fwctrl_lps == 3)
ppsc->fwctrl_psmode = FW_PS_DTIM_MODE; ppsc->fwctrl_psmode = FW_PS_DTIM_MODE;
/*Tx/Rx related var */ /*Tx/Rx related var */
......
...@@ -86,7 +86,7 @@ bool rtl_ps_set_rf_state(struct ieee80211_hw *hw, ...@@ -86,7 +86,7 @@ bool rtl_ps_set_rf_state(struct ieee80211_hw *hw,
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
enum rf_pwrstate rtstate; enum rf_pwrstate rtstate;
bool b_actionallowed = false; bool actionallowed = false;
u16 rfwait_cnt = 0; u16 rfwait_cnt = 0;
unsigned long flag; unsigned long flag;
...@@ -139,13 +139,13 @@ bool rtl_ps_set_rf_state(struct ieee80211_hw *hw, ...@@ -139,13 +139,13 @@ bool rtl_ps_set_rf_state(struct ieee80211_hw *hw,
ppsc->rfoff_reason &= (~changesource); ppsc->rfoff_reason &= (~changesource);
if ((changesource == RF_CHANGE_BY_HW) && if ((changesource == RF_CHANGE_BY_HW) &&
(ppsc->b_hwradiooff == true)) { (ppsc->hwradiooff == true)) {
ppsc->b_hwradiooff = false; ppsc->hwradiooff = false;
} }
if (!ppsc->rfoff_reason) { if (!ppsc->rfoff_reason) {
ppsc->rfoff_reason = 0; ppsc->rfoff_reason = 0;
b_actionallowed = true; actionallowed = true;
} }
break; break;
...@@ -153,17 +153,17 @@ bool rtl_ps_set_rf_state(struct ieee80211_hw *hw, ...@@ -153,17 +153,17 @@ bool rtl_ps_set_rf_state(struct ieee80211_hw *hw,
case ERFOFF: case ERFOFF:
if ((changesource == RF_CHANGE_BY_HW) if ((changesource == RF_CHANGE_BY_HW)
&& (ppsc->b_hwradiooff == false)) { && (ppsc->hwradiooff == false)) {
ppsc->b_hwradiooff = true; ppsc->hwradiooff = true;
} }
ppsc->rfoff_reason |= changesource; ppsc->rfoff_reason |= changesource;
b_actionallowed = true; actionallowed = true;
break; break;
case ERFSLEEP: case ERFSLEEP:
ppsc->rfoff_reason |= changesource; ppsc->rfoff_reason |= changesource;
b_actionallowed = true; actionallowed = true;
break; break;
default: default:
...@@ -172,7 +172,7 @@ bool rtl_ps_set_rf_state(struct ieee80211_hw *hw, ...@@ -172,7 +172,7 @@ bool rtl_ps_set_rf_state(struct ieee80211_hw *hw,
break; break;
} }
if (b_actionallowed) if (actionallowed)
rtlpriv->cfg->ops->set_rf_power_state(hw, state_toset); rtlpriv->cfg->ops->set_rf_power_state(hw, state_toset);
if (!protect_or_not) { if (!protect_or_not) {
...@@ -181,7 +181,7 @@ bool rtl_ps_set_rf_state(struct ieee80211_hw *hw, ...@@ -181,7 +181,7 @@ bool rtl_ps_set_rf_state(struct ieee80211_hw *hw,
spin_unlock_irqrestore(&rtlpriv->locks.rf_ps_lock, flag); spin_unlock_irqrestore(&rtlpriv->locks.rf_ps_lock, flag);
} }
return b_actionallowed; return actionallowed;
} }
EXPORT_SYMBOL(rtl_ps_set_rf_state); EXPORT_SYMBOL(rtl_ps_set_rf_state);
...@@ -191,7 +191,7 @@ static void _rtl_ps_inactive_ps(struct ieee80211_hw *hw) ...@@ -191,7 +191,7 @@ static void _rtl_ps_inactive_ps(struct ieee80211_hw *hw)
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
ppsc->b_swrf_processing = true; ppsc->swrf_processing = true;
if (ppsc->inactive_pwrstate == ERFON && rtlhal->interface == INTF_PCI) { if (ppsc->inactive_pwrstate == ERFON && rtlhal->interface == INTF_PCI) {
if ((ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM) && if ((ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM) &&
...@@ -213,7 +213,7 @@ static void _rtl_ps_inactive_ps(struct ieee80211_hw *hw) ...@@ -213,7 +213,7 @@ static void _rtl_ps_inactive_ps(struct ieee80211_hw *hw)
} }
} }
ppsc->b_swrf_processing = false; ppsc->swrf_processing = false;
} }
void rtl_ips_nic_off_wq_callback(void *data) void rtl_ips_nic_off_wq_callback(void *data)
...@@ -239,13 +239,13 @@ void rtl_ips_nic_off_wq_callback(void *data) ...@@ -239,13 +239,13 @@ void rtl_ips_nic_off_wq_callback(void *data)
if (rtlpriv->sec.being_setkey) if (rtlpriv->sec.being_setkey)
return; return;
if (ppsc->b_inactiveps) { if (ppsc->inactiveps) {
rtstate = ppsc->rfpwr_state; rtstate = ppsc->rfpwr_state;
/* /*
*Do not enter IPS in the following conditions: *Do not enter IPS in the following conditions:
*(1) RF is already OFF or Sleep *(1) RF is already OFF or Sleep
*(2) b_swrf_processing (indicates the IPS is still under going) *(2) swrf_processing (indicates the IPS is still under going)
*(3) Connectted (only disconnected can trigger IPS) *(3) Connectted (only disconnected can trigger IPS)
*(4) IBSS (send Beacon) *(4) IBSS (send Beacon)
*(5) AP mode (send Beacon) *(5) AP mode (send Beacon)
...@@ -253,14 +253,14 @@ void rtl_ips_nic_off_wq_callback(void *data) ...@@ -253,14 +253,14 @@ void rtl_ips_nic_off_wq_callback(void *data)
*/ */
if (rtstate == ERFON && if (rtstate == ERFON &&
!ppsc->b_swrf_processing && !ppsc->swrf_processing &&
(mac->link_state == MAC80211_NOLINK) && (mac->link_state == MAC80211_NOLINK) &&
!mac->act_scanning) { !mac->act_scanning) {
RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
("IPSEnter(): Turn off RF.\n")); ("IPSEnter(): Turn off RF.\n"));
ppsc->inactive_pwrstate = ERFOFF; ppsc->inactive_pwrstate = ERFOFF;
ppsc->b_in_powersavemode = true; ppsc->in_powersavemode = true;
/*rtl_pci_reset_trx_ring(hw); */ /*rtl_pci_reset_trx_ring(hw); */
_rtl_ps_inactive_ps(hw); _rtl_ps_inactive_ps(hw);
...@@ -290,15 +290,15 @@ void rtl_ips_nic_on(struct ieee80211_hw *hw) ...@@ -290,15 +290,15 @@ void rtl_ips_nic_on(struct ieee80211_hw *hw)
spin_lock_irqsave(&rtlpriv->locks.ips_lock, flags); spin_lock_irqsave(&rtlpriv->locks.ips_lock, flags);
if (ppsc->b_inactiveps) { if (ppsc->inactiveps) {
rtstate = ppsc->rfpwr_state; rtstate = ppsc->rfpwr_state;
if (rtstate != ERFON && if (rtstate != ERFON &&
!ppsc->b_swrf_processing && !ppsc->swrf_processing &&
ppsc->rfoff_reason <= RF_CHANGE_BY_IPS) { ppsc->rfoff_reason <= RF_CHANGE_BY_IPS) {
ppsc->inactive_pwrstate = ERFON; ppsc->inactive_pwrstate = ERFON;
ppsc->b_in_powersavemode = false; ppsc->in_powersavemode = false;
_rtl_ps_inactive_ps(hw); _rtl_ps_inactive_ps(hw);
} }
...@@ -370,9 +370,9 @@ static void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode) ...@@ -370,9 +370,9 @@ static void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode)
* mode and set RPWM to turn RF on. * mode and set RPWM to turn RF on.
*/ */
if ((ppsc->b_fwctrl_lps) && (ppsc->b_leisure_ps) && if ((ppsc->fwctrl_lps) && (ppsc->leisure_ps) &&
ppsc->report_linked) { ppsc->report_linked) {
bool b_fw_current_inps; bool fw_current_inps;
if (ppsc->dot11_psmode == EACTIVE) { if (ppsc->dot11_psmode == EACTIVE) {
RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
("FW LPS leave ps_mode:%x\n", ("FW LPS leave ps_mode:%x\n",
...@@ -385,11 +385,11 @@ static void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode) ...@@ -385,11 +385,11 @@ static void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode)
rtlpriv->cfg->ops->set_hw_reg(hw, rtlpriv->cfg->ops->set_hw_reg(hw,
HW_VAR_H2C_FW_PWRMODE, HW_VAR_H2C_FW_PWRMODE,
(u8 *) (&fw_pwrmode)); (u8 *) (&fw_pwrmode));
b_fw_current_inps = false; fw_current_inps = false;
rtlpriv->cfg->ops->set_hw_reg(hw, rtlpriv->cfg->ops->set_hw_reg(hw,
HW_VAR_FW_PSMODE_STATUS, HW_VAR_FW_PSMODE_STATUS,
(u8 *) (&b_fw_current_inps)); (u8 *) (&fw_current_inps));
} else { } else {
if (rtl_get_fwlps_doze(hw)) { if (rtl_get_fwlps_doze(hw)) {
...@@ -398,10 +398,10 @@ static void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode) ...@@ -398,10 +398,10 @@ static void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode)
ppsc->fwctrl_psmode)); ppsc->fwctrl_psmode));
rpwm_val = 0x02; /* RF off */ rpwm_val = 0x02; /* RF off */
b_fw_current_inps = true; fw_current_inps = true;
rtlpriv->cfg->ops->set_hw_reg(hw, rtlpriv->cfg->ops->set_hw_reg(hw,
HW_VAR_FW_PSMODE_STATUS, HW_VAR_FW_PSMODE_STATUS,
(u8 *) (&b_fw_current_inps)); (u8 *) (&fw_current_inps));
rtlpriv->cfg->ops->set_hw_reg(hw, rtlpriv->cfg->ops->set_hw_reg(hw,
HW_VAR_H2C_FW_PWRMODE, HW_VAR_H2C_FW_PWRMODE,
(u8 *) (&ppsc->fwctrl_psmode)); (u8 *) (&ppsc->fwctrl_psmode));
...@@ -425,13 +425,13 @@ void rtl_lps_enter(struct ieee80211_hw *hw) ...@@ -425,13 +425,13 @@ void rtl_lps_enter(struct ieee80211_hw *hw)
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
unsigned long flag; unsigned long flag;
if (!(ppsc->b_fwctrl_lps && ppsc->b_leisure_ps)) if (!(ppsc->fwctrl_lps && ppsc->leisure_ps))
return; return;
if (rtlpriv->sec.being_setkey) if (rtlpriv->sec.being_setkey)
return; return;
if (rtlpriv->link_info.b_busytraffic) if (rtlpriv->link_info.busytraffic)
return; return;
/*sleep after linked 10s, to let DHCP and 4-way handshake ok enough!! */ /*sleep after linked 10s, to let DHCP and 4-way handshake ok enough!! */
...@@ -446,7 +446,7 @@ void rtl_lps_enter(struct ieee80211_hw *hw) ...@@ -446,7 +446,7 @@ void rtl_lps_enter(struct ieee80211_hw *hw)
spin_lock_irqsave(&rtlpriv->locks.lps_lock, flag); spin_lock_irqsave(&rtlpriv->locks.lps_lock, flag);
if (ppsc->b_leisure_ps) { if (ppsc->leisure_ps) {
/* Idle for a while if we connect to AP a while ago. */ /* Idle for a while if we connect to AP a while ago. */
if (mac->cnt_after_linked >= 2) { if (mac->cnt_after_linked >= 2) {
if (ppsc->dot11_psmode == EACTIVE) { if (ppsc->dot11_psmode == EACTIVE) {
...@@ -470,7 +470,7 @@ void rtl_lps_leave(struct ieee80211_hw *hw) ...@@ -470,7 +470,7 @@ void rtl_lps_leave(struct ieee80211_hw *hw)
spin_lock_irqsave(&rtlpriv->locks.lps_lock, flag); spin_lock_irqsave(&rtlpriv->locks.lps_lock, flag);
if (ppsc->b_fwctrl_lps && ppsc->b_leisure_ps) { if (ppsc->fwctrl_lps && ppsc->leisure_ps) {
if (ppsc->dot11_psmode != EACTIVE) { if (ppsc->dot11_psmode != EACTIVE) {
/*FIX ME */ /*FIX ME */
......
...@@ -306,13 +306,13 @@ static void rtl92c_dm_initial_gain_multi_sta(struct ieee80211_hw *hw) ...@@ -306,13 +306,13 @@ static void rtl92c_dm_initial_gain_multi_sta(struct ieee80211_hw *hw)
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
long rssi_strength = rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb; long rssi_strength = rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb;
bool b_multi_sta = false; bool multi_sta = false;
if (mac->opmode == NL80211_IFTYPE_ADHOC) if (mac->opmode == NL80211_IFTYPE_ADHOC)
b_multi_sta = true; multi_sta = true;
if ((b_multi_sta == false) || (dm_digtable.cursta_connectctate != if ((multi_sta == false) || (dm_digtable.cursta_connectctate !=
DIG_STA_DISCONNECT)) { DIG_STA_DISCONNECT)) {
binitialized = false; binitialized = false;
dm_digtable.dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX; dm_digtable.dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX;
return; return;
...@@ -479,7 +479,7 @@ static void rtl92c_dm_dig(struct ieee80211_hw *hw) ...@@ -479,7 +479,7 @@ static void rtl92c_dm_dig(struct ieee80211_hw *hw)
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
if (rtlpriv->dm.b_dm_initialgain_enable == false) if (rtlpriv->dm.dm_initialgain_enable == false)
return; return;
if (dm_digtable.dig_enable_flag == false) if (dm_digtable.dig_enable_flag == false)
return; return;
...@@ -492,7 +492,7 @@ static void rtl92c_dm_init_dynamic_txpower(struct ieee80211_hw *hw) ...@@ -492,7 +492,7 @@ static void rtl92c_dm_init_dynamic_txpower(struct ieee80211_hw *hw)
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
rtlpriv->dm.bdynamic_txpower_enable = false; rtlpriv->dm.dynamic_txpower_enable = false;
rtlpriv->dm.last_dtp_lvl = TXHIGHPWRLEVEL_NORMAL; rtlpriv->dm.last_dtp_lvl = TXHIGHPWRLEVEL_NORMAL;
rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL; rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL;
...@@ -550,9 +550,9 @@ static void rtl92c_dm_pwdb_monitor(struct ieee80211_hw *hw) ...@@ -550,9 +550,9 @@ static void rtl92c_dm_pwdb_monitor(struct ieee80211_hw *hw)
void rtl92c_dm_init_edca_turbo(struct ieee80211_hw *hw) void rtl92c_dm_init_edca_turbo(struct ieee80211_hw *hw)
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
rtlpriv->dm.bcurrent_turbo_edca = false; rtlpriv->dm.current_turbo_edca = false;
rtlpriv->dm.bis_any_nonbepkts = false; rtlpriv->dm.is_any_nonbepkts = false;
rtlpriv->dm.bis_cur_rdlstate = false; rtlpriv->dm.is_cur_rdlstate = false;
} }
static void rtl92c_dm_check_edca_turbo(struct ieee80211_hw *hw) static void rtl92c_dm_check_edca_turbo(struct ieee80211_hw *hw)
...@@ -570,7 +570,7 @@ static void rtl92c_dm_check_edca_turbo(struct ieee80211_hw *hw) ...@@ -570,7 +570,7 @@ static void rtl92c_dm_check_edca_turbo(struct ieee80211_hw *hw)
goto dm_checkedcaturbo_exit; goto dm_checkedcaturbo_exit;
if (mac->link_state != MAC80211_LINKED) { if (mac->link_state != MAC80211_LINKED) {
rtlpriv->dm.bcurrent_turbo_edca = false; rtlpriv->dm.current_turbo_edca = false;
return; return;
} }
...@@ -582,40 +582,40 @@ static void rtl92c_dm_check_edca_turbo(struct ieee80211_hw *hw) ...@@ -582,40 +582,40 @@ static void rtl92c_dm_check_edca_turbo(struct ieee80211_hw *hw)
edca_be_dl |= 0x005e0000; edca_be_dl |= 0x005e0000;
} }
if ((!rtlpriv->dm.bis_any_nonbepkts) && if ((!rtlpriv->dm.is_any_nonbepkts) &&
(!rtlpriv->dm.b_disable_framebursting)) { (!rtlpriv->dm.disable_framebursting)) {
cur_txok_cnt = rtlpriv->stats.txbytesunicast - last_txok_cnt; cur_txok_cnt = rtlpriv->stats.txbytesunicast - last_txok_cnt;
cur_rxok_cnt = rtlpriv->stats.rxbytesunicast - last_rxok_cnt; cur_rxok_cnt = rtlpriv->stats.rxbytesunicast - last_rxok_cnt;
if (cur_rxok_cnt > 4 * cur_txok_cnt) { if (cur_rxok_cnt > 4 * cur_txok_cnt) {
if (!rtlpriv->dm.bis_cur_rdlstate || if (!rtlpriv->dm.is_cur_rdlstate ||
!rtlpriv->dm.bcurrent_turbo_edca) { !rtlpriv->dm.current_turbo_edca) {
rtl_write_dword(rtlpriv, rtl_write_dword(rtlpriv,
REG_EDCA_BE_PARAM, REG_EDCA_BE_PARAM,
edca_be_dl); edca_be_dl);
rtlpriv->dm.bis_cur_rdlstate = true; rtlpriv->dm.is_cur_rdlstate = true;
} }
} else { } else {
if (rtlpriv->dm.bis_cur_rdlstate || if (rtlpriv->dm.is_cur_rdlstate ||
!rtlpriv->dm.bcurrent_turbo_edca) { !rtlpriv->dm.current_turbo_edca) {
rtl_write_dword(rtlpriv, rtl_write_dword(rtlpriv,
REG_EDCA_BE_PARAM, REG_EDCA_BE_PARAM,
edca_be_ul); edca_be_ul);
rtlpriv->dm.bis_cur_rdlstate = false; rtlpriv->dm.is_cur_rdlstate = false;
} }
} }
rtlpriv->dm.bcurrent_turbo_edca = true; rtlpriv->dm.current_turbo_edca = true;
} else { } else {
if (rtlpriv->dm.bcurrent_turbo_edca) { if (rtlpriv->dm.current_turbo_edca) {
u8 tmp = AC0_BE; u8 tmp = AC0_BE;
rtlpriv->cfg->ops->set_hw_reg(hw, rtlpriv->cfg->ops->set_hw_reg(hw,
HW_VAR_AC_PARAM, HW_VAR_AC_PARAM,
(u8 *) (&tmp)); (u8 *) (&tmp));
rtlpriv->dm.bcurrent_turbo_edca = false; rtlpriv->dm.current_turbo_edca = false;
} }
} }
dm_checkedcaturbo_exit: dm_checkedcaturbo_exit:
rtlpriv->dm.bis_any_nonbepkts = false; rtlpriv->dm.is_any_nonbepkts = false;
last_txok_cnt = rtlpriv->stats.txbytesunicast; last_txok_cnt = rtlpriv->stats.txbytesunicast;
last_rxok_cnt = rtlpriv->stats.rxbytesunicast; last_rxok_cnt = rtlpriv->stats.rxbytesunicast;
} }
...@@ -636,7 +636,7 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw ...@@ -636,7 +636,7 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
u8 txpwr_level[2] = {0, 0}; u8 txpwr_level[2] = {0, 0};
u8 ofdm_min_index = 6, rf; u8 ofdm_min_index = 6, rf;
rtlpriv->dm.btxpower_trackingInit = true; rtlpriv->dm.txpower_trackingInit = true;
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
("rtl92c_dm_txpower_tracking_callback_thermalmeter\n")); ("rtl92c_dm_txpower_tracking_callback_thermalmeter\n"));
...@@ -696,7 +696,7 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw ...@@ -696,7 +696,7 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
rtl_get_bbreg(hw, RCCK0_TXFILTER2, MASKDWORD) & MASKCCK; rtl_get_bbreg(hw, RCCK0_TXFILTER2, MASKDWORD) & MASKCCK;
for (i = 0; i < CCK_TABLE_LENGTH; i++) { for (i = 0; i < CCK_TABLE_LENGTH; i++) {
if (rtlpriv->dm.b_cck_inch14) { if (rtlpriv->dm.cck_inch14) {
if (memcmp((void *)&temp_cck, if (memcmp((void *)&temp_cck,
(void *)&cckswing_table_ch14[i][2], (void *)&cckswing_table_ch14[i][2],
4) == 0) { 4) == 0) {
...@@ -708,7 +708,7 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw ...@@ -708,7 +708,7 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
"cck_index=0x%x, ch 14 %d\n", "cck_index=0x%x, ch 14 %d\n",
RCCK0_TXFILTER2, temp_cck, RCCK0_TXFILTER2, temp_cck,
cck_index_old, cck_index_old,
rtlpriv->dm.b_cck_inch14)); rtlpriv->dm.cck_inch14));
break; break;
} }
} else { } else {
...@@ -724,7 +724,7 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw ...@@ -724,7 +724,7 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
"cck_index=0x%x, ch14 %d\n", "cck_index=0x%x, ch14 %d\n",
RCCK0_TXFILTER2, temp_cck, RCCK0_TXFILTER2, temp_cck,
cck_index_old, cck_index_old,
rtlpriv->dm.b_cck_inch14)); rtlpriv->dm.cck_inch14));
break; break;
} }
} }
...@@ -937,7 +937,7 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw ...@@ -937,7 +937,7 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
BIT(31) | BIT(29), 0x00); BIT(31) | BIT(29), 0x00);
} }
if (!rtlpriv->dm.b_cck_inch14) { if (!rtlpriv->dm.cck_inch14) {
rtl_write_byte(rtlpriv, 0xa22, rtl_write_byte(rtlpriv, 0xa22,
cckswing_table_ch1ch13[cck_index] cckswing_table_ch1ch13[cck_index]
[0]); [0]);
...@@ -1057,12 +1057,12 @@ static void rtl92c_dm_initialize_txpower_tracking_thermalmeter( ...@@ -1057,12 +1057,12 @@ static void rtl92c_dm_initialize_txpower_tracking_thermalmeter(
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
rtlpriv->dm.btxpower_tracking = true; rtlpriv->dm.txpower_tracking = true;
rtlpriv->dm.btxpower_trackingInit = false; rtlpriv->dm.txpower_trackingInit = false;
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
("pMgntInfo->btxpower_tracking = %d\n", ("pMgntInfo->txpower_tracking = %d\n",
rtlpriv->dm.btxpower_tracking)); rtlpriv->dm.txpower_tracking));
} }
static void rtl92c_dm_initialize_txpower_tracking(struct ieee80211_hw *hw) static void rtl92c_dm_initialize_txpower_tracking(struct ieee80211_hw *hw)
...@@ -1081,7 +1081,7 @@ static void rtl92c_dm_check_txpower_tracking_thermal_meter( ...@@ -1081,7 +1081,7 @@ static void rtl92c_dm_check_txpower_tracking_thermal_meter(
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
static u8 tm_trigger; static u8 tm_trigger;
if (!rtlpriv->dm.btxpower_tracking) if (!rtlpriv->dm.txpower_tracking)
return; return;
if (!tm_trigger) { if (!tm_trigger) {
...@@ -1113,9 +1113,9 @@ void rtl92c_dm_init_rate_adaptive_mask(struct ieee80211_hw *hw) ...@@ -1113,9 +1113,9 @@ void rtl92c_dm_init_rate_adaptive_mask(struct ieee80211_hw *hw)
p_ra->pre_ratr_state = DM_RATR_STA_INIT; p_ra->pre_ratr_state = DM_RATR_STA_INIT;
if (rtlpriv->dm.dm_type == DM_TYPE_BYDRIVER) if (rtlpriv->dm.dm_type == DM_TYPE_BYDRIVER)
rtlpriv->dm.b_useramask = true; rtlpriv->dm.useramask = true;
else else
rtlpriv->dm.b_useramask = false; rtlpriv->dm.useramask = false;
} }
...@@ -1133,7 +1133,7 @@ static void rtl92c_dm_refresh_rate_adaptive_mask(struct ieee80211_hw *hw) ...@@ -1133,7 +1133,7 @@ static void rtl92c_dm_refresh_rate_adaptive_mask(struct ieee80211_hw *hw)
return; return;
} }
if (!rtlpriv->dm.b_useramask) { if (!rtlpriv->dm.useramask) {
RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD,
("<---- driver does not control rate adaptive mask\n")); ("<---- driver does not control rate adaptive mask\n"));
return; return;
...@@ -1365,16 +1365,16 @@ void rtl92c_dm_watchdog(struct ieee80211_hw *hw) ...@@ -1365,16 +1365,16 @@ void rtl92c_dm_watchdog(struct ieee80211_hw *hw)
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
bool b_fw_current_inpsmode = false; bool fw_current_inpsmode = false;
bool b_fw_ps_awake = true; bool fw_ps_awake = true;
rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_FW_PSMODE_STATUS, rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_FW_PSMODE_STATUS,
(u8 *) (&b_fw_current_inpsmode)); (u8 *) (&fw_current_inpsmode));
rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_FWLPS_RF_ON, rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_FWLPS_RF_ON,
(u8 *) (&b_fw_ps_awake)); (u8 *) (&fw_ps_awake));
if ((ppsc->rfpwr_state == ERFON) && ((!b_fw_current_inpsmode) && if ((ppsc->rfpwr_state == ERFON) && ((!fw_current_inpsmode) &&
b_fw_ps_awake) fw_ps_awake)
&& (!ppsc->rfchange_inprogress)) { && (!ppsc->rfchange_inprogress)) {
rtl92c_dm_pwdb_monitor(hw); rtl92c_dm_pwdb_monitor(hw);
rtl92c_dm_dig(hw); rtl92c_dm_dig(hw);
......
...@@ -44,7 +44,7 @@ void rtl92c_dm_dynamic_txpower(struct ieee80211_hw *hw) ...@@ -44,7 +44,7 @@ void rtl92c_dm_dynamic_txpower(struct ieee80211_hw *hw)
struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
long undecorated_smoothed_pwdb; long undecorated_smoothed_pwdb;
if (!rtlpriv->dm.bdynamic_txpower_enable) if (!rtlpriv->dm.dynamic_txpower_enable)
return; return;
if (rtlpriv->dm.dm_flag & HAL_DM_HIPWR_DISABLE) { if (rtlpriv->dm.dm_flag & HAL_DM_HIPWR_DISABLE) {
......
...@@ -316,12 +316,12 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw, ...@@ -316,12 +316,12 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
while (true) { while (true) {
spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag); spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag);
if (rtlhal->b_h2c_setinprogress) { if (rtlhal->h2c_setinprogress) {
RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
("H2C set in progress! Wait to set.." ("H2C set in progress! Wait to set.."
"element_id(%d).\n", element_id)); "element_id(%d).\n", element_id));
while (rtlhal->b_h2c_setinprogress) { while (rtlhal->h2c_setinprogress) {
spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock,
flag); flag);
h2c_waitcounter++; h2c_waitcounter++;
...@@ -337,7 +337,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw, ...@@ -337,7 +337,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
} }
spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag); spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag);
} else { } else {
rtlhal->b_h2c_setinprogress = true; rtlhal->h2c_setinprogress = true;
spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag); spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag);
break; break;
} }
...@@ -493,7 +493,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw, ...@@ -493,7 +493,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
} }
spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag); spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag);
rtlhal->b_h2c_setinprogress = false; rtlhal->h2c_setinprogress = false;
spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag); spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag);
RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("go out\n")); RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("go out\n"));
...@@ -505,7 +505,7 @@ void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw, ...@@ -505,7 +505,7 @@ void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw,
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
u32 tmp_cmdbuf[2]; u32 tmp_cmdbuf[2];
if (rtlhal->bfw_ready == false) { if (rtlhal->fw_ready == false) {
RT_ASSERT(false, ("return H2C cmd because of Fw " RT_ASSERT(false, ("return H2C cmd because of Fw "
"download fail!!!\n")); "download fail!!!\n"));
return; return;
......
...@@ -124,7 +124,7 @@ void rtl92ce_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) ...@@ -124,7 +124,7 @@ void rtl92ce_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
break; break;
} }
case HW_VAR_FW_PSMODE_STATUS: case HW_VAR_FW_PSMODE_STATUS:
*((bool *) (val)) = ppsc->b_fw_current_inpsmode; *((bool *) (val)) = ppsc->fw_current_inpsmode;
break; break;
case HW_VAR_CORRECT_TSF:{ case HW_VAR_CORRECT_TSF:{
u64 tsf; u64 tsf;
...@@ -173,15 +173,15 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) ...@@ -173,15 +173,15 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
break; break;
} }
case HW_VAR_BASIC_RATE:{ case HW_VAR_BASIC_RATE:{
u16 b_rate_cfg = ((u16 *) val)[0]; u16 rate_cfg = ((u16 *) val)[0];
u8 rate_index = 0; u8 rate_index = 0;
b_rate_cfg = b_rate_cfg & 0x15f; rate_cfg &= 0x15f;
b_rate_cfg |= 0x01; rate_cfg |= 0x01;
rtl_write_byte(rtlpriv, REG_RRSR, b_rate_cfg & 0xff); rtl_write_byte(rtlpriv, REG_RRSR, rate_cfg & 0xff);
rtl_write_byte(rtlpriv, REG_RRSR + 1, rtl_write_byte(rtlpriv, REG_RRSR + 1,
(b_rate_cfg >> 8)&0xff); (rate_cfg >> 8)&0xff);
while (b_rate_cfg > 0x1) { while (rate_cfg > 0x1) {
b_rate_cfg = (b_rate_cfg >> 1); rate_cfg = (rate_cfg >> 1);
rate_index++; rate_index++;
} }
rtl_write_byte(rtlpriv, REG_INIRTS_RATE_SEL, rtl_write_byte(rtlpriv, REG_INIRTS_RATE_SEL,
...@@ -469,12 +469,12 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) ...@@ -469,12 +469,12 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
break; break;
} }
case HW_VAR_FW_PSMODE_STATUS: case HW_VAR_FW_PSMODE_STATUS:
ppsc->b_fw_current_inpsmode = *((bool *) val); ppsc->fw_current_inpsmode = *((bool *) val);
break; break;
case HW_VAR_H2C_FW_JOINBSSRPT:{ case HW_VAR_H2C_FW_JOINBSSRPT:{
u8 mstatus = (*(u8 *) val); u8 mstatus = (*(u8 *) val);
u8 tmp_regcr, tmp_reg422; u8 tmp_regcr, tmp_reg422;
bool b_recover = false; bool recover = false;
if (mstatus == RT_MEDIA_CONNECT) { if (mstatus == RT_MEDIA_CONNECT) {
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AID, rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AID,
...@@ -491,7 +491,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) ...@@ -491,7 +491,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
rtl_read_byte(rtlpriv, rtl_read_byte(rtlpriv,
REG_FWHW_TXQ_CTRL + 2); REG_FWHW_TXQ_CTRL + 2);
if (tmp_reg422 & BIT(6)) if (tmp_reg422 & BIT(6))
b_recover = true; recover = true;
rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2, rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2,
tmp_reg422 & (~BIT(6))); tmp_reg422 & (~BIT(6)));
...@@ -500,7 +500,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) ...@@ -500,7 +500,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
_rtl92ce_set_bcn_ctrl_reg(hw, BIT(3), 0); _rtl92ce_set_bcn_ctrl_reg(hw, BIT(3), 0);
_rtl92ce_set_bcn_ctrl_reg(hw, 0, BIT(4)); _rtl92ce_set_bcn_ctrl_reg(hw, 0, BIT(4));
if (b_recover) { if (recover) {
rtl_write_byte(rtlpriv, rtl_write_byte(rtlpriv,
REG_FWHW_TXQ_CTRL + 2, REG_FWHW_TXQ_CTRL + 2,
tmp_reg422); tmp_reg422);
...@@ -868,7 +868,7 @@ static void _rtl92ce_enable_aspm_back_door(struct ieee80211_hw *hw) ...@@ -868,7 +868,7 @@ static void _rtl92ce_enable_aspm_back_door(struct ieee80211_hw *hw)
rtl_write_word(rtlpriv, 0x350, 0x870c); rtl_write_word(rtlpriv, 0x350, 0x870c);
rtl_write_byte(rtlpriv, 0x352, 0x1); rtl_write_byte(rtlpriv, 0x352, 0x1);
if (ppsc->b_support_backdoor) if (ppsc->support_backdoor)
rtl_write_byte(rtlpriv, 0x349, 0x1b); rtl_write_byte(rtlpriv, 0x349, 0x1b);
else else
rtl_write_byte(rtlpriv, 0x349, 0x03); rtl_write_byte(rtlpriv, 0x349, 0x03);
...@@ -940,10 +940,10 @@ int rtl92ce_hw_init(struct ieee80211_hw *hw) ...@@ -940,10 +940,10 @@ int rtl92ce_hw_init(struct ieee80211_hw *hw)
("Failed to download FW. Init HW " ("Failed to download FW. Init HW "
"without FW now..\n")); "without FW now..\n"));
err = 1; err = 1;
rtlhal->bfw_ready = false; rtlhal->fw_ready = false;
return err; return err;
} else { } else {
rtlhal->bfw_ready = true; rtlhal->fw_ready = true;
} }
rtlhal->last_hmeboxnum = 0; rtlhal->last_hmeboxnum = 0;
...@@ -1237,7 +1237,7 @@ static void _rtl92ce_poweroff_adapter(struct ieee80211_hw *hw) ...@@ -1237,7 +1237,7 @@ static void _rtl92ce_poweroff_adapter(struct ieee80211_hw *hw)
rtl_write_byte(rtlpriv, REG_APSD_CTRL, 0x40); rtl_write_byte(rtlpriv, REG_APSD_CTRL, 0x40);
rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE2); rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE2);
rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE0); rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE0);
if ((rtl_read_byte(rtlpriv, REG_MCUFWDL) & BIT(7)) && rtlhal->bfw_ready) if ((rtl_read_byte(rtlpriv, REG_MCUFWDL) & BIT(7)) && rtlhal->fw_ready)
rtl92c_firmware_selfreset(hw); rtl92c_firmware_selfreset(hw);
rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN + 1, 0x51); rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN + 1, 0x51);
rtl_write_byte(rtlpriv, REG_MCUFWDL, 0x00); rtl_write_byte(rtlpriv, REG_MCUFWDL, 0x00);
...@@ -1555,7 +1555,7 @@ static void _rtl92ce_read_txpower_info_from_hwpg(struct ieee80211_hw *hw, ...@@ -1555,7 +1555,7 @@ static void _rtl92ce_read_txpower_info_from_hwpg(struct ieee80211_hw *hw,
rtlefuse->eeprom_thermalmeter = (tempval & 0x1f); rtlefuse->eeprom_thermalmeter = (tempval & 0x1f);
if (rtlefuse->eeprom_thermalmeter == 0x1f || autoload_fail) if (rtlefuse->eeprom_thermalmeter == 0x1f || autoload_fail)
rtlefuse->b_apk_thermalmeterignore = true; rtlefuse->apk_thermalmeterignore = true;
rtlefuse->thermalmeter[0] = rtlefuse->eeprom_thermalmeter; rtlefuse->thermalmeter[0] = rtlefuse->eeprom_thermalmeter;
RTPRINT(rtlpriv, FINIT, INIT_TxPower, RTPRINT(rtlpriv, FINIT, INIT_TxPower,
...@@ -1612,7 +1612,7 @@ static void _rtl92ce_read_adapter_info(struct ieee80211_hw *hw) ...@@ -1612,7 +1612,7 @@ static void _rtl92ce_read_adapter_info(struct ieee80211_hw *hw)
rtlefuse->eeprom_channelplan = *(u8 *)&hwinfo[EEPROM_CHANNELPLAN]; rtlefuse->eeprom_channelplan = *(u8 *)&hwinfo[EEPROM_CHANNELPLAN];
rtlefuse->eeprom_version = *(u16 *)&hwinfo[EEPROM_VERSION]; rtlefuse->eeprom_version = *(u16 *)&hwinfo[EEPROM_VERSION];
rtlefuse->b_txpwr_fromeprom = true; rtlefuse->txpwr_fromeprom = true;
rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMER_ID]; rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMER_ID];
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
...@@ -1655,7 +1655,7 @@ static void _rtl92ce_hal_customized_behavior(struct ieee80211_hw *hw) ...@@ -1655,7 +1655,7 @@ static void _rtl92ce_hal_customized_behavior(struct ieee80211_hw *hw)
switch (rtlhal->oem_id) { switch (rtlhal->oem_id) {
case RT_CID_819x_HP: case RT_CID_819x_HP:
pcipriv->ledctl.bled_opendrain = true; pcipriv->ledctl.led_opendrain = true;
break; break;
case RT_CID_819x_Lenovo: case RT_CID_819x_Lenovo:
case RT_CID_DEFAULT: case RT_CID_DEFAULT:
...@@ -1680,10 +1680,10 @@ void rtl92ce_read_eeprom_info(struct ieee80211_hw *hw) ...@@ -1680,10 +1680,10 @@ void rtl92ce_read_eeprom_info(struct ieee80211_hw *hw)
rtlhal->version = _rtl92ce_read_chip_version(hw); rtlhal->version = _rtl92ce_read_chip_version(hw);
if (get_rf_type(rtlphy) == RF_1T1R) if (get_rf_type(rtlphy) == RF_1T1R)
rtlpriv->dm.brfpath_rxenable[0] = true; rtlpriv->dm.rfpath_rxenable[0] = true;
else else
rtlpriv->dm.brfpath_rxenable[0] = rtlpriv->dm.rfpath_rxenable[0] =
rtlpriv->dm.brfpath_rxenable[1] = true; rtlpriv->dm.rfpath_rxenable[1] = true;
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("VersionID = 0x%4x\n", RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("VersionID = 0x%4x\n",
rtlhal->version)); rtlhal->version));
tmp_u1b = rtl_read_byte(rtlpriv, REG_9346CR); tmp_u1b = rtl_read_byte(rtlpriv, REG_9346CR);
...@@ -1714,13 +1714,13 @@ void rtl92ce_update_hal_rate_table(struct ieee80211_hw *hw) ...@@ -1714,13 +1714,13 @@ void rtl92ce_update_hal_rate_table(struct ieee80211_hw *hw)
u32 ratr_value = (u32) mac->basic_rates; u32 ratr_value = (u32) mac->basic_rates;
u8 *p_mcsrate = mac->mcs; u8 *p_mcsrate = mac->mcs;
u8 ratr_index = 0; u8 ratr_index = 0;
u8 b_nmode = mac->ht_enable; u8 nmode = mac->ht_enable;
u8 mimo_ps = 1; u8 mimo_ps = 1;
u16 shortgi_rate; u16 shortgi_rate;
u32 tmp_ratr_value; u32 tmp_ratr_value;
u8 b_curtxbw_40mhz = mac->bw_40; u8 curtxbw_40mhz = mac->bw_40;
u8 b_curshortgi_40mhz = mac->sgi_40; u8 curshortgi_40mhz = mac->sgi_40;
u8 b_curshortgi_20mhz = mac->sgi_20; u8 curshortgi_20mhz = mac->sgi_20;
enum wireless_mode wirelessmode = mac->mode; enum wireless_mode wirelessmode = mac->mode;
ratr_value |= EF2BYTE((*(u16 *) (p_mcsrate))) << 12; ratr_value |= EF2BYTE((*(u16 *) (p_mcsrate))) << 12;
...@@ -1737,7 +1737,7 @@ void rtl92ce_update_hal_rate_table(struct ieee80211_hw *hw) ...@@ -1737,7 +1737,7 @@ void rtl92ce_update_hal_rate_table(struct ieee80211_hw *hw)
break; break;
case WIRELESS_MODE_N_24G: case WIRELESS_MODE_N_24G:
case WIRELESS_MODE_N_5G: case WIRELESS_MODE_N_5G:
b_nmode = 1; nmode = 1;
if (mimo_ps == 0) { if (mimo_ps == 0) {
ratr_value &= 0x0007F005; ratr_value &= 0x0007F005;
} else { } else {
...@@ -1763,9 +1763,8 @@ void rtl92ce_update_hal_rate_table(struct ieee80211_hw *hw) ...@@ -1763,9 +1763,8 @@ void rtl92ce_update_hal_rate_table(struct ieee80211_hw *hw)
ratr_value &= 0x0FFFFFFF; ratr_value &= 0x0FFFFFFF;
if (b_nmode && ((b_curtxbw_40mhz && if (nmode && ((curtxbw_40mhz && curshortgi_40mhz) || (!curtxbw_40mhz &&
b_curshortgi_40mhz) || (!b_curtxbw_40mhz && curshortgi_20mhz))) {
b_curshortgi_20mhz))) {
ratr_value |= 0x10000000; ratr_value |= 0x10000000;
tmp_ratr_value = (ratr_value >> 12); tmp_ratr_value = (ratr_value >> 12);
...@@ -1793,11 +1792,11 @@ void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level) ...@@ -1793,11 +1792,11 @@ void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level)
u32 ratr_bitmap = (u32) mac->basic_rates; u32 ratr_bitmap = (u32) mac->basic_rates;
u8 *p_mcsrate = mac->mcs; u8 *p_mcsrate = mac->mcs;
u8 ratr_index; u8 ratr_index;
u8 b_curtxbw_40mhz = mac->bw_40; u8 curtxbw_40mhz = mac->bw_40;
u8 b_curshortgi_40mhz = mac->sgi_40; u8 curshortgi_40mhz = mac->sgi_40;
u8 b_curshortgi_20mhz = mac->sgi_20; u8 curshortgi_20mhz = mac->sgi_20;
enum wireless_mode wirelessmode = mac->mode; enum wireless_mode wirelessmode = mac->mode;
bool b_shortgi = false; bool shortgi = false;
u8 rate_mask[5]; u8 rate_mask[5];
u8 macid = 0; u8 macid = 0;
u8 mimops = 1; u8 mimops = 1;
...@@ -1839,7 +1838,7 @@ void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level) ...@@ -1839,7 +1838,7 @@ void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level)
} else { } else {
if (rtlphy->rf_type == RF_1T2R || if (rtlphy->rf_type == RF_1T2R ||
rtlphy->rf_type == RF_1T1R) { rtlphy->rf_type == RF_1T1R) {
if (b_curtxbw_40mhz) { if (curtxbw_40mhz) {
if (rssi_level == 1) if (rssi_level == 1)
ratr_bitmap &= 0x000f0000; ratr_bitmap &= 0x000f0000;
else if (rssi_level == 2) else if (rssi_level == 2)
...@@ -1855,7 +1854,7 @@ void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level) ...@@ -1855,7 +1854,7 @@ void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level)
ratr_bitmap &= 0x000ff005; ratr_bitmap &= 0x000ff005;
} }
} else { } else {
if (b_curtxbw_40mhz) { if (curtxbw_40mhz) {
if (rssi_level == 1) if (rssi_level == 1)
ratr_bitmap &= 0x0f0f0000; ratr_bitmap &= 0x0f0f0000;
else if (rssi_level == 2) else if (rssi_level == 2)
...@@ -1873,13 +1872,13 @@ void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level) ...@@ -1873,13 +1872,13 @@ void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level)
} }
} }
if ((b_curtxbw_40mhz && b_curshortgi_40mhz) || if ((curtxbw_40mhz && curshortgi_40mhz) ||
(!b_curtxbw_40mhz && b_curshortgi_20mhz)) { (!curtxbw_40mhz && curshortgi_20mhz)) {
if (macid == 0) if (macid == 0)
b_shortgi = true; shortgi = true;
else if (macid == 1) else if (macid == 1)
b_shortgi = false; shortgi = false;
} }
break; break;
default: default:
...@@ -1895,7 +1894,7 @@ void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level) ...@@ -1895,7 +1894,7 @@ void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level)
("ratr_bitmap :%x\n", ratr_bitmap)); ("ratr_bitmap :%x\n", ratr_bitmap));
*(u32 *)&rate_mask = EF4BYTE((ratr_bitmap & 0x0fffffff) | *(u32 *)&rate_mask = EF4BYTE((ratr_bitmap & 0x0fffffff) |
(ratr_index << 28)); (ratr_index << 28));
rate_mask[4] = macid | (b_shortgi ? 0x20 : 0x00) | 0x80; rate_mask[4] = macid | (shortgi ? 0x20 : 0x00) | 0x80;
RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, ("Rate_index:%x, " RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, ("Rate_index:%x, "
"ratr_val:%x, %x:%x:%x:%x:%x\n", "ratr_val:%x, %x:%x:%x:%x:%x\n",
ratr_index, ratr_bitmap, ratr_index, ratr_bitmap,
...@@ -1927,13 +1926,13 @@ bool rtl92ce_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 * valid) ...@@ -1927,13 +1926,13 @@ bool rtl92ce_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 * valid)
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
enum rf_pwrstate e_rfpowerstate_toset, cur_rfstate; enum rf_pwrstate e_rfpowerstate_toset, cur_rfstate;
u8 u1tmp; u8 u1tmp;
bool b_actuallyset = false; bool actuallyset = false;
unsigned long flag; unsigned long flag;
if ((rtlpci->up_first_time == 1) || (rtlpci->being_init_adapter)) if ((rtlpci->up_first_time == 1) || (rtlpci->being_init_adapter))
return false; return false;
if (ppsc->b_swrf_processing) if (ppsc->swrf_processing)
return false; return false;
spin_lock_irqsave(&rtlpriv->locks.rf_ps_lock, flag); spin_lock_irqsave(&rtlpriv->locks.rf_ps_lock, flag);
...@@ -1959,24 +1958,24 @@ bool rtl92ce_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 * valid) ...@@ -1959,24 +1958,24 @@ bool rtl92ce_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 * valid)
u1tmp = rtl_read_byte(rtlpriv, REG_GPIO_IO_SEL); u1tmp = rtl_read_byte(rtlpriv, REG_GPIO_IO_SEL);
e_rfpowerstate_toset = (u1tmp & BIT(3)) ? ERFON : ERFOFF; e_rfpowerstate_toset = (u1tmp & BIT(3)) ? ERFON : ERFOFF;
if ((ppsc->b_hwradiooff == true) && (e_rfpowerstate_toset == ERFON)) { if ((ppsc->hwradiooff == true) && (e_rfpowerstate_toset == ERFON)) {
RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
("GPIOChangeRF - HW Radio ON, RF ON\n")); ("GPIOChangeRF - HW Radio ON, RF ON\n"));
e_rfpowerstate_toset = ERFON; e_rfpowerstate_toset = ERFON;
ppsc->b_hwradiooff = false; ppsc->hwradiooff = false;
b_actuallyset = true; actuallyset = true;
} else if ((ppsc->b_hwradiooff == false) } else if ((ppsc->hwradiooff == false)
&& (e_rfpowerstate_toset == ERFOFF)) { && (e_rfpowerstate_toset == ERFOFF)) {
RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
("GPIOChangeRF - HW Radio OFF, RF OFF\n")); ("GPIOChangeRF - HW Radio OFF, RF OFF\n"));
e_rfpowerstate_toset = ERFOFF; e_rfpowerstate_toset = ERFOFF;
ppsc->b_hwradiooff = true; ppsc->hwradiooff = true;
b_actuallyset = true; actuallyset = true;
} }
if (b_actuallyset) { if (actuallyset) {
if (e_rfpowerstate_toset == ERFON) { if (e_rfpowerstate_toset == ERFON) {
if ((ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM) && if ((ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM) &&
RT_IN_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_ASPM)) { RT_IN_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_ASPM)) {
...@@ -2015,7 +2014,7 @@ bool rtl92ce_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 * valid) ...@@ -2015,7 +2014,7 @@ bool rtl92ce_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 * valid)
} }
*valid = 1; *valid = 1;
return !ppsc->b_hwradiooff; return !ppsc->hwradiooff;
} }
......
...@@ -57,7 +57,7 @@ void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled) ...@@ -57,7 +57,7 @@ void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
("switch case not process\n")); ("switch case not process\n"));
break; break;
} }
pled->b_ledon = true; pled->ledon = true;
} }
void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled) void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
...@@ -76,7 +76,7 @@ void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled) ...@@ -76,7 +76,7 @@ void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
break; break;
case LED_PIN_LED0: case LED_PIN_LED0:
ledcfg &= 0xf0; ledcfg &= 0xf0;
if (pcipriv->ledctl.bled_opendrain == true) if (pcipriv->ledctl.led_opendrain == true)
rtl_write_byte(rtlpriv, REG_LEDCFG2, rtl_write_byte(rtlpriv, REG_LEDCFG2,
(ledcfg | BIT(1) | BIT(5) | BIT(6))); (ledcfg | BIT(1) | BIT(5) | BIT(6)));
else else
...@@ -92,7 +92,7 @@ void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled) ...@@ -92,7 +92,7 @@ void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
("switch case not process\n")); ("switch case not process\n"));
break; break;
} }
pled->b_ledon = false; pled->ledon = false;
} }
void rtl92ce_init_sw_leds(struct ieee80211_hw *hw) void rtl92ce_init_sw_leds(struct ieee80211_hw *hw)
......
...@@ -330,7 +330,7 @@ bool rtl92c_phy_bb_config(struct ieee80211_hw *hw) ...@@ -330,7 +330,7 @@ bool rtl92c_phy_bb_config(struct ieee80211_hw *hw)
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
u16 regval; u16 regval;
u32 regvaldw; u32 regvaldw;
u8 b_reg_hwparafile = 1; u8 reg_hwparafile = 1;
_rtl92c_phy_init_bb_rf_register_definition(hw); _rtl92c_phy_init_bb_rf_register_definition(hw);
regval = rtl_read_word(rtlpriv, REG_SYS_FUNC_EN); regval = rtl_read_word(rtlpriv, REG_SYS_FUNC_EN);
...@@ -345,7 +345,7 @@ bool rtl92c_phy_bb_config(struct ieee80211_hw *hw) ...@@ -345,7 +345,7 @@ bool rtl92c_phy_bb_config(struct ieee80211_hw *hw)
rtl_write_byte(rtlpriv, REG_AFE_XTAL_CTRL + 1, 0x80); rtl_write_byte(rtlpriv, REG_AFE_XTAL_CTRL + 1, 0x80);
regvaldw = rtl_read_dword(rtlpriv, REG_LEDCFG0); regvaldw = rtl_read_dword(rtlpriv, REG_LEDCFG0);
rtl_write_dword(rtlpriv, REG_LEDCFG0, regvaldw | BIT(23)); rtl_write_dword(rtlpriv, REG_LEDCFG0, regvaldw | BIT(23));
if (b_reg_hwparafile == 1) if (reg_hwparafile == 1)
rtstatus = _rtl92c_phy_bb8192c_config_parafile(hw); rtstatus = _rtl92c_phy_bb8192c_config_parafile(hw);
return rtstatus; return rtstatus;
} }
...@@ -388,7 +388,7 @@ static bool _rtl92c_phy_bb8192c_config_parafile(struct ieee80211_hw *hw) ...@@ -388,7 +388,7 @@ static bool _rtl92c_phy_bb8192c_config_parafile(struct ieee80211_hw *hw)
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("AGC Table Fail\n")); RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("AGC Table Fail\n"));
return false; return false;
} }
rtlphy->bcck_high_power = (bool) (rtl_get_bbreg(hw, rtlphy->cck_high_power = (bool) (rtl_get_bbreg(hw,
RFPGA0_XA_HSSIPARAMETER2, RFPGA0_XA_HSSIPARAMETER2,
0x200)); 0x200));
return true; return true;
...@@ -954,7 +954,7 @@ void rtl92c_phy_set_txpower_level(struct ieee80211_hw *hw, u8 channel) ...@@ -954,7 +954,7 @@ void rtl92c_phy_set_txpower_level(struct ieee80211_hw *hw, u8 channel)
struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
u8 cckpowerlevel[2], ofdmpowerlevel[2]; u8 cckpowerlevel[2], ofdmpowerlevel[2];
if (rtlefuse->b_txpwr_fromeprom == false) if (rtlefuse->txpwr_fromeprom == false)
return; return;
_rtl92c_get_txpower_index(hw, channel, _rtl92c_get_txpower_index(hw, channel,
&cckpowerlevel[0], &ofdmpowerlevel[0]); &cckpowerlevel[0], &ofdmpowerlevel[0]);
...@@ -1437,7 +1437,7 @@ static u8 _rtl92c_phy_path_b_iqk(struct ieee80211_hw *hw) ...@@ -1437,7 +1437,7 @@ static u8 _rtl92c_phy_path_b_iqk(struct ieee80211_hw *hw)
} }
static void _rtl92c_phy_path_a_fill_iqk_matrix(struct ieee80211_hw *hw, static void _rtl92c_phy_path_a_fill_iqk_matrix(struct ieee80211_hw *hw,
bool b_iqk_ok, long result[][8], bool iqk_ok, long result[][8],
u8 final_candidate, bool btxonly) u8 final_candidate, bool btxonly)
{ {
u32 oldval_0, x, tx0_a, reg; u32 oldval_0, x, tx0_a, reg;
...@@ -1445,7 +1445,7 @@ static void _rtl92c_phy_path_a_fill_iqk_matrix(struct ieee80211_hw *hw, ...@@ -1445,7 +1445,7 @@ static void _rtl92c_phy_path_a_fill_iqk_matrix(struct ieee80211_hw *hw,
if (final_candidate == 0xFF) if (final_candidate == 0xFF)
return; return;
else if (b_iqk_ok) { else if (iqk_ok) {
oldval_0 = (rtl_get_bbreg(hw, ROFDM0_XATXIQIMBALANCE, oldval_0 = (rtl_get_bbreg(hw, ROFDM0_XATXIQIMBALANCE,
MASKDWORD) >> 22) & 0x3FF; MASKDWORD) >> 22) & 0x3FF;
x = result[final_candidate][0]; x = result[final_candidate][0];
...@@ -1477,7 +1477,7 @@ static void _rtl92c_phy_path_a_fill_iqk_matrix(struct ieee80211_hw *hw, ...@@ -1477,7 +1477,7 @@ static void _rtl92c_phy_path_a_fill_iqk_matrix(struct ieee80211_hw *hw,
} }
static void _rtl92c_phy_path_b_fill_iqk_matrix(struct ieee80211_hw *hw, static void _rtl92c_phy_path_b_fill_iqk_matrix(struct ieee80211_hw *hw,
bool b_iqk_ok, long result[][8], bool iqk_ok, long result[][8],
u8 final_candidate, bool btxonly) u8 final_candidate, bool btxonly)
{ {
u32 oldval_1, x, tx1_a, reg; u32 oldval_1, x, tx1_a, reg;
...@@ -1485,7 +1485,7 @@ static void _rtl92c_phy_path_b_fill_iqk_matrix(struct ieee80211_hw *hw, ...@@ -1485,7 +1485,7 @@ static void _rtl92c_phy_path_b_fill_iqk_matrix(struct ieee80211_hw *hw,
if (final_candidate == 0xFF) if (final_candidate == 0xFF)
return; return;
else if (b_iqk_ok) { else if (iqk_ok) {
oldval_1 = (rtl_get_bbreg(hw, ROFDM0_XBTXIQIMBALANCE, oldval_1 = (rtl_get_bbreg(hw, ROFDM0_XBTXIQIMBALANCE,
MASKDWORD) >> 22) & 0x3FF; MASKDWORD) >> 22) & 0x3FF;
x = result[final_candidate][4]; x = result[final_candidate][4];
...@@ -1698,11 +1698,11 @@ static void _rtl92c_phy_iq_calibrate(struct ieee80211_hw *hw, ...@@ -1698,11 +1698,11 @@ static void _rtl92c_phy_iq_calibrate(struct ieee80211_hw *hw,
} }
_rtl92c_phy_path_adda_on(hw, adda_reg, true, is2t); _rtl92c_phy_path_adda_on(hw, adda_reg, true, is2t);
if (t == 0) { if (t == 0) {
rtlphy->b_rfpi_enable = (u8) rtl_get_bbreg(hw, rtlphy->rfpi_enable = (u8) rtl_get_bbreg(hw,
RFPGA0_XA_HSSIPARAMETER1, RFPGA0_XA_HSSIPARAMETER1,
BIT(8)); BIT(8));
} }
if (!rtlphy->b_rfpi_enable) if (!rtlphy->rfpi_enable)
_rtl92c_phy_pi_mode_switch(hw, true); _rtl92c_phy_pi_mode_switch(hw, true);
if (t == 0) { if (t == 0) {
rtlphy->reg_c04 = rtl_get_bbreg(hw, 0xc04, MASKDWORD); rtlphy->reg_c04 = rtl_get_bbreg(hw, 0xc04, MASKDWORD);
...@@ -1783,7 +1783,7 @@ static void _rtl92c_phy_iq_calibrate(struct ieee80211_hw *hw, ...@@ -1783,7 +1783,7 @@ static void _rtl92c_phy_iq_calibrate(struct ieee80211_hw *hw,
if (is2t) if (is2t)
rtl_set_bbreg(hw, 0x844, MASKDWORD, 0x00032ed3); rtl_set_bbreg(hw, 0x844, MASKDWORD, 0x00032ed3);
if (t != 0) { if (t != 0) {
if (!rtlphy->b_rfpi_enable) if (!rtlphy->rfpi_enable)
_rtl92c_phy_pi_mode_switch(hw, false); _rtl92c_phy_pi_mode_switch(hw, false);
_rtl92c_phy_reload_adda_registers(hw, adda_reg, _rtl92c_phy_reload_adda_registers(hw, adda_reg,
rtlphy->adda_backup, 16); rtlphy->adda_backup, 16);
...@@ -2370,7 +2370,7 @@ void rtl92c_phy_ap_calibrate(struct ieee80211_hw *hw, char delta) ...@@ -2370,7 +2370,7 @@ void rtl92c_phy_ap_calibrate(struct ieee80211_hw *hw, char delta)
struct rtl_phy *rtlphy = &(rtlpriv->phy); struct rtl_phy *rtlphy = &(rtlpriv->phy);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
if (rtlphy->b_apk_done) if (rtlphy->apk_done)
return; return;
if (IS_92C_SERIAL(rtlhal->version)) if (IS_92C_SERIAL(rtlhal->version))
_rtl92c_phy_ap_calibrate(hw, delta, true); _rtl92c_phy_ap_calibrate(hw, delta, true);
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
#define RTL92C_MAX_PATH_NUM 2 #define RTL92C_MAX_PATH_NUM 2
#define CHANNEL_MAX_NUMBER 14 #define CHANNEL_MAX_NUMBER 14
#define CHANNEL_GROUP_MAX 3 #define CHANNEL_GROUP_MAX 3
#define LLT_LAST_ENTRY_OF_TX_PKT_BUFFER 255
enum swchnlcmd_id { enum swchnlcmd_id {
CMDID_END, CMDID_END,
CMDID_SET_TXPOWEROWER_LEVEL, CMDID_SET_TXPOWEROWER_LEVEL,
...@@ -233,5 +233,6 @@ void rtl92c_phy_config_bb_external_pa(struct ieee80211_hw *hw); ...@@ -233,5 +233,6 @@ void rtl92c_phy_config_bb_external_pa(struct ieee80211_hw *hw);
void rtl92ce_phy_set_rf_on(struct ieee80211_hw *hw); void rtl92ce_phy_set_rf_on(struct ieee80211_hw *hw);
bool rtl92c_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype); bool rtl92c_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype);
void rtl92c_phy_set_io(struct ieee80211_hw *hw); void rtl92c_phy_set_io(struct ieee80211_hw *hw);
void rtl92c_bb_block_on(struct ieee80211_hw *hw);
#endif #endif
...@@ -46,9 +46,9 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw) ...@@ -46,9 +46,9 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw)
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
rtlpriv->dm.b_dm_initialgain_enable = 1; rtlpriv->dm.dm_initialgain_enable = 1;
rtlpriv->dm.dm_flag = 0; rtlpriv->dm.dm_flag = 0;
rtlpriv->dm.b_disable_framebursting = 0;; rtlpriv->dm.disable_framebursting = 0;
rtlpriv->dm.thermalvalue = 0; rtlpriv->dm.thermalvalue = 0;
rtlpci->transmit_config = CFENDFORM | BIT(12) | BIT(13); rtlpci->transmit_config = CFENDFORM | BIT(12) | BIT(13);
......
...@@ -245,9 +245,9 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw, ...@@ -245,9 +245,9 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw,
struct rtl_stats *pstats, struct rtl_stats *pstats,
struct rx_desc_92c *pdesc, struct rx_desc_92c *pdesc,
struct rx_fwinfo_92c *p_drvinfo, struct rx_fwinfo_92c *p_drvinfo,
bool bpacket_match_bssid, bool packet_match_bssid,
bool bpacket_toself, bool packet_toself,
bool b_packet_beacon) bool packet_beacon)
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct phy_sts_cck_8192s_t *cck_buf; struct phy_sts_cck_8192s_t *cck_buf;
...@@ -258,11 +258,11 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw, ...@@ -258,11 +258,11 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw,
bool is_cck_rate; bool is_cck_rate;
is_cck_rate = RX_HAL_IS_CCK_RATE(pdesc); is_cck_rate = RX_HAL_IS_CCK_RATE(pdesc);
pstats->b_packet_matchbssid = bpacket_match_bssid; pstats->packet_matchbssid = packet_match_bssid;
pstats->b_packet_toself = bpacket_toself; pstats->packet_toself = packet_toself;
pstats->b_is_cck = is_cck_rate; pstats->is_cck = is_cck_rate;
pstats->b_packet_beacon = b_packet_beacon; pstats->packet_beacon = packet_beacon;
pstats->b_is_cck = is_cck_rate; pstats->is_cck = is_cck_rate;
pstats->rx_mimo_signalquality[0] = -1; pstats->rx_mimo_signalquality[0] = -1;
pstats->rx_mimo_signalquality[1] = -1; pstats->rx_mimo_signalquality[1] = -1;
...@@ -315,7 +315,7 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw, ...@@ -315,7 +315,7 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw,
pstats->rx_pwdb_all = pwdb_all; pstats->rx_pwdb_all = pwdb_all;
pstats->recvsignalpower = rx_pwr_all; pstats->recvsignalpower = rx_pwr_all;
if (bpacket_match_bssid) { if (packet_match_bssid) {
u8 sq; u8 sq;
if (pstats->rx_pwdb_all > 40) if (pstats->rx_pwdb_all > 40)
sq = 100; sq = 100;
...@@ -334,10 +334,10 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw, ...@@ -334,10 +334,10 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw,
pstats->rx_mimo_signalquality[1] = -1; pstats->rx_mimo_signalquality[1] = -1;
} }
} else { } else {
rtlpriv->dm.brfpath_rxenable[0] = rtlpriv->dm.rfpath_rxenable[0] =
rtlpriv->dm.brfpath_rxenable[1] = true; rtlpriv->dm.rfpath_rxenable[1] = true;
for (i = RF90_PATH_A; i < RF90_PATH_MAX; i++) { for (i = RF90_PATH_A; i < RF90_PATH_MAX; i++) {
if (rtlpriv->dm.brfpath_rxenable[i]) if (rtlpriv->dm.rfpath_rxenable[i])
rf_rx_num++; rf_rx_num++;
rx_pwr[i] = rx_pwr[i] =
...@@ -347,7 +347,7 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw, ...@@ -347,7 +347,7 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw,
rtlpriv->stats.rx_snr_db[i] = rtlpriv->stats.rx_snr_db[i] =
(long)(p_drvinfo->rxsnr[i] / 2); (long)(p_drvinfo->rxsnr[i] / 2);
if (bpacket_match_bssid) if (packet_match_bssid)
pstats->rx_mimo_signalstrength[i] = (u8) rssi; pstats->rx_mimo_signalstrength[i] = (u8) rssi;
} }
...@@ -366,7 +366,7 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw, ...@@ -366,7 +366,7 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw,
for (i = 0; i < max_spatial_stream; i++) { for (i = 0; i < max_spatial_stream; i++) {
evm = _rtl92c_evm_db_to_percentage(p_drvinfo->rxevm[i]); evm = _rtl92c_evm_db_to_percentage(p_drvinfo->rxevm[i]);
if (bpacket_match_bssid) { if (packet_match_bssid) {
if (i == 0) if (i == 0)
pstats->signalquality = pstats->signalquality =
(u8) (evm & 0xff); (u8) (evm & 0xff);
...@@ -393,7 +393,7 @@ static void _rtl92ce_process_ui_rssi(struct ieee80211_hw *hw, ...@@ -393,7 +393,7 @@ static void _rtl92ce_process_ui_rssi(struct ieee80211_hw *hw,
u8 rfpath; u8 rfpath;
u32 last_rssi, tmpval; u32 last_rssi, tmpval;
if (pstats->b_packet_toself || pstats->b_packet_beacon) { if (pstats->packet_toself || pstats->packet_beacon) {
rtlpriv->stats.rssi_calculate_cnt++; rtlpriv->stats.rssi_calculate_cnt++;
if (rtlpriv->stats.ui_rssi.total_num++ >= if (rtlpriv->stats.ui_rssi.total_num++ >=
...@@ -421,7 +421,7 @@ static void _rtl92ce_process_ui_rssi(struct ieee80211_hw *hw, ...@@ -421,7 +421,7 @@ static void _rtl92ce_process_ui_rssi(struct ieee80211_hw *hw,
pstats->rssi = rtlpriv->stats.signal_strength; pstats->rssi = rtlpriv->stats.signal_strength;
} }
if (!pstats->b_is_cck && pstats->b_packet_toself) { if (!pstats->is_cck && pstats->packet_toself) {
for (rfpath = RF90_PATH_A; rfpath < rtlphy->num_total_rfpath; for (rfpath = RF90_PATH_A; rfpath < rtlphy->num_total_rfpath;
rfpath++) { rfpath++) {
...@@ -493,7 +493,7 @@ static void _rtl92ce_process_pwdb(struct ieee80211_hw *hw, ...@@ -493,7 +493,7 @@ static void _rtl92ce_process_pwdb(struct ieee80211_hw *hw,
rtlpriv->dm.undecorated_smoothed_pwdb; rtlpriv->dm.undecorated_smoothed_pwdb;
} }
if (pstats->b_packet_toself || pstats->b_packet_beacon) { if (pstats->packet_toself || pstats->packet_beacon) {
if (undecorated_smoothed_pwdb < 0) if (undecorated_smoothed_pwdb < 0)
undecorated_smoothed_pwdb = pstats->rx_pwdb_all; undecorated_smoothed_pwdb = pstats->rx_pwdb_all;
...@@ -525,7 +525,7 @@ static void _rtl92ce_process_ui_link_quality(struct ieee80211_hw *hw, ...@@ -525,7 +525,7 @@ static void _rtl92ce_process_ui_link_quality(struct ieee80211_hw *hw,
u32 last_evm, n_spatialstream, tmpval; u32 last_evm, n_spatialstream, tmpval;
if (pstats->signalquality != 0) { if (pstats->signalquality != 0) {
if (pstats->b_packet_toself || pstats->b_packet_beacon) { if (pstats->packet_toself || pstats->packet_beacon) {
if (rtlpriv->stats.ui_link_quality.total_num++ >= if (rtlpriv->stats.ui_link_quality.total_num++ >=
PHY_LINKQUALITY_SLID_WIN_MAX) { PHY_LINKQUALITY_SLID_WIN_MAX) {
...@@ -595,8 +595,8 @@ static void _rtl92ce_process_phyinfo(struct ieee80211_hw *hw, ...@@ -595,8 +595,8 @@ static void _rtl92ce_process_phyinfo(struct ieee80211_hw *hw,
struct rtl_stats *pcurrent_stats) struct rtl_stats *pcurrent_stats)
{ {
if (!pcurrent_stats->b_packet_matchbssid && if (!pcurrent_stats->packet_matchbssid &&
!pcurrent_stats->b_packet_beacon) !pcurrent_stats->packet_beacon)
return; return;
_rtl92ce_process_ui_rssi(hw, pcurrent_stats); _rtl92ce_process_ui_rssi(hw, pcurrent_stats);
...@@ -618,7 +618,7 @@ static void _rtl92ce_translate_rx_signal_stuff(struct ieee80211_hw *hw, ...@@ -618,7 +618,7 @@ static void _rtl92ce_translate_rx_signal_stuff(struct ieee80211_hw *hw,
u8 *praddr; u8 *praddr;
u8 *psaddr; u8 *psaddr;
u16 fc, type; u16 fc, type;
bool b_packet_matchbssid, b_packet_toself, b_packet_beacon; bool packet_matchbssid, packet_toself, packet_beacon;
tmp_buf = skb->data + pstats->rx_drvinfo_size + pstats->rx_bufshift; tmp_buf = skb->data + pstats->rx_drvinfo_size + pstats->rx_bufshift;
...@@ -628,23 +628,23 @@ static void _rtl92ce_translate_rx_signal_stuff(struct ieee80211_hw *hw, ...@@ -628,23 +628,23 @@ static void _rtl92ce_translate_rx_signal_stuff(struct ieee80211_hw *hw,
praddr = hdr->addr1; praddr = hdr->addr1;
psaddr = hdr->addr2; psaddr = hdr->addr2;
b_packet_matchbssid = packet_matchbssid =
((IEEE80211_FTYPE_CTL != type) && ((IEEE80211_FTYPE_CTL != type) &&
(!compare_ether_addr(mac->bssid, (!compare_ether_addr(mac->bssid,
(fc & IEEE80211_FCTL_TODS) ? (fc & IEEE80211_FCTL_TODS) ?
hdr->addr1 : (fc & IEEE80211_FCTL_FROMDS) ? hdr->addr1 : (fc & IEEE80211_FCTL_FROMDS) ?
hdr->addr2 : hdr->addr3)) && hdr->addr2 : hdr->addr3)) &&
(!pstats->b_hwerror) && (!pstats->b_crc) && (!pstats->b_icv)); (!pstats->hwerror) && (!pstats->crc) && (!pstats->icv));
b_packet_toself = b_packet_matchbssid && packet_toself = packet_matchbssid &&
(!compare_ether_addr(praddr, rtlefuse->dev_addr)); (!compare_ether_addr(praddr, rtlefuse->dev_addr));
if (ieee80211_is_beacon(fc)) if (ieee80211_is_beacon(fc))
b_packet_beacon = true; packet_beacon = true;
_rtl92ce_query_rxphystatus(hw, pstats, pdesc, p_drvinfo, _rtl92ce_query_rxphystatus(hw, pstats, pdesc, p_drvinfo,
b_packet_matchbssid, b_packet_toself, packet_matchbssid, packet_toself,
b_packet_beacon); packet_beacon);
_rtl92ce_process_phyinfo(hw, tmp_buf, pstats); _rtl92ce_process_phyinfo(hw, tmp_buf, pstats);
} }
...@@ -662,14 +662,14 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw, ...@@ -662,14 +662,14 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw,
stats->rx_drvinfo_size = (u8) GET_RX_DESC_DRV_INFO_SIZE(pdesc) * stats->rx_drvinfo_size = (u8) GET_RX_DESC_DRV_INFO_SIZE(pdesc) *
RX_DRV_INFO_SIZE_UNIT; RX_DRV_INFO_SIZE_UNIT;
stats->rx_bufshift = (u8) (GET_RX_DESC_SHIFT(pdesc) & 0x03); stats->rx_bufshift = (u8) (GET_RX_DESC_SHIFT(pdesc) & 0x03);
stats->b_icv = (u16) GET_RX_DESC_ICV(pdesc); stats->icv = (u16) GET_RX_DESC_ICV(pdesc);
stats->b_crc = (u16) GET_RX_DESC_CRC32(pdesc); stats->crc = (u16) GET_RX_DESC_CRC32(pdesc);
stats->b_hwerror = (stats->b_crc | stats->b_icv); stats->hwerror = (stats->crc | stats->icv);
stats->decrypted = !GET_RX_DESC_SWDEC(pdesc); stats->decrypted = !GET_RX_DESC_SWDEC(pdesc);
stats->rate = (u8) GET_RX_DESC_RXMCS(pdesc); stats->rate = (u8) GET_RX_DESC_RXMCS(pdesc);
stats->b_shortpreamble = (u16) GET_RX_DESC_SPLCP(pdesc); stats->shortpreamble = (u16) GET_RX_DESC_SPLCP(pdesc);
stats->b_isampdu = (bool) (GET_RX_DESC_PAGGR(pdesc) == 1); stats->isampdu = (bool) (GET_RX_DESC_PAGGR(pdesc) == 1);
stats->b_isampdu = (bool) ((GET_RX_DESC_PAGGR(pdesc) == 1) stats->isampdu = (bool) ((GET_RX_DESC_PAGGR(pdesc) == 1)
&& (GET_RX_DESC_FAGGR(pdesc) == 1)); && (GET_RX_DESC_FAGGR(pdesc) == 1));
stats->timestamp_low = GET_RX_DESC_TSFL(pdesc); stats->timestamp_low = GET_RX_DESC_TSFL(pdesc);
stats->rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(pdesc); stats->rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(pdesc);
...@@ -727,7 +727,7 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw, ...@@ -727,7 +727,7 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
bool b_defaultadapter = true; bool defaultadapter = true;
struct ieee80211_sta *sta = ieee80211_find_sta(mac->vif, mac->bssid); struct ieee80211_sta *sta = ieee80211_find_sta(mac->vif, mac->bssid);
...@@ -743,11 +743,11 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw, ...@@ -743,11 +743,11 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
_rtl92ce_map_hwqueue_to_fwqueue(le16_to_cpu(hdr->frame_control), _rtl92ce_map_hwqueue_to_fwqueue(le16_to_cpu(hdr->frame_control),
queue_index); queue_index);
bool b_firstseg = ((hdr->seq_ctrl & bool firstseg = ((hdr->seq_ctrl &
cpu_to_le16(IEEE80211_SCTL_FRAG)) == 0); cpu_to_le16(IEEE80211_SCTL_FRAG)) == 0);
bool b_lastseg = ((hdr->frame_control & bool lastseg = ((hdr->frame_control &
cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)) == 0); cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)) == 0);
dma_addr_t mapping = pci_map_single(rtlpci->pdev, dma_addr_t mapping = pci_map_single(rtlpci->pdev,
skb->data, skb->len, skb->data, skb->len,
...@@ -759,7 +759,7 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw, ...@@ -759,7 +759,7 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
CLEAR_PCI_TX_DESC_CONTENT(pdesc, sizeof(struct tx_desc_92c)); CLEAR_PCI_TX_DESC_CONTENT(pdesc, sizeof(struct tx_desc_92c));
if (b_firstseg) { if (firstseg) {
SET_TX_DESC_OFFSET(pdesc, USB_HWDESC_HEADER_LEN); SET_TX_DESC_OFFSET(pdesc, USB_HWDESC_HEADER_LEN);
SET_TX_DESC_TX_RATE(pdesc, tcb_desc.hw_rate); SET_TX_DESC_TX_RATE(pdesc, tcb_desc.hw_rate);
...@@ -774,25 +774,25 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw, ...@@ -774,25 +774,25 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
} }
SET_TX_DESC_SEQ(pdesc, seq_number); SET_TX_DESC_SEQ(pdesc, seq_number);
SET_TX_DESC_RTS_ENABLE(pdesc, ((tcb_desc.b_rts_enable && SET_TX_DESC_RTS_ENABLE(pdesc, ((tcb_desc.rts_enable &&
!tcb_desc. !tcb_desc.
b_cts_enable) ? 1 : 0)); cts_enable) ? 1 : 0));
SET_TX_DESC_HW_RTS_ENABLE(pdesc, SET_TX_DESC_HW_RTS_ENABLE(pdesc,
((tcb_desc.b_rts_enable ((tcb_desc.rts_enable
|| tcb_desc.b_cts_enable) ? 1 : 0)); || tcb_desc.cts_enable) ? 1 : 0));
SET_TX_DESC_CTS2SELF(pdesc, ((tcb_desc.b_cts_enable) ? 1 : 0)); SET_TX_DESC_CTS2SELF(pdesc, ((tcb_desc.cts_enable) ? 1 : 0));
SET_TX_DESC_RTS_STBC(pdesc, ((tcb_desc.b_rts_stbc) ? 1 : 0)); SET_TX_DESC_RTS_STBC(pdesc, ((tcb_desc.rts_stbc) ? 1 : 0));
SET_TX_DESC_RTS_RATE(pdesc, tcb_desc.rts_rate); SET_TX_DESC_RTS_RATE(pdesc, tcb_desc.rts_rate);
SET_TX_DESC_RTS_BW(pdesc, 0); SET_TX_DESC_RTS_BW(pdesc, 0);
SET_TX_DESC_RTS_SC(pdesc, tcb_desc.rts_sc); SET_TX_DESC_RTS_SC(pdesc, tcb_desc.rts_sc);
SET_TX_DESC_RTS_SHORT(pdesc, SET_TX_DESC_RTS_SHORT(pdesc,
((tcb_desc.rts_rate <= DESC92C_RATE54M) ? ((tcb_desc.rts_rate <= DESC92C_RATE54M) ?
(tcb_desc.b_rts_use_shortpreamble ? 1 : 0) (tcb_desc.rts_use_shortpreamble ? 1 : 0)
: (tcb_desc.b_rts_use_shortgi ? 1 : 0))); : (tcb_desc.rts_use_shortgi ? 1 : 0)));
if (mac->bw_40) { if (mac->bw_40) {
if (tcb_desc.b_packet_bw) { if (tcb_desc.packet_bw) {
SET_TX_DESC_DATA_BW(pdesc, 1); SET_TX_DESC_DATA_BW(pdesc, 1);
SET_TX_DESC_TX_SUB_CARRIER(pdesc, 3); SET_TX_DESC_TX_SUB_CARRIER(pdesc, 3);
} else { } else {
...@@ -854,14 +854,14 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw, ...@@ -854,14 +854,14 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
} }
} }
SET_TX_DESC_FIRST_SEG(pdesc, (b_firstseg ? 1 : 0)); SET_TX_DESC_FIRST_SEG(pdesc, (firstseg ? 1 : 0));
SET_TX_DESC_LAST_SEG(pdesc, (b_lastseg ? 1 : 0)); SET_TX_DESC_LAST_SEG(pdesc, (lastseg ? 1 : 0));
SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16) skb->len); SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16) skb->len);
SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, cpu_to_le32(mapping)); SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, cpu_to_le32(mapping));
if (rtlpriv->dm.b_useramask) { if (rtlpriv->dm.useramask) {
SET_TX_DESC_RATE_ID(pdesc, tcb_desc.ratr_index); SET_TX_DESC_RATE_ID(pdesc, tcb_desc.ratr_index);
SET_TX_DESC_MACID(pdesc, tcb_desc.mac_id); SET_TX_DESC_MACID(pdesc, tcb_desc.mac_id);
} else { } else {
...@@ -869,16 +869,16 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw, ...@@ -869,16 +869,16 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
SET_TX_DESC_MACID(pdesc, tcb_desc.ratr_index); SET_TX_DESC_MACID(pdesc, tcb_desc.ratr_index);
} }
if ((!ieee80211_is_data_qos(fc)) && ppsc->b_leisure_ps && if ((!ieee80211_is_data_qos(fc)) && ppsc->leisure_ps &&
ppsc->b_fwctrl_lps) { ppsc->fwctrl_lps) {
SET_TX_DESC_HWSEQ_EN(pdesc, 1); SET_TX_DESC_HWSEQ_EN(pdesc, 1);
SET_TX_DESC_PKT_ID(pdesc, 8); SET_TX_DESC_PKT_ID(pdesc, 8);
if (!b_defaultadapter) if (!defaultadapter)
SET_TX_DESC_QOS(pdesc, 1); SET_TX_DESC_QOS(pdesc, 1);
} }
SET_TX_DESC_MORE_FRAG(pdesc, (b_lastseg ? 0 : 1)); SET_TX_DESC_MORE_FRAG(pdesc, (lastseg ? 0 : 1));
if (is_multicast_ether_addr(ieee80211_get_DA(hdr)) || if (is_multicast_ether_addr(ieee80211_get_DA(hdr)) ||
is_broadcast_ether_addr(ieee80211_get_DA(hdr))) { is_broadcast_ether_addr(ieee80211_get_DA(hdr))) {
...@@ -889,8 +889,8 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw, ...@@ -889,8 +889,8 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
} }
void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw, void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw,
u8 *pdesc, bool b_firstseg, u8 *pdesc, bool firstseg,
bool b_lastseg, struct sk_buff *skb) bool lastseg, struct sk_buff *skb)
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
...@@ -905,7 +905,7 @@ void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw, ...@@ -905,7 +905,7 @@ void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw,
CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE); CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
if (b_firstseg) if (firstseg)
SET_TX_DESC_OFFSET(pdesc, USB_HWDESC_HEADER_LEN); SET_TX_DESC_OFFSET(pdesc, USB_HWDESC_HEADER_LEN);
SET_TX_DESC_TX_RATE(pdesc, DESC92C_RATE1M); SET_TX_DESC_TX_RATE(pdesc, DESC92C_RATE1M);
......
...@@ -366,10 +366,10 @@ static int _rtl_usb_init_sw(struct ieee80211_hw *hw) ...@@ -366,10 +366,10 @@ static int _rtl_usb_init_sw(struct ieee80211_hw *hw)
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw)); struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
rtlhal->hw = hw; rtlhal->hw = hw;
ppsc->b_inactiveps = false; ppsc->inactiveps = false;
ppsc->b_leisure_ps = false; ppsc->leisure_ps = false;
ppsc->b_fwctrl_lps = false; ppsc->fwctrl_lps = false;
ppsc->b_reg_fwctrl_lps = 3; ppsc->reg_fwctrl_lps = 3;
ppsc->reg_max_lps_awakeintvl = 5; ppsc->reg_max_lps_awakeintvl = 5;
ppsc->fwctrl_psmode = FW_PS_DTIM_MODE; ppsc->fwctrl_psmode = FW_PS_DTIM_MODE;
...@@ -450,7 +450,7 @@ static void _rtl_usb_rx_process_agg(struct ieee80211_hw *hw, ...@@ -450,7 +450,7 @@ static void _rtl_usb_rx_process_agg(struct ieee80211_hw *hw,
skb_pull(skb, (stats.rx_drvinfo_size + stats.rx_bufshift)); skb_pull(skb, (stats.rx_drvinfo_size + stats.rx_bufshift));
hdr = (struct ieee80211_hdr *)(skb->data); hdr = (struct ieee80211_hdr *)(skb->data);
fc = le16_to_cpu(hdr->frame_control); fc = le16_to_cpu(hdr->frame_control);
if (!stats.b_crc) { if (!stats.crc) {
memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status)); memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status));
if (is_broadcast_ether_addr(hdr->addr1)) { if (is_broadcast_ether_addr(hdr->addr1)) {
...@@ -493,7 +493,7 @@ static void _rtl_usb_rx_process_noagg(struct ieee80211_hw *hw, ...@@ -493,7 +493,7 @@ static void _rtl_usb_rx_process_noagg(struct ieee80211_hw *hw,
skb_pull(skb, (stats.rx_drvinfo_size + stats.rx_bufshift)); skb_pull(skb, (stats.rx_drvinfo_size + stats.rx_bufshift));
hdr = (struct ieee80211_hdr *)(skb->data); hdr = (struct ieee80211_hdr *)(skb->data);
fc = le16_to_cpu(hdr->frame_control); fc = le16_to_cpu(hdr->frame_control);
if (!stats.b_crc) { if (!stats.crc) {
memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status)); memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status));
if (is_broadcast_ether_addr(hdr->addr1)) { if (is_broadcast_ether_addr(hdr->addr1)) {
......
...@@ -578,11 +578,11 @@ struct rtl_probe_rsp { ...@@ -578,11 +578,11 @@ struct rtl_probe_rsp {
struct rtl_led { struct rtl_led {
void *hw; void *hw;
enum rtl_led_pin ledpin; enum rtl_led_pin ledpin;
bool b_ledon; bool ledon;
}; };
struct rtl_led_ctl { struct rtl_led_ctl {
bool bled_opendrain; bool led_opendrain;
struct rtl_led sw_led0; struct rtl_led sw_led0;
struct rtl_led sw_led1; struct rtl_led sw_led1;
}; };
...@@ -727,10 +727,10 @@ struct rtl_phy { ...@@ -727,10 +727,10 @@ struct rtl_phy {
u32 iqk_mac_backup[IQK_MAC_REG_NUM]; u32 iqk_mac_backup[IQK_MAC_REG_NUM];
u32 iqk_bb_backup[10]; u32 iqk_bb_backup[10];
bool b_rfpi_enable; bool rfpi_enable;
u8 pwrgroup_cnt; u8 pwrgroup_cnt;
u8 bcck_high_power; u8 cck_high_power;
/* 3 groups of pwr diff by rates*/ /* 3 groups of pwr diff by rates*/
u32 mcs_txpwrlevel_origoffset[4][16]; u32 mcs_txpwrlevel_origoffset[4][16];
u8 default_initialgain[4]; u8 default_initialgain[4];
...@@ -740,7 +740,7 @@ struct rtl_phy { ...@@ -740,7 +740,7 @@ struct rtl_phy {
u8 cur_ofdm24g_txpwridx; u8 cur_ofdm24g_txpwridx;
u32 rfreg_chnlval[2]; u32 rfreg_chnlval[2];
bool b_apk_done; bool apk_done;
/*fsync*/ /*fsync*/
u8 framesync; u8 framesync;
...@@ -867,9 +867,9 @@ struct rtl_hal { ...@@ -867,9 +867,9 @@ struct rtl_hal {
/*firmware */ /*firmware */
u8 *pfirmware; u8 *pfirmware;
bool b_h2c_setinprogress; bool h2c_setinprogress;
u8 last_hmeboxnum; u8 last_hmeboxnum;
bool bfw_ready; bool fw_ready;
/*Reserve page start offset except beacon in TxQ. */ /*Reserve page start offset except beacon in TxQ. */
u8 fw_rsvdpage_startoffset; u8 fw_rsvdpage_startoffset;
}; };
...@@ -900,17 +900,17 @@ struct rtl_dm { ...@@ -900,17 +900,17 @@ struct rtl_dm {
long entry_min_undecoratedsmoothed_pwdb; long entry_min_undecoratedsmoothed_pwdb;
long undecorated_smoothed_pwdb; /*out dm */ long undecorated_smoothed_pwdb; /*out dm */
long entry_max_undecoratedsmoothed_pwdb; long entry_max_undecoratedsmoothed_pwdb;
bool b_dm_initialgain_enable; bool dm_initialgain_enable;
bool bdynamic_txpower_enable; bool dynamic_txpower_enable;
bool bcurrent_turbo_edca; bool current_turbo_edca;
bool bis_any_nonbepkts; /*out dm */ bool is_any_nonbepkts; /*out dm */
bool bis_cur_rdlstate; bool is_cur_rdlstate;
bool btxpower_trackingInit; bool txpower_trackingInit;
bool b_disable_framebursting; bool disable_framebursting;
bool b_cck_inch14; bool cck_inch14;
bool btxpower_tracking; bool txpower_tracking;
bool b_useramask; bool useramask;
bool brfpath_rxenable[4]; bool rfpath_rxenable[4];
u8 thermalvalue_iqk; u8 thermalvalue_iqk;
u8 thermalvalue_lck; u8 thermalvalue_lck;
...@@ -928,7 +928,7 @@ struct rtl_dm { ...@@ -928,7 +928,7 @@ struct rtl_dm {
#define EFUSE_MAX_LOGICAL_SIZE 128 #define EFUSE_MAX_LOGICAL_SIZE 128
struct rtl_efuse { struct rtl_efuse {
bool bautoLoad_ok; bool autoLoad_ok;
bool bootfromefuse; bool bootfromefuse;
u16 max_physical_size; u16 max_physical_size;
u8 contents[EFUSE_MAX_LOGICAL_SIZE]; u8 contents[EFUSE_MAX_LOGICAL_SIZE];
...@@ -950,7 +950,7 @@ struct rtl_efuse { ...@@ -950,7 +950,7 @@ struct rtl_efuse {
u8 dev_addr[6]; u8 dev_addr[6];
bool b_txpwr_fromeprom; bool txpwr_fromeprom;
u8 eeprom_tssi[2]; u8 eeprom_tssi[2];
u8 eeprom_pwrlimit_ht20[3]; u8 eeprom_pwrlimit_ht20[3];
u8 eeprom_pwrlimit_ht40[3]; u8 eeprom_pwrlimit_ht40[3];
...@@ -974,15 +974,15 @@ struct rtl_efuse { ...@@ -974,15 +974,15 @@ struct rtl_efuse {
u8 thermalmeter[2]; u8 thermalmeter[2];
u8 legacy_ht_txpowerdiff; /*Legacy to HT rate power diff */ u8 legacy_ht_txpowerdiff; /*Legacy to HT rate power diff */
bool b_apk_thermalmeterignore; bool apk_thermalmeterignore;
}; };
struct rtl_ps_ctl { struct rtl_ps_ctl {
bool set_rfpowerstate_inprogress; bool set_rfpowerstate_inprogress;
bool b_in_powersavemode; bool in_powersavemode;
bool rfchange_inprogress; bool rfchange_inprogress;
bool b_swrf_processing; bool swrf_processing;
bool b_hwradiooff; bool hwradiooff;
u32 last_sleep_jiffies; u32 last_sleep_jiffies;
u32 last_awake_jiffies; u32 last_awake_jiffies;
...@@ -993,23 +993,23 @@ struct rtl_ps_ctl { ...@@ -993,23 +993,23 @@ struct rtl_ps_ctl {
* If it supports ASPM, Offset[560h] = 0x40, * If it supports ASPM, Offset[560h] = 0x40,
* otherwise Offset[560h] = 0x00. * otherwise Offset[560h] = 0x00.
* */ * */
bool b_support_aspm; bool support_aspm;
bool b_support_backdoor; bool support_backdoor;
/*for LPS */ /*for LPS */
enum rt_psmode dot11_psmode; /*Power save mode configured. */ enum rt_psmode dot11_psmode; /*Power save mode configured. */
bool b_leisure_ps; bool leisure_ps;
bool b_fwctrl_lps; bool fwctrl_lps;
u8 fwctrl_psmode; u8 fwctrl_psmode;
/*For Fw control LPS mode */ /*For Fw control LPS mode */
u8 b_reg_fwctrl_lps; u8 reg_fwctrl_lps;
/*Record Fw PS mode status. */ /*Record Fw PS mode status. */
bool b_fw_current_inpsmode; bool fw_current_inpsmode;
u8 reg_max_lps_awakeintvl; u8 reg_max_lps_awakeintvl;
bool report_linked; bool report_linked;
/*for IPS */ /*for IPS */
bool b_inactiveps; bool inactiveps;
u32 rfoff_reason; u32 rfoff_reason;
...@@ -1047,10 +1047,10 @@ struct rtl_stats { ...@@ -1047,10 +1047,10 @@ struct rtl_stats {
s32 recvsignalpower; s32 recvsignalpower;
s8 rxpower; /*in dBm Translate from PWdB */ s8 rxpower; /*in dBm Translate from PWdB */
u8 signalstrength; /*in 0-100 index. */ u8 signalstrength; /*in 0-100 index. */
u16 b_hwerror:1; u16 hwerror:1;
u16 b_crc:1; u16 crc:1;
u16 b_icv:1; u16 icv:1;
u16 b_shortpreamble:1; u16 shortpreamble:1;
u16 antenna:1; u16 antenna:1;
u16 decrypted:1; u16 decrypted:1;
u16 wakeup:1; u16 wakeup:1;
...@@ -1059,15 +1059,15 @@ struct rtl_stats { ...@@ -1059,15 +1059,15 @@ struct rtl_stats {
u8 rx_drvinfo_size; u8 rx_drvinfo_size;
u8 rx_bufshift; u8 rx_bufshift;
bool b_isampdu; bool isampdu;
bool rx_is40Mhzpacket; bool rx_is40Mhzpacket;
u32 rx_pwdb_all; u32 rx_pwdb_all;
u8 rx_mimo_signalstrength[4]; /*in 0~100 index */ u8 rx_mimo_signalstrength[4]; /*in 0~100 index */
s8 rx_mimo_signalquality[2]; s8 rx_mimo_signalquality[2];
bool b_packet_matchbssid; bool packet_matchbssid;
bool b_is_cck; bool is_cck;
bool b_packet_toself; bool packet_toself;
bool b_packet_beacon; /*for rssi */ bool packet_beacon; /*for rssi */
char cck_adc_pwdb[4]; /*for rx path selection */ char cck_adc_pwdb[4]; /*for rx path selection */
}; };
...@@ -1078,23 +1078,23 @@ struct rt_link_detect { ...@@ -1078,23 +1078,23 @@ struct rt_link_detect {
u32 num_tx_inperiod; u32 num_tx_inperiod;
u32 num_rx_inperiod; u32 num_rx_inperiod;
bool b_busytraffic; bool busytraffic;
bool b_higher_busytraffic; bool higher_busytraffic;
bool b_higher_busyrxtraffic; bool higher_busyrxtraffic;
}; };
struct rtl_tcb_desc { struct rtl_tcb_desc {
u8 b_packet_bw:1; u8 packet_bw:1;
u8 b_multicast:1; u8 multicast:1;
u8 b_broadcast:1; u8 broadcast:1;
u8 b_rts_stbc:1; u8 rts_stbc:1;
u8 b_rts_enable:1; u8 rts_enable:1;
u8 b_cts_enable:1; u8 cts_enable:1;
u8 b_rts_use_shortpreamble:1; u8 rts_use_shortpreamble:1;
u8 b_rts_use_shortgi:1; u8 rts_use_shortgi:1;
u8 rts_sc:1; u8 rts_sc:1;
u8 b_rts_bw:1; u8 rts_bw:1;
u8 rts_rate; u8 rts_rate;
u8 use_shortgi:1; u8 use_shortgi:1;
...@@ -1137,23 +1137,23 @@ struct rtl_hal_ops { ...@@ -1137,23 +1137,23 @@ struct rtl_hal_ops {
struct ieee80211_tx_info *info, struct ieee80211_tx_info *info,
struct sk_buff *skb, unsigned int queue_index); struct sk_buff *skb, unsigned int queue_index);
void (*fill_tx_cmddesc) (struct ieee80211_hw *hw, u8 *pdesc, void (*fill_tx_cmddesc) (struct ieee80211_hw *hw, u8 *pdesc,
bool b_firstseg, bool b_lastseg, bool firstseg, bool lastseg,
struct sk_buff *skb); struct sk_buff *skb);
bool (*cmd_send_packet)(struct ieee80211_hw *hw, struct sk_buff *skb); bool (*cmd_send_packet)(struct ieee80211_hw *hw, struct sk_buff *skb);
bool(*query_rx_desc) (struct ieee80211_hw *hw, bool (*query_rx_desc) (struct ieee80211_hw *hw,
struct rtl_stats *stats, struct rtl_stats *stats,
struct ieee80211_rx_status *rx_status, struct ieee80211_rx_status *rx_status,
u8 *pdesc, struct sk_buff *skb); u8 *pdesc, struct sk_buff *skb);
void (*set_channel_access) (struct ieee80211_hw *hw); void (*set_channel_access) (struct ieee80211_hw *hw);
bool(*radio_onoff_checking) (struct ieee80211_hw *hw, u8 *valid); bool (*radio_onoff_checking) (struct ieee80211_hw *hw, u8 *valid);
void (*dm_watchdog) (struct ieee80211_hw *hw); void (*dm_watchdog) (struct ieee80211_hw *hw);
void (*scan_operation_backup) (struct ieee80211_hw *hw, u8 operation); void (*scan_operation_backup) (struct ieee80211_hw *hw, u8 operation);
bool(*set_rf_power_state) (struct ieee80211_hw *hw, bool (*set_rf_power_state) (struct ieee80211_hw *hw,
enum rf_pwrstate rfpwr_state); enum rf_pwrstate rfpwr_state);
void (*led_control) (struct ieee80211_hw *hw, void (*led_control) (struct ieee80211_hw *hw,
enum led_ctl_mode ledaction); enum led_ctl_mode ledaction);
void (*set_desc) (u8 *pdesc, bool istx, u8 desc_name, u8 *val); void (*set_desc) (u8 *pdesc, bool istx, u8 desc_name, u8 *val);
u32(*get_desc) (u8 *pdesc, bool istx, u8 desc_name); u32 (*get_desc) (u8 *pdesc, bool istx, u8 desc_name);
void (*tx_polling) (struct ieee80211_hw *hw, unsigned int hw_queue); void (*tx_polling) (struct ieee80211_hw *hw, unsigned int hw_queue);
void (*enable_hw_sec) (struct ieee80211_hw *hw); void (*enable_hw_sec) (struct ieee80211_hw *hw);
void (*set_key) (struct ieee80211_hw *hw, u32 key_index, void (*set_key) (struct ieee80211_hw *hw, u32 key_index,
...@@ -1161,10 +1161,10 @@ struct rtl_hal_ops { ...@@ -1161,10 +1161,10 @@ struct rtl_hal_ops {
bool is_wepkey, bool clear_all); bool is_wepkey, bool clear_all);
void (*init_sw_leds) (struct ieee80211_hw *hw); void (*init_sw_leds) (struct ieee80211_hw *hw);
void (*deinit_sw_leds) (struct ieee80211_hw *hw); void (*deinit_sw_leds) (struct ieee80211_hw *hw);
u32(*get_bbreg) (struct ieee80211_hw *hw, u32 regaddr, u32 bitmask); u32 (*get_bbreg) (struct ieee80211_hw *hw, u32 regaddr, u32 bitmask);
void (*set_bbreg) (struct ieee80211_hw *hw, u32 regaddr, u32 bitmask, void (*set_bbreg) (struct ieee80211_hw *hw, u32 regaddr, u32 bitmask,
u32 data); u32 data);
u32(*get_rfreg) (struct ieee80211_hw *hw, enum radio_path rfpath, u32 (*get_rfreg) (struct ieee80211_hw *hw, enum radio_path rfpath,
u32 regaddr, u32 bitmask); u32 regaddr, u32 bitmask);
void (*set_rfreg) (struct ieee80211_hw *hw, enum radio_path rfpath, void (*set_rfreg) (struct ieee80211_hw *hw, enum radio_path rfpath,
u32 regaddr, u32 bitmask, u32 data); u32 regaddr, u32 bitmask, u32 data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册