Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79101
b: refs/heads/master
c: 8ed7fc4
h: refs/heads/master
i:
  79099: cbe62df
v: v3
  • Loading branch information
Michael Buesch authored and David S. Miller committed Jan 28, 2008
1 parent 4248ea2 commit fb661c0
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 23 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: bb54244be7d12c2a5985226061d598edb49c9078
refs/heads/master: 8ed7fc48eb31e583bb31c2bcfdd3a9c557bad5d0
14 changes: 10 additions & 4 deletions trunk/drivers/net/wireless/b43/b43.h
Original file line number Diff line number Diff line change
Expand Up @@ -547,12 +547,18 @@ struct b43_phy {

u16 initval; //FIXME rename?

/* OFDM address read/write caching for hardware auto-increment. */
u16 ofdm_addr;
u8 ofdm_valid; /* 0: invalid, 1: read, 2: write */

/* PHY TX errors counter. */
atomic_t txerr_cnt;

/* The device does address auto increment for the OFDM tables.
* We cache the previously used address here and omit the address
* write on the next table access, if possible. */
u16 ofdmtab_addr; /* The address currently set in hardware. */
enum { /* The last data flow direction. */
B43_OFDMTAB_DIRECTION_UNKNOWN = 0,
B43_OFDMTAB_DIRECTION_READ,
B43_OFDMTAB_DIRECTION_WRITE,
} ofdmtab_addr_direction;
};

/* Data structures for DMA transmission, per 80211 core. */
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 @@ -2264,12 +2264,6 @@ static int b43_chip_init(struct b43_wldev *dev)
b43_write16(dev, B43_MMIO_POWERUP_DELAY,
dev->dev->bus->chipco.fast_pwrup_delay);

/* OFDM address caching. */
phy->ofdm_valid = 0;

/* PHY TX errors counter. */
atomic_set(&phy->txerr_cnt, B43_PHY_TX_BADNESS_LIMIT);

err = 0;
b43dbg(dev->wl, "Chip initialized\n");
out:
Expand Down Expand Up @@ -3195,6 +3189,12 @@ static void setup_struct_phy_for_init(struct b43_wldev *dev,
phy->channel = 0xFF;

phy->hardware_power_control = !!modparam_hwpctl;

/* PHY TX errors counter. */
atomic_set(&phy->txerr_cnt, B43_PHY_TX_BADNESS_LIMIT);

/* OFDM-table address caching. */
phy->ofdmtab_addr_direction = B43_OFDMTAB_DIRECTION_UNKNOWN;
}

static void setup_struct_wldev_for_init(struct b43_wldev *dev)
Expand Down
35 changes: 23 additions & 12 deletions trunk/drivers/net/wireless/b43/tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,17 @@ u16 b43_ofdmtab_read16(struct b43_wldev *dev, u16 table, u16 offset)
u16 addr;

addr = table + offset;
if (addr - 1 != phy->ofdm_addr || phy->ofdm_valid != 1) {
if ((phy->ofdmtab_addr_direction != B43_OFDMTAB_DIRECTION_READ) ||
(addr - 1 != phy->ofdmtab_addr)) {
/* The hardware has a different address in memory. Update it. */
b43_phy_write(dev, B43_PHY_OTABLECTL, addr);
phy->ofdm_valid = 1;
phy->ofdmtab_addr_direction = B43_OFDMTAB_DIRECTION_READ;
}
phy->ofdm_addr = addr;
phy->ofdmtab_addr = addr;

return b43_phy_read(dev, B43_PHY_OTABLEI);

/* Some compiletime assertions... */
assert_sizes();
}

Expand All @@ -398,11 +402,13 @@ void b43_ofdmtab_write16(struct b43_wldev *dev, u16 table,
u16 addr;

addr = table + offset;
if (addr - 1 != phy->ofdm_addr || phy->ofdm_valid != 2) {
if ((phy->ofdmtab_addr_direction != B43_OFDMTAB_DIRECTION_WRITE) ||
(addr -1 != phy->ofdmtab_addr)) {
/* The hardware has a different address in memory. Update it. */
b43_phy_write(dev, B43_PHY_OTABLECTL, addr);
phy->ofdm_valid = 2;
phy->ofdmtab_addr_direction = B43_OFDMTAB_DIRECTION_WRITE;
}
phy->ofdm_addr = addr;
phy->ofdmtab_addr = addr;
b43_phy_write(dev, B43_PHY_OTABLEI, value);
}

Expand All @@ -413,11 +419,13 @@ u32 b43_ofdmtab_read32(struct b43_wldev *dev, u16 table, u16 offset)
u16 addr;

addr = table + offset;
if (addr - 1 != phy->ofdm_addr || phy->ofdm_valid != 1) {
if ((phy->ofdmtab_addr_direction != B43_OFDMTAB_DIRECTION_READ) ||
(addr - 1 != phy->ofdmtab_addr)) {
/* The hardware has a different address in memory. Update it. */
b43_phy_write(dev, B43_PHY_OTABLECTL, addr);
phy->ofdm_valid = 1;
phy->ofdmtab_addr_direction = B43_OFDMTAB_DIRECTION_READ;
}
phy->ofdm_addr = addr;
phy->ofdmtab_addr = addr;
ret = b43_phy_read(dev, B43_PHY_OTABLEQ);
ret <<= 16;
ret |= b43_phy_read(dev, B43_PHY_OTABLEI);
Expand All @@ -432,13 +440,16 @@ void b43_ofdmtab_write32(struct b43_wldev *dev, u16 table,
u16 addr;

addr = table + offset;
if (addr - 1 != phy->ofdm_addr || phy->ofdm_valid != 2) {
if ((phy->ofdmtab_addr_direction != B43_OFDMTAB_DIRECTION_WRITE) ||
(addr - 1 != phy->ofdmtab_addr)) {
/* The hardware has a different address in memory. Update it. */
b43_phy_write(dev, B43_PHY_OTABLECTL, addr);
phy->ofdm_valid = 2;
phy->ofdmtab_addr_direction = B43_OFDMTAB_DIRECTION_WRITE;
}
phy->ofdm_addr = addr;
phy->ofdmtab_addr = addr;

b43_phy_write(dev, B43_PHY_OTABLEI, value);
b43_phy_write(dev, B43_PHY_OTABLEQ, (value >> 16));
}

u16 b43_gtab_read(struct b43_wldev *dev, u16 table, u16 offset)
Expand Down

0 comments on commit fb661c0

Please sign in to comment.