summaryrefslogtreecommitdiff
path: root/cleopatre/linux-2.6.25.10-spc300
diff options
context:
space:
mode:
authorYacine Belkadi2011-07-26 14:52:21 +0200
committerYacine Belkadi2011-09-08 16:12:40 +0200
commit53decb28737512b8ef4125382d901fa98123a449 (patch)
tree2b4f380e30897ac9a1d5e84b2dff59450029fa71 /cleopatre/linux-2.6.25.10-spc300
parent21e4811b588663dde6d56164b969fc18ab8816ad (diff)
cleo/linux/drv/eth: add seq_check support, refs #2644
Diffstat (limited to 'cleopatre/linux-2.6.25.10-spc300')
-rw-r--r--cleopatre/linux-2.6.25.10-spc300/drivers/net/arm/Makefile9
-rw-r--r--cleopatre/linux-2.6.25.10-spc300/drivers/net/arm/synop3504.c13
2 files changed, 22 insertions, 0 deletions
diff --git a/cleopatre/linux-2.6.25.10-spc300/drivers/net/arm/Makefile b/cleopatre/linux-2.6.25.10-spc300/drivers/net/arm/Makefile
index e83176ed0c..f3ae6b7e03 100644
--- a/cleopatre/linux-2.6.25.10-spc300/drivers/net/arm/Makefile
+++ b/cleopatre/linux-2.6.25.10-spc300/drivers/net/arm/Makefile
@@ -15,7 +15,16 @@ ifeq ($(CONFIG_SYNOP3504),m)
synop3504mod-objs := synop3504.o synop3504_hw.o
CFLAGS_synop3504.o := -g -O0
CFLAGS_synop3504_hw.o := -g -O0
+
+ ifeq ($(CONFIG_SEQ_CHECK),y)
+ CFLAGS_synop3504.o += -DCONFIG_SEQ_CHECK
+ endif
endif
+
ifeq ($(CONFIG_SYNOP3504),y)
obj-$(CONFIG_SYNOP3504) += synop3504.o synop3504_hw.o
+
+ ifeq ($(CONFIG_SEQ_CHECK),y)
+ CFLAGS_synop3504.o += -DCONFIG_SEQ_CHECK
+ endif
endif
diff --git a/cleopatre/linux-2.6.25.10-spc300/drivers/net/arm/synop3504.c b/cleopatre/linux-2.6.25.10-spc300/drivers/net/arm/synop3504.c
index ce149ca768..24bb2ab491 100644
--- a/cleopatre/linux-2.6.25.10-spc300/drivers/net/arm/synop3504.c
+++ b/cleopatre/linux-2.6.25.10-spc300/drivers/net/arm/synop3504.c
@@ -52,10 +52,12 @@
#include <linux/phy.h>
#include <linux/dma-mapping.h>
#include <linux/kthread.h>
+#include <net/seq_check.h>
#include "synop3504_hw.h"
#include "synop3504.h"
+
/** Max size of a eth frame (size for rx buffer) must be align on 4 bytes */
#define PKT_BUF_SZ 1524
@@ -127,6 +129,10 @@ struct net_priv
unsigned int link;
unsigned int speed;
unsigned int duplex;
+
+#ifdef CONFIG_SEQ_CHECK
+ struct seq_check_ctx seq_check_ctx;
+#endif
};
/** How many Tx buffers to clean */
@@ -766,6 +772,8 @@ static int synop3504_tx(struct sk_buff *skb, struct net_device *dev)
TRACE("%s: Transmit\n", dev->name);
+ seq_check_tx(&priv->seq_check_ctx, skb);
+
n = tx->head_ptr;
//Increase head pointer and check end of ring
@@ -914,6 +922,8 @@ static void synop3504_rx(struct net_device *dev, int *budget)
skb->protocol = eth_type_trans(skb, dev);
dev->last_rx = jiffies;
+ seq_check_rx(&priv->seq_check_ctx, skb);
+
//Send RX packet to Linux
netif_receive_skb(skb);
@@ -1725,6 +1735,8 @@ static int __init synop3504_module_probe(struct platform_device *pdev)
priv->support_rmii = pdata->support_rmii;
priv->phy_addr = pdata->phy_addr;
+ seq_check_init(&priv->seq_check_ctx, "eth_drv");
+
//Proceed the init driver
result = synop3504_init(dev);
if(result < 0)
@@ -1761,6 +1773,7 @@ static int __init synop3504_module_probe(struct platform_device *pdev)
}
}
+
platform_set_drvdata(pdev, dev);
return 0;