diff options
author | Michael Buesch <mb@bu3sch.de> | 2008-05-20 06:16:28 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-28 16:43:40 -0400 |
commit | 6b4bec010d888c5b8c731aa596635cd83dd3416c (patch) | |
tree | c90eff9d7e421caf8d7954b893261e8604d42ca2 /drivers/net | |
parent | bc1b1fb2753873314ad1bf56bc7d5b8dd447cd2a (diff) |
b43: Upload both beacon templates on initial load
This updates the beacon template code to upload both templates,
if we never uploaded one before.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/b43/b43.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/b43/main.c | 58 |
2 files changed, 45 insertions, 14 deletions
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h index 37783cdd301a..dfa4bdd5597c 100644 --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h | |||
@@ -737,6 +737,7 @@ struct b43_wl { | |||
737 | struct ieee80211_tx_control beacon_txctl; | 737 | struct ieee80211_tx_control beacon_txctl; |
738 | bool beacon0_uploaded; | 738 | bool beacon0_uploaded; |
739 | bool beacon1_uploaded; | 739 | bool beacon1_uploaded; |
740 | bool beacon_templates_virgin; /* Never wrote the templates? */ | ||
740 | struct work_struct beacon_update_trigger; | 741 | struct work_struct beacon_update_trigger; |
741 | 742 | ||
742 | /* The current QOS parameters for the 4 queues. | 743 | /* The current QOS parameters for the 4 queues. |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 8fdba9415c04..b8e77751065a 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -1544,6 +1544,30 @@ static void b43_write_probe_resp_template(struct b43_wldev *dev, | |||
1544 | kfree(probe_resp_data); | 1544 | kfree(probe_resp_data); |
1545 | } | 1545 | } |
1546 | 1546 | ||
1547 | static void b43_upload_beacon0(struct b43_wldev *dev) | ||
1548 | { | ||
1549 | struct b43_wl *wl = dev->wl; | ||
1550 | |||
1551 | if (wl->beacon0_uploaded) | ||
1552 | return; | ||
1553 | b43_write_beacon_template(dev, 0x68, 0x18); | ||
1554 | /* FIXME: Probe resp upload doesn't really belong here, | ||
1555 | * but we don't use that feature anyway. */ | ||
1556 | b43_write_probe_resp_template(dev, 0x268, 0x4A, | ||
1557 | &__b43_ratetable[3]); | ||
1558 | wl->beacon0_uploaded = 1; | ||
1559 | } | ||
1560 | |||
1561 | static void b43_upload_beacon1(struct b43_wldev *dev) | ||
1562 | { | ||
1563 | struct b43_wl *wl = dev->wl; | ||
1564 | |||
1565 | if (wl->beacon1_uploaded) | ||
1566 | return; | ||
1567 | b43_write_beacon_template(dev, 0x468, 0x1A); | ||
1568 | wl->beacon1_uploaded = 1; | ||
1569 | } | ||
1570 | |||
1547 | static void handle_irq_beacon(struct b43_wldev *dev) | 1571 | static void handle_irq_beacon(struct b43_wldev *dev) |
1548 | { | 1572 | { |
1549 | struct b43_wl *wl = dev->wl; | 1573 | struct b43_wl *wl = dev->wl; |
@@ -1568,24 +1592,27 @@ static void handle_irq_beacon(struct b43_wldev *dev) | |||
1568 | return; | 1592 | return; |
1569 | } | 1593 | } |
1570 | 1594 | ||
1571 | if (!beacon0_valid) { | 1595 | if (unlikely(wl->beacon_templates_virgin)) { |
1572 | if (!wl->beacon0_uploaded) { | 1596 | /* We never uploaded a beacon before. |
1573 | b43_write_beacon_template(dev, 0x68, 0x18); | 1597 | * Upload both templates now, but only mark one valid. */ |
1574 | b43_write_probe_resp_template(dev, 0x268, 0x4A, | 1598 | wl->beacon_templates_virgin = 0; |
1575 | &__b43_ratetable[3]); | 1599 | b43_upload_beacon0(dev); |
1576 | wl->beacon0_uploaded = 1; | 1600 | b43_upload_beacon1(dev); |
1577 | } | ||
1578 | cmd = b43_read32(dev, B43_MMIO_MACCMD); | 1601 | cmd = b43_read32(dev, B43_MMIO_MACCMD); |
1579 | cmd |= B43_MACCMD_BEACON0_VALID; | 1602 | cmd |= B43_MACCMD_BEACON0_VALID; |
1580 | b43_write32(dev, B43_MMIO_MACCMD, cmd); | 1603 | b43_write32(dev, B43_MMIO_MACCMD, cmd); |
1581 | } else if (!beacon1_valid) { | 1604 | } else { |
1582 | if (!wl->beacon1_uploaded) { | 1605 | if (!beacon0_valid) { |
1583 | b43_write_beacon_template(dev, 0x468, 0x1A); | 1606 | b43_upload_beacon0(dev); |
1584 | wl->beacon1_uploaded = 1; | 1607 | cmd = b43_read32(dev, B43_MMIO_MACCMD); |
1608 | cmd |= B43_MACCMD_BEACON0_VALID; | ||
1609 | b43_write32(dev, B43_MMIO_MACCMD, cmd); | ||
1610 | } else if (!beacon1_valid) { | ||
1611 | b43_upload_beacon1(dev); | ||
1612 | cmd = b43_read32(dev, B43_MMIO_MACCMD); | ||
1613 | cmd |= B43_MACCMD_BEACON1_VALID; | ||
1614 | b43_write32(dev, B43_MMIO_MACCMD, cmd); | ||
1585 | } | 1615 | } |
1586 | cmd = b43_read32(dev, B43_MMIO_MACCMD); | ||
1587 | cmd |= B43_MACCMD_BEACON1_VALID; | ||
1588 | b43_write32(dev, B43_MMIO_MACCMD, cmd); | ||
1589 | } | 1616 | } |
1590 | } | 1617 | } |
1591 | 1618 | ||
@@ -4073,6 +4100,9 @@ static int b43_op_start(struct ieee80211_hw *hw) | |||
4073 | wl->filter_flags = 0; | 4100 | wl->filter_flags = 0; |
4074 | wl->radiotap_enabled = 0; | 4101 | wl->radiotap_enabled = 0; |
4075 | b43_qos_clear(wl); | 4102 | b43_qos_clear(wl); |
4103 | wl->beacon0_uploaded = 0; | ||
4104 | wl->beacon1_uploaded = 0; | ||
4105 | wl->beacon_templates_virgin = 1; | ||
4076 | 4106 | ||
4077 | /* First register RFkill. | 4107 | /* First register RFkill. |
4078 | * LEDs that are registered later depend on it. */ | 4108 | * LEDs that are registered later depend on it. */ |