diff options
author | jogo <jogo@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-02-04 10:19:55 +0000 |
---|---|---|
committer | jogo <jogo@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-02-04 10:19:55 +0000 |
commit | 6ec4b12517f63923263923141b648f13a5e952a9 (patch) | |
tree | 795c678a9aada87200ea960ac154a52f1186eef2 /target/linux/brcm63xx/patches-3.8/419-bcm63xx_enet-store-is_sw-in-a-variable-instead-of-ch.patch | |
parent | 404cd71e7c4cb3b69a53db4876c0b2cbf27c3036 (diff) |
bcm63xx: add support for linux 3.8
Based on 3.8-rc6
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35482 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm63xx/patches-3.8/419-bcm63xx_enet-store-is_sw-in-a-variable-instead-of-ch.patch')
-rw-r--r-- | target/linux/brcm63xx/patches-3.8/419-bcm63xx_enet-store-is_sw-in-a-variable-instead-of-ch.patch | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/patches-3.8/419-bcm63xx_enet-store-is_sw-in-a-variable-instead-of-ch.patch b/target/linux/brcm63xx/patches-3.8/419-bcm63xx_enet-store-is_sw-in-a-variable-instead-of-ch.patch new file mode 100644 index 000000000..9f3cbfd91 --- /dev/null +++ b/target/linux/brcm63xx/patches-3.8/419-bcm63xx_enet-store-is_sw-in-a-variable-instead-of-ch.patch @@ -0,0 +1,73 @@ +From ef581388c45dbc48f7bbe050e87deb1e3c63a698 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski <jonas.gorski@gmail.com> +Date: Tue, 10 Jul 2012 10:52:02 +0200 +Subject: [PATCH 35/84] bcm63xx_enet: store is_sw in a variable instead of checking the cpuid + +Reduces the number of changes needed for making enetsw work on new +chips. +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 7 +++++-- + drivers/net/ethernet/broadcom/bcm63xx_enet.h | 10 ++-------- + 2 files changed, 7 insertions(+), 10 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -364,7 +364,7 @@ static int bcm_enet_receive_queue(struct + } + + /* recycle packet if it's marked as bad */ +- if (!bcm_enet_is_sw(priv) && ++ if (!priv->enet_is_sw && + unlikely(len_stat & DMADESC_ERR_MASK)) { + dev->stats.rx_errors++; + +@@ -597,7 +597,7 @@ static int bcm_enet_start_xmit(struct sk + } + + /* pad small packets sent on a switch device */ +- if (bcm_enet_is_sw(priv) && skb->len < 64) { ++ if (priv->enet_is_sw && skb->len < 64) { + int needed = 64 - skb->len; + char *data; + +@@ -1700,6 +1700,8 @@ static int bcm_enet_probe(struct platfor + return -ENOMEM; + priv = netdev_priv(dev); + ++ priv->enet_is_sw = false; ++ + ret = compute_hw_mtu(priv, dev->mtu); + if (ret) + goto out; +@@ -2725,6 +2727,7 @@ static int bcm_enetsw_probe(struct platf + memset(priv, 0, sizeof(*priv)); + + /* initialize default and fetch platform data */ ++ priv->enet_is_sw = true; + priv->irq_rx = irq_rx; + priv->irq_tx = irq_tx; + priv->rx_ring_size = BCMENET_DEF_RX_DESC; +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h +@@ -325,6 +325,8 @@ struct bcm_enet_priv { + /* maximum hardware transmit/receive size */ + unsigned int hw_mtu; + ++ bool enet_is_sw; ++ + /* port mapping for switch devices */ + int num_ports; + struct bcm63xx_enetsw_port used_ports[ENETSW_MAX_PORT]; +@@ -335,12 +337,4 @@ struct bcm_enet_priv { + spinlock_t enetsw_mdio_lock; + }; + +-static inline int bcm_enet_is_sw(struct bcm_enet_priv *priv) +-{ +- if (BCMCPU_IS_6368()) +- return 1; +- else +- return 0; +-} +- + #endif /* ! BCM63XX_ENET_H_ */ |