Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Rafał Miłecki and committed by
John W. Linville
66d80a51 9a2e85de

+52 -1
+49 -1
drivers/net/wireless/b43/tables_nphy.c
··· 2171 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 2216 /* TX gain tables */ 2175 2217 const u32 b43_ntab_tx_gain_rev0_1_2[] = { 2176 2218 0x03cc2b44, 0x03cc2b42, 0x03cc2a44, 0x03cc2a42, ··· 3048 3006 } while (0) 3049 3007 void b43_nphy_rev3plus_tables_init(struct b43_wldev *dev) 3050 3008 { 3009 + struct ssb_sprom *sprom = dev->dev->bus_sprom; 3010 + 3051 3011 /* Static tables */ 3052 3012 ntab_upload_r3(dev, B43_NTAB_FRAMESTRUCT_R3, b43_ntab_framestruct_r3); 3053 3013 ntab_upload_r3(dev, B43_NTAB_PILOT_R3, b43_ntab_pilot_r3); ··· 3080 3036 ntab_upload_r3(dev, B43_NTAB_C1_LOFEEDTH_R3, b43_ntab_loftlt1_r3); 3081 3037 3082 3038 /* Volatile tables */ 3083 - /* TODO */ 3039 + if (sprom->fem.ghz2.antswlut < ARRAY_SIZE(b43_ntab_antswctl2g_r3)) 3040 + ntab_upload_r3(dev, B43_NTAB_ANT_SW_CTL_R3, 3041 + b43_ntab_antswctl2g_r3[sprom->fem.ghz2.antswlut]); 3042 + else 3043 + B43_WARN_ON(1); 3084 3044 } 3085 3045 3086 3046 struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent(
+3
drivers/net/wireless/b43/tables_nphy.h
··· 126 126 #define B43_NTAB_C1_LOFEEDTH B43_NTAB16(0x1B, 0x1C0) /* Local Oscillator Feed Through Lookup Table Core 1 */ 127 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 132 /* Static N-PHY tables, PHY revision >= 3 */ 130 133 #define B43_NTAB_FRAMESTRUCT_R3 B43_NTAB32(10, 0) /* frame struct */ 131 134 #define B43_NTAB_PILOT_R3 B43_NTAB16(11, 0) /* pilot */