scan.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /**
  2. * Interface for the wlan network scan routines
  3. *
  4. * Driver interface functions and type declarations for the scan module
  5. * implemented in scan.c.
  6. */
  7. #ifndef _LBS_SCAN_H
  8. #define _LBS_SCAN_H
  9. #include <net/ieee80211.h>
  10. #include "hostcmd.h"
  11. /**
  12. * @brief Maximum number of channels that can be sent in a setuserscan ioctl
  13. */
  14. #define LBS_IOCTL_USER_SCAN_CHAN_MAX 50
  15. //! Infrastructure BSS scan type in cmd_ds_802_11_scan
  16. #define LBS_SCAN_BSS_TYPE_BSS 1
  17. //! Adhoc BSS scan type in cmd_ds_802_11_scan
  18. #define LBS_SCAN_BSS_TYPE_IBSS 2
  19. //! Adhoc or Infrastructure BSS scan type in cmd_ds_802_11_scan, no filter
  20. #define LBS_SCAN_BSS_TYPE_ANY 3
  21. /**
  22. * @brief Structure used to store information for each beacon/probe response
  23. */
  24. struct bss_descriptor {
  25. u8 bssid[ETH_ALEN];
  26. u8 ssid[IW_ESSID_MAX_SIZE + 1];
  27. u8 ssid_len;
  28. u16 capability;
  29. u32 rssi;
  30. u32 channel;
  31. u16 beaconperiod;
  32. u32 atimwindow;
  33. /* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */
  34. u8 mode;
  35. /* zero-terminated array of supported data rates */
  36. u8 rates[MAX_RATES + 1];
  37. unsigned long last_scanned;
  38. union ieeetypes_phyparamset phyparamset;
  39. union IEEEtypes_ssparamset ssparamset;
  40. struct ieeetypes_countryinfofullset countryinfo;
  41. u8 wpa_ie[MAX_WPA_IE_LEN];
  42. size_t wpa_ie_len;
  43. u8 rsn_ie[MAX_WPA_IE_LEN];
  44. size_t rsn_ie_len;
  45. u8 mesh;
  46. struct list_head list;
  47. };
  48. int lbs_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len);
  49. struct bss_descriptor *lbs_find_ssid_in_list(struct lbs_private *priv,
  50. u8 *ssid, u8 ssid_len, u8 *bssid, u8 mode,
  51. int channel);
  52. struct bss_descriptor *lbs_find_bssid_in_list(struct lbs_private *priv,
  53. u8 *bssid, u8 mode);
  54. int lbs_find_best_network_ssid(struct lbs_private *priv, u8 *out_ssid,
  55. u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode);
  56. int lbs_send_specific_ssid_scan(struct lbs_private *priv, u8 *ssid,
  57. u8 ssid_len);
  58. int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
  59. struct iw_point *dwrq, char *extra);
  60. int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
  61. union iwreq_data *wrqu, char *extra);
  62. void lbs_scan_worker(struct work_struct *work);
  63. #endif