summaryrefslogtreecommitdiff
path: root/target/linux/adm5120/patches-3.3/a12-adm5120sw-3.3-fixes.patch
blob: aa2be2e4adbc904079931075e2b2138c6a28628e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
--- 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;