mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-26 00:56:47 +02:00
05735d303b
Partially based on the 3.1 patches by Hartmut Knaack <knaack.h [at] gmx.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31474 3c298f89-4303-0410-b956-a3cf2f4a3e73
85 lines
2.7 KiB
Diff
85 lines
2.7 KiB
Diff
--- a/drivers/net/adm5120sw.c
|
|
+++ b/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(struc
|
|
|
|
/* ------------------------------------------------------------------------ */
|
|
|
|
+#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_s
|
|
{
|
|
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
|
|
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_lis
|
|
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 adm51
|
|
.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;
|