From 2e825b7d5b32990c7273215b3d382b0c0e8d823d Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 25 Nov 2010 12:18:36 +0000 Subject: [ar7] rename 973-cpmac_handle_mvswitch.c to 973-cpmac_handle_mvswitch.patch git-svn-id: svn://svn.openwrt.org/openwrt/trunk@24141 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../ar7/patches-2.6.32/973-cpmac_handle_mvswitch.c | 65 ---------------------- .../patches-2.6.32/973-cpmac_handle_mvswitch.patch | 65 ++++++++++++++++++++++ 2 files changed, 65 insertions(+), 65 deletions(-) delete mode 100644 target/linux/ar7/patches-2.6.32/973-cpmac_handle_mvswitch.c create mode 100644 target/linux/ar7/patches-2.6.32/973-cpmac_handle_mvswitch.patch (limited to 'target/linux/ar7/patches-2.6.32') diff --git a/target/linux/ar7/patches-2.6.32/973-cpmac_handle_mvswitch.c b/target/linux/ar7/patches-2.6.32/973-cpmac_handle_mvswitch.c deleted file mode 100644 index 23c66aa5b6..0000000000 --- a/target/linux/ar7/patches-2.6.32/973-cpmac_handle_mvswitch.c +++ /dev/null @@ -1,65 +0,0 @@ -Index: linux-2.6.32.25/drivers/net/cpmac.c -=================================================================== ---- linux-2.6.32.25.orig/drivers/net/cpmac.c 2010-11-24 12:16:56.067517245 -0800 -+++ linux-2.6.32.25/drivers/net/cpmac.c 2010-11-24 12:17:56.279985384 -0800 -@@ -387,6 +387,7 @@ - struct cpmac_desc *desc) - { - struct sk_buff *skb, *result = NULL; -+ int offset; - - if (unlikely(netif_msg_hw(priv))) - cpmac_dump_desc(priv->dev, desc); -@@ -400,9 +401,13 @@ - - skb = netdev_alloc_skb(priv->dev, CPMAC_SKB_SIZE); - if (likely(skb)) { -- skb_reserve(skb, 2); -+ offset = 2; -+ if (priv->phy) { -+ offset += priv->phy->pkt_align; -+ } -+ skb_reserve(skb, offset); -+ - skb_put(desc->skb, desc->datalen); -- desc->skb->protocol = eth_type_trans(desc->skb, priv->dev); - desc->skb->ip_summed = CHECKSUM_NONE; - priv->dev->stats.rx_packets++; - priv->dev->stats.rx_bytes += desc->datalen; -@@ -474,7 +479,12 @@ - - skb = cpmac_rx_one(priv, desc); - if (likely(skb)) { -- netif_receive_skb(skb); -+ if (priv->phy->netif_receive_skb) { -+ priv->phy->netif_receive_skb(skb); -+ } else { -+ skb->protocol = eth_type_trans(skb, priv->dev); -+ netif_receive_skb(skb); -+ } - received++; - } - desc = desc->next; -@@ -970,7 +980,7 @@ - - static int cpmac_open(struct net_device *dev) - { -- int i, size, res; -+ int i, size, res, offset; - struct cpmac_priv *priv = netdev_priv(dev); - struct resource *mem; - struct cpmac_desc *desc; -@@ -1014,7 +1024,12 @@ - res = -ENOMEM; - goto fail_desc; - } -- skb_reserve(skb, 2); -+ offset = 2; -+ if (priv->phy) { -+ offset += priv->phy->pkt_align; -+ } -+ skb_reserve(skb, offset); -+ - desc->skb = skb; - desc->data_mapping = dma_map_single(&dev->dev, skb->data, - CPMAC_SKB_SIZE, diff --git a/target/linux/ar7/patches-2.6.32/973-cpmac_handle_mvswitch.patch b/target/linux/ar7/patches-2.6.32/973-cpmac_handle_mvswitch.patch new file mode 100644 index 0000000000..23c66aa5b6 --- /dev/null +++ b/target/linux/ar7/patches-2.6.32/973-cpmac_handle_mvswitch.patch @@ -0,0 +1,65 @@ +Index: linux-2.6.32.25/drivers/net/cpmac.c +=================================================================== +--- linux-2.6.32.25.orig/drivers/net/cpmac.c 2010-11-24 12:16:56.067517245 -0800 ++++ linux-2.6.32.25/drivers/net/cpmac.c 2010-11-24 12:17:56.279985384 -0800 +@@ -387,6 +387,7 @@ + struct cpmac_desc *desc) + { + struct sk_buff *skb, *result = NULL; ++ int offset; + + if (unlikely(netif_msg_hw(priv))) + cpmac_dump_desc(priv->dev, desc); +@@ -400,9 +401,13 @@ + + skb = netdev_alloc_skb(priv->dev, CPMAC_SKB_SIZE); + if (likely(skb)) { +- skb_reserve(skb, 2); ++ offset = 2; ++ if (priv->phy) { ++ offset += priv->phy->pkt_align; ++ } ++ skb_reserve(skb, offset); ++ + skb_put(desc->skb, desc->datalen); +- desc->skb->protocol = eth_type_trans(desc->skb, priv->dev); + desc->skb->ip_summed = CHECKSUM_NONE; + priv->dev->stats.rx_packets++; + priv->dev->stats.rx_bytes += desc->datalen; +@@ -474,7 +479,12 @@ + + skb = cpmac_rx_one(priv, desc); + if (likely(skb)) { +- netif_receive_skb(skb); ++ if (priv->phy->netif_receive_skb) { ++ priv->phy->netif_receive_skb(skb); ++ } else { ++ skb->protocol = eth_type_trans(skb, priv->dev); ++ netif_receive_skb(skb); ++ } + received++; + } + desc = desc->next; +@@ -970,7 +980,7 @@ + + static int cpmac_open(struct net_device *dev) + { +- int i, size, res; ++ int i, size, res, offset; + struct cpmac_priv *priv = netdev_priv(dev); + struct resource *mem; + struct cpmac_desc *desc; +@@ -1014,7 +1024,12 @@ + res = -ENOMEM; + goto fail_desc; + } +- skb_reserve(skb, 2); ++ offset = 2; ++ if (priv->phy) { ++ offset += priv->phy->pkt_align; ++ } ++ skb_reserve(skb, offset); ++ + desc->skb = skb; + desc->data_mapping = dma_map_single(&dev->dev, skb->data, + CPMAC_SKB_SIZE, -- cgit v1.2.3