diff options
author | Michael Buesch <mb@bu3sch.de> | 2007-09-18 15:39:42 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:51:37 -0400 |
commit | e4d6b7951812d98417feb10784e400e253caf633 (patch) | |
tree | 4f653c52b4cffd5ade2eb166a56b306c9181ed08 /drivers/net/wireless/b43/lo.h | |
parent | 61e115a56d1aafd6e6a8a9fee8ac099a6128ac7b (diff) |
[B43]: add mac80211-based driver for modern BCM43xx devices
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/b43/lo.h')
-rw-r--r-- | drivers/net/wireless/b43/lo.h | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/lo.h b/drivers/net/wireless/b43/lo.h new file mode 100644 index 000000000000..455615d1f8c6 --- /dev/null +++ b/drivers/net/wireless/b43/lo.h | |||
@@ -0,0 +1,112 @@ | |||
1 | #ifndef B43_LO_H_ | ||
2 | #define B43_LO_H_ | ||
3 | |||
4 | #include "phy.h" | ||
5 | |||
6 | struct b43_wldev; | ||
7 | |||
8 | /* Local Oscillator control value-pair. */ | ||
9 | struct b43_loctl { | ||
10 | /* Control values. */ | ||
11 | s8 i; | ||
12 | s8 q; | ||
13 | /* "Used by hardware" flag. */ | ||
14 | bool used; | ||
15 | #ifdef CONFIG_B43_DEBUG | ||
16 | /* Is this lo-control-array entry calibrated? */ | ||
17 | bool calibrated; | ||
18 | #endif | ||
19 | }; | ||
20 | |||
21 | /* Debugging: Poison value for i and q values. */ | ||
22 | #define B43_LOCTL_POISON 111 | ||
23 | |||
24 | /* loctl->calibrated debugging mechanism */ | ||
25 | #ifdef CONFIG_B43_DEBUG | ||
26 | static inline void b43_loctl_set_calibrated(struct b43_loctl *loctl, | ||
27 | bool calibrated) | ||
28 | { | ||
29 | loctl->calibrated = calibrated; | ||
30 | } | ||
31 | static inline bool b43_loctl_is_calibrated(struct b43_loctl *loctl) | ||
32 | { | ||
33 | return loctl->calibrated; | ||
34 | } | ||
35 | #else | ||
36 | static inline void b43_loctl_set_calibrated(struct b43_loctl *loctl, | ||
37 | bool calibrated) | ||
38 | { | ||
39 | } | ||
40 | static inline bool b43_loctl_is_calibrated(struct b43_loctl *loctl) | ||
41 | { | ||
42 | return 1; | ||
43 | } | ||
44 | #endif | ||
45 | |||
46 | /* TX Power LO Control Array. | ||
47 | * Value-pairs to adjust the LocalOscillator are stored | ||
48 | * in this structure. | ||
49 | * There are two different set of values. One for "Flag is Set" | ||
50 | * and one for "Flag is Unset". | ||
51 | * By "Flag" the flag in struct b43_rfatt is meant. | ||
52 | * The Value arrays are two-dimensional. The first index | ||
53 | * is the baseband attenuation and the second index | ||
54 | * is the radio attenuation. | ||
55 | * Use b43_get_lo_g_ctl() to retrieve a value from the lists. | ||
56 | */ | ||
57 | struct b43_txpower_lo_control { | ||
58 | #define B43_NR_BB 12 | ||
59 | #define B43_NR_RF 16 | ||
60 | /* LO Control values, with PAD Mixer */ | ||
61 | struct b43_loctl with_padmix[B43_NR_BB][B43_NR_RF]; | ||
62 | /* LO Control values, without PAD Mixer */ | ||
63 | struct b43_loctl no_padmix[B43_NR_BB][B43_NR_RF]; | ||
64 | |||
65 | /* Flag to indicate a complete rebuild of the two tables above | ||
66 | * to the LO measuring code. */ | ||
67 | bool rebuild; | ||
68 | |||
69 | /* Lists of valid RF and BB attenuation values for this device. */ | ||
70 | struct b43_rfatt_list rfatt_list; | ||
71 | struct b43_bbatt_list bbatt_list; | ||
72 | |||
73 | /* Current TX Bias value */ | ||
74 | u8 tx_bias; | ||
75 | /* Current TX Magnification Value (if used by the device) */ | ||
76 | u8 tx_magn; | ||
77 | |||
78 | /* GPHY LO is measured. */ | ||
79 | bool lo_measured; | ||
80 | |||
81 | /* Saved device PowerVector */ | ||
82 | u64 power_vector; | ||
83 | }; | ||
84 | |||
85 | /* Measure the BPHY Local Oscillator. */ | ||
86 | void b43_lo_b_measure(struct b43_wldev *dev); | ||
87 | /* Measure the BPHY/GPHY Local Oscillator. */ | ||
88 | void b43_lo_g_measure(struct b43_wldev *dev); | ||
89 | |||
90 | /* Adjust the Local Oscillator to the saved attenuation | ||
91 | * and txctl values. | ||
92 | */ | ||
93 | void b43_lo_g_adjust(struct b43_wldev *dev); | ||
94 | /* Adjust to specific values. */ | ||
95 | void b43_lo_g_adjust_to(struct b43_wldev *dev, | ||
96 | u16 rfatt, u16 bbatt, u16 tx_control); | ||
97 | |||
98 | /* Mark all possible b43_lo_g_ctl as "unused" */ | ||
99 | void b43_lo_g_ctl_mark_all_unused(struct b43_wldev *dev); | ||
100 | /* Mark the b43_lo_g_ctl corresponding to the current | ||
101 | * attenuation values as used. | ||
102 | */ | ||
103 | void b43_lo_g_ctl_mark_cur_used(struct b43_wldev *dev); | ||
104 | |||
105 | /* Get a reference to a LO Control value pair in the | ||
106 | * TX Power LO Control Array. | ||
107 | */ | ||
108 | struct b43_loctl *b43_get_lo_g_ctl(struct b43_wldev *dev, | ||
109 | const struct b43_rfatt *rfatt, | ||
110 | const struct b43_bbatt *bbatt); | ||
111 | |||
112 | #endif /* B43_LO_H_ */ | ||