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

b43: N-PHY: add writing one element tables

Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d713804c
...@@ -808,8 +808,7 @@ static void b43_nphy_stop_playback(struct b43_wldev *dev) ...@@ -808,8 +808,7 @@ static void b43_nphy_stop_playback(struct b43_wldev *dev)
if (nphy->bb_mult_save & 0x80000000) { if (nphy->bb_mult_save & 0x80000000) {
tmp = nphy->bb_mult_save & 0xFFFF; tmp = nphy->bb_mult_save & 0xFFFF;
/* TODO: Write an N PHY Table with ID 15, length 1, offset 87, b43_ntab_write(dev, B43_NTAB16(15, 87), tmp);
width 16 and data from tmp */
nphy->bb_mult_save = 0; nphy->bb_mult_save = 0;
} }
...@@ -1486,13 +1485,11 @@ static void b43_nphy_update_tx_cal_ladder(struct b43_wldev *dev, u16 core) ...@@ -1486,13 +1485,11 @@ static void b43_nphy_update_tx_cal_ladder(struct b43_wldev *dev, u16 core)
for (i = 0; i < 18; i++) { for (i = 0; i < 18; i++) {
scale = (ladder_lo[i].percent * tmp) / 100; scale = (ladder_lo[i].percent * tmp) / 100;
entry = ((scale & 0xFF) << 8) | ladder_lo[i].g_env; entry = ((scale & 0xFF) << 8) | ladder_lo[i].g_env;
/* TODO: Write an N PHY Table with ID 15, length 1, b43_ntab_write(dev, B43_NTAB16(15, i), entry);
offset i, width 16, and data entry */
scale = (ladder_iq[i].percent * tmp) / 100; scale = (ladder_iq[i].percent * tmp) / 100;
entry = ((scale & 0xFF) << 8) | ladder_iq[i].g_env; entry = ((scale & 0xFF) << 8) | ladder_iq[i].g_env;
/* TODO: Write an N PHY Table with ID 15, length 1, b43_ntab_write(dev, B43_NTAB16(15, i + 32), entry);
offset i + 32, width 16, and data entry */
} }
} }
...@@ -1590,10 +1587,8 @@ static void b43_nphy_tx_cal_phy_cleanup(struct b43_wldev *dev) ...@@ -1590,10 +1587,8 @@ static void b43_nphy_tx_cal_phy_cleanup(struct b43_wldev *dev)
b43_phy_write(dev, B43_NPHY_AFECTL_OVER1, regs[2]); b43_phy_write(dev, B43_NPHY_AFECTL_OVER1, regs[2]);
b43_phy_write(dev, B43_NPHY_AFECTL_OVER, regs[3]); b43_phy_write(dev, B43_NPHY_AFECTL_OVER, regs[3]);
b43_phy_write(dev, B43_NPHY_BBCFG, regs[4]); b43_phy_write(dev, B43_NPHY_BBCFG, regs[4]);
/* TODO: Write an N PHY Table with ID 8, length 1, offset 3, b43_ntab_write(dev, B43_NTAB16(8, 3), regs[5]);
width 16, and data from regs[5] */ b43_ntab_write(dev, B43_NTAB16(8, 19), regs[6]);
/* TODO: Write an N PHY Table with ID 8, length 1, offset 19,
width 16, and data from regs[6] */
b43_phy_write(dev, B43_NPHY_RFCTL_INTC1, regs[7]); b43_phy_write(dev, B43_NPHY_RFCTL_INTC1, regs[7]);
b43_phy_write(dev, B43_NPHY_RFCTL_INTC2, regs[8]); b43_phy_write(dev, B43_NPHY_RFCTL_INTC2, regs[8]);
b43_phy_write(dev, B43_NPHY_PAPD_EN0, regs[9]); b43_phy_write(dev, B43_NPHY_PAPD_EN0, regs[9]);
...@@ -1603,10 +1598,8 @@ static void b43_nphy_tx_cal_phy_cleanup(struct b43_wldev *dev) ...@@ -1603,10 +1598,8 @@ static void b43_nphy_tx_cal_phy_cleanup(struct b43_wldev *dev)
b43_phy_maskset(dev, B43_NPHY_AFECTL_C1, 0x0FFF, regs[0]); b43_phy_maskset(dev, B43_NPHY_AFECTL_C1, 0x0FFF, regs[0]);
b43_phy_maskset(dev, B43_NPHY_AFECTL_C2, 0x0FFF, regs[1]); b43_phy_maskset(dev, B43_NPHY_AFECTL_C2, 0x0FFF, regs[1]);
b43_phy_write(dev, B43_NPHY_AFECTL_OVER, regs[2]); b43_phy_write(dev, B43_NPHY_AFECTL_OVER, regs[2]);
/* TODO: Write an N PHY Table with ID 8, length 1, offset 2, b43_ntab_write(dev, B43_NTAB16(8, 2), regs[3]);
width 16, and data from regs[3] */ b43_ntab_write(dev, B43_NTAB16(8, 18), regs[4]);
/* TODO: Write an N PHY Table with ID 8, length 1, offset 18,
width 16, and data from regs[4] */
b43_phy_write(dev, B43_NPHY_RFCTL_INTC1, regs[5]); b43_phy_write(dev, B43_NPHY_RFCTL_INTC1, regs[5]);
b43_phy_write(dev, B43_NPHY_RFCTL_INTC2, regs[6]); b43_phy_write(dev, B43_NPHY_RFCTL_INTC2, regs[6]);
} }
...@@ -1638,15 +1631,11 @@ static void b43_nphy_tx_cal_phy_setup(struct b43_wldev *dev) ...@@ -1638,15 +1631,11 @@ static void b43_nphy_tx_cal_phy_setup(struct b43_wldev *dev)
/* TODO: Read an N PHY Table with ID 8, length 1, offset 3, /* TODO: Read an N PHY Table with ID 8, length 1, offset 3,
width 16, and data pointing to tmp */ width 16, and data pointing to tmp */
regs[5] = tmp; regs[5] = tmp;
b43_ntab_write(dev, B43_NTAB16(8, 3), 0);
/* TODO: Write an N PHY Table with ID 8, length 1, offset 3,
width 16, and data 0 */
/* TODO: Read an N PHY Table with ID 8, length 1, offset 19, /* TODO: Read an N PHY Table with ID 8, length 1, offset 19,
width 16, and data pointing to tmp */ width 16, and data pointing to tmp */
regs[6] = tmp; regs[6] = tmp;
b43_ntab_write(dev, B43_NTAB16(8, 19), 0);
/* TODO: Write an N PHY Table with ID 8, length 1, offset 19,
width 16, and data 0 */
regs[7] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC1); regs[7] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC1);
regs[8] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC2); regs[8] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC2);
...@@ -1668,14 +1657,12 @@ static void b43_nphy_tx_cal_phy_setup(struct b43_wldev *dev) ...@@ -1668,14 +1657,12 @@ static void b43_nphy_tx_cal_phy_setup(struct b43_wldev *dev)
width 16, and data pointing to tmp */ width 16, and data pointing to tmp */
regs[3] = tmp; regs[3] = tmp;
tmp |= 0x2000; tmp |= 0x2000;
/* TODO: Write an N PHY Table with ID 8, length 1, offset 2, b43_ntab_write(dev, B43_NTAB16(8, 2), tmp);
width 16, and data pointer tmp */
/* TODO: Read an N PHY Table with ID 8, length 1, offset 18, /* TODO: Read an N PHY Table with ID 8, length 1, offset 18,
width 16, and data pointer tmp */ width 16, and data pointer tmp */
regs[4] = tmp; regs[4] = tmp;
tmp |= 0x2000; tmp |= 0x2000;
/* TODO: Write an N PHY Table with ID 8, length 1, offset 18, b43_ntab_write(dev, B43_NTAB16(8, 18), tmp);
width 16, and data pointer tmp */
regs[5] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC1); regs[5] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC1);
regs[6] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC2); regs[6] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC2);
if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ)
...@@ -1900,9 +1887,8 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev, ...@@ -1900,9 +1887,8 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
width 16, and data pointer buffer */ width 16, and data pointer buffer */
diq_start = buffer[0]; diq_start = buffer[0];
buffer[0] = 0; buffer[0] = 0;
/* TODO: Write an N PHY Table with ID 15, b43_ntab_write(dev, B43_NTAB16(15, 69 + core),
length 1, offset 69 + core, width 16, 0);
and data of 0 */
} }
b43_phy_write(dev, B43_NPHY_IQLOCAL_CMD, cmd); b43_phy_write(dev, B43_NPHY_IQLOCAL_CMD, cmd);
......
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