Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf27cea4 authored by Taehee Yoo's avatar Taehee Yoo Committed by Kalle Valo
Browse files

rtlwifi: rtl8192cu: remove duplicated routine in hw.c and mac.c



rtl92c_set_xxx_filter is same routine with rtl92cu_set_hw_reg.
so i remove those functions that are rtl92c_set_xxx_filter.
(rtl92c_get_xxx_filter is also same reason.)
also i add code updating struct rtl_mac member variable in the
rtl92cu_set_hw_reg.
after that, no more _update_mac_setting is not useful. thus i remove that.

Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 15f6d96d
Loading
Loading
Loading
Loading
+16 −22
Original line number Diff line number Diff line
@@ -819,25 +819,28 @@ static void _rtl92cu_init_usb_aggregation(struct ieee80211_hw *hw)
static void _rtl92cu_init_wmac_setting(struct ieee80211_hw *hw)
{
	u16 value16;

	u32 value32;
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));

	mac->rx_conf = (RCR_APM | RCR_AM | RCR_ADF | RCR_AB | RCR_APPFCS |
	value32 = (RCR_APM | RCR_AM | RCR_ADF | RCR_AB | RCR_APPFCS |
		   RCR_APP_ICV | RCR_AMF | RCR_HTC_LOC_CTRL |
		   RCR_APP_MIC | RCR_APP_PHYSTS | RCR_ACRC32);
	rtl_write_dword(rtlpriv, REG_RCR, mac->rx_conf);
	rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR, (u8 *)(&value32));
	/* Accept all multicast address */
	rtl_write_dword(rtlpriv,  REG_MAR, 0xFFFFFFFF);
	rtl_write_dword(rtlpriv,  REG_MAR + 4, 0xFFFFFFFF);
	/* Accept all management frames */
	value16 = 0xFFFF;
	rtl92c_set_mgt_filter(hw, value16);
	rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_MGT_FILTER,
				      (u8 *)(&value16));
	/* Reject all control frame - default value is 0 */
	rtl92c_set_ctrl_filter(hw, 0x0);
	value16 = 0x0;
	rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_CTRL_FILTER,
				      (u8 *)(&value16));
	/* Accept all data frames */
	value16 = 0xFFFF;
	rtl92c_set_data_filter(hw, value16);
	rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_DATA_FILTER,
				      (u8 *)(&value16));
}

static void _rtl92cu_init_beacon_parameters(struct ieee80211_hw *hw)
@@ -988,17 +991,6 @@ static void _InitPABias(struct ieee80211_hw *hw)
	}
}

static void _update_mac_setting(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));

	mac->rx_conf = rtl_read_dword(rtlpriv, REG_RCR);
	mac->rx_mgt_filter = rtl_read_word(rtlpriv, REG_RXFLTMAP0);
	mac->rx_ctrl_filter = rtl_read_word(rtlpriv, REG_RXFLTMAP1);
	mac->rx_data_filter = rtl_read_word(rtlpriv, REG_RXFLTMAP2);
}

int rtl92cu_hw_init(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
@@ -1068,7 +1060,6 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw)
	}
	_rtl92cu_hw_configure(hw);
	_InitPABias(hw);
	_update_mac_setting(hw);
	rtl92c_dm_init(hw);
exit:
	local_irq_restore(flags);
@@ -1999,12 +1990,15 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
		}
	case HW_VAR_MGT_FILTER:
		rtl_write_word(rtlpriv, REG_RXFLTMAP0, *(u16 *)val);
		mac->rx_mgt_filter = *(u16 *)val;
		break;
	case HW_VAR_CTRL_FILTER:
		rtl_write_word(rtlpriv, REG_RXFLTMAP1, *(u16 *)val);
		mac->rx_ctrl_filter = *(u16 *)val;
		break;
	case HW_VAR_DATA_FILTER:
		rtl_write_word(rtlpriv, REG_RXFLTMAP2, *(u16 *)val);
		mac->rx_data_filter = *(u16 *)val;
		break;
	default:
		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
+0 −41
Original line number Diff line number Diff line
@@ -644,47 +644,6 @@ void rtl92c_set_min_space(struct ieee80211_hw *hw, bool is2T)
	rtl_write_byte(rtlpriv, REG_AMPDU_MIN_SPACE, value);
}

u16 rtl92c_get_mgt_filter(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);

	return rtl_read_word(rtlpriv, REG_RXFLTMAP0);
}

void rtl92c_set_mgt_filter(struct ieee80211_hw *hw, u16 filter)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);

	rtl_write_word(rtlpriv, REG_RXFLTMAP0, filter);
}

u16 rtl92c_get_ctrl_filter(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);

	return rtl_read_word(rtlpriv, REG_RXFLTMAP1);
}

void rtl92c_set_ctrl_filter(struct ieee80211_hw *hw, u16 filter)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);

	rtl_write_word(rtlpriv, REG_RXFLTMAP1, filter);
}

u16 rtl92c_get_data_filter(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);

	return rtl_read_word(rtlpriv,  REG_RXFLTMAP2);
}

void rtl92c_set_data_filter(struct ieee80211_hw *hw, u16 filter)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);

	rtl_write_word(rtlpriv, REG_RXFLTMAP2, filter);
}
/*==============================================================*/

static u8 _rtl92c_query_rxpwrpercentage(char antpower)
+0 −9
Original line number Diff line number Diff line
@@ -73,15 +73,6 @@ void rtl92c_init_retry_function(struct ieee80211_hw *hw);
void rtl92c_disable_fast_edca(struct ieee80211_hw *hw);
void rtl92c_set_min_space(struct ieee80211_hw *hw, bool is2T);

/* For filter */
u16 rtl92c_get_mgt_filter(struct ieee80211_hw *hw);
void rtl92c_set_mgt_filter(struct ieee80211_hw *hw, u16 filter);
u16 rtl92c_get_ctrl_filter(struct ieee80211_hw *hw);
void rtl92c_set_ctrl_filter(struct ieee80211_hw *hw, u16 filter);
u16 rtl92c_get_data_filter(struct ieee80211_hw *hw);
void rtl92c_set_data_filter(struct ieee80211_hw *hw, u16 filter);


u32 rtl92c_get_txdma_status(struct ieee80211_hw *hw);

struct rx_fwinfo_92c {