aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43legacy
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/b43legacy')
-rw-r--r--drivers/net/wireless/b43legacy/Kconfig2
-rw-r--r--drivers/net/wireless/b43legacy/b43legacy.h2
-rw-r--r--drivers/net/wireless/b43legacy/dma.c17
-rw-r--r--drivers/net/wireless/b43legacy/main.c6
-rw-r--r--drivers/net/wireless/b43legacy/xmit.c1
5 files changed, 19 insertions, 9 deletions
diff --git a/drivers/net/wireless/b43legacy/Kconfig b/drivers/net/wireless/b43legacy/Kconfig
index 94a463478053..1ffa28835c58 100644
--- a/drivers/net/wireless/b43legacy/Kconfig
+++ b/drivers/net/wireless/b43legacy/Kconfig
@@ -1,6 +1,6 @@
1config B43LEGACY 1config B43LEGACY
2 tristate "Broadcom 43xx-legacy wireless support (mac80211 stack)" 2 tristate "Broadcom 43xx-legacy wireless support (mac80211 stack)"
3 depends on SSB_POSSIBLE && MAC80211 && WLAN_80211 && HAS_DMA 3 depends on SSB_POSSIBLE && MAC80211 && HAS_DMA
4 select SSB 4 select SSB
5 select FW_LOADER 5 select FW_LOADER
6 ---help--- 6 ---help---
diff --git a/drivers/net/wireless/b43legacy/b43legacy.h b/drivers/net/wireless/b43legacy/b43legacy.h
index 038baa8869e2..89fe2f972c72 100644
--- a/drivers/net/wireless/b43legacy/b43legacy.h
+++ b/drivers/net/wireless/b43legacy/b43legacy.h
@@ -29,8 +29,6 @@
29 29
30#define B43legacy_IRQWAIT_MAX_RETRIES 20 30#define B43legacy_IRQWAIT_MAX_RETRIES 20
31 31
32#define B43legacy_RX_MAX_SSI 60 /* best guess at max ssi */
33
34/* MMIO offsets */ 32/* MMIO offsets */
35#define B43legacy_MMIO_DMA0_REASON 0x20 33#define B43legacy_MMIO_DMA0_REASON 0x20
36#define B43legacy_MMIO_DMA0_IRQ_MASK 0x24 34#define B43legacy_MMIO_DMA0_IRQ_MASK 0x24
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c
index 866403415811..0a86bdf53154 100644
--- a/drivers/net/wireless/b43legacy/dma.c
+++ b/drivers/net/wireless/b43legacy/dma.c
@@ -1240,8 +1240,9 @@ struct b43legacy_dmaring *parse_cookie(struct b43legacy_wldev *dev,
1240} 1240}
1241 1241
1242static int dma_tx_fragment(struct b43legacy_dmaring *ring, 1242static int dma_tx_fragment(struct b43legacy_dmaring *ring,
1243 struct sk_buff *skb) 1243 struct sk_buff **in_skb)
1244{ 1244{
1245 struct sk_buff *skb = *in_skb;
1245 const struct b43legacy_dma_ops *ops = ring->ops; 1246 const struct b43legacy_dma_ops *ops = ring->ops;
1246 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1247 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1247 u8 *header; 1248 u8 *header;
@@ -1305,8 +1306,14 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring,
1305 } 1306 }
1306 1307
1307 memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len); 1308 memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len);
1309 memcpy(bounce_skb->cb, skb->cb, sizeof(skb->cb));
1310 bounce_skb->dev = skb->dev;
1311 skb_set_queue_mapping(bounce_skb, skb_get_queue_mapping(skb));
1312 info = IEEE80211_SKB_CB(bounce_skb);
1313
1308 dev_kfree_skb_any(skb); 1314 dev_kfree_skb_any(skb);
1309 skb = bounce_skb; 1315 skb = bounce_skb;
1316 *in_skb = bounce_skb;
1310 meta->skb = skb; 1317 meta->skb = skb;
1311 meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); 1318 meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
1312 if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) { 1319 if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) {
@@ -1360,8 +1367,10 @@ int b43legacy_dma_tx(struct b43legacy_wldev *dev,
1360 struct sk_buff *skb) 1367 struct sk_buff *skb)
1361{ 1368{
1362 struct b43legacy_dmaring *ring; 1369 struct b43legacy_dmaring *ring;
1370 struct ieee80211_hdr *hdr;
1363 int err = 0; 1371 int err = 0;
1364 unsigned long flags; 1372 unsigned long flags;
1373 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1365 1374
1366 ring = priority_to_txring(dev, skb_get_queue_mapping(skb)); 1375 ring = priority_to_txring(dev, skb_get_queue_mapping(skb));
1367 spin_lock_irqsave(&ring->lock, flags); 1376 spin_lock_irqsave(&ring->lock, flags);
@@ -1386,7 +1395,11 @@ int b43legacy_dma_tx(struct b43legacy_wldev *dev,
1386 goto out_unlock; 1395 goto out_unlock;
1387 } 1396 }
1388 1397
1389 err = dma_tx_fragment(ring, skb); 1398 /* dma_tx_fragment might reallocate the skb, so invalidate pointers pointing
1399 * into the skb data or cb now. */
1400 hdr = NULL;
1401 info = NULL;
1402 err = dma_tx_fragment(ring, &skb);
1390 if (unlikely(err == -ENOKEY)) { 1403 if (unlikely(err == -ENOKEY)) {
1391 /* Drop this packet, as we don't have the encryption key 1404 /* Drop this packet, as we don't have the encryption key
1392 * anymore and must not transmit it unencrypted. */ 1405 * anymore and must not transmit it unencrypted. */
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 4b60148a5e61..ab6a18c2e9d9 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2677,7 +2677,7 @@ static int b43legacy_op_dev_config(struct ieee80211_hw *hw,
2677 if (conf->channel->hw_value != phy->channel) 2677 if (conf->channel->hw_value != phy->channel)
2678 b43legacy_radio_selectchannel(dev, conf->channel->hw_value, 0); 2678 b43legacy_radio_selectchannel(dev, conf->channel->hw_value, 0);
2679 2679
2680 dev->wl->radiotap_enabled = !!(conf->flags & IEEE80211_CONF_RADIOTAP); 2680 dev->wl->radiotap_enabled = !!(conf->flags & IEEE80211_CONF_MONITOR);
2681 2681
2682 /* Adjust the desired TX power level. */ 2682 /* Adjust the desired TX power level. */
2683 if (conf->power_level != 0) { 2683 if (conf->power_level != 0) {
@@ -3593,7 +3593,7 @@ static int b43legacy_wireless_core_attach(struct b43legacy_wldev *dev)
3593{ 3593{
3594 struct b43legacy_wl *wl = dev->wl; 3594 struct b43legacy_wl *wl = dev->wl;
3595 struct ssb_bus *bus = dev->dev->bus; 3595 struct ssb_bus *bus = dev->dev->bus;
3596 struct pci_dev *pdev = bus->host_pci; 3596 struct pci_dev *pdev = (bus->bustype == SSB_BUSTYPE_PCI) ? bus->host_pci : NULL;
3597 int err; 3597 int err;
3598 int have_bphy = 0; 3598 int have_bphy = 0;
3599 int have_gphy = 0; 3599 int have_gphy = 0;
@@ -3707,7 +3707,7 @@ static int b43legacy_one_core_attach(struct ssb_device *dev,
3707 3707
3708 if (!list_empty(&wl->devlist)) { 3708 if (!list_empty(&wl->devlist)) {
3709 /* We are not the first core on this chip. */ 3709 /* We are not the first core on this chip. */
3710 pdev = dev->bus->host_pci; 3710 pdev = (dev->bus->bustype == SSB_BUSTYPE_PCI) ? dev->bus->host_pci : NULL;
3711 /* Only special chips support more than one wireless 3711 /* Only special chips support more than one wireless
3712 * core, although some of the other chips have more than 3712 * core, although some of the other chips have more than
3713 * one wireless core as well. Check for this and 3713 * one wireless core as well. Check for this and
diff --git a/drivers/net/wireless/b43legacy/xmit.c b/drivers/net/wireless/b43legacy/xmit.c
index 103f3c9e7f58..9c8882d9275e 100644
--- a/drivers/net/wireless/b43legacy/xmit.c
+++ b/drivers/net/wireless/b43legacy/xmit.c
@@ -549,7 +549,6 @@ void b43legacy_rx(struct b43legacy_wldev *dev,
549 (phystat0 & B43legacy_RX_PHYST0_GAINCTL), 549 (phystat0 & B43legacy_RX_PHYST0_GAINCTL),
550 (phystat3 & B43legacy_RX_PHYST3_TRSTATE)); 550 (phystat3 & B43legacy_RX_PHYST3_TRSTATE));
551 status.noise = dev->stats.link_noise; 551 status.noise = dev->stats.link_noise;
552 status.qual = (jssi * 100) / B43legacy_RX_MAX_SSI;
553 /* change to support A PHY */ 552 /* change to support A PHY */
554 if (phystat0 & B43legacy_RX_PHYST0_OFDM) 553 if (phystat0 & B43legacy_RX_PHYST0_OFDM)
555 status.rate_idx = b43legacy_plcp_get_bitrate_idx_ofdm(plcp, false); 554 status.rate_idx = b43legacy_plcp_get_bitrate_idx_ofdm(plcp, false);