~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/net/wireless/wl1251/ps.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
        unsigned long delay;
59
59
 
60
60
        if (wl->psm) {
61
 
                cancel_delayed_work(&wl->elp_work);
62
61
                delay = msecs_to_jiffies(ELP_ENTRY_DELAY);
63
62
                ieee80211_queue_delayed_work(wl->hw, &wl->elp_work, delay);
64
63
        }
69
68
        unsigned long timeout, start;
70
69
        u32 elp_reg;
71
70
 
 
71
        if (delayed_work_pending(&wl->elp_work))
 
72
                cancel_delayed_work(&wl->elp_work);
 
73
 
72
74
        if (!wl->elp)
73
75
                return 0;
74
76
 
102
104
        return 0;
103
105
}
104
106
 
105
 
static int wl1251_ps_set_elp(struct wl1251 *wl, bool enable)
106
 
{
107
 
        int ret;
108
 
 
109
 
        if (enable) {
110
 
                wl1251_debug(DEBUG_PSM, "sleep auth psm/elp");
111
 
 
112
 
                ret = wl1251_acx_sleep_auth(wl, WL1251_PSM_ELP);
113
 
                if (ret < 0)
114
 
                        return ret;
115
 
 
116
 
                wl1251_ps_elp_sleep(wl);
117
 
        } else {
118
 
                wl1251_debug(DEBUG_PSM, "sleep auth cam");
119
 
 
120
 
                /*
121
 
                 * When the target is in ELP, we can only
122
 
                 * access the ELP control register. Thus,
123
 
                 * we have to wake the target up before
124
 
                 * changing the power authorization.
125
 
                 */
126
 
 
127
 
                wl1251_ps_elp_wakeup(wl);
128
 
 
129
 
                ret = wl1251_acx_sleep_auth(wl, WL1251_PSM_CAM);
130
 
                if (ret < 0)
131
 
                        return ret;
132
 
        }
133
 
 
134
 
        return 0;
135
 
}
136
 
 
137
107
int wl1251_ps_set_mode(struct wl1251 *wl, enum wl1251_cmd_ps_mode mode)
138
108
{
139
109
        int ret;
153
123
                if (ret < 0)
154
124
                        return ret;
155
125
 
 
126
                ret = wl1251_acx_bet_enable(wl, WL1251_ACX_BET_ENABLE,
 
127
                                            WL1251_DEFAULT_BET_CONSECUTIVE);
 
128
                if (ret < 0)
 
129
                        return ret;
 
130
 
156
131
                ret = wl1251_cmd_ps_mode(wl, STATION_POWER_SAVE_MODE);
157
132
                if (ret < 0)
158
133
                        return ret;
159
134
 
160
 
                ret = wl1251_ps_set_elp(wl, true);
 
135
                ret = wl1251_acx_sleep_auth(wl, WL1251_PSM_ELP);
161
136
                if (ret < 0)
162
137
                        return ret;
163
138
 
166
141
        case STATION_ACTIVE_MODE:
167
142
        default:
168
143
                wl1251_debug(DEBUG_PSM, "leaving psm");
169
 
                ret = wl1251_ps_set_elp(wl, false);
 
144
 
 
145
                ret = wl1251_acx_sleep_auth(wl, WL1251_PSM_CAM);
 
146
                if (ret < 0)
 
147
                        return ret;
 
148
 
 
149
                /* disable BET */
 
150
                ret = wl1251_acx_bet_enable(wl, WL1251_ACX_BET_DISABLE,
 
151
                                            WL1251_DEFAULT_BET_CONSECUTIVE);
170
152
                if (ret < 0)
171
153
                        return ret;
172
154