Skip to content

Commit

Permalink
rtlwifi_new: Update rtl8192ee to V062814
Browse files Browse the repository at this point in the history
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
  • Loading branch information
lwfinger committed Aug 15, 2014
1 parent aa06943 commit b67eb97
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 69 deletions.
14 changes: 6 additions & 8 deletions rtl8192ee/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,7 @@ static void rtl92ee_dm_false_alarm_counter_statistics(struct ieee80211_hw *hw)


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);
Expand Down Expand Up @@ -644,7 +643,7 @@ static void rtl92ee_dm_check_edca_turbo(struct ieee80211_hw *hw)
u32 edca_be_ul = 0x5ea42b;
u32 edca_be_dl = 0x5ea42b; /*not sure*/
u32 edca_be = 0x5ea42b;
bool b_is_cur_rdlstate;
bool is_cur_rdlstate;
bool b_edca_turbo_on = false;

if (rtlpriv->dm.dbginfo.num_non_be_pkt > 0x100)
Expand All @@ -663,12 +662,12 @@ static void rtl92ee_dm_check_edca_turbo(struct ieee80211_hw *hw)
goto dm_CheckEdcaTurbo_EXIT;

if (b_edca_turbo_on) {
b_is_cur_rdlstate = (cur_rxok_cnt > cur_txok_cnt * 4) ?
is_cur_rdlstate = (cur_rxok_cnt > cur_txok_cnt * 4) ?
true : false;

edca_be = b_is_cur_rdlstate ? edca_be_dl : edca_be_ul;
edca_be = is_cur_rdlstate ? edca_be_dl : edca_be_ul;
rtl_write_dword(rtlpriv , REG_EDCA_BE_PARAM , edca_be);
rtlpriv->dm.is_cur_rdlstate = b_is_cur_rdlstate;
rtlpriv->dm.is_cur_rdlstate = is_cur_rdlstate;
rtlpriv->dm.bcurrent_turbo_edca = true;
} else {
if (rtlpriv->dm.bcurrent_turbo_edca) {
Expand Down Expand Up @@ -854,8 +853,7 @@ static void rtl92ee_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;
}
}
Expand Down
34 changes: 14 additions & 20 deletions rtl8192ee/fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ static int _rtl92ee_fw_free_to_go(struct ieee80211_hw *hw)
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
if (value32 & WINTINI_RDY) {
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD ,
"Polling FW ready success!! REG_MCUFWDL:"
"0x%08x. count = %d\n", value32, counter);
"Polling FW ready success!! REG_MCUFWDL:0x%08x. count = %d\n",
value32, counter);
err = 0;
goto exit;
}
Expand Down Expand Up @@ -269,7 +269,7 @@ static bool _rtl92ee_check_fw_read_last_h2c(struct ieee80211_hw *hw, u8 boxnum)
}

static void _rtl92ee_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
u32 cmd_len, u8 *p_cmdbuffer)
u32 cmd_len, u8 *cmdbuffer)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
Expand All @@ -289,8 +289,7 @@ static void _rtl92ee_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
if (ppsc->dot11_psmode != EACTIVE ||
ppsc->inactive_pwrstate == ERFOFF) {
RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD ,
"FillH2CCommand8192E(): "
"Return because RF is off!!!\n");
"FillH2CCommand8192E(): Return because RF is off!!!\n");
return;
}

Expand All @@ -303,8 +302,7 @@ static void _rtl92ee_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,
Expand Down Expand Up @@ -333,8 +331,7 @@ static void _rtl92ee_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
/*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;
}
*/
Expand Down Expand Up @@ -382,8 +379,7 @@ static void _rtl92ee_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
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",
"Waiting too long for FW read clear HMEBox(%d)!!!\n",
boxnum);
break;
}
Expand All @@ -392,8 +388,7 @@ static void _rtl92ee_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
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);
}
}
Expand All @@ -420,7 +415,7 @@ static void _rtl92ee_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
case 3:
/*boxcontent[0] &= ~(BIT(7));*/
memcpy((u8 *) (boxcontent) + 1,
p_cmdbuffer + buf_index, cmd_len);
cmdbuffer + buf_index, cmd_len);

for (idx = 0; idx < 4; idx++) {
rtl_write_byte(rtlpriv, box_reg + idx,
Expand All @@ -433,9 +428,9 @@ static void _rtl92ee_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
case 7:
/*boxcontent[0] |= (BIT(7));*/
memcpy((u8 *) (boxextcontent),
p_cmdbuffer + buf_index+3, cmd_len-3);
cmdbuffer + buf_index+3, cmd_len-3);
memcpy((u8 *) (boxcontent) + 1,
p_cmdbuffer + buf_index, 3);
cmdbuffer + buf_index, 3);

for (idx = 0; idx < 4; idx++) {
rtl_write_byte(rtlpriv, box_extreg + idx,
Expand Down Expand Up @@ -472,19 +467,18 @@ static void _rtl92ee_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
}

void rtl92ee_fill_h2c_cmd(struct ieee80211_hw *hw,
u8 element_id, u32 cmd_len, u8 *p_cmdbuffer)
u8 element_id, u32 cmd_len, u8 *cmdbuffer)
{
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
u32 tmp_cmdbuf[2];

if (rtlhal->fw_ready == false) {
RT_ASSERT(false, "return H2C cmd because of Fw "
"download fail!!!\n");
RT_ASSERT(false, "return H2C cmd because of Fw download fail!!!\n");
return;
}

memset(tmp_cmdbuf, 0, 8);
memcpy(tmp_cmdbuf, p_cmdbuffer, cmd_len);
memcpy(tmp_cmdbuf, cmdbuffer, cmd_len);
_rtl92ee_fill_h2c_command(hw, element_id, cmd_len, (u8 *)&tmp_cmdbuf);

return;
Expand Down
2 changes: 1 addition & 1 deletion rtl8192ee/fw.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ enum rtl8192e_c2h_evt {

int rtl92ee_download_fw(struct ieee80211_hw *hw, bool buse_wake_on_wlan_fw);
void rtl92ee_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id,
u32 cmd_len, u8 *p_cmdbuffer);
u32 cmd_len, u8 *cmdbuffer);
void rtl92ee_firmware_selfreset(struct ieee80211_hw *hw);
void rtl92ee_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode);
void rtl92ee_set_fw_media_status_rpt_cmd(struct ieee80211_hw *hw, u8 mstatus);
Expand Down
28 changes: 13 additions & 15 deletions rtl8192ee/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,8 @@ void rtl92ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
break;
default:
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
"HW_VAR_ACM_CTRL acm set "
"failed: eACI is %d\n", acm);
"HW_VAR_ACM_CTRL acm set failed: eACI is %d\n",
acm);
break;
}
} else {
Expand Down Expand Up @@ -1392,8 +1392,8 @@ static int _rtl92ee_set_media_status(struct ieee80211_hw *hw,
_rtl92ee_disable_bcn_sub_func(hw);
} else {
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
"Set HW_VAR_MEDIA_STATUS: "
"No such media status(%x).\n", mode);
"Set HW_VAR_MEDIA_STATUS: No such media status(%x).\n",
mode);
}

rtl_write_byte(rtlpriv, (MSR), bt_msr | mode);
Expand Down Expand Up @@ -2215,7 +2215,7 @@ static void rtl92ee_update_hal_rate_mask(struct ieee80211_hw *hw,
struct rtl_sta_info *sta_entry = NULL;
u32 ratr_bitmap;
u8 ratr_index;
u8 b_curtxbw_40mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)
u8 curtxbw_40mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)
? 1 : 0;
u8 b_curshortgi_40mhz = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ?
1 : 0;
Expand All @@ -2230,7 +2230,7 @@ static void rtl92ee_update_hal_rate_mask(struct ieee80211_hw *hw,
wirelessmode = sta_entry->wireless_mode;
if (mac->opmode == NL80211_IFTYPE_STATION ||
mac->opmode == NL80211_IFTYPE_MESH_POINT)
b_curtxbw_40mhz = mac->bw_40;
curtxbw_40mhz = mac->bw_40;
else if (mac->opmode == NL80211_IFTYPE_AP ||
mac->opmode == NL80211_IFTYPE_ADHOC)
macid = sta->aid + 1;
Expand Down Expand Up @@ -2261,13 +2261,13 @@ static void rtl92ee_update_hal_rate_mask(struct ieee80211_hw *hw,
ratr_bitmap &= 0x00000ff5;
break;
case WIRELESS_MODE_N_24G:
if (b_curtxbw_40mhz)
if (curtxbw_40mhz)
ratr_index = RATR_INX_WIRELESS_NGB;
else
ratr_index = RATR_INX_WIRELESS_NB;

if (rtlphy->rf_type == RF_1T1R) {
if (b_curtxbw_40mhz) {
if (curtxbw_40mhz) {
if (rssi_level == 1)
ratr_bitmap &= 0x000f0000;
else if (rssi_level == 2)
Expand All @@ -2283,7 +2283,7 @@ static void rtl92ee_update_hal_rate_mask(struct ieee80211_hw *hw,
ratr_bitmap &= 0x000ff005;
}
} else {
if (b_curtxbw_40mhz) {
if (curtxbw_40mhz) {
if (rssi_level == 1)
ratr_bitmap &= 0x0f8f0000;
else if (rssi_level == 2)
Expand All @@ -2300,8 +2300,8 @@ static void rtl92ee_update_hal_rate_mask(struct ieee80211_hw *hw,
}
}

if ((b_curtxbw_40mhz && b_curshortgi_40mhz) ||
(!b_curtxbw_40mhz && b_curshortgi_20mhz)) {
if ((curtxbw_40mhz && b_curshortgi_40mhz) ||
(!curtxbw_40mhz && b_curshortgi_20mhz)) {

if (macid == 0)
b_shortgi = true;
Expand All @@ -2327,7 +2327,7 @@ static void rtl92ee_update_hal_rate_mask(struct ieee80211_hw *hw,
(ratr_index << 28);
rate_mask[0] = macid;
rate_mask[1] = ratr_index | (b_shortgi ? 0x80 : 0x00);
rate_mask[2] = b_curtxbw_40mhz;
rate_mask[2] = curtxbw_40mhz;
rate_mask[3] = (u8)(ratr_bitmap & 0x000000ff);
rate_mask[4] = (u8)((ratr_bitmap & 0x0000ff00) >> 8);
rate_mask[5] = (u8)((ratr_bitmap & 0x00ff0000) >> 16);
Expand Down Expand Up @@ -2446,9 +2446,7 @@ void rtl92ee_set_key(struct ieee80211_hw *hw, u32 key_index,
p_macaddr);
if (entry_id >= TOTAL_CAM_ENTRY) {
RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
"Can not find free "
"hw security cam "
"entry\n");
"Can not find free hw security cam entry\n");
return;
}
} else {
Expand Down
37 changes: 15 additions & 22 deletions rtl8192ee/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,8 +791,7 @@ static bool _rtl92ee_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
}
}
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
"The agctab_array_table[0] is "
"%x Rtl818EEPHY_REGArray[1] is %x\n",
"The agctab_array_table[0] is %x Rtl818EEPHY_REGArray[1] is %x\n",
array[i],
array[i + 1]);
}
Expand Down Expand Up @@ -1051,8 +1050,7 @@ void rtl92ee_phy_get_hw_reg_originalvalue(struct ieee80211_hw *hw)
(u8) rtl_get_bbreg(hw, ROFDM0_XDAGCCORE1, MASKBYTE0);

RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
"Default initial gain (c50=0x%x, "
"c58=0x%x, c60=0x%x, c68=0x%x\n",
"Default initial gain (c50=0x%x, c58=0x%x, c60=0x%x, c68=0x%x\n",
rtlphy->default_initialgain[0],
rtlphy->default_initialgain[1],
rtlphy->default_initialgain[2],
Expand Down Expand Up @@ -1899,8 +1897,7 @@ u8 rtl92ee_phy_sw_chnl(struct ieee80211_hw *hw)
if (!(is_hal_stop(rtlhal)) && !(RT_CANNOT_IO(hw))) {
rtl92ee_phy_sw_chnl_callback(hw);
RT_TRACE(rtlpriv, COMP_CHAN, DBG_LOUD,
"sw_chnl_inprogress false schdule "
"workitem current channel %d\n",
"sw_chnl_inprogress false schdule workitem current channel %d\n",
rtlphy->current_channel);
rtlphy->sw_chnl_inprogress = false;
} else {
Expand Down Expand Up @@ -3085,7 +3082,7 @@ bool rtl92ee_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_phy *rtlphy = &(rtlpriv->phy);
bool b_postprocessing = false;
bool postprocessing = false;

RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE,
"-->IO Cmd(%#x), set_io_inprogress(%d)\n",
Expand All @@ -3095,20 +3092,20 @@ bool rtl92ee_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
case IO_CMD_RESUME_DM_BY_SCAN:
RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE,
"[IO CMD] Resume DM after scan.\n");
b_postprocessing = true;
postprocessing = true;
break;
case IO_CMD_PAUSE_BAND0_DM_BY_SCAN:
RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE,
"[IO CMD] Pause DM before scan.\n");
b_postprocessing = true;
postprocessing = true;
break;
default:
RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
"switch case not process\n");
break;
}
} while (false);
if (b_postprocessing && !rtlphy->set_io_inprogress) {
if (postprocessing && !rtlphy->set_io_inprogress) {
rtlphy->set_io_inprogress = true;
rtlphy->current_io_type = iotype;
} else {
Expand Down Expand Up @@ -3223,18 +3220,16 @@ static bool _rtl92ee_phy_set_rf_power_state(struct ieee80211_hw *hw,
continue;
} else {
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
"eRf Off/Sleep: %d times "
"TcbBusyQueue[%d] =%d before "
"doze!\n", (i + 1), queue_id,
skb_queue_len(&ring->queue));
"eRf Off/Sleep: %d times TcbBusyQueue[%d] =%d before doze!\n",
(i + 1), queue_id,
skb_queue_len(&ring->queue));

udelay(10);
i++;
}
if (i >= MAX_DOZE_WAITING_TIMES_9x) {
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
"\n ERFSLEEP: %d times "
"TcbBusyQueue[%d] = %d !\n",
"\n ERFSLEEP: %d times TcbBusyQueue[%d] = %d !\n",
MAX_DOZE_WAITING_TIMES_9x,
queue_id,
skb_queue_len(&ring->queue));
Expand Down Expand Up @@ -3268,17 +3263,15 @@ static bool _rtl92ee_phy_set_rf_power_state(struct ieee80211_hw *hw,
continue;
} else {
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
"eRf Off/Sleep: %d times "
"TcbBusyQueue[%d] =%d before "
"doze!\n", (i + 1), queue_id,
skb_queue_len(&ring->queue));
"eRf Off/Sleep: %d times TcbBusyQueue[%d] =%d before doze!\n",
(i + 1), queue_id,
skb_queue_len(&ring->queue));
udelay(10);
i++;
}
if (i >= MAX_DOZE_WAITING_TIMES_9x) {
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
"\n ERFSLEEP: %d times "
"TcbBusyQueue[%d] = %d !\n",
"\n ERFSLEEP: %d times TcbBusyQueue[%d] = %d !\n",
MAX_DOZE_WAITING_TIMES_9x,
queue_id,
skb_queue_len(&ring->queue));
Expand Down
4 changes: 1 addition & 3 deletions rtl8192ee/pwrseqcmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ bool rtl_hal_pwrseqcmdparsing(struct rtl_priv *rtlpriv, u8 cut_version,
do {
pwr_cfg_cmd = pwrcfgcmd[ary_idx];
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
"offset(%#x),cut_msk(%#x), fab_msk(%#x),"
"interface_msk(%#x), base(%#x), cmd(%#x), "
"msk(%#x), value(%#x)\n",
"offset(%#x),cut_msk(%#x), fab_msk(%#x),interface_msk(%#x), base(%#x), cmd(%#x), msk(%#x), value(%#x)\n",
GET_PWR_CFG_OFFSET(pwr_cfg_cmd),
GET_PWR_CFG_CUT_MASK(pwr_cfg_cmd),
GET_PWR_CFG_FAB_MASK(pwr_cfg_cmd),
Expand Down

0 comments on commit b67eb97

Please sign in to comment.