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; |
Alexander Wetzel | 6cdd397 | 2019-03-19 21:34:07 +0100 | [diff] [blame] | 80 | trace_rdev_add_key(&rdev->wiphy, netdev, key_index, pairwise, |
| 81 | mac_addr, params->mode); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 82 | ret = rdev->ops->add_key(&rdev->wiphy, netdev, key_index, pairwise, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 83 | mac_addr, params); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 84 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 85 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | static inline int |
| 89 | rdev_get_key(struct cfg80211_registered_device *rdev, struct net_device *netdev, |
| 90 | u8 key_index, bool pairwise, const u8 *mac_addr, void *cookie, |
| 91 | void (*callback)(void *cookie, struct key_params*)) |
| 92 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 93 | int ret; |
| 94 | trace_rdev_get_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr); |
| 95 | ret = rdev->ops->get_key(&rdev->wiphy, netdev, key_index, pairwise, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 96 | mac_addr, cookie, callback); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 97 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 98 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 99 | } |
| 100 | |
| 101 | static inline int rdev_del_key(struct cfg80211_registered_device *rdev, |
| 102 | struct net_device *netdev, u8 key_index, |
| 103 | bool pairwise, const u8 *mac_addr) |
| 104 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 105 | int ret; |
| 106 | trace_rdev_del_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr); |
| 107 | ret = rdev->ops->del_key(&rdev->wiphy, netdev, key_index, pairwise, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 108 | mac_addr); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 109 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 110 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 111 | } |
| 112 | |
| 113 | static inline int |
| 114 | rdev_set_default_key(struct cfg80211_registered_device *rdev, |
| 115 | struct net_device *netdev, u8 key_index, bool unicast, |
| 116 | bool multicast) |
| 117 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 118 | int ret; |
| 119 | trace_rdev_set_default_key(&rdev->wiphy, netdev, key_index, |
| 120 | unicast, multicast); |
| 121 | ret = rdev->ops->set_default_key(&rdev->wiphy, netdev, key_index, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 122 | unicast, multicast); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 123 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 124 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 125 | } |
| 126 | |
| 127 | static inline int |
| 128 | rdev_set_default_mgmt_key(struct cfg80211_registered_device *rdev, |
| 129 | struct net_device *netdev, u8 key_index) |
| 130 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 131 | int ret; |
| 132 | trace_rdev_set_default_mgmt_key(&rdev->wiphy, netdev, key_index); |
| 133 | ret = rdev->ops->set_default_mgmt_key(&rdev->wiphy, netdev, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 134 | key_index); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 135 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 136 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 137 | } |
| 138 | |
Jouni Malinen | 56be393 | 2020-02-22 15:25:43 +0200 | [diff] [blame] | 139 | static inline int |
| 140 | rdev_set_default_beacon_key(struct cfg80211_registered_device *rdev, |
| 141 | struct net_device *netdev, u8 key_index) |
| 142 | { |
| 143 | int ret; |
| 144 | |
| 145 | trace_rdev_set_default_beacon_key(&rdev->wiphy, netdev, key_index); |
| 146 | ret = rdev->ops->set_default_beacon_key(&rdev->wiphy, netdev, |
| 147 | key_index); |
| 148 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 149 | return ret; |
| 150 | } |
| 151 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 152 | static inline int rdev_start_ap(struct cfg80211_registered_device *rdev, |
| 153 | struct net_device *dev, |
| 154 | struct cfg80211_ap_settings *settings) |
| 155 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 156 | int ret; |
| 157 | trace_rdev_start_ap(&rdev->wiphy, dev, settings); |
| 158 | ret = rdev->ops->start_ap(&rdev->wiphy, dev, settings); |
| 159 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 160 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | static inline int rdev_change_beacon(struct cfg80211_registered_device *rdev, |
| 164 | struct net_device *dev, |
| 165 | struct cfg80211_beacon_data *info) |
| 166 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 167 | int ret; |
| 168 | trace_rdev_change_beacon(&rdev->wiphy, dev, info); |
| 169 | ret = rdev->ops->change_beacon(&rdev->wiphy, dev, info); |
| 170 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 171 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 172 | } |
| 173 | |
| 174 | static inline int rdev_stop_ap(struct cfg80211_registered_device *rdev, |
| 175 | struct net_device *dev) |
| 176 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 177 | int ret; |
| 178 | trace_rdev_stop_ap(&rdev->wiphy, dev); |
| 179 | ret = rdev->ops->stop_ap(&rdev->wiphy, dev); |
| 180 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 181 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | static inline int rdev_add_station(struct cfg80211_registered_device *rdev, |
| 185 | struct net_device *dev, u8 *mac, |
| 186 | struct station_parameters *params) |
| 187 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 188 | int ret; |
| 189 | trace_rdev_add_station(&rdev->wiphy, dev, mac, params); |
| 190 | ret = rdev->ops->add_station(&rdev->wiphy, dev, mac, params); |
| 191 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 192 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 193 | } |
| 194 | |
| 195 | static inline int rdev_del_station(struct cfg80211_registered_device *rdev, |
Jouni Malinen | 89c771e | 2014-10-10 20:52:40 +0300 | [diff] [blame] | 196 | struct net_device *dev, |
| 197 | struct station_del_parameters *params) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 198 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 199 | int ret; |
Jouni Malinen | 89c771e | 2014-10-10 20:52:40 +0300 | [diff] [blame] | 200 | trace_rdev_del_station(&rdev->wiphy, dev, params); |
| 201 | ret = rdev->ops->del_station(&rdev->wiphy, dev, params); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 202 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 203 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 204 | } |
| 205 | |
| 206 | static inline int rdev_change_station(struct cfg80211_registered_device *rdev, |
| 207 | struct net_device *dev, u8 *mac, |
| 208 | struct station_parameters *params) |
| 209 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 210 | int ret; |
| 211 | trace_rdev_change_station(&rdev->wiphy, dev, mac, params); |
| 212 | ret = rdev->ops->change_station(&rdev->wiphy, dev, mac, params); |
| 213 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 214 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | static inline int rdev_get_station(struct cfg80211_registered_device *rdev, |
Antonio Quartulli | 7406353 | 2014-05-19 21:53:21 +0200 | [diff] [blame] | 218 | struct net_device *dev, const u8 *mac, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 219 | struct station_info *sinfo) |
| 220 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 221 | int ret; |
| 222 | trace_rdev_get_station(&rdev->wiphy, dev, mac); |
| 223 | ret = rdev->ops->get_station(&rdev->wiphy, dev, mac, sinfo); |
| 224 | trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo); |
| 225 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 226 | } |
| 227 | |
| 228 | static inline int rdev_dump_station(struct cfg80211_registered_device *rdev, |
| 229 | struct net_device *dev, int idx, u8 *mac, |
| 230 | struct station_info *sinfo) |
| 231 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 232 | int ret; |
| 233 | trace_rdev_dump_station(&rdev->wiphy, dev, idx, mac); |
| 234 | ret = rdev->ops->dump_station(&rdev->wiphy, dev, idx, mac, sinfo); |
| 235 | trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo); |
| 236 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 237 | } |
| 238 | |
| 239 | static inline int rdev_add_mpath(struct cfg80211_registered_device *rdev, |
| 240 | struct net_device *dev, u8 *dst, u8 *next_hop) |
| 241 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 242 | int ret; |
| 243 | trace_rdev_add_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 244 | ret = rdev->ops->add_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 245 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 246 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 247 | } |
| 248 | |
| 249 | static inline int rdev_del_mpath(struct cfg80211_registered_device *rdev, |
| 250 | struct net_device *dev, u8 *dst) |
| 251 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 252 | int ret; |
| 253 | trace_rdev_del_mpath(&rdev->wiphy, dev, dst); |
| 254 | ret = rdev->ops->del_mpath(&rdev->wiphy, dev, dst); |
| 255 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 256 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 257 | } |
| 258 | |
| 259 | static inline int rdev_change_mpath(struct cfg80211_registered_device *rdev, |
| 260 | struct net_device *dev, u8 *dst, |
| 261 | u8 *next_hop) |
| 262 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 263 | int ret; |
| 264 | trace_rdev_change_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 265 | ret = rdev->ops->change_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 266 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 267 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 268 | } |
| 269 | |
| 270 | static inline int rdev_get_mpath(struct cfg80211_registered_device *rdev, |
| 271 | struct net_device *dev, u8 *dst, u8 *next_hop, |
| 272 | struct mpath_info *pinfo) |
| 273 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 274 | int ret; |
| 275 | trace_rdev_get_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 276 | ret = rdev->ops->get_mpath(&rdev->wiphy, dev, dst, next_hop, pinfo); |
| 277 | trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo); |
| 278 | return ret; |
| 279 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 280 | } |
| 281 | |
Henning Rogge | 66be7d2 | 2014-09-12 08:58:49 +0200 | [diff] [blame] | 282 | static inline int rdev_get_mpp(struct cfg80211_registered_device *rdev, |
| 283 | struct net_device *dev, u8 *dst, u8 *mpp, |
| 284 | struct mpath_info *pinfo) |
| 285 | { |
| 286 | int ret; |
| 287 | |
| 288 | trace_rdev_get_mpp(&rdev->wiphy, dev, dst, mpp); |
| 289 | ret = rdev->ops->get_mpp(&rdev->wiphy, dev, dst, mpp, pinfo); |
| 290 | trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo); |
| 291 | return ret; |
| 292 | } |
| 293 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 294 | static inline int rdev_dump_mpath(struct cfg80211_registered_device *rdev, |
| 295 | struct net_device *dev, int idx, u8 *dst, |
| 296 | u8 *next_hop, struct mpath_info *pinfo) |
| 297 | |
| 298 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 299 | int ret; |
| 300 | trace_rdev_dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop); |
| 301 | ret = rdev->ops->dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop, |
Henning Rogge | 66be7d2 | 2014-09-12 08:58:49 +0200 | [diff] [blame] | 302 | pinfo); |
| 303 | trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo); |
| 304 | return ret; |
| 305 | } |
| 306 | |
| 307 | static inline int rdev_dump_mpp(struct cfg80211_registered_device *rdev, |
| 308 | struct net_device *dev, int idx, u8 *dst, |
| 309 | u8 *mpp, struct mpath_info *pinfo) |
| 310 | |
| 311 | { |
| 312 | int ret; |
| 313 | |
| 314 | trace_rdev_dump_mpp(&rdev->wiphy, dev, idx, dst, mpp); |
| 315 | ret = rdev->ops->dump_mpp(&rdev->wiphy, dev, idx, dst, mpp, pinfo); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 316 | trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo); |
| 317 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 318 | } |
| 319 | |
| 320 | static inline int |
| 321 | rdev_get_mesh_config(struct cfg80211_registered_device *rdev, |
| 322 | struct net_device *dev, struct mesh_config *conf) |
| 323 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 324 | int ret; |
| 325 | trace_rdev_get_mesh_config(&rdev->wiphy, dev); |
| 326 | ret = rdev->ops->get_mesh_config(&rdev->wiphy, dev, conf); |
| 327 | trace_rdev_return_int_mesh_config(&rdev->wiphy, ret, conf); |
| 328 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 329 | } |
| 330 | |
| 331 | static inline int |
| 332 | rdev_update_mesh_config(struct cfg80211_registered_device *rdev, |
| 333 | struct net_device *dev, u32 mask, |
| 334 | const struct mesh_config *nconf) |
| 335 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 336 | int ret; |
| 337 | trace_rdev_update_mesh_config(&rdev->wiphy, dev, mask, nconf); |
| 338 | ret = rdev->ops->update_mesh_config(&rdev->wiphy, dev, mask, nconf); |
| 339 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 340 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 341 | } |
| 342 | |
| 343 | static inline int rdev_join_mesh(struct cfg80211_registered_device *rdev, |
| 344 | struct net_device *dev, |
| 345 | const struct mesh_config *conf, |
| 346 | const struct mesh_setup *setup) |
| 347 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 348 | int ret; |
| 349 | trace_rdev_join_mesh(&rdev->wiphy, dev, conf, setup); |
| 350 | ret = rdev->ops->join_mesh(&rdev->wiphy, dev, conf, setup); |
| 351 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 352 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 353 | } |
| 354 | |
| 355 | |
| 356 | static inline int rdev_leave_mesh(struct cfg80211_registered_device *rdev, |
| 357 | struct net_device *dev) |
| 358 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 359 | int ret; |
| 360 | trace_rdev_leave_mesh(&rdev->wiphy, dev); |
| 361 | ret = rdev->ops->leave_mesh(&rdev->wiphy, dev); |
| 362 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 363 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 364 | } |
| 365 | |
Rostislav Lisovy | 6e0bd6c | 2014-11-03 10:33:18 +0100 | [diff] [blame] | 366 | static inline int rdev_join_ocb(struct cfg80211_registered_device *rdev, |
| 367 | struct net_device *dev, |
| 368 | struct ocb_setup *setup) |
| 369 | { |
| 370 | int ret; |
| 371 | trace_rdev_join_ocb(&rdev->wiphy, dev, setup); |
| 372 | ret = rdev->ops->join_ocb(&rdev->wiphy, dev, setup); |
| 373 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 374 | return ret; |
| 375 | } |
| 376 | |
| 377 | static inline int rdev_leave_ocb(struct cfg80211_registered_device *rdev, |
| 378 | struct net_device *dev) |
| 379 | { |
| 380 | int ret; |
| 381 | trace_rdev_leave_ocb(&rdev->wiphy, dev); |
| 382 | ret = rdev->ops->leave_ocb(&rdev->wiphy, dev); |
| 383 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 384 | return ret; |
| 385 | } |
| 386 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 387 | static inline int rdev_change_bss(struct cfg80211_registered_device *rdev, |
| 388 | struct net_device *dev, |
| 389 | struct bss_parameters *params) |
| 390 | |
| 391 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 392 | int ret; |
| 393 | trace_rdev_change_bss(&rdev->wiphy, dev, params); |
| 394 | ret = rdev->ops->change_bss(&rdev->wiphy, dev, params); |
| 395 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 396 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 397 | } |
| 398 | |
| 399 | static inline int rdev_set_txq_params(struct cfg80211_registered_device *rdev, |
| 400 | struct net_device *dev, |
| 401 | struct ieee80211_txq_params *params) |
| 402 | |
| 403 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 404 | int ret; |
| 405 | trace_rdev_set_txq_params(&rdev->wiphy, dev, params); |
| 406 | ret = rdev->ops->set_txq_params(&rdev->wiphy, dev, params); |
| 407 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 408 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 409 | } |
| 410 | |
| 411 | static inline int |
| 412 | rdev_libertas_set_mesh_channel(struct cfg80211_registered_device *rdev, |
| 413 | struct net_device *dev, |
| 414 | struct ieee80211_channel *chan) |
| 415 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 416 | int ret; |
| 417 | trace_rdev_libertas_set_mesh_channel(&rdev->wiphy, dev, chan); |
| 418 | ret = rdev->ops->libertas_set_mesh_channel(&rdev->wiphy, dev, chan); |
| 419 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 420 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 421 | } |
| 422 | |
| 423 | static inline int |
| 424 | rdev_set_monitor_channel(struct cfg80211_registered_device *rdev, |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 425 | struct cfg80211_chan_def *chandef) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 426 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 427 | int ret; |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 428 | trace_rdev_set_monitor_channel(&rdev->wiphy, chandef); |
| 429 | ret = rdev->ops->set_monitor_channel(&rdev->wiphy, chandef); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 430 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 431 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 432 | } |
| 433 | |
| 434 | static inline int rdev_scan(struct cfg80211_registered_device *rdev, |
| 435 | struct cfg80211_scan_request *request) |
| 436 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 437 | int ret; |
| 438 | trace_rdev_scan(&rdev->wiphy, request); |
| 439 | ret = rdev->ops->scan(&rdev->wiphy, request); |
| 440 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 441 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 442 | } |
| 443 | |
Vidyullatha Kanchanapally | 91d3ab4 | 2015-10-30 19:14:49 +0530 | [diff] [blame] | 444 | static inline void rdev_abort_scan(struct cfg80211_registered_device *rdev, |
| 445 | struct wireless_dev *wdev) |
| 446 | { |
| 447 | trace_rdev_abort_scan(&rdev->wiphy, wdev); |
| 448 | rdev->ops->abort_scan(&rdev->wiphy, wdev); |
| 449 | trace_rdev_return_void(&rdev->wiphy); |
| 450 | } |
| 451 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 452 | static inline int rdev_auth(struct cfg80211_registered_device *rdev, |
| 453 | struct net_device *dev, |
| 454 | struct cfg80211_auth_request *req) |
| 455 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 456 | int ret; |
| 457 | trace_rdev_auth(&rdev->wiphy, dev, req); |
| 458 | ret = rdev->ops->auth(&rdev->wiphy, dev, req); |
| 459 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 460 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 461 | } |
| 462 | |
| 463 | static inline int rdev_assoc(struct cfg80211_registered_device *rdev, |
| 464 | struct net_device *dev, |
| 465 | struct cfg80211_assoc_request *req) |
| 466 | { |
Johannes Berg | 64a8747 | 2021-06-18 13:41:48 +0300 | [diff] [blame] | 467 | const struct cfg80211_bss_ies *bss_ies; |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 468 | int ret; |
Johannes Berg | 64a8747 | 2021-06-18 13:41:48 +0300 | [diff] [blame] | 469 | |
| 470 | /* |
| 471 | * Note: we might trace not exactly the data that's processed, |
| 472 | * due to races and the driver/mac80211 getting a newer copy. |
| 473 | */ |
| 474 | rcu_read_lock(); |
| 475 | bss_ies = rcu_dereference(req->bss->ies); |
| 476 | trace_rdev_assoc(&rdev->wiphy, dev, req, bss_ies); |
| 477 | rcu_read_unlock(); |
| 478 | |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 479 | ret = rdev->ops->assoc(&rdev->wiphy, dev, req); |
| 480 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 481 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 482 | } |
| 483 | |
| 484 | static inline int rdev_deauth(struct cfg80211_registered_device *rdev, |
| 485 | struct net_device *dev, |
| 486 | struct cfg80211_deauth_request *req) |
| 487 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 488 | int ret; |
| 489 | trace_rdev_deauth(&rdev->wiphy, dev, req); |
| 490 | ret = rdev->ops->deauth(&rdev->wiphy, dev, req); |
| 491 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 492 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 493 | } |
| 494 | |
| 495 | static inline int rdev_disassoc(struct cfg80211_registered_device *rdev, |
| 496 | struct net_device *dev, |
| 497 | struct cfg80211_disassoc_request *req) |
| 498 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 499 | int ret; |
| 500 | trace_rdev_disassoc(&rdev->wiphy, dev, req); |
| 501 | ret = rdev->ops->disassoc(&rdev->wiphy, dev, req); |
| 502 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 503 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 504 | } |
| 505 | |
| 506 | static inline int rdev_connect(struct cfg80211_registered_device *rdev, |
| 507 | struct net_device *dev, |
| 508 | struct cfg80211_connect_params *sme) |
| 509 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 510 | int ret; |
| 511 | trace_rdev_connect(&rdev->wiphy, dev, sme); |
| 512 | ret = rdev->ops->connect(&rdev->wiphy, dev, sme); |
| 513 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 514 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 515 | } |
| 516 | |
vamsi krishna | 088e8df | 2016-10-27 16:51:11 +0300 | [diff] [blame] | 517 | static inline int |
| 518 | rdev_update_connect_params(struct cfg80211_registered_device *rdev, |
| 519 | struct net_device *dev, |
| 520 | struct cfg80211_connect_params *sme, u32 changed) |
| 521 | { |
| 522 | int ret; |
| 523 | trace_rdev_update_connect_params(&rdev->wiphy, dev, sme, changed); |
| 524 | ret = rdev->ops->update_connect_params(&rdev->wiphy, dev, sme, changed); |
| 525 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 526 | return ret; |
| 527 | } |
| 528 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 529 | static inline int rdev_disconnect(struct cfg80211_registered_device *rdev, |
| 530 | struct net_device *dev, u16 reason_code) |
| 531 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 532 | int ret; |
| 533 | trace_rdev_disconnect(&rdev->wiphy, dev, reason_code); |
| 534 | ret = rdev->ops->disconnect(&rdev->wiphy, dev, reason_code); |
| 535 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 536 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 537 | } |
| 538 | |
| 539 | static inline int rdev_join_ibss(struct cfg80211_registered_device *rdev, |
| 540 | struct net_device *dev, |
| 541 | struct cfg80211_ibss_params *params) |
| 542 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 543 | int ret; |
| 544 | trace_rdev_join_ibss(&rdev->wiphy, dev, params); |
| 545 | ret = rdev->ops->join_ibss(&rdev->wiphy, dev, params); |
| 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_leave_ibss(struct cfg80211_registered_device *rdev, |
| 551 | struct net_device *dev) |
| 552 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 553 | int ret; |
| 554 | trace_rdev_leave_ibss(&rdev->wiphy, dev); |
| 555 | ret = rdev->ops->leave_ibss(&rdev->wiphy, dev); |
| 556 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 557 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 558 | } |
| 559 | |
| 560 | static inline int |
| 561 | rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed) |
| 562 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 563 | int ret; |
Johannes Berg | 24953de | 2020-01-13 12:53:59 +0100 | [diff] [blame] | 564 | |
| 565 | if (!rdev->ops->set_wiphy_params) |
| 566 | return -EOPNOTSUPP; |
| 567 | |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 568 | trace_rdev_set_wiphy_params(&rdev->wiphy, changed); |
| 569 | ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed); |
| 570 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 571 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 572 | } |
| 573 | |
| 574 | static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev, |
Johannes Berg | c844211 | 2012-10-24 10:17:18 +0200 | [diff] [blame] | 575 | struct wireless_dev *wdev, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 576 | enum nl80211_tx_power_setting type, int mbm) |
| 577 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 578 | int ret; |
Johannes Berg | c844211 | 2012-10-24 10:17:18 +0200 | [diff] [blame] | 579 | trace_rdev_set_tx_power(&rdev->wiphy, wdev, type, mbm); |
| 580 | ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, type, mbm); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 581 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 582 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 583 | } |
| 584 | |
| 585 | static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev, |
Johannes Berg | c844211 | 2012-10-24 10:17:18 +0200 | [diff] [blame] | 586 | struct wireless_dev *wdev, int *dbm) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 587 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 588 | int ret; |
Johannes Berg | c844211 | 2012-10-24 10:17:18 +0200 | [diff] [blame] | 589 | trace_rdev_get_tx_power(&rdev->wiphy, wdev); |
| 590 | ret = rdev->ops->get_tx_power(&rdev->wiphy, wdev, dbm); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 591 | trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm); |
| 592 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 593 | } |
| 594 | |
Michael Braun | ce0ce13 | 2016-10-10 19:12:22 +0200 | [diff] [blame] | 595 | static inline int |
| 596 | rdev_set_multicast_to_unicast(struct cfg80211_registered_device *rdev, |
| 597 | struct net_device *dev, |
| 598 | const bool enabled) |
| 599 | { |
| 600 | int ret; |
| 601 | trace_rdev_set_multicast_to_unicast(&rdev->wiphy, dev, enabled); |
| 602 | ret = rdev->ops->set_multicast_to_unicast(&rdev->wiphy, dev, enabled); |
| 603 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 604 | return ret; |
| 605 | } |
| 606 | |
Toke Høiland-Jørgensen | 52539ca | 2018-05-08 13:03:50 +0200 | [diff] [blame] | 607 | static inline int |
| 608 | rdev_get_txq_stats(struct cfg80211_registered_device *rdev, |
| 609 | struct wireless_dev *wdev, |
| 610 | struct cfg80211_txq_stats *txqstats) |
| 611 | { |
| 612 | int ret; |
| 613 | trace_rdev_get_txq_stats(&rdev->wiphy, wdev); |
| 614 | ret = rdev->ops->get_txq_stats(&rdev->wiphy, wdev, txqstats); |
| 615 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 616 | return ret; |
| 617 | } |
| 618 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 619 | static inline void rdev_rfkill_poll(struct cfg80211_registered_device *rdev) |
| 620 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 621 | trace_rdev_rfkill_poll(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 622 | rdev->ops->rfkill_poll(&rdev->wiphy); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 623 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 624 | } |
| 625 | |
| 626 | |
| 627 | #ifdef CONFIG_NL80211_TESTMODE |
| 628 | static inline int rdev_testmode_cmd(struct cfg80211_registered_device *rdev, |
David Spinadel | fc73f11 | 2013-07-31 18:04:15 +0300 | [diff] [blame] | 629 | struct wireless_dev *wdev, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 630 | void *data, int len) |
| 631 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 632 | int ret; |
David Spinadel | fc73f11 | 2013-07-31 18:04:15 +0300 | [diff] [blame] | 633 | trace_rdev_testmode_cmd(&rdev->wiphy, wdev); |
| 634 | ret = rdev->ops->testmode_cmd(&rdev->wiphy, wdev, data, len); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 635 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 636 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 637 | } |
| 638 | |
| 639 | static inline int rdev_testmode_dump(struct cfg80211_registered_device *rdev, |
| 640 | struct sk_buff *skb, |
| 641 | struct netlink_callback *cb, void *data, |
| 642 | int len) |
| 643 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 644 | int ret; |
| 645 | trace_rdev_testmode_dump(&rdev->wiphy); |
| 646 | ret = rdev->ops->testmode_dump(&rdev->wiphy, skb, cb, data, len); |
| 647 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 648 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 649 | } |
| 650 | #endif |
| 651 | |
| 652 | static inline int |
| 653 | rdev_set_bitrate_mask(struct cfg80211_registered_device *rdev, |
| 654 | struct net_device *dev, const u8 *peer, |
| 655 | const struct cfg80211_bitrate_mask *mask) |
| 656 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 657 | int ret; |
| 658 | trace_rdev_set_bitrate_mask(&rdev->wiphy, dev, peer, mask); |
| 659 | ret = rdev->ops->set_bitrate_mask(&rdev->wiphy, dev, peer, mask); |
| 660 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 661 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 662 | } |
| 663 | |
| 664 | static inline int rdev_dump_survey(struct cfg80211_registered_device *rdev, |
| 665 | struct net_device *netdev, int idx, |
| 666 | struct survey_info *info) |
| 667 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 668 | int ret; |
| 669 | trace_rdev_dump_survey(&rdev->wiphy, netdev, idx); |
| 670 | ret = rdev->ops->dump_survey(&rdev->wiphy, netdev, idx, info); |
| 671 | if (ret < 0) |
| 672 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 673 | else |
| 674 | trace_rdev_return_int_survey_info(&rdev->wiphy, ret, info); |
| 675 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 676 | } |
| 677 | |
| 678 | static inline int rdev_set_pmksa(struct cfg80211_registered_device *rdev, |
| 679 | struct net_device *netdev, |
| 680 | struct cfg80211_pmksa *pmksa) |
| 681 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 682 | int ret; |
| 683 | trace_rdev_set_pmksa(&rdev->wiphy, netdev, pmksa); |
| 684 | ret = rdev->ops->set_pmksa(&rdev->wiphy, netdev, pmksa); |
| 685 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 686 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 687 | } |
| 688 | |
| 689 | static inline int rdev_del_pmksa(struct cfg80211_registered_device *rdev, |
| 690 | struct net_device *netdev, |
| 691 | struct cfg80211_pmksa *pmksa) |
| 692 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 693 | int ret; |
| 694 | trace_rdev_del_pmksa(&rdev->wiphy, netdev, pmksa); |
| 695 | ret = rdev->ops->del_pmksa(&rdev->wiphy, netdev, pmksa); |
| 696 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 697 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 698 | } |
| 699 | |
| 700 | static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev, |
| 701 | struct net_device *netdev) |
| 702 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 703 | int ret; |
| 704 | trace_rdev_flush_pmksa(&rdev->wiphy, netdev); |
| 705 | ret = rdev->ops->flush_pmksa(&rdev->wiphy, netdev); |
| 706 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 707 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 708 | } |
| 709 | |
| 710 | static inline int |
| 711 | rdev_remain_on_channel(struct cfg80211_registered_device *rdev, |
| 712 | struct wireless_dev *wdev, |
| 713 | struct ieee80211_channel *chan, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 714 | unsigned int duration, u64 *cookie) |
| 715 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 716 | int ret; |
Johannes Berg | 42d97a5 | 2012-11-08 18:31:02 +0100 | [diff] [blame] | 717 | trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 718 | ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan, |
Johannes Berg | 42d97a5 | 2012-11-08 18:31:02 +0100 | [diff] [blame] | 719 | duration, cookie); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 720 | trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); |
| 721 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 722 | } |
| 723 | |
| 724 | static inline int |
| 725 | rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev, |
| 726 | struct wireless_dev *wdev, u64 cookie) |
| 727 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 728 | int ret; |
| 729 | trace_rdev_cancel_remain_on_channel(&rdev->wiphy, wdev, cookie); |
| 730 | ret = rdev->ops->cancel_remain_on_channel(&rdev->wiphy, wdev, cookie); |
| 731 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 732 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 733 | } |
| 734 | |
| 735 | static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev, |
| 736 | struct wireless_dev *wdev, |
Andrei Otcheretianski | b176e62 | 2013-11-18 19:06:49 +0200 | [diff] [blame] | 737 | struct cfg80211_mgmt_tx_params *params, |
| 738 | u64 *cookie) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 739 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 740 | int ret; |
Andrei Otcheretianski | b176e62 | 2013-11-18 19:06:49 +0200 | [diff] [blame] | 741 | trace_rdev_mgmt_tx(&rdev->wiphy, wdev, params); |
| 742 | ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, params, cookie); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 743 | trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); |
| 744 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 745 | } |
| 746 | |
Denis Kenzior | 2576a9a | 2018-03-26 12:52:42 -0500 | [diff] [blame] | 747 | static inline int rdev_tx_control_port(struct cfg80211_registered_device *rdev, |
| 748 | struct net_device *dev, |
| 749 | const void *buf, size_t len, |
Johannes Berg | 8d74a62 | 2020-02-24 10:19:12 +0100 | [diff] [blame] | 750 | const u8 *dest, __be16 proto, |
Markus Theil | dca9ca2 | 2020-05-08 16:42:00 +0200 | [diff] [blame] | 751 | const bool noencrypt, u64 *cookie) |
Denis Kenzior | 2576a9a | 2018-03-26 12:52:42 -0500 | [diff] [blame] | 752 | { |
| 753 | int ret; |
| 754 | trace_rdev_tx_control_port(&rdev->wiphy, dev, buf, len, |
Johannes Berg | 8d74a62 | 2020-02-24 10:19:12 +0100 | [diff] [blame] | 755 | dest, proto, noencrypt); |
Denis Kenzior | 2576a9a | 2018-03-26 12:52:42 -0500 | [diff] [blame] | 756 | ret = rdev->ops->tx_control_port(&rdev->wiphy, dev, buf, len, |
Markus Theil | dca9ca2 | 2020-05-08 16:42:00 +0200 | [diff] [blame] | 757 | dest, proto, noencrypt, cookie); |
| 758 | if (cookie) |
| 759 | trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); |
| 760 | else |
| 761 | trace_rdev_return_int(&rdev->wiphy, ret); |
Denis Kenzior | 2576a9a | 2018-03-26 12:52:42 -0500 | [diff] [blame] | 762 | return ret; |
| 763 | } |
| 764 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 765 | static inline int |
| 766 | rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device *rdev, |
| 767 | struct wireless_dev *wdev, u64 cookie) |
| 768 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 769 | int ret; |
| 770 | trace_rdev_mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie); |
| 771 | ret = rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie); |
| 772 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 773 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 774 | } |
| 775 | |
| 776 | static inline int rdev_set_power_mgmt(struct cfg80211_registered_device *rdev, |
| 777 | struct net_device *dev, bool enabled, |
| 778 | int timeout) |
| 779 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 780 | int ret; |
| 781 | trace_rdev_set_power_mgmt(&rdev->wiphy, dev, enabled, timeout); |
| 782 | ret = rdev->ops->set_power_mgmt(&rdev->wiphy, dev, enabled, timeout); |
| 783 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 784 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 785 | } |
| 786 | |
| 787 | static inline int |
| 788 | rdev_set_cqm_rssi_config(struct cfg80211_registered_device *rdev, |
| 789 | struct net_device *dev, s32 rssi_thold, u32 rssi_hyst) |
| 790 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 791 | int ret; |
| 792 | trace_rdev_set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold, |
| 793 | rssi_hyst); |
| 794 | ret = rdev->ops->set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold, |
| 795 | rssi_hyst); |
| 796 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 797 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 798 | } |
| 799 | |
| 800 | static inline int |
Andrew Zaborowski | 4a4b816 | 2017-02-10 10:02:31 +0100 | [diff] [blame] | 801 | rdev_set_cqm_rssi_range_config(struct cfg80211_registered_device *rdev, |
| 802 | struct net_device *dev, s32 low, s32 high) |
| 803 | { |
| 804 | int ret; |
| 805 | trace_rdev_set_cqm_rssi_range_config(&rdev->wiphy, dev, low, high); |
| 806 | ret = rdev->ops->set_cqm_rssi_range_config(&rdev->wiphy, dev, |
| 807 | low, high); |
| 808 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 809 | return ret; |
| 810 | } |
| 811 | |
| 812 | static inline int |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 813 | rdev_set_cqm_txe_config(struct cfg80211_registered_device *rdev, |
| 814 | struct net_device *dev, u32 rate, u32 pkts, u32 intvl) |
| 815 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 816 | int ret; |
| 817 | trace_rdev_set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, intvl); |
| 818 | ret = rdev->ops->set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 819 | intvl); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 820 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 821 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 822 | } |
| 823 | |
| 824 | static inline void |
Johannes Berg | 6cd536f | 2020-04-17 12:43:01 +0200 | [diff] [blame] | 825 | rdev_update_mgmt_frame_registrations(struct cfg80211_registered_device *rdev, |
| 826 | struct wireless_dev *wdev, |
| 827 | struct mgmt_frame_regs *upd) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 828 | { |
Johannes Berg | 33d8783 | 2015-06-23 17:47:05 +0200 | [diff] [blame] | 829 | might_sleep(); |
| 830 | |
Johannes Berg | 6cd536f | 2020-04-17 12:43:01 +0200 | [diff] [blame] | 831 | trace_rdev_update_mgmt_frame_registrations(&rdev->wiphy, wdev, upd); |
| 832 | if (rdev->ops->update_mgmt_frame_registrations) |
| 833 | rdev->ops->update_mgmt_frame_registrations(&rdev->wiphy, wdev, |
| 834 | upd); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 835 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 836 | } |
| 837 | |
| 838 | static inline int rdev_set_antenna(struct cfg80211_registered_device *rdev, |
| 839 | u32 tx_ant, u32 rx_ant) |
| 840 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 841 | int ret; |
| 842 | trace_rdev_set_antenna(&rdev->wiphy, tx_ant, rx_ant); |
| 843 | ret = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant); |
| 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_get_antenna(struct cfg80211_registered_device *rdev, |
| 849 | u32 *tx_ant, u32 *rx_ant) |
| 850 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 851 | int ret; |
| 852 | trace_rdev_get_antenna(&rdev->wiphy); |
| 853 | ret = rdev->ops->get_antenna(&rdev->wiphy, tx_ant, rx_ant); |
| 854 | if (ret) |
| 855 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 856 | else |
| 857 | trace_rdev_return_int_tx_rx(&rdev->wiphy, ret, *tx_ant, |
| 858 | *rx_ant); |
| 859 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 860 | } |
| 861 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 862 | static inline int |
| 863 | rdev_sched_scan_start(struct cfg80211_registered_device *rdev, |
| 864 | struct net_device *dev, |
| 865 | struct cfg80211_sched_scan_request *request) |
| 866 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 867 | int ret; |
Arend Van Spriel | ca986ad | 2017-04-21 13:05:00 +0100 | [diff] [blame] | 868 | trace_rdev_sched_scan_start(&rdev->wiphy, dev, request->reqid); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 869 | ret = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request); |
| 870 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 871 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 872 | } |
| 873 | |
| 874 | 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] | 875 | struct net_device *dev, u64 reqid) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 876 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 877 | int ret; |
Arend Van Spriel | 3a3ecf1 | 2017-04-21 13:05:02 +0100 | [diff] [blame] | 878 | trace_rdev_sched_scan_stop(&rdev->wiphy, dev, reqid); |
| 879 | ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev, reqid); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 880 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 881 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 882 | } |
| 883 | |
| 884 | static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev, |
| 885 | struct net_device *dev, |
| 886 | struct cfg80211_gtk_rekey_data *data) |
| 887 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 888 | int ret; |
| 889 | trace_rdev_set_rekey_data(&rdev->wiphy, dev); |
| 890 | ret = rdev->ops->set_rekey_data(&rdev->wiphy, dev, data); |
| 891 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 892 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 893 | } |
| 894 | |
| 895 | static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev, |
| 896 | struct net_device *dev, u8 *peer, |
| 897 | u8 action_code, u8 dialog_token, |
Sunil Dutt Undekari | df942e7 | 2014-02-20 16:22:09 +0530 | [diff] [blame] | 898 | u16 status_code, u32 peer_capability, |
Arik Nemtsov | 31fa97c | 2014-06-11 17:18:21 +0300 | [diff] [blame] | 899 | bool initiator, const u8 *buf, size_t len) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 900 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 901 | int ret; |
| 902 | trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code, |
Sunil Dutt Undekari | df942e7 | 2014-02-20 16:22:09 +0530 | [diff] [blame] | 903 | dialog_token, status_code, peer_capability, |
Arik Nemtsov | 31fa97c | 2014-06-11 17:18:21 +0300 | [diff] [blame] | 904 | initiator, buf, len); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 905 | ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code, |
Sunil Dutt Undekari | df942e7 | 2014-02-20 16:22:09 +0530 | [diff] [blame] | 906 | dialog_token, status_code, peer_capability, |
Arik Nemtsov | 31fa97c | 2014-06-11 17:18:21 +0300 | [diff] [blame] | 907 | initiator, buf, len); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 908 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 909 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 910 | } |
| 911 | |
| 912 | static inline int rdev_tdls_oper(struct cfg80211_registered_device *rdev, |
| 913 | struct net_device *dev, u8 *peer, |
| 914 | enum nl80211_tdls_operation oper) |
| 915 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 916 | int ret; |
| 917 | trace_rdev_tdls_oper(&rdev->wiphy, dev, peer, oper); |
| 918 | ret = rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, oper); |
| 919 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 920 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 921 | } |
| 922 | |
| 923 | static inline int rdev_probe_client(struct cfg80211_registered_device *rdev, |
| 924 | struct net_device *dev, const u8 *peer, |
| 925 | u64 *cookie) |
| 926 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 927 | int ret; |
| 928 | trace_rdev_probe_client(&rdev->wiphy, dev, peer); |
| 929 | ret = rdev->ops->probe_client(&rdev->wiphy, dev, peer, cookie); |
| 930 | trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); |
| 931 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 932 | } |
| 933 | |
| 934 | static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev, |
| 935 | struct net_device *dev, u16 noack_map) |
| 936 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 937 | int ret; |
| 938 | trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map); |
| 939 | ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map); |
| 940 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 941 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 942 | } |
| 943 | |
| 944 | static inline int |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 945 | rdev_get_channel(struct cfg80211_registered_device *rdev, |
| 946 | struct wireless_dev *wdev, |
| 947 | struct cfg80211_chan_def *chandef) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 948 | { |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 949 | int ret; |
| 950 | |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 951 | trace_rdev_get_channel(&rdev->wiphy, wdev); |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 952 | ret = rdev->ops->get_channel(&rdev->wiphy, wdev, chandef); |
| 953 | trace_rdev_return_chandef(&rdev->wiphy, ret, chandef); |
| 954 | |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 955 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 956 | } |
| 957 | |
Johannes Berg | eeb126e | 2012-10-23 15:16:50 +0200 | [diff] [blame] | 958 | static inline int rdev_start_p2p_device(struct cfg80211_registered_device *rdev, |
| 959 | struct wireless_dev *wdev) |
| 960 | { |
| 961 | int ret; |
| 962 | |
| 963 | trace_rdev_start_p2p_device(&rdev->wiphy, wdev); |
| 964 | ret = rdev->ops->start_p2p_device(&rdev->wiphy, wdev); |
| 965 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 966 | return ret; |
| 967 | } |
| 968 | |
| 969 | static inline void rdev_stop_p2p_device(struct cfg80211_registered_device *rdev, |
| 970 | struct wireless_dev *wdev) |
| 971 | { |
| 972 | trace_rdev_stop_p2p_device(&rdev->wiphy, wdev); |
| 973 | rdev->ops->stop_p2p_device(&rdev->wiphy, wdev); |
| 974 | trace_rdev_return_void(&rdev->wiphy); |
Arend van Spriel | 5de1798 | 2013-04-18 15:49:00 +0200 | [diff] [blame] | 975 | } |
Vasanthakumar Thiagarajan | 77765ea | 2013-01-18 11:18:45 +0530 | [diff] [blame] | 976 | |
Ayala Beker | cb3b7d8 | 2016-09-20 17:31:13 +0300 | [diff] [blame] | 977 | static inline int rdev_start_nan(struct cfg80211_registered_device *rdev, |
| 978 | struct wireless_dev *wdev, |
| 979 | struct cfg80211_nan_conf *conf) |
| 980 | { |
| 981 | int ret; |
| 982 | |
| 983 | trace_rdev_start_nan(&rdev->wiphy, wdev, conf); |
| 984 | ret = rdev->ops->start_nan(&rdev->wiphy, wdev, conf); |
| 985 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 986 | return ret; |
| 987 | } |
| 988 | |
| 989 | static inline void rdev_stop_nan(struct cfg80211_registered_device *rdev, |
| 990 | struct wireless_dev *wdev) |
| 991 | { |
| 992 | trace_rdev_stop_nan(&rdev->wiphy, wdev); |
| 993 | rdev->ops->stop_nan(&rdev->wiphy, wdev); |
| 994 | trace_rdev_return_void(&rdev->wiphy); |
| 995 | } |
| 996 | |
Ayala Beker | a442b76 | 2016-09-20 17:31:15 +0300 | [diff] [blame] | 997 | static inline int |
| 998 | rdev_add_nan_func(struct cfg80211_registered_device *rdev, |
| 999 | struct wireless_dev *wdev, |
| 1000 | struct cfg80211_nan_func *nan_func) |
| 1001 | { |
| 1002 | int ret; |
| 1003 | |
| 1004 | trace_rdev_add_nan_func(&rdev->wiphy, wdev, nan_func); |
| 1005 | ret = rdev->ops->add_nan_func(&rdev->wiphy, wdev, nan_func); |
| 1006 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1007 | return ret; |
| 1008 | } |
| 1009 | |
| 1010 | static inline void rdev_del_nan_func(struct cfg80211_registered_device *rdev, |
| 1011 | struct wireless_dev *wdev, u64 cookie) |
| 1012 | { |
| 1013 | trace_rdev_del_nan_func(&rdev->wiphy, wdev, cookie); |
| 1014 | rdev->ops->del_nan_func(&rdev->wiphy, wdev, cookie); |
| 1015 | trace_rdev_return_void(&rdev->wiphy); |
| 1016 | } |
| 1017 | |
Ayala Beker | a5a9dcf | 2016-09-20 17:31:16 +0300 | [diff] [blame] | 1018 | static inline int |
| 1019 | rdev_nan_change_conf(struct cfg80211_registered_device *rdev, |
| 1020 | struct wireless_dev *wdev, |
| 1021 | struct cfg80211_nan_conf *conf, u32 changes) |
| 1022 | { |
| 1023 | int ret; |
| 1024 | |
| 1025 | trace_rdev_nan_change_conf(&rdev->wiphy, wdev, conf, changes); |
| 1026 | if (rdev->ops->nan_change_conf) |
| 1027 | ret = rdev->ops->nan_change_conf(&rdev->wiphy, wdev, conf, |
| 1028 | changes); |
| 1029 | else |
| 1030 | ret = -ENOTSUPP; |
| 1031 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1032 | return ret; |
| 1033 | } |
| 1034 | |
Vasanthakumar Thiagarajan | 77765ea | 2013-01-18 11:18:45 +0530 | [diff] [blame] | 1035 | static inline int rdev_set_mac_acl(struct cfg80211_registered_device *rdev, |
| 1036 | struct net_device *dev, |
| 1037 | struct cfg80211_acl_data *params) |
| 1038 | { |
| 1039 | int ret; |
| 1040 | |
| 1041 | trace_rdev_set_mac_acl(&rdev->wiphy, dev, params); |
| 1042 | ret = rdev->ops->set_mac_acl(&rdev->wiphy, dev, params); |
| 1043 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1044 | return ret; |
| 1045 | } |
Jouni Malinen | 355199e | 2013-02-27 17:14:27 +0200 | [diff] [blame] | 1046 | |
| 1047 | static inline int rdev_update_ft_ies(struct cfg80211_registered_device *rdev, |
| 1048 | struct net_device *dev, |
| 1049 | struct cfg80211_update_ft_ies_params *ftie) |
| 1050 | { |
| 1051 | int ret; |
| 1052 | |
| 1053 | trace_rdev_update_ft_ies(&rdev->wiphy, dev, ftie); |
| 1054 | ret = rdev->ops->update_ft_ies(&rdev->wiphy, dev, ftie); |
| 1055 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1056 | return ret; |
| 1057 | } |
| 1058 | |
Arend van Spriel | 5de1798 | 2013-04-18 15:49:00 +0200 | [diff] [blame] | 1059 | static inline int rdev_crit_proto_start(struct cfg80211_registered_device *rdev, |
| 1060 | struct wireless_dev *wdev, |
| 1061 | enum nl80211_crit_proto_id protocol, |
| 1062 | u16 duration) |
| 1063 | { |
| 1064 | int ret; |
| 1065 | |
| 1066 | trace_rdev_crit_proto_start(&rdev->wiphy, wdev, protocol, duration); |
| 1067 | ret = rdev->ops->crit_proto_start(&rdev->wiphy, wdev, |
| 1068 | protocol, duration); |
| 1069 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1070 | return ret; |
| 1071 | } |
| 1072 | |
| 1073 | static inline void rdev_crit_proto_stop(struct cfg80211_registered_device *rdev, |
| 1074 | struct wireless_dev *wdev) |
| 1075 | { |
| 1076 | trace_rdev_crit_proto_stop(&rdev->wiphy, wdev); |
| 1077 | rdev->ops->crit_proto_stop(&rdev->wiphy, wdev); |
| 1078 | trace_rdev_return_void(&rdev->wiphy); |
| 1079 | } |
| 1080 | |
Simon Wunderlich | 16ef1fe | 2013-07-11 16:09:05 +0200 | [diff] [blame] | 1081 | static inline int rdev_channel_switch(struct cfg80211_registered_device *rdev, |
| 1082 | struct net_device *dev, |
| 1083 | struct cfg80211_csa_settings *params) |
| 1084 | { |
| 1085 | int ret; |
| 1086 | |
| 1087 | trace_rdev_channel_switch(&rdev->wiphy, dev, params); |
| 1088 | ret = rdev->ops->channel_switch(&rdev->wiphy, dev, params); |
| 1089 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1090 | return ret; |
| 1091 | } |
| 1092 | |
Kyeyoon Park | fa9ffc7 | 2013-12-16 23:01:30 -0800 | [diff] [blame] | 1093 | static inline int rdev_set_qos_map(struct cfg80211_registered_device *rdev, |
| 1094 | struct net_device *dev, |
| 1095 | struct cfg80211_qos_map *qos_map) |
| 1096 | { |
| 1097 | int ret = -EOPNOTSUPP; |
| 1098 | |
| 1099 | if (rdev->ops->set_qos_map) { |
| 1100 | trace_rdev_set_qos_map(&rdev->wiphy, dev, qos_map); |
| 1101 | ret = rdev->ops->set_qos_map(&rdev->wiphy, dev, qos_map); |
| 1102 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1103 | } |
| 1104 | |
| 1105 | return ret; |
| 1106 | } |
| 1107 | |
Jouni Malinen | e16821b | 2014-04-28 11:22:08 +0300 | [diff] [blame] | 1108 | static inline int |
| 1109 | rdev_set_ap_chanwidth(struct cfg80211_registered_device *rdev, |
| 1110 | struct net_device *dev, struct cfg80211_chan_def *chandef) |
| 1111 | { |
| 1112 | int ret; |
| 1113 | |
| 1114 | trace_rdev_set_ap_chanwidth(&rdev->wiphy, dev, chandef); |
| 1115 | ret = rdev->ops->set_ap_chanwidth(&rdev->wiphy, dev, chandef); |
| 1116 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1117 | |
| 1118 | return ret; |
| 1119 | } |
| 1120 | |
Johannes Berg | 960d01a | 2014-09-09 22:55:35 +0300 | [diff] [blame] | 1121 | static inline int |
| 1122 | rdev_add_tx_ts(struct cfg80211_registered_device *rdev, |
| 1123 | struct net_device *dev, u8 tsid, const u8 *peer, |
| 1124 | u8 user_prio, u16 admitted_time) |
| 1125 | { |
| 1126 | int ret = -EOPNOTSUPP; |
| 1127 | |
| 1128 | trace_rdev_add_tx_ts(&rdev->wiphy, dev, tsid, peer, |
| 1129 | user_prio, admitted_time); |
| 1130 | if (rdev->ops->add_tx_ts) |
| 1131 | ret = rdev->ops->add_tx_ts(&rdev->wiphy, dev, tsid, peer, |
| 1132 | user_prio, admitted_time); |
| 1133 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1134 | |
| 1135 | return ret; |
| 1136 | } |
| 1137 | |
| 1138 | static inline int |
| 1139 | rdev_del_tx_ts(struct cfg80211_registered_device *rdev, |
| 1140 | struct net_device *dev, u8 tsid, const u8 *peer) |
| 1141 | { |
| 1142 | int ret = -EOPNOTSUPP; |
| 1143 | |
| 1144 | trace_rdev_del_tx_ts(&rdev->wiphy, dev, tsid, peer); |
| 1145 | if (rdev->ops->del_tx_ts) |
| 1146 | ret = rdev->ops->del_tx_ts(&rdev->wiphy, dev, tsid, peer); |
| 1147 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1148 | |
| 1149 | return ret; |
| 1150 | } |
| 1151 | |
Arik Nemtsov | 1057d35 | 2014-11-19 12:54:26 +0200 | [diff] [blame] | 1152 | static inline int |
| 1153 | rdev_tdls_channel_switch(struct cfg80211_registered_device *rdev, |
| 1154 | struct net_device *dev, const u8 *addr, |
| 1155 | u8 oper_class, struct cfg80211_chan_def *chandef) |
| 1156 | { |
| 1157 | int ret; |
| 1158 | |
| 1159 | trace_rdev_tdls_channel_switch(&rdev->wiphy, dev, addr, oper_class, |
| 1160 | chandef); |
| 1161 | ret = rdev->ops->tdls_channel_switch(&rdev->wiphy, dev, addr, |
| 1162 | oper_class, chandef); |
| 1163 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1164 | return ret; |
| 1165 | } |
| 1166 | |
| 1167 | static inline void |
| 1168 | rdev_tdls_cancel_channel_switch(struct cfg80211_registered_device *rdev, |
| 1169 | struct net_device *dev, const u8 *addr) |
| 1170 | { |
| 1171 | trace_rdev_tdls_cancel_channel_switch(&rdev->wiphy, dev, addr); |
| 1172 | rdev->ops->tdls_cancel_channel_switch(&rdev->wiphy, dev, addr); |
| 1173 | trace_rdev_return_void(&rdev->wiphy); |
| 1174 | } |
| 1175 | |
Ilan Peer | a1056b1b | 2015-10-22 22:27:46 +0300 | [diff] [blame] | 1176 | static inline int |
| 1177 | rdev_start_radar_detection(struct cfg80211_registered_device *rdev, |
| 1178 | struct net_device *dev, |
| 1179 | struct cfg80211_chan_def *chandef, |
| 1180 | u32 cac_time_ms) |
| 1181 | { |
| 1182 | int ret = -ENOTSUPP; |
| 1183 | |
| 1184 | trace_rdev_start_radar_detection(&rdev->wiphy, dev, chandef, |
| 1185 | cac_time_ms); |
| 1186 | if (rdev->ops->start_radar_detection) |
| 1187 | ret = rdev->ops->start_radar_detection(&rdev->wiphy, dev, |
| 1188 | chandef, cac_time_ms); |
| 1189 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1190 | return ret; |
| 1191 | } |
| 1192 | |
Orr Mazor | 26ec17a | 2019-12-22 14:55:31 +0000 | [diff] [blame] | 1193 | static inline void |
| 1194 | rdev_end_cac(struct cfg80211_registered_device *rdev, |
| 1195 | struct net_device *dev) |
| 1196 | { |
| 1197 | trace_rdev_end_cac(&rdev->wiphy, dev); |
| 1198 | if (rdev->ops->end_cac) |
| 1199 | rdev->ops->end_cac(&rdev->wiphy, dev); |
| 1200 | trace_rdev_return_void(&rdev->wiphy); |
| 1201 | } |
| 1202 | |
Ilan Peer | a1056b1b | 2015-10-22 22:27:46 +0300 | [diff] [blame] | 1203 | static inline int |
| 1204 | rdev_set_mcast_rate(struct cfg80211_registered_device *rdev, |
| 1205 | struct net_device *dev, |
Johannes Berg | 57fbcce | 2016-04-12 15:56:15 +0200 | [diff] [blame] | 1206 | int mcast_rate[NUM_NL80211_BANDS]) |
Ilan Peer | a1056b1b | 2015-10-22 22:27:46 +0300 | [diff] [blame] | 1207 | { |
| 1208 | int ret = -ENOTSUPP; |
| 1209 | |
| 1210 | trace_rdev_set_mcast_rate(&rdev->wiphy, dev, mcast_rate); |
| 1211 | if (rdev->ops->set_mcast_rate) |
| 1212 | ret = rdev->ops->set_mcast_rate(&rdev->wiphy, dev, mcast_rate); |
| 1213 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1214 | return ret; |
| 1215 | } |
| 1216 | |
| 1217 | static inline int |
| 1218 | rdev_set_coalesce(struct cfg80211_registered_device *rdev, |
| 1219 | struct cfg80211_coalesce *coalesce) |
| 1220 | { |
| 1221 | int ret = -ENOTSUPP; |
| 1222 | |
| 1223 | trace_rdev_set_coalesce(&rdev->wiphy, coalesce); |
| 1224 | if (rdev->ops->set_coalesce) |
| 1225 | ret = rdev->ops->set_coalesce(&rdev->wiphy, coalesce); |
| 1226 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1227 | return ret; |
| 1228 | } |
Avraham Stern | 3a00df5 | 2017-06-09 13:08:43 +0100 | [diff] [blame] | 1229 | |
| 1230 | static inline int rdev_set_pmk(struct cfg80211_registered_device *rdev, |
| 1231 | struct net_device *dev, |
| 1232 | struct cfg80211_pmk_conf *pmk_conf) |
| 1233 | { |
| 1234 | int ret = -EOPNOTSUPP; |
| 1235 | |
| 1236 | trace_rdev_set_pmk(&rdev->wiphy, dev, pmk_conf); |
| 1237 | if (rdev->ops->set_pmk) |
| 1238 | ret = rdev->ops->set_pmk(&rdev->wiphy, dev, pmk_conf); |
| 1239 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1240 | return ret; |
| 1241 | } |
| 1242 | |
| 1243 | static inline int rdev_del_pmk(struct cfg80211_registered_device *rdev, |
| 1244 | struct net_device *dev, const u8 *aa) |
| 1245 | { |
| 1246 | int ret = -EOPNOTSUPP; |
| 1247 | |
| 1248 | trace_rdev_del_pmk(&rdev->wiphy, dev, aa); |
| 1249 | if (rdev->ops->del_pmk) |
| 1250 | ret = rdev->ops->del_pmk(&rdev->wiphy, dev, aa); |
| 1251 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1252 | return ret; |
| 1253 | } |
Srinivas Dasari | 40cbfa9 | 2018-01-25 17:13:38 +0200 | [diff] [blame] | 1254 | |
| 1255 | static inline int |
| 1256 | rdev_external_auth(struct cfg80211_registered_device *rdev, |
| 1257 | struct net_device *dev, |
| 1258 | struct cfg80211_external_auth_params *params) |
| 1259 | { |
| 1260 | int ret = -EOPNOTSUPP; |
| 1261 | |
| 1262 | trace_rdev_external_auth(&rdev->wiphy, dev, params); |
| 1263 | if (rdev->ops->external_auth) |
| 1264 | ret = rdev->ops->external_auth(&rdev->wiphy, dev, params); |
| 1265 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1266 | return ret; |
| 1267 | } |
| 1268 | |
Pradeep Kumar Chitrapu | 81e54d0 | 2018-09-20 17:30:09 -0700 | [diff] [blame] | 1269 | static inline int |
| 1270 | rdev_get_ftm_responder_stats(struct cfg80211_registered_device *rdev, |
| 1271 | struct net_device *dev, |
| 1272 | struct cfg80211_ftm_responder_stats *ftm_stats) |
| 1273 | { |
| 1274 | int ret = -EOPNOTSUPP; |
| 1275 | |
| 1276 | trace_rdev_get_ftm_responder_stats(&rdev->wiphy, dev, ftm_stats); |
| 1277 | if (rdev->ops->get_ftm_responder_stats) |
| 1278 | ret = rdev->ops->get_ftm_responder_stats(&rdev->wiphy, dev, |
| 1279 | ftm_stats); |
| 1280 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1281 | return ret; |
| 1282 | } |
| 1283 | |
Johannes Berg | 9bb7e0f | 2018-09-10 13:29:12 +0200 | [diff] [blame] | 1284 | static inline int |
| 1285 | rdev_start_pmsr(struct cfg80211_registered_device *rdev, |
| 1286 | struct wireless_dev *wdev, |
| 1287 | struct cfg80211_pmsr_request *request) |
| 1288 | { |
| 1289 | int ret = -EOPNOTSUPP; |
| 1290 | |
| 1291 | trace_rdev_start_pmsr(&rdev->wiphy, wdev, request->cookie); |
| 1292 | if (rdev->ops->start_pmsr) |
| 1293 | ret = rdev->ops->start_pmsr(&rdev->wiphy, wdev, request); |
| 1294 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1295 | return ret; |
| 1296 | } |
| 1297 | |
| 1298 | static inline void |
| 1299 | rdev_abort_pmsr(struct cfg80211_registered_device *rdev, |
| 1300 | struct wireless_dev *wdev, |
| 1301 | struct cfg80211_pmsr_request *request) |
| 1302 | { |
| 1303 | trace_rdev_abort_pmsr(&rdev->wiphy, wdev, request->cookie); |
| 1304 | if (rdev->ops->abort_pmsr) |
| 1305 | rdev->ops->abort_pmsr(&rdev->wiphy, wdev, request); |
| 1306 | trace_rdev_return_void(&rdev->wiphy); |
| 1307 | } |
| 1308 | |
Sunil Dutt | cb74e97 | 2019-02-20 16:18:07 +0530 | [diff] [blame] | 1309 | static inline int rdev_update_owe_info(struct cfg80211_registered_device *rdev, |
| 1310 | struct net_device *dev, |
| 1311 | struct cfg80211_update_owe_info *oweinfo) |
| 1312 | { |
| 1313 | int ret = -EOPNOTSUPP; |
| 1314 | |
| 1315 | trace_rdev_update_owe_info(&rdev->wiphy, dev, oweinfo); |
| 1316 | if (rdev->ops->update_owe_info) |
| 1317 | ret = rdev->ops->update_owe_info(&rdev->wiphy, dev, oweinfo); |
| 1318 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1319 | return ret; |
| 1320 | } |
| 1321 | |
Rajkumar Manoharan | 5ab92e7 | 2019-04-11 13:47:24 -0700 | [diff] [blame] | 1322 | static inline int |
| 1323 | rdev_probe_mesh_link(struct cfg80211_registered_device *rdev, |
| 1324 | struct net_device *dev, const u8 *dest, |
| 1325 | const void *buf, size_t len) |
| 1326 | { |
| 1327 | int ret; |
| 1328 | |
| 1329 | trace_rdev_probe_mesh_link(&rdev->wiphy, dev, dest, buf, len); |
| 1330 | ret = rdev->ops->probe_mesh_link(&rdev->wiphy, dev, buf, len); |
| 1331 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1332 | return ret; |
| 1333 | } |
| 1334 | |
Tamizh chelvam | 77f576d | 2020-01-20 13:21:22 +0530 | [diff] [blame] | 1335 | static inline int rdev_set_tid_config(struct cfg80211_registered_device *rdev, |
| 1336 | struct net_device *dev, |
Johannes Berg | 3710a8a | 2020-02-24 11:34:25 +0100 | [diff] [blame] | 1337 | struct cfg80211_tid_config *tid_conf) |
Tamizh chelvam | 77f576d | 2020-01-20 13:21:22 +0530 | [diff] [blame] | 1338 | { |
| 1339 | int ret; |
| 1340 | |
| 1341 | trace_rdev_set_tid_config(&rdev->wiphy, dev, tid_conf); |
| 1342 | ret = rdev->ops->set_tid_config(&rdev->wiphy, dev, tid_conf); |
| 1343 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1344 | return ret; |
| 1345 | } |
| 1346 | |
| 1347 | static inline int rdev_reset_tid_config(struct cfg80211_registered_device *rdev, |
| 1348 | struct net_device *dev, const u8 *peer, |
Johannes Berg | 3710a8a | 2020-02-24 11:34:25 +0100 | [diff] [blame] | 1349 | u8 tids) |
Tamizh chelvam | 77f576d | 2020-01-20 13:21:22 +0530 | [diff] [blame] | 1350 | { |
| 1351 | int ret; |
| 1352 | |
Johannes Berg | 3710a8a | 2020-02-24 11:34:25 +0100 | [diff] [blame] | 1353 | trace_rdev_reset_tid_config(&rdev->wiphy, dev, peer, tids); |
| 1354 | ret = rdev->ops->reset_tid_config(&rdev->wiphy, dev, peer, tids); |
Tamizh chelvam | 77f576d | 2020-01-20 13:21:22 +0530 | [diff] [blame] | 1355 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1356 | return ret; |
| 1357 | } |
| 1358 | |
Carl Huang | 6bdb68c | 2020-12-03 05:37:26 -0500 | [diff] [blame] | 1359 | static inline int rdev_set_sar_specs(struct cfg80211_registered_device *rdev, |
| 1360 | struct cfg80211_sar_specs *sar) |
| 1361 | { |
| 1362 | int ret; |
| 1363 | |
| 1364 | trace_rdev_set_sar_specs(&rdev->wiphy, sar); |
| 1365 | ret = rdev->ops->set_sar_specs(&rdev->wiphy, sar); |
| 1366 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1367 | |
| 1368 | return ret; |
| 1369 | } |
| 1370 | |
John Crispin | 0d2ab3ae | 2021-07-02 19:44:07 +0200 | [diff] [blame] | 1371 | static inline int rdev_color_change(struct cfg80211_registered_device *rdev, |
| 1372 | struct net_device *dev, |
| 1373 | struct cfg80211_color_change_settings *params) |
| 1374 | { |
| 1375 | int ret; |
| 1376 | |
| 1377 | trace_rdev_color_change(&rdev->wiphy, dev, params); |
| 1378 | ret = rdev->ops->color_change(&rdev->wiphy, dev, params); |
| 1379 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1380 | |
| 1381 | return ret; |
| 1382 | } |
| 1383 | |
Subrat Mishra | e306784 | 2021-09-15 11:22:23 +0530 | [diff] [blame] | 1384 | static inline int |
| 1385 | rdev_set_fils_aad(struct cfg80211_registered_device *rdev, |
| 1386 | struct net_device *dev, struct cfg80211_fils_aad *fils_aad) |
| 1387 | { |
| 1388 | int ret = -EOPNOTSUPP; |
| 1389 | |
| 1390 | trace_rdev_set_fils_aad(&rdev->wiphy, dev, fils_aad); |
| 1391 | if (rdev->ops->set_fils_aad) |
| 1392 | ret = rdev->ops->set_fils_aad(&rdev->wiphy, dev, fils_aad); |
| 1393 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 1394 | |
| 1395 | return ret; |
| 1396 | } |
| 1397 | |
Lorenzo Bianconi | bc2dfc0 | 2021-10-23 11:10:50 +0200 | [diff] [blame] | 1398 | static inline int |
Lorenzo Bianconi | a95bfb8 | 2021-11-29 14:11:24 +0100 | [diff] [blame] | 1399 | rdev_set_radar_background(struct cfg80211_registered_device *rdev, |
| 1400 | struct cfg80211_chan_def *chandef) |
Lorenzo Bianconi | bc2dfc0 | 2021-10-23 11:10:50 +0200 | [diff] [blame] | 1401 | { |
| 1402 | struct wiphy *wiphy = &rdev->wiphy; |
| 1403 | int ret; |
| 1404 | |
Lorenzo Bianconi | a95bfb8 | 2021-11-29 14:11:24 +0100 | [diff] [blame] | 1405 | if (!rdev->ops->set_radar_background) |
Lorenzo Bianconi | bc2dfc0 | 2021-10-23 11:10:50 +0200 | [diff] [blame] | 1406 | return -EOPNOTSUPP; |
| 1407 | |
Lorenzo Bianconi | a95bfb8 | 2021-11-29 14:11:24 +0100 | [diff] [blame] | 1408 | trace_rdev_set_radar_background(wiphy, chandef); |
| 1409 | ret = rdev->ops->set_radar_background(wiphy, chandef); |
Lorenzo Bianconi | bc2dfc0 | 2021-10-23 11:10:50 +0200 | [diff] [blame] | 1410 | trace_rdev_return_int(wiphy, ret); |
| 1411 | |
| 1412 | return ret; |
| 1413 | } |
| 1414 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 1415 | #endif /* __CFG80211_RDEV_OPS */ |