diff options
author | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-04-29 07:36:43 +0000 |
---|---|---|
committer | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-04-29 07:36:43 +0000 |
commit | 0c3e51f31ceb672b391aa4b4086ab5e0edf07fc1 (patch) | |
tree | 15e272500401e7847d9ea7dc40a0fafb81f93c1d /target/linux/adm5120/files/drivers/net | |
parent | 71b94eaba41e5b7d038d3ad09a404316d9430ae5 (diff) |
adm5120: merge 3.3 patches
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31511 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/adm5120/files/drivers/net')
-rw-r--r-- | target/linux/adm5120/files/drivers/net/adm5120sw.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/target/linux/adm5120/files/drivers/net/adm5120sw.c b/target/linux/adm5120/files/drivers/net/adm5120sw.c index 17b1f4e49..d80a6a3a1 100644 --- a/target/linux/adm5120/files/drivers/net/adm5120sw.c +++ b/target/linux/adm5120/files/drivers/net/adm5120sw.c @@ -38,6 +38,7 @@ #include <asm/mach-adm5120/adm5120_switch.h> #include "adm5120sw.h" +#include <linux/dma-mapping.h> #define DRV_NAME "adm5120-switch" #define DRV_DESC "ADM5120 built-in ethernet switch driver" @@ -153,7 +154,7 @@ static unsigned int cur_txl, dirty_txl; static unsigned int sw_used; -static spinlock_t tx_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(tx_lock); /* ------------------------------------------------------------------------ */ @@ -216,6 +217,7 @@ static inline int desc_ipcsum_fail(struct dma_desc *desc) /* ------------------------------------------------------------------------ */ +#ifdef CONFIG_ADM5120_SWITCH_DEBUG static void sw_dump_desc(char *label, struct dma_desc *desc, int tx) { u32 t; @@ -336,6 +338,11 @@ static void sw_dump_regs(void) t = sw_read_reg(SWITCH_REG_RLDA); SW_DBG("rlda: %08X\n", t); } +#else +static inline void sw_dump_desc(char *label, struct dma_desc *desc, int tx) {} +static void sw_dump_intr_mask(char *label, u32 mask) {} +static inline void sw_dump_regs(void) {} +#endif /* CONFIG_ADM5120_SWITCH_DEBUG */ /* ------------------------------------------------------------------------ */ @@ -502,7 +509,7 @@ static int adm5120_if_poll(struct napi_struct *napi, int limit) { struct adm5120_if_priv *priv = container_of(napi, struct adm5120_if_priv, napi); - struct net_device *dev = priv->dev; + struct net_device *dev __maybe_unused = priv->dev; int done; u32 status; @@ -920,7 +927,7 @@ static void adm5120_if_tx_timeout(struct net_device *dev) SW_INFO("TX timeout on %s\n", dev->name); } -static void adm5120_if_set_multicast_list(struct net_device *dev) +static void adm5120_if_set_rx_mode(struct net_device *dev) { struct adm5120_if_priv *priv = netdev_priv(dev); u32 ports; @@ -937,7 +944,7 @@ static void adm5120_if_set_multicast_list(struct net_device *dev) t |= (ports << CPUP_CONF_DUNP_SHIFT); if (dev->flags & IFF_PROMISC || dev->flags & IFF_ALLMULTI || - dev->mc_count) + netdev_mc_count(dev)) /* enable multicast packets */ t &= ~(ports << CPUP_CONF_DMCP_SHIFT); else @@ -1024,7 +1031,7 @@ static const struct net_device_ops adm5120sw_netdev_ops = { .ndo_open = adm5120_if_open, .ndo_stop = adm5120_if_stop, .ndo_start_xmit = adm5120_if_hard_start_xmit, - .ndo_set_multicast_list = adm5120_if_set_multicast_list, + .ndo_set_rx_mode = adm5120_if_set_rx_mode, .ndo_do_ioctl = adm5120_if_do_ioctl, .ndo_tx_timeout = adm5120_if_tx_timeout, .ndo_validate_addr = eth_validate_addr, @@ -1076,7 +1083,7 @@ static void adm5120_switch_cleanup(void) adm5120_switch_rx_ring_free(); } -static int __init adm5120_switch_probe(struct platform_device *pdev) +static int __devinit adm5120_switch_probe(struct platform_device *pdev) { u32 t; int i, err; |