package/index: fix index creating when building without signing
[librecmc/librecmc.git] / target / linux / brcm47xx / patches-3.10 / 740-bgmac-add-support-for-Byte-Queue-Limits.patch
1 From: Hauke Mehrtens <hauke@hauke-m.de>
2 bgmac: add support for Byte Queue Limits
3
4 --- a/drivers/net/ethernet/broadcom/bgmac.c
5 +++ b/drivers/net/ethernet/broadcom/bgmac.c
6 @@ -178,6 +178,7 @@ static void bgmac_dma_tx_free(struct bgm
7         struct device *dma_dev = bgmac->core->dma_dev;
8         int empty_slot;
9         bool freed = false;
10 +       unsigned bytes_compl = 0, pkts_compl = 0;
11  
12         /* The last slot that hardware didn't consume yet */
13         empty_slot = bgmac_read(bgmac, ring->mmio_base + BGMAC_DMA_TX_STATUS);
14 @@ -195,6 +196,9 @@ static void bgmac_dma_tx_free(struct bgm
15                                          slot->skb->len, DMA_TO_DEVICE);
16                         slot->dma_addr = 0;
17  
18 +                       bytes_compl += slot->skb->len;
19 +                       pkts_compl++;
20 +
21                         /* Free memory! :) */
22                         dev_kfree_skb(slot->skb);
23                         slot->skb = NULL;
24 @@ -208,6 +212,8 @@ static void bgmac_dma_tx_free(struct bgm
25                 freed = true;
26         }
27  
28 +       netdev_completed_queue(bgmac->net_dev, pkts_compl, bytes_compl);
29 +
30         if (freed && netif_queue_stopped(bgmac->net_dev))
31                 netif_wake_queue(bgmac->net_dev);
32  }
33 @@ -987,6 +993,8 @@ static void bgmac_chip_reset(struct bgma
34                 bgmac_set(bgmac, BGMAC_PHY_CNTL, BGMAC_PC_MTE);
35         bgmac_miiconfig(bgmac);
36         bgmac_phy_init(bgmac);
37 +       
38 +       netdev_reset_queue(bgmac->net_dev);
39  
40         bgmac->int_status = 0;
41  }
42 @@ -1198,6 +1206,8 @@ static netdev_tx_t bgmac_start_xmit(stru
43         struct bgmac *bgmac = netdev_priv(net_dev);
44         struct bgmac_dma_ring *ring;
45  
46 +       netdev_sent_queue(net_dev, skb->len);
47 +
48         /* No QOS support yet */
49         ring = &bgmac->tx_ring[0];
50         return bgmac_dma_tx_add(bgmac, ring, skb);