b43: Convert usage of b43_radio_maskset()
[safe/jmp/linux-2.6] / drivers / net / wireless / b43 / phy_g.h
index 1f0daeb..718947f 100644 (file)
@@ -114,9 +114,6 @@ static inline bool b43_compare_bbatt(const struct b43_bbatt *a,
 struct b43_txpower_lo_control;
 
 struct b43_phy_g {
-       bool initialised;
-       bool dyn_tssi_tbl;      /* tssi2dbm is kmalloc()ed. */
-
        /* ACI (adjacent channel interference) flags. */
        bool aci_enable;
        bool aci_wlan_automatic;
@@ -135,12 +132,26 @@ struct b43_phy_g {
        u16 minlowsig[2];
        u16 minlowsigpos[2];
 
-       /* TSSI to dBm table in use */
+       /* Pointer to the table used to convert a
+        * TSSI value to dBm-Q5.2 */
        const s8 *tssi2dbm;
+       /* tssi2dbm is kmalloc()ed. Only used for free()ing. */
+       bool dyn_tssi_tbl;
        /* Target idle TSSI */
        int tgt_idle_tssi;
        /* Current idle TSSI */
        int cur_idle_tssi;
+       /* The current average TSSI.
+        * Needs irq_lock, as it's updated in the IRQ path. */
+       u8 average_tssi;
+       /* Current TX power level attenuation control values */
+       struct b43_bbatt bbatt;
+       struct b43_rfatt rfatt;
+       u8 tx_control;          /* B43_TXCTL_XXX */
+       /* The calculated attenuation deltas that are used later
+        * when adjusting the actual power output. */
+       int bbatt_delta;
+       int rfatt_delta;
 
        /* LocalOscillator control values. */
        struct b43_txpower_lo_control *lo_control;
@@ -151,11 +162,6 @@ struct b43_phy_g {
        s16 lna_gain;           /* LNA */
        s16 pga_gain;           /* PGA */
 
-       /* Current TX power level attenuation control values */
-       struct b43_bbatt bbatt;
-       struct b43_rfatt rfatt;
-       u8 tx_control;          /* B43_TXCTL_XXX */
-
        /* Current Interference Mitigation mode */
        int interfmode;
        /* Stack of saved values from the Interference Mitigation code.
@@ -194,6 +200,8 @@ void b43_gphy_set_baseband_attenuation(struct b43_wldev *dev,
 void b43_gphy_channel_switch(struct b43_wldev *dev,
                             unsigned int channel,
                             bool synthetic_pu_workaround);
+u8 * b43_generate_dyn_tssi2dbm_tab(struct b43_wldev *dev,
+                                  s16 pab0, s16 pab1, s16 pab2);
 
 struct b43_phy_operations;
 extern const struct b43_phy_operations b43_phyops_g;