cfg80211/nl80211: clarify TX queue API
[linux-2.6-block.git] / net / mac80211 / driver-ops.h
1 #ifndef __MAC80211_DRIVER_OPS
2 #define __MAC80211_DRIVER_OPS
3
4 #include <net/mac80211.h>
5 #include "ieee80211_i.h"
6 #include "driver-trace.h"
7
8 static inline void check_sdata_in_driver(struct ieee80211_sub_if_data *sdata)
9 {
10         WARN(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER),
11              "%s:  Failed check-sdata-in-driver check, flags: 0x%x\n",
12              sdata->dev->name, sdata->flags);
13 }
14
15 static inline struct ieee80211_sub_if_data *
16 get_bss_sdata(struct ieee80211_sub_if_data *sdata)
17 {
18         if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
19                 sdata = container_of(sdata->bss, struct ieee80211_sub_if_data,
20                                      u.ap);
21
22         return sdata;
23 }
24
25 static inline void drv_tx(struct ieee80211_local *local, struct sk_buff *skb)
26 {
27         local->ops->tx(&local->hw, skb);
28 }
29
30 static inline void drv_tx_frags(struct ieee80211_local *local,
31                                 struct ieee80211_vif *vif,
32                                 struct ieee80211_sta *sta,
33                                 struct sk_buff_head *skbs)
34 {
35         local->ops->tx_frags(&local->hw, vif, sta, skbs);
36 }
37
38 static inline int drv_start(struct ieee80211_local *local)
39 {
40         int ret;
41
42         might_sleep();
43
44         trace_drv_start(local);
45         local->started = true;
46         smp_mb();
47         ret = local->ops->start(&local->hw);
48         trace_drv_return_int(local, ret);
49         return ret;
50 }
51
52 static inline void drv_stop(struct ieee80211_local *local)
53 {
54         might_sleep();
55
56         trace_drv_stop(local);
57         local->ops->stop(&local->hw);
58         trace_drv_return_void(local);
59
60         /* sync away all work on the tasklet before clearing started */
61         tasklet_disable(&local->tasklet);
62         tasklet_enable(&local->tasklet);
63
64         barrier();
65
66         local->started = false;
67 }
68
69 #ifdef CONFIG_PM
70 static inline int drv_suspend(struct ieee80211_local *local,
71                               struct cfg80211_wowlan *wowlan)
72 {
73         int ret;
74
75         might_sleep();
76
77         trace_drv_suspend(local);
78         ret = local->ops->suspend(&local->hw, wowlan);
79         trace_drv_return_int(local, ret);
80         return ret;
81 }
82
83 static inline int drv_resume(struct ieee80211_local *local)
84 {
85         int ret;
86
87         might_sleep();
88
89         trace_drv_resume(local);
90         ret = local->ops->resume(&local->hw);
91         trace_drv_return_int(local, ret);
92         return ret;
93 }
94 #endif
95
96 static inline int drv_add_interface(struct ieee80211_local *local,
97                                     struct ieee80211_sub_if_data *sdata)
98 {
99         int ret;
100
101         might_sleep();
102
103         if (WARN_ON(sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
104                     sdata->vif.type == NL80211_IFTYPE_MONITOR))
105                 return -EINVAL;
106
107         trace_drv_add_interface(local, sdata);
108         ret = local->ops->add_interface(&local->hw, &sdata->vif);
109         trace_drv_return_int(local, ret);
110
111         if (ret == 0)
112                 sdata->flags |= IEEE80211_SDATA_IN_DRIVER;
113
114         return ret;
115 }
116
117 static inline int drv_change_interface(struct ieee80211_local *local,
118                                        struct ieee80211_sub_if_data *sdata,
119                                        enum nl80211_iftype type, bool p2p)
120 {
121         int ret;
122
123         might_sleep();
124
125         check_sdata_in_driver(sdata);
126
127         trace_drv_change_interface(local, sdata, type, p2p);
128         ret = local->ops->change_interface(&local->hw, &sdata->vif, type, p2p);
129         trace_drv_return_int(local, ret);
130         return ret;
131 }
132
133 static inline void drv_remove_interface(struct ieee80211_local *local,
134                                         struct ieee80211_sub_if_data *sdata)
135 {
136         might_sleep();
137
138         check_sdata_in_driver(sdata);
139
140         trace_drv_remove_interface(local, sdata);
141         local->ops->remove_interface(&local->hw, &sdata->vif);
142         sdata->flags &= ~IEEE80211_SDATA_IN_DRIVER;
143         trace_drv_return_void(local);
144 }
145
146 static inline int drv_config(struct ieee80211_local *local, u32 changed)
147 {
148         int ret;
149
150         might_sleep();
151
152         trace_drv_config(local, changed);
153         ret = local->ops->config(&local->hw, changed);
154         trace_drv_return_int(local, ret);
155         return ret;
156 }
157
158 static inline void drv_bss_info_changed(struct ieee80211_local *local,
159                                         struct ieee80211_sub_if_data *sdata,
160                                         struct ieee80211_bss_conf *info,
161                                         u32 changed)
162 {
163         might_sleep();
164
165         check_sdata_in_driver(sdata);
166
167         trace_drv_bss_info_changed(local, sdata, info, changed);
168         if (local->ops->bss_info_changed)
169                 local->ops->bss_info_changed(&local->hw, &sdata->vif, info, changed);
170         trace_drv_return_void(local);
171 }
172
173 static inline u64 drv_prepare_multicast(struct ieee80211_local *local,
174                                         struct netdev_hw_addr_list *mc_list)
175 {
176         u64 ret = 0;
177
178         trace_drv_prepare_multicast(local, mc_list->count);
179
180         if (local->ops->prepare_multicast)
181                 ret = local->ops->prepare_multicast(&local->hw, mc_list);
182
183         trace_drv_return_u64(local, ret);
184
185         return ret;
186 }
187
188 static inline void drv_configure_filter(struct ieee80211_local *local,
189                                         unsigned int changed_flags,
190                                         unsigned int *total_flags,
191                                         u64 multicast)
192 {
193         might_sleep();
194
195         trace_drv_configure_filter(local, changed_flags, total_flags,
196                                    multicast);
197         local->ops->configure_filter(&local->hw, changed_flags, total_flags,
198                                      multicast);
199         trace_drv_return_void(local);
200 }
201
202 static inline int drv_set_tim(struct ieee80211_local *local,
203                               struct ieee80211_sta *sta, bool set)
204 {
205         int ret = 0;
206         trace_drv_set_tim(local, sta, set);
207         if (local->ops->set_tim)
208                 ret = local->ops->set_tim(&local->hw, sta, set);
209         trace_drv_return_int(local, ret);
210         return ret;
211 }
212
213 static inline int drv_set_key(struct ieee80211_local *local,
214                               enum set_key_cmd cmd,
215                               struct ieee80211_sub_if_data *sdata,
216                               struct ieee80211_sta *sta,
217                               struct ieee80211_key_conf *key)
218 {
219         int ret;
220
221         might_sleep();
222
223         sdata = get_bss_sdata(sdata);
224         check_sdata_in_driver(sdata);
225
226         trace_drv_set_key(local, cmd, sdata, sta, key);
227         ret = local->ops->set_key(&local->hw, cmd, &sdata->vif, sta, key);
228         trace_drv_return_int(local, ret);
229         return ret;
230 }
231
232 static inline void drv_update_tkip_key(struct ieee80211_local *local,
233                                        struct ieee80211_sub_if_data *sdata,
234                                        struct ieee80211_key_conf *conf,
235                                        struct sta_info *sta, u32 iv32,
236                                        u16 *phase1key)
237 {
238         struct ieee80211_sta *ista = NULL;
239
240         if (sta)
241                 ista = &sta->sta;
242
243         sdata = get_bss_sdata(sdata);
244         check_sdata_in_driver(sdata);
245
246         trace_drv_update_tkip_key(local, sdata, conf, ista, iv32);
247         if (local->ops->update_tkip_key)
248                 local->ops->update_tkip_key(&local->hw, &sdata->vif, conf,
249                                             ista, iv32, phase1key);
250         trace_drv_return_void(local);
251 }
252
253 static inline int drv_hw_scan(struct ieee80211_local *local,
254                               struct ieee80211_sub_if_data *sdata,
255                               struct cfg80211_scan_request *req)
256 {
257         int ret;
258
259         might_sleep();
260
261         check_sdata_in_driver(sdata);
262
263         trace_drv_hw_scan(local, sdata);
264         ret = local->ops->hw_scan(&local->hw, &sdata->vif, req);
265         trace_drv_return_int(local, ret);
266         return ret;
267 }
268
269 static inline void drv_cancel_hw_scan(struct ieee80211_local *local,
270                                       struct ieee80211_sub_if_data *sdata)
271 {
272         might_sleep();
273
274         check_sdata_in_driver(sdata);
275
276         trace_drv_cancel_hw_scan(local, sdata);
277         local->ops->cancel_hw_scan(&local->hw, &sdata->vif);
278         trace_drv_return_void(local);
279 }
280
281 static inline int
282 drv_sched_scan_start(struct ieee80211_local *local,
283                      struct ieee80211_sub_if_data *sdata,
284                      struct cfg80211_sched_scan_request *req,
285                      struct ieee80211_sched_scan_ies *ies)
286 {
287         int ret;
288
289         might_sleep();
290
291         check_sdata_in_driver(sdata);
292
293         trace_drv_sched_scan_start(local, sdata);
294         ret = local->ops->sched_scan_start(&local->hw, &sdata->vif,
295                                               req, ies);
296         trace_drv_return_int(local, ret);
297         return ret;
298 }
299
300 static inline void drv_sched_scan_stop(struct ieee80211_local *local,
301                                        struct ieee80211_sub_if_data *sdata)
302 {
303         might_sleep();
304
305         check_sdata_in_driver(sdata);
306
307         trace_drv_sched_scan_stop(local, sdata);
308         local->ops->sched_scan_stop(&local->hw, &sdata->vif);
309         trace_drv_return_void(local);
310 }
311
312 static inline void drv_sw_scan_start(struct ieee80211_local *local)
313 {
314         might_sleep();
315
316         trace_drv_sw_scan_start(local);
317         if (local->ops->sw_scan_start)
318                 local->ops->sw_scan_start(&local->hw);
319         trace_drv_return_void(local);
320 }
321
322 static inline void drv_sw_scan_complete(struct ieee80211_local *local)
323 {
324         might_sleep();
325
326         trace_drv_sw_scan_complete(local);
327         if (local->ops->sw_scan_complete)
328                 local->ops->sw_scan_complete(&local->hw);
329         trace_drv_return_void(local);
330 }
331
332 static inline int drv_get_stats(struct ieee80211_local *local,
333                                 struct ieee80211_low_level_stats *stats)
334 {
335         int ret = -EOPNOTSUPP;
336
337         might_sleep();
338
339         if (local->ops->get_stats)
340                 ret = local->ops->get_stats(&local->hw, stats);
341         trace_drv_get_stats(local, stats, ret);
342
343         return ret;
344 }
345
346 static inline void drv_get_tkip_seq(struct ieee80211_local *local,
347                                     u8 hw_key_idx, u32 *iv32, u16 *iv16)
348 {
349         if (local->ops->get_tkip_seq)
350                 local->ops->get_tkip_seq(&local->hw, hw_key_idx, iv32, iv16);
351         trace_drv_get_tkip_seq(local, hw_key_idx, iv32, iv16);
352 }
353
354 static inline int drv_set_frag_threshold(struct ieee80211_local *local,
355                                         u32 value)
356 {
357         int ret = 0;
358
359         might_sleep();
360
361         trace_drv_set_frag_threshold(local, value);
362         if (local->ops->set_frag_threshold)
363                 ret = local->ops->set_frag_threshold(&local->hw, value);
364         trace_drv_return_int(local, ret);
365         return ret;
366 }
367
368 static inline int drv_set_rts_threshold(struct ieee80211_local *local,
369                                         u32 value)
370 {
371         int ret = 0;
372
373         might_sleep();
374
375         trace_drv_set_rts_threshold(local, value);
376         if (local->ops->set_rts_threshold)
377                 ret = local->ops->set_rts_threshold(&local->hw, value);
378         trace_drv_return_int(local, ret);
379         return ret;
380 }
381
382 static inline int drv_set_coverage_class(struct ieee80211_local *local,
383                                          u8 value)
384 {
385         int ret = 0;
386         might_sleep();
387
388         trace_drv_set_coverage_class(local, value);
389         if (local->ops->set_coverage_class)
390                 local->ops->set_coverage_class(&local->hw, value);
391         else
392                 ret = -EOPNOTSUPP;
393
394         trace_drv_return_int(local, ret);
395         return ret;
396 }
397
398 static inline void drv_sta_notify(struct ieee80211_local *local,
399                                   struct ieee80211_sub_if_data *sdata,
400                                   enum sta_notify_cmd cmd,
401                                   struct ieee80211_sta *sta)
402 {
403         sdata = get_bss_sdata(sdata);
404         check_sdata_in_driver(sdata);
405
406         trace_drv_sta_notify(local, sdata, cmd, sta);
407         if (local->ops->sta_notify)
408                 local->ops->sta_notify(&local->hw, &sdata->vif, cmd, sta);
409         trace_drv_return_void(local);
410 }
411
412 static inline int drv_sta_add(struct ieee80211_local *local,
413                               struct ieee80211_sub_if_data *sdata,
414                               struct ieee80211_sta *sta)
415 {
416         int ret = 0;
417
418         might_sleep();
419
420         sdata = get_bss_sdata(sdata);
421         check_sdata_in_driver(sdata);
422
423         trace_drv_sta_add(local, sdata, sta);
424         if (local->ops->sta_add)
425                 ret = local->ops->sta_add(&local->hw, &sdata->vif, sta);
426
427         trace_drv_return_int(local, ret);
428
429         return ret;
430 }
431
432 static inline void drv_sta_remove(struct ieee80211_local *local,
433                                   struct ieee80211_sub_if_data *sdata,
434                                   struct ieee80211_sta *sta)
435 {
436         might_sleep();
437
438         sdata = get_bss_sdata(sdata);
439         check_sdata_in_driver(sdata);
440
441         trace_drv_sta_remove(local, sdata, sta);
442         if (local->ops->sta_remove)
443                 local->ops->sta_remove(&local->hw, &sdata->vif, sta);
444
445         trace_drv_return_void(local);
446 }
447
448 static inline __must_check
449 int drv_sta_state(struct ieee80211_local *local,
450                   struct ieee80211_sub_if_data *sdata,
451                   struct sta_info *sta,
452                   enum ieee80211_sta_state old_state,
453                   enum ieee80211_sta_state new_state)
454 {
455         int ret = 0;
456
457         might_sleep();
458
459         sdata = get_bss_sdata(sdata);
460         check_sdata_in_driver(sdata);
461
462         trace_drv_sta_state(local, sdata, &sta->sta, old_state, new_state);
463         if (local->ops->sta_state) {
464                 ret = local->ops->sta_state(&local->hw, &sdata->vif, &sta->sta,
465                                             old_state, new_state);
466         } else if (old_state == IEEE80211_STA_AUTH &&
467                    new_state == IEEE80211_STA_ASSOC) {
468                 ret = drv_sta_add(local, sdata, &sta->sta);
469                 if (ret == 0)
470                         sta->uploaded = true;
471         } else if (old_state == IEEE80211_STA_ASSOC &&
472                    new_state == IEEE80211_STA_AUTH) {
473                 drv_sta_remove(local, sdata, &sta->sta);
474         }
475         trace_drv_return_int(local, ret);
476         return ret;
477 }
478
479 static inline void drv_sta_rc_update(struct ieee80211_local *local,
480                                      struct ieee80211_sub_if_data *sdata,
481                                      struct ieee80211_sta *sta, u32 changed)
482 {
483         sdata = get_bss_sdata(sdata);
484         check_sdata_in_driver(sdata);
485
486         trace_drv_sta_rc_update(local, sdata, sta, changed);
487         if (local->ops->sta_rc_update)
488                 local->ops->sta_rc_update(&local->hw, &sdata->vif,
489                                           sta, changed);
490
491         trace_drv_return_void(local);
492 }
493
494 static inline int drv_conf_tx(struct ieee80211_local *local,
495                               struct ieee80211_sub_if_data *sdata, u16 ac,
496                               const struct ieee80211_tx_queue_params *params)
497 {
498         int ret = -EOPNOTSUPP;
499
500         might_sleep();
501
502         check_sdata_in_driver(sdata);
503
504         trace_drv_conf_tx(local, sdata, ac, params);
505         if (local->ops->conf_tx)
506                 ret = local->ops->conf_tx(&local->hw, &sdata->vif,
507                                           ac, params);
508         trace_drv_return_int(local, ret);
509         return ret;
510 }
511
512 static inline u64 drv_get_tsf(struct ieee80211_local *local,
513                               struct ieee80211_sub_if_data *sdata)
514 {
515         u64 ret = -1ULL;
516
517         might_sleep();
518
519         check_sdata_in_driver(sdata);
520
521         trace_drv_get_tsf(local, sdata);
522         if (local->ops->get_tsf)
523                 ret = local->ops->get_tsf(&local->hw, &sdata->vif);
524         trace_drv_return_u64(local, ret);
525         return ret;
526 }
527
528 static inline void drv_set_tsf(struct ieee80211_local *local,
529                                struct ieee80211_sub_if_data *sdata,
530                                u64 tsf)
531 {
532         might_sleep();
533
534         check_sdata_in_driver(sdata);
535
536         trace_drv_set_tsf(local, sdata, tsf);
537         if (local->ops->set_tsf)
538                 local->ops->set_tsf(&local->hw, &sdata->vif, tsf);
539         trace_drv_return_void(local);
540 }
541
542 static inline void drv_reset_tsf(struct ieee80211_local *local,
543                                  struct ieee80211_sub_if_data *sdata)
544 {
545         might_sleep();
546
547         check_sdata_in_driver(sdata);
548
549         trace_drv_reset_tsf(local, sdata);
550         if (local->ops->reset_tsf)
551                 local->ops->reset_tsf(&local->hw, &sdata->vif);
552         trace_drv_return_void(local);
553 }
554
555 static inline int drv_tx_last_beacon(struct ieee80211_local *local)
556 {
557         int ret = 0; /* default unsuported op for less congestion */
558
559         might_sleep();
560
561         trace_drv_tx_last_beacon(local);
562         if (local->ops->tx_last_beacon)
563                 ret = local->ops->tx_last_beacon(&local->hw);
564         trace_drv_return_int(local, ret);
565         return ret;
566 }
567
568 static inline int drv_ampdu_action(struct ieee80211_local *local,
569                                    struct ieee80211_sub_if_data *sdata,
570                                    enum ieee80211_ampdu_mlme_action action,
571                                    struct ieee80211_sta *sta, u16 tid,
572                                    u16 *ssn, u8 buf_size)
573 {
574         int ret = -EOPNOTSUPP;
575
576         might_sleep();
577
578         sdata = get_bss_sdata(sdata);
579         check_sdata_in_driver(sdata);
580
581         trace_drv_ampdu_action(local, sdata, action, sta, tid, ssn, buf_size);
582
583         if (local->ops->ampdu_action)
584                 ret = local->ops->ampdu_action(&local->hw, &sdata->vif, action,
585                                                sta, tid, ssn, buf_size);
586
587         trace_drv_return_int(local, ret);
588
589         return ret;
590 }
591
592 static inline int drv_get_survey(struct ieee80211_local *local, int idx,
593                                 struct survey_info *survey)
594 {
595         int ret = -EOPNOTSUPP;
596
597         trace_drv_get_survey(local, idx, survey);
598
599         if (local->ops->get_survey)
600                 ret = local->ops->get_survey(&local->hw, idx, survey);
601
602         trace_drv_return_int(local, ret);
603
604         return ret;
605 }
606
607 static inline void drv_rfkill_poll(struct ieee80211_local *local)
608 {
609         might_sleep();
610
611         if (local->ops->rfkill_poll)
612                 local->ops->rfkill_poll(&local->hw);
613 }
614
615 static inline void drv_flush(struct ieee80211_local *local, bool drop)
616 {
617         might_sleep();
618
619         trace_drv_flush(local, drop);
620         if (local->ops->flush)
621                 local->ops->flush(&local->hw, drop);
622         trace_drv_return_void(local);
623 }
624
625 static inline void drv_channel_switch(struct ieee80211_local *local,
626                                      struct ieee80211_channel_switch *ch_switch)
627 {
628         might_sleep();
629
630         trace_drv_channel_switch(local, ch_switch);
631         local->ops->channel_switch(&local->hw, ch_switch);
632         trace_drv_return_void(local);
633 }
634
635
636 static inline int drv_set_antenna(struct ieee80211_local *local,
637                                   u32 tx_ant, u32 rx_ant)
638 {
639         int ret = -EOPNOTSUPP;
640         might_sleep();
641         if (local->ops->set_antenna)
642                 ret = local->ops->set_antenna(&local->hw, tx_ant, rx_ant);
643         trace_drv_set_antenna(local, tx_ant, rx_ant, ret);
644         return ret;
645 }
646
647 static inline int drv_get_antenna(struct ieee80211_local *local,
648                                   u32 *tx_ant, u32 *rx_ant)
649 {
650         int ret = -EOPNOTSUPP;
651         might_sleep();
652         if (local->ops->get_antenna)
653                 ret = local->ops->get_antenna(&local->hw, tx_ant, rx_ant);
654         trace_drv_get_antenna(local, *tx_ant, *rx_ant, ret);
655         return ret;
656 }
657
658 static inline int drv_remain_on_channel(struct ieee80211_local *local,
659                                         struct ieee80211_channel *chan,
660                                         enum nl80211_channel_type chantype,
661                                         unsigned int duration)
662 {
663         int ret;
664
665         might_sleep();
666
667         trace_drv_remain_on_channel(local, chan, chantype, duration);
668         ret = local->ops->remain_on_channel(&local->hw, chan, chantype,
669                                             duration);
670         trace_drv_return_int(local, ret);
671
672         return ret;
673 }
674
675 static inline int drv_cancel_remain_on_channel(struct ieee80211_local *local)
676 {
677         int ret;
678
679         might_sleep();
680
681         trace_drv_cancel_remain_on_channel(local);
682         ret = local->ops->cancel_remain_on_channel(&local->hw);
683         trace_drv_return_int(local, ret);
684
685         return ret;
686 }
687
688 static inline int drv_set_ringparam(struct ieee80211_local *local,
689                                     u32 tx, u32 rx)
690 {
691         int ret = -ENOTSUPP;
692
693         might_sleep();
694
695         trace_drv_set_ringparam(local, tx, rx);
696         if (local->ops->set_ringparam)
697                 ret = local->ops->set_ringparam(&local->hw, tx, rx);
698         trace_drv_return_int(local, ret);
699
700         return ret;
701 }
702
703 static inline void drv_get_ringparam(struct ieee80211_local *local,
704                                      u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max)
705 {
706         might_sleep();
707
708         trace_drv_get_ringparam(local, tx, tx_max, rx, rx_max);
709         if (local->ops->get_ringparam)
710                 local->ops->get_ringparam(&local->hw, tx, tx_max, rx, rx_max);
711         trace_drv_return_void(local);
712 }
713
714 static inline bool drv_tx_frames_pending(struct ieee80211_local *local)
715 {
716         bool ret = false;
717
718         might_sleep();
719
720         trace_drv_tx_frames_pending(local);
721         if (local->ops->tx_frames_pending)
722                 ret = local->ops->tx_frames_pending(&local->hw);
723         trace_drv_return_bool(local, ret);
724
725         return ret;
726 }
727
728 static inline int drv_set_bitrate_mask(struct ieee80211_local *local,
729                                        struct ieee80211_sub_if_data *sdata,
730                                        const struct cfg80211_bitrate_mask *mask)
731 {
732         int ret = -EOPNOTSUPP;
733
734         might_sleep();
735
736         check_sdata_in_driver(sdata);
737
738         trace_drv_set_bitrate_mask(local, sdata, mask);
739         if (local->ops->set_bitrate_mask)
740                 ret = local->ops->set_bitrate_mask(&local->hw,
741                                                    &sdata->vif, mask);
742         trace_drv_return_int(local, ret);
743
744         return ret;
745 }
746
747 static inline void drv_set_rekey_data(struct ieee80211_local *local,
748                                       struct ieee80211_sub_if_data *sdata,
749                                       struct cfg80211_gtk_rekey_data *data)
750 {
751         check_sdata_in_driver(sdata);
752
753         trace_drv_set_rekey_data(local, sdata, data);
754         if (local->ops->set_rekey_data)
755                 local->ops->set_rekey_data(&local->hw, &sdata->vif, data);
756         trace_drv_return_void(local);
757 }
758
759 static inline void drv_rssi_callback(struct ieee80211_local *local,
760                                      const enum ieee80211_rssi_event event)
761 {
762         trace_drv_rssi_callback(local, event);
763         if (local->ops->rssi_callback)
764                 local->ops->rssi_callback(&local->hw, event);
765         trace_drv_return_void(local);
766 }
767
768 static inline void
769 drv_release_buffered_frames(struct ieee80211_local *local,
770                             struct sta_info *sta, u16 tids, int num_frames,
771                             enum ieee80211_frame_release_type reason,
772                             bool more_data)
773 {
774         trace_drv_release_buffered_frames(local, &sta->sta, tids, num_frames,
775                                           reason, more_data);
776         if (local->ops->release_buffered_frames)
777                 local->ops->release_buffered_frames(&local->hw, &sta->sta, tids,
778                                                     num_frames, reason,
779                                                     more_data);
780         trace_drv_return_void(local);
781 }
782
783 static inline void
784 drv_allow_buffered_frames(struct ieee80211_local *local,
785                           struct sta_info *sta, u16 tids, int num_frames,
786                           enum ieee80211_frame_release_type reason,
787                           bool more_data)
788 {
789         trace_drv_allow_buffered_frames(local, &sta->sta, tids, num_frames,
790                                         reason, more_data);
791         if (local->ops->allow_buffered_frames)
792                 local->ops->allow_buffered_frames(&local->hw, &sta->sta,
793                                                   tids, num_frames, reason,
794                                                   more_data);
795         trace_drv_return_void(local);
796 }
797 #endif /* __MAC80211_DRIVER_OPS */