aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2010-03-28 18:53:15 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-03-31 14:39:19 -0400
commitf19ebe7d772a3b48743fa798ad979a4ee3cb64e2 (patch)
tree7f0216e4dc449edda0f2d6b7a8676ddb53cbf594 /drivers
parentffd2d9bdac1a0a5d3184e085ea1bd3060b4166fe (diff)
b43: N-PHY: prepare for rev3+ channel tables
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/b43/phy_n.c22
-rw-r--r--drivers/net/wireless/b43/tables_nphy.c8
-rw-r--r--drivers/net/wireless/b43/tables_nphy.h17
3 files changed, 31 insertions, 16 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index d9e47ba5e15..34f80c452f7 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -104,7 +104,7 @@ static enum b43_txpwr_result b43_nphy_op_recalc_txpower(struct b43_wldev *dev,
104} 104}
105 105
106static void b43_chantab_radio_upload(struct b43_wldev *dev, 106static void b43_chantab_radio_upload(struct b43_wldev *dev,
107 const struct b43_nphy_channeltab_entry *e) 107 const struct b43_nphy_channeltab_entry_rev2 *e)
108{ 108{
109 b43_radio_write(dev, B2055_PLL_REF, e->radio_pll_ref); 109 b43_radio_write(dev, B2055_PLL_REF, e->radio_pll_ref);
110 b43_radio_write(dev, B2055_RF_PLLMOD0, e->radio_rf_pllmod0); 110 b43_radio_write(dev, B2055_RF_PLLMOD0, e->radio_rf_pllmod0);
@@ -159,7 +159,7 @@ static void b43_nphy_tx_power_fix(struct b43_wldev *dev)
159 159
160/* http://bcm-v4.sipsolutions.net/802.11/PHY/Radio/2055Setup */ 160/* http://bcm-v4.sipsolutions.net/802.11/PHY/Radio/2055Setup */
161static void b43_radio_2055_setup(struct b43_wldev *dev, 161static void b43_radio_2055_setup(struct b43_wldev *dev,
162 const struct b43_nphy_channeltab_entry *e) 162 const struct b43_nphy_channeltab_entry_rev2 *e)
163{ 163{
164 B43_WARN_ON(dev->phy.rev >= 3); 164 B43_WARN_ON(dev->phy.rev >= 3);
165 165
@@ -3336,16 +3336,20 @@ static int b43_nphy_set_chanspec(struct b43_wldev *dev,
3336{ 3336{
3337 struct b43_phy_n *nphy = dev->phy.n; 3337 struct b43_phy_n *nphy = dev->phy.n;
3338 3338
3339 const struct b43_nphy_channeltab_entry *tabent; 3339 const struct b43_nphy_channeltab_entry_rev2 *tabent_r2;
3340 const struct b43_nphy_channeltab_entry_rev3 *tabent_r3;
3340 3341
3341 u8 tmp; 3342 u8 tmp;
3342 u8 channel = chanspec.channel; 3343 u8 channel = chanspec.channel;
3343 3344
3344 if (dev->phy.rev >= 3) { 3345 if (dev->phy.rev >= 3) {
3345 /* TODO */ 3346 /* TODO */
3347 tabent_r3 = NULL;
3348 if (!tabent_r3)
3349 return -ESRCH;
3346 } else { 3350 } else {
3347 tabent = b43_nphy_get_chantabent(dev, channel); 3351 tabent_r2 = b43_nphy_get_chantabent_rev2(dev, channel);
3348 if (!tabent) 3352 if (!tabent_r2)
3349 return -ESRCH; 3353 return -ESRCH;
3350 } 3354 }
3351 3355
@@ -3367,13 +3371,13 @@ static int b43_nphy_set_chanspec(struct b43_wldev *dev,
3367 if (dev->phy.rev >= 3) { 3371 if (dev->phy.rev >= 3) {
3368 tmp = (chanspec.b_freq == 1) ? 4 : 0; 3372 tmp = (chanspec.b_freq == 1) ? 4 : 0;
3369 b43_radio_maskset(dev, 0x08, 0xFFFB, tmp); 3373 b43_radio_maskset(dev, 0x08, 0xFFFB, tmp);
3370 /* TODO: PHY Radio2056 Setup (chan_info_ptr[i]) */ 3374 /* TODO: PHY Radio2056 Setup (dev, tabent_r3); */
3371 /* TODO: N PHY Chanspec Setup (chan_info_ptr[i]) */ 3375 b43_nphy_chanspec_setup(dev, &(tabent_r3->phy_regs), chanspec);
3372 } else { 3376 } else {
3373 tmp = (chanspec.b_freq == 1) ? 0x0020 : 0x0050; 3377 tmp = (chanspec.b_freq == 1) ? 0x0020 : 0x0050;
3374 b43_radio_maskset(dev, B2055_MASTER1, 0xFF8F, tmp); 3378 b43_radio_maskset(dev, B2055_MASTER1, 0xFF8F, tmp);
3375 b43_radio_2055_setup(dev, tabent); 3379 b43_radio_2055_setup(dev, tabent_r2);
3376 b43_nphy_chanspec_setup(dev, &(tabent->phy_regs), chanspec); 3380 b43_nphy_chanspec_setup(dev, &(tabent_r2->phy_regs), chanspec);
3377 } 3381 }
3378 3382
3379 return 0; 3383 return 0;
diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c
index 237426d64ad..d96e870ab8f 100644
--- a/drivers/net/wireless/b43/tables_nphy.c
+++ b/drivers/net/wireless/b43/tables_nphy.c
@@ -325,7 +325,7 @@ void b2055_upload_inittab(struct b43_wldev *dev,
325 .phy_regs.phy_bw5 = r4, \ 325 .phy_regs.phy_bw5 = r4, \
326 .phy_regs.phy_bw6 = r5 326 .phy_regs.phy_bw6 = r5
327 327
328static const struct b43_nphy_channeltab_entry b43_nphy_channeltab[] = { 328static const struct b43_nphy_channeltab_entry_rev2 b43_nphy_channeltab[] = {
329 { .channel = 184, 329 { .channel = 184,
330 .freq = 4920, /* MHz */ 330 .freq = 4920, /* MHz */
331 .unk2 = 3280, 331 .unk2 = 3280,
@@ -1320,10 +1320,10 @@ static const struct b43_nphy_channeltab_entry b43_nphy_channeltab[] = {
1320 }, 1320 },
1321}; 1321};
1322 1322
1323const struct b43_nphy_channeltab_entry * 1323const struct b43_nphy_channeltab_entry_rev2 *
1324b43_nphy_get_chantabent(struct b43_wldev *dev, u8 channel) 1324b43_nphy_get_chantabent_rev2(struct b43_wldev *dev, u8 channel)
1325{ 1325{
1326 const struct b43_nphy_channeltab_entry *e; 1326 const struct b43_nphy_channeltab_entry_rev2 *e;
1327 unsigned int i; 1327 unsigned int i;
1328 1328
1329 for (i = 0; i < ARRAY_SIZE(b43_nphy_channeltab); i++) { 1329 for (i = 0; i < ARRAY_SIZE(b43_nphy_channeltab); i++) {
diff --git a/drivers/net/wireless/b43/tables_nphy.h b/drivers/net/wireless/b43/tables_nphy.h
index 84dea356d85..8fc1da9f8fe 100644
--- a/drivers/net/wireless/b43/tables_nphy.h
+++ b/drivers/net/wireless/b43/tables_nphy.h
@@ -13,7 +13,7 @@ struct b43_phy_n_sfo_cfg {
13 u16 phy_bw6; 13 u16 phy_bw6;
14}; 14};
15 15
16struct b43_nphy_channeltab_entry { 16struct b43_nphy_channeltab_entry_rev2 {
17 /* The channel number */ 17 /* The channel number */
18 u8 channel; 18 u8 channel;
19 /* The channel frequency in MHz */ 19 /* The channel frequency in MHz */
@@ -47,6 +47,17 @@ struct b43_nphy_channeltab_entry {
47 struct b43_phy_n_sfo_cfg phy_regs; 47 struct b43_phy_n_sfo_cfg phy_regs;
48}; 48};
49 49
50struct b43_nphy_channeltab_entry_rev3 {
51 /* The channel number */
52 u8 channel;
53 /* The channel frequency in MHz */
54 u16 freq;
55 /* Radio register values on channelswitch */
56 /* TODO */
57 /* PHY register values on channelswitch */
58 struct b43_phy_n_sfo_cfg phy_regs;
59};
60
50 61
51struct b43_wldev; 62struct b43_wldev;
52 63
@@ -81,8 +92,8 @@ void b2055_upload_inittab(struct b43_wldev *dev,
81 92
82/* Get the NPHY Channel Switch Table entry for a channel number. 93/* Get the NPHY Channel Switch Table entry for a channel number.
83 * Returns NULL on failure to find an entry. */ 94 * Returns NULL on failure to find an entry. */
84const struct b43_nphy_channeltab_entry * 95const struct b43_nphy_channeltab_entry_rev2 *
85b43_nphy_get_chantabent(struct b43_wldev *dev, u8 channel); 96b43_nphy_get_chantabent_rev2(struct b43_wldev *dev, u8 channel);
86 97
87 98
88/* The N-PHY tables. */ 99/* The N-PHY tables. */