Commit f2a6d6a0 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville

b43: N-PHY: prepare for rev3+ channel tables

Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 087de74a
...@@ -3399,7 +3399,8 @@ static int b43_nphy_set_channel(struct b43_wldev *dev, ...@@ -3399,7 +3399,8 @@ static int b43_nphy_set_channel(struct b43_wldev *dev,
u8 tmp; u8 tmp;
if (dev->phy.rev >= 3) { if (dev->phy.rev >= 3) {
/* TODO */ tabent_r3 = b43_nphy_get_chantabent_rev3(dev,
channel->center_freq);
tabent_r3 = NULL; tabent_r3 = NULL;
if (!tabent_r3) if (!tabent_r3)
return -ESRCH; return -ESRCH;
......
...@@ -325,7 +325,7 @@ void b2055_upload_inittab(struct b43_wldev *dev, ...@@ -325,7 +325,7 @@ void b2055_upload_inittab(struct b43_wldev *dev,
.phy_regs.phy_bw5 = r4, \ .phy_regs.phy_bw5 = r4, \
.phy_regs.phy_bw6 = r5 .phy_regs.phy_bw6 = r5
static const struct b43_nphy_channeltab_entry_rev2 b43_nphy_channeltab[] = { static const struct b43_nphy_channeltab_entry_rev2 b43_nphy_channeltab_rev2[] = {
{ .channel = 184, { .channel = 184,
.freq = 4920, /* MHz */ .freq = 4920, /* MHz */
.unk2 = 3280, .unk2 = 3280,
...@@ -1326,8 +1326,8 @@ b43_nphy_get_chantabent_rev2(struct b43_wldev *dev, u8 channel) ...@@ -1326,8 +1326,8 @@ b43_nphy_get_chantabent_rev2(struct b43_wldev *dev, u8 channel)
const struct b43_nphy_channeltab_entry_rev2 *e; const struct b43_nphy_channeltab_entry_rev2 *e;
unsigned int i; unsigned int i;
for (i = 0; i < ARRAY_SIZE(b43_nphy_channeltab); i++) { for (i = 0; i < ARRAY_SIZE(b43_nphy_channeltab_rev2); i++) {
e = &(b43_nphy_channeltab[i]); e = &(b43_nphy_channeltab_rev2[i]);
if (e->channel == channel) if (e->channel == channel)
return e; return e;
} }
...@@ -1335,6 +1335,24 @@ b43_nphy_get_chantabent_rev2(struct b43_wldev *dev, u8 channel) ...@@ -1335,6 +1335,24 @@ b43_nphy_get_chantabent_rev2(struct b43_wldev *dev, u8 channel)
return NULL; return NULL;
} }
static const struct b43_nphy_channeltab_entry_rev3 b43_nphy_channeltab_rev3[] = {
};
const struct b43_nphy_channeltab_entry_rev3 *
b43_nphy_get_chantabent_rev3(struct b43_wldev *dev, u16 freq)
{
const struct b43_nphy_channeltab_entry_rev3 *e;
unsigned int i;
for (i = 0; i < ARRAY_SIZE(b43_nphy_channeltab_rev3); i++) {
e = &(b43_nphy_channeltab_rev3[i]);
if (e->freq == freq)
return e;
}
return NULL;
}
static const u8 b43_ntab_adjustpower0[] = { static const u8 b43_ntab_adjustpower0[] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
......
...@@ -90,10 +90,12 @@ void b2055_upload_inittab(struct b43_wldev *dev, ...@@ -90,10 +90,12 @@ void b2055_upload_inittab(struct b43_wldev *dev,
bool ghz5, bool ignore_uploadflag); bool ghz5, bool ignore_uploadflag);
/* Get the NPHY Channel Switch Table entry for a channel number. /* Get the NPHY Channel Switch Table entry for a channel.
* Returns NULL on failure to find an entry. */ * Returns NULL on failure to find an entry. */
const struct b43_nphy_channeltab_entry_rev2 * const struct b43_nphy_channeltab_entry_rev2 *
b43_nphy_get_chantabent_rev2(struct b43_wldev *dev, u8 channel); b43_nphy_get_chantabent_rev2(struct b43_wldev *dev, u8 channel);
const struct b43_nphy_channeltab_entry_rev3 *
b43_nphy_get_chantabent_rev3(struct b43_wldev *dev, u16 freq);
/* The N-PHY tables. */ /* The N-PHY tables. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment