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 TX Bias value */
46 /* Current TX Magnification Value (if used by the device) */
49 /* GPHY LO is measured. */
52 /* Saved device PowerVector */
57 /* Measure the BPHY Local Oscillator. */
58 void bcm43xx_lo_b_measure(struct bcm43xx_wldev
*dev
);
59 /* Measure the BPHY/GPHY Local Oscillator. */
60 void bcm43xx_lo_g_measure(struct bcm43xx_wldev
*dev
);
62 /* Adjust the Local Oscillator to the saved attenuation
65 void bcm43xx_lo_g_adjust(struct bcm43xx_wldev
*dev
);
66 /* Adjust to specific values. */
67 void bcm43xx_lo_g_adjust_to(struct bcm43xx_wldev
*dev
,
68 u16 rfatt
, u16 bbatt
, u16 tx_control
);
70 /* Returns the bcm43xx_lo_g_ctl corresponding to the current
73 struct bcm43xx_loctl
* bcm43xx_lo_g_ctl_current(struct bcm43xx_wldev
*dev
);
74 /* Mark all possible bcm43xx_lo_g_ctl as "unused" */
75 void bcm43xx_lo_g_ctl_mark_all_unused(struct bcm43xx_wldev
*dev
);
76 /* Mark the bcm43xx_lo_g_ctl corresponding to the current
77 * attenuation values as used.
79 void bcm43xx_lo_g_ctl_mark_cur_used(struct bcm43xx_wldev
*dev
);
81 /* Get a reference to a LO Control value pair in the
82 * TX Power LO Control Array.
84 struct bcm43xx_loctl
* bcm43xx_get_lo_g_ctl(struct bcm43xx_wldev
*dev
,
85 const struct bcm43xx_rfatt
*rfatt
,
86 const struct bcm43xx_bbatt
*bbatt
);
88 #endif /* BCM43xx_LO_H_ */