Skip to content

Commit 66d80a5

Browse files
rmileckilinvjw
authored andcommitted
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>
1 parent 9a2e85d commit 66d80a5

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

drivers/net/wireless/b43/tables_nphy.c

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2171,6 +2171,48 @@ static const u16 b43_ntab_loftlt1_r3[] = {
21712171
0x0000, 0x0000,
21722172
};
21732173

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+
21742216
/* TX gain tables */
21752217
const u32 b43_ntab_tx_gain_rev0_1_2[] = {
21762218
0x03cc2b44, 0x03cc2b42, 0x03cc2a44, 0x03cc2a42,
@@ -3006,6 +3048,8 @@ void b43_nphy_rev0_1_2_tables_init(struct b43_wldev *dev)
30063048
} while (0)
30073049
void b43_nphy_rev3plus_tables_init(struct b43_wldev *dev)
30083050
{
3051+
struct ssb_sprom *sprom = dev->dev->bus_sprom;
3052+
30093053
/* Static tables */
30103054
ntab_upload_r3(dev, B43_NTAB_FRAMESTRUCT_R3, b43_ntab_framestruct_r3);
30113055
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)
30363080
ntab_upload_r3(dev, B43_NTAB_C1_LOFEEDTH_R3, b43_ntab_loftlt1_r3);
30373081

30383082
/* 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);
30403088
}
30413089

30423090
struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent(

drivers/net/wireless/b43/tables_nphy.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent(
126126
#define B43_NTAB_C1_LOFEEDTH B43_NTAB16(0x1B, 0x1C0) /* Local Oscillator Feed Through Lookup Table Core 1 */
127127
#define B43_NTAB_C1_LOFEEDTH_SIZE 128
128128

129+
/* Volatile N-PHY tables, PHY revision >= 3 */
130+
#define B43_NTAB_ANT_SW_CTL_R3 B43_NTAB16( 9, 0) /* antenna software control */
131+
129132
/* Static N-PHY tables, PHY revision >= 3 */
130133
#define B43_NTAB_FRAMESTRUCT_R3 B43_NTAB32(10, 0) /* frame struct */
131134
#define B43_NTAB_PILOT_R3 B43_NTAB16(11, 0) /* pilot */

0 commit comments

Comments
 (0)