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 | |
| 9 | static inline int rdev_suspend(struct cfg80211_registered_device *rdev) |
| 10 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 11 | int ret; |
| 12 | trace_rdev_suspend(&rdev->wiphy, rdev->wowlan); |
| 13 | ret = rdev->ops->suspend(&rdev->wiphy, rdev->wowlan); |
| 14 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 15 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 16 | } |
| 17 | |
| 18 | static inline int rdev_resume(struct cfg80211_registered_device *rdev) |
| 19 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 20 | int ret; |
| 21 | trace_rdev_resume(&rdev->wiphy); |
| 22 | ret = rdev->ops->resume(&rdev->wiphy); |
| 23 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 24 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | static inline void rdev_set_wakeup(struct cfg80211_registered_device *rdev, |
| 28 | bool enabled) |
| 29 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 30 | trace_rdev_set_wakeup(&rdev->wiphy, enabled); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 31 | rdev->ops->set_wakeup(&rdev->wiphy, enabled); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 32 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | static inline struct wireless_dev |
| 36 | *rdev_add_virtual_intf(struct cfg80211_registered_device *rdev, char *name, |
| 37 | enum nl80211_iftype type, u32 *flags, |
| 38 | struct vif_params *params) |
| 39 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 40 | struct wireless_dev *ret; |
| 41 | trace_rdev_add_virtual_intf(&rdev->wiphy, name, type); |
| 42 | ret = rdev->ops->add_virtual_intf(&rdev->wiphy, name, type, flags, |
| 43 | params); |
| 44 | trace_rdev_return_wdev(&rdev->wiphy, ret); |
| 45 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | static inline int |
| 49 | rdev_del_virtual_intf(struct cfg80211_registered_device *rdev, |
| 50 | struct wireless_dev *wdev) |
| 51 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 52 | int ret; |
| 53 | trace_rdev_del_virtual_intf(&rdev->wiphy, wdev); |
| 54 | ret = rdev->ops->del_virtual_intf(&rdev->wiphy, wdev); |
| 55 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 56 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | static inline int |
| 60 | rdev_change_virtual_intf(struct cfg80211_registered_device *rdev, |
| 61 | struct net_device *dev, enum nl80211_iftype type, |
| 62 | u32 *flags, struct vif_params *params) |
| 63 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 64 | int ret; |
| 65 | trace_rdev_change_virtual_intf(&rdev->wiphy, dev, type); |
| 66 | ret = rdev->ops->change_virtual_intf(&rdev->wiphy, dev, type, flags, |
| 67 | params); |
| 68 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 69 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 70 | } |
| 71 | |
| 72 | static inline int rdev_add_key(struct cfg80211_registered_device *rdev, |
| 73 | struct net_device *netdev, u8 key_index, |
| 74 | bool pairwise, const u8 *mac_addr, |
| 75 | struct key_params *params) |
| 76 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 77 | int ret; |
| 78 | trace_rdev_add_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr); |
| 79 | ret = rdev->ops->add_key(&rdev->wiphy, netdev, key_index, pairwise, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 80 | mac_addr, params); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 81 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 82 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 83 | } |
| 84 | |
| 85 | static inline int |
| 86 | rdev_get_key(struct cfg80211_registered_device *rdev, struct net_device *netdev, |
| 87 | u8 key_index, bool pairwise, const u8 *mac_addr, void *cookie, |
| 88 | void (*callback)(void *cookie, struct key_params*)) |
| 89 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 90 | int ret; |
| 91 | trace_rdev_get_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr); |
| 92 | ret = rdev->ops->get_key(&rdev->wiphy, netdev, key_index, pairwise, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 93 | mac_addr, cookie, callback); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 94 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 95 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | static inline int rdev_del_key(struct cfg80211_registered_device *rdev, |
| 99 | struct net_device *netdev, u8 key_index, |
| 100 | bool pairwise, const u8 *mac_addr) |
| 101 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 102 | int ret; |
| 103 | trace_rdev_del_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr); |
| 104 | ret = rdev->ops->del_key(&rdev->wiphy, netdev, key_index, pairwise, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 105 | mac_addr); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 106 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 107 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 108 | } |
| 109 | |
| 110 | static inline int |
| 111 | rdev_set_default_key(struct cfg80211_registered_device *rdev, |
| 112 | struct net_device *netdev, u8 key_index, bool unicast, |
| 113 | bool multicast) |
| 114 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 115 | int ret; |
| 116 | trace_rdev_set_default_key(&rdev->wiphy, netdev, key_index, |
| 117 | unicast, multicast); |
| 118 | ret = rdev->ops->set_default_key(&rdev->wiphy, netdev, key_index, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 119 | unicast, multicast); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 120 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 121 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | static inline int |
| 125 | rdev_set_default_mgmt_key(struct cfg80211_registered_device *rdev, |
| 126 | struct net_device *netdev, u8 key_index) |
| 127 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 128 | int ret; |
| 129 | trace_rdev_set_default_mgmt_key(&rdev->wiphy, netdev, key_index); |
| 130 | ret = rdev->ops->set_default_mgmt_key(&rdev->wiphy, netdev, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 131 | key_index); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 132 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 133 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | static inline int rdev_start_ap(struct cfg80211_registered_device *rdev, |
| 137 | struct net_device *dev, |
| 138 | struct cfg80211_ap_settings *settings) |
| 139 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 140 | int ret; |
| 141 | trace_rdev_start_ap(&rdev->wiphy, dev, settings); |
| 142 | ret = rdev->ops->start_ap(&rdev->wiphy, dev, settings); |
| 143 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 144 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 145 | } |
| 146 | |
| 147 | static inline int rdev_change_beacon(struct cfg80211_registered_device *rdev, |
| 148 | struct net_device *dev, |
| 149 | struct cfg80211_beacon_data *info) |
| 150 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 151 | int ret; |
| 152 | trace_rdev_change_beacon(&rdev->wiphy, dev, info); |
| 153 | ret = rdev->ops->change_beacon(&rdev->wiphy, dev, info); |
| 154 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 155 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 156 | } |
| 157 | |
| 158 | static inline int rdev_stop_ap(struct cfg80211_registered_device *rdev, |
| 159 | struct net_device *dev) |
| 160 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 161 | int ret; |
| 162 | trace_rdev_stop_ap(&rdev->wiphy, dev); |
| 163 | ret = rdev->ops->stop_ap(&rdev->wiphy, dev); |
| 164 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 165 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 166 | } |
| 167 | |
| 168 | static inline int rdev_add_station(struct cfg80211_registered_device *rdev, |
| 169 | struct net_device *dev, u8 *mac, |
| 170 | struct station_parameters *params) |
| 171 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 172 | int ret; |
| 173 | trace_rdev_add_station(&rdev->wiphy, dev, mac, params); |
| 174 | ret = rdev->ops->add_station(&rdev->wiphy, dev, mac, params); |
| 175 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 176 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 177 | } |
| 178 | |
| 179 | static inline int rdev_del_station(struct cfg80211_registered_device *rdev, |
| 180 | struct net_device *dev, u8 *mac) |
| 181 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 182 | int ret; |
| 183 | trace_rdev_del_station(&rdev->wiphy, dev, mac); |
| 184 | ret = rdev->ops->del_station(&rdev->wiphy, dev, mac); |
| 185 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 186 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 187 | } |
| 188 | |
| 189 | static inline int rdev_change_station(struct cfg80211_registered_device *rdev, |
| 190 | struct net_device *dev, u8 *mac, |
| 191 | struct station_parameters *params) |
| 192 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 193 | int ret; |
| 194 | trace_rdev_change_station(&rdev->wiphy, dev, mac, params); |
| 195 | ret = rdev->ops->change_station(&rdev->wiphy, dev, mac, params); |
| 196 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 197 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 198 | } |
| 199 | |
| 200 | static inline int rdev_get_station(struct cfg80211_registered_device *rdev, |
| 201 | struct net_device *dev, u8 *mac, |
| 202 | struct station_info *sinfo) |
| 203 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 204 | int ret; |
| 205 | trace_rdev_get_station(&rdev->wiphy, dev, mac); |
| 206 | ret = rdev->ops->get_station(&rdev->wiphy, dev, mac, sinfo); |
| 207 | trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo); |
| 208 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 209 | } |
| 210 | |
| 211 | static inline int rdev_dump_station(struct cfg80211_registered_device *rdev, |
| 212 | struct net_device *dev, int idx, u8 *mac, |
| 213 | struct station_info *sinfo) |
| 214 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 215 | int ret; |
| 216 | trace_rdev_dump_station(&rdev->wiphy, dev, idx, mac); |
| 217 | ret = rdev->ops->dump_station(&rdev->wiphy, dev, idx, mac, sinfo); |
| 218 | trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo); |
| 219 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 220 | } |
| 221 | |
| 222 | static inline int rdev_add_mpath(struct cfg80211_registered_device *rdev, |
| 223 | struct net_device *dev, u8 *dst, u8 *next_hop) |
| 224 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 225 | int ret; |
| 226 | trace_rdev_add_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 227 | ret = rdev->ops->add_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 228 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 229 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 230 | } |
| 231 | |
| 232 | static inline int rdev_del_mpath(struct cfg80211_registered_device *rdev, |
| 233 | struct net_device *dev, u8 *dst) |
| 234 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 235 | int ret; |
| 236 | trace_rdev_del_mpath(&rdev->wiphy, dev, dst); |
| 237 | ret = rdev->ops->del_mpath(&rdev->wiphy, dev, dst); |
| 238 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 239 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | static inline int rdev_change_mpath(struct cfg80211_registered_device *rdev, |
| 243 | struct net_device *dev, u8 *dst, |
| 244 | u8 *next_hop) |
| 245 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 246 | int ret; |
| 247 | trace_rdev_change_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 248 | ret = rdev->ops->change_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 249 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 250 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 251 | } |
| 252 | |
| 253 | static inline int rdev_get_mpath(struct cfg80211_registered_device *rdev, |
| 254 | struct net_device *dev, u8 *dst, u8 *next_hop, |
| 255 | struct mpath_info *pinfo) |
| 256 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 257 | int ret; |
| 258 | trace_rdev_get_mpath(&rdev->wiphy, dev, dst, next_hop); |
| 259 | ret = rdev->ops->get_mpath(&rdev->wiphy, dev, dst, next_hop, pinfo); |
| 260 | trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo); |
| 261 | return ret; |
| 262 | |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 263 | } |
| 264 | |
| 265 | static inline int rdev_dump_mpath(struct cfg80211_registered_device *rdev, |
| 266 | struct net_device *dev, int idx, u8 *dst, |
| 267 | u8 *next_hop, struct mpath_info *pinfo) |
| 268 | |
| 269 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 270 | int ret; |
| 271 | trace_rdev_dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop); |
| 272 | ret = rdev->ops->dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 273 | pinfo); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 274 | trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo); |
| 275 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 276 | } |
| 277 | |
| 278 | static inline int |
| 279 | rdev_get_mesh_config(struct cfg80211_registered_device *rdev, |
| 280 | struct net_device *dev, struct mesh_config *conf) |
| 281 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 282 | int ret; |
| 283 | trace_rdev_get_mesh_config(&rdev->wiphy, dev); |
| 284 | ret = rdev->ops->get_mesh_config(&rdev->wiphy, dev, conf); |
| 285 | trace_rdev_return_int_mesh_config(&rdev->wiphy, ret, conf); |
| 286 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 287 | } |
| 288 | |
| 289 | static inline int |
| 290 | rdev_update_mesh_config(struct cfg80211_registered_device *rdev, |
| 291 | struct net_device *dev, u32 mask, |
| 292 | const struct mesh_config *nconf) |
| 293 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 294 | int ret; |
| 295 | trace_rdev_update_mesh_config(&rdev->wiphy, dev, mask, nconf); |
| 296 | ret = rdev->ops->update_mesh_config(&rdev->wiphy, dev, mask, nconf); |
| 297 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 298 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | static inline int rdev_join_mesh(struct cfg80211_registered_device *rdev, |
| 302 | struct net_device *dev, |
| 303 | const struct mesh_config *conf, |
| 304 | const struct mesh_setup *setup) |
| 305 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 306 | int ret; |
| 307 | trace_rdev_join_mesh(&rdev->wiphy, dev, conf, setup); |
| 308 | ret = rdev->ops->join_mesh(&rdev->wiphy, dev, conf, setup); |
| 309 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 310 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 311 | } |
| 312 | |
| 313 | |
| 314 | static inline int rdev_leave_mesh(struct cfg80211_registered_device *rdev, |
| 315 | struct net_device *dev) |
| 316 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 317 | int ret; |
| 318 | trace_rdev_leave_mesh(&rdev->wiphy, dev); |
| 319 | ret = rdev->ops->leave_mesh(&rdev->wiphy, dev); |
| 320 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 321 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 322 | } |
| 323 | |
| 324 | static inline int rdev_change_bss(struct cfg80211_registered_device *rdev, |
| 325 | struct net_device *dev, |
| 326 | struct bss_parameters *params) |
| 327 | |
| 328 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 329 | int ret; |
| 330 | trace_rdev_change_bss(&rdev->wiphy, dev, params); |
| 331 | ret = rdev->ops->change_bss(&rdev->wiphy, dev, params); |
| 332 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 333 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 334 | } |
| 335 | |
| 336 | static inline int rdev_set_txq_params(struct cfg80211_registered_device *rdev, |
| 337 | struct net_device *dev, |
| 338 | struct ieee80211_txq_params *params) |
| 339 | |
| 340 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 341 | int ret; |
| 342 | trace_rdev_set_txq_params(&rdev->wiphy, dev, params); |
| 343 | ret = rdev->ops->set_txq_params(&rdev->wiphy, dev, params); |
| 344 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 345 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 346 | } |
| 347 | |
| 348 | static inline int |
| 349 | rdev_libertas_set_mesh_channel(struct cfg80211_registered_device *rdev, |
| 350 | struct net_device *dev, |
| 351 | struct ieee80211_channel *chan) |
| 352 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 353 | int ret; |
| 354 | trace_rdev_libertas_set_mesh_channel(&rdev->wiphy, dev, chan); |
| 355 | ret = rdev->ops->libertas_set_mesh_channel(&rdev->wiphy, dev, chan); |
| 356 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 357 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 358 | } |
| 359 | |
| 360 | static inline int |
| 361 | rdev_set_monitor_channel(struct cfg80211_registered_device *rdev, |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 362 | struct cfg80211_chan_def *chandef) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 363 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 364 | int ret; |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 365 | trace_rdev_set_monitor_channel(&rdev->wiphy, chandef); |
| 366 | ret = rdev->ops->set_monitor_channel(&rdev->wiphy, chandef); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 367 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 368 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 369 | } |
| 370 | |
| 371 | static inline int rdev_scan(struct cfg80211_registered_device *rdev, |
| 372 | struct cfg80211_scan_request *request) |
| 373 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 374 | int ret; |
| 375 | trace_rdev_scan(&rdev->wiphy, request); |
| 376 | ret = rdev->ops->scan(&rdev->wiphy, request); |
| 377 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 378 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 379 | } |
| 380 | |
| 381 | static inline int rdev_auth(struct cfg80211_registered_device *rdev, |
| 382 | struct net_device *dev, |
| 383 | struct cfg80211_auth_request *req) |
| 384 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 385 | int ret; |
| 386 | trace_rdev_auth(&rdev->wiphy, dev, req); |
| 387 | ret = rdev->ops->auth(&rdev->wiphy, dev, req); |
| 388 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 389 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 390 | } |
| 391 | |
| 392 | static inline int rdev_assoc(struct cfg80211_registered_device *rdev, |
| 393 | struct net_device *dev, |
| 394 | struct cfg80211_assoc_request *req) |
| 395 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 396 | int ret; |
| 397 | trace_rdev_assoc(&rdev->wiphy, dev, req); |
| 398 | ret = rdev->ops->assoc(&rdev->wiphy, dev, req); |
| 399 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 400 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 401 | } |
| 402 | |
| 403 | static inline int rdev_deauth(struct cfg80211_registered_device *rdev, |
| 404 | struct net_device *dev, |
| 405 | struct cfg80211_deauth_request *req) |
| 406 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 407 | int ret; |
| 408 | trace_rdev_deauth(&rdev->wiphy, dev, req); |
| 409 | ret = rdev->ops->deauth(&rdev->wiphy, dev, req); |
| 410 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 411 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 412 | } |
| 413 | |
| 414 | static inline int rdev_disassoc(struct cfg80211_registered_device *rdev, |
| 415 | struct net_device *dev, |
| 416 | struct cfg80211_disassoc_request *req) |
| 417 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 418 | int ret; |
| 419 | trace_rdev_disassoc(&rdev->wiphy, dev, req); |
| 420 | ret = rdev->ops->disassoc(&rdev->wiphy, dev, req); |
| 421 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 422 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 423 | } |
| 424 | |
| 425 | static inline int rdev_connect(struct cfg80211_registered_device *rdev, |
| 426 | struct net_device *dev, |
| 427 | struct cfg80211_connect_params *sme) |
| 428 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 429 | int ret; |
| 430 | trace_rdev_connect(&rdev->wiphy, dev, sme); |
| 431 | ret = rdev->ops->connect(&rdev->wiphy, dev, sme); |
| 432 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 433 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 434 | } |
| 435 | |
| 436 | static inline int rdev_disconnect(struct cfg80211_registered_device *rdev, |
| 437 | struct net_device *dev, u16 reason_code) |
| 438 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 439 | int ret; |
| 440 | trace_rdev_disconnect(&rdev->wiphy, dev, reason_code); |
| 441 | ret = rdev->ops->disconnect(&rdev->wiphy, dev, reason_code); |
| 442 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 443 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 444 | } |
| 445 | |
| 446 | static inline int rdev_join_ibss(struct cfg80211_registered_device *rdev, |
| 447 | struct net_device *dev, |
| 448 | struct cfg80211_ibss_params *params) |
| 449 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 450 | int ret; |
| 451 | trace_rdev_join_ibss(&rdev->wiphy, dev, params); |
| 452 | ret = rdev->ops->join_ibss(&rdev->wiphy, dev, params); |
| 453 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 454 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 455 | } |
| 456 | |
| 457 | static inline int rdev_leave_ibss(struct cfg80211_registered_device *rdev, |
| 458 | struct net_device *dev) |
| 459 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 460 | int ret; |
| 461 | trace_rdev_leave_ibss(&rdev->wiphy, dev); |
| 462 | ret = rdev->ops->leave_ibss(&rdev->wiphy, dev); |
| 463 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 464 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 465 | } |
| 466 | |
| 467 | static inline int |
| 468 | rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed) |
| 469 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 470 | int ret; |
| 471 | trace_rdev_set_wiphy_params(&rdev->wiphy, changed); |
| 472 | ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed); |
| 473 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 474 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 475 | } |
| 476 | |
| 477 | static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev, |
Johannes Berg | c844211 | 2012-10-24 10:17:18 +0200 | [diff] [blame] | 478 | struct wireless_dev *wdev, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 479 | enum nl80211_tx_power_setting type, int mbm) |
| 480 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 481 | int ret; |
Johannes Berg | c844211 | 2012-10-24 10:17:18 +0200 | [diff] [blame] | 482 | trace_rdev_set_tx_power(&rdev->wiphy, wdev, type, mbm); |
| 483 | ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, type, mbm); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 484 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 485 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 486 | } |
| 487 | |
| 488 | static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev, |
Johannes Berg | c844211 | 2012-10-24 10:17:18 +0200 | [diff] [blame] | 489 | struct wireless_dev *wdev, int *dbm) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 490 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 491 | int ret; |
Johannes Berg | c844211 | 2012-10-24 10:17:18 +0200 | [diff] [blame] | 492 | trace_rdev_get_tx_power(&rdev->wiphy, wdev); |
| 493 | ret = rdev->ops->get_tx_power(&rdev->wiphy, wdev, dbm); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 494 | trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm); |
| 495 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 496 | } |
| 497 | |
| 498 | static inline int rdev_set_wds_peer(struct cfg80211_registered_device *rdev, |
| 499 | struct net_device *dev, const u8 *addr) |
| 500 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 501 | int ret; |
| 502 | trace_rdev_set_wds_peer(&rdev->wiphy, dev, addr); |
| 503 | ret = rdev->ops->set_wds_peer(&rdev->wiphy, dev, addr); |
| 504 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 505 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 506 | } |
| 507 | |
| 508 | static inline void rdev_rfkill_poll(struct cfg80211_registered_device *rdev) |
| 509 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 510 | trace_rdev_rfkill_poll(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 511 | rdev->ops->rfkill_poll(&rdev->wiphy); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 512 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 513 | } |
| 514 | |
| 515 | |
| 516 | #ifdef CONFIG_NL80211_TESTMODE |
| 517 | static inline int rdev_testmode_cmd(struct cfg80211_registered_device *rdev, |
| 518 | void *data, int len) |
| 519 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 520 | int ret; |
| 521 | trace_rdev_testmode_cmd(&rdev->wiphy); |
| 522 | ret = rdev->ops->testmode_cmd(&rdev->wiphy, data, len); |
| 523 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 524 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 525 | } |
| 526 | |
| 527 | static inline int rdev_testmode_dump(struct cfg80211_registered_device *rdev, |
| 528 | struct sk_buff *skb, |
| 529 | struct netlink_callback *cb, void *data, |
| 530 | int len) |
| 531 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 532 | int ret; |
| 533 | trace_rdev_testmode_dump(&rdev->wiphy); |
| 534 | ret = rdev->ops->testmode_dump(&rdev->wiphy, skb, cb, data, len); |
| 535 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 536 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 537 | } |
| 538 | #endif |
| 539 | |
| 540 | static inline int |
| 541 | rdev_set_bitrate_mask(struct cfg80211_registered_device *rdev, |
| 542 | struct net_device *dev, const u8 *peer, |
| 543 | const struct cfg80211_bitrate_mask *mask) |
| 544 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 545 | int ret; |
| 546 | trace_rdev_set_bitrate_mask(&rdev->wiphy, dev, peer, mask); |
| 547 | ret = rdev->ops->set_bitrate_mask(&rdev->wiphy, dev, peer, mask); |
| 548 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 549 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 550 | } |
| 551 | |
| 552 | static inline int rdev_dump_survey(struct cfg80211_registered_device *rdev, |
| 553 | struct net_device *netdev, int idx, |
| 554 | struct survey_info *info) |
| 555 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 556 | int ret; |
| 557 | trace_rdev_dump_survey(&rdev->wiphy, netdev, idx); |
| 558 | ret = rdev->ops->dump_survey(&rdev->wiphy, netdev, idx, info); |
| 559 | if (ret < 0) |
| 560 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 561 | else |
| 562 | trace_rdev_return_int_survey_info(&rdev->wiphy, ret, info); |
| 563 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 564 | } |
| 565 | |
| 566 | static inline int rdev_set_pmksa(struct cfg80211_registered_device *rdev, |
| 567 | struct net_device *netdev, |
| 568 | struct cfg80211_pmksa *pmksa) |
| 569 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 570 | int ret; |
| 571 | trace_rdev_set_pmksa(&rdev->wiphy, netdev, pmksa); |
| 572 | ret = rdev->ops->set_pmksa(&rdev->wiphy, netdev, pmksa); |
| 573 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 574 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 575 | } |
| 576 | |
| 577 | static inline int rdev_del_pmksa(struct cfg80211_registered_device *rdev, |
| 578 | struct net_device *netdev, |
| 579 | struct cfg80211_pmksa *pmksa) |
| 580 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 581 | int ret; |
| 582 | trace_rdev_del_pmksa(&rdev->wiphy, netdev, pmksa); |
| 583 | ret = rdev->ops->del_pmksa(&rdev->wiphy, netdev, pmksa); |
| 584 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 585 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 586 | } |
| 587 | |
| 588 | static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev, |
| 589 | struct net_device *netdev) |
| 590 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 591 | int ret; |
| 592 | trace_rdev_flush_pmksa(&rdev->wiphy, netdev); |
| 593 | ret = rdev->ops->flush_pmksa(&rdev->wiphy, netdev); |
| 594 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 595 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 596 | } |
| 597 | |
| 598 | static inline int |
| 599 | rdev_remain_on_channel(struct cfg80211_registered_device *rdev, |
| 600 | struct wireless_dev *wdev, |
| 601 | struct ieee80211_channel *chan, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 602 | unsigned int duration, u64 *cookie) |
| 603 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 604 | int ret; |
Johannes Berg | 42d97a5 | 2012-11-08 18:31:02 +0100 | [diff] [blame] | 605 | trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 606 | ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan, |
Johannes Berg | 42d97a5 | 2012-11-08 18:31:02 +0100 | [diff] [blame] | 607 | duration, cookie); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 608 | trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); |
| 609 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 610 | } |
| 611 | |
| 612 | static inline int |
| 613 | rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev, |
| 614 | struct wireless_dev *wdev, u64 cookie) |
| 615 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 616 | int ret; |
| 617 | trace_rdev_cancel_remain_on_channel(&rdev->wiphy, wdev, cookie); |
| 618 | ret = rdev->ops->cancel_remain_on_channel(&rdev->wiphy, wdev, cookie); |
| 619 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 620 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 621 | } |
| 622 | |
| 623 | static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev, |
| 624 | struct wireless_dev *wdev, |
| 625 | struct ieee80211_channel *chan, bool offchan, |
Johannes Berg | 42d97a5 | 2012-11-08 18:31:02 +0100 | [diff] [blame] | 626 | unsigned int wait, const u8 *buf, size_t len, |
| 627 | bool no_cck, bool dont_wait_for_ack, u64 *cookie) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 628 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 629 | int ret; |
Johannes Berg | 42d97a5 | 2012-11-08 18:31:02 +0100 | [diff] [blame] | 630 | trace_rdev_mgmt_tx(&rdev->wiphy, wdev, chan, offchan, |
| 631 | wait, no_cck, dont_wait_for_ack); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 632 | ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, chan, offchan, |
Johannes Berg | 42d97a5 | 2012-11-08 18:31:02 +0100 | [diff] [blame] | 633 | wait, buf, len, no_cck, |
| 634 | dont_wait_for_ack, cookie); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 635 | trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); |
| 636 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 637 | } |
| 638 | |
| 639 | static inline int |
| 640 | rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device *rdev, |
| 641 | struct wireless_dev *wdev, u64 cookie) |
| 642 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 643 | int ret; |
| 644 | trace_rdev_mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie); |
| 645 | ret = rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie); |
| 646 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 647 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 648 | } |
| 649 | |
| 650 | static inline int rdev_set_power_mgmt(struct cfg80211_registered_device *rdev, |
| 651 | struct net_device *dev, bool enabled, |
| 652 | int timeout) |
| 653 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 654 | int ret; |
| 655 | trace_rdev_set_power_mgmt(&rdev->wiphy, dev, enabled, timeout); |
| 656 | ret = rdev->ops->set_power_mgmt(&rdev->wiphy, dev, enabled, timeout); |
| 657 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 658 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 659 | } |
| 660 | |
| 661 | static inline int |
| 662 | rdev_set_cqm_rssi_config(struct cfg80211_registered_device *rdev, |
| 663 | struct net_device *dev, s32 rssi_thold, u32 rssi_hyst) |
| 664 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 665 | int ret; |
| 666 | trace_rdev_set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold, |
| 667 | rssi_hyst); |
| 668 | ret = rdev->ops->set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold, |
| 669 | rssi_hyst); |
| 670 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 671 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 672 | } |
| 673 | |
| 674 | static inline int |
| 675 | rdev_set_cqm_txe_config(struct cfg80211_registered_device *rdev, |
| 676 | struct net_device *dev, u32 rate, u32 pkts, u32 intvl) |
| 677 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 678 | int ret; |
| 679 | trace_rdev_set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, intvl); |
| 680 | ret = rdev->ops->set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 681 | intvl); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 682 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 683 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 684 | } |
| 685 | |
| 686 | static inline void |
| 687 | rdev_mgmt_frame_register(struct cfg80211_registered_device *rdev, |
| 688 | struct wireless_dev *wdev, u16 frame_type, bool reg) |
| 689 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 690 | trace_rdev_mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg); |
| 691 | rdev->ops->mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg); |
| 692 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 693 | } |
| 694 | |
| 695 | static inline int rdev_set_antenna(struct cfg80211_registered_device *rdev, |
| 696 | u32 tx_ant, u32 rx_ant) |
| 697 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 698 | int ret; |
| 699 | trace_rdev_set_antenna(&rdev->wiphy, tx_ant, rx_ant); |
| 700 | ret = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant); |
| 701 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 702 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 703 | } |
| 704 | |
| 705 | static inline int rdev_get_antenna(struct cfg80211_registered_device *rdev, |
| 706 | u32 *tx_ant, u32 *rx_ant) |
| 707 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 708 | int ret; |
| 709 | trace_rdev_get_antenna(&rdev->wiphy); |
| 710 | ret = rdev->ops->get_antenna(&rdev->wiphy, tx_ant, rx_ant); |
| 711 | if (ret) |
| 712 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 713 | else |
| 714 | trace_rdev_return_int_tx_rx(&rdev->wiphy, ret, *tx_ant, |
| 715 | *rx_ant); |
| 716 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 717 | } |
| 718 | |
| 719 | static inline int rdev_set_ringparam(struct cfg80211_registered_device *rdev, |
| 720 | u32 tx, u32 rx) |
| 721 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 722 | int ret; |
| 723 | trace_rdev_set_ringparam(&rdev->wiphy, tx, rx); |
| 724 | ret = rdev->ops->set_ringparam(&rdev->wiphy, tx, rx); |
| 725 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 726 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 727 | } |
| 728 | |
| 729 | static inline void rdev_get_ringparam(struct cfg80211_registered_device *rdev, |
| 730 | u32 *tx, u32 *tx_max, u32 *rx, |
| 731 | u32 *rx_max) |
| 732 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 733 | trace_rdev_get_ringparam(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 734 | rdev->ops->get_ringparam(&rdev->wiphy, tx, tx_max, rx, rx_max); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 735 | 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] | 736 | } |
| 737 | |
| 738 | static inline int |
| 739 | rdev_sched_scan_start(struct cfg80211_registered_device *rdev, |
| 740 | struct net_device *dev, |
| 741 | struct cfg80211_sched_scan_request *request) |
| 742 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 743 | int ret; |
| 744 | trace_rdev_sched_scan_start(&rdev->wiphy, dev, request); |
| 745 | ret = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request); |
| 746 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 747 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 748 | } |
| 749 | |
| 750 | static inline int rdev_sched_scan_stop(struct cfg80211_registered_device *rdev, |
| 751 | struct net_device *dev) |
| 752 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 753 | int ret; |
| 754 | trace_rdev_sched_scan_stop(&rdev->wiphy, dev); |
| 755 | ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev); |
| 756 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 757 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 758 | } |
| 759 | |
| 760 | static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev, |
| 761 | struct net_device *dev, |
| 762 | struct cfg80211_gtk_rekey_data *data) |
| 763 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 764 | int ret; |
| 765 | trace_rdev_set_rekey_data(&rdev->wiphy, dev); |
| 766 | ret = rdev->ops->set_rekey_data(&rdev->wiphy, dev, data); |
| 767 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 768 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 769 | } |
| 770 | |
| 771 | static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev, |
| 772 | struct net_device *dev, u8 *peer, |
| 773 | u8 action_code, u8 dialog_token, |
| 774 | u16 status_code, const u8 *buf, size_t len) |
| 775 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 776 | int ret; |
| 777 | trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code, |
| 778 | dialog_token, status_code, buf, len); |
| 779 | ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code, |
| 780 | dialog_token, status_code, buf, len); |
| 781 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 782 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 783 | } |
| 784 | |
| 785 | static inline int rdev_tdls_oper(struct cfg80211_registered_device *rdev, |
| 786 | struct net_device *dev, u8 *peer, |
| 787 | enum nl80211_tdls_operation oper) |
| 788 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 789 | int ret; |
| 790 | trace_rdev_tdls_oper(&rdev->wiphy, dev, peer, oper); |
| 791 | ret = rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, oper); |
| 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_probe_client(struct cfg80211_registered_device *rdev, |
| 797 | struct net_device *dev, const u8 *peer, |
| 798 | u64 *cookie) |
| 799 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 800 | int ret; |
| 801 | trace_rdev_probe_client(&rdev->wiphy, dev, peer); |
| 802 | ret = rdev->ops->probe_client(&rdev->wiphy, dev, peer, cookie); |
| 803 | trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); |
| 804 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 805 | } |
| 806 | |
| 807 | static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev, |
| 808 | struct net_device *dev, u16 noack_map) |
| 809 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 810 | int ret; |
| 811 | trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map); |
| 812 | ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map); |
| 813 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 814 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 815 | } |
| 816 | |
| 817 | static inline int |
| 818 | rdev_get_et_sset_count(struct cfg80211_registered_device *rdev, |
| 819 | struct net_device *dev, int sset) |
| 820 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 821 | int ret; |
| 822 | trace_rdev_get_et_sset_count(&rdev->wiphy, dev, sset); |
| 823 | ret = rdev->ops->get_et_sset_count(&rdev->wiphy, dev, sset); |
| 824 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 825 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 826 | } |
| 827 | |
| 828 | static inline void rdev_get_et_stats(struct cfg80211_registered_device *rdev, |
| 829 | struct net_device *dev, |
| 830 | struct ethtool_stats *stats, u64 *data) |
| 831 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 832 | trace_rdev_get_et_stats(&rdev->wiphy, dev); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 833 | rdev->ops->get_et_stats(&rdev->wiphy, dev, stats, data); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 834 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 835 | } |
| 836 | |
| 837 | static inline void rdev_get_et_strings(struct cfg80211_registered_device *rdev, |
| 838 | struct net_device *dev, u32 sset, |
| 839 | u8 *data) |
| 840 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 841 | trace_rdev_get_et_strings(&rdev->wiphy, dev, sset); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 842 | rdev->ops->get_et_strings(&rdev->wiphy, dev, sset, data); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 843 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 844 | } |
| 845 | |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 846 | static inline int |
| 847 | rdev_get_channel(struct cfg80211_registered_device *rdev, |
| 848 | struct wireless_dev *wdev, |
| 849 | struct cfg80211_chan_def *chandef) |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 850 | { |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 851 | int ret; |
| 852 | |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 853 | trace_rdev_get_channel(&rdev->wiphy, wdev); |
Johannes Berg | 683b6d3 | 2012-11-08 21:25:48 +0100 | [diff] [blame] | 854 | ret = rdev->ops->get_channel(&rdev->wiphy, wdev, chandef); |
| 855 | trace_rdev_return_chandef(&rdev->wiphy, ret, chandef); |
| 856 | |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 857 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 858 | } |
| 859 | |
Johannes Berg | eeb126e | 2012-10-23 15:16:50 +0200 | [diff] [blame] | 860 | static inline int rdev_start_p2p_device(struct cfg80211_registered_device *rdev, |
| 861 | struct wireless_dev *wdev) |
| 862 | { |
| 863 | int ret; |
| 864 | |
| 865 | trace_rdev_start_p2p_device(&rdev->wiphy, wdev); |
| 866 | ret = rdev->ops->start_p2p_device(&rdev->wiphy, wdev); |
| 867 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 868 | return ret; |
| 869 | } |
| 870 | |
| 871 | static inline void rdev_stop_p2p_device(struct cfg80211_registered_device *rdev, |
| 872 | struct wireless_dev *wdev) |
| 873 | { |
| 874 | trace_rdev_stop_p2p_device(&rdev->wiphy, wdev); |
| 875 | rdev->ops->stop_p2p_device(&rdev->wiphy, wdev); |
| 876 | trace_rdev_return_void(&rdev->wiphy); |
| 877 | } |
Vasanthakumar Thiagarajan | 77765ea | 2013-01-18 11:18:45 +0530 | [diff] [blame] | 878 | |
| 879 | static inline int rdev_set_mac_acl(struct cfg80211_registered_device *rdev, |
| 880 | struct net_device *dev, |
| 881 | struct cfg80211_acl_data *params) |
| 882 | { |
| 883 | int ret; |
| 884 | |
| 885 | trace_rdev_set_mac_acl(&rdev->wiphy, dev, params); |
| 886 | ret = rdev->ops->set_mac_acl(&rdev->wiphy, dev, params); |
| 887 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 888 | return ret; |
| 889 | } |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 890 | #endif /* __CFG80211_RDEV_OPS */ |