orinoco: clear countermeasure setting on commit
[orinoco_usb.git] / drivers / net / wireless / orinoco / main.h
blob21ab36cd76c795b74604df687a15e5a1f8658a86
1 /* Exports from main to helper modules
3 * See copyright notice in main.c
4 */
5 #ifndef _ORINOCO_MAIN_H_
6 #define _ORINOCO_MAIN_H_
8 #include <linux/ieee80211.h>
9 #include "orinoco.h"
11 /********************************************************************/
12 /* Compile time configuration and compatibility stuff */
13 /********************************************************************/
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 */
22 /********************************************************************/
24 /* Export module parameter */
25 extern int force_monitor;
27 /* Forward declarations */
28 struct net_device;
29 struct work_struct;
31 void set_port_type(struct orinoco_private *priv);
32 int orinoco_commit(struct orinoco_private *priv);
33 void orinoco_reset(struct work_struct *work);
35 /* Information element helpers - find a home for these... */
36 static inline u8 *orinoco_get_ie(u8 *data, size_t len,
37 enum ieee80211_eid eid)
39 u8 *p = data;
40 while ((p + 2) < (data + len)) {
41 if (p[0] == eid)
42 return p;
43 p += p[1] + 2;
45 return NULL;
48 #define WPA_OUI_TYPE "\x00\x50\xF2\x01"
49 #define WPA_SELECTOR_LEN 4
50 static inline u8 *orinoco_get_wpa_ie(u8 *data, size_t len)
52 u8 *p = data;
53 while ((p + 2 + WPA_SELECTOR_LEN) < (data + len)) {
54 if ((p[0] == WLAN_EID_GENERIC) &&
55 (memcmp(&p[2], WPA_OUI_TYPE, WPA_SELECTOR_LEN) == 0))
56 return p;
57 p += p[1] + 2;
59 return NULL;
62 #endif /* _ORINOCO_MAIN_H_ */