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, |
| 362 | struct ieee80211_channel *chan, |
| 363 | enum nl80211_channel_type channel_type) |
| 364 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 365 | int ret; |
| 366 | trace_rdev_set_monitor_channel(&rdev->wiphy, chan, channel_type); |
| 367 | ret = rdev->ops->set_monitor_channel(&rdev->wiphy, chan, channel_type); |
| 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, |
| 519 | void *data, int len) |
| 520 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 521 | int ret; |
| 522 | trace_rdev_testmode_cmd(&rdev->wiphy); |
| 523 | ret = rdev->ops->testmode_cmd(&rdev->wiphy, data, len); |
| 524 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 525 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 526 | } |
| 527 | |
| 528 | static inline int rdev_testmode_dump(struct cfg80211_registered_device *rdev, |
| 529 | struct sk_buff *skb, |
| 530 | struct netlink_callback *cb, void *data, |
| 531 | int len) |
| 532 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 533 | int ret; |
| 534 | trace_rdev_testmode_dump(&rdev->wiphy); |
| 535 | ret = rdev->ops->testmode_dump(&rdev->wiphy, skb, cb, data, len); |
| 536 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 537 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 538 | } |
| 539 | #endif |
| 540 | |
| 541 | static inline int |
| 542 | rdev_set_bitrate_mask(struct cfg80211_registered_device *rdev, |
| 543 | struct net_device *dev, const u8 *peer, |
| 544 | const struct cfg80211_bitrate_mask *mask) |
| 545 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 546 | int ret; |
| 547 | trace_rdev_set_bitrate_mask(&rdev->wiphy, dev, peer, mask); |
| 548 | ret = rdev->ops->set_bitrate_mask(&rdev->wiphy, dev, peer, mask); |
| 549 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 550 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 551 | } |
| 552 | |
| 553 | static inline int rdev_dump_survey(struct cfg80211_registered_device *rdev, |
| 554 | struct net_device *netdev, int idx, |
| 555 | struct survey_info *info) |
| 556 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 557 | int ret; |
| 558 | trace_rdev_dump_survey(&rdev->wiphy, netdev, idx); |
| 559 | ret = rdev->ops->dump_survey(&rdev->wiphy, netdev, idx, info); |
| 560 | if (ret < 0) |
| 561 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 562 | else |
| 563 | trace_rdev_return_int_survey_info(&rdev->wiphy, ret, info); |
| 564 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 565 | } |
| 566 | |
| 567 | static inline int rdev_set_pmksa(struct cfg80211_registered_device *rdev, |
| 568 | struct net_device *netdev, |
| 569 | struct cfg80211_pmksa *pmksa) |
| 570 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 571 | int ret; |
| 572 | trace_rdev_set_pmksa(&rdev->wiphy, netdev, pmksa); |
| 573 | ret = rdev->ops->set_pmksa(&rdev->wiphy, netdev, pmksa); |
| 574 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 575 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 576 | } |
| 577 | |
| 578 | static inline int rdev_del_pmksa(struct cfg80211_registered_device *rdev, |
| 579 | struct net_device *netdev, |
| 580 | struct cfg80211_pmksa *pmksa) |
| 581 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 582 | int ret; |
| 583 | trace_rdev_del_pmksa(&rdev->wiphy, netdev, pmksa); |
| 584 | ret = rdev->ops->del_pmksa(&rdev->wiphy, netdev, pmksa); |
| 585 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 586 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 587 | } |
| 588 | |
| 589 | static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev, |
| 590 | struct net_device *netdev) |
| 591 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 592 | int ret; |
| 593 | trace_rdev_flush_pmksa(&rdev->wiphy, netdev); |
| 594 | ret = rdev->ops->flush_pmksa(&rdev->wiphy, netdev); |
| 595 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 596 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 597 | } |
| 598 | |
| 599 | static inline int |
| 600 | rdev_remain_on_channel(struct cfg80211_registered_device *rdev, |
| 601 | struct wireless_dev *wdev, |
| 602 | struct ieee80211_channel *chan, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 603 | unsigned int duration, u64 *cookie) |
| 604 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 605 | int ret; |
Johannes Berg | 42d97a5 | 2012-11-08 18:31:02 +0100 | [diff] [blame^] | 606 | trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 607 | ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan, |
Johannes Berg | 42d97a5 | 2012-11-08 18:31:02 +0100 | [diff] [blame^] | 608 | duration, cookie); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 609 | trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); |
| 610 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 611 | } |
| 612 | |
| 613 | static inline int |
| 614 | rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev, |
| 615 | struct wireless_dev *wdev, u64 cookie) |
| 616 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 617 | int ret; |
| 618 | trace_rdev_cancel_remain_on_channel(&rdev->wiphy, wdev, cookie); |
| 619 | ret = rdev->ops->cancel_remain_on_channel(&rdev->wiphy, wdev, cookie); |
| 620 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 621 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 622 | } |
| 623 | |
| 624 | static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev, |
| 625 | struct wireless_dev *wdev, |
| 626 | struct ieee80211_channel *chan, bool offchan, |
Johannes Berg | 42d97a5 | 2012-11-08 18:31:02 +0100 | [diff] [blame^] | 627 | unsigned int wait, const u8 *buf, size_t len, |
| 628 | bool no_cck, bool dont_wait_for_ack, 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; |
Johannes Berg | 42d97a5 | 2012-11-08 18:31:02 +0100 | [diff] [blame^] | 631 | trace_rdev_mgmt_tx(&rdev->wiphy, wdev, chan, offchan, |
| 632 | wait, no_cck, dont_wait_for_ack); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 633 | ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, chan, offchan, |
Johannes Berg | 42d97a5 | 2012-11-08 18:31:02 +0100 | [diff] [blame^] | 634 | wait, buf, len, no_cck, |
| 635 | dont_wait_for_ack, cookie); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 636 | trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); |
| 637 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 638 | } |
| 639 | |
| 640 | static inline int |
| 641 | rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device *rdev, |
| 642 | struct wireless_dev *wdev, u64 cookie) |
| 643 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 644 | int ret; |
| 645 | trace_rdev_mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie); |
| 646 | ret = rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie); |
| 647 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 648 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 649 | } |
| 650 | |
| 651 | static inline int rdev_set_power_mgmt(struct cfg80211_registered_device *rdev, |
| 652 | struct net_device *dev, bool enabled, |
| 653 | int timeout) |
| 654 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 655 | int ret; |
| 656 | trace_rdev_set_power_mgmt(&rdev->wiphy, dev, enabled, timeout); |
| 657 | ret = rdev->ops->set_power_mgmt(&rdev->wiphy, dev, enabled, timeout); |
| 658 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 659 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 660 | } |
| 661 | |
| 662 | static inline int |
| 663 | rdev_set_cqm_rssi_config(struct cfg80211_registered_device *rdev, |
| 664 | struct net_device *dev, s32 rssi_thold, u32 rssi_hyst) |
| 665 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 666 | int ret; |
| 667 | trace_rdev_set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold, |
| 668 | rssi_hyst); |
| 669 | ret = rdev->ops->set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold, |
| 670 | rssi_hyst); |
| 671 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 672 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 673 | } |
| 674 | |
| 675 | static inline int |
| 676 | rdev_set_cqm_txe_config(struct cfg80211_registered_device *rdev, |
| 677 | struct net_device *dev, u32 rate, u32 pkts, u32 intvl) |
| 678 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 679 | int ret; |
| 680 | trace_rdev_set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, intvl); |
| 681 | ret = rdev->ops->set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 682 | intvl); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 683 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 684 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 685 | } |
| 686 | |
| 687 | static inline void |
| 688 | rdev_mgmt_frame_register(struct cfg80211_registered_device *rdev, |
| 689 | struct wireless_dev *wdev, u16 frame_type, bool reg) |
| 690 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 691 | trace_rdev_mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg); |
| 692 | rdev->ops->mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg); |
| 693 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 694 | } |
| 695 | |
| 696 | static inline int rdev_set_antenna(struct cfg80211_registered_device *rdev, |
| 697 | u32 tx_ant, u32 rx_ant) |
| 698 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 699 | int ret; |
| 700 | trace_rdev_set_antenna(&rdev->wiphy, tx_ant, rx_ant); |
| 701 | ret = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant); |
| 702 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 703 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 704 | } |
| 705 | |
| 706 | static inline int rdev_get_antenna(struct cfg80211_registered_device *rdev, |
| 707 | u32 *tx_ant, u32 *rx_ant) |
| 708 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 709 | int ret; |
| 710 | trace_rdev_get_antenna(&rdev->wiphy); |
| 711 | ret = rdev->ops->get_antenna(&rdev->wiphy, tx_ant, rx_ant); |
| 712 | if (ret) |
| 713 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 714 | else |
| 715 | trace_rdev_return_int_tx_rx(&rdev->wiphy, ret, *tx_ant, |
| 716 | *rx_ant); |
| 717 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 718 | } |
| 719 | |
| 720 | static inline int rdev_set_ringparam(struct cfg80211_registered_device *rdev, |
| 721 | u32 tx, u32 rx) |
| 722 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 723 | int ret; |
| 724 | trace_rdev_set_ringparam(&rdev->wiphy, tx, rx); |
| 725 | ret = rdev->ops->set_ringparam(&rdev->wiphy, tx, rx); |
| 726 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 727 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 728 | } |
| 729 | |
| 730 | static inline void rdev_get_ringparam(struct cfg80211_registered_device *rdev, |
| 731 | u32 *tx, u32 *tx_max, u32 *rx, |
| 732 | u32 *rx_max) |
| 733 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 734 | trace_rdev_get_ringparam(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 735 | rdev->ops->get_ringparam(&rdev->wiphy, tx, tx_max, rx, rx_max); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 736 | 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] | 737 | } |
| 738 | |
| 739 | static inline int |
| 740 | rdev_sched_scan_start(struct cfg80211_registered_device *rdev, |
| 741 | struct net_device *dev, |
| 742 | struct cfg80211_sched_scan_request *request) |
| 743 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 744 | int ret; |
| 745 | trace_rdev_sched_scan_start(&rdev->wiphy, dev, request); |
| 746 | ret = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request); |
| 747 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 748 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 749 | } |
| 750 | |
| 751 | static inline int rdev_sched_scan_stop(struct cfg80211_registered_device *rdev, |
| 752 | struct net_device *dev) |
| 753 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 754 | int ret; |
| 755 | trace_rdev_sched_scan_stop(&rdev->wiphy, dev); |
| 756 | ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev); |
| 757 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 758 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 759 | } |
| 760 | |
| 761 | static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev, |
| 762 | struct net_device *dev, |
| 763 | struct cfg80211_gtk_rekey_data *data) |
| 764 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 765 | int ret; |
| 766 | trace_rdev_set_rekey_data(&rdev->wiphy, dev); |
| 767 | ret = rdev->ops->set_rekey_data(&rdev->wiphy, dev, data); |
| 768 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 769 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 770 | } |
| 771 | |
| 772 | static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev, |
| 773 | struct net_device *dev, u8 *peer, |
| 774 | u8 action_code, u8 dialog_token, |
| 775 | u16 status_code, const u8 *buf, size_t len) |
| 776 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 777 | int ret; |
| 778 | trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code, |
| 779 | dialog_token, status_code, buf, len); |
| 780 | ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code, |
| 781 | dialog_token, status_code, buf, len); |
| 782 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 783 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 784 | } |
| 785 | |
| 786 | static inline int rdev_tdls_oper(struct cfg80211_registered_device *rdev, |
| 787 | struct net_device *dev, u8 *peer, |
| 788 | enum nl80211_tdls_operation oper) |
| 789 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 790 | int ret; |
| 791 | trace_rdev_tdls_oper(&rdev->wiphy, dev, peer, oper); |
| 792 | ret = rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, oper); |
| 793 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 794 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 795 | } |
| 796 | |
| 797 | static inline int rdev_probe_client(struct cfg80211_registered_device *rdev, |
| 798 | struct net_device *dev, const u8 *peer, |
| 799 | u64 *cookie) |
| 800 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 801 | int ret; |
| 802 | trace_rdev_probe_client(&rdev->wiphy, dev, peer); |
| 803 | ret = rdev->ops->probe_client(&rdev->wiphy, dev, peer, cookie); |
| 804 | trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); |
| 805 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 806 | } |
| 807 | |
| 808 | static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev, |
| 809 | struct net_device *dev, u16 noack_map) |
| 810 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 811 | int ret; |
| 812 | trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map); |
| 813 | ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map); |
| 814 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 815 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 816 | } |
| 817 | |
| 818 | static inline int |
| 819 | rdev_get_et_sset_count(struct cfg80211_registered_device *rdev, |
| 820 | struct net_device *dev, int sset) |
| 821 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 822 | int ret; |
| 823 | trace_rdev_get_et_sset_count(&rdev->wiphy, dev, sset); |
| 824 | ret = rdev->ops->get_et_sset_count(&rdev->wiphy, dev, sset); |
| 825 | trace_rdev_return_int(&rdev->wiphy, ret); |
| 826 | return ret; |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 827 | } |
| 828 | |
| 829 | static inline void rdev_get_et_stats(struct cfg80211_registered_device *rdev, |
| 830 | struct net_device *dev, |
| 831 | struct ethtool_stats *stats, u64 *data) |
| 832 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 833 | trace_rdev_get_et_stats(&rdev->wiphy, dev); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 834 | rdev->ops->get_et_stats(&rdev->wiphy, dev, stats, data); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 835 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 836 | } |
| 837 | |
| 838 | static inline void rdev_get_et_strings(struct cfg80211_registered_device *rdev, |
| 839 | struct net_device *dev, u32 sset, |
| 840 | u8 *data) |
| 841 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 842 | trace_rdev_get_et_strings(&rdev->wiphy, dev, sset); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 843 | rdev->ops->get_et_strings(&rdev->wiphy, dev, sset, data); |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 844 | trace_rdev_return_void(&rdev->wiphy); |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 845 | } |
| 846 | |
| 847 | static inline struct ieee80211_channel |
| 848 | *rdev_get_channel(struct cfg80211_registered_device *rdev, |
| 849 | struct wireless_dev *wdev, enum nl80211_channel_type *type) |
| 850 | { |
Beni Lev | 14e8a3c | 2012-07-31 18:48:27 +0300 | [diff] [blame] | 851 | struct ieee80211_channel *ret; |
| 852 | trace_rdev_get_channel(&rdev->wiphy, wdev); |
| 853 | ret = rdev->ops->get_channel(&rdev->wiphy, wdev, type); |
| 854 | trace_rdev_return_channel(&rdev->wiphy, ret, *type); |
| 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); |
| 875 | } |
Hila Gonen | e35e4d2 | 2012-06-27 17:19:42 +0300 | [diff] [blame] | 876 | #endif /* __CFG80211_RDEV_OPS */ |