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

b43: N-PHY: use b43_phy_n_sfo_cfg rather than duplicating same fields

Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d817f4e1
...@@ -141,7 +141,7 @@ static void b43_chantab_radio_upload(struct b43_wldev *dev, ...@@ -141,7 +141,7 @@ static void b43_chantab_radio_upload(struct b43_wldev *dev,
} }
static void b43_chantab_phy_upload(struct b43_wldev *dev, static void b43_chantab_phy_upload(struct b43_wldev *dev,
const struct b43_nphy_channeltab_entry *e) const struct b43_phy_n_sfo_cfg *e)
{ {
b43_phy_write(dev, B43_NPHY_BW1A, e->phy_bw1a); b43_phy_write(dev, B43_NPHY_BW1A, e->phy_bw1a);
b43_phy_write(dev, B43_NPHY_BW2, e->phy_bw2); b43_phy_write(dev, B43_NPHY_BW2, e->phy_bw2);
...@@ -3270,7 +3270,7 @@ int b43_phy_initn(struct b43_wldev *dev) ...@@ -3270,7 +3270,7 @@ int b43_phy_initn(struct b43_wldev *dev)
/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ChanspecSetup */ /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ChanspecSetup */
static void b43_nphy_chanspec_setup(struct b43_wldev *dev, static void b43_nphy_chanspec_setup(struct b43_wldev *dev,
const struct b43_nphy_channeltab_entry *e, const struct b43_phy_n_sfo_cfg *e,
struct b43_chanspec chanspec) struct b43_chanspec chanspec)
{ {
struct b43_phy *phy = &dev->phy; struct b43_phy *phy = &dev->phy;
...@@ -3373,7 +3373,7 @@ static int b43_nphy_set_chanspec(struct b43_wldev *dev, ...@@ -3373,7 +3373,7 @@ static int b43_nphy_set_chanspec(struct b43_wldev *dev,
tmp = (chanspec.b_freq == 1) ? 0x0020 : 0x0050; tmp = (chanspec.b_freq == 1) ? 0x0020 : 0x0050;
b43_radio_maskset(dev, B2055_MASTER1, 0xFF8F, tmp); b43_radio_maskset(dev, B2055_MASTER1, 0xFF8F, tmp);
b43_radio_2055_setup(dev, tabent); b43_radio_2055_setup(dev, tabent);
b43_nphy_chanspec_setup(dev, tabent, chanspec); b43_nphy_chanspec_setup(dev, &(tabent->phy_regs), chanspec);
} }
return 0; return 0;
......
...@@ -318,12 +318,12 @@ void b2055_upload_inittab(struct b43_wldev *dev, ...@@ -318,12 +318,12 @@ void b2055_upload_inittab(struct b43_wldev *dev,
.radio_c2_tx_mxbgtrim = r21 .radio_c2_tx_mxbgtrim = r21
#define PHYREGS(r0, r1, r2, r3, r4, r5) \ #define PHYREGS(r0, r1, r2, r3, r4, r5) \
.phy_bw1a = r0, \ .phy_regs.phy_bw1a = r0, \
.phy_bw2 = r1, \ .phy_regs.phy_bw2 = r1, \
.phy_bw3 = r2, \ .phy_regs.phy_bw3 = r2, \
.phy_bw4 = r3, \ .phy_regs.phy_bw4 = r3, \
.phy_bw5 = r4, \ .phy_regs.phy_bw5 = r4, \
.phy_bw6 = r5 .phy_regs.phy_bw6 = r5
static const struct b43_nphy_channeltab_entry b43_nphy_channeltab[] = { static const struct b43_nphy_channeltab_entry b43_nphy_channeltab[] = {
{ .channel = 184, { .channel = 184,
......
...@@ -16,6 +16,10 @@ struct b43_phy_n_sfo_cfg { ...@@ -16,6 +16,10 @@ struct b43_phy_n_sfo_cfg {
struct b43_nphy_channeltab_entry { struct b43_nphy_channeltab_entry {
/* The channel number */ /* The channel number */
u8 channel; u8 channel;
/* The channel frequency in MHz */
u16 freq;
/* An unknown value */
u16 unk2;
/* Radio register values on channelswitch */ /* Radio register values on channelswitch */
u8 radio_pll_ref; u8 radio_pll_ref;
u8 radio_rf_pllmod0; u8 radio_rf_pllmod0;
...@@ -40,16 +44,7 @@ struct b43_nphy_channeltab_entry { ...@@ -40,16 +44,7 @@ struct b43_nphy_channeltab_entry {
u8 radio_c2_tx_pgapadtn; u8 radio_c2_tx_pgapadtn;
u8 radio_c2_tx_mxbgtrim; u8 radio_c2_tx_mxbgtrim;
/* PHY register values on channelswitch */ /* PHY register values on channelswitch */
u16 phy_bw1a; struct b43_phy_n_sfo_cfg phy_regs;
u16 phy_bw2;
u16 phy_bw3;
u16 phy_bw4;
u16 phy_bw5;
u16 phy_bw6;
/* The channel frequency in MHz */
u16 freq;
/* An unknown value */
u16 unk2;
}; };
......
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