Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 2 | #ifndef __CFG80211_RDEV_OPS |
| 3 | #define __CFG80211_RDEV_OPS |
| 4 | |
| 5 | #include <linux/rtnetlink.h> |
| 6 | #include <net/cfg80211.h> |
| 7 | #include "core.h" |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 8 | #include "trace.h" |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 9 | |
Stanislaw Gruszka | 8125696 | 2013-02-28 10:55:25 +0100 | [diff] [blame] | 10 | static inline int rdev_suspend(struct cfg80211_registered_device *rdev, |
| 11 | struct cfg80211_wowlan *wowlan) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 12 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 13 | int ret; |
Stanislaw Gruszka | 8125696 | 2013-02-28 10:55:25 +0100 | [diff] [blame] | 14 | trace_rdev_suspend(&rdev->wiphy, wowlan); |
| 15 | ret = rdev->ops->suspend(&rdev->wiphy, wowlan); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 16 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 17 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 18 | } |
| 19 | |
| 20 | static inline int rdev_resume(struct cfg80211_registered_device *rdev) |
| 21 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 22 | int ret; |
| 23 | trace_rdev_resume(&rdev->wiphy); |
| 24 | ret = rdev->ops->resume(&rdev->wiphy); |
| 25 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 26 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | static inline void rdev_set_wakeup(struct cfg80211_registered_device *rdev, |
| 30 | bool enabled) |
| 31 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 32 | trace_rdev_set_wakeup(&rdev->wiphy, enabled); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 33 | rdev->ops->set_wakeup(&rdev->wiphy, enabled); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 34 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | static inline struct wireless_dev |
| 38 | *rdev_add_virtual_intf(struct cfg80211_registered_device *rdev, char *name, |
Tom Gundersen | 6bab2e19 | 2015-03-18 11:13:39 +0100 | [diff] [blame] | 39 | unsigned char name_assign_type, |
Johannes Berg | 818a986 | 2017-04-12 11:23:28 +0200 | [diff] [blame] | 40 | enum nl80211_iftype type, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 41 | struct vif_params *params) |
| 42 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 43 | struct wireless_dev *ret; |
| 44 | trace_rdev_add_virtual_intf(&rdev->wiphy, name, type); |
Tom Gundersen | 6bab2e19 | 2015-03-18 11:13:39 +0100 | [diff] [blame] | 45 | ret = rdev->ops->add_virtual_intf(&rdev->wiphy, name, name_assign_type, |
Johannes Berg | 818a986 | 2017-04-12 11:23:28 +0200 | [diff] [blame] | 46 | type, params); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 47 | trace_rdev_return_wdev(&rdev->wiphy, ret); |
| 48 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | static inline int |
| 52 | rdev_del_virtual_intf(struct cfg80211_registered_device *rdev, |
| 53 | struct wireless_dev *wdev) |
| 54 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 55 | int ret; |
| 56 | trace_rdev_del_virtual_intf(&rdev->wiphy, wdev); |
| 57 | ret = rdev->ops->del_virtual_intf(&rdev->wiphy, wdev); |
| 58 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 59 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | static inline int |
| 63 | rdev_change_virtual_intf(struct cfg80211_registered_device *rdev, |
| 64 | struct net_device *dev, enum nl80211_iftype type, |
Johannes Berg | 818a986 | 2017-04-12 11:23:28 +0200 | [diff] [blame] | 65 | struct vif_params *params) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 66 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 67 | int ret; |
| 68 | trace_rdev_change_virtual_intf(&rdev->wiphy, dev, type); |
Johannes Berg | 818a986 | 2017-04-12 11:23:28 +0200 | [diff] [blame] | 69 | ret = rdev->ops->change_virtual_intf(&rdev->wiphy, dev, type, params); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 70 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 71 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | static inline int rdev_add_key(struct cfg80211_registered_device *rdev, |
| 75 | struct net_device *netdev, u8 key_index, |
| 76 | bool pairwise, const u8 *mac_addr, |
| 77 | struct key_params *params) |
| 78 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 79 | int ret; |
| 80 | trace_rdev_add_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr); |
| 81 | ret = rdev->ops->add_key(&rdev->wiphy, netdev, key_index, pairwise, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 82 | mac_addr, params); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 83 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 84 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | static inline int |
| 88 | rdev_get_key(struct cfg80211_registered_device *rdev, struct net_device *netdev, |
| 89 | u8 key_index, bool pairwise, const u8 *mac_addr, void *cookie, |
| 90 | void (*callback)(void *cookie, struct key_params*)) |
| 91 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 92 | int ret; |
| 93 | trace_rdev_get_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr); |
| 94 | ret = rdev->ops->get_key(&rdev->wiphy, netdev, key_index, pairwise, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 95 | mac_addr, cookie, callback); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 96 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 97 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | static inline int rdev_del_key(struct cfg80211_registered_device *rdev, |
| 101 | struct net_device *netdev, u8 key_index, |
| 102 | bool pairwise, const u8 *mac_addr) |
| 103 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 104 | int ret; |
| 105 | trace_rdev_del_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr); |
| 106 | ret = rdev->ops->del_key(&rdev->wiphy, netdev, key_index, pairwise, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 107 | mac_addr); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 108 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 109 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | static inline int |
| 113 | rdev_set_default_key(struct cfg80211_registered_device *rdev, |
| 114 | struct net_device *netdev, u8 key_index, bool unicast, |
| 115 | bool multicast) |
| 116 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 117 | int ret; |
| 118 | trace_rdev_set_default_key(&rdev->wiphy, netdev, key_index, |
| 119 | unicast, multicast); |
| 120 | ret = rdev->ops->set_default_key(&rdev->wiphy, netdev, key_index, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 121 | unicast, multicast); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 122 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 123 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | static inline int |
| 127 | rdev_set_default_mgmt_key(struct cfg80211_registered_device *rdev, |
| 128 | struct net_device *netdev, u8 key_index) |
| 129 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 130 | int ret; |
| 131 | trace_rdev_set_default_mgmt_key(&rdev->wiphy, netdev, key_index); |
| 132 | ret = rdev->ops->set_default_mgmt_key(&rdev->wiphy, netdev, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 133 | key_index); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 134 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 135 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | static inline int rdev_start_ap(struct cfg80211_registered_device *rdev, |
| 139 | struct net_device *dev, |
| 140 | struct cfg80211_ap_settings *settings) |
| 141 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 142 | int ret; |
| 143 | trace_rdev_start_ap(&rdev->wiphy, dev, settings); |
| 144 | ret = rdev->ops->start_ap(&rdev->wiphy, dev, settings); |
| 145 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 146 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 147 | } |
| 148 | |
| 149 | static inline int rdev_change_beacon(struct cfg80211_registered_device *rdev, |
| 150 | struct net_device *dev, |
| 151 | struct cfg80211_beacon_data *info) |
| 152 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 153 | int ret; |
| 154 | trace_rdev_change_beacon(&rdev->wiphy, dev, info); |
| 155 | ret = rdev->ops->change_beacon(&rdev->wiphy, dev, info); |
| 156 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 157 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | static inline int rdev_stop_ap(struct cfg80211_registered_device *rdev, |
| 161 | struct net_device *dev) |
| 162 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 163 | int ret; |
| 164 | trace_rdev_stop_ap(&rdev->wiphy, dev); |
| 165 | ret = rdev->ops->stop_ap(&rdev->wiphy, dev); |
| 166 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 167 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 168 | } |
| 169 | |
| 170 | static inline int rdev_add_station(struct cfg80211_registered_device *rdev, |
| 171 | struct net_device *dev, u8 *mac, |
| 172 | struct station_parameters *params) |
| 173 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 174 | int ret; |
| 175 | trace_rdev_add_station(&rdev->wiphy, dev, mac, params); |
| 176 | ret = rdev->ops->add_station(&rdev->wiphy, dev, mac, params); |
| 177 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 178 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 179 | } |
| 180 | |
| 181 | static inline int rdev_del_station(struct cfg80211_registered_device *rdev, |
Jouni Malinen | 89c771e | 2014-10-10 20:52:40 +0300 | [diff] [blame] | 182 | struct net_device *dev, |
| 183 | struct station_del_parameters *params) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 184 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 185 | int ret; |
Jouni Malinen | 89c771e | 2014-10-10 20:52:40 +0300 | [diff] [blame] | 186 | trace_rdev_del_station(&rdev->wiphy, dev, params); |
| 187 | ret = rdev->ops->del_station(&rdev->wiphy, dev, params); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 188 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 189 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 190 | } |
| 191 | |
| 192 | static inline int rdev_change_station(struct cfg80211_registered_device *rdev, |
| 193 | struct net_device *dev, u8 *mac, |
| 194 | struct station_parameters *params) |
| 195 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 196 | int ret; |
| 197 | trace_rdev_change_station(&rdev->wiphy, dev, mac, params); |
| 198 | ret = rdev->ops->change_station(&rdev->wiphy, dev, mac, params); |
| 199 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 200 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 201 | } |
| 202 | |
| 203 | static inline int rdev_get_station(struct cfg80211_registered_device *rdev, |
Antonio Quartulli | 7406353 | 2014-05-19 21:53:21 +0200 | [diff] [blame] | 204 | struct net_device *dev, const u8 *mac, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 205 | struct station_info *sinfo) |
| 206 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 207 | int ret; |
| 208 | trace_rdev_get_station(&rdev->wiphy, dev, mac); |
| 209 | ret = rdev->ops->get_station(&rdev->wiphy, dev, mac, sinfo); |
| 210 | trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo); |
| 211 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 212 | } |
| 213 | |
| 214 | static inline int rdev_dump_station(struct cfg80211_registered_device *rdev, |
| 215 | struct net_device *dev, int idx, u8 *mac, |
| 216 | struct station_info *sinfo) |
| 217 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 218 | int ret; |
| 219 | trace_rdev_dump_station(&rdev->wiphy, dev, idx, mac); |
| 220 | ret = rdev->ops->dump_station(&rdev->wiphy, dev, idx, mac, sinfo); |
| 221 | trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo); |
| 222 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 223 | } |
| 224 | |
| 225 | static inline int rdev_add_mpath(struct cfg80211_registered_device *rdev, |
| 226 | struct net_device *dev, u8 *dst, u8 *next_hop) |
| 227 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 228 | int ret; |
| 229 | trace_rdev_add_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 230 | ret = rdev->ops->add_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 231 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 232 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 233 | } |
| 234 | |
| 235 | static inline int rdev_del_mpath(struct cfg80211_registered_device *rdev, |
| 236 | struct net_device *dev, u8 *dst) |
| 237 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 238 | int ret; |
| 239 | trace_rdev_del_mpath(&rdev->wiphy, dev, dst); |
| 240 | ret = rdev->ops->del_mpath(&rdev->wiphy, dev, dst); |
| 241 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 242 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 243 | } |
| 244 | |
| 245 | static inline int rdev_change_mpath(struct cfg80211_registered_device *rdev, |
| 246 | struct net_device *dev, u8 *dst, |
| 247 | u8 *next_hop) |
| 248 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 249 | int ret; |
| 250 | trace_rdev_change_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 251 | ret = rdev->ops->change_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 252 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 253 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 254 | } |
| 255 | |
| 256 | static inline int rdev_get_mpath(struct cfg80211_registered_device *rdev, |
| 257 | struct net_device *dev, u8 *dst, u8 *next_hop, |
| 258 | struct mpath_info *pinfo) |
| 259 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 260 | int ret; |
| 261 | trace_rdev_get_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 262 | ret = rdev->ops->get_mpath(&rdev->wiphy, dev, dst, next_hop, pinfo); |
| 263 | trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo); |
| 264 | return ret; |
| 265 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 266 | } |
| 267 | |
Henning Rogge | 66be7d2 | 2014-09-12 08:58:49 +0200 | [diff] [blame] | 268 | static inline int rdev_get_mpp(struct cfg80211_registered_device *rdev, |
| 269 | struct net_device *dev, u8 *dst, u8 *mpp, |
| 270 | struct mpath_info *pinfo) |
| 271 | { |
| 272 | int ret; |
| 273 | |
| 274 | trace_rdev_get_mpp(&rdev->wiphy, dev, dst, mpp); |
| 275 | ret = rdev->ops->get_mpp(&rdev->wiphy, dev, dst, mpp, pinfo); |
| 276 | trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo); |
| 277 | return ret; |
| 278 | } |
| 279 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 280 | static inline int rdev_dump_mpath(struct cfg80211_registered_device *rdev, |
| 281 | struct net_device *dev, int idx, u8 *dst, |
| 282 | u8 *next_hop, struct mpath_info *pinfo) |
| 283 | |
| 284 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 285 | int ret; |
| 286 | trace_rdev_dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop); |
| 287 | ret = rdev->ops->dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop, |
Henning Rogge | 66be7d2 | 2014-09-12 08:58:49 +0200 | [diff] [blame] | 288 | pinfo); |
| 289 | trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo); |
| 290 | return ret; |
| 291 | } |
| 292 | |
| 293 | static inline int rdev_dump_mpp(struct cfg80211_registered_device *rdev, |
| 294 | struct net_device *dev, int idx, u8 *dst, |
| 295 | u8 *mpp, struct mpath_info *pinfo) |
| 296 | |
| 297 | { |
| 298 | int ret; |
| 299 | |
| 300 | trace_rdev_dump_mpp(&rdev->wiphy, dev, idx, dst, mpp); |
| 301 | ret = rdev->ops->dump_mpp(&rdev->wiphy, dev, idx, dst, mpp, pinfo); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 302 | trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo); |
| 303 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 304 | } |
| 305 | |
| 306 | static inline int |
| 307 | rdev_get_mesh_config(struct cfg80211_registered_device *rdev, |
| 308 | struct net_device *dev, struct mesh_config *conf) |
| 309 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 310 | int ret; |
| 311 | trace_rdev_get_mesh_config(&rdev->wiphy, dev); |
| 312 | ret = rdev->ops->get_mesh_config(&rdev->wiphy, dev, conf); |
| 313 | trace_rdev_return_int_mesh_config(&rdev->wiphy, ret, conf); |
| 314 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 315 | } |
| 316 | |
| 317 | static inline int |
| 318 | rdev_update_mesh_config(struct cfg80211_registered_device *rdev, |
| 319 | struct net_device *dev, u32 mask, |
| 320 | const struct mesh_config *nconf) |
| 321 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 322 | int ret; |
| 323 | trace_rdev_update_mesh_config(&rdev->wiphy, dev, mask, nconf); |
| 324 | ret = rdev->ops->update_mesh_config(&rdev->wiphy, dev, mask, nconf); |
| 325 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 326 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 327 | } |
| 328 | |
| 329 | static inline int rdev_join_mesh(struct cfg80211_registered_device *rdev, |
| 330 | struct net_device *dev, |
| 331 | const struct mesh_config *conf, |
| 332 | const struct mesh_setup *setup) |
| 333 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 334 | int ret; |
| 335 | trace_rdev_join_mesh(&rdev->wiphy, dev, conf, setup); |
| 336 | ret = rdev->ops->join_mesh(&rdev->wiphy, dev, conf, setup); |
| 337 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 338 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 339 | } |
| 340 | |
| 341 | |
| 342 | static inline int rdev_leave_mesh(struct cfg80211_registered_device *rdev, |
| 343 | struct net_device *dev) |
| 344 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 345 | int ret; |
| 346 | trace_rdev_leave_mesh(&rdev->wiphy, dev); |
| 347 | ret = rdev->ops->leave_mesh(&rdev->wiphy, dev); |
| 348 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 349 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 350 | } |
| 351 | |
Rostislav Lisovy | 6e0bd6c | 2014-11-03 10:33:18 +0100 | [diff] [blame] | 352 | static inline int rdev_join_ocb(struct cfg80211_registered_device *rdev, |
| 353 | struct net_device *dev, |
| 354 | struct ocb_setup *setup) |
| 355 | { |
| 356 | int ret; |
| 357 | trace_rdev_join_ocb(&rdev->wiphy, dev, setup); |
| 358 | ret = rdev->ops->join_ocb(&rdev->wiphy, dev, setup); |
| 359 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 360 | return ret; |
| 361 | } |
| 362 | |
| 363 | static inline int rdev_leave_ocb(struct cfg80211_registered_device *rdev, |
| 364 | struct net_device *dev) |
| 365 | { |
| 366 | int ret; |
| 367 | trace_rdev_leave_ocb(&rdev->wiphy, dev); |
| 368 | ret = rdev->ops->leave_ocb(&rdev->wiphy, dev); |
| 369 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 370 | return ret; |
| 371 | } |
| 372 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 373 | static inline int rdev_change_bss(struct cfg80211_registered_device *rdev, |
| 374 | struct net_device *dev, |
| 375 | struct bss_parameters *params) |
| 376 | |
| 377 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 378 | int ret; |
| 379 | trace_rdev_change_bss(&rdev->wiphy, dev, params); |
| 380 | ret = rdev->ops->change_bss(&rdev->wiphy, dev, params); |
| 381 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 382 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 383 | } |
| 384 | |
| 385 | static inline int rdev_set_txq_params(struct cfg80211_registered_device *rdev, |
| 386 | struct net_device *dev, |
| 387 | struct ieee80211_txq_params *params) |
| 388 | |
| 389 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 390 | int ret; |
| 391 | trace_rdev_set_txq_params(&rdev->wiphy, dev, params); |
| 392 | ret = rdev->ops->set_txq_params(&rdev->wiphy, dev, params); |
| 393 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 394 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 395 | } |
| 396 | |
| 397 | static inline int |
| 398 | rdev_libertas_set_mesh_channel(struct cfg80211_registered_device *rdev, |
| 399 | struct net_device *dev, |
| 400 | struct ieee80211_channel *chan) |
| 401 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 402 | int ret; |
| 403 | trace_rdev_libertas_set_mesh_channel(&rdev->wiphy, dev, chan); |
| 404 | ret = rdev->ops->libertas_set_mesh_channel(&rdev->wiphy, dev, chan); |
| 405 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 406 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 407 | } |
| 408 | |
| 409 | static inline int |
| 410 | rdev_set_monitor_channel(struct cfg80211_registered_device *rdev, |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 411 | struct cfg80211_chan_def *chandef) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 412 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 413 | int ret; |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 414 | trace_rdev_set_monitor_channel(&rdev->wiphy, chandef); |
| 415 | ret = rdev->ops->set_monitor_channel(&rdev->wiphy, chandef); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 416 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 417 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 418 | } |
| 419 | |
| 420 | static inline int rdev_scan(struct cfg80211_registered_device *rdev, |
| 421 | struct cfg80211_scan_request *request) |
| 422 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 423 | int ret; |
| 424 | trace_rdev_scan(&rdev->wiphy, request); |
| 425 | ret = rdev->ops->scan(&rdev->wiphy, request); |
| 426 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 427 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 428 | } |
| 429 | |
Vidyullatha Kanchanapally | 91d3ab4 | 2015-10-30 19:14:49 +0530 | [diff] [blame] | 430 | static inline void rdev_abort_scan(struct cfg80211_registered_device *rdev, |
| 431 | struct wireless_dev *wdev) |
| 432 | { |
| 433 | trace_rdev_abort_scan(&rdev->wiphy, wdev); |
| 434 | rdev->ops->abort_scan(&rdev->wiphy, wdev); |
| 435 | trace_rdev_return_void(&rdev->wiphy); |
| 436 | } |
| 437 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 438 | static inline int rdev_auth(struct cfg80211_registered_device *rdev, |
| 439 | struct net_device *dev, |
| 440 | struct cfg80211_auth_request *req) |
| 441 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 442 | int ret; |
| 443 | trace_rdev_auth(&rdev->wiphy, dev, req); |
| 444 | ret = rdev->ops->auth(&rdev->wiphy, dev, req); |
| 445 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 446 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 447 | } |
| 448 | |
| 449 | static inline int rdev_assoc(struct cfg80211_registered_device *rdev, |
| 450 | struct net_device *dev, |
| 451 | struct cfg80211_assoc_request *req) |
| 452 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 453 | int ret; |
| 454 | trace_rdev_assoc(&rdev->wiphy, dev, req); |
| 455 | ret = rdev->ops->assoc(&rdev->wiphy, dev, req); |
| 456 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 457 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 458 | } |
| 459 | |
| 460 | static inline int rdev_deauth(struct cfg80211_registered_device *rdev, |
| 461 | struct net_device *dev, |
| 462 | struct cfg80211_deauth_request *req) |
| 463 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 464 | int ret; |
| 465 | trace_rdev_deauth(&rdev->wiphy, dev, req); |
| 466 | ret = rdev->ops->deauth(&rdev->wiphy, dev, req); |
| 467 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 468 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 469 | } |
| 470 | |
| 471 | static inline int rdev_disassoc(struct cfg80211_registered_device *rdev, |
| 472 | struct net_device *dev, |
| 473 | struct cfg80211_disassoc_request *req) |
| 474 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 475 | int ret; |
| 476 | trace_rdev_disassoc(&rdev->wiphy, dev, req); |
| 477 | ret = rdev->ops->disassoc(&rdev->wiphy, dev, req); |
| 478 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 479 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 480 | } |
| 481 | |
| 482 | static inline int rdev_connect(struct cfg80211_registered_device *rdev, |
| 483 | struct net_device *dev, |
| 484 | struct cfg80211_connect_params *sme) |
| 485 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 486 | int ret; |
| 487 | trace_rdev_connect(&rdev->wiphy, dev, sme); |
| 488 | ret = rdev->ops->connect(&rdev->wiphy, dev, sme); |
| 489 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 490 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 491 | } |
| 492 | |
vamsi krishna | 088e8df | 2016-10-27 16:51:11 +0300 | [diff] [blame] | 493 | static inline int |
| 494 | rdev_update_connect_params(struct cfg80211_registered_device *rdev, |
| 495 | struct net_device *dev, |
| 496 | struct cfg80211_connect_params *sme, u32 changed) |
| 497 | { |
| 498 | int ret; |
| 499 | trace_rdev_update_connect_params(&rdev->wiphy, dev, sme, changed); |
| 500 | ret = rdev->ops->update_connect_params(&rdev->wiphy, dev, sme, changed); |
| 501 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 502 | return ret; |
| 503 | } |
| 504 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 505 | static inline int rdev_disconnect(struct cfg80211_registered_device *rdev, |
| 506 | struct net_device *dev, u16 reason_code) |
| 507 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 508 | int ret; |
| 509 | trace_rdev_disconnect(&rdev->wiphy, dev, reason_code); |
| 510 | ret = rdev->ops->disconnect(&rdev->wiphy, dev, reason_code); |
| 511 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 512 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 513 | } |
| 514 | |
| 515 | static inline int rdev_join_ibss(struct cfg80211_registered_device *rdev, |
| 516 | struct net_device *dev, |
| 517 | struct cfg80211_ibss_params *params) |
| 518 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 519 | int ret; |
| 520 | trace_rdev_join_ibss(&rdev->wiphy, dev, params); |
| 521 | ret = rdev->ops->join_ibss(&rdev->wiphy, dev, params); |
| 522 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 523 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 524 | } |
| 525 | |
| 526 | static inline int rdev_leave_ibss(struct cfg80211_registered_device *rdev, |
| 527 | struct net_device *dev) |
| 528 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 529 | int ret; |
| 530 | trace_rdev_leave_ibss(&rdev->wiphy, dev); |
| 531 | ret = rdev->ops->leave_ibss(&rdev->wiphy, dev); |
| 532 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 533 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 534 | } |
| 535 | |
| 536 | static inline int |
| 537 | rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed) |
| 538 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 539 | int ret; |
Johannes Berg | 162b3b1 | 2020-01-13 12:53:59 +0100 | [diff] [blame] | 540 | |
| 541 | if (!rdev->ops->set_wiphy_params) |
| 542 | return -EOPNOTSUPP; |
| 543 | |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 544 | trace_rdev_set_wiphy_params(&rdev->wiphy, changed); |
| 545 | ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed); |
| 546 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 547 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 548 | } |
| 549 | |
| 550 | static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev, |
Johannes Berg | c844211 | 2012-10-24 10:17:18 +0200 | [diff] [blame] | 551 | struct wireless_dev *wdev, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 552 | enum nl80211_tx_power_setting type, int mbm) |
| 553 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 554 | int ret; |
Johannes Berg | c844211 | 2012-10-24 10:17:18 +0200 | [diff] [blame] | 555 | trace_rdev_set_tx_power(&rdev->wiphy, wdev, type, mbm); |
| 556 | ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, type, mbm); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 557 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 558 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 559 | } |
| 560 | |
| 561 | static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev, |
Johannes Berg | c844211 | 2012-10-24 10:17:18 +0200 | [diff] [blame] | 562 | struct wireless_dev *wdev, int *dbm) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 563 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 564 | int ret; |
Johannes Berg | c844211 | 2012-10-24 10:17:18 +0200 | [diff] [blame] | 565 | trace_rdev_get_tx_power(&rdev->wiphy, wdev); |
| 566 | ret = rdev->ops->get_tx_power(&rdev->wiphy, wdev, dbm); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 567 | trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm); |
| 568 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 569 | } |
| 570 | |
| 571 | static inline int rdev_set_wds_peer(struct cfg80211_registered_device *rdev, |
| 572 | struct net_device *dev, const u8 *addr) |
| 573 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 574 | int ret; |
| 575 | trace_rdev_set_wds_peer(&rdev->wiphy, dev, addr); |
| 576 | ret = rdev->ops->set_wds_peer(&rdev->wiphy, dev, addr); |
| 577 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 578 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 579 | } |
| 580 | |
Michael Braun | ce0ce13 | 2016-10-10 19:12:22 +0200 | [diff] [blame] | 581 | static inline int |
| 582 | rdev_set_multicast_to_unicast(struct cfg80211_registered_device *rdev, |
| 583 | struct net_device *dev, |
| 584 | const bool enabled) |
| 585 | { |
| 586 | int ret; |
| 587 | trace_rdev_set_multicast_to_unicast(&rdev->wiphy, dev, enabled); |
| 588 | ret = rdev->ops->set_multicast_to_unicast(&rdev->wiphy, dev, enabled); |
| 589 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 590 | return ret; |
| 591 | } |
| 592 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 593 | static inline void rdev_rfkill_poll(struct cfg80211_registered_device *rdev) |
| 594 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 595 | trace_rdev_rfkill_poll(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 596 | rdev->ops->rfkill_poll(&rdev->wiphy); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 597 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 598 | } |
| 599 | |
| 600 | |
| 601 | #ifdef CONFIG_NL80211_TESTMODE |
| 602 | static inline int rdev_testmode_cmd(struct cfg80211_registered_device *rdev, |
David Spinadel | fc73f11 | 2013-07-31 18:04:15 +0300 | [diff] [blame] | 603 | struct wireless_dev *wdev, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 604 | void *data, int len) |
| 605 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 606 | int ret; |
David Spinadel | fc73f11 | 2013-07-31 18:04:15 +0300 | [diff] [blame] | 607 | trace_rdev_testmode_cmd(&rdev->wiphy, wdev); |
| 608 | ret = rdev->ops->testmode_cmd(&rdev->wiphy, wdev, data, len); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 609 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 610 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 611 | } |
| 612 | |
| 613 | static inline int rdev_testmode_dump(struct cfg80211_registered_device *rdev, |
| 614 | struct sk_buff *skb, |
| 615 | struct netlink_callback *cb, void *data, |
| 616 | int len) |
| 617 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 618 | int ret; |
| 619 | trace_rdev_testmode_dump(&rdev->wiphy); |
| 620 | ret = rdev->ops->testmode_dump(&rdev->wiphy, skb, cb, data, len); |
| 621 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 622 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 623 | } |
| 624 | #endif |
| 625 | |
| 626 | static inline int |
| 627 | rdev_set_bitrate_mask(struct cfg80211_registered_device *rdev, |
| 628 | struct net_device *dev, const u8 *peer, |
| 629 | const struct cfg80211_bitrate_mask *mask) |
| 630 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 631 | int ret; |
| 632 | trace_rdev_set_bitrate_mask(&rdev->wiphy, dev, peer, mask); |
| 633 | ret = rdev->ops->set_bitrate_mask(&rdev->wiphy, dev, peer, mask); |
| 634 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 635 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 636 | } |
| 637 | |
| 638 | static inline int rdev_dump_survey(struct cfg80211_registered_device *rdev, |
| 639 | struct net_device *netdev, int idx, |
| 640 | struct survey_info *info) |
| 641 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 642 | int ret; |
| 643 | trace_rdev_dump_survey(&rdev->wiphy, netdev, idx); |
| 644 | ret = rdev->ops->dump_survey(&rdev->wiphy, netdev, idx, info); |
| 645 | if (ret < 0) |
| 646 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 647 | else |
| 648 | trace_rdev_return_int_survey_info(&rdev->wiphy, ret, info); |
| 649 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 650 | } |
| 651 | |
| 652 | static inline int rdev_set_pmksa(struct cfg80211_registered_device *rdev, |
| 653 | struct net_device *netdev, |
| 654 | struct cfg80211_pmksa *pmksa) |
| 655 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 656 | int ret; |
| 657 | trace_rdev_set_pmksa(&rdev->wiphy, netdev, pmksa); |
| 658 | ret = rdev->ops->set_pmksa(&rdev->wiphy, netdev, pmksa); |
| 659 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 660 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 661 | } |
| 662 | |
| 663 | static inline int rdev_del_pmksa(struct cfg80211_registered_device *rdev, |
| 664 | struct net_device *netdev, |
| 665 | struct cfg80211_pmksa *pmksa) |
| 666 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 667 | int ret; |
| 668 | trace_rdev_del_pmksa(&rdev->wiphy, netdev, pmksa); |
| 669 | ret = rdev->ops->del_pmksa(&rdev->wiphy, netdev, pmksa); |
| 670 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 671 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 672 | } |
| 673 | |
| 674 | static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev, |
| 675 | struct net_device *netdev) |
| 676 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 677 | int ret; |
| 678 | trace_rdev_flush_pmksa(&rdev->wiphy, netdev); |
| 679 | ret = rdev->ops->flush_pmksa(&rdev->wiphy, netdev); |
| 680 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 681 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 682 | } |
| 683 | |
| 684 | static inline int |
| 685 | rdev_remain_on_channel(struct cfg80211_registered_device *rdev, |
| 686 | struct wireless_dev *wdev, |
| 687 | struct ieee80211_channel *chan, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 688 | unsigned int duration, u64 *cookie) |
| 689 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 690 | int ret; |
Johannes Berg | 42d97a5 | 2012-11-08 18:31:02 +0100 | [diff] [blame] | 691 | trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 692 | ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan, |
Johannes Berg | 42d97a5 | 2012-11-08 18:31:02 +0100 | [diff] [blame] | 693 | duration, cookie); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 694 | trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); |
| 695 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 696 | } |
| 697 | |
| 698 | static inline int |
| 699 | rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev, |
| 700 | struct wireless_dev *wdev, u64 cookie) |
| 701 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 702 | int ret; |
| 703 | trace_rdev_cancel_remain_on_channel(&rdev->wiphy, wdev, cookie); |
| 704 | ret = rdev->ops->cancel_remain_on_channel(&rdev->wiphy, wdev, cookie); |
| 705 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 706 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 707 | } |
| 708 | |
| 709 | static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev, |
| 710 | struct wireless_dev *wdev, |
Andrei Otcheretianski | b176e62 | 2013-11-18 19:06:49 +0200 | [diff] [blame] | 711 | struct cfg80211_mgmt_tx_params *params, |
| 712 | u64 *cookie) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 713 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 714 | int ret; |
Andrei Otcheretianski | b176e62 | 2013-11-18 19:06:49 +0200 | [diff] [blame] | 715 | trace_rdev_mgmt_tx(&rdev->wiphy, wdev, params); |
| 716 | ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, params, cookie); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 717 | trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); |
| 718 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 719 | } |
| 720 | |
| 721 | static inline int |
| 722 | rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device *rdev, |
| 723 | struct wireless_dev *wdev, u64 cookie) |
| 724 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 725 | int ret; |
| 726 | trace_rdev_mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie); |
| 727 | ret = rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie); |
| 728 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 729 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 730 | } |
| 731 | |
| 732 | static inline int rdev_set_power_mgmt(struct cfg80211_registered_device *rdev, |
| 733 | struct net_device *dev, bool enabled, |
| 734 | int timeout) |
| 735 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 736 | int ret; |
| 737 | trace_rdev_set_power_mgmt(&rdev->wiphy, dev, enabled, timeout); |
| 738 | ret = rdev->ops->set_power_mgmt(&rdev->wiphy, dev, enabled, timeout); |
| 739 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 740 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 741 | } |
| 742 | |
| 743 | static inline int |
| 744 | rdev_set_cqm_rssi_config(struct cfg80211_registered_device *rdev, |
| 745 | struct net_device *dev, s32 rssi_thold, u32 rssi_hyst) |
| 746 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 747 | int ret; |
| 748 | trace_rdev_set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold, |
| 749 | rssi_hyst); |
| 750 | ret = rdev->ops->set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold, |
| 751 | rssi_hyst); |
| 752 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 753 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 754 | } |
| 755 | |
| 756 | static inline int |
Andrew Zaborowski | 4a4b816 | 2017-02-10 10:02:31 +0100 | [diff] [blame] | 757 | rdev_set_cqm_rssi_range_config(struct cfg80211_registered_device *rdev, |
| 758 | struct net_device *dev, s32 low, s32 high) |
| 759 | { |
| 760 | int ret; |
| 761 | trace_rdev_set_cqm_rssi_range_config(&rdev->wiphy, dev, low, high); |
| 762 | ret = rdev->ops->set_cqm_rssi_range_config(&rdev->wiphy, dev, |
| 763 | low, high); |
| 764 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 765 | return ret; |
| 766 | } |
| 767 | |
| 768 | static inline int |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 769 | rdev_set_cqm_txe_config(struct cfg80211_registered_device *rdev, |
| 770 | struct net_device *dev, u32 rate, u32 pkts, u32 intvl) |
| 771 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 772 | int ret; |
| 773 | trace_rdev_set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, intvl); |
| 774 | ret = rdev->ops->set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 775 | intvl); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 776 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 777 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 778 | } |
| 779 | |
| 780 | static inline void |
| 781 | rdev_mgmt_frame_register(struct cfg80211_registered_device *rdev, |
| 782 | struct wireless_dev *wdev, u16 frame_type, bool reg) |
| 783 | { |
Johannes Berg | 33d8783 | 2015-06-23 17:47:05 +0200 | [diff] [blame] | 784 | might_sleep(); |
| 785 | |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 786 | trace_rdev_mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg); |
| 787 | rdev->ops->mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg); |
| 788 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 789 | } |
| 790 | |
| 791 | static inline int rdev_set_antenna(struct cfg80211_registered_device *rdev, |
| 792 | u32 tx_ant, u32 rx_ant) |
| 793 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 794 | int ret; |
| 795 | trace_rdev_set_antenna(&rdev->wiphy, tx_ant, rx_ant); |
| 796 | ret = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant); |
| 797 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 798 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 799 | } |
| 800 | |
| 801 | static inline int rdev_get_antenna(struct cfg80211_registered_device *rdev, |
| 802 | u32 *tx_ant, u32 *rx_ant) |
| 803 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 804 | int ret; |
| 805 | trace_rdev_get_antenna(&rdev->wiphy); |
| 806 | ret = rdev->ops->get_antenna(&rdev->wiphy, tx_ant, rx_ant); |
| 807 | if (ret) |
| 808 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 809 | else |
| 810 | trace_rdev_return_int_tx_rx(&rdev->wiphy, ret, *tx_ant, |
| 811 | *rx_ant); |
| 812 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 813 | } |
| 814 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 815 | static inline int |
| 816 | rdev_sched_scan_start(struct cfg80211_registered_device *rdev, |
| 817 | struct net_device *dev, |
| 818 | struct cfg80211_sched_scan_request *request) |
| 819 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 820 | int ret; |
Arend Van Spriel | ca986ad | 2017-04-21 13:05:00 +0100 | [diff] [blame] | 821 | trace_rdev_sched_scan_start(&rdev->wiphy, dev, request->reqid); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 822 | ret = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request); |
| 823 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 824 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 825 | } |
| 826 | |
| 827 | static inline int rdev_sched_scan_stop(struct cfg80211_registered_device *rdev, |
Arend Van Spriel | 3a3ecf1 | 2017-04-21 13:05:02 +0100 | [diff] [blame] | 828 | struct net_device *dev, u64 reqid) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 829 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 830 | int ret; |
Arend Van Spriel | 3a3ecf1 | 2017-04-21 13:05:02 +0100 | [diff] [blame] | 831 | trace_rdev_sched_scan_stop(&rdev->wiphy, dev, reqid); |
| 832 | ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev, reqid); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 833 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 834 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 835 | } |
| 836 | |
| 837 | static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev, |
| 838 | struct net_device *dev, |
| 839 | struct cfg80211_gtk_rekey_data *data) |
| 840 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 841 | int ret; |
| 842 | trace_rdev_set_rekey_data(&rdev->wiphy, dev); |
| 843 | ret = rdev->ops->set_rekey_data(&rdev->wiphy, dev, data); |
| 844 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 845 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 846 | } |
| 847 | |
| 848 | static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev, |
| 849 | struct net_device *dev, u8 *peer, |
| 850 | u8 action_code, u8 dialog_token, |
Sunil Dutt Undekari | df942e7 | 2014-02-20 16:22:09 +0530 | [diff] [blame] | 851 | u16 status_code, u32 peer_capability, |
Arik Nemtsov | 31fa97c | 2014-06-11 17:18:21 +0300 | [diff] [blame] | 852 | bool initiator, const u8 *buf, size_t len) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 853 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 854 | int ret; |
| 855 | trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code, |
Sunil Dutt Undekari | df942e7 | 2014-02-20 16:22:09 +0530 | [diff] [blame] | 856 | dialog_token, status_code, peer_capability, |
Arik Nemtsov | 31fa97c | 2014-06-11 17:18:21 +0300 | [diff] [blame] | 857 | initiator, buf, len); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 858 | ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code, |
Sunil Dutt Undekari | df942e7 | 2014-02-20 16:22:09 +0530 | [diff] [blame] | 859 | dialog_token, status_code, peer_capability, |
Arik Nemtsov | 31fa97c | 2014-06-11 17:18:21 +0300 | [diff] [blame] | 860 | initiator, buf, len); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 861 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 862 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 863 | } |
| 864 | |
| 865 | static inline int rdev_tdls_oper(struct cfg80211_registered_device *rdev, |
| 866 | struct net_device *dev, u8 *peer, |
| 867 | enum nl80211_tdls_operation oper) |
| 868 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 869 | int ret; |
| 870 | trace_rdev_tdls_oper(&rdev->wiphy, dev, peer, oper); |
| 871 | ret = rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, oper); |
| 872 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 873 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 874 | } |
| 875 | |
| 876 | static inline int rdev_probe_client(struct cfg80211_registered_device *rdev, |
| 877 | struct net_device *dev, const u8 *peer, |
| 878 | u64 *cookie) |
| 879 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 880 | int ret; |
| 881 | trace_rdev_probe_client(&rdev->wiphy, dev, peer); |
| 882 | ret = rdev->ops->probe_client(&rdev->wiphy, dev, peer, cookie); |
| 883 | trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); |
| 884 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 885 | } |
| 886 | |
| 887 | static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev, |
| 888 | struct net_device *dev, u16 noack_map) |
| 889 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 890 | int ret; |
| 891 | trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map); |
| 892 | ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map); |
| 893 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 894 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 895 | } |
| 896 | |
| 897 | static inline int |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 898 | rdev_get_channel(struct cfg80211_registered_device *rdev, |
| 899 | struct wireless_dev *wdev, |
| 900 | struct cfg80211_chan_def *chandef) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 901 | { |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 902 | int ret; |
| 903 | |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 904 | trace_rdev_get_channel(&rdev->wiphy, wdev); |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 905 | ret = rdev->ops->get_channel(&rdev->wiphy, wdev, chandef); |
| 906 | trace_rdev_return_chandef(&rdev->wiphy, ret, chandef); |
| 907 | |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 908 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 909 | } |
| 910 | |
Johannes Berg | eeb126e | 2012-10-23 15:16:50 +0200 | [diff] [blame] | 911 | static inline int rdev_start_p2p_device(struct cfg80211_registered_device *rdev, |
| 912 | struct wireless_dev *wdev) |
| 913 | { |
| 914 | int ret; |
| 915 | |
| 916 | trace_rdev_start_p2p_device(&rdev->wiphy, wdev); |
| 917 | ret = rdev->ops->start_p2p_device(&rdev->wiphy, wdev); |
| 918 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 919 | return ret; |
| 920 | } |
| 921 | |
| 922 | static inline void rdev_stop_p2p_device(struct cfg80211_registered_device *rdev, |
| 923 | struct wireless_dev *wdev) |
| 924 | { |
| 925 | trace_rdev_stop_p2p_device(&rdev->wiphy, wdev); |
| 926 | rdev->ops->stop_p2p_device(&rdev->wiphy, wdev); |
| 927 | trace_rdev_return_void(&rdev->wiphy); |
Arend van Spriel | 5de1798 | 2013-04-18 15:49:00 +0200 | [diff] [blame] | 928 | } |
Vasanthakumar Thiagarajan | 77765ea | 2013-01-18 11:18:45 +0530 | [diff] [blame] | 929 | |
Ayala Beker | cb3b7d8 | 2016-09-20 17:31:13 +0300 | [diff] [blame] | 930 | static inline int rdev_start_nan(struct cfg80211_registered_device *rdev, |
| 931 | struct wireless_dev *wdev, |
| 932 | struct cfg80211_nan_conf *conf) |
| 933 | { |
| 934 | int ret; |
| 935 | |
| 936 | trace_rdev_start_nan(&rdev->wiphy, wdev, conf); |
| 937 | ret = rdev->ops->start_nan(&rdev->wiphy, wdev, conf); |
| 938 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 939 | return ret; |
| 940 | } |
| 941 | |
| 942 | static inline void rdev_stop_nan(struct cfg80211_registered_device *rdev, |
| 943 | struct wireless_dev *wdev) |
| 944 | { |
| 945 | trace_rdev_stop_nan(&rdev->wiphy, wdev); |
| 946 | rdev->ops->stop_nan(&rdev->wiphy, wdev); |
| 947 | trace_rdev_return_void(&rdev->wiphy); |
| 948 | } |
| 949 | |
Ayala Beker | a442b76 | 2016-09-20 17:31:15 +0300 | [diff] [blame] | 950 | static inline int |
| 951 | rdev_add_nan_func(struct cfg80211_registered_device *rdev, |
| 952 | struct wireless_dev *wdev, |
| 953 | struct cfg80211_nan_func *nan_func) |
| 954 | { |
| 955 | int ret; |
| 956 | |
| 957 | trace_rdev_add_nan_func(&rdev->wiphy, wdev, nan_func); |
| 958 | ret = rdev->ops->add_nan_func(&rdev->wiphy, wdev, nan_func); |
| 959 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 960 | return ret; |
| 961 | } |
| 962 | |
| 963 | static inline void rdev_del_nan_func(struct cfg80211_registered_device *rdev, |
| 964 | struct wireless_dev *wdev, u64 cookie) |
| 965 | { |
| 966 | trace_rdev_del_nan_func(&rdev->wiphy, wdev, cookie); |
| 967 | rdev->ops->del_nan_func(&rdev->wiphy, wdev, cookie); |
| 968 | trace_rdev_return_void(&rdev->wiphy); |
| 969 | } |
| 970 | |
Ayala Beker | a5a9dcf | 2016-09-20 17:31:16 +0300 | [diff] [blame] | 971 | static inline int |
| 972 | rdev_nan_change_conf(struct cfg80211_registered_device *rdev, |
| 973 | struct wireless_dev *wdev, |
| 974 | struct cfg80211_nan_conf *conf, u32 changes) |
| 975 | { |
| 976 | int ret; |
| 977 | |
| 978 | trace_rdev_nan_change_conf(&rdev->wiphy, wdev, conf, changes); |
| 979 | if (rdev->ops->nan_change_conf) |
| 980 | ret = rdev->ops->nan_change_conf(&rdev->wiphy, wdev, conf, |
| 981 | changes); |
| 982 | else |
| 983 | ret = -ENOTSUPP; |
| 984 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 985 | return ret; |
| 986 | } |
| 987 | |
Vasanthakumar Thiagarajan | 77765ea | 2013-01-18 11:18:45 +0530 | [diff] [blame] | 988 | static inline int rdev_set_mac_acl(struct cfg80211_registered_device *rdev, |
| 989 | struct net_device *dev, |
| 990 | struct cfg80211_acl_data *params) |
| 991 | { |
| 992 | int ret; |
| 993 | |
| 994 | trace_rdev_set_mac_acl(&rdev->wiphy, dev, params); |
| 995 | ret = rdev->ops->set_mac_acl(&rdev->wiphy, dev, params); |
| 996 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 997 | return ret; |
| 998 | } |
Jouni Malinen | 355199e | 2013-02-27 17:14:27 +0200 | [diff] [blame] | 999 | |
| 1000 | static inline int rdev_update_ft_ies(struct cfg80211_registered_device *rdev, |
| 1001 | struct net_device *dev, |
| 1002 | struct cfg80211_update_ft_ies_params *ftie) |
| 1003 | { |
| 1004 | int ret; |
| 1005 | |
| 1006 | trace_rdev_update_ft_ies(&rdev->wiphy, dev, ftie); |
| 1007 | ret = rdev->ops->update_ft_ies(&rdev->wiphy, dev, ftie); |
| 1008 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1009 | return ret; |
| 1010 | } |
| 1011 | |
Arend van Spriel | 5de1798 | 2013-04-18 15:49:00 +0200 | [diff] [blame] | 1012 | static inline int rdev_crit_proto_start(struct cfg80211_registered_device *rdev, |
| 1013 | struct wireless_dev *wdev, |
| 1014 | enum nl80211_crit_proto_id protocol, |
| 1015 | u16 duration) |
| 1016 | { |
| 1017 | int ret; |
| 1018 | |
| 1019 | trace_rdev_crit_proto_start(&rdev->wiphy, wdev, protocol, duration); |
| 1020 | ret = rdev->ops->crit_proto_start(&rdev->wiphy, wdev, |
| 1021 | protocol, duration); |
| 1022 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1023 | return ret; |
| 1024 | } |
| 1025 | |
| 1026 | static inline void rdev_crit_proto_stop(struct cfg80211_registered_device *rdev, |
| 1027 | struct wireless_dev *wdev) |
| 1028 | { |
| 1029 | trace_rdev_crit_proto_stop(&rdev->wiphy, wdev); |
| 1030 | rdev->ops->crit_proto_stop(&rdev->wiphy, wdev); |
| 1031 | trace_rdev_return_void(&rdev->wiphy); |
| 1032 | } |
| 1033 | |
Simon Wunderlich | 16ef1fe | 2013-07-11 16:09:05 +0200 | [diff] [blame] | 1034 | static inline int rdev_channel_switch(struct cfg80211_registered_device *rdev, |
| 1035 | struct net_device *dev, |
| 1036 | struct cfg80211_csa_settings *params) |
| 1037 | { |
| 1038 | int ret; |
| 1039 | |
| 1040 | trace_rdev_channel_switch(&rdev->wiphy, dev, params); |
| 1041 | ret = rdev->ops->channel_switch(&rdev->wiphy, dev, params); |
| 1042 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1043 | return ret; |
| 1044 | } |
| 1045 | |
Kyeyoon Park | fa9ffc7 | 2013-12-16 23:01:30 -0800 | [diff] [blame] | 1046 | static inline int rdev_set_qos_map(struct cfg80211_registered_device *rdev, |
| 1047 | struct net_device *dev, |
| 1048 | struct cfg80211_qos_map *qos_map) |
| 1049 | { |
| 1050 | int ret = -EOPNOTSUPP; |
| 1051 | |
| 1052 | if (rdev->ops->set_qos_map) { |
| 1053 | trace_rdev_set_qos_map(&rdev->wiphy, dev, qos_map); |
| 1054 | ret = rdev->ops->set_qos_map(&rdev->wiphy, dev, qos_map); |
| 1055 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1056 | } |
| 1057 | |
| 1058 | return ret; |
| 1059 | } |
| 1060 | |
Jouni Malinen | e16821b | 2014-04-28 11:22:08 +0300 | [diff] [blame] | 1061 | static inline int |
| 1062 | rdev_set_ap_chanwidth(struct cfg80211_registered_device *rdev, |
| 1063 | struct net_device *dev, struct cfg80211_chan_def *chandef) |
| 1064 | { |
| 1065 | int ret; |
| 1066 | |
| 1067 | trace_rdev_set_ap_chanwidth(&rdev->wiphy, dev, chandef); |
| 1068 | ret = rdev->ops->set_ap_chanwidth(&rdev->wiphy, dev, chandef); |
| 1069 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1070 | |
| 1071 | return ret; |
| 1072 | } |
| 1073 | |
Johannes Berg | 960d01a | 2014-09-09 22:55:35 +0300 | [diff] [blame] | 1074 | static inline int |
| 1075 | rdev_add_tx_ts(struct cfg80211_registered_device *rdev, |
| 1076 | struct net_device *dev, u8 tsid, const u8 *peer, |
| 1077 | u8 user_prio, u16 admitted_time) |
| 1078 | { |
| 1079 | int ret = -EOPNOTSUPP; |
| 1080 | |
| 1081 | trace_rdev_add_tx_ts(&rdev->wiphy, dev, tsid, peer, |
| 1082 | user_prio, admitted_time); |
| 1083 | if (rdev->ops->add_tx_ts) |
| 1084 | ret = rdev->ops->add_tx_ts(&rdev->wiphy, dev, tsid, peer, |
| 1085 | user_prio, admitted_time); |
| 1086 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1087 | |
| 1088 | return ret; |
| 1089 | } |
| 1090 | |
| 1091 | static inline int |
| 1092 | rdev_del_tx_ts(struct cfg80211_registered_device *rdev, |
| 1093 | struct net_device *dev, u8 tsid, const u8 *peer) |
| 1094 | { |
| 1095 | int ret = -EOPNOTSUPP; |
| 1096 | |
| 1097 | trace_rdev_del_tx_ts(&rdev->wiphy, dev, tsid, peer); |
| 1098 | if (rdev->ops->del_tx_ts) |
| 1099 | ret = rdev->ops->del_tx_ts(&rdev->wiphy, dev, tsid, peer); |
| 1100 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1101 | |
| 1102 | return ret; |
| 1103 | } |
| 1104 | |
Arik Nemtsov | 1057d35 | 2014-11-19 12:54:26 +0200 | [diff] [blame] | 1105 | static inline int |
| 1106 | rdev_tdls_channel_switch(struct cfg80211_registered_device *rdev, |
| 1107 | struct net_device *dev, const u8 *addr, |
| 1108 | u8 oper_class, struct cfg80211_chan_def *chandef) |
| 1109 | { |
| 1110 | int ret; |
| 1111 | |
| 1112 | trace_rdev_tdls_channel_switch(&rdev->wiphy, dev, addr, oper_class, |
| 1113 | chandef); |
| 1114 | ret = rdev->ops->tdls_channel_switch(&rdev->wiphy, dev, addr, |
| 1115 | oper_class, chandef); |
| 1116 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1117 | return ret; |
| 1118 | } |
| 1119 | |
| 1120 | static inline void |
| 1121 | rdev_tdls_cancel_channel_switch(struct cfg80211_registered_device *rdev, |
| 1122 | struct net_device *dev, const u8 *addr) |
| 1123 | { |
| 1124 | trace_rdev_tdls_cancel_channel_switch(&rdev->wiphy, dev, addr); |
| 1125 | rdev->ops->tdls_cancel_channel_switch(&rdev->wiphy, dev, addr); |
| 1126 | trace_rdev_return_void(&rdev->wiphy); |
| 1127 | } |
| 1128 | |
Ilan Peer | a1056b1 | 2015-10-22 22:27:46 +0300 | [diff] [blame] | 1129 | static inline int |
| 1130 | rdev_start_radar_detection(struct cfg80211_registered_device *rdev, |
| 1131 | struct net_device *dev, |
| 1132 | struct cfg80211_chan_def *chandef, |
| 1133 | u32 cac_time_ms) |
| 1134 | { |
| 1135 | int ret = -ENOTSUPP; |
| 1136 | |
| 1137 | trace_rdev_start_radar_detection(&rdev->wiphy, dev, chandef, |
| 1138 | cac_time_ms); |
| 1139 | if (rdev->ops->start_radar_detection) |
| 1140 | ret = rdev->ops->start_radar_detection(&rdev->wiphy, dev, |
| 1141 | chandef, cac_time_ms); |
| 1142 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1143 | return ret; |
| 1144 | } |
| 1145 | |
Orr Mazor | 2dbb6fa | 2019-12-22 14:55:31 +0000 | [diff] [blame] | 1146 | static inline void |
| 1147 | rdev_end_cac(struct cfg80211_registered_device *rdev, |
| 1148 | struct net_device *dev) |
| 1149 | { |
| 1150 | trace_rdev_end_cac(&rdev->wiphy, dev); |
| 1151 | if (rdev->ops->end_cac) |
| 1152 | rdev->ops->end_cac(&rdev->wiphy, dev); |
| 1153 | trace_rdev_return_void(&rdev->wiphy); |
| 1154 | } |
| 1155 | |
Ilan Peer | a1056b1 | 2015-10-22 22:27:46 +0300 | [diff] [blame] | 1156 | static inline int |
| 1157 | rdev_set_mcast_rate(struct cfg80211_registered_device *rdev, |
| 1158 | struct net_device *dev, |
Johannes Berg | 57fbcce | 2016-04-12 15:56:15 +0200 | [diff] [blame] | 1159 | int mcast_rate[NUM_NL80211_BANDS]) |
Ilan Peer | a1056b1 | 2015-10-22 22:27:46 +0300 | [diff] [blame] | 1160 | { |
| 1161 | int ret = -ENOTSUPP; |
| 1162 | |
| 1163 | trace_rdev_set_mcast_rate(&rdev->wiphy, dev, mcast_rate); |
| 1164 | if (rdev->ops->set_mcast_rate) |
| 1165 | ret = rdev->ops->set_mcast_rate(&rdev->wiphy, dev, mcast_rate); |
| 1166 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1167 | return ret; |
| 1168 | } |
| 1169 | |
| 1170 | static inline int |
| 1171 | rdev_set_coalesce(struct cfg80211_registered_device *rdev, |
| 1172 | struct cfg80211_coalesce *coalesce) |
| 1173 | { |
| 1174 | int ret = -ENOTSUPP; |
| 1175 | |
| 1176 | trace_rdev_set_coalesce(&rdev->wiphy, coalesce); |
| 1177 | if (rdev->ops->set_coalesce) |
| 1178 | ret = rdev->ops->set_coalesce(&rdev->wiphy, coalesce); |
| 1179 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1180 | return ret; |
| 1181 | } |
Avraham Stern | 3a00df5 | 2017-06-09 13:08:43 +0100 | [diff] [blame] | 1182 | |
| 1183 | static inline int rdev_set_pmk(struct cfg80211_registered_device *rdev, |
| 1184 | struct net_device *dev, |
| 1185 | struct cfg80211_pmk_conf *pmk_conf) |
| 1186 | { |
| 1187 | int ret = -EOPNOTSUPP; |
| 1188 | |
| 1189 | trace_rdev_set_pmk(&rdev->wiphy, dev, pmk_conf); |
| 1190 | if (rdev->ops->set_pmk) |
| 1191 | ret = rdev->ops->set_pmk(&rdev->wiphy, dev, pmk_conf); |
| 1192 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1193 | return ret; |
| 1194 | } |
| 1195 | |
| 1196 | static inline int rdev_del_pmk(struct cfg80211_registered_device *rdev, |
| 1197 | struct net_device *dev, const u8 *aa) |
| 1198 | { |
| 1199 | int ret = -EOPNOTSUPP; |
| 1200 | |
| 1201 | trace_rdev_del_pmk(&rdev->wiphy, dev, aa); |
| 1202 | if (rdev->ops->del_pmk) |
| 1203 | ret = rdev->ops->del_pmk(&rdev->wiphy, dev, aa); |
| 1204 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1205 | return ret; |
| 1206 | } |
Xiang Wu | aa8ca5e | 2020-03-03 02:10:26 +0800 | [diff] [blame] | 1207 | |
| 1208 | static inline int |
| 1209 | rdev_external_auth(struct cfg80211_registered_device *rdev, |
| 1210 | struct net_device *dev, |
| 1211 | struct cfg80211_external_auth_params *params) |
| 1212 | { |
| 1213 | int ret = -EOPNOTSUPP; |
| 1214 | |
| 1215 | trace_rdev_external_auth(&rdev->wiphy, dev, params); |
| 1216 | if (rdev->ops->external_auth) |
| 1217 | ret = rdev->ops->external_auth(&rdev->wiphy, dev, params); |
| 1218 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1219 | return ret; |
| 1220 | } |
| 1221 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 1222 | #endif /* __CFG80211_RDEV_OPS */ |