blob: 73118364b55270ec902345aedb387744636dc9c1 [file] [log] [blame]
John W. Linvillef2223132006-01-23 16:59:58 -05001/*
2
3 Broadcom BCM43xx wireless driver
4
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>
10
11 Some parts of the code in this file are derived from the ipw2200
12 driver Copyright(c) 2003 - 2004 Intel Corporation.
13
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.
18
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.
23
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.
28
29*/
30
31#ifndef BCM43xx_PHY_H_
32#define BCM43xx_PHY_H_
33
34#include <linux/types.h>
35
36struct bcm43xx_private;
37
38void 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)
44void 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)
50
Larry Finger3a5c3932007-03-28 11:07:49 -050051/* Card uses the loopback gain stuff */
52#define has_loopback_gain(phy) \
53 (((phy)->rev > 1) || ((phy)->connected))
54
John W. Linvillef2223132006-01-23 16:59:58 -050055u16 bcm43xx_phy_read(struct bcm43xx_private *bcm, u16 offset);
56void bcm43xx_phy_write(struct bcm43xx_private *bcm, u16 offset, u16 val);
57
58int bcm43xx_phy_init_tssi2dbm_table(struct bcm43xx_private *bcm);
59int bcm43xx_phy_init(struct bcm43xx_private *bcm);
60
61void bcm43xx_phy_set_antenna_diversity(struct bcm43xx_private *bcm);
62void bcm43xx_phy_calibrate(struct bcm43xx_private *bcm);
63int bcm43xx_phy_connect(struct bcm43xx_private *bcm, int connect);
64
65void bcm43xx_phy_lo_b_measure(struct bcm43xx_private *bcm);
66void bcm43xx_phy_lo_g_measure(struct bcm43xx_private *bcm);
67void bcm43xx_phy_xmitpower(struct bcm43xx_private *bcm);
68
69/* Adjust the LocalOscillator to the saved values.
70 * "fixed" is only set to 1 once in initialization. Set to 0 otherwise.
71 */
72void bcm43xx_phy_lo_adjust(struct bcm43xx_private *bcm, int fixed);
73void bcm43xx_phy_lo_mark_all_unused(struct bcm43xx_private *bcm);
74
75void bcm43xx_phy_set_baseband_attenuation(struct bcm43xx_private *bcm,
76 u16 baseband_attenuation);
77
78#endif /* BCM43xx_PHY_H_ */