diff options
-rw-r--r-- | drivers/staging/wilc1000/coreconfigurator.c | 48 |
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) */ |
24 | enum basic_frame_type { | 20 | enum 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. */ | ||
176 | static 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. */ | ||
183 | static 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. */ | ||
190 | static 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. */ |
181 | static inline void get_BSSID(u8 *data, u8 *bssid) | 198 | static 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 */ |