x86: fix bootup crash in native_read_tsc()
[wrt350n-kernel.git] / drivers / net / wireless / bcm43xx / bcm43xx_phy.h
blob73118364b55270ec902345aedb387744636dc9c1
1 /*
3 Broadcom BCM43xx wireless driver
5 Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>,
6 Stefano Brivio <st3@riseup.net>
7 Michael Buesch <mbuesch@freenet.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 #ifndef BCM43xx_PHY_H_
32 #define BCM43xx_PHY_H_
34 #include <linux/types.h>
36 struct bcm43xx_private;
38 void bcm43xx_raw_phy_lock(struct bcm43xx_private *bcm);
39 #define bcm43xx_phy_lock(bcm, flags) \
40 do { \
41 local_irq_save(flags); \
42 bcm43xx_raw_phy_lock(bcm); \
43 } while (0)
44 void bcm43xx_raw_phy_unlock(struct bcm43xx_private *bcm);
45 #define bcm43xx_phy_unlock(bcm, flags) \
46 do { \
47 bcm43xx_raw_phy_unlock(bcm); \
48 local_irq_restore(flags); \
49 } while (0)
51 /* Card uses the loopback gain stuff */
52 #define has_loopback_gain(phy) \
53 (((phy)->rev > 1) || ((phy)->connected))
55 u16 bcm43xx_phy_read(struct bcm43xx_private *bcm, u16 offset);
56 void bcm43xx_phy_write(struct bcm43xx_private *bcm, u16 offset, u16 val);
58 int bcm43xx_phy_init_tssi2dbm_table(struct bcm43xx_private *bcm);
59 int bcm43xx_phy_init(struct bcm43xx_private *bcm);
61 void bcm43xx_phy_set_antenna_diversity(struct bcm43xx_private *bcm);
62 void bcm43xx_phy_calibrate(struct bcm43xx_private *bcm);
63 int bcm43xx_phy_connect(struct bcm43xx_private *bcm, int connect);
65 void bcm43xx_phy_lo_b_measure(struct bcm43xx_private *bcm);
66 void bcm43xx_phy_lo_g_measure(struct bcm43xx_private *bcm);
67 void bcm43xx_phy_xmitpower(struct bcm43xx_private *bcm);
69 /* Adjust the LocalOscillator to the saved values.
70 * "fixed" is only set to 1 once in initialization. Set to 0 otherwise.
72 void bcm43xx_phy_lo_adjust(struct bcm43xx_private *bcm, int fixed);
73 void bcm43xx_phy_lo_mark_all_unused(struct bcm43xx_private *bcm);
75 void bcm43xx_phy_set_baseband_attenuation(struct bcm43xx_private *bcm,
76 u16 baseband_attenuation);
78 #endif /* BCM43xx_PHY_H_ */