summaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000
diff options
context:
space:
mode:
authorAjay Singh2018-11-01 17:45:11 +0100
committerGreg Kroah-Hartman2018-11-05 15:23:01 +0100
commite23c009f728c338e946797d9ff59e61175e34203 (patch)
treec5ff744547c592dc3035a25dc9b043232d8aa982 /drivers/staging/wilc1000
parentstaging: wilc1000: remove unused code in coreconfigurator (diff)
downloadkernel-qcow2-linux-e23c009f728c338e946797d9ff59e61175e34203.tar.gz
kernel-qcow2-linux-e23c009f728c338e946797d9ff59e61175e34203.tar.xz
kernel-qcow2-linux-e23c009f728c338e946797d9ff59e61175e34203.zip
staging: wilc1000: refactor get_bssid() function
Refactor get_bssid() by making use of 'ieee80211_mgmt' struct. Instead of passing the memory offset now using structure element to fetch the bssid information. Returning the pointer to bssid from get_bssid() instead of filing the input argument. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r--drivers/staging/wilc1000/coreconfigurator.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 166443d9a28c..ac4484679ced 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -8,29 +8,14 @@
#include "coreconfigurator.h"
-static inline void get_address1(u8 *msa, u8 *addr)
+static inline u8 *get_bssid(struct ieee80211_mgmt *mgmt)
{
- memcpy(addr, msa + 4, 6);
-}
-
-static inline void get_address2(u8 *msa, u8 *addr)
-{
- memcpy(addr, msa + 10, 6);
-}
-
-static inline void get_address3(u8 *msa, u8 *addr)
-{
- memcpy(addr, msa + 16, 6);
-}
-
-static inline void get_bssid(__le16 fc, u8 *data, u8 *bssid)
-{
- if (ieee80211_has_fromds(fc))
- get_address2(data, bssid);
- else if (ieee80211_has_tods(fc))
- get_address1(data, bssid);
+ if (ieee80211_has_fromds(mgmt->frame_control))
+ return mgmt->sa;
+ else if (ieee80211_has_tods(mgmt->frame_control))
+ return mgmt->da;
else
- get_address3(data, bssid);
+ return mgmt->bssid;
}
static inline u16 get_asoc_status(u8 *data)
@@ -87,7 +72,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer,
return -EIO;
}
- get_bssid(mgt->frame_control, msa, network_info->bssid);
+ ether_addr_copy(network_info->bssid, get_bssid(mgt));
ies = mgt->u.beacon.variable;
ies_len = rx_len - offset;