Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Wireless configuration interface internals.
0004  *
0005  * Copyright 2006-2010  Johannes Berg <johannes@sipsolutions.net>
0006  * Copyright (C) 2018-2022 Intel Corporation
0007  */
0008 #ifndef __NET_WIRELESS_CORE_H
0009 #define __NET_WIRELESS_CORE_H
0010 #include <linux/list.h>
0011 #include <linux/netdevice.h>
0012 #include <linux/rbtree.h>
0013 #include <linux/debugfs.h>
0014 #include <linux/rfkill.h>
0015 #include <linux/workqueue.h>
0016 #include <linux/rtnetlink.h>
0017 #include <net/genetlink.h>
0018 #include <net/cfg80211.h>
0019 #include "reg.h"
0020 
0021 
0022 #define WIPHY_IDX_INVALID   -1
0023 
0024 struct cfg80211_registered_device {
0025     const struct cfg80211_ops *ops;
0026     struct list_head list;
0027 
0028     /* rfkill support */
0029     struct rfkill_ops rfkill_ops;
0030     struct work_struct rfkill_block;
0031 
0032     /* ISO / IEC 3166 alpha2 for which this device is receiving
0033      * country IEs on, this can help disregard country IEs from APs
0034      * on the same alpha2 quickly. The alpha2 may differ from
0035      * cfg80211_regdomain's alpha2 when an intersection has occurred.
0036      * If the AP is reconfigured this can also be used to tell us if
0037      * the country on the country IE changed. */
0038     char country_ie_alpha2[2];
0039 
0040     /*
0041      * the driver requests the regulatory core to set this regulatory
0042      * domain as the wiphy's. Only used for %REGULATORY_WIPHY_SELF_MANAGED
0043      * devices using the regulatory_set_wiphy_regd() API
0044      */
0045     const struct ieee80211_regdomain *requested_regd;
0046 
0047     /* If a Country IE has been received this tells us the environment
0048      * which its telling us its in. This defaults to ENVIRON_ANY */
0049     enum environment_cap env;
0050 
0051     /* wiphy index, internal only */
0052     int wiphy_idx;
0053 
0054     /* protected by RTNL */
0055     int devlist_generation, wdev_id;
0056     int opencount;
0057     wait_queue_head_t dev_wait;
0058 
0059     struct list_head beacon_registrations;
0060     spinlock_t beacon_registrations_lock;
0061 
0062     /* protected by RTNL only */
0063     int num_running_ifaces;
0064     int num_running_monitor_ifaces;
0065     u64 cookie_counter;
0066 
0067     /* BSSes/scanning */
0068     spinlock_t bss_lock;
0069     struct list_head bss_list;
0070     struct rb_root bss_tree;
0071     u32 bss_generation;
0072     u32 bss_entries;
0073     struct cfg80211_scan_request *scan_req; /* protected by RTNL */
0074     struct cfg80211_scan_request *int_scan_req;
0075     struct sk_buff *scan_msg;
0076     struct list_head sched_scan_req_list;
0077     time64_t suspend_at;
0078     struct work_struct scan_done_wk;
0079 
0080     struct genl_info *cur_cmd_info;
0081 
0082     struct work_struct conn_work;
0083     struct work_struct event_work;
0084 
0085     struct delayed_work dfs_update_channels_wk;
0086 
0087     struct wireless_dev *background_radar_wdev;
0088     struct cfg80211_chan_def background_radar_chandef;
0089     struct delayed_work background_cac_done_wk;
0090     struct work_struct background_cac_abort_wk;
0091 
0092     /* netlink port which started critical protocol (0 means not started) */
0093     u32 crit_proto_nlportid;
0094 
0095     struct cfg80211_coalesce *coalesce;
0096 
0097     struct work_struct destroy_work;
0098     struct work_struct sched_scan_stop_wk;
0099     struct work_struct sched_scan_res_wk;
0100 
0101     struct cfg80211_chan_def radar_chandef;
0102     struct work_struct propagate_radar_detect_wk;
0103 
0104     struct cfg80211_chan_def cac_done_chandef;
0105     struct work_struct propagate_cac_done_wk;
0106 
0107     struct work_struct mgmt_registrations_update_wk;
0108     /* lock for all wdev lists */
0109     spinlock_t mgmt_registrations_lock;
0110 
0111     /* must be last because of the way we do wiphy_priv(),
0112      * and it should at least be aligned to NETDEV_ALIGN */
0113     struct wiphy wiphy __aligned(NETDEV_ALIGN);
0114 };
0115 
0116 static inline
0117 struct cfg80211_registered_device *wiphy_to_rdev(struct wiphy *wiphy)
0118 {
0119     BUG_ON(!wiphy);
0120     return container_of(wiphy, struct cfg80211_registered_device, wiphy);
0121 }
0122 
0123 static inline void
0124 cfg80211_rdev_free_wowlan(struct cfg80211_registered_device *rdev)
0125 {
0126 #ifdef CONFIG_PM
0127     int i;
0128 
0129     if (!rdev->wiphy.wowlan_config)
0130         return;
0131     for (i = 0; i < rdev->wiphy.wowlan_config->n_patterns; i++)
0132         kfree(rdev->wiphy.wowlan_config->patterns[i].mask);
0133     kfree(rdev->wiphy.wowlan_config->patterns);
0134     if (rdev->wiphy.wowlan_config->tcp &&
0135         rdev->wiphy.wowlan_config->tcp->sock)
0136         sock_release(rdev->wiphy.wowlan_config->tcp->sock);
0137     kfree(rdev->wiphy.wowlan_config->tcp);
0138     kfree(rdev->wiphy.wowlan_config->nd_config);
0139     kfree(rdev->wiphy.wowlan_config);
0140 #endif
0141 }
0142 
0143 static inline u64 cfg80211_assign_cookie(struct cfg80211_registered_device *rdev)
0144 {
0145     u64 r = ++rdev->cookie_counter;
0146 
0147     if (WARN_ON(r == 0))
0148         r = ++rdev->cookie_counter;
0149 
0150     return r;
0151 }
0152 
0153 extern struct workqueue_struct *cfg80211_wq;
0154 extern struct list_head cfg80211_rdev_list;
0155 extern int cfg80211_rdev_list_generation;
0156 
0157 struct cfg80211_internal_bss {
0158     struct list_head list;
0159     struct list_head hidden_list;
0160     struct rb_node rbn;
0161     u64 ts_boottime;
0162     unsigned long ts;
0163     unsigned long refcount;
0164     atomic_t hold;
0165 
0166     /* time at the start of the reception of the first octet of the
0167      * timestamp field of the last beacon/probe received for this BSS.
0168      * The time is the TSF of the BSS specified by %parent_bssid.
0169      */
0170     u64 parent_tsf;
0171 
0172     /* the BSS according to which %parent_tsf is set. This is set to
0173      * the BSS that the interface that requested the scan was connected to
0174      * when the beacon/probe was received.
0175      */
0176     u8 parent_bssid[ETH_ALEN] __aligned(2);
0177 
0178     /* must be last because of priv member */
0179     struct cfg80211_bss pub;
0180 };
0181 
0182 static inline struct cfg80211_internal_bss *bss_from_pub(struct cfg80211_bss *pub)
0183 {
0184     return container_of(pub, struct cfg80211_internal_bss, pub);
0185 }
0186 
0187 static inline void cfg80211_hold_bss(struct cfg80211_internal_bss *bss)
0188 {
0189     atomic_inc(&bss->hold);
0190     if (bss->pub.transmitted_bss) {
0191         bss = container_of(bss->pub.transmitted_bss,
0192                    struct cfg80211_internal_bss, pub);
0193         atomic_inc(&bss->hold);
0194     }
0195 }
0196 
0197 static inline void cfg80211_unhold_bss(struct cfg80211_internal_bss *bss)
0198 {
0199     int r = atomic_dec_return(&bss->hold);
0200     WARN_ON(r < 0);
0201     if (bss->pub.transmitted_bss) {
0202         bss = container_of(bss->pub.transmitted_bss,
0203                    struct cfg80211_internal_bss, pub);
0204         r = atomic_dec_return(&bss->hold);
0205         WARN_ON(r < 0);
0206     }
0207 }
0208 
0209 
0210 struct cfg80211_registered_device *cfg80211_rdev_by_wiphy_idx(int wiphy_idx);
0211 int get_wiphy_idx(struct wiphy *wiphy);
0212 
0213 struct wiphy *wiphy_idx_to_wiphy(int wiphy_idx);
0214 
0215 int cfg80211_switch_netns(struct cfg80211_registered_device *rdev,
0216               struct net *net);
0217 
0218 void cfg80211_init_wdev(struct wireless_dev *wdev);
0219 void cfg80211_register_wdev(struct cfg80211_registered_device *rdev,
0220                 struct wireless_dev *wdev);
0221 
0222 static inline void wdev_lock(struct wireless_dev *wdev)
0223     __acquires(wdev)
0224 {
0225     mutex_lock(&wdev->mtx);
0226     __acquire(wdev->mtx);
0227 }
0228 
0229 static inline void wdev_unlock(struct wireless_dev *wdev)
0230     __releases(wdev)
0231 {
0232     __release(wdev->mtx);
0233     mutex_unlock(&wdev->mtx);
0234 }
0235 
0236 #define ASSERT_WDEV_LOCK(wdev) lockdep_assert_held(&(wdev)->mtx)
0237 
0238 static inline bool cfg80211_has_monitors_only(struct cfg80211_registered_device *rdev)
0239 {
0240     lockdep_assert_held(&rdev->wiphy.mtx);
0241 
0242     return rdev->num_running_ifaces == rdev->num_running_monitor_ifaces &&
0243            rdev->num_running_ifaces > 0;
0244 }
0245 
0246 enum cfg80211_event_type {
0247     EVENT_CONNECT_RESULT,
0248     EVENT_ROAMED,
0249     EVENT_DISCONNECTED,
0250     EVENT_IBSS_JOINED,
0251     EVENT_STOPPED,
0252     EVENT_PORT_AUTHORIZED,
0253 };
0254 
0255 struct cfg80211_event {
0256     struct list_head list;
0257     enum cfg80211_event_type type;
0258 
0259     union {
0260         struct cfg80211_connect_resp_params cr;
0261         struct cfg80211_roam_info rm;
0262         struct {
0263             const u8 *ie;
0264             size_t ie_len;
0265             u16 reason;
0266             bool locally_generated;
0267         } dc;
0268         struct {
0269             u8 bssid[ETH_ALEN];
0270             struct ieee80211_channel *channel;
0271         } ij;
0272         struct {
0273             u8 bssid[ETH_ALEN];
0274         } pa;
0275     };
0276 };
0277 
0278 struct cfg80211_cached_keys {
0279     struct key_params params[CFG80211_MAX_WEP_KEYS];
0280     u8 data[CFG80211_MAX_WEP_KEYS][WLAN_KEY_LEN_WEP104];
0281     int def;
0282 };
0283 
0284 struct cfg80211_beacon_registration {
0285     struct list_head list;
0286     u32 nlportid;
0287 };
0288 
0289 struct cfg80211_cqm_config {
0290     u32 rssi_hyst;
0291     s32 last_rssi_event_value;
0292     int n_rssi_thresholds;
0293     s32 rssi_thresholds[];
0294 };
0295 
0296 void cfg80211_destroy_ifaces(struct cfg80211_registered_device *rdev);
0297 
0298 /* free object */
0299 void cfg80211_dev_free(struct cfg80211_registered_device *rdev);
0300 
0301 int cfg80211_dev_rename(struct cfg80211_registered_device *rdev,
0302             char *newname);
0303 
0304 void ieee80211_set_bitrate_flags(struct wiphy *wiphy);
0305 
0306 void cfg80211_bss_expire(struct cfg80211_registered_device *rdev);
0307 void cfg80211_bss_age(struct cfg80211_registered_device *rdev,
0308                       unsigned long age_secs);
0309 void cfg80211_update_assoc_bss_entry(struct wireless_dev *wdev,
0310                      unsigned int link,
0311                      struct ieee80211_channel *channel);
0312 
0313 /* IBSS */
0314 int __cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
0315              struct net_device *dev,
0316              struct cfg80211_ibss_params *params,
0317              struct cfg80211_cached_keys *connkeys);
0318 void cfg80211_clear_ibss(struct net_device *dev, bool nowext);
0319 int __cfg80211_leave_ibss(struct cfg80211_registered_device *rdev,
0320               struct net_device *dev, bool nowext);
0321 int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev,
0322             struct net_device *dev, bool nowext);
0323 void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid,
0324                 struct ieee80211_channel *channel);
0325 int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev,
0326                 struct wireless_dev *wdev);
0327 
0328 /* mesh */
0329 extern const struct mesh_config default_mesh_config;
0330 extern const struct mesh_setup default_mesh_setup;
0331 int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
0332              struct net_device *dev,
0333              struct mesh_setup *setup,
0334              const struct mesh_config *conf);
0335 int __cfg80211_leave_mesh(struct cfg80211_registered_device *rdev,
0336               struct net_device *dev);
0337 int cfg80211_leave_mesh(struct cfg80211_registered_device *rdev,
0338             struct net_device *dev);
0339 int cfg80211_set_mesh_channel(struct cfg80211_registered_device *rdev,
0340                   struct wireless_dev *wdev,
0341                   struct cfg80211_chan_def *chandef);
0342 
0343 /* OCB */
0344 int __cfg80211_join_ocb(struct cfg80211_registered_device *rdev,
0345             struct net_device *dev,
0346             struct ocb_setup *setup);
0347 int cfg80211_join_ocb(struct cfg80211_registered_device *rdev,
0348               struct net_device *dev,
0349               struct ocb_setup *setup);
0350 int __cfg80211_leave_ocb(struct cfg80211_registered_device *rdev,
0351              struct net_device *dev);
0352 int cfg80211_leave_ocb(struct cfg80211_registered_device *rdev,
0353                struct net_device *dev);
0354 
0355 /* AP */
0356 int __cfg80211_stop_ap(struct cfg80211_registered_device *rdev,
0357                struct net_device *dev, int link,
0358                bool notify);
0359 int cfg80211_stop_ap(struct cfg80211_registered_device *rdev,
0360              struct net_device *dev, int link,
0361              bool notify);
0362 
0363 /* MLME */
0364 int cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
0365                struct net_device *dev,
0366                struct cfg80211_auth_request *req);
0367 int cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
0368             struct net_device *dev,
0369             struct cfg80211_assoc_request *req);
0370 int cfg80211_mlme_deauth(struct cfg80211_registered_device *rdev,
0371              struct net_device *dev, const u8 *bssid,
0372              const u8 *ie, int ie_len, u16 reason,
0373              bool local_state_change);
0374 int cfg80211_mlme_disassoc(struct cfg80211_registered_device *rdev,
0375                struct net_device *dev, const u8 *ap_addr,
0376                const u8 *ie, int ie_len, u16 reason,
0377                bool local_state_change);
0378 void cfg80211_mlme_down(struct cfg80211_registered_device *rdev,
0379             struct net_device *dev);
0380 int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid,
0381                 u16 frame_type, const u8 *match_data,
0382                 int match_len, bool multicast_rx,
0383                 struct netlink_ext_ack *extack);
0384 void cfg80211_mgmt_registrations_update_wk(struct work_struct *wk);
0385 void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid);
0386 void cfg80211_mlme_purge_registrations(struct wireless_dev *wdev);
0387 int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
0388               struct wireless_dev *wdev,
0389               struct cfg80211_mgmt_tx_params *params,
0390               u64 *cookie);
0391 void cfg80211_oper_and_ht_capa(struct ieee80211_ht_cap *ht_capa,
0392                    const struct ieee80211_ht_cap *ht_capa_mask);
0393 void cfg80211_oper_and_vht_capa(struct ieee80211_vht_cap *vht_capa,
0394                 const struct ieee80211_vht_cap *vht_capa_mask);
0395 
0396 /* SME events */
0397 int cfg80211_connect(struct cfg80211_registered_device *rdev,
0398              struct net_device *dev,
0399              struct cfg80211_connect_params *connect,
0400              struct cfg80211_cached_keys *connkeys,
0401              const u8 *prev_bssid);
0402 void __cfg80211_connect_result(struct net_device *dev,
0403                    struct cfg80211_connect_resp_params *params,
0404                    bool wextev);
0405 void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,
0406                  size_t ie_len, u16 reason, bool from_ap);
0407 int cfg80211_disconnect(struct cfg80211_registered_device *rdev,
0408             struct net_device *dev, u16 reason,
0409             bool wextev);
0410 void __cfg80211_roamed(struct wireless_dev *wdev,
0411                struct cfg80211_roam_info *info);
0412 void __cfg80211_port_authorized(struct wireless_dev *wdev, const u8 *bssid);
0413 int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev,
0414                   struct wireless_dev *wdev);
0415 void cfg80211_autodisconnect_wk(struct work_struct *work);
0416 
0417 /* SME implementation */
0418 void cfg80211_conn_work(struct work_struct *work);
0419 void cfg80211_sme_scan_done(struct net_device *dev);
0420 bool cfg80211_sme_rx_assoc_resp(struct wireless_dev *wdev, u16 status);
0421 void cfg80211_sme_rx_auth(struct wireless_dev *wdev, const u8 *buf, size_t len);
0422 void cfg80211_sme_disassoc(struct wireless_dev *wdev);
0423 void cfg80211_sme_deauth(struct wireless_dev *wdev);
0424 void cfg80211_sme_auth_timeout(struct wireless_dev *wdev);
0425 void cfg80211_sme_assoc_timeout(struct wireless_dev *wdev);
0426 void cfg80211_sme_abandon_assoc(struct wireless_dev *wdev);
0427 
0428 /* internal helpers */
0429 bool cfg80211_supported_cipher_suite(struct wiphy *wiphy, u32 cipher);
0430 bool cfg80211_valid_key_idx(struct cfg80211_registered_device *rdev,
0431                 int key_idx, bool pairwise);
0432 int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
0433                    struct key_params *params, int key_idx,
0434                    bool pairwise, const u8 *mac_addr);
0435 void __cfg80211_scan_done(struct work_struct *wk);
0436 void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev,
0437                bool send_message);
0438 void cfg80211_add_sched_scan_req(struct cfg80211_registered_device *rdev,
0439                  struct cfg80211_sched_scan_request *req);
0440 int cfg80211_sched_scan_req_possible(struct cfg80211_registered_device *rdev,
0441                      bool want_multi);
0442 void cfg80211_sched_scan_results_wk(struct work_struct *work);
0443 int cfg80211_stop_sched_scan_req(struct cfg80211_registered_device *rdev,
0444                  struct cfg80211_sched_scan_request *req,
0445                  bool driver_initiated);
0446 int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev,
0447                    u64 reqid, bool driver_initiated);
0448 void cfg80211_upload_connect_keys(struct wireless_dev *wdev);
0449 int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
0450               struct net_device *dev, enum nl80211_iftype ntype,
0451               struct vif_params *params);
0452 void cfg80211_process_rdev_events(struct cfg80211_registered_device *rdev);
0453 void cfg80211_process_wdev_events(struct wireless_dev *wdev);
0454 
0455 bool cfg80211_does_bw_fit_range(const struct ieee80211_freq_range *freq_range,
0456                 u32 center_freq_khz, u32 bw_khz);
0457 
0458 int cfg80211_scan(struct cfg80211_registered_device *rdev);
0459 
0460 extern struct work_struct cfg80211_disconnect_work;
0461 
0462 /**
0463  * cfg80211_chandef_dfs_usable - checks if chandef is DFS usable
0464  * @wiphy: the wiphy to validate against
0465  * @chandef: the channel definition to check
0466  *
0467  * Checks if chandef is usable and we can/need start CAC on such channel.
0468  *
0469  * Return: true if all channels available and at least
0470  *     one channel requires CAC (NL80211_DFS_USABLE)
0471  */
0472 bool cfg80211_chandef_dfs_usable(struct wiphy *wiphy,
0473                  const struct cfg80211_chan_def *chandef);
0474 
0475 void cfg80211_set_dfs_state(struct wiphy *wiphy,
0476                 const struct cfg80211_chan_def *chandef,
0477                 enum nl80211_dfs_state dfs_state);
0478 
0479 void cfg80211_dfs_channels_update_work(struct work_struct *work);
0480 
0481 unsigned int
0482 cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy,
0483                   const struct cfg80211_chan_def *chandef);
0484 
0485 void cfg80211_sched_dfs_chan_update(struct cfg80211_registered_device *rdev);
0486 
0487 int
0488 cfg80211_start_background_radar_detection(struct cfg80211_registered_device *rdev,
0489                       struct wireless_dev *wdev,
0490                       struct cfg80211_chan_def *chandef);
0491 
0492 void cfg80211_stop_background_radar_detection(struct wireless_dev *wdev);
0493 
0494 void cfg80211_background_cac_done_wk(struct work_struct *work);
0495 
0496 void cfg80211_background_cac_abort_wk(struct work_struct *work);
0497 
0498 bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy,
0499                   struct ieee80211_channel *chan);
0500 
0501 bool cfg80211_beaconing_iface_active(struct wireless_dev *wdev);
0502 
0503 bool cfg80211_is_sub_chan(struct cfg80211_chan_def *chandef,
0504               struct ieee80211_channel *chan,
0505               bool primary_only);
0506 bool cfg80211_wdev_on_sub_chan(struct wireless_dev *wdev,
0507                    struct ieee80211_channel *chan,
0508                    bool primary_only);
0509 
0510 static inline unsigned int elapsed_jiffies_msecs(unsigned long start)
0511 {
0512     unsigned long end = jiffies;
0513 
0514     if (end >= start)
0515         return jiffies_to_msecs(end - start);
0516 
0517     return jiffies_to_msecs(end + (ULONG_MAX - start) + 1);
0518 }
0519 
0520 int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev,
0521                  struct cfg80211_chan_def *chandef);
0522 
0523 int ieee80211_get_ratemask(struct ieee80211_supported_band *sband,
0524                const u8 *rates, unsigned int n_rates,
0525                u32 *mask);
0526 
0527 int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev,
0528                  enum nl80211_iftype iftype, u32 beacon_int);
0529 
0530 void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev,
0531                    enum nl80211_iftype iftype, int num);
0532 
0533 void __cfg80211_leave(struct cfg80211_registered_device *rdev,
0534               struct wireless_dev *wdev);
0535 void cfg80211_leave(struct cfg80211_registered_device *rdev,
0536             struct wireless_dev *wdev);
0537 
0538 void cfg80211_stop_p2p_device(struct cfg80211_registered_device *rdev,
0539                   struct wireless_dev *wdev);
0540 
0541 void cfg80211_stop_nan(struct cfg80211_registered_device *rdev,
0542                struct wireless_dev *wdev);
0543 
0544 struct cfg80211_internal_bss *
0545 cfg80211_bss_update(struct cfg80211_registered_device *rdev,
0546             struct cfg80211_internal_bss *tmp,
0547             bool signal_valid, unsigned long ts);
0548 #ifdef CONFIG_CFG80211_DEVELOPER_WARNINGS
0549 #define CFG80211_DEV_WARN_ON(cond)  WARN_ON(cond)
0550 #else
0551 /*
0552  * Trick to enable using it as a condition,
0553  * and also not give a warning when it's
0554  * not used that way.
0555  */
0556 #define CFG80211_DEV_WARN_ON(cond)  ({bool __r = (cond); __r; })
0557 #endif
0558 
0559 void cfg80211_cqm_config_free(struct wireless_dev *wdev);
0560 
0561 void cfg80211_release_pmsr(struct wireless_dev *wdev, u32 portid);
0562 void cfg80211_pmsr_wdev_down(struct wireless_dev *wdev);
0563 void cfg80211_pmsr_free_wk(struct work_struct *work);
0564 
0565 void cfg80211_remove_link(struct wireless_dev *wdev, unsigned int link_id);
0566 void cfg80211_remove_links(struct wireless_dev *wdev);
0567 int cfg80211_remove_virtual_intf(struct cfg80211_registered_device *rdev,
0568                  struct wireless_dev *wdev);
0569 
0570 #endif /* __NET_WIRELESS_CORE_H */