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

Commit da3ba88a authored by Larry Finger's avatar Larry Finger Committed by John W. Linville
Browse files

rtlwifi: Combine instances of RTL_HAL_IS_CCK_RATE macros.



Three drivers, rtl8192ce, rtl8192cu and rtl8192de, use the same macro
to check if a particular rate is in the CCK set. This common code is
relocated to a common header file. A distinct macro used by rtl8192se
with the same name is renamed.

Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 87b6d092
Loading
Loading
Loading
Loading
+0 −6
Original line number Original line Diff line number Diff line
@@ -537,12 +537,6 @@ do { \
		memset(__pdesc, 0, _size);	\
		memset(__pdesc, 0, _size);	\
} while (0);
} while (0);


#define RX_HAL_IS_CCK_RATE(_pdesc)\
	(_pdesc->rxmcs == DESC92_RATE1M ||		\
	 _pdesc->rxmcs == DESC92_RATE2M ||		\
	 _pdesc->rxmcs == DESC92_RATE5_5M ||		\
	 _pdesc->rxmcs == DESC92_RATE11M)

struct rx_fwinfo_92c {
struct rx_fwinfo_92c {
	u8 gain_trsw[4];
	u8 gain_trsw[4];
	u8 pwdb_all;
	u8 pwdb_all;
+0 −6
Original line number Original line Diff line number Diff line
@@ -87,12 +87,6 @@ void rtl92c_set_data_filter(struct ieee80211_hw *hw, u16 filter);


u32 rtl92c_get_txdma_status(struct ieee80211_hw *hw);
u32 rtl92c_get_txdma_status(struct ieee80211_hw *hw);


#define RX_HAL_IS_CCK_RATE(_pdesc)\
	(GET_RX_DESC_RX_MCS(_pdesc) == DESC92_RATE1M ||\
	 GET_RX_DESC_RX_MCS(_pdesc) == DESC92_RATE2M ||\
	 GET_RX_DESC_RX_MCS(_pdesc) == DESC92_RATE5_5M ||\
	 GET_RX_DESC_RX_MCS(_pdesc) == DESC92_RATE11M)

struct rx_fwinfo_92c {
struct rx_fwinfo_92c {
	u8 gain_trsw[4];
	u8 gain_trsw[4];
	u8 pwdb_all;
	u8 pwdb_all;
+0 −6
Original line number Original line Diff line number Diff line
@@ -537,12 +537,6 @@ do { \
		memset((void *)__pdesc, 0, _size);	\
		memset((void *)__pdesc, 0, _size);	\
} while (0);
} while (0);


#define RX_HAL_IS_CCK_RATE(_pdesc)\
	(_pdesc->rxmcs == DESC92_RATE1M ||		\
	 _pdesc->rxmcs == DESC92_RATE2M ||		\
	 _pdesc->rxmcs == DESC92_RATE5_5M ||		\
	 _pdesc->rxmcs == DESC92_RATE11M)

/* For 92D early mode */
/* For 92D early mode */
#define SET_EARLYMODE_PKTNUM(__paddr, __value)		\
#define SET_EARLYMODE_PKTNUM(__paddr, __value)		\
	SET_BITS_OFFSET_LE(__paddr, 0, 3, __value)
	SET_BITS_OFFSET_LE(__paddr, 0, 3, __value)
+1 −1
Original line number Original line Diff line number Diff line
@@ -459,7 +459,7 @@ do { \
#define SET_RX_STATUS__DESC_BUFF_ADDR(__pdesc, __val)	\
#define SET_RX_STATUS__DESC_BUFF_ADDR(__pdesc, __val)	\
	SET_BITS_OFFSET_LE(__pdesc + 24, 0, 32, __val)
	SET_BITS_OFFSET_LE(__pdesc + 24, 0, 32, __val)


#define RX_HAL_IS_CCK_RATE(_pdesc)\
#define SE_RX_HAL_IS_CCK_RATE(_pdesc)\
	(GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE1M ||	\
	(GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE1M ||	\
	 GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE2M ||	\
	 GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE2M ||	\
	 GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE5_5M ||\
	 GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE5_5M ||\
+1 −1
Original line number Original line Diff line number Diff line
@@ -126,7 +126,7 @@ static void _rtl92se_query_rxphystatus(struct ieee80211_hw *hw,
	bool in_powersavemode = false;
	bool in_powersavemode = false;
	bool is_cck_rate;
	bool is_cck_rate;


	is_cck_rate = RX_HAL_IS_CCK_RATE(pdesc);
	is_cck_rate = SE_RX_HAL_IS_CCK_RATE(pdesc);
	pstats->packet_matchbssid = packet_match_bssid;
	pstats->packet_matchbssid = packet_match_bssid;
	pstats->packet_toself = packet_toself;
	pstats->packet_toself = packet_toself;
	pstats->is_cck = is_cck_rate;
	pstats->is_cck = is_cck_rate;
Loading