Skip to content

Commit ea422b2

Browse files
rmileckilinvjw
authored andcommitted
b43: HT-PHY: Complete radio init (add missing entries)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 28f051f commit ea422b2

3 files changed

Lines changed: 30 additions & 2 deletions

File tree

‎drivers/net/wireless/b43/phy_ht.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ static void b43_radio_2059_init(struct b43_wldev *dev)
160160
/* Prepare (reset?) radio */
161161
b43_radio_2059_init_pre(dev);
162162

163-
b43_radio_write(dev, R2059_ALL | 0x51, 0x0070);
164-
b43_radio_write(dev, R2059_ALL | 0x5a, 0x0003);
163+
r2059_upload_inittabs(dev);
165164

166165
for (i = 0; i < ARRAY_SIZE(routing); i++)
167166
b43_radio_set(dev, routing[i] | 0x146, 0x3);

‎drivers/net/wireless/b43/radio_2059.c‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
#include "b43.h"
2626
#include "radio_2059.h"
2727

28+
/* Extracted from MMIO dump of 6.30.223.141 */
29+
static u16 r2059_phy_rev1_init[][2] = {
30+
{ 0x051, 0x70 }, { 0x05a, 0x03 }, { 0x079, 0x01 }, { 0x082, 0x70 },
31+
{ 0x083, 0x00 }, { 0x084, 0x70 }, { 0x09a, 0x7f }, { 0x0b6, 0x10 },
32+
{ 0x188, 0x05 },
33+
};
34+
2835
#define RADIOREGS(r00, r01, r02, r03, r04, r05, r06, r07, r08, r09, \
2936
r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, \
3037
r20) \
@@ -139,6 +146,26 @@ static const struct b43_phy_ht_channeltab_e_radio2059 b43_phy_ht_channeltab_radi
139146
},
140147
};
141148

149+
void r2059_upload_inittabs(struct b43_wldev *dev)
150+
{
151+
struct b43_phy *phy = &dev->phy;
152+
u16 *table = NULL;
153+
u16 size, i;
154+
155+
switch (phy->rev) {
156+
case 1:
157+
table = r2059_phy_rev1_init[0];
158+
size = ARRAY_SIZE(r2059_phy_rev1_init);
159+
break;
160+
default:
161+
B43_WARN_ON(1);
162+
return;
163+
}
164+
165+
for (i = 0; i < size; i++, table += 2)
166+
b43_radio_write(dev, R2059_ALL | table[0], table[1]);
167+
}
168+
142169
const struct b43_phy_ht_channeltab_e_radio2059
143170
*b43_phy_ht_get_channeltab_e_r2059(struct b43_wldev *dev, u16 freq)
144171
{

‎drivers/net/wireless/b43/radio_2059.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ struct b43_phy_ht_channeltab_e_radio2059 {
5252
struct b43_phy_ht_channeltab_e_phy phy_regs;
5353
};
5454

55+
void r2059_upload_inittabs(struct b43_wldev *dev);
56+
5557
const struct b43_phy_ht_channeltab_e_radio2059
5658
*b43_phy_ht_get_channeltab_e_r2059(struct b43_wldev *dev, u16 freq);
5759

0 commit comments

Comments
 (0)