main.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #include <linux/ieee80211.h>
  8. #include "orinoco.h"
  9. /********************************************************************/
  10. /* Compile time configuration and compatibility stuff */
  11. /********************************************************************/
  12. /* We do this this way to avoid ifdefs in the actual code */
  13. #ifdef WIRELESS_SPY
  14. #define SPY_NUMBER(priv) (priv->spy_data.spy_number)
  15. #else
  16. #define SPY_NUMBER(priv) 0
  17. #endif /* WIRELESS_SPY */
  18. /********************************************************************/
  19. /* Export module parameter */
  20. extern int force_monitor;
  21. /* Forward declarations */
  22. struct net_device;
  23. struct work_struct;
  24. void set_port_type(struct orinoco_private *priv);
  25. int orinoco_commit(struct orinoco_private *priv);
  26. void orinoco_reset(struct work_struct *work);
  27. /* Information element helpers - find a home for these... */
  28. #define WPA_OUI_TYPE "\x00\x50\xF2\x01"
  29. #define WPA_SELECTOR_LEN 4
  30. static inline u8 *orinoco_get_wpa_ie(u8 *data, size_t len)
  31. {
  32. u8 *p = data;
  33. while ((p + 2 + WPA_SELECTOR_LEN) < (data + len)) {
  34. if ((p[0] == WLAN_EID_VENDOR_SPECIFIC) &&
  35. (memcmp(&p[2], WPA_OUI_TYPE, WPA_SELECTOR_LEN) == 0))
  36. return p;
  37. p += p[1] + 2;
  38. }
  39. return NULL;
  40. }
  41. #endif /* _ORINOCO_MAIN_H_ */