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, |
| 38 | enum nl80211_iftype type, u32 *flags, |
| 39 | struct vif_params *params) |
| 40 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 41 | struct wireless_dev *ret; |
| 42 | trace_rdev_add_virtual_intf(&rdev->wiphy, name, type); |
| 43 | ret = rdev->ops->add_virtual_intf(&rdev->wiphy, name, type, flags, |
| 44 | params); |
| 45 | trace_rdev_return_wdev(&rdev->wiphy, ret); |
| 46 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | static inline int |
| 50 | rdev_del_virtual_intf(struct cfg80211_registered_device *rdev, |
| 51 | struct wireless_dev *wdev) |
| 52 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 53 | int ret; |
| 54 | trace_rdev_del_virtual_intf(&rdev->wiphy, wdev); |
| 55 | ret = rdev->ops->del_virtual_intf(&rdev->wiphy, wdev); |
| 56 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 57 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | static inline int |
| 61 | rdev_change_virtual_intf(struct cfg80211_registered_device *rdev, |
| 62 | struct net_device *dev, enum nl80211_iftype type, |
| 63 | u32 *flags, struct vif_params *params) |
| 64 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 65 | int ret; |
| 66 | trace_rdev_change_virtual_intf(&rdev->wiphy, dev, type); |
| 67 | ret = rdev->ops->change_virtual_intf(&rdev->wiphy, dev, type, flags, |
| 68 | params); |
| 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, |
| 181 | struct net_device *dev, u8 *mac) |
| 182 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 183 | int ret; |
| 184 | trace_rdev_del_station(&rdev->wiphy, dev, mac); |
| 185 | ret = rdev->ops->del_station(&rdev->wiphy, dev, mac); |
| 186 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 187 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 188 | } |
| 189 | |
| 190 | static inline int rdev_change_station(struct cfg80211_registered_device *rdev, |
| 191 | struct net_device *dev, u8 *mac, |
| 192 | struct station_parameters *params) |
| 193 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 194 | int ret; |
| 195 | trace_rdev_change_station(&rdev->wiphy, dev, mac, params); |
| 196 | ret = rdev->ops->change_station(&rdev->wiphy, dev, mac, params); |
| 197 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 198 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | static inline int rdev_get_station(struct cfg80211_registered_device *rdev, |
| 202 | struct net_device *dev, u8 *mac, |
| 203 | struct station_info *sinfo) |
| 204 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 205 | int ret; |
| 206 | trace_rdev_get_station(&rdev->wiphy, dev, mac); |
| 207 | ret = rdev->ops->get_station(&rdev->wiphy, dev, mac, sinfo); |
| 208 | trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo); |
| 209 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 210 | } |
| 211 | |
| 212 | static inline int rdev_dump_station(struct cfg80211_registered_device *rdev, |
| 213 | struct net_device *dev, int idx, u8 *mac, |
| 214 | struct station_info *sinfo) |
| 215 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 216 | int ret; |
| 217 | trace_rdev_dump_station(&rdev->wiphy, dev, idx, mac); |
| 218 | ret = rdev->ops->dump_station(&rdev->wiphy, dev, idx, mac, sinfo); |
| 219 | trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo); |
| 220 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | static inline int rdev_add_mpath(struct cfg80211_registered_device *rdev, |
| 224 | struct net_device *dev, u8 *dst, u8 *next_hop) |
| 225 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 226 | int ret; |
| 227 | trace_rdev_add_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 228 | ret = rdev->ops->add_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 229 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 230 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | static inline int rdev_del_mpath(struct cfg80211_registered_device *rdev, |
| 234 | struct net_device *dev, u8 *dst) |
| 235 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 236 | int ret; |
| 237 | trace_rdev_del_mpath(&rdev->wiphy, dev, dst); |
| 238 | ret = rdev->ops->del_mpath(&rdev->wiphy, dev, dst); |
| 239 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 240 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | static inline int rdev_change_mpath(struct cfg80211_registered_device *rdev, |
| 244 | struct net_device *dev, u8 *dst, |
| 245 | u8 *next_hop) |
| 246 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 247 | int ret; |
| 248 | trace_rdev_change_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 249 | ret = rdev->ops->change_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 250 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 251 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 252 | } |
| 253 | |
| 254 | static inline int rdev_get_mpath(struct cfg80211_registered_device *rdev, |
| 255 | struct net_device *dev, u8 *dst, u8 *next_hop, |
| 256 | struct mpath_info *pinfo) |
| 257 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 258 | int ret; |
| 259 | trace_rdev_get_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 260 | ret = rdev->ops->get_mpath(&rdev->wiphy, dev, dst, next_hop, pinfo); |
| 261 | trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo); |
| 262 | return ret; |
| 263 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 264 | } |
| 265 | |
| 266 | static inline int rdev_dump_mpath(struct cfg80211_registered_device *rdev, |
| 267 | struct net_device *dev, int idx, u8 *dst, |
| 268 | u8 *next_hop, struct mpath_info *pinfo) |
| 269 | |
| 270 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 271 | int ret; |
| 272 | trace_rdev_dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop); |
| 273 | ret = rdev->ops->dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 274 | pinfo); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 275 | trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo); |
| 276 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 277 | } |
| 278 | |
| 279 | static inline int |
| 280 | rdev_get_mesh_config(struct cfg80211_registered_device *rdev, |
| 281 | struct net_device *dev, struct mesh_config *conf) |
| 282 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 283 | int ret; |
| 284 | trace_rdev_get_mesh_config(&rdev->wiphy, dev); |
| 285 | ret = rdev->ops->get_mesh_config(&rdev->wiphy, dev, conf); |
| 286 | trace_rdev_return_int_mesh_config(&rdev->wiphy, ret, conf); |
| 287 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 288 | } |
| 289 | |
| 290 | static inline int |
| 291 | rdev_update_mesh_config(struct cfg80211_registered_device *rdev, |
| 292 | struct net_device *dev, u32 mask, |
| 293 | const struct mesh_config *nconf) |
| 294 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 295 | int ret; |
| 296 | trace_rdev_update_mesh_config(&rdev->wiphy, dev, mask, nconf); |
| 297 | ret = rdev->ops->update_mesh_config(&rdev->wiphy, dev, mask, nconf); |
| 298 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 299 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 300 | } |
| 301 | |
| 302 | static inline int rdev_join_mesh(struct cfg80211_registered_device *rdev, |
| 303 | struct net_device *dev, |
| 304 | const struct mesh_config *conf, |
| 305 | const struct mesh_setup *setup) |
| 306 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 307 | int ret; |
| 308 | trace_rdev_join_mesh(&rdev->wiphy, dev, conf, setup); |
| 309 | ret = rdev->ops->join_mesh(&rdev->wiphy, dev, conf, setup); |
| 310 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 311 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 312 | } |
| 313 | |
| 314 | |
| 315 | static inline int rdev_leave_mesh(struct cfg80211_registered_device *rdev, |
| 316 | struct net_device *dev) |
| 317 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 318 | int ret; |
| 319 | trace_rdev_leave_mesh(&rdev->wiphy, dev); |
| 320 | ret = rdev->ops->leave_mesh(&rdev->wiphy, dev); |
| 321 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 322 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 323 | } |
| 324 | |
| 325 | static inline int rdev_change_bss(struct cfg80211_registered_device *rdev, |
| 326 | struct net_device *dev, |
| 327 | struct bss_parameters *params) |
| 328 | |
| 329 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 330 | int ret; |
| 331 | trace_rdev_change_bss(&rdev->wiphy, dev, params); |
| 332 | ret = rdev->ops->change_bss(&rdev->wiphy, dev, params); |
| 333 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 334 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 335 | } |
| 336 | |
| 337 | static inline int rdev_set_txq_params(struct cfg80211_registered_device *rdev, |
| 338 | struct net_device *dev, |
| 339 | struct ieee80211_txq_params *params) |
| 340 | |
| 341 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 342 | int ret; |
| 343 | trace_rdev_set_txq_params(&rdev->wiphy, dev, params); |
| 344 | ret = rdev->ops->set_txq_params(&rdev->wiphy, dev, params); |
| 345 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 346 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 347 | } |
| 348 | |
| 349 | static inline int |
| 350 | rdev_libertas_set_mesh_channel(struct cfg80211_registered_device *rdev, |
| 351 | struct net_device *dev, |
| 352 | struct ieee80211_channel *chan) |
| 353 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 354 | int ret; |
| 355 | trace_rdev_libertas_set_mesh_channel(&rdev->wiphy, dev, chan); |
| 356 | ret = rdev->ops->libertas_set_mesh_channel(&rdev->wiphy, dev, chan); |
| 357 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 358 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 359 | } |
| 360 | |
| 361 | static inline int |
| 362 | rdev_set_monitor_channel(struct cfg80211_registered_device *rdev, |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 363 | struct cfg80211_chan_def *chandef) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 364 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 365 | int ret; |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 366 | trace_rdev_set_monitor_channel(&rdev->wiphy, chandef); |
| 367 | ret = rdev->ops->set_monitor_channel(&rdev->wiphy, chandef); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 368 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 369 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 370 | } |
| 371 | |
| 372 | static inline int rdev_scan(struct cfg80211_registered_device *rdev, |
| 373 | struct cfg80211_scan_request *request) |
| 374 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 375 | int ret; |
| 376 | trace_rdev_scan(&rdev->wiphy, request); |
| 377 | ret = rdev->ops->scan(&rdev->wiphy, request); |
| 378 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 379 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 380 | } |
| 381 | |
| 382 | static inline int rdev_auth(struct cfg80211_registered_device *rdev, |
| 383 | struct net_device *dev, |
| 384 | struct cfg80211_auth_request *req) |
| 385 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 386 | int ret; |
| 387 | trace_rdev_auth(&rdev->wiphy, dev, req); |
| 388 | ret = rdev->ops->auth(&rdev->wiphy, dev, req); |
| 389 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 390 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 391 | } |
| 392 | |
| 393 | static inline int rdev_assoc(struct cfg80211_registered_device *rdev, |
| 394 | struct net_device *dev, |
| 395 | struct cfg80211_assoc_request *req) |
| 396 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 397 | int ret; |
| 398 | trace_rdev_assoc(&rdev->wiphy, dev, req); |
| 399 | ret = rdev->ops->assoc(&rdev->wiphy, dev, req); |
| 400 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 401 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 402 | } |
| 403 | |
| 404 | static inline int rdev_deauth(struct cfg80211_registered_device *rdev, |
| 405 | struct net_device *dev, |
| 406 | struct cfg80211_deauth_request *req) |
| 407 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 408 | int ret; |
| 409 | trace_rdev_deauth(&rdev->wiphy, dev, req); |
| 410 | ret = rdev->ops->deauth(&rdev->wiphy, dev, req); |
| 411 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 412 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 413 | } |
| 414 | |
| 415 | static inline int rdev_disassoc(struct cfg80211_registered_device *rdev, |
| 416 | struct net_device *dev, |
| 417 | struct cfg80211_disassoc_request *req) |
| 418 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 419 | int ret; |
| 420 | trace_rdev_disassoc(&rdev->wiphy, dev, req); |
| 421 | ret = rdev->ops->disassoc(&rdev->wiphy, dev, req); |
| 422 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 423 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 424 | } |
| 425 | |
| 426 | static inline int rdev_connect(struct cfg80211_registered_device *rdev, |
| 427 | struct net_device *dev, |
| 428 | struct cfg80211_connect_params *sme) |
| 429 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 430 | int ret; |
| 431 | trace_rdev_connect(&rdev->wiphy, dev, sme); |
| 432 | ret = rdev->ops->connect(&rdev->wiphy, dev, sme); |
| 433 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 434 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 435 | } |
| 436 | |
| 437 | static inline int rdev_disconnect(struct cfg80211_registered_device *rdev, |
| 438 | struct net_device *dev, u16 reason_code) |
| 439 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 440 | int ret; |
| 441 | trace_rdev_disconnect(&rdev->wiphy, dev, reason_code); |
| 442 | ret = rdev->ops->disconnect(&rdev->wiphy, dev, reason_code); |
| 443 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 444 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 445 | } |
| 446 | |
| 447 | static inline int rdev_join_ibss(struct cfg80211_registered_device *rdev, |
| 448 | struct net_device *dev, |
| 449 | struct cfg80211_ibss_params *params) |
| 450 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 451 | int ret; |
| 452 | trace_rdev_join_ibss(&rdev->wiphy, dev, params); |
| 453 | ret = rdev->ops->join_ibss(&rdev->wiphy, dev, params); |
| 454 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 455 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 456 | } |
| 457 | |
| 458 | static inline int rdev_leave_ibss(struct cfg80211_registered_device *rdev, |
| 459 | struct net_device *dev) |
| 460 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 461 | int ret; |
| 462 | trace_rdev_leave_ibss(&rdev->wiphy, dev); |
| 463 | ret = rdev->ops->leave_ibss(&rdev->wiphy, dev); |
| 464 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 465 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 466 | } |
| 467 | |
| 468 | static inline int |
| 469 | rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed) |
| 470 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 471 | int ret; |
| 472 | trace_rdev_set_wiphy_params(&rdev->wiphy, changed); |
| 473 | ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed); |
| 474 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 475 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 476 | } |
| 477 | |
| 478 | static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev, |
Johannes Berg | c844211 | 2012-10-24 10:17:18 +0200 | [diff] [blame] | 479 | struct wireless_dev *wdev, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 480 | enum nl80211_tx_power_setting type, int mbm) |
| 481 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 482 | int ret; |
Johannes Berg | c844211 | 2012-10-24 10:17:18 +0200 | [diff] [blame] | 483 | trace_rdev_set_tx_power(&rdev->wiphy, wdev, type, mbm); |
| 484 | ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, type, mbm); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 485 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 486 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 487 | } |
| 488 | |
| 489 | static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev, |
Johannes Berg | c844211 | 2012-10-24 10:17:18 +0200 | [diff] [blame] | 490 | struct wireless_dev *wdev, int *dbm) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 491 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 492 | int ret; |
Johannes Berg | c844211 | 2012-10-24 10:17:18 +0200 | [diff] [blame] | 493 | trace_rdev_get_tx_power(&rdev->wiphy, wdev); |
| 494 | ret = rdev->ops->get_tx_power(&rdev->wiphy, wdev, dbm); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 495 | trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm); |
| 496 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 497 | } |
| 498 | |
| 499 | static inline int rdev_set_wds_peer(struct cfg80211_registered_device *rdev, |
| 500 | struct net_device *dev, const u8 *addr) |
| 501 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 502 | int ret; |
| 503 | trace_rdev_set_wds_peer(&rdev->wiphy, dev, addr); |
| 504 | ret = rdev->ops->set_wds_peer(&rdev->wiphy, dev, addr); |
| 505 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 506 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 507 | } |
| 508 | |
| 509 | static inline void rdev_rfkill_poll(struct cfg80211_registered_device *rdev) |
| 510 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 511 | trace_rdev_rfkill_poll(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 512 | rdev->ops->rfkill_poll(&rdev->wiphy); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 513 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 514 | } |
| 515 | |
| 516 | |
| 517 | #ifdef CONFIG_NL80211_TESTMODE |
| 518 | static inline int rdev_testmode_cmd(struct cfg80211_registered_device *rdev, |
David Spinadel | fc73f11 | 2013-07-31 18:04:15 +0300 | [diff] [blame] | 519 | struct wireless_dev *wdev, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 520 | void *data, int len) |
| 521 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 522 | int ret; |
David Spinadel | fc73f11 | 2013-07-31 18:04:15 +0300 | [diff] [blame] | 523 | trace_rdev_testmode_cmd(&rdev->wiphy, wdev); |
| 524 | ret = rdev->ops->testmode_cmd(&rdev->wiphy, wdev, data, len); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 525 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 526 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 527 | } |
| 528 | |
| 529 | static inline int rdev_testmode_dump(struct cfg80211_registered_device *rdev, |
| 530 | struct sk_buff *skb, |
| 531 | struct netlink_callback *cb, void *data, |
| 532 | int len) |
| 533 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 534 | int ret; |
| 535 | trace_rdev_testmode_dump(&rdev->wiphy); |
| 536 | ret = rdev->ops->testmode_dump(&rdev->wiphy, skb, cb, data, len); |
| 537 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 538 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 539 | } |
| 540 | #endif |
| 541 | |
| 542 | static inline int |
| 543 | rdev_set_bitrate_mask(struct cfg80211_registered_device *rdev, |
| 544 | struct net_device *dev, const u8 *peer, |
| 545 | const struct cfg80211_bitrate_mask *mask) |
| 546 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 547 | int ret; |
| 548 | trace_rdev_set_bitrate_mask(&rdev->wiphy, dev, peer, mask); |
| 549 | ret = rdev->ops->set_bitrate_mask(&rdev->wiphy, dev, peer, mask); |
| 550 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 551 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 552 | } |
| 553 | |
| 554 | static inline int rdev_dump_survey(struct cfg80211_registered_device *rdev, |
| 555 | struct net_device *netdev, int idx, |
| 556 | struct survey_info *info) |
| 557 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 558 | int ret; |
| 559 | trace_rdev_dump_survey(&rdev->wiphy, netdev, idx); |
| 560 | ret = rdev->ops->dump_survey(&rdev->wiphy, netdev, idx, info); |
| 561 | if (ret < 0) |
| 562 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 563 | else |
| 564 | trace_rdev_return_int_survey_info(&rdev->wiphy, ret, info); |
| 565 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 566 | } |
| 567 | |
| 568 | static inline int rdev_set_pmksa(struct cfg80211_registered_device *rdev, |
| 569 | struct net_device *netdev, |
| 570 | struct cfg80211_pmksa *pmksa) |
| 571 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 572 | int ret; |
| 573 | trace_rdev_set_pmksa(&rdev->wiphy, netdev, pmksa); |
| 574 | ret = rdev->ops->set_pmksa(&rdev->wiphy, netdev, pmksa); |
| 575 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 576 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 577 | } |
| 578 | |
| 579 | static inline int rdev_del_pmksa(struct cfg80211_registered_device *rdev, |
| 580 | struct net_device *netdev, |
| 581 | struct cfg80211_pmksa *pmksa) |
| 582 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 583 | int ret; |
| 584 | trace_rdev_del_pmksa(&rdev->wiphy, netdev, pmksa); |
| 585 | ret = rdev->ops->del_pmksa(&rdev->wiphy, netdev, pmksa); |
| 586 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 587 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 588 | } |
| 589 | |
| 590 | static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev, |
| 591 | struct net_device *netdev) |
| 592 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 593 | int ret; |
| 594 | trace_rdev_flush_pmksa(&rdev->wiphy, netdev); |
| 595 | ret = rdev->ops->flush_pmksa(&rdev->wiphy, netdev); |
| 596 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 597 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 598 | } |
| 599 | |
| 600 | static inline int |
| 601 | rdev_remain_on_channel(struct cfg80211_registered_device *rdev, |
| 602 | struct wireless_dev *wdev, |
| 603 | struct ieee80211_channel *chan, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 604 | unsigned int duration, u64 *cookie) |
| 605 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 606 | int ret; |
Johannes Berg | 42d97a5 | 2012-11-08 18:31:02 +0100 | [diff] [blame] | 607 | trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 608 | ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan, |
Johannes Berg | 42d97a5 | 2012-11-08 18:31:02 +0100 | [diff] [blame] | 609 | duration, cookie); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 610 | trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); |
| 611 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 612 | } |
| 613 | |
| 614 | static inline int |
| 615 | rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev, |
| 616 | struct wireless_dev *wdev, u64 cookie) |
| 617 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 618 | int ret; |
| 619 | trace_rdev_cancel_remain_on_channel(&rdev->wiphy, wdev, cookie); |
| 620 | ret = rdev->ops->cancel_remain_on_channel(&rdev->wiphy, wdev, cookie); |
| 621 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 622 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 623 | } |
| 624 | |
| 625 | static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev, |
| 626 | struct wireless_dev *wdev, |
Andrei Otcheretianski | b176e62 | 2013-11-18 19:06:49 +0200 | [diff] [blame] | 627 | struct cfg80211_mgmt_tx_params *params, |
| 628 | u64 *cookie) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 629 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 630 | int ret; |
Andrei Otcheretianski | b176e62 | 2013-11-18 19:06:49 +0200 | [diff] [blame] | 631 | trace_rdev_mgmt_tx(&rdev->wiphy, wdev, params); |
| 632 | ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, params, cookie); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 633 | trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); |
| 634 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 635 | } |
| 636 | |
| 637 | static inline int |
| 638 | rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device *rdev, |
| 639 | struct wireless_dev *wdev, u64 cookie) |
| 640 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 641 | int ret; |
| 642 | trace_rdev_mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie); |
| 643 | ret = rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie); |
| 644 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 645 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 646 | } |
| 647 | |
| 648 | static inline int rdev_set_power_mgmt(struct cfg80211_registered_device *rdev, |
| 649 | struct net_device *dev, bool enabled, |
| 650 | int timeout) |
| 651 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 652 | int ret; |
| 653 | trace_rdev_set_power_mgmt(&rdev->wiphy, dev, enabled, timeout); |
| 654 | ret = rdev->ops->set_power_mgmt(&rdev->wiphy, dev, enabled, timeout); |
| 655 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 656 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 657 | } |
| 658 | |
| 659 | static inline int |
| 660 | rdev_set_cqm_rssi_config(struct cfg80211_registered_device *rdev, |
| 661 | struct net_device *dev, s32 rssi_thold, u32 rssi_hyst) |
| 662 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 663 | int ret; |
| 664 | trace_rdev_set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold, |
| 665 | rssi_hyst); |
| 666 | ret = rdev->ops->set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold, |
| 667 | rssi_hyst); |
| 668 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 669 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 670 | } |
| 671 | |
| 672 | static inline int |
| 673 | rdev_set_cqm_txe_config(struct cfg80211_registered_device *rdev, |
| 674 | struct net_device *dev, u32 rate, u32 pkts, u32 intvl) |
| 675 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 676 | int ret; |
| 677 | trace_rdev_set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, intvl); |
| 678 | ret = rdev->ops->set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 679 | intvl); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 680 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 681 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 682 | } |
| 683 | |
| 684 | static inline void |
| 685 | rdev_mgmt_frame_register(struct cfg80211_registered_device *rdev, |
| 686 | struct wireless_dev *wdev, u16 frame_type, bool reg) |
| 687 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 688 | trace_rdev_mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg); |
| 689 | rdev->ops->mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg); |
| 690 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 691 | } |
| 692 | |
| 693 | static inline int rdev_set_antenna(struct cfg80211_registered_device *rdev, |
| 694 | u32 tx_ant, u32 rx_ant) |
| 695 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 696 | int ret; |
| 697 | trace_rdev_set_antenna(&rdev->wiphy, tx_ant, rx_ant); |
| 698 | ret = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant); |
| 699 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 700 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 701 | } |
| 702 | |
| 703 | static inline int rdev_get_antenna(struct cfg80211_registered_device *rdev, |
| 704 | u32 *tx_ant, u32 *rx_ant) |
| 705 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 706 | int ret; |
| 707 | trace_rdev_get_antenna(&rdev->wiphy); |
| 708 | ret = rdev->ops->get_antenna(&rdev->wiphy, tx_ant, rx_ant); |
| 709 | if (ret) |
| 710 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 711 | else |
| 712 | trace_rdev_return_int_tx_rx(&rdev->wiphy, ret, *tx_ant, |
| 713 | *rx_ant); |
| 714 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 715 | } |
| 716 | |
| 717 | static inline int rdev_set_ringparam(struct cfg80211_registered_device *rdev, |
| 718 | u32 tx, u32 rx) |
| 719 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 720 | int ret; |
| 721 | trace_rdev_set_ringparam(&rdev->wiphy, tx, rx); |
| 722 | ret = rdev->ops->set_ringparam(&rdev->wiphy, tx, rx); |
| 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 void rdev_get_ringparam(struct cfg80211_registered_device *rdev, |
| 728 | u32 *tx, u32 *tx_max, u32 *rx, |
| 729 | u32 *rx_max) |
| 730 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 731 | trace_rdev_get_ringparam(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 732 | rdev->ops->get_ringparam(&rdev->wiphy, tx, tx_max, rx, rx_max); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 733 | trace_rdev_return_void_tx_rx(&rdev->wiphy, *tx, *tx_max, *rx, *rx_max); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 734 | } |
| 735 | |
| 736 | static inline int |
| 737 | rdev_sched_scan_start(struct cfg80211_registered_device *rdev, |
| 738 | struct net_device *dev, |
| 739 | struct cfg80211_sched_scan_request *request) |
| 740 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 741 | int ret; |
| 742 | trace_rdev_sched_scan_start(&rdev->wiphy, dev, request); |
| 743 | ret = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request); |
| 744 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 745 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 746 | } |
| 747 | |
| 748 | static inline int rdev_sched_scan_stop(struct cfg80211_registered_device *rdev, |
| 749 | struct net_device *dev) |
| 750 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 751 | int ret; |
| 752 | trace_rdev_sched_scan_stop(&rdev->wiphy, dev); |
| 753 | ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev); |
| 754 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 755 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 756 | } |
| 757 | |
| 758 | static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev, |
| 759 | struct net_device *dev, |
| 760 | struct cfg80211_gtk_rekey_data *data) |
| 761 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 762 | int ret; |
| 763 | trace_rdev_set_rekey_data(&rdev->wiphy, dev); |
| 764 | ret = rdev->ops->set_rekey_data(&rdev->wiphy, dev, data); |
| 765 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 766 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 767 | } |
| 768 | |
| 769 | static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev, |
| 770 | struct net_device *dev, u8 *peer, |
| 771 | u8 action_code, u8 dialog_token, |
| 772 | u16 status_code, const u8 *buf, size_t len) |
| 773 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 774 | int ret; |
| 775 | trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code, |
| 776 | dialog_token, status_code, buf, len); |
| 777 | ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code, |
| 778 | dialog_token, status_code, buf, len); |
| 779 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 780 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 781 | } |
| 782 | |
| 783 | static inline int rdev_tdls_oper(struct cfg80211_registered_device *rdev, |
| 784 | struct net_device *dev, u8 *peer, |
| 785 | enum nl80211_tdls_operation oper) |
| 786 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 787 | int ret; |
| 788 | trace_rdev_tdls_oper(&rdev->wiphy, dev, peer, oper); |
| 789 | ret = rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, oper); |
| 790 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 791 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 792 | } |
| 793 | |
| 794 | static inline int rdev_probe_client(struct cfg80211_registered_device *rdev, |
| 795 | struct net_device *dev, const u8 *peer, |
| 796 | u64 *cookie) |
| 797 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 798 | int ret; |
| 799 | trace_rdev_probe_client(&rdev->wiphy, dev, peer); |
| 800 | ret = rdev->ops->probe_client(&rdev->wiphy, dev, peer, cookie); |
| 801 | trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); |
| 802 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 803 | } |
| 804 | |
| 805 | static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev, |
| 806 | struct net_device *dev, u16 noack_map) |
| 807 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 808 | int ret; |
| 809 | trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map); |
| 810 | ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map); |
| 811 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 812 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 813 | } |
| 814 | |
| 815 | static inline int |
| 816 | rdev_get_et_sset_count(struct cfg80211_registered_device *rdev, |
| 817 | struct net_device *dev, int sset) |
| 818 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 819 | int ret; |
| 820 | trace_rdev_get_et_sset_count(&rdev->wiphy, dev, sset); |
| 821 | ret = rdev->ops->get_et_sset_count(&rdev->wiphy, dev, sset); |
| 822 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 823 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 824 | } |
| 825 | |
| 826 | static inline void rdev_get_et_stats(struct cfg80211_registered_device *rdev, |
| 827 | struct net_device *dev, |
| 828 | struct ethtool_stats *stats, u64 *data) |
| 829 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 830 | trace_rdev_get_et_stats(&rdev->wiphy, dev); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 831 | rdev->ops->get_et_stats(&rdev->wiphy, dev, stats, data); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 832 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 833 | } |
| 834 | |
| 835 | static inline void rdev_get_et_strings(struct cfg80211_registered_device *rdev, |
| 836 | struct net_device *dev, u32 sset, |
| 837 | u8 *data) |
| 838 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 839 | trace_rdev_get_et_strings(&rdev->wiphy, dev, sset); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 840 | rdev->ops->get_et_strings(&rdev->wiphy, dev, sset, data); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 841 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 842 | } |
| 843 | |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 844 | static inline int |
| 845 | rdev_get_channel(struct cfg80211_registered_device *rdev, |
| 846 | struct wireless_dev *wdev, |
| 847 | struct cfg80211_chan_def *chandef) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 848 | { |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 849 | int ret; |
| 850 | |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 851 | trace_rdev_get_channel(&rdev->wiphy, wdev); |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 852 | ret = rdev->ops->get_channel(&rdev->wiphy, wdev, chandef); |
| 853 | trace_rdev_return_chandef(&rdev->wiphy, ret, chandef); |
| 854 | |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 855 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 856 | } |
| 857 | |
Johannes Berg | eeb126e | 2012-10-23 15:16:50 +0200 | [diff] [blame] | 858 | static inline int rdev_start_p2p_device(struct cfg80211_registered_device *rdev, |
| 859 | struct wireless_dev *wdev) |
| 860 | { |
| 861 | int ret; |
| 862 | |
| 863 | trace_rdev_start_p2p_device(&rdev->wiphy, wdev); |
| 864 | ret = rdev->ops->start_p2p_device(&rdev->wiphy, wdev); |
| 865 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 866 | return ret; |
| 867 | } |
| 868 | |
| 869 | static inline void rdev_stop_p2p_device(struct cfg80211_registered_device *rdev, |
| 870 | struct wireless_dev *wdev) |
| 871 | { |
| 872 | trace_rdev_stop_p2p_device(&rdev->wiphy, wdev); |
| 873 | rdev->ops->stop_p2p_device(&rdev->wiphy, wdev); |
| 874 | trace_rdev_return_void(&rdev->wiphy); |
Arend van Spriel | 5de1798 | 2013-04-18 15:49:00 +0200 | [diff] [blame] | 875 | } |
Vasanthakumar Thiagarajan | 77765ea | 2013-01-18 11:18:45 +0530 | [diff] [blame] | 876 | |
| 877 | static inline int rdev_set_mac_acl(struct cfg80211_registered_device *rdev, |
| 878 | struct net_device *dev, |
| 879 | struct cfg80211_acl_data *params) |
| 880 | { |
| 881 | int ret; |
| 882 | |
| 883 | trace_rdev_set_mac_acl(&rdev->wiphy, dev, params); |
| 884 | ret = rdev->ops->set_mac_acl(&rdev->wiphy, dev, params); |
| 885 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 886 | return ret; |
| 887 | } |
Jouni Malinen | 355199e | 2013-02-27 17:14:27 +0200 | [diff] [blame] | 888 | |
| 889 | static inline int rdev_update_ft_ies(struct cfg80211_registered_device *rdev, |
| 890 | struct net_device *dev, |
| 891 | struct cfg80211_update_ft_ies_params *ftie) |
| 892 | { |
| 893 | int ret; |
| 894 | |
| 895 | trace_rdev_update_ft_ies(&rdev->wiphy, dev, ftie); |
| 896 | ret = rdev->ops->update_ft_ies(&rdev->wiphy, dev, ftie); |
| 897 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 898 | return ret; |
| 899 | } |
| 900 | |
Arend van Spriel | 5de1798 | 2013-04-18 15:49:00 +0200 | [diff] [blame] | 901 | static inline int rdev_crit_proto_start(struct cfg80211_registered_device *rdev, |
| 902 | struct wireless_dev *wdev, |
| 903 | enum nl80211_crit_proto_id protocol, |
| 904 | u16 duration) |
| 905 | { |
| 906 | int ret; |
| 907 | |
| 908 | trace_rdev_crit_proto_start(&rdev->wiphy, wdev, protocol, duration); |
| 909 | ret = rdev->ops->crit_proto_start(&rdev->wiphy, wdev, |
| 910 | protocol, duration); |
| 911 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 912 | return ret; |
| 913 | } |
| 914 | |
| 915 | static inline void rdev_crit_proto_stop(struct cfg80211_registered_device *rdev, |
| 916 | struct wireless_dev *wdev) |
| 917 | { |
| 918 | trace_rdev_crit_proto_stop(&rdev->wiphy, wdev); |
| 919 | rdev->ops->crit_proto_stop(&rdev->wiphy, wdev); |
| 920 | trace_rdev_return_void(&rdev->wiphy); |
| 921 | } |
| 922 | |
Simon Wunderlich | 16ef1fe | 2013-07-11 16:09:05 +0200 | [diff] [blame] | 923 | static inline int rdev_channel_switch(struct cfg80211_registered_device *rdev, |
| 924 | struct net_device *dev, |
| 925 | struct cfg80211_csa_settings *params) |
| 926 | { |
| 927 | int ret; |
| 928 | |
| 929 | trace_rdev_channel_switch(&rdev->wiphy, dev, params); |
| 930 | ret = rdev->ops->channel_switch(&rdev->wiphy, dev, params); |
| 931 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 932 | return ret; |
| 933 | } |
| 934 | |
Kyeyoon Park | fa9ffc7 | 2013-12-16 23:01:30 -0800 | [diff] [blame] | 935 | static inline int rdev_set_qos_map(struct cfg80211_registered_device *rdev, |
| 936 | struct net_device *dev, |
| 937 | struct cfg80211_qos_map *qos_map) |
| 938 | { |
| 939 | int ret = -EOPNOTSUPP; |
| 940 | |
| 941 | if (rdev->ops->set_qos_map) { |
| 942 | trace_rdev_set_qos_map(&rdev->wiphy, dev, qos_map); |
| 943 | ret = rdev->ops->set_qos_map(&rdev->wiphy, dev, qos_map); |
| 944 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 945 | } |
| 946 | |
| 947 | return ret; |
| 948 | } |
| 949 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 950 | #endif /* __CFG80211_RDEV_OPS */ |