3 Broadcom BCM43xx wireless driver
5 Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>,
6 Stefano Brivio <st3@riseup.net>
7 Michael Buesch <mb@bu3sch.de>
8 Danny van Dyk <kugelfang@gentoo.org>
9 Andreas Jaggi <andreas.jaggi@waterwave.ch>
11 Some parts of the code in this file are derived from the ipw2200
12 driver Copyright(c) 2003 - 2004 Intel Corporation.
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
24 You should have received a copy of the GNU General Public License
25 along with this program; see the file COPYING. If not, write to
26 the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
27 Boston, MA 02110-1301, USA.
31 #include <linux/delay.h>
34 #include "bcm43xx_power.h"
35 #include "bcm43xx_main.h"
38 //TODO Kill this file.
40 /* Set the PowerSavingControlBits.
44 * -1 => calculate the bit
46 void bcm43xx_power_saving_ctl_bits(struct bcm43xx_wldev
*dev
,
52 //FIXME: Force 25 to off and 26 to on for now:
57 //TODO: If powersave is not off and FIXME is not set and we are not in adhoc
58 // and thus is not an AP and we are associated, set bit 25
61 //TODO: If the device is awake or this is an AP, or we are scanning, or FIXME,
62 // or we are associated, or FIXME, or the latest PS-Poll packet sent was
63 // successful, set bit26
65 status
= bcm43xx_read32(dev
, BCM43xx_MMIO_STATUS_BITFIELD
);
67 status
|= BCM43xx_SBF_PS1
;
69 status
&= ~BCM43xx_SBF_PS1
;
71 status
|= BCM43xx_SBF_PS2
;
73 status
&= ~BCM43xx_SBF_PS2
;
74 bcm43xx_write32(dev
, BCM43xx_MMIO_STATUS_BITFIELD
, status
);
75 if (bit26
&& dev
->dev
->id
.revision
>= 5) {
76 for (i
= 0; i
< 100; i
++) {
77 if (bcm43xx_shm_read32(dev
, BCM43xx_SHM_SHARED
, 0x0040) != 4)