3 Broadcom B43 wireless driver
4 IEEE 802.11n PHY support
6 Copyright (c) 2008 Michael Buesch <mb@bu3sch.de>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; see the file COPYING. If not, write to
20 the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
21 Boston, MA 02110-1301, USA.
27 #include "tables_nphy.h"
30 void b43_nphy_set_rxantenna(struct b43_wldev *dev, int antenna)
34 void b43_nphy_xmitpower(struct b43_wldev *dev)
38 /* Tune the hardware to a new channel. Don't call this directly.
39 * Use b43_radio_selectchannel() */
40 void b43_nphy_selectchannel(struct b43_wldev *dev, u8 channel)
46 static void b43_radio_init2055_pre(struct b43_wldev *dev)
48 b43_phy_mask(dev, B43_NPHY_RFCTL_CMD,
49 ~B43_NPHY_RFCTL_CMD_PORFORCE);
50 b43_phy_set(dev, B43_NPHY_RFCTL_CMD,
51 B43_NPHY_RFCTL_CMD_CHIP0PU |
52 B43_NPHY_RFCTL_CMD_OEPORFORCE);
53 b43_phy_set(dev, B43_NPHY_RFCTL_CMD,
54 B43_NPHY_RFCTL_CMD_PORFORCE);
57 static void b43_radio_init2055_post(struct b43_wldev *dev)
59 struct ssb_sprom *sprom = &(dev->dev->bus->sprom);
60 struct ssb_boardinfo *binfo = &(dev->dev->bus->boardinfo);
64 b43_radio_mask(dev, B2055_MASTER1, 0xFFF3);
66 if ((sprom->revision != 4) || !(sprom->boardflags_hi & 0x0002)) {
67 if ((binfo->vendor != PCI_VENDOR_ID_BROADCOM) ||
68 (binfo->type != 0x46D) ||
69 (binfo->rev < 0x41)) {
70 b43_radio_mask(dev, B2055_C1_RX_BB_REG, 0x7F);
71 b43_radio_mask(dev, B2055_C1_RX_BB_REG, 0x7F);
75 b43_radio_maskset(dev, B2055_RRCCAL_NOPTSEL, 0x3F, 0x2C);
77 b43_radio_write16(dev, B2055_CAL_MISC, 0x3C);
79 b43_radio_mask(dev, B2055_CAL_MISC, 0xFFBE);
81 b43_radio_set(dev, B2055_CAL_LPOCTL, 0x80);
83 b43_radio_set(dev, B2055_CAL_MISC, 0x1);
85 b43_radio_set(dev, B2055_CAL_MISC, 0x40);
87 for (i = 0; i < 100; i++) {
88 val = b43_radio_read16(dev, B2055_CAL_COUT2);
94 b43_radio_mask(dev, B2055_CAL_LPOCTL, 0xFF7F);
96 b43_radio_selectchannel(dev, dev->phy.channel, 0);
97 b43_radio_write16(dev, B2055_C1_RX_BB_LPF, 0x9);
98 b43_radio_write16(dev, B2055_C2_RX_BB_LPF, 0x9);
99 b43_radio_write16(dev, B2055_C1_RX_BB_MIDACHP, 0x83);
100 b43_radio_write16(dev, B2055_C2_RX_BB_MIDACHP, 0x83);
103 /* Initialize a Broadcom 2055 N-radio */
104 static void b43_radio_init2055(struct b43_wldev *dev)
106 b43_radio_init2055_pre(dev);
107 if (b43_status(dev) < B43_STAT_INITIALIZED)
108 b2055_upload_inittab(dev, 0, 1);
110 b2055_upload_inittab(dev, 0/*FIXME on 5ghz band*/, 0);
111 b43_radio_init2055_post(dev);
114 void b43_nphy_radio_turn_on(struct b43_wldev *dev)
116 b43_radio_init2055(dev);
119 void b43_nphy_radio_turn_off(struct b43_wldev *dev)
121 b43_phy_mask(dev, B43_NPHY_RFCTL_CMD,
122 ~B43_NPHY_RFCTL_CMD_EN);
125 int b43_phy_initn(struct b43_wldev *dev)
127 b43err(dev->wl, "IEEE 802.11n devices are not supported, yet.\n");