diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2011-12-10 20:55:32 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-13 15:33:50 -0500 |
commit | 66d80a51e8a6fbca35bdce69db813288826ce9aa (patch) | |
tree | 7e08b6bc32cd5c2f0ad45e3eb33e6ddb6574e2ea | |
parent | 9a2e85de2c2ff85bbf2891f8a29cded5dbff5e05 (diff) |
b43: N-PHY: add table for antenna software control
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/b43/tables_nphy.c | 50 | ||||
-rw-r--r-- | drivers/net/wireless/b43/tables_nphy.h | 3 |
2 files changed, 52 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c index 05ab6a466703..691839e7541c 100644 --- a/drivers/net/wireless/b43/tables_nphy.c +++ b/drivers/net/wireless/b43/tables_nphy.c | |||
@@ -2171,6 +2171,48 @@ static const u16 b43_ntab_loftlt1_r3[] = { | |||
2171 | 0x0000, 0x0000, | 2171 | 0x0000, 0x0000, |
2172 | }; | 2172 | }; |
2173 | 2173 | ||
2174 | /* volatile tables, PHY revision >= 3 */ | ||
2175 | |||
2176 | /* indexed by antswctl2g */ | ||
2177 | static const u16 b43_ntab_antswctl2g_r3[4][32] = { | ||
2178 | { | ||
2179 | 0x0082, 0x0082, 0x0211, 0x0222, 0x0328, | ||
2180 | 0x0000, 0x0000, 0x0000, 0x0144, 0x0000, | ||
2181 | 0x0000, 0x0000, 0x0188, 0x0000, 0x0000, | ||
2182 | 0x0000, 0x0082, 0x0082, 0x0211, 0x0222, | ||
2183 | 0x0328, 0x0000, 0x0000, 0x0000, 0x0144, | ||
2184 | 0x0000, 0x0000, 0x0000, 0x0188, 0x0000, | ||
2185 | 0x0000, 0x0000, | ||
2186 | }, | ||
2187 | { | ||
2188 | 0x0022, 0x0022, 0x0011, 0x0022, 0x0022, | ||
2189 | 0x0000, 0x0000, 0x0000, 0x0011, 0x0000, | ||
2190 | 0x0000, 0x0000, 0x0022, 0x0000, 0x0000, | ||
2191 | 0x0000, 0x0022, 0x0022, 0x0011, 0x0022, | ||
2192 | 0x0022, 0x0000, 0x0000, 0x0000, 0x0011, | ||
2193 | 0x0000, 0x0000, 0x0000, 0x0022, 0x0000, | ||
2194 | 0x0000, 0x0000, | ||
2195 | }, | ||
2196 | { | ||
2197 | 0x0088, 0x0088, 0x0044, 0x0088, 0x0088, | ||
2198 | 0x0000, 0x0000, 0x0000, 0x0044, 0x0000, | ||
2199 | 0x0000, 0x0000, 0x0088, 0x0000, 0x0000, | ||
2200 | 0x0000, 0x0088, 0x0088, 0x0044, 0x0088, | ||
2201 | 0x0088, 0x0000, 0x0000, 0x0000, 0x0044, | ||
2202 | 0x0000, 0x0000, 0x0000, 0x0088, 0x0000, | ||
2203 | 0x0000, 0x0000, | ||
2204 | }, | ||
2205 | { | ||
2206 | 0x0022, 0x0022, 0x0011, 0x0022, 0x0000, | ||
2207 | 0x0000, 0x0000, 0x0000, 0x0011, 0x0000, | ||
2208 | 0x0000, 0x0000, 0x0022, 0x0000, 0x0000, | ||
2209 | 0x03cc, 0x0022, 0x0022, 0x0011, 0x0022, | ||
2210 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0011, | ||
2211 | 0x0000, 0x0000, 0x0000, 0x0022, 0x0000, | ||
2212 | 0x0000, 0x03cc, | ||
2213 | } | ||
2214 | }; | ||
2215 | |||
2174 | /* TX gain tables */ | 2216 | /* TX gain tables */ |
2175 | const u32 b43_ntab_tx_gain_rev0_1_2[] = { | 2217 | const u32 b43_ntab_tx_gain_rev0_1_2[] = { |
2176 | 0x03cc2b44, 0x03cc2b42, 0x03cc2a44, 0x03cc2a42, | 2218 | 0x03cc2b44, 0x03cc2b42, 0x03cc2a44, 0x03cc2a42, |
@@ -3006,6 +3048,8 @@ void b43_nphy_rev0_1_2_tables_init(struct b43_wldev *dev) | |||
3006 | } while (0) | 3048 | } while (0) |
3007 | void b43_nphy_rev3plus_tables_init(struct b43_wldev *dev) | 3049 | void b43_nphy_rev3plus_tables_init(struct b43_wldev *dev) |
3008 | { | 3050 | { |
3051 | struct ssb_sprom *sprom = dev->dev->bus_sprom; | ||
3052 | |||
3009 | /* Static tables */ | 3053 | /* Static tables */ |
3010 | ntab_upload_r3(dev, B43_NTAB_FRAMESTRUCT_R3, b43_ntab_framestruct_r3); | 3054 | ntab_upload_r3(dev, B43_NTAB_FRAMESTRUCT_R3, b43_ntab_framestruct_r3); |
3011 | ntab_upload_r3(dev, B43_NTAB_PILOT_R3, b43_ntab_pilot_r3); | 3055 | ntab_upload_r3(dev, B43_NTAB_PILOT_R3, b43_ntab_pilot_r3); |
@@ -3036,7 +3080,11 @@ void b43_nphy_rev3plus_tables_init(struct b43_wldev *dev) | |||
3036 | ntab_upload_r3(dev, B43_NTAB_C1_LOFEEDTH_R3, b43_ntab_loftlt1_r3); | 3080 | ntab_upload_r3(dev, B43_NTAB_C1_LOFEEDTH_R3, b43_ntab_loftlt1_r3); |
3037 | 3081 | ||
3038 | /* Volatile tables */ | 3082 | /* Volatile tables */ |
3039 | /* TODO */ | 3083 | if (sprom->fem.ghz2.antswlut < ARRAY_SIZE(b43_ntab_antswctl2g_r3)) |
3084 | ntab_upload_r3(dev, B43_NTAB_ANT_SW_CTL_R3, | ||
3085 | b43_ntab_antswctl2g_r3[sprom->fem.ghz2.antswlut]); | ||
3086 | else | ||
3087 | B43_WARN_ON(1); | ||
3040 | } | 3088 | } |
3041 | 3089 | ||
3042 | struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent( | 3090 | struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent( |
diff --git a/drivers/net/wireless/b43/tables_nphy.h b/drivers/net/wireless/b43/tables_nphy.h index ddca0ddbb857..97038c481930 100644 --- a/drivers/net/wireless/b43/tables_nphy.h +++ b/drivers/net/wireless/b43/tables_nphy.h | |||
@@ -126,6 +126,9 @@ struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent( | |||
126 | #define B43_NTAB_C1_LOFEEDTH B43_NTAB16(0x1B, 0x1C0) /* Local Oscillator Feed Through Lookup Table Core 1 */ | 126 | #define B43_NTAB_C1_LOFEEDTH B43_NTAB16(0x1B, 0x1C0) /* Local Oscillator Feed Through Lookup Table Core 1 */ |
127 | #define B43_NTAB_C1_LOFEEDTH_SIZE 128 | 127 | #define B43_NTAB_C1_LOFEEDTH_SIZE 128 |
128 | 128 | ||
129 | /* Volatile N-PHY tables, PHY revision >= 3 */ | ||
130 | #define B43_NTAB_ANT_SW_CTL_R3 B43_NTAB16( 9, 0) /* antenna software control */ | ||
131 | |||
129 | /* Static N-PHY tables, PHY revision >= 3 */ | 132 | /* Static N-PHY tables, PHY revision >= 3 */ |
130 | #define B43_NTAB_FRAMESTRUCT_R3 B43_NTAB32(10, 0) /* frame struct */ | 133 | #define B43_NTAB_FRAMESTRUCT_R3 B43_NTAB32(10, 0) /* frame struct */ |
131 | #define B43_NTAB_PILOT_R3 B43_NTAB16(11, 0) /* pilot */ | 134 | #define B43_NTAB_PILOT_R3 B43_NTAB16(11, 0) /* pilot */ |