scan.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. /* receive signal strength in dBm */
  30. long rssi;
  31. u32 channel;
  32. u16 beaconperiod;
  33. u32 atimwindow;
  34. /* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */
  35. u8 mode;
  36. /* zero-terminated array of supported data rates */
  37. u8 rates[MAX_RATES + 1];
  38. unsigned long last_scanned;
  39. union ieeetypes_phyparamset phyparamset;
  40. union IEEEtypes_ssparamset ssparamset;
  41. struct ieeetypes_countryinfofullset countryinfo;
  42. u8 wpa_ie[MAX_WPA_IE_LEN];
  43. size_t wpa_ie_len;
  44. u8 rsn_ie[MAX_WPA_IE_LEN];
  45. size_t rsn_ie_len;
  46. u8 mesh;
  47. struct list_head list;
  48. };
  49. int lbs_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len);
  50. struct bss_descriptor *lbs_find_ssid_in_list(struct lbs_private *priv,
  51. u8 *ssid, u8 ssid_len, u8 *bssid, u8 mode,
  52. int channel);
  53. struct bss_descriptor *lbs_find_bssid_in_list(struct lbs_private *priv,
  54. u8 *bssid, u8 mode);
  55. int lbs_find_best_network_ssid(struct lbs_private *priv, u8 *out_ssid,
  56. u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode);
  57. int lbs_send_specific_ssid_scan(struct lbs_private *priv, u8 *ssid,
  58. u8 ssid_len);
  59. int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
  60. struct iw_point *dwrq, char *extra);
  61. int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
  62. union iwreq_data *wrqu, char *extra);
  63. void lbs_scan_worker(struct work_struct *work);
  64. #endif