Back to home page

OSCL-LXR

 
 

    


0001 /* Exports from main to helper modules
0002  *
0003  * See copyright notice in main.c
0004  */
0005 #ifndef _ORINOCO_MAIN_H_
0006 #define _ORINOCO_MAIN_H_
0007 
0008 #include <linux/ieee80211.h>
0009 #include "orinoco.h"
0010 
0011 /********************************************************************/
0012 /* Compile time configuration and compatibility stuff               */
0013 /********************************************************************/
0014 
0015 /* We do this this way to avoid ifdefs in the actual code */
0016 #ifdef WIRELESS_SPY
0017 #define SPY_NUMBER(priv)    (priv->spy_data.spy_number)
0018 #else
0019 #define SPY_NUMBER(priv)    0
0020 #endif /* WIRELESS_SPY */
0021 
0022 /********************************************************************/
0023 
0024 /* Export module parameter */
0025 extern int force_monitor;
0026 
0027 /* Forward declarations */
0028 struct net_device;
0029 struct work_struct;
0030 
0031 void set_port_type(struct orinoco_private *priv);
0032 int orinoco_commit(struct orinoco_private *priv);
0033 void orinoco_reset(struct work_struct *work);
0034 
0035 /* Information element helpers - find a home for these... */
0036 #define WPA_OUI_TYPE    "\x00\x50\xF2\x01"
0037 #define WPA_SELECTOR_LEN 4
0038 static inline u8 *orinoco_get_wpa_ie(u8 *data, size_t len)
0039 {
0040     u8 *p = data;
0041     while ((p + 2 + WPA_SELECTOR_LEN) < (data + len)) {
0042         if ((p[0] == WLAN_EID_VENDOR_SPECIFIC) &&
0043             (memcmp(&p[2], WPA_OUI_TYPE, WPA_SELECTOR_LEN) == 0))
0044             return p;
0045         p += p[1] + 2;
0046     }
0047     return NULL;
0048 }
0049 
0050 #endif /* _ORINOCO_MAIN_H_ */