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