aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-04-01 13:36:50 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-01 13:36:50 -0400
commita210576cf891e9e6d2c238eabcf5c1286b1e7526 (patch)
tree0fa81a901cf628b25e6ee79057700cf39e59818a /drivers/net/wireless/b43
parent7d4c04fc170087119727119074e72445f2bb192b (diff)
parent3658f3604066d5500ebd73a04084f127dc779441 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: net/mac80211/sta_info.c net/wireless/core.h Two minor conflicts in wireless. Overlapping additions of extern declarations in net/wireless/core.h and a bug fix overlapping with the addition of a boolean parameter to __ieee80211_key_free(). Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r--drivers/net/wireless/b43/dma.c65
-rw-r--r--drivers/net/wireless/b43/phy_n.c8
2 files changed, 57 insertions, 16 deletions
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index f73cbb512f7c..523355b87659 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -1482,8 +1482,12 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
1482 const struct b43_dma_ops *ops; 1482 const struct b43_dma_ops *ops;
1483 struct b43_dmaring *ring; 1483 struct b43_dmaring *ring;
1484 struct b43_dmadesc_meta *meta; 1484 struct b43_dmadesc_meta *meta;
1485 static const struct b43_txstatus fake; /* filled with 0 */
1486 const struct b43_txstatus *txstat;
1485 int slot, firstused; 1487 int slot, firstused;
1486 bool frame_succeed; 1488 bool frame_succeed;
1489 int skip;
1490 static u8 err_out1, err_out2;
1487 1491
1488 ring = parse_cookie(dev, status->cookie, &slot); 1492 ring = parse_cookie(dev, status->cookie, &slot);
1489 if (unlikely(!ring)) 1493 if (unlikely(!ring))
@@ -1496,13 +1500,36 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
1496 firstused = ring->current_slot - ring->used_slots + 1; 1500 firstused = ring->current_slot - ring->used_slots + 1;
1497 if (firstused < 0) 1501 if (firstused < 0)
1498 firstused = ring->nr_slots + firstused; 1502 firstused = ring->nr_slots + firstused;
1503
1504 skip = 0;
1499 if (unlikely(slot != firstused)) { 1505 if (unlikely(slot != firstused)) {
1500 /* This possibly is a firmware bug and will result in 1506 /* This possibly is a firmware bug and will result in
1501 * malfunction, memory leaks and/or stall of DMA functionality. */ 1507 * malfunction, memory leaks and/or stall of DMA functionality.
1502 b43dbg(dev->wl, "Out of order TX status report on DMA ring %d. " 1508 */
1503 "Expected %d, but got %d\n", 1509 if (slot == next_slot(ring, next_slot(ring, firstused))) {
1504 ring->index, firstused, slot); 1510 /* If a single header/data pair was missed, skip over
1505 return; 1511 * the first two slots in an attempt to recover.
1512 */
1513 slot = firstused;
1514 skip = 2;
1515 if (!err_out1) {
1516 /* Report the error once. */
1517 b43dbg(dev->wl,
1518 "Skip on DMA ring %d slot %d.\n",
1519 ring->index, slot);
1520 err_out1 = 1;
1521 }
1522 } else {
1523 /* More than a single header/data pair were missed.
1524 * Report this error once.
1525 */
1526 if (!err_out2)
1527 b43dbg(dev->wl,
1528 "Out of order TX status report on DMA ring %d. Expected %d, but got %d\n",
1529 ring->index, firstused, slot);
1530 err_out2 = 1;
1531 return;
1532 }
1506 } 1533 }
1507 1534
1508 ops = ring->ops; 1535 ops = ring->ops;
@@ -1517,11 +1544,13 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
1517 slot, firstused, ring->index); 1544 slot, firstused, ring->index);
1518 break; 1545 break;
1519 } 1546 }
1547
1520 if (meta->skb) { 1548 if (meta->skb) {
1521 struct b43_private_tx_info *priv_info = 1549 struct b43_private_tx_info *priv_info =
1522 b43_get_priv_tx_info(IEEE80211_SKB_CB(meta->skb)); 1550 b43_get_priv_tx_info(IEEE80211_SKB_CB(meta->skb));
1523 1551
1524 unmap_descbuffer(ring, meta->dmaaddr, meta->skb->len, 1); 1552 unmap_descbuffer(ring, meta->dmaaddr,
1553 meta->skb->len, 1);
1525 kfree(priv_info->bouncebuffer); 1554 kfree(priv_info->bouncebuffer);
1526 priv_info->bouncebuffer = NULL; 1555 priv_info->bouncebuffer = NULL;
1527 } else { 1556 } else {
@@ -1533,8 +1562,9 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
1533 struct ieee80211_tx_info *info; 1562 struct ieee80211_tx_info *info;
1534 1563
1535 if (unlikely(!meta->skb)) { 1564 if (unlikely(!meta->skb)) {
1536 /* This is a scatter-gather fragment of a frame, so 1565 /* This is a scatter-gather fragment of a frame,
1537 * the skb pointer must not be NULL. */ 1566 * so the skb pointer must not be NULL.
1567 */
1538 b43dbg(dev->wl, "TX status unexpected NULL skb " 1568 b43dbg(dev->wl, "TX status unexpected NULL skb "
1539 "at slot %d (first=%d) on ring %d\n", 1569 "at slot %d (first=%d) on ring %d\n",
1540 slot, firstused, ring->index); 1570 slot, firstused, ring->index);
@@ -1545,9 +1575,18 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
1545 1575
1546 /* 1576 /*
1547 * Call back to inform the ieee80211 subsystem about 1577 * Call back to inform the ieee80211 subsystem about
1548 * the status of the transmission. 1578 * the status of the transmission. When skipping over
1579 * a missed TX status report, use a status structure
1580 * filled with zeros to indicate that the frame was not
1581 * sent (frame_count 0) and not acknowledged
1549 */ 1582 */
1550 frame_succeed = b43_fill_txstatus_report(dev, info, status); 1583 if (unlikely(skip))
1584 txstat = &fake;
1585 else
1586 txstat = status;
1587
1588 frame_succeed = b43_fill_txstatus_report(dev, info,
1589 txstat);
1551#ifdef CONFIG_B43_DEBUG 1590#ifdef CONFIG_B43_DEBUG
1552 if (frame_succeed) 1591 if (frame_succeed)
1553 ring->nr_succeed_tx_packets++; 1592 ring->nr_succeed_tx_packets++;
@@ -1575,12 +1614,14 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
1575 /* Everything unmapped and free'd. So it's not used anymore. */ 1614 /* Everything unmapped and free'd. So it's not used anymore. */
1576 ring->used_slots--; 1615 ring->used_slots--;
1577 1616
1578 if (meta->is_last_fragment) { 1617 if (meta->is_last_fragment && !skip) {
1579 /* This is the last scatter-gather 1618 /* This is the last scatter-gather
1580 * fragment of the frame. We are done. */ 1619 * fragment of the frame. We are done. */
1581 break; 1620 break;
1582 } 1621 }
1583 slot = next_slot(ring, slot); 1622 slot = next_slot(ring, slot);
1623 if (skip > 0)
1624 --skip;
1584 } 1625 }
1585 if (ring->stopped) { 1626 if (ring->stopped) {
1586 B43_WARN_ON(free_slots(ring) < TX_SLOTS_PER_FRAME); 1627 B43_WARN_ON(free_slots(ring) < TX_SLOTS_PER_FRAME);
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 3c35382ee6c2..e8486c1e091a 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -1564,7 +1564,7 @@ static void b43_nphy_rev3_rssi_cal(struct b43_wldev *dev)
1564 u16 clip_off[2] = { 0xFFFF, 0xFFFF }; 1564 u16 clip_off[2] = { 0xFFFF, 0xFFFF };
1565 1565
1566 u8 vcm_final = 0; 1566 u8 vcm_final = 0;
1567 s8 offset[4]; 1567 s32 offset[4];
1568 s32 results[8][4] = { }; 1568 s32 results[8][4] = { };
1569 s32 results_min[4] = { }; 1569 s32 results_min[4] = { };
1570 s32 poll_results[4] = { }; 1570 s32 poll_results[4] = { };
@@ -1615,7 +1615,7 @@ static void b43_nphy_rev3_rssi_cal(struct b43_wldev *dev)
1615 } 1615 }
1616 for (i = 0; i < 4; i += 2) { 1616 for (i = 0; i < 4; i += 2) {
1617 s32 curr; 1617 s32 curr;
1618 s32 mind = 40; 1618 s32 mind = 0x100000;
1619 s32 minpoll = 249; 1619 s32 minpoll = 249;
1620 u8 minvcm = 0; 1620 u8 minvcm = 0;
1621 if (2 * core != i) 1621 if (2 * core != i)
@@ -1732,7 +1732,7 @@ static void b43_nphy_rev2_rssi_cal(struct b43_wldev *dev, u8 type)
1732 u8 regs_save_radio[2]; 1732 u8 regs_save_radio[2];
1733 u16 regs_save_phy[2]; 1733 u16 regs_save_phy[2];
1734 1734
1735 s8 offset[4]; 1735 s32 offset[4];
1736 u8 core; 1736 u8 core;
1737 u8 rail; 1737 u8 rail;
1738 1738
@@ -1799,7 +1799,7 @@ static void b43_nphy_rev2_rssi_cal(struct b43_wldev *dev, u8 type)
1799 } 1799 }
1800 1800
1801 for (i = 0; i < 4; i++) { 1801 for (i = 0; i < 4; i++) {
1802 s32 mind = 40; 1802 s32 mind = 0x100000;
1803 u8 minvcm = 0; 1803 u8 minvcm = 0;
1804 s32 minpoll = 249; 1804 s32 minpoll = 249;
1805 s32 curr; 1805 s32 curr;