3 Broadcom B43 wireless driver
4 IEEE 802.11g LP-PHY driver
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 "phy_common.h"
30 static int b43_lpphy_op_allocate(struct b43_wldev *dev)
32 struct b43_phy_lp *lpphy;
34 lpphy = kzalloc(sizeof(*lpphy), GFP_KERNEL);
44 static int b43_lpphy_op_init(struct b43_wldev *dev)
46 struct b43_phy_lp *lpphy = dev->phy.lp;
49 lpphy->initialised = 1;
54 static void b43_lpphy_op_exit(struct b43_wldev *dev)
56 struct b43_phy_lp *lpphy = dev->phy.lp;
58 if (lpphy->initialised) {
60 lpphy->initialised = 0;
67 static u16 b43_lpphy_op_read(struct b43_wldev *dev, u16 reg)
73 static void b43_lpphy_op_write(struct b43_wldev *dev, u16 reg, u16 value)
78 static u16 b43_lpphy_op_radio_read(struct b43_wldev *dev, u16 reg)
84 static void b43_lpphy_op_radio_write(struct b43_wldev *dev, u16 reg, u16 value)
86 /* Register 1 is a 32-bit register. */
87 B43_WARN_ON(reg == 1);
92 static void b43_lpphy_op_software_rfkill(struct b43_wldev *dev,
93 enum rfkill_state state)
98 static int b43_lpphy_op_switch_channel(struct b43_wldev *dev,
99 unsigned int new_channel)
105 static unsigned int b43_lpphy_op_get_default_chan(struct b43_wldev *dev)
107 return 1; /* Default to channel 1 */
110 static void b43_lpphy_op_set_rx_antenna(struct b43_wldev *dev, int antenna)
115 static void b43_lpphy_op_adjust_txpower(struct b43_wldev *dev)
120 static enum b43_txpwr_result b43_lpphy_op_recalc_txpower(struct b43_wldev *dev,
124 return B43_TXPWR_RES_DONE;
128 const struct b43_phy_operations b43_phyops_lp = {
129 .allocate = b43_lpphy_op_allocate,
130 .init = b43_lpphy_op_init,
131 .exit = b43_lpphy_op_exit,
132 .phy_read = b43_lpphy_op_read,
133 .phy_write = b43_lpphy_op_write,
134 .radio_read = b43_lpphy_op_radio_read,
135 .radio_write = b43_lpphy_op_radio_write,
136 .software_rfkill = b43_lpphy_op_software_rfkill,
137 .switch_channel = b43_lpphy_op_switch_channel,
138 .get_default_chan = b43_lpphy_op_get_default_chan,
139 .set_rx_antenna = b43_lpphy_op_set_rx_antenna,
140 .recalc_txpower = b43_lpphy_op_recalc_txpower,
141 .adjust_txpower = b43_lpphy_op_adjust_txpower,