blob: 14123dce544bf960a57d6f06fdbda6bbcc83f88a [file] [log] [blame]
Johannes Berg24487982009-04-23 18:52:52 +02001#ifndef __MAC80211_DRIVER_OPS
2#define __MAC80211_DRIVER_OPS
3
4#include <net/mac80211.h>
5#include "ieee80211_i.h"
Johannes Berg0a2b8bb2009-07-07 13:46:22 +02006#include "driver-trace.h"
Johannes Berg24487982009-04-23 18:52:52 +02007
8static inline int drv_tx(struct ieee80211_local *local, struct sk_buff *skb)
9{
10 return local->ops->tx(&local->hw, skb);
11}
12
13static inline int drv_start(struct ieee80211_local *local)
14{
Johannes Bergea77f122009-08-21 14:44:45 +020015 int ret;
16
Kalle Valoe1781ed2009-12-23 13:15:47 +010017 might_sleep();
18
Johannes Berg4efc76b2010-06-10 10:56:20 +020019 trace_drv_start(local);
Johannes Bergea77f122009-08-21 14:44:45 +020020 local->started = true;
21 smp_mb();
22 ret = local->ops->start(&local->hw);
Johannes Berg4efc76b2010-06-10 10:56:20 +020023 trace_drv_return_int(local, ret);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +020024 return ret;
Johannes Berg24487982009-04-23 18:52:52 +020025}
26
27static inline void drv_stop(struct ieee80211_local *local)
28{
Kalle Valoe1781ed2009-12-23 13:15:47 +010029 might_sleep();
30
Johannes Berg0a2b8bb2009-07-07 13:46:22 +020031 trace_drv_stop(local);
Johannes Berg4efc76b2010-06-10 10:56:20 +020032 local->ops->stop(&local->hw);
33 trace_drv_return_void(local);
Johannes Bergea77f122009-08-21 14:44:45 +020034
35 /* sync away all work on the tasklet before clearing started */
36 tasklet_disable(&local->tasklet);
37 tasklet_enable(&local->tasklet);
38
39 barrier();
40
41 local->started = false;
Johannes Berg24487982009-04-23 18:52:52 +020042}
43
44static inline int drv_add_interface(struct ieee80211_local *local,
Johannes Berg1ed32e42009-12-23 13:15:45 +010045 struct ieee80211_vif *vif)
Johannes Berg24487982009-04-23 18:52:52 +020046{
Kalle Valoe1781ed2009-12-23 13:15:47 +010047 int ret;
48
49 might_sleep();
50
Johannes Berg4efc76b2010-06-10 10:56:20 +020051 trace_drv_add_interface(local, vif_to_sdata(vif));
Kalle Valoe1781ed2009-12-23 13:15:47 +010052 ret = local->ops->add_interface(&local->hw, vif);
Johannes Berg4efc76b2010-06-10 10:56:20 +020053 trace_drv_return_int(local, ret);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +020054 return ret;
Johannes Berg24487982009-04-23 18:52:52 +020055}
56
57static inline void drv_remove_interface(struct ieee80211_local *local,
Johannes Berg1ed32e42009-12-23 13:15:45 +010058 struct ieee80211_vif *vif)
Johannes Berg24487982009-04-23 18:52:52 +020059{
Kalle Valoe1781ed2009-12-23 13:15:47 +010060 might_sleep();
61
Johannes Berg1ed32e42009-12-23 13:15:45 +010062 trace_drv_remove_interface(local, vif_to_sdata(vif));
Johannes Berg4efc76b2010-06-10 10:56:20 +020063 local->ops->remove_interface(&local->hw, vif);
64 trace_drv_return_void(local);
Johannes Berg24487982009-04-23 18:52:52 +020065}
66
67static inline int drv_config(struct ieee80211_local *local, u32 changed)
68{
Kalle Valoe1781ed2009-12-23 13:15:47 +010069 int ret;
70
71 might_sleep();
72
Johannes Berg4efc76b2010-06-10 10:56:20 +020073 trace_drv_config(local, changed);
Kalle Valoe1781ed2009-12-23 13:15:47 +010074 ret = local->ops->config(&local->hw, changed);
Johannes Berg4efc76b2010-06-10 10:56:20 +020075 trace_drv_return_int(local, ret);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +020076 return ret;
Johannes Berg24487982009-04-23 18:52:52 +020077}
78
79static inline void drv_bss_info_changed(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +010080 struct ieee80211_sub_if_data *sdata,
Johannes Berg24487982009-04-23 18:52:52 +020081 struct ieee80211_bss_conf *info,
82 u32 changed)
83{
Kalle Valoe1781ed2009-12-23 13:15:47 +010084 might_sleep();
85
Johannes Berg4efc76b2010-06-10 10:56:20 +020086 trace_drv_bss_info_changed(local, sdata, info, changed);
Johannes Berg24487982009-04-23 18:52:52 +020087 if (local->ops->bss_info_changed)
Johannes Berg12375ef2009-11-25 20:30:31 +010088 local->ops->bss_info_changed(&local->hw, &sdata->vif, info, changed);
Johannes Berg4efc76b2010-06-10 10:56:20 +020089 trace_drv_return_void(local);
Johannes Berg24487982009-04-23 18:52:52 +020090}
91
Johannes Berg3ac64be2009-08-17 16:16:53 +020092static inline u64 drv_prepare_multicast(struct ieee80211_local *local,
Jiri Pirko22bedad32010-04-01 21:22:57 +000093 struct netdev_hw_addr_list *mc_list)
Johannes Berg24487982009-04-23 18:52:52 +020094{
Johannes Berg3ac64be2009-08-17 16:16:53 +020095 u64 ret = 0;
96
Johannes Berg4efc76b2010-06-10 10:56:20 +020097 trace_drv_prepare_multicast(local, mc_list->count);
98
Johannes Berg3ac64be2009-08-17 16:16:53 +020099 if (local->ops->prepare_multicast)
Jiri Pirko22bedad32010-04-01 21:22:57 +0000100 ret = local->ops->prepare_multicast(&local->hw, mc_list);
Johannes Berg3ac64be2009-08-17 16:16:53 +0200101
Johannes Berg4efc76b2010-06-10 10:56:20 +0200102 trace_drv_return_u64(local, ret);
Johannes Berg3ac64be2009-08-17 16:16:53 +0200103
104 return ret;
105}
106
107static inline void drv_configure_filter(struct ieee80211_local *local,
108 unsigned int changed_flags,
109 unsigned int *total_flags,
110 u64 multicast)
111{
112 might_sleep();
113
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200114 trace_drv_configure_filter(local, changed_flags, total_flags,
Johannes Berg3ac64be2009-08-17 16:16:53 +0200115 multicast);
Johannes Berg4efc76b2010-06-10 10:56:20 +0200116 local->ops->configure_filter(&local->hw, changed_flags, total_flags,
117 multicast);
118 trace_drv_return_void(local);
Johannes Berg24487982009-04-23 18:52:52 +0200119}
120
121static inline int drv_set_tim(struct ieee80211_local *local,
122 struct ieee80211_sta *sta, bool set)
123{
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200124 int ret = 0;
Johannes Berg4efc76b2010-06-10 10:56:20 +0200125 trace_drv_set_tim(local, sta, set);
Johannes Berg24487982009-04-23 18:52:52 +0200126 if (local->ops->set_tim)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200127 ret = local->ops->set_tim(&local->hw, sta, set);
Johannes Berg4efc76b2010-06-10 10:56:20 +0200128 trace_drv_return_int(local, ret);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200129 return ret;
Johannes Berg24487982009-04-23 18:52:52 +0200130}
131
132static inline int drv_set_key(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100133 enum set_key_cmd cmd,
134 struct ieee80211_sub_if_data *sdata,
Johannes Berg24487982009-04-23 18:52:52 +0200135 struct ieee80211_sta *sta,
136 struct ieee80211_key_conf *key)
137{
Kalle Valoe1781ed2009-12-23 13:15:47 +0100138 int ret;
139
140 might_sleep();
141
Johannes Berg4efc76b2010-06-10 10:56:20 +0200142 trace_drv_set_key(local, cmd, sdata, sta, key);
Kalle Valoe1781ed2009-12-23 13:15:47 +0100143 ret = local->ops->set_key(&local->hw, cmd, &sdata->vif, sta, key);
Johannes Berg4efc76b2010-06-10 10:56:20 +0200144 trace_drv_return_int(local, ret);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200145 return ret;
Johannes Berg24487982009-04-23 18:52:52 +0200146}
147
148static inline void drv_update_tkip_key(struct ieee80211_local *local,
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100149 struct ieee80211_sub_if_data *sdata,
Johannes Berg24487982009-04-23 18:52:52 +0200150 struct ieee80211_key_conf *conf,
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100151 struct sta_info *sta, u32 iv32,
Johannes Berg24487982009-04-23 18:52:52 +0200152 u16 *phase1key)
153{
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100154 struct ieee80211_sta *ista = NULL;
155
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100156 if (sta)
157 ista = &sta->sta;
158
Johannes Berg4efc76b2010-06-10 10:56:20 +0200159 trace_drv_update_tkip_key(local, sdata, conf, ista, iv32);
Johannes Berg24487982009-04-23 18:52:52 +0200160 if (local->ops->update_tkip_key)
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100161 local->ops->update_tkip_key(&local->hw, &sdata->vif, conf,
162 ista, iv32, phase1key);
Johannes Berg4efc76b2010-06-10 10:56:20 +0200163 trace_drv_return_void(local);
Johannes Berg24487982009-04-23 18:52:52 +0200164}
165
166static inline int drv_hw_scan(struct ieee80211_local *local,
Johannes Berga060bbf2010-04-27 11:59:34 +0200167 struct ieee80211_sub_if_data *sdata,
Johannes Berg24487982009-04-23 18:52:52 +0200168 struct cfg80211_scan_request *req)
169{
Kalle Valoe1781ed2009-12-23 13:15:47 +0100170 int ret;
171
172 might_sleep();
173
Johannes Berg4efc76b2010-06-10 10:56:20 +0200174 trace_drv_hw_scan(local, sdata, req);
Johannes Berga060bbf2010-04-27 11:59:34 +0200175 ret = local->ops->hw_scan(&local->hw, &sdata->vif, req);
Johannes Berg4efc76b2010-06-10 10:56:20 +0200176 trace_drv_return_int(local, ret);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200177 return ret;
Johannes Berg24487982009-04-23 18:52:52 +0200178}
179
180static inline void drv_sw_scan_start(struct ieee80211_local *local)
181{
Kalle Valoe1781ed2009-12-23 13:15:47 +0100182 might_sleep();
183
Johannes Berg4efc76b2010-06-10 10:56:20 +0200184 trace_drv_sw_scan_start(local);
Johannes Berg24487982009-04-23 18:52:52 +0200185 if (local->ops->sw_scan_start)
186 local->ops->sw_scan_start(&local->hw);
Johannes Berg4efc76b2010-06-10 10:56:20 +0200187 trace_drv_return_void(local);
Johannes Berg24487982009-04-23 18:52:52 +0200188}
189
190static inline void drv_sw_scan_complete(struct ieee80211_local *local)
191{
Kalle Valoe1781ed2009-12-23 13:15:47 +0100192 might_sleep();
193
Johannes Berg4efc76b2010-06-10 10:56:20 +0200194 trace_drv_sw_scan_complete(local);
Johannes Berg24487982009-04-23 18:52:52 +0200195 if (local->ops->sw_scan_complete)
196 local->ops->sw_scan_complete(&local->hw);
Johannes Berg4efc76b2010-06-10 10:56:20 +0200197 trace_drv_return_void(local);
Johannes Berg24487982009-04-23 18:52:52 +0200198}
199
200static inline int drv_get_stats(struct ieee80211_local *local,
201 struct ieee80211_low_level_stats *stats)
202{
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200203 int ret = -EOPNOTSUPP;
204
Kalle Valoe1781ed2009-12-23 13:15:47 +0100205 might_sleep();
206
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200207 if (local->ops->get_stats)
208 ret = local->ops->get_stats(&local->hw, stats);
209 trace_drv_get_stats(local, stats, ret);
210
211 return ret;
Johannes Berg24487982009-04-23 18:52:52 +0200212}
213
214static inline void drv_get_tkip_seq(struct ieee80211_local *local,
215 u8 hw_key_idx, u32 *iv32, u16 *iv16)
216{
217 if (local->ops->get_tkip_seq)
218 local->ops->get_tkip_seq(&local->hw, hw_key_idx, iv32, iv16);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200219 trace_drv_get_tkip_seq(local, hw_key_idx, iv32, iv16);
Johannes Berg24487982009-04-23 18:52:52 +0200220}
221
222static inline int drv_set_rts_threshold(struct ieee80211_local *local,
223 u32 value)
224{
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200225 int ret = 0;
Kalle Valoe1781ed2009-12-23 13:15:47 +0100226
227 might_sleep();
228
Johannes Berg4efc76b2010-06-10 10:56:20 +0200229 trace_drv_set_rts_threshold(local, value);
Johannes Berg24487982009-04-23 18:52:52 +0200230 if (local->ops->set_rts_threshold)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200231 ret = local->ops->set_rts_threshold(&local->hw, value);
Johannes Berg4efc76b2010-06-10 10:56:20 +0200232 trace_drv_return_int(local, ret);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200233 return ret;
Johannes Berg24487982009-04-23 18:52:52 +0200234}
235
Lukáš Turek310bc672009-12-21 22:50:48 +0100236static inline int drv_set_coverage_class(struct ieee80211_local *local,
237 u8 value)
238{
239 int ret = 0;
240 might_sleep();
241
Johannes Berg4efc76b2010-06-10 10:56:20 +0200242 trace_drv_set_coverage_class(local, value);
Lukáš Turek310bc672009-12-21 22:50:48 +0100243 if (local->ops->set_coverage_class)
244 local->ops->set_coverage_class(&local->hw, value);
245 else
246 ret = -EOPNOTSUPP;
247
Johannes Berg4efc76b2010-06-10 10:56:20 +0200248 trace_drv_return_int(local, ret);
Lukáš Turek310bc672009-12-21 22:50:48 +0100249 return ret;
250}
251
Johannes Berg24487982009-04-23 18:52:52 +0200252static inline void drv_sta_notify(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100253 struct ieee80211_sub_if_data *sdata,
Johannes Berg24487982009-04-23 18:52:52 +0200254 enum sta_notify_cmd cmd,
255 struct ieee80211_sta *sta)
256{
Johannes Berg4efc76b2010-06-10 10:56:20 +0200257 trace_drv_sta_notify(local, sdata, cmd, sta);
Johannes Berg24487982009-04-23 18:52:52 +0200258 if (local->ops->sta_notify)
Johannes Berg12375ef2009-11-25 20:30:31 +0100259 local->ops->sta_notify(&local->hw, &sdata->vif, cmd, sta);
Johannes Berg4efc76b2010-06-10 10:56:20 +0200260 trace_drv_return_void(local);
Johannes Berg24487982009-04-23 18:52:52 +0200261}
262
Johannes Berg34e89502010-02-03 13:59:58 +0100263static inline int drv_sta_add(struct ieee80211_local *local,
264 struct ieee80211_sub_if_data *sdata,
265 struct ieee80211_sta *sta)
266{
267 int ret = 0;
268
269 might_sleep();
270
Johannes Berg4efc76b2010-06-10 10:56:20 +0200271 trace_drv_sta_add(local, sdata, sta);
Johannes Berg34e89502010-02-03 13:59:58 +0100272 if (local->ops->sta_add)
273 ret = local->ops->sta_add(&local->hw, &sdata->vif, sta);
Johannes Berg34e89502010-02-03 13:59:58 +0100274
Johannes Berg4efc76b2010-06-10 10:56:20 +0200275 trace_drv_return_int(local, ret);
Johannes Berg34e89502010-02-03 13:59:58 +0100276
277 return ret;
278}
279
280static inline void drv_sta_remove(struct ieee80211_local *local,
281 struct ieee80211_sub_if_data *sdata,
282 struct ieee80211_sta *sta)
283{
284 might_sleep();
285
Johannes Berg4efc76b2010-06-10 10:56:20 +0200286 trace_drv_sta_remove(local, sdata, sta);
Johannes Berg34e89502010-02-03 13:59:58 +0100287 if (local->ops->sta_remove)
288 local->ops->sta_remove(&local->hw, &sdata->vif, sta);
Johannes Berg34e89502010-02-03 13:59:58 +0100289
Johannes Berg4efc76b2010-06-10 10:56:20 +0200290 trace_drv_return_void(local);
Johannes Berg34e89502010-02-03 13:59:58 +0100291}
292
Johannes Berg24487982009-04-23 18:52:52 +0200293static inline int drv_conf_tx(struct ieee80211_local *local, u16 queue,
294 const struct ieee80211_tx_queue_params *params)
295{
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200296 int ret = -EOPNOTSUPP;
Kalle Valoe1781ed2009-12-23 13:15:47 +0100297
298 might_sleep();
299
Johannes Berg4efc76b2010-06-10 10:56:20 +0200300 trace_drv_conf_tx(local, queue, params);
Johannes Berg24487982009-04-23 18:52:52 +0200301 if (local->ops->conf_tx)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200302 ret = local->ops->conf_tx(&local->hw, queue, params);
Johannes Berg4efc76b2010-06-10 10:56:20 +0200303 trace_drv_return_int(local, ret);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200304 return ret;
Johannes Berg24487982009-04-23 18:52:52 +0200305}
306
Johannes Berg24487982009-04-23 18:52:52 +0200307static inline u64 drv_get_tsf(struct ieee80211_local *local)
308{
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200309 u64 ret = -1ULL;
Kalle Valoe1781ed2009-12-23 13:15:47 +0100310
311 might_sleep();
312
Johannes Berg4efc76b2010-06-10 10:56:20 +0200313 trace_drv_get_tsf(local);
Johannes Berg24487982009-04-23 18:52:52 +0200314 if (local->ops->get_tsf)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200315 ret = local->ops->get_tsf(&local->hw);
Johannes Berg4efc76b2010-06-10 10:56:20 +0200316 trace_drv_return_u64(local, ret);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200317 return ret;
Johannes Berg24487982009-04-23 18:52:52 +0200318}
319
320static inline void drv_set_tsf(struct ieee80211_local *local, u64 tsf)
321{
Kalle Valoe1781ed2009-12-23 13:15:47 +0100322 might_sleep();
323
Johannes Berg4efc76b2010-06-10 10:56:20 +0200324 trace_drv_set_tsf(local, tsf);
Johannes Berg24487982009-04-23 18:52:52 +0200325 if (local->ops->set_tsf)
326 local->ops->set_tsf(&local->hw, tsf);
Johannes Berg4efc76b2010-06-10 10:56:20 +0200327 trace_drv_return_void(local);
Johannes Berg24487982009-04-23 18:52:52 +0200328}
329
330static inline void drv_reset_tsf(struct ieee80211_local *local)
331{
Kalle Valoe1781ed2009-12-23 13:15:47 +0100332 might_sleep();
333
Johannes Berg4efc76b2010-06-10 10:56:20 +0200334 trace_drv_reset_tsf(local);
Johannes Berg24487982009-04-23 18:52:52 +0200335 if (local->ops->reset_tsf)
336 local->ops->reset_tsf(&local->hw);
Johannes Berg4efc76b2010-06-10 10:56:20 +0200337 trace_drv_return_void(local);
Johannes Berg24487982009-04-23 18:52:52 +0200338}
339
340static inline int drv_tx_last_beacon(struct ieee80211_local *local)
341{
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200342 int ret = 1;
Kalle Valoe1781ed2009-12-23 13:15:47 +0100343
344 might_sleep();
345
Johannes Berg4efc76b2010-06-10 10:56:20 +0200346 trace_drv_tx_last_beacon(local);
Johannes Berg24487982009-04-23 18:52:52 +0200347 if (local->ops->tx_last_beacon)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200348 ret = local->ops->tx_last_beacon(&local->hw);
Johannes Berg4efc76b2010-06-10 10:56:20 +0200349 trace_drv_return_int(local, ret);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200350 return ret;
Johannes Berg24487982009-04-23 18:52:52 +0200351}
352
353static inline int drv_ampdu_action(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100354 struct ieee80211_sub_if_data *sdata,
Johannes Berg24487982009-04-23 18:52:52 +0200355 enum ieee80211_ampdu_mlme_action action,
356 struct ieee80211_sta *sta, u16 tid,
357 u16 *ssn)
358{
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200359 int ret = -EOPNOTSUPP;
Johannes Bergcfcdbde2010-06-10 10:21:48 +0200360
361 might_sleep();
362
Johannes Berg4efc76b2010-06-10 10:56:20 +0200363 trace_drv_ampdu_action(local, sdata, action, sta, tid, ssn);
364
Johannes Berg24487982009-04-23 18:52:52 +0200365 if (local->ops->ampdu_action)
Johannes Berg12375ef2009-11-25 20:30:31 +0100366 ret = local->ops->ampdu_action(&local->hw, &sdata->vif, action,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200367 sta, tid, ssn);
Johannes Berg85ad1812010-06-10 10:21:49 +0200368
Johannes Berg4efc76b2010-06-10 10:56:20 +0200369 trace_drv_return_int(local, ret);
370
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200371 return ret;
Johannes Berg24487982009-04-23 18:52:52 +0200372}
Johannes Berg1f87f7d2009-06-02 13:01:41 +0200373
Holger Schurig12897232010-04-19 10:23:57 +0200374static inline int drv_get_survey(struct ieee80211_local *local, int idx,
375 struct survey_info *survey)
376{
377 int ret = -EOPNOTSUPP;
John W. Linvillec466d4e2010-06-29 14:51:23 -0400378
379 trace_drv_get_survey(local, idx, survey);
380
Holger Schurig35dd0502010-06-07 16:33:49 +0200381 if (local->ops->get_survey)
Holger Schurig12897232010-04-19 10:23:57 +0200382 ret = local->ops->get_survey(&local->hw, idx, survey);
John W. Linvillec466d4e2010-06-29 14:51:23 -0400383
384 trace_drv_return_int(local, ret);
385
Holger Schurig12897232010-04-19 10:23:57 +0200386 return ret;
387}
Johannes Berg1f87f7d2009-06-02 13:01:41 +0200388
389static inline void drv_rfkill_poll(struct ieee80211_local *local)
390{
Kalle Valoe1781ed2009-12-23 13:15:47 +0100391 might_sleep();
392
Johannes Berg1f87f7d2009-06-02 13:01:41 +0200393 if (local->ops->rfkill_poll)
394 local->ops->rfkill_poll(&local->hw);
395}
Johannes Berga80f7c02009-12-23 13:15:32 +0100396
397static inline void drv_flush(struct ieee80211_local *local, bool drop)
398{
Kalle Valoe1781ed2009-12-23 13:15:47 +0100399 might_sleep();
400
Johannes Berga80f7c02009-12-23 13:15:32 +0100401 trace_drv_flush(local, drop);
402 if (local->ops->flush)
403 local->ops->flush(&local->hw, drop);
Johannes Berg4efc76b2010-06-10 10:56:20 +0200404 trace_drv_return_void(local);
Johannes Berga80f7c02009-12-23 13:15:32 +0100405}
Johannes Berg5ce6e432010-05-11 16:20:57 +0200406
407static inline void drv_channel_switch(struct ieee80211_local *local,
408 struct ieee80211_channel_switch *ch_switch)
409{
410 might_sleep();
411
Johannes Berg5ce6e432010-05-11 16:20:57 +0200412 trace_drv_channel_switch(local, ch_switch);
Johannes Berg4efc76b2010-06-10 10:56:20 +0200413 local->ops->channel_switch(&local->hw, ch_switch);
414 trace_drv_return_void(local);
Johannes Berg5ce6e432010-05-11 16:20:57 +0200415}
416
Johannes Berg24487982009-04-23 18:52:52 +0200417#endif /* __MAC80211_DRIVER_OPS */