~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to net/mac80211/driver-ops.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
#include "ieee80211_i.h"
6
6
#include "driver-trace.h"
7
7
 
8
 
static inline int drv_tx(struct ieee80211_local *local, struct sk_buff *skb)
 
8
static inline void drv_tx(struct ieee80211_local *local, struct sk_buff *skb)
9
9
{
10
 
        return local->ops->tx(&local->hw, skb);
 
10
        local->ops->tx(&local->hw, skb);
11
11
}
12
12
 
13
13
static inline int drv_start(struct ieee80211_local *local)
41
41
        local->started = false;
42
42
}
43
43
 
 
44
#ifdef CONFIG_PM
 
45
static inline int drv_suspend(struct ieee80211_local *local,
 
46
                              struct cfg80211_wowlan *wowlan)
 
47
{
 
48
        int ret;
 
49
 
 
50
        might_sleep();
 
51
 
 
52
        trace_drv_suspend(local);
 
53
        ret = local->ops->suspend(&local->hw, wowlan);
 
54
        trace_drv_return_int(local, ret);
 
55
        return ret;
 
56
}
 
57
 
 
58
static inline int drv_resume(struct ieee80211_local *local)
 
59
{
 
60
        int ret;
 
61
 
 
62
        might_sleep();
 
63
 
 
64
        trace_drv_resume(local);
 
65
        ret = local->ops->resume(&local->hw);
 
66
        trace_drv_return_int(local, ret);
 
67
        return ret;
 
68
}
 
69
#endif
 
70
 
44
71
static inline int drv_add_interface(struct ieee80211_local *local,
45
72
                                    struct ieee80211_vif *vif)
46
73
{
185
212
 
186
213
        might_sleep();
187
214
 
188
 
        trace_drv_hw_scan(local, sdata, req);
 
215
        trace_drv_hw_scan(local, sdata);
189
216
        ret = local->ops->hw_scan(&local->hw, &sdata->vif, req);
190
217
        trace_drv_return_int(local, ret);
191
218
        return ret;
192
219
}
193
220
 
 
221
static inline int
 
222
drv_sched_scan_start(struct ieee80211_local *local,
 
223
                     struct ieee80211_sub_if_data *sdata,
 
224
                     struct cfg80211_sched_scan_request *req,
 
225
                     struct ieee80211_sched_scan_ies *ies)
 
226
{
 
227
        int ret;
 
228
 
 
229
        might_sleep();
 
230
 
 
231
        trace_drv_sched_scan_start(local, sdata);
 
232
        ret = local->ops->sched_scan_start(&local->hw, &sdata->vif,
 
233
                                              req, ies);
 
234
        trace_drv_return_int(local, ret);
 
235
        return ret;
 
236
}
 
237
 
 
238
static inline void drv_sched_scan_stop(struct ieee80211_local *local,
 
239
                                       struct ieee80211_sub_if_data *sdata)
 
240
{
 
241
        might_sleep();
 
242
 
 
243
        trace_drv_sched_scan_stop(local, sdata);
 
244
        local->ops->sched_scan_stop(&local->hw, &sdata->vif);
 
245
        trace_drv_return_void(local);
 
246
}
 
247
 
194
248
static inline void drv_sw_scan_start(struct ieee80211_local *local)
195
249
{
196
250
        might_sleep();
382
436
                                   struct ieee80211_sub_if_data *sdata,
383
437
                                   enum ieee80211_ampdu_mlme_action action,
384
438
                                   struct ieee80211_sta *sta, u16 tid,
385
 
                                   u16 *ssn)
 
439
                                   u16 *ssn, u8 buf_size)
386
440
{
387
441
        int ret = -EOPNOTSUPP;
388
442
 
389
443
        might_sleep();
390
444
 
391
 
        trace_drv_ampdu_action(local, sdata, action, sta, tid, ssn);
 
445
        trace_drv_ampdu_action(local, sdata, action, sta, tid, ssn, buf_size);
392
446
 
393
447
        if (local->ops->ampdu_action)
394
448
                ret = local->ops->ampdu_action(&local->hw, &sdata->vif, action,
395
 
                                               sta, tid, ssn);
 
449
                                               sta, tid, ssn, buf_size);
396
450
 
397
451
        trace_drv_return_int(local, ret);
398
452
 
495
549
        return ret;
496
550
}
497
551
 
 
552
static inline int drv_offchannel_tx(struct ieee80211_local *local,
 
553
                                    struct sk_buff *skb,
 
554
                                    struct ieee80211_channel *chan,
 
555
                                    enum nl80211_channel_type channel_type,
 
556
                                    unsigned int wait)
 
557
{
 
558
        int ret;
 
559
 
 
560
        might_sleep();
 
561
 
 
562
        trace_drv_offchannel_tx(local, skb, chan, channel_type, wait);
 
563
        ret = local->ops->offchannel_tx(&local->hw, skb, chan,
 
564
                                        channel_type, wait);
 
565
        trace_drv_return_int(local, ret);
 
566
 
 
567
        return ret;
 
568
}
 
569
 
 
570
static inline int drv_offchannel_tx_cancel_wait(struct ieee80211_local *local)
 
571
{
 
572
        int ret;
 
573
 
 
574
        might_sleep();
 
575
 
 
576
        trace_drv_offchannel_tx_cancel_wait(local);
 
577
        ret = local->ops->offchannel_tx_cancel_wait(&local->hw);
 
578
        trace_drv_return_int(local, ret);
 
579
 
 
580
        return ret;
 
581
}
 
582
 
 
583
static inline int drv_set_ringparam(struct ieee80211_local *local,
 
584
                                    u32 tx, u32 rx)
 
585
{
 
586
        int ret = -ENOTSUPP;
 
587
 
 
588
        might_sleep();
 
589
 
 
590
        trace_drv_set_ringparam(local, tx, rx);
 
591
        if (local->ops->set_ringparam)
 
592
                ret = local->ops->set_ringparam(&local->hw, tx, rx);
 
593
        trace_drv_return_int(local, ret);
 
594
 
 
595
        return ret;
 
596
}
 
597
 
 
598
static inline void drv_get_ringparam(struct ieee80211_local *local,
 
599
                                     u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max)
 
600
{
 
601
        might_sleep();
 
602
 
 
603
        trace_drv_get_ringparam(local, tx, tx_max, rx, rx_max);
 
604
        if (local->ops->get_ringparam)
 
605
                local->ops->get_ringparam(&local->hw, tx, tx_max, rx, rx_max);
 
606
        trace_drv_return_void(local);
 
607
}
 
608
 
 
609
static inline bool drv_tx_frames_pending(struct ieee80211_local *local)
 
610
{
 
611
        bool ret = false;
 
612
 
 
613
        might_sleep();
 
614
 
 
615
        trace_drv_tx_frames_pending(local);
 
616
        if (local->ops->tx_frames_pending)
 
617
                ret = local->ops->tx_frames_pending(&local->hw);
 
618
        trace_drv_return_bool(local, ret);
 
619
 
 
620
        return ret;
 
621
}
 
622
 
 
623
static inline int drv_set_bitrate_mask(struct ieee80211_local *local,
 
624
                                       struct ieee80211_sub_if_data *sdata,
 
625
                                       const struct cfg80211_bitrate_mask *mask)
 
626
{
 
627
        int ret = -EOPNOTSUPP;
 
628
 
 
629
        might_sleep();
 
630
 
 
631
        trace_drv_set_bitrate_mask(local, sdata, mask);
 
632
        if (local->ops->set_bitrate_mask)
 
633
                ret = local->ops->set_bitrate_mask(&local->hw,
 
634
                                                   &sdata->vif, mask);
 
635
        trace_drv_return_int(local, ret);
 
636
 
 
637
        return ret;
 
638
}
 
639
 
498
640
#endif /* __MAC80211_DRIVER_OPS */