1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

adm5120: merge 3.3 patches

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31511 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg
2012-04-29 07:36:43 +00:00
parent 71b94eaba4
commit 0c3e51f31c
38 changed files with 223 additions and 1919 deletions

View File

@@ -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;