mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
rtlwifi: rtl8192cu: Remove and replace routine in hw.c and mac.c
I remove duplicated routines which related rtl92cu_set_hw_reg(). 1. rtl92c_set_qos() and HW_VAR_AC_PARAM routine are similar code. so i replace code with rtlpriv->cfg->ops->set_hw_reg(). 2. rtl92c_set_mac_addr() and 'HW_VAR_ETHER_ADDR' case at rtl92cu_set_hw_reg() routine are similar code. so i removed rtl92c_set_mac_addr() function. also it was not used anywhere. 3. remove HW_VAR_ACM_CTRL routine in rtl92cu_set_hw_reg(). if rtl_usb->acm_method is not EACMWAY2_SW, HW_VAR_ACM_CTRL is called from HW_VAR_AC_PARAM. but it never called. because acm_method is always EACMWAY2_SW. so i remove acm_method check routine and HW_VAR_ACM_CTRL routine. both usb and pci interface is not used HW_VAR_ACM_CTRL. but i can't test pci interface module, so i didn't modify pci code. Signed-off-by: Taehee Yoo <ap420073@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
bf27cea495
commit
9ff4b6de26
3 changed files with 2 additions and 107 deletions
|
@ -1611,7 +1611,6 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
|
|||
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
|
||||
struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
|
||||
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
|
||||
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
|
||||
enum wireless_mode wirelessmode = mac->mode;
|
||||
u8 idx = 0;
|
||||
|
||||
|
@ -1820,63 +1819,10 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
|
|||
u4b_ac_param);
|
||||
break;
|
||||
default:
|
||||
RT_ASSERT(false,
|
||||
"SetHwReg8185(): invalid aci: %d !\n",
|
||||
RT_ASSERT(false, "invalid aci: %d !\n",
|
||||
e_aci);
|
||||
break;
|
||||
}
|
||||
if (rtlusb->acm_method != EACMWAY2_SW)
|
||||
rtlpriv->cfg->ops->set_hw_reg(hw,
|
||||
HW_VAR_ACM_CTRL, &e_aci);
|
||||
break;
|
||||
}
|
||||
case HW_VAR_ACM_CTRL:{
|
||||
u8 e_aci = *val;
|
||||
union aci_aifsn *p_aci_aifsn = (union aci_aifsn *)
|
||||
(&(mac->ac[0].aifs));
|
||||
u8 acm = p_aci_aifsn->f.acm;
|
||||
u8 acm_ctrl = rtl_read_byte(rtlpriv, REG_ACMHWCTRL);
|
||||
|
||||
acm_ctrl =
|
||||
acm_ctrl | ((rtlusb->acm_method == 2) ? 0x0 : 0x1);
|
||||
if (acm) {
|
||||
switch (e_aci) {
|
||||
case AC0_BE:
|
||||
acm_ctrl |= AcmHw_BeqEn;
|
||||
break;
|
||||
case AC2_VI:
|
||||
acm_ctrl |= AcmHw_ViqEn;
|
||||
break;
|
||||
case AC3_VO:
|
||||
acm_ctrl |= AcmHw_VoqEn;
|
||||
break;
|
||||
default:
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
|
||||
"HW_VAR_ACM_CTRL acm set failed: eACI is %d\n",
|
||||
acm);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (e_aci) {
|
||||
case AC0_BE:
|
||||
acm_ctrl &= (~AcmHw_BeqEn);
|
||||
break;
|
||||
case AC2_VI:
|
||||
acm_ctrl &= (~AcmHw_ViqEn);
|
||||
break;
|
||||
case AC3_VO:
|
||||
acm_ctrl &= (~AcmHw_VoqEn);
|
||||
break;
|
||||
default:
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
|
||||
"switch case not processed\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
RT_TRACE(rtlpriv, COMP_QOS, DBG_TRACE,
|
||||
"SetHwReg8190pci(): [HW_VAR_ACM_CTRL] Write 0x%X\n",
|
||||
acm_ctrl);
|
||||
rtl_write_byte(rtlpriv, REG_ACMHWCTRL, acm_ctrl);
|
||||
break;
|
||||
}
|
||||
case HW_VAR_RCR:{
|
||||
|
|
|
@ -393,59 +393,9 @@ void rtl92c_disable_interrupt(struct ieee80211_hw *hw)
|
|||
void rtl92c_set_qos(struct ieee80211_hw *hw, int aci)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
|
||||
u32 u4b_ac_param;
|
||||
|
||||
rtl92c_dm_init_edca_turbo(hw);
|
||||
u4b_ac_param = (u32) mac->ac[aci].aifs;
|
||||
u4b_ac_param |=
|
||||
((u32) le16_to_cpu(mac->ac[aci].cw_min) & 0xF) <<
|
||||
AC_PARAM_ECW_MIN_OFFSET;
|
||||
u4b_ac_param |=
|
||||
((u32) le16_to_cpu(mac->ac[aci].cw_max) & 0xF) <<
|
||||
AC_PARAM_ECW_MAX_OFFSET;
|
||||
u4b_ac_param |= (u32) le16_to_cpu(mac->ac[aci].tx_op) <<
|
||||
AC_PARAM_TXOP_OFFSET;
|
||||
RT_TRACE(rtlpriv, COMP_QOS, DBG_LOUD, "queue:%x, ac_param:%x\n",
|
||||
aci, u4b_ac_param);
|
||||
switch (aci) {
|
||||
case AC1_BK:
|
||||
rtl_write_dword(rtlpriv, REG_EDCA_BK_PARAM, u4b_ac_param);
|
||||
break;
|
||||
case AC0_BE:
|
||||
rtl_write_dword(rtlpriv, REG_EDCA_BE_PARAM, u4b_ac_param);
|
||||
break;
|
||||
case AC2_VI:
|
||||
rtl_write_dword(rtlpriv, REG_EDCA_VI_PARAM, u4b_ac_param);
|
||||
break;
|
||||
case AC3_VO:
|
||||
rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, u4b_ac_param);
|
||||
break;
|
||||
default:
|
||||
RT_ASSERT(false, "invalid aci: %d !\n", aci);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* HW MAC Address
|
||||
*-------------------------------------------------------------------------*/
|
||||
void rtl92c_set_mac_addr(struct ieee80211_hw *hw, const u8 *addr)
|
||||
{
|
||||
u32 i;
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
|
||||
for (i = 0 ; i < ETH_ALEN ; i++)
|
||||
rtl_write_byte(rtlpriv, (REG_MACID + i), *(addr+i));
|
||||
|
||||
RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG,
|
||||
"MAC Address: %02X-%02X-%02X-%02X-%02X-%02X\n",
|
||||
rtl_read_byte(rtlpriv, REG_MACID),
|
||||
rtl_read_byte(rtlpriv, REG_MACID+1),
|
||||
rtl_read_byte(rtlpriv, REG_MACID+2),
|
||||
rtl_read_byte(rtlpriv, REG_MACID+3),
|
||||
rtl_read_byte(rtlpriv, REG_MACID+4),
|
||||
rtl_read_byte(rtlpriv, REG_MACID+5));
|
||||
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AC_PARAM, (u8 *)&aci);
|
||||
}
|
||||
|
||||
void rtl92c_init_driver_info_size(struct ieee80211_hw *hw, u8 size)
|
||||
|
|
|
@ -48,7 +48,6 @@ void rtl92c_set_qos(struct ieee80211_hw *hw, int aci);
|
|||
/*---------------------------------------------------------------
|
||||
* Hardware init functions
|
||||
*---------------------------------------------------------------*/
|
||||
void rtl92c_set_mac_addr(struct ieee80211_hw *hw, const u8 *addr);
|
||||
void rtl92c_init_interrupt(struct ieee80211_hw *hw);
|
||||
void rtl92c_init_driver_info_size(struct ieee80211_hw *hw, u8 size);
|
||||
|
||||
|
|
Loading…
Reference in a new issue