Skip to contentSkip to conversation

w5300: add WIZnet W5300 Ethernet driver

PATCH In review Taehun Kim 2 participants 3 messages Oct 22, 2011 – Oct 29, 2011

Subsystems (3)
lore
Share & tools
lore

Taehun Kim

author
#0 lore raw

PATCH 1/1 w5300: add WIZnet W5300 Ethernet driver

hello, guys.

I have rewritten W5300 driver by applying the Francois Romieu's feedback
(http://marc.info/?l=linux-netdev&m=131714561419786&w=2).

This driver has been tested in the ARM board.

Please review this driver and apply it if do not have any problems.

Thank you.

T.K.

---
 drivers/net/ethernet/Kconfig         |    1 +
 drivers/net/ethernet/Makefile        |    1 +
 drivers/net/ethernet/wiznet/Kconfig  |   32 ++
 drivers/net/ethernet/wiznet/Makefile |    5 +
 drivers/net/ethernet/wiznet/w5300.c  |  706 ++++++++++++++++++++++++++++++++++
 drivers/net/ethernet/wiznet/w5300.h  |  121 ++++++
 6 files changed, 866 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/ethernet/wiznet/Kconfig
 create mode 100644 drivers/net/ethernet/wiznet/Makefile
 create mode 100644 drivers/net/ethernet/wiznet/w5300.c
 create mode 100644 drivers/net/ethernet/wiznet/w5300.h
drivers/net/ethernet/Kconfig +1 -0
index 6dff5a0..6325d85 100644
@@ -173,5 +173,6 @@ source "drivers/net/ethernet/tundra/Kconfig"
 source "drivers/net/ethernet/via/Kconfig"
 source "drivers/net/ethernet/xilinx/Kconfig"
 source "drivers/net/ethernet/xircom/Kconfig"
+source "drivers/net/ethernet/wiznet/Kconfig"
 
 endif # ETHERNET
drivers/net/ethernet/Makefile +1 -0
index c53ad3a..7bd5211 100644
@@ -72,3 +72,4 @@ obj-$(CONFIG_NET_VENDOR_TUNDRA) += tundra/
 obj-$(CONFIG_NET_VENDOR_VIA) += via/
 obj-$(CONFIG_NET_VENDOR_XILINX) += xilinx/
 obj-$(CONFIG_NET_VENDOR_XIRCOM) += xircom/
+obj-$(CONFIG_NET_VENDOR_WIZNET) += wiznet/
drivers/net/ethernet/wiznet/Kconfig new file +32 -0
new file mode 100644
index 0000000..b5925bd
@@ -0,0 +1,32 @@
+#
+# WIZnet device configuration
+#
+
+config NET_VENDOR_WIZNET
+	bool "WIZnet devices"
+	default y
+	---help---
+	  If you have a network (Ethernet) card belonging to this class, say Y
+	  and read the Ethernet-HOWTO, available from
+	  <http://www.tldp.org/docs.html#howto>.
+
+	  Note that the answer to this question doesn't directly affect the
+	  kernel: saying N will just cause the configurator to skip all
+	  the questions about WIZnet devices. If you say Y, you will be asked for
+	  your specific card in the following questions.
+
+if NET_VENDOR_WIZNET
+
+config W5300
+	tristate "WIZnet W5300 Ethernet support"
+	depends on ARM
+	---help---
+	  This driver supports the Ethernet in the WIZnet W5300 chips.
+	  W5300 supports hardwired TCP/IP stack. But this driver is limited to
+	  the Ethernet function. To use hardwired TCP/IP stack, need to modify
+	  the TCP/IP stack in linux kerenl.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called w5300.
+
+endif # NET_VENDOR_WIZNET
drivers/net/ethernet/wiznet/Makefile new file +5 -0
new file mode 100644
index 0000000..53120bc
@@ -0,0 +1,5 @@
+#
+# Makefile for the WIZnet device drivers.
+#
+
+obj-$(CONFIG_W5300) += w5300.o
drivers/net/ethernet/wiznet/w5300.c new file +706 -0

706 lines not on this page · raw message

drivers/net/ethernet/wiznet/w5300.h new file +121 -0

121 lines not on this page · raw message

Signature · 1 line
1.7.1
maintainer
#1 lore raw

From: Taehun Kim <[email protected]>
Date: Sat, 22 Oct 2011 17:41:56 +0900

drivers/net/ethernet/wiznet/w5300.c line 76

Quoted 10 lines
drivers/net/ethernet/wiznet/w5300.c new file +10 -0
+struct wiz_private {
+	void __iomem *base;
+	struct net_device *dev;
+	u8 rxbuf_conf[MAX_SOCK_NUM];
+	u8 txbuf_conf[MAX_SOCK_NUM];
+	struct net_device_stats stats;
+	struct napi_struct napi;
+	spinlock_t lock;
+	u32 msg_enable;
+};

You don't need to have a private net_device_stats, just use the one in struct net_device, and then you can also get rid of your private ->ndo_get_stats() method.

author
#2 lore raw

2011/10/25 David Miller <[email protected]>:

Quoted 18 lines

From: Taehun Kim <[email protected]>
Date: Sat, 22 Oct 2011 17:41:56 +0900

drivers/net/ethernet/wiznet/w5300.c line 76

Quoted 10 lines
drivers/net/ethernet/wiznet/w5300.c new file +10 -0
+struct wiz_private {
+     void __iomem *base;
+     struct net_device *dev;
+     u8 rxbuf_conf[MAX_SOCK_NUM];
+     u8 txbuf_conf[MAX_SOCK_NUM];
+     struct net_device_stats stats;
+     struct napi_struct napi;
+     spinlock_t lock;
+     u32 msg_enable;
+};

You don't need to have a private net_device_stats, just use the one in struct net_device, and then you can also get rid of your private ->ndo_get_stats() method.

Thank you for your feedback :)

I am working on this drive by referencing other Ethernet drivers. I have one question.

Should I suggest the updated driver patch to this thread or new thread?