David Kilroy | cb1576a | 2009-02-04 23:05:56 +0000 | [diff] [blame] | 1 | /* Exports from main to helper modules |
| 2 | * |
| 3 | * See copyright notice in main.c |
| 4 | */ |
| 5 | #ifndef _ORINOCO_MAIN_H_ |
| 6 | #define _ORINOCO_MAIN_H_ |
| 7 | |
| 8 | #include <linux/ieee80211.h> |
| 9 | #include "orinoco.h" |
| 10 | |
| 11 | /********************************************************************/ |
| 12 | /* Compile time configuration and compatibility stuff */ |
| 13 | /********************************************************************/ |
| 14 | |
| 15 | /* We do this this way to avoid ifdefs in the actual code */ |
| 16 | #ifdef WIRELESS_SPY |
| 17 | #define SPY_NUMBER(priv) (priv->spy_data.spy_number) |
| 18 | #else |
| 19 | #define SPY_NUMBER(priv) 0 |
| 20 | #endif /* WIRELESS_SPY */ |
| 21 | |
| 22 | /********************************************************************/ |
| 23 | |
| 24 | /* Export module parameter */ |
| 25 | extern int force_monitor; |
| 26 | |
| 27 | /* Forward declarations */ |
| 28 | struct net_device; |
| 29 | struct work_struct; |
| 30 | |
| 31 | void set_port_type(struct orinoco_private *priv); |
David Kilroy | 721aa2f | 2009-06-18 23:21:31 +0100 | [diff] [blame] | 32 | int orinoco_commit(struct orinoco_private *priv); |
David Kilroy | cb1576a | 2009-02-04 23:05:56 +0000 | [diff] [blame] | 33 | void orinoco_reset(struct work_struct *work); |
| 34 | |
David Kilroy | cb1576a | 2009-02-04 23:05:56 +0000 | [diff] [blame] | 35 | /* Information element helpers - find a home for these... */ |
David Kilroy | cb1576a | 2009-02-04 23:05:56 +0000 | [diff] [blame] | 36 | #define WPA_OUI_TYPE "\x00\x50\xF2\x01" |
| 37 | #define WPA_SELECTOR_LEN 4 |
| 38 | static inline u8 *orinoco_get_wpa_ie(u8 *data, size_t len) |
| 39 | { |
| 40 | u8 *p = data; |
| 41 | while ((p + 2 + WPA_SELECTOR_LEN) < (data + len)) { |
Arend van Spriel | 04b2312 | 2012-10-12 12:28:14 +0200 | [diff] [blame] | 42 | if ((p[0] == WLAN_EID_VENDOR_SPECIFIC) && |
David Kilroy | cb1576a | 2009-02-04 23:05:56 +0000 | [diff] [blame] | 43 | (memcmp(&p[2], WPA_OUI_TYPE, WPA_SELECTOR_LEN) == 0)) |
| 44 | return p; |
| 45 | p += p[1] + 2; |
| 46 | } |
| 47 | return NULL; |
| 48 | } |
| 49 | |
| 50 | #endif /* _ORINOCO_MAIN_H_ */ |