From 054044ff91891723025a6b35bd583c98e141ea3d Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 14 Apr 2015 12:17:20 +0000 Subject: kernel: update bgmac patches to the latest version submitted Signed-off-by: Felix Fietkau git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45431 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../077-04-bgmac-simplify-tx-ring-index-handling.patch | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'target/linux/generic/patches-3.18/077-04-bgmac-simplify-tx-ring-index-handling.patch') diff --git a/target/linux/generic/patches-3.18/077-04-bgmac-simplify-tx-ring-index-handling.patch b/target/linux/generic/patches-3.18/077-04-bgmac-simplify-tx-ring-index-handling.patch index cf62a50a2f..241a3083a9 100644 --- a/target/linux/generic/patches-3.18/077-04-bgmac-simplify-tx-ring-index-handling.patch +++ b/target/linux/generic/patches-3.18/077-04-bgmac-simplify-tx-ring-index-handling.patch @@ -25,22 +25,24 @@ Signed-off-by: Felix Fietkau int i; if (skb->len > BGMAC_DESC_CTL1_LEN) { -@@ -158,13 +157,7 @@ static netdev_tx_t bgmac_dma_tx_add(stru - skb_checksum_help(skb); +@@ -159,12 +158,10 @@ static netdev_tx_t bgmac_dma_tx_add(stru nr_frags = skb_shinfo(skb)->nr_frags; -- + - if (ring->start <= ring->end) - free_slots = ring->start - ring->end + BGMAC_TX_RING_SLOTS; - else - free_slots = ring->start - ring->end; - - if (free_slots <= nr_frags + 1) { ++ /* ring->end - ring->start will return the number of valid slots, ++ * even when ring->end overflows ++ */ + if (ring->end - ring->start + nr_frags + 1 >= BGMAC_TX_RING_SLOTS) { bgmac_err(bgmac, "TX ring is full, queue should be stopped!\n"); netif_stop_queue(net_dev); return NETDEV_TX_BUSY; -@@ -200,7 +193,7 @@ static netdev_tx_t bgmac_dma_tx_add(stru +@@ -200,7 +197,7 @@ static netdev_tx_t bgmac_dma_tx_add(stru } slot->skb = skb; @@ -49,7 +51,7 @@ Signed-off-by: Felix Fietkau netdev_sent_queue(net_dev, skb->len); wmb(); -@@ -208,13 +201,12 @@ static netdev_tx_t bgmac_dma_tx_add(stru +@@ -208,13 +205,12 @@ static netdev_tx_t bgmac_dma_tx_add(stru /* Increase ring->end to point empty slot. We tell hardware the first * slot it should *not* read. */ @@ -66,7 +68,7 @@ Signed-off-by: Felix Fietkau netif_stop_queue(net_dev); return NETDEV_TX_OK; -@@ -256,17 +248,17 @@ static void bgmac_dma_tx_free(struct bgm +@@ -256,17 +252,17 @@ static void bgmac_dma_tx_free(struct bgm empty_slot &= BGMAC_DMA_TX_STATDPTR; empty_slot /= sizeof(struct bgmac_dma_desc); @@ -93,7 +95,7 @@ Signed-off-by: Felix Fietkau if (ctl1 & BGMAC_DESC_CTL0_SOF) /* Unmap no longer used buffer */ dma_unmap_single(dma_dev, slot->dma_addr, len, -@@ -284,10 +276,8 @@ static void bgmac_dma_tx_free(struct bgm +@@ -284,10 +280,8 @@ static void bgmac_dma_tx_free(struct bgm slot->skb = NULL; } -- cgit v1.2.3