summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8192u/ieee80211/dot11d.h
diff options
context:
space:
mode:
authorJohn Whitmore <johnfwhitmore@gmail.com>2018-08-08 22:00:22 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-08-27 19:17:07 +0200
commit9391bea9ad4e7d4b3ad5748c080061bafcb1693f (patch)
tree67494c2679400013374843c10507506ef3b5e792 /drivers/staging/rtl8192u/ieee80211/dot11d.h
parentd947dddf1c95122f5a6e2de19b4483c7ba74aeca (diff)
staging:rtl8192u: Remove macro eqMacAddr - Style
The macro eqMacAddr implements the same functionality as the ether_addr_equal function defined in etherdevice.h, as a result the macro has been removed from the code, and its use replaced with the function call. Note that to use the ether_addr_equal function the data array containing the MAC Address has to be u16 aligned. Because of this the struct rt_dot11d_info has had it's member variables re-ordered. This is a coding style change which should have no impact on runtime code execution. Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192u/ieee80211/dot11d.h')
-rw-r--r--drivers/staging/rtl8192u/ieee80211/dot11d.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.h b/drivers/staging/rtl8192u/ieee80211/dot11d.h
index 363a6bed18dd..3bfd7efe05a0 100644
--- a/drivers/staging/rtl8192u/ieee80211/dot11d.h
+++ b/drivers/staging/rtl8192u/ieee80211/dot11d.h
@@ -17,22 +17,20 @@ enum dot11d_state {
};
struct rt_dot11d_info {
- bool enabled; /* dot11MultiDomainCapabilityEnabled */
-
u16 country_ie_len; /* > 0 if country_ie_buf[] contains valid country information element. */
- u8 country_ie_buf[MAX_IE_LEN];
+
+ /* country_ie_src_addr u16 aligned for comparison and copy */
u8 country_ie_src_addr[6]; /* Source AP of the country IE. */
+ u8 country_ie_buf[MAX_IE_LEN];
u8 country_ie_watchdog;
u8 channel_map[MAX_CHANNEL_NUMBER + 1]; /* !Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan) */
u8 max_tx_pwr_dbm_list[MAX_CHANNEL_NUMBER + 1];
enum dot11d_state state;
+ bool enabled; /* dot11MultiDomainCapabilityEnabled */
};
-#define eqMacAddr(a, b) (((a)[0] == (b)[0] && \
- (a)[1] == (b)[1] && (a)[2] == (b)[2] && (a)[3] == (b)[3] && \
- (a)[4] == (b)[4] && (a)[5] == (b)[5]) ? 1 : 0)
#define cpMacAddr(des, src) ((des)[0] = (src)[0], \
(des)[1] = (src)[1], (des)[2] = (src)[2], \
(des)[3] = (src)[3], (des)[4] = (src)[4], \
@@ -42,7 +40,7 @@ struct rt_dot11d_info {
#define IS_DOT11D_ENABLE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->enabled)
#define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->country_ie_len > 0)
-#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)
+#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) ether_addr_equal(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)
#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)
#define GET_CIE_WATCHDOG(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->country_ie_watchdog)