4 #include "bcm43xx_phy.h"
8 /* Local Oscillator control value-pair. */
13 /* "Used by hardware" flag. */
17 /* TX Power LO Control Array.
18 * Value-pairs to adjust the LocalOscillator are stored
20 * There are two different set of values. One for "Flag is Set"
21 * and one for "Flag is Unset".
22 * By "Flag" the flag in struct bcm43xx_rfatt is meant.
23 * The Value arrays are two-dimensional. The first index
24 * is the baseband attenuation and the second index
25 * is the radio attenuation.
26 * Use bcm43xx_get_lo_g_ctl() to retrieve a value from the lists.
28 struct bcm43xx_txpower_lo_control
{
29 #define BCM43xx_NR_BB 9
30 #define BCM43xx_NR_RF 16
31 /* LO Control values, with PAD Mixer */
32 struct bcm43xx_loctl with_padmix
[ BCM43xx_NR_BB
][ BCM43xx_NR_RF
];
33 /* LO Control values, without PAD Mixer */
34 struct bcm43xx_loctl no_padmix
[ BCM43xx_NR_BB
][ BCM43xx_NR_RF
];
36 /* Flag to indicate a complete rebuild of the two tables above
37 * to the LO measuring code. */
40 /* Lists of valid RF and BB attenuation values for this device. */
41 struct bcm43xx_rfatt_list rfatt_list
;
42 struct bcm43xx_bbatt_list bbatt_list
;
44 /* Current RF and BB attenuation and LO control values. */
45 struct bcm43xx_rfatt rfatt
;
46 struct bcm43xx_bbatt bbatt
;
48 /* Current TX Bias value */
50 /* Current TX Magnification Value (if used by the device) */
53 /* GPHY LO is measured. */
56 /* Saved device PowerVector */
61 /* Measure the BPHY Local Oscillator. */
62 void bcm43xx_lo_b_measure(struct bcm43xx_wldev
*dev
);
63 /* Measure the BPHY/GPHY Local Oscillator. */
64 void bcm43xx_lo_g_measure(struct bcm43xx_wldev
*dev
);
66 /* Adjust the Local Oscillator to the saved attenuation
69 void bcm43xx_lo_g_adjust(struct bcm43xx_wldev
*dev
);
70 /* Adjust to specific values. */
71 void bcm43xx_lo_g_adjust_to(struct bcm43xx_wldev
*dev
,
72 u16 rfatt
, u16 bbatt
, u16 txctl1
);
74 /* Returns the bcm43xx_lo_g_ctl corresponding to the current
77 struct bcm43xx_loctl
* bcm43xx_lo_g_ctl_current(struct bcm43xx_wldev
*dev
);
78 /* Mark all possible bcm43xx_lo_g_ctl as "unused" */
79 void bcm43xx_lo_g_ctl_mark_all_unused(struct bcm43xx_wldev
*dev
);
80 /* Mark the bcm43xx_lo_g_ctl corresponding to the current
81 * attenuation values as used.
83 void bcm43xx_lo_g_ctl_mark_cur_used(struct bcm43xx_wldev
*dev
);
85 /* Get a reference to a LO Control value pair in the
86 * TX Power LO Control Array.
88 struct bcm43xx_loctl
* bcm43xx_get_lo_g_ctl(struct bcm43xx_wldev
*dev
,
89 const struct bcm43xx_rfatt
*rfatt
,
90 const struct bcm43xx_bbatt
*bbatt
);
92 #endif /* BCM43xx_LO_H_ */