wl_cfgscan.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * Header for Linux cfg80211 scan
  3. *
  4. * Portions of this code are copyright (c) 2020 Cypress Semiconductor Corporation
  5. *
  6. * Copyright (C) 1999-2020, Broadcom Corporation
  7. *
  8. * Unless you and Broadcom execute a separate written software license
  9. * agreement governing use of this software, this software is licensed to you
  10. * under the terms of the GNU General Public License version 2 (the "GPL"),
  11. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  12. * following added to such license:
  13. *
  14. * As a special exception, the copyright holders of this software give you
  15. * permission to link this software with independent modules, and to copy and
  16. * distribute the resulting executable under terms of your choice, provided that
  17. * you also meet, for each linked independent module, the terms and conditions of
  18. * the license of that module. An independent module is a module which is not
  19. * derived from this software. The special exception does not apply to any
  20. * modifications of the software.
  21. *
  22. * Notwithstanding the above, under no circumstances may you combine this
  23. * software in any way with any other Broadcom software provided under a license
  24. * other than the GPL, without Broadcom's express prior written consent.
  25. *
  26. *
  27. * <<Broadcom-WL-IPTag/Open:>>
  28. *
  29. * $Id$
  30. */
  31. #ifndef _wl_cfgscan_h_
  32. #define _wl_cfgscan_h_
  33. #include <linux/wireless.h>
  34. #include <typedefs.h>
  35. #include <ethernet.h>
  36. #include <wlioctl.h>
  37. #include <linux/wireless.h>
  38. #include <net/cfg80211.h>
  39. #include <linux/rfkill.h>
  40. #include <osl.h>
  41. #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
  42. #define GET_SCAN_WDEV(scan_request) \
  43. (scan_request && scan_request->dev) ? scan_request->dev->ieee80211_ptr : NULL;
  44. #else
  45. #define GET_SCAN_WDEV(scan_request) \
  46. scan_request ? scan_request->wdev : NULL;
  47. #endif // endif
  48. #ifdef WL_SCHED_SCAN
  49. #define GET_SCHED_SCAN_WDEV(scan_request) \
  50. (scan_request && scan_request->dev) ? scan_request->dev->ieee80211_ptr : NULL;
  51. #endif /* WL_SCHED_SCAN */
  52. extern s32 wl_escan_handler(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
  53. const wl_event_msg_t *e, void *data);
  54. extern s32 wl_do_escan(struct bcm_cfg80211 *cfg, struct wiphy *wiphy,
  55. struct net_device *ndev, struct cfg80211_scan_request *request);
  56. extern s32 __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
  57. struct cfg80211_scan_request *request, struct cfg80211_ssid *this_ssid);
  58. #if defined(WL_CFG80211_P2P_DEV_IF)
  59. extern s32 wl_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request);
  60. #else
  61. extern s32 wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
  62. struct cfg80211_scan_request *request);
  63. extern int wl_cfg80211_scan_stop(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev);
  64. #endif /* WL_CFG80211_P2P_DEV_IF */
  65. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0))
  66. extern void wl_cfg80211_abort_scan(struct wiphy *wiphy, struct wireless_dev *wdev);
  67. #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)) */
  68. extern void wl_cfg80211_scan_abort(struct bcm_cfg80211 *cfg);
  69. extern s32 wl_init_scan(struct bcm_cfg80211 *cfg);
  70. extern int wl_cfg80211_scan_stop(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev);
  71. extern s32 wl_notify_scan_status(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
  72. const wl_event_msg_t *e, void *data);
  73. extern void wl_cfg80211_set_passive_scan(struct net_device *dev, char *command);
  74. #ifdef PNO_SUPPORT
  75. extern s32 wl_notify_pfn_status(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
  76. const wl_event_msg_t *e, void *data);
  77. #endif /* PNO_SUPPORT */
  78. #ifdef GSCAN_SUPPORT
  79. extern s32 wl_notify_gscan_event(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
  80. const wl_event_msg_t *e, void *data);
  81. #endif /* GSCAN_SUPPORT */
  82. #ifdef WES_SUPPORT
  83. #ifdef CUSTOMER_SCAN_TIMEOUT_SETTING
  84. #define CUSTOMER_WL_SCAN_TIMER_INTERVAL_MS 25000 /* Scan timeout */
  85. enum wl_custom_scan_time_type {
  86. WL_CUSTOM_SCAN_CHANNEL_TIME = 0,
  87. WL_CUSTOM_SCAN_UNASSOC_TIME,
  88. WL_CUSTOM_SCAN_PASSIVE_TIME,
  89. WL_CUSTOM_SCAN_HOME_TIME,
  90. WL_CUSTOM_SCAN_HOME_AWAY_TIME
  91. };
  92. extern s32 wl_cfg80211_custom_scan_time(struct net_device *dev,
  93. enum wl_custom_scan_time_type type, int time);
  94. #endif /* CUSTOMER_SCAN_TIMEOUT_SETTING */
  95. #endif /* WES_SUPPORT */
  96. #if defined(SUPPORT_RANDOM_MAC_SCAN)
  97. int wl_cfg80211_set_random_mac(struct net_device *dev, bool enable);
  98. int wl_cfg80211_random_mac_enable(struct net_device *dev);
  99. int wl_cfg80211_random_mac_disable(struct net_device *dev);
  100. int wl_cfg80211_scan_mac_enable(struct net_device *dev, uint8 *rand_mac, uint8 *rand_mask);
  101. int wl_cfg80211_scan_mac_disable(struct net_device *dev);
  102. #endif /* SUPPORT_RANDOM_MAC_SCAN */
  103. #ifdef WL_SCHED_SCAN
  104. extern int wl_cfg80211_sched_scan_start(struct wiphy *wiphy, struct net_device *dev,
  105. struct cfg80211_sched_scan_request *request);
  106. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0))
  107. int
  108. wl_cfg80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev, u64 req);
  109. #else
  110. int wl_cfg80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev);
  111. #endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(4, 11, 0) */
  112. #endif /* WL_SCHED_SCAN */
  113. #endif /* _wl_cfgscan_h_ */