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

« back to all changes in this revision

Viewing changes to net/mac80211/pm.c

  • 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:
6
6
#include "driver-ops.h"
7
7
#include "led.h"
8
8
 
9
 
int __ieee80211_suspend(struct ieee80211_hw *hw)
 
9
int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
10
10
{
11
11
        struct ieee80211_local *local = hw_to_local(hw);
12
12
        struct ieee80211_sub_if_data *sdata;
14
14
 
15
15
        ieee80211_scan_cancel(local);
16
16
 
 
17
        if (hw->flags & IEEE80211_HW_AMPDU_AGGREGATION) {
 
18
                mutex_lock(&local->sta_mtx);
 
19
                list_for_each_entry(sta, &local->sta_list, list) {
 
20
                        set_sta_flags(sta, WLAN_STA_BLOCK_BA);
 
21
                        ieee80211_sta_tear_down_BA_sessions(sta, true);
 
22
                }
 
23
                mutex_unlock(&local->sta_mtx);
 
24
        }
 
25
 
17
26
        ieee80211_stop_queues_by_reason(hw,
18
27
                        IEEE80211_QUEUE_STOP_REASON_SUSPEND);
19
28
 
20
29
        /* flush out all packets */
21
30
        synchronize_net();
22
31
 
 
32
        drv_flush(local, false);
 
33
 
23
34
        local->quiescing = true;
24
35
        /* make quiescing visible to timers everywhere */
25
36
        mb();
36
47
        cancel_work_sync(&local->dynamic_ps_enable_work);
37
48
        del_timer_sync(&local->dynamic_ps_timer);
38
49
 
 
50
        local->wowlan = wowlan && local->open_count;
 
51
        if (local->wowlan) {
 
52
                int err = drv_suspend(local, wowlan);
 
53
                if (err) {
 
54
                        local->quiescing = false;
 
55
                        return err;
 
56
                }
 
57
                goto suspend;
 
58
        }
 
59
 
39
60
        /* disable keys */
40
61
        list_for_each_entry(sdata, &local->interfaces, list)
41
62
                ieee80211_disable_keys(sdata);
43
64
        /* tear down aggregation sessions and remove STAs */
44
65
        mutex_lock(&local->sta_mtx);
45
66
        list_for_each_entry(sta, &local->sta_list, list) {
46
 
                if (hw->flags & IEEE80211_HW_AMPDU_AGGREGATION) {
47
 
                        set_sta_flags(sta, WLAN_STA_BLOCK_BA);
48
 
                        ieee80211_sta_tear_down_BA_sessions(sta, true);
49
 
                }
50
 
 
51
67
                if (sta->uploaded) {
52
68
                        sdata = sta->sdata;
53
69
                        if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
98
114
        if (local->open_count)
99
115
                ieee80211_stop_device(local);
100
116
 
 
117
 suspend:
101
118
        local->suspended = true;
102
119
        /* need suspended to be visible before quiescing is false */
103
120
        barrier();