Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255369
b: refs/heads/master
c: c244e08
h: refs/heads/master
i:
  255367: 3a1da12
v: v3
  • Loading branch information
Rafał Miłecki authored and John W. Linville committed Jun 1, 2011
1 parent 51b9621 commit c696c19
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a18c715e63505850edd2b69ded5373d6d464cd80
refs/heads/master: c244e08c7aa30abea3c29ff17a40f4b0a58a7913
4 changes: 4 additions & 0 deletions trunk/drivers/net/wireless/b43/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev)
dev->dma_dev = sdev->dma_dev;
dev->irq = sdev->irq;

dev->chip_id = sdev->bus->chip_id;
dev->chip_rev = sdev->bus->chip_rev;
dev->chip_pkg = sdev->bus->chip_package;

dev->bus_sprom = &sdev->bus->sprom;

dev->core_id = sdev->id.coreid;
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/net/wireless/b43/bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ struct b43_bus_dev {
struct device *dma_dev;
unsigned int irq;

u16 chip_id;
u8 chip_rev;
u8 chip_pkg;

struct ssb_sprom *bus_sprom;

u16 core_id;
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/net/wireless/b43/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2588,7 +2588,7 @@ static int b43_gpio_init(struct b43_wldev *dev)

mask = 0x0000001F;
set = 0x0000000F;
if (dev->sdev->bus->chip_id == 0x4301) {
if (dev->dev->chip_id == 0x4301) {
mask |= 0x0060;
set |= 0x0060;
}
Expand Down Expand Up @@ -2748,8 +2748,8 @@ static void b43_adjust_opmode(struct b43_wldev *dev)

cfp_pretbtt = 2;
if ((ctl & B43_MACCTL_INFRA) && !(ctl & B43_MACCTL_AP)) {
if (dev->sdev->bus->chip_id == 0x4306 &&
dev->sdev->bus->chip_rev == 3)
if (dev->dev->chip_id == 0x4306 &&
dev->dev->chip_rev == 3)
cfp_pretbtt = 100;
else
cfp_pretbtt = 50;
Expand Down Expand Up @@ -4096,10 +4096,10 @@ static int b43_phy_versioning(struct b43_wldev *dev)
analog_type, phy_type, phy_rev);

/* Get RADIO versioning */
if (dev->sdev->bus->chip_id == 0x4317) {
if (dev->sdev->bus->chip_rev == 0)
if (dev->dev->chip_id == 0x4317) {
if (dev->dev->chip_rev == 0)
tmp = 0x3205017F;
else if (dev->sdev->bus->chip_rev == 1)
else if (dev->dev->chip_rev == 1)
tmp = 0x4205017F;
else
tmp = 0x5205017F;
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/wireless/b43/phy_g.c
Original file line number Diff line number Diff line change
Expand Up @@ -2088,8 +2088,8 @@ static void b43_phy_initg(struct b43_wldev *dev)
/* FIXME: The spec says in the following if, the 0 should be replaced
'if OFDM may not be used in the current locale'
but OFDM is legal everywhere */
if ((dev->sdev->bus->chip_id == 0x4306
&& dev->sdev->bus->chip_package == 2) || 0) {
if ((dev->dev->chip_id == 0x4306
&& dev->dev->chip_pkg == 2) || 0) {
b43_phy_mask(dev, B43_PHY_CRS0, 0xBFFF);
b43_phy_mask(dev, B43_PHY_OFDM(0xC3), 0x7FFF);
}
Expand Down Expand Up @@ -2203,7 +2203,7 @@ static void default_radio_attenuation(struct b43_wldev *dev,
&& bus->boardinfo.type ==
SSB_BOARD_BU4306)
rf->att = 5;
else if (bus->chip_id == 0x4320)
else if (dev->dev->chip_id == 0x4320)
rf->att = 4;
else
rf->att = 3;
Expand Down Expand Up @@ -2388,7 +2388,7 @@ static int b43_gphy_init_tssi2dbm_table(struct b43_wldev *dev)
pab1 = (s16) (dev->dev->bus_sprom->pa0b1);
pab2 = (s16) (dev->dev->bus_sprom->pa0b2);

B43_WARN_ON((dev->sdev->bus->chip_id == 0x4301) &&
B43_WARN_ON((dev->dev->chip_id == 0x4301) &&
(phy->radio_ver != 0x2050)); /* Not supported anymore */

gphy->dyn_tssi_tbl = 0;
Expand Down
22 changes: 9 additions & 13 deletions trunk/drivers/net/wireless/b43/phy_lp.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_8, B43_LPPHY_TR_LOOKUP_4);
}
if ((sprom->boardflags_hi & B43_BFH_FEM_BT) &&
(bus->chip_id == 0x5354) &&
(bus->chip_package == SSB_CHIPPACK_BCM4712S)) {
(dev->dev->chip_id == 0x5354) &&
(dev->dev->chip_pkg == SSB_CHIPPACK_BCM4712S)) {
b43_phy_set(dev, B43_LPPHY_CRSGAIN_CTL, 0x0006);
b43_phy_write(dev, B43_LPPHY_GPIO_SELECT, 0x0005);
b43_phy_write(dev, B43_LPPHY_GPIO_OUTEN, 0xFFFF);
Expand Down Expand Up @@ -450,7 +450,7 @@ static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev)
b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFC1F, 0xA0);
b43_phy_maskset(dev, B43_LPPHY_GAINDIRECTMISMATCH, 0xE0FF, 0x300);
b43_phy_maskset(dev, B43_LPPHY_HIGAINDB, 0x00FF, 0x2A00);
if ((bus->chip_id == 0x4325) && (bus->chip_rev == 0)) {
if ((dev->dev->chip_id == 0x4325) && (dev->dev->chip_rev == 0)) {
b43_phy_maskset(dev, B43_LPPHY_LOWGAINDB, 0x00FF, 0x2100);
b43_phy_maskset(dev, B43_LPPHY_VERYLOWGAINDB, 0xFF00, 0xA);
} else {
Expand All @@ -468,7 +468,7 @@ static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev)
b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFFE0, 0x12);
b43_phy_maskset(dev, B43_LPPHY_GAINMISMATCH, 0x0FFF, 0x9000);

if ((bus->chip_id == 0x4325) && (bus->chip_rev == 0)) {
if ((dev->dev->chip_id == 0x4325) && (dev->dev->chip_rev == 0)) {
b43_lptab_write(dev, B43_LPTAB16(0x08, 0x14), 0);
b43_lptab_write(dev, B43_LPTAB16(0x08, 0x12), 0x40);
}
Expand All @@ -493,7 +493,7 @@ static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev)
0x2000 | ((u16)lpphy->rssi_gs << 10) |
((u16)lpphy->rssi_vc << 4) | lpphy->rssi_vf);

if ((bus->chip_id == 0x4325) && (bus->chip_rev == 0)) {
if ((dev->dev->chip_id == 0x4325) && (dev->dev->chip_rev == 0)) {
b43_phy_set(dev, B43_LPPHY_AFE_ADC_CTL_0, 0x1C);
b43_phy_maskset(dev, B43_LPPHY_AFE_CTL, 0x00FF, 0x8800);
b43_phy_maskset(dev, B43_LPPHY_AFE_ADC_CTL_1, 0xFC3C, 0x0400);
Expand Down Expand Up @@ -698,7 +698,7 @@ static void lpphy_radio_init(struct b43_wldev *dev)
lpphy_sync_stx(dev);
b43_phy_write(dev, B43_PHY_OFDM(0xF0), 0x5F80);
b43_phy_write(dev, B43_PHY_OFDM(0xF1), 0);
if (dev->sdev->bus->chip_id == 0x4325) {
if (dev->dev->chip_id == 0x4325) {
// TODO SSB PMU recalibration
}
}
Expand Down Expand Up @@ -1841,7 +1841,6 @@ static void lpphy_papd_cal(struct b43_wldev *dev, struct lpphy_tx_gains gains,
static void lpphy_papd_cal_txpwr(struct b43_wldev *dev)
{
struct b43_phy_lp *lpphy = dev->phy.lp;
struct ssb_bus *bus = dev->sdev->bus;
struct lpphy_tx_gains gains, oldgains;
int old_txpctl, old_afe_ovr, old_rf, old_bbmult;

Expand All @@ -1855,7 +1854,7 @@ static void lpphy_papd_cal_txpwr(struct b43_wldev *dev)

lpphy_set_tx_power_control(dev, B43_LPPHY_TXPCTL_OFF);

if (bus->chip_id == 0x4325 && bus->chip_rev == 0)
if (dev->dev->chip_id == 0x4325 && dev->dev->chip_rev == 0)
lpphy_papd_cal(dev, gains, 0, 1, 30);
else
lpphy_papd_cal(dev, gains, 0, 1, 65);
Expand All @@ -1871,7 +1870,6 @@ static int lpphy_rx_iq_cal(struct b43_wldev *dev, bool noise, bool tx,
bool rx, bool pa, struct lpphy_tx_gains *gains)
{
struct b43_phy_lp *lpphy = dev->phy.lp;
struct ssb_bus *bus = dev->sdev->bus;
const struct lpphy_rx_iq_comp *iqcomp = NULL;
struct lpphy_tx_gains nogains, oldgains;
u16 tmp;
Expand All @@ -1880,7 +1878,7 @@ static int lpphy_rx_iq_cal(struct b43_wldev *dev, bool noise, bool tx,
memset(&nogains, 0, sizeof(nogains));
memset(&oldgains, 0, sizeof(oldgains));

if (bus->chip_id == 0x5354) {
if (dev->dev->chip_id == 0x5354) {
for (i = 0; i < ARRAY_SIZE(lpphy_5354_iq_table); i++) {
if (lpphy_5354_iq_table[i].chan == lpphy->channel) {
iqcomp = &lpphy_5354_iq_table[i];
Expand Down Expand Up @@ -2409,11 +2407,9 @@ static const struct b206x_channel b2063_chantbl[] = {

static void lpphy_b2062_reset_pll_bias(struct b43_wldev *dev)
{
struct ssb_bus *bus = dev->sdev->bus;

b43_radio_write(dev, B2062_S_RFPLL_CTL2, 0xFF);
udelay(20);
if (bus->chip_id == 0x5354) {
if (dev->dev->chip_id == 0x5354) {
b43_radio_write(dev, B2062_N_COMM1, 4);
b43_radio_write(dev, B2062_S_RFPLL_CTL2, 4);
} else {
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/wireless/b43/tables_lpphy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2304,7 +2304,6 @@ void lpphy_rev0_1_table_init(struct b43_wldev *dev)

void lpphy_rev2plus_table_init(struct b43_wldev *dev)
{
struct ssb_bus *bus = dev->sdev->bus;
int i;

B43_WARN_ON(dev->phy.rev < 2);
Expand Down Expand Up @@ -2341,7 +2340,7 @@ void lpphy_rev2plus_table_init(struct b43_wldev *dev)
b43_lptab_write_bulk(dev, B43_LPTAB32(10, 0),
ARRAY_SIZE(lpphy_papd_mult_table), lpphy_papd_mult_table);

if ((bus->chip_id == 0x4325) && (bus->chip_rev == 0)) {
if ((dev->dev->chip_id == 0x4325) && (dev->dev->chip_rev == 0)) {
b43_lptab_write_bulk(dev, B43_LPTAB32(13, 0),
ARRAY_SIZE(lpphy_a0_gain_idx_table), lpphy_a0_gain_idx_table);
b43_lptab_write_bulk(dev, B43_LPTAB16(14, 0),
Expand Down

0 comments on commit c696c19

Please sign in to comment.