core.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Wireless configuration interface internals.
  4. *
  5. * Copyright 2006-2010 Johannes Berg <[email protected]>
  6. * Copyright (C) 2018-2022 Intel Corporation
  7. */
  8. #ifndef __NET_WIRELESS_CORE_H
  9. #define __NET_WIRELESS_CORE_H
  10. #include <linux/list.h>
  11. #include <linux/netdevice.h>
  12. #include <linux/rbtree.h>
  13. #include <linux/debugfs.h>
  14. #include <linux/rfkill.h>
  15. #include <linux/workqueue.h>
  16. #include <linux/rtnetlink.h>
  17. #include <net/genetlink.h>
  18. #include <net/cfg80211.h>
  19. #include "reg.h"
  20. #define WIPHY_IDX_INVALID -1
  21. struct cfg80211_registered_device {
  22. const struct cfg80211_ops *ops;
  23. struct list_head list;
  24. /* rfkill support */
  25. struct rfkill_ops rfkill_ops;
  26. struct work_struct rfkill_block;
  27. /* ISO / IEC 3166 alpha2 for which this device is receiving
  28. * country IEs on, this can help disregard country IEs from APs
  29. * on the same alpha2 quickly. The alpha2 may differ from
  30. * cfg80211_regdomain's alpha2 when an intersection has occurred.
  31. * If the AP is reconfigured this can also be used to tell us if
  32. * the country on the country IE changed. */
  33. char country_ie_alpha2[2];
  34. /*
  35. * the driver requests the regulatory core to set this regulatory
  36. * domain as the wiphy's. Only used for %REGULATORY_WIPHY_SELF_MANAGED
  37. * devices using the regulatory_set_wiphy_regd() API
  38. */
  39. const struct ieee80211_regdomain *requested_regd;
  40. /* If a Country IE has been received this tells us the environment
  41. * which its telling us its in. This defaults to ENVIRON_ANY */
  42. enum environment_cap env;
  43. /* wiphy index, internal only */
  44. int wiphy_idx;
  45. /* protected by RTNL */
  46. int devlist_generation, wdev_id;
  47. int opencount;
  48. wait_queue_head_t dev_wait;
  49. struct list_head beacon_registrations;
  50. spinlock_t beacon_registrations_lock;
  51. /* protected by RTNL only */
  52. int num_running_ifaces;
  53. int num_running_monitor_ifaces;
  54. u64 cookie_counter;
  55. /* BSSes/scanning */
  56. spinlock_t bss_lock;
  57. struct list_head bss_list;
  58. struct rb_root bss_tree;
  59. u32 bss_generation;
  60. u32 bss_entries;
  61. struct cfg80211_scan_request *scan_req; /* protected by RTNL */
  62. struct cfg80211_scan_request *int_scan_req;
  63. struct sk_buff *scan_msg;
  64. struct list_head sched_scan_req_list;
  65. time64_t suspend_at;
  66. struct work_struct scan_done_wk;
  67. struct genl_info *cur_cmd_info;
  68. struct work_struct conn_work;
  69. struct work_struct event_work;
  70. struct delayed_work dfs_update_channels_wk;
  71. struct wireless_dev *background_radar_wdev;
  72. struct cfg80211_chan_def background_radar_chandef;
  73. struct delayed_work background_cac_done_wk;
  74. struct work_struct background_cac_abort_wk;
  75. /* netlink port which started critical protocol (0 means not started) */
  76. u32 crit_proto_nlportid;
  77. struct cfg80211_coalesce *coalesce;
  78. struct work_struct destroy_work;
  79. struct work_struct sched_scan_stop_wk;
  80. struct work_struct sched_scan_res_wk;
  81. struct cfg80211_chan_def radar_chandef;
  82. struct work_struct propagate_radar_detect_wk;
  83. struct cfg80211_chan_def cac_done_chandef;
  84. struct work_struct propagate_cac_done_wk;
  85. struct work_struct mgmt_registrations_update_wk;
  86. /* lock for all wdev lists */
  87. spinlock_t mgmt_registrations_lock;
  88. struct work_struct wiphy_work;
  89. struct list_head wiphy_work_list;
  90. /* protects the list above */
  91. spinlock_t wiphy_work_lock;
  92. bool suspended;
  93. /* must be last because of the way we do wiphy_priv(),
  94. * and it should at least be aligned to NETDEV_ALIGN */
  95. struct wiphy wiphy __aligned(NETDEV_ALIGN);
  96. };
  97. static inline
  98. struct cfg80211_registered_device *wiphy_to_rdev(struct wiphy *wiphy)
  99. {
  100. BUG_ON(!wiphy);
  101. return container_of(wiphy, struct cfg80211_registered_device, wiphy);
  102. }
  103. static inline void
  104. cfg80211_rdev_free_wowlan(struct cfg80211_registered_device *rdev)
  105. {
  106. #ifdef CONFIG_PM
  107. int i;
  108. if (!rdev->wiphy.wowlan_config)
  109. return;
  110. for (i = 0; i < rdev->wiphy.wowlan_config->n_patterns; i++)
  111. kfree(rdev->wiphy.wowlan_config->patterns[i].mask);
  112. kfree(rdev->wiphy.wowlan_config->patterns);
  113. if (rdev->wiphy.wowlan_config->tcp &&
  114. rdev->wiphy.wowlan_config->tcp->sock)
  115. sock_release(rdev->wiphy.wowlan_config->tcp->sock);
  116. kfree(rdev->wiphy.wowlan_config->tcp);
  117. kfree(rdev->wiphy.wowlan_config->nd_config);
  118. kfree(rdev->wiphy.wowlan_config);
  119. #endif
  120. }
  121. static inline u64 cfg80211_assign_cookie(struct cfg80211_registered_device *rdev)
  122. {
  123. u64 r = ++rdev->cookie_counter;
  124. if (WARN_ON(r == 0))
  125. r = ++rdev->cookie_counter;
  126. return r;
  127. }
  128. extern struct workqueue_struct *cfg80211_wq;
  129. extern struct list_head cfg80211_rdev_list;
  130. extern int cfg80211_rdev_list_generation;
  131. struct cfg80211_internal_bss {
  132. struct list_head list;
  133. struct list_head hidden_list;
  134. struct rb_node rbn;
  135. u64 ts_boottime;
  136. unsigned long ts;
  137. unsigned long refcount;
  138. atomic_t hold;
  139. /* time at the start of the reception of the first octet of the
  140. * timestamp field of the last beacon/probe received for this BSS.
  141. * The time is the TSF of the BSS specified by %parent_bssid.
  142. */
  143. u64 parent_tsf;
  144. /* the BSS according to which %parent_tsf is set. This is set to
  145. * the BSS that the interface that requested the scan was connected to
  146. * when the beacon/probe was received.
  147. */
  148. u8 parent_bssid[ETH_ALEN] __aligned(2);
  149. /* must be last because of priv member */
  150. struct cfg80211_bss pub;
  151. };
  152. static inline struct cfg80211_internal_bss *bss_from_pub(struct cfg80211_bss *pub)
  153. {
  154. return container_of(pub, struct cfg80211_internal_bss, pub);
  155. }
  156. static inline void cfg80211_hold_bss(struct cfg80211_internal_bss *bss)
  157. {
  158. atomic_inc(&bss->hold);
  159. if (bss->pub.transmitted_bss) {
  160. bss = container_of(bss->pub.transmitted_bss,
  161. struct cfg80211_internal_bss, pub);
  162. atomic_inc(&bss->hold);
  163. }
  164. }
  165. static inline void cfg80211_unhold_bss(struct cfg80211_internal_bss *bss)
  166. {
  167. int r = atomic_dec_return(&bss->hold);
  168. WARN_ON(r < 0);
  169. if (bss->pub.transmitted_bss) {
  170. bss = container_of(bss->pub.transmitted_bss,
  171. struct cfg80211_internal_bss, pub);
  172. r = atomic_dec_return(&bss->hold);
  173. WARN_ON(r < 0);
  174. }
  175. }
  176. struct cfg80211_registered_device *cfg80211_rdev_by_wiphy_idx(int wiphy_idx);
  177. int get_wiphy_idx(struct wiphy *wiphy);
  178. struct wiphy *wiphy_idx_to_wiphy(int wiphy_idx);
  179. int cfg80211_switch_netns(struct cfg80211_registered_device *rdev,
  180. struct net *net);
  181. void cfg80211_init_wdev(struct wireless_dev *wdev);
  182. void cfg80211_register_wdev(struct cfg80211_registered_device *rdev,
  183. struct wireless_dev *wdev);
  184. static inline void wdev_lock(struct wireless_dev *wdev)
  185. __acquires(wdev)
  186. {
  187. mutex_lock(&wdev->mtx);
  188. __acquire(wdev->mtx);
  189. }
  190. static inline void wdev_unlock(struct wireless_dev *wdev)
  191. __releases(wdev)
  192. {
  193. __release(wdev->mtx);
  194. mutex_unlock(&wdev->mtx);
  195. }
  196. #define ASSERT_WDEV_LOCK(wdev) lockdep_assert_held(&(wdev)->mtx)
  197. static inline bool cfg80211_has_monitors_only(struct cfg80211_registered_device *rdev)
  198. {
  199. lockdep_assert_held(&rdev->wiphy.mtx);
  200. return rdev->num_running_ifaces == rdev->num_running_monitor_ifaces &&
  201. rdev->num_running_ifaces > 0;
  202. }
  203. enum cfg80211_event_type {
  204. EVENT_CONNECT_RESULT,
  205. EVENT_ROAMED,
  206. EVENT_DISCONNECTED,
  207. EVENT_IBSS_JOINED,
  208. EVENT_STOPPED,
  209. EVENT_PORT_AUTHORIZED,
  210. };
  211. struct cfg80211_event {
  212. struct list_head list;
  213. enum cfg80211_event_type type;
  214. union {
  215. struct cfg80211_connect_resp_params cr;
  216. struct cfg80211_roam_info rm;
  217. struct {
  218. const u8 *ie;
  219. size_t ie_len;
  220. u16 reason;
  221. bool locally_generated;
  222. } dc;
  223. struct {
  224. u8 bssid[ETH_ALEN];
  225. struct ieee80211_channel *channel;
  226. } ij;
  227. struct {
  228. u8 peer_addr[ETH_ALEN];
  229. const u8 *td_bitmap;
  230. u8 td_bitmap_len;
  231. } pa;
  232. };
  233. };
  234. struct cfg80211_cached_keys {
  235. struct key_params params[CFG80211_MAX_WEP_KEYS];
  236. u8 data[CFG80211_MAX_WEP_KEYS][WLAN_KEY_LEN_WEP104];
  237. int def;
  238. };
  239. struct cfg80211_beacon_registration {
  240. struct list_head list;
  241. u32 nlportid;
  242. };
  243. struct cfg80211_cqm_config {
  244. u32 rssi_hyst;
  245. s32 last_rssi_event_value;
  246. int n_rssi_thresholds;
  247. s32 rssi_thresholds[];
  248. };
  249. void cfg80211_destroy_ifaces(struct cfg80211_registered_device *rdev);
  250. /* free object */
  251. void cfg80211_dev_free(struct cfg80211_registered_device *rdev);
  252. int cfg80211_dev_rename(struct cfg80211_registered_device *rdev,
  253. char *newname);
  254. void ieee80211_set_bitrate_flags(struct wiphy *wiphy);
  255. void cfg80211_bss_expire(struct cfg80211_registered_device *rdev);
  256. void cfg80211_bss_age(struct cfg80211_registered_device *rdev,
  257. unsigned long age_secs);
  258. void cfg80211_update_assoc_bss_entry(struct wireless_dev *wdev,
  259. unsigned int link,
  260. struct ieee80211_channel *channel);
  261. /* IBSS */
  262. int __cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
  263. struct net_device *dev,
  264. struct cfg80211_ibss_params *params,
  265. struct cfg80211_cached_keys *connkeys);
  266. void cfg80211_clear_ibss(struct net_device *dev, bool nowext);
  267. int __cfg80211_leave_ibss(struct cfg80211_registered_device *rdev,
  268. struct net_device *dev, bool nowext);
  269. int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev,
  270. struct net_device *dev, bool nowext);
  271. void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid,
  272. struct ieee80211_channel *channel);
  273. int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev,
  274. struct wireless_dev *wdev);
  275. /* mesh */
  276. extern const struct mesh_config default_mesh_config;
  277. extern const struct mesh_setup default_mesh_setup;
  278. int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
  279. struct net_device *dev,
  280. struct mesh_setup *setup,
  281. const struct mesh_config *conf);
  282. int __cfg80211_leave_mesh(struct cfg80211_registered_device *rdev,
  283. struct net_device *dev);
  284. int cfg80211_leave_mesh(struct cfg80211_registered_device *rdev,
  285. struct net_device *dev);
  286. int cfg80211_set_mesh_channel(struct cfg80211_registered_device *rdev,
  287. struct wireless_dev *wdev,
  288. struct cfg80211_chan_def *chandef);
  289. /* OCB */
  290. int __cfg80211_join_ocb(struct cfg80211_registered_device *rdev,
  291. struct net_device *dev,
  292. struct ocb_setup *setup);
  293. int cfg80211_join_ocb(struct cfg80211_registered_device *rdev,
  294. struct net_device *dev,
  295. struct ocb_setup *setup);
  296. int __cfg80211_leave_ocb(struct cfg80211_registered_device *rdev,
  297. struct net_device *dev);
  298. int cfg80211_leave_ocb(struct cfg80211_registered_device *rdev,
  299. struct net_device *dev);
  300. /* AP */
  301. int __cfg80211_stop_ap(struct cfg80211_registered_device *rdev,
  302. struct net_device *dev, int link,
  303. bool notify);
  304. int cfg80211_stop_ap(struct cfg80211_registered_device *rdev,
  305. struct net_device *dev, int link,
  306. bool notify);
  307. /* MLME */
  308. int cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
  309. struct net_device *dev,
  310. struct cfg80211_auth_request *req);
  311. int cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
  312. struct net_device *dev,
  313. struct cfg80211_assoc_request *req);
  314. int cfg80211_mlme_deauth(struct cfg80211_registered_device *rdev,
  315. struct net_device *dev, const u8 *bssid,
  316. const u8 *ie, int ie_len, u16 reason,
  317. bool local_state_change);
  318. int cfg80211_mlme_disassoc(struct cfg80211_registered_device *rdev,
  319. struct net_device *dev, const u8 *ap_addr,
  320. const u8 *ie, int ie_len, u16 reason,
  321. bool local_state_change);
  322. void cfg80211_mlme_down(struct cfg80211_registered_device *rdev,
  323. struct net_device *dev);
  324. int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid,
  325. u16 frame_type, const u8 *match_data,
  326. int match_len, bool multicast_rx,
  327. struct netlink_ext_ack *extack);
  328. void cfg80211_mgmt_registrations_update_wk(struct work_struct *wk);
  329. void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid);
  330. void cfg80211_mlme_purge_registrations(struct wireless_dev *wdev);
  331. int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
  332. struct wireless_dev *wdev,
  333. struct cfg80211_mgmt_tx_params *params,
  334. u64 *cookie);
  335. void cfg80211_oper_and_ht_capa(struct ieee80211_ht_cap *ht_capa,
  336. const struct ieee80211_ht_cap *ht_capa_mask);
  337. void cfg80211_oper_and_vht_capa(struct ieee80211_vht_cap *vht_capa,
  338. const struct ieee80211_vht_cap *vht_capa_mask);
  339. /* SME events */
  340. int cfg80211_connect(struct cfg80211_registered_device *rdev,
  341. struct net_device *dev,
  342. struct cfg80211_connect_params *connect,
  343. struct cfg80211_cached_keys *connkeys,
  344. const u8 *prev_bssid);
  345. void __cfg80211_connect_result(struct net_device *dev,
  346. struct cfg80211_connect_resp_params *params,
  347. bool wextev);
  348. void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,
  349. size_t ie_len, u16 reason, bool from_ap);
  350. int cfg80211_disconnect(struct cfg80211_registered_device *rdev,
  351. struct net_device *dev, u16 reason,
  352. bool wextev);
  353. void __cfg80211_roamed(struct wireless_dev *wdev,
  354. struct cfg80211_roam_info *info);
  355. void __cfg80211_port_authorized(struct wireless_dev *wdev, const u8 *peer_addr,
  356. const u8 *td_bitmap, u8 td_bitmap_len);
  357. int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev,
  358. struct wireless_dev *wdev);
  359. void cfg80211_autodisconnect_wk(struct work_struct *work);
  360. /* SME implementation */
  361. void cfg80211_conn_work(struct work_struct *work);
  362. void cfg80211_sme_scan_done(struct net_device *dev);
  363. bool cfg80211_sme_rx_assoc_resp(struct wireless_dev *wdev, u16 status);
  364. void cfg80211_sme_rx_auth(struct wireless_dev *wdev, const u8 *buf, size_t len);
  365. void cfg80211_sme_disassoc(struct wireless_dev *wdev);
  366. void cfg80211_sme_deauth(struct wireless_dev *wdev);
  367. void cfg80211_sme_auth_timeout(struct wireless_dev *wdev);
  368. void cfg80211_sme_assoc_timeout(struct wireless_dev *wdev);
  369. void cfg80211_sme_abandon_assoc(struct wireless_dev *wdev);
  370. /* internal helpers */
  371. bool cfg80211_supported_cipher_suite(struct wiphy *wiphy, u32 cipher);
  372. bool cfg80211_valid_key_idx(struct cfg80211_registered_device *rdev,
  373. int key_idx, bool pairwise);
  374. int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
  375. struct key_params *params, int key_idx,
  376. bool pairwise, const u8 *mac_addr);
  377. void __cfg80211_scan_done(struct work_struct *wk);
  378. void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev,
  379. bool send_message);
  380. void cfg80211_add_sched_scan_req(struct cfg80211_registered_device *rdev,
  381. struct cfg80211_sched_scan_request *req);
  382. int cfg80211_sched_scan_req_possible(struct cfg80211_registered_device *rdev,
  383. bool want_multi);
  384. void cfg80211_sched_scan_results_wk(struct work_struct *work);
  385. int cfg80211_stop_sched_scan_req(struct cfg80211_registered_device *rdev,
  386. struct cfg80211_sched_scan_request *req,
  387. bool driver_initiated);
  388. int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev,
  389. u64 reqid, bool driver_initiated);
  390. void cfg80211_upload_connect_keys(struct wireless_dev *wdev);
  391. int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
  392. struct net_device *dev, enum nl80211_iftype ntype,
  393. struct vif_params *params);
  394. void cfg80211_process_rdev_events(struct cfg80211_registered_device *rdev);
  395. void cfg80211_process_wiphy_works(struct cfg80211_registered_device *rdev,
  396. struct wiphy_work *end);
  397. void cfg80211_process_wdev_events(struct wireless_dev *wdev);
  398. bool cfg80211_does_bw_fit_range(const struct ieee80211_freq_range *freq_range,
  399. u32 center_freq_khz, u32 bw_khz);
  400. int cfg80211_scan(struct cfg80211_registered_device *rdev);
  401. extern struct work_struct cfg80211_disconnect_work;
  402. /**
  403. * cfg80211_chandef_dfs_usable - checks if chandef is DFS usable
  404. * @wiphy: the wiphy to validate against
  405. * @chandef: the channel definition to check
  406. *
  407. * Checks if chandef is usable and we can/need start CAC on such channel.
  408. *
  409. * Return: true if all channels available and at least
  410. * one channel requires CAC (NL80211_DFS_USABLE)
  411. */
  412. bool cfg80211_chandef_dfs_usable(struct wiphy *wiphy,
  413. const struct cfg80211_chan_def *chandef);
  414. void cfg80211_set_dfs_state(struct wiphy *wiphy,
  415. const struct cfg80211_chan_def *chandef,
  416. enum nl80211_dfs_state dfs_state);
  417. void cfg80211_dfs_channels_update_work(struct work_struct *work);
  418. unsigned int
  419. cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy,
  420. const struct cfg80211_chan_def *chandef);
  421. void cfg80211_sched_dfs_chan_update(struct cfg80211_registered_device *rdev);
  422. int
  423. cfg80211_start_background_radar_detection(struct cfg80211_registered_device *rdev,
  424. struct wireless_dev *wdev,
  425. struct cfg80211_chan_def *chandef);
  426. void cfg80211_stop_background_radar_detection(struct wireless_dev *wdev);
  427. void cfg80211_background_cac_done_wk(struct work_struct *work);
  428. void cfg80211_background_cac_abort_wk(struct work_struct *work);
  429. bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy,
  430. struct ieee80211_channel *chan);
  431. bool cfg80211_beaconing_iface_active(struct wireless_dev *wdev);
  432. bool cfg80211_is_sub_chan(struct cfg80211_chan_def *chandef,
  433. struct ieee80211_channel *chan,
  434. bool primary_only);
  435. bool cfg80211_wdev_on_sub_chan(struct wireless_dev *wdev,
  436. struct ieee80211_channel *chan,
  437. bool primary_only);
  438. static inline unsigned int elapsed_jiffies_msecs(unsigned long start)
  439. {
  440. unsigned long end = jiffies;
  441. if (end >= start)
  442. return jiffies_to_msecs(end - start);
  443. return jiffies_to_msecs(end + (ULONG_MAX - start) + 1);
  444. }
  445. int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev,
  446. struct cfg80211_chan_def *chandef);
  447. int ieee80211_get_ratemask(struct ieee80211_supported_band *sband,
  448. const u8 *rates, unsigned int n_rates,
  449. u32 *mask);
  450. int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev,
  451. enum nl80211_iftype iftype, u32 beacon_int);
  452. void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev,
  453. enum nl80211_iftype iftype, int num);
  454. void __cfg80211_leave(struct cfg80211_registered_device *rdev,
  455. struct wireless_dev *wdev);
  456. void cfg80211_leave(struct cfg80211_registered_device *rdev,
  457. struct wireless_dev *wdev);
  458. void cfg80211_stop_p2p_device(struct cfg80211_registered_device *rdev,
  459. struct wireless_dev *wdev);
  460. void cfg80211_stop_nan(struct cfg80211_registered_device *rdev,
  461. struct wireless_dev *wdev);
  462. struct cfg80211_internal_bss *
  463. cfg80211_bss_update(struct cfg80211_registered_device *rdev,
  464. struct cfg80211_internal_bss *tmp,
  465. bool signal_valid, unsigned long ts);
  466. #ifdef CONFIG_CFG80211_DEVELOPER_WARNINGS
  467. #define CFG80211_DEV_WARN_ON(cond) WARN_ON(cond)
  468. #else
  469. /*
  470. * Trick to enable using it as a condition,
  471. * and also not give a warning when it's
  472. * not used that way.
  473. */
  474. #define CFG80211_DEV_WARN_ON(cond) ({bool __r = (cond); __r; })
  475. #endif
  476. void cfg80211_cqm_config_free(struct wireless_dev *wdev);
  477. void cfg80211_release_pmsr(struct wireless_dev *wdev, u32 portid);
  478. void cfg80211_pmsr_wdev_down(struct wireless_dev *wdev);
  479. void cfg80211_pmsr_free_wk(struct work_struct *work);
  480. void cfg80211_remove_link(struct wireless_dev *wdev, unsigned int link_id);
  481. void cfg80211_remove_links(struct wireless_dev *wdev);
  482. int cfg80211_remove_virtual_intf(struct cfg80211_registered_device *rdev,
  483. struct wireless_dev *wdev);
  484. #endif /* __NET_WIRELESS_CORE_H */