Commit f0dcd57e authored by Larry Finger's avatar Larry Finger Committed by Kalle Valo
Browse files

rtlwifi: Remove dependence on special bit manipulation macros for common driver



The special macros are used in several places in the base driver.
These are replaced by standard bit manipulation macros or code.

Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 4c8692d4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -61,9 +61,9 @@ enum ap_peer {
	CP_MACADDR((u8 *)(_hdr)+FRAME_OFFSET_ADDRESS3, (u8 *)(_val))

#define SET_TX_DESC_SPE_RPT(__pdesc, __val)			\
	SET_BITS_TO_LE_4BYTE((__pdesc) + 8, 19, 1, __val)
	le32p_replace_bits((__le32 *)(__pdesc + 8), __val, BIT(19))
#define SET_TX_DESC_SW_DEFINE(__pdesc, __val)	\
	SET_BITS_TO_LE_4BYTE((__pdesc) + 24, 0, 12, __val)
	le32p_replace_bits((__le32 *)(__pdesc + 24), __val, GENMASK(11, 0))

int rtl_init_core(struct ieee80211_hw *hw);
void rtl_deinit_core(struct ieee80211_hw *hw);
+10 −10
Original line number Diff line number Diff line
@@ -737,7 +737,7 @@ static void rtl_p2p_noa_ie(struct ieee80211_hw *hw, void *data,
	find_p2p_ie = true;
	/*to find noa ie*/
	while (ie + 1 < end) {
		noa_len = READEF2BYTE((__le16 *)&ie[1]);
		noa_len = le16_to_cpu(*((__le16 *)&ie[1]));
		if (ie + 3 + ie[1] > end)
			return;

@@ -766,16 +766,16 @@ static void rtl_p2p_noa_ie(struct ieee80211_hw *hw, void *data,
				index = 5;
				for (i = 0; i < noa_num; i++) {
					p2pinfo->noa_count_type[i] =
							READEF1BYTE(ie+index);
					 *(u8 *)(ie + index);
					index += 1;
					p2pinfo->noa_duration[i] =
						 READEF4BYTE((__le32 *)ie+index);
					 le32_to_cpu(*(__le32 *)ie + index);
					index += 4;
					p2pinfo->noa_interval[i] =
						 READEF4BYTE((__le32 *)ie+index);
					 le32_to_cpu(*(__le32 *)ie + index);
					index += 4;
					p2pinfo->noa_start_time[i] =
						 READEF4BYTE((__le32 *)ie+index);
					 le32_to_cpu(*(__le32 *)ie + index);
					index += 4;
				}

@@ -832,7 +832,7 @@ static void rtl_p2p_action_ie(struct ieee80211_hw *hw, void *data,
	RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "action frame find P2P IE.\n");
	/*to find noa ie*/
	while (ie + 1 < end) {
		noa_len = READEF2BYTE((__le16 *)&ie[1]);
		noa_len = le16_to_cpu(*(__le16 *)&ie[1]);
		if (ie + 3 + ie[1] > end)
			return;

@@ -861,16 +861,16 @@ static void rtl_p2p_action_ie(struct ieee80211_hw *hw, void *data,
				index = 5;
				for (i = 0; i < noa_num; i++) {
					p2pinfo->noa_count_type[i] =
							READEF1BYTE(ie+index);
					 *(u8 *)(ie + index);
					index += 1;
					p2pinfo->noa_duration[i] =
							 READEF4BYTE((__le32 *)ie+index);
					 le32_to_cpu(*(__le32 *)ie + index);
					index += 4;
					p2pinfo->noa_interval[i] =
							 READEF4BYTE((__le32 *)ie+index);
					 le32_to_cpu(*(__le32 *)ie + index);
					index += 4;
					p2pinfo->noa_start_time[i] =
							 READEF4BYTE((__le32 *)ie+index);
					 le32_to_cpu(*(__le32 *)ie + index);
					index += 4;
				}