Skip to contentSkip to conversation

sh: sh_eth: Change new network API

PATCH New Nobuhiro Iwamatsu 2 participants 3 messages Nov 21, 2008 – Nov 25, 2008 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: sh_eth: Change new network API

sh_eth used old network API. This patch changed new API.

---
 cpu/sh4/cpu.c        |    8 +
 drivers/net/sh_eth.c |  355 ++++++++++++++++++++++++++++++++------------------
 drivers/net/sh_eth.h |   10 +-
 include/netdev.h     |    1 +
 4 files changed, 240 insertions(+), 134 deletions(-)
cpu/sh4/cpu.c +8 -0
index d94e139..52b6cfd 100644
@@ -82,3 +82,11 @@ int dcache_status (void)
 {
 	return 0;
 }
+
+int cpu_eth_init(bd_t *bis)
+{
+#ifdef CONFIG_SH_ETHER
+	sh_eth_initialize(bis);
+#endif
+	return 0;
+}
drivers/net/sh_eth.c +225 -130

550 lines not on this page · raw message

drivers/net/sh_eth.h +6 -4
index 9cf0ea0..a13fff0 100644
@@ -20,6 +20,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <netdev.h>
 #include <asm/types.h>
 
 #define SHETHER_NAME "sh_eth"
@@ -48,7 +49,7 @@
 #define TX_DESC_PADDING		4
 #define TX_DESC_SIZE		(12 + TX_DESC_PADDING)
 
-/* Tx descriptor. We always use 4 bytes of padding */
+/* Tx descriptor. We always use 3 bytes of padding */
 struct tx_desc_s {
 	volatile u32 td0;
 	u32 td1;
@@ -72,7 +73,7 @@ struct rx_desc_s {
 	u32 padding;
 };
 
-struct port_info_s {
+struct sh_eth_info {
 	struct tx_desc_s *tx_desc_malloc;
 	struct tx_desc_s *tx_desc_base;
 	struct tx_desc_s *tx_desc_cur;
@@ -83,11 +84,12 @@ struct port_info_s {
 	u8 *rx_buf_base;
 	u8 mac_addr[6];
 	u8 phy_addr;
+	struct eth_device *dev;
 };
 
-struct dev_info_s {
+struct sh_eth_dev {
 	int port;
-	struct port_info_s port_info[MAX_PORT_NUM];
+	struct sh_eth_info port_info[MAX_PORT_NUM];
 };
 
 /* Register Address */
include/netdev.h +1 -0
index 751f0da..a7d662d 100644
@@ -70,6 +70,7 @@ int skge_initialize(bd_t *bis);
 int tsi108_eth_initialize(bd_t *bis);
 int uec_initialize(int index);
 int uli526x_initialize(bd_t *bis);
+int sh_eth_initialize(bd_t *bis);
 
 /* Boards with PCI network controllers can call this from their board_eth_init()
  * function to initialize whatever's on board.
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 1/1 sh: sh_eth: Change new network API

Hello,

Quoted 11 lines · Nobuhiro Iwamatsu

sh_eth used old network API. This patch changed new API.

---
 cpu/sh4/cpu.c        |    8 +
 drivers/net/sh_eth.c |  355
++++++++++++++++++++++++++++++++------------------
 drivers/net/sh_eth.h |   10 +-
 include/netdev.h     |    1 +
 4 files changed, 240 insertions(+), 134 deletions(-)

Wonderful! I'll look it over this weekend and will provide feedback.

regards,
Ben