aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlen Lee <glen.lee@atmel.com>2015-11-05 04:51:23 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-11-18 16:22:44 -0500
commitb57f9f34e27bf81c97b10d6725d71824e448c37e (patch)
tree5f945b3d975192f3cdd2bf370a9dc2681e9a5055
parent819db468b26797d9f53d547dd2a9fe94859a16e0 (diff)
Revert "Staging: wilc1000: coreconfigurator: Drop unneeded wrapper functions"
The source and destination pointers are misplaced. This will be like, ether_addr_copy(data, bssid + ADDR2); -> ether_addr_copy(bssid, data + ADDR2); and also to use ether_addr_copy, it has to be proved that src/dst address are properly aligned(2). I revert this as author agree to drop this patch. This reverts commit d4622f68db8095dd54179e3134e97812727f6b89. Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/wilc1000/coreconfigurator.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index e10c6ffa698a..9568bdb6319b 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -13,12 +13,8 @@
13#include "wilc_wlan.h" 13#include "wilc_wlan.h"
14#include <linux/errno.h> 14#include <linux/errno.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/etherdevice.h>
17#define TAG_PARAM_OFFSET (MAC_HDR_LEN + TIME_STAMP_LEN + \ 16#define TAG_PARAM_OFFSET (MAC_HDR_LEN + TIME_STAMP_LEN + \
18 BEACON_INTERVAL_LEN + CAP_INFO_LEN) 17 BEACON_INTERVAL_LEN + CAP_INFO_LEN)
19#define ADDR1 4
20#define ADDR2 10
21#define ADDR3 16
22 18
23/* Basic Frame Type Codes (2-bit) */ 19/* Basic Frame Type Codes (2-bit) */
24enum basic_frame_type { 20enum basic_frame_type {
@@ -175,32 +171,38 @@ static inline u8 get_from_ds(u8 *header)
175 return ((header[1] & 0x02) >> 1); 171 return ((header[1] & 0x02) >> 1);
176} 172}
177 173
174/* This function extracts the MAC Address in 'address1' field of the MAC */
175/* header and updates the MAC Address in the allocated 'addr' variable. */
176static inline void get_address1(u8 *pu8msa, u8 *addr)
177{
178 memcpy(addr, pu8msa + 4, 6);
179}
180
181/* This function extracts the MAC Address in 'address2' field of the MAC */
182/* header and updates the MAC Address in the allocated 'addr' variable. */
183static inline void get_address2(u8 *pu8msa, u8 *addr)
184{
185 memcpy(addr, pu8msa + 10, 6);
186}
187
188/* This function extracts the MAC Address in 'address3' field of the MAC */
189/* header and updates the MAC Address in the allocated 'addr' variable. */
190static inline void get_address3(u8 *pu8msa, u8 *addr)
191{
192 memcpy(addr, pu8msa + 16, 6);
193}
194
178/* This function extracts the BSSID from the incoming WLAN packet based on */ 195/* This function extracts the BSSID from the incoming WLAN packet based on */
179/* the 'from ds' bit, and updates the MAC Address in the allocated 'data' */ 196/* the 'from ds' bit, and updates the MAC Address in the allocated 'addr' */
180/* variable. */ 197/* variable. */
181static inline void get_BSSID(u8 *data, u8 *bssid) 198static inline void get_BSSID(u8 *data, u8 *bssid)
182{ 199{
183 if (get_from_ds(data) == 1) 200 if (get_from_ds(data) == 1)
184 /* 201 get_address2(data, bssid);
185 * Extract the MAC Address in 'address2' field of the MAC
186 * header and update the MAC Address in the allocated 'data'
187 * variable.
188 */
189 ether_addr_copy(data, bssid + ADDR2);
190 else if (get_to_ds(data) == 1) 202 else if (get_to_ds(data) == 1)
191 /* 203 get_address1(data, bssid);
192 * Extract the MAC Address in 'address1' field of the MAC
193 * header and update the MAC Address in the allocated 'data'
194 * variable.
195 */
196 ether_addr_copy(data, bssid + ADDR1);
197 else 204 else
198 /* 205 get_address3(data, bssid);
199 * Extract the MAC Address in 'address3' field of the MAC
200 * header and update the MAC Address in the allocated 'data'
201 * variable.
202 */
203 ether_addr_copy(data, bssid + ADDR3);
204} 206}
205 207
206/* This function extracts the SSID from a beacon/probe response frame */ 208/* This function extracts the SSID from a beacon/probe response frame */