Re: [U-Boot] [Turris Omnia] Btrfs support status?

2017-04-26 Thread Tomas Hlavacek
Hi Marek!

On Tue, Apr 25, 2017 at 3:37 PM, Marek BehĂșn  wrote:
> Hello,
>
> the Turris Omnia router uses btrfs as the main filesystem, from which
> it also loads kernel and dts. We have an implementation in our internal
> u-boot
> (https://gitlab.labs.nic.cz/turris/turris-omnia-uboot/tree/master/fs/btrfs).
>
> As I understand it, this code was already proposed for u-boot:
> https://patchwork.ozlabs.org/patch/300593/ . Is this true?

I picked these patches in the first place and I have fixed some
obvious problems in my version in Turris Omnia tree (see git log).
Please note that it is more a proof of concept, that we
(unfortunately) use. I think that it needs removing static variables,
remove predetermined constant size for many variable-sized data
structures and it needs heavy code cleanup. Or rewrite...

Tomas
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] powerpc: P2020 relocation breaks with ELDK 5.5

2015-04-22 Thread Tomas Hlavacek

Hello!

It seems that there might be some problem with relocation on P2020RDB-PC 
board when U-Boot is compiled with a relatively new toolchain. It is hard 
to detect because it seems that the relocation leaves only some constants 
on their old addresses but otherwise it works fine.


I have a Turris board which is a derivative of P2020RDB-PC (it differs only 
in minor aspects). I have a perfectly working U-Boot (current master) 
compiled with ELDK 5.2.1. But compiling the same tree with anything newer 
(ELDK 5.5+ or current OpenWRT buildroot) causes this


U-Boot 2015.04-8-g2b3a8e8 (Apr 21 2015 - 06:18:55)

CPU0: P2020E, Version: 2.1, (0x80ea0021)
Core: e500, Version: 5.1, (0x80211051)
Clock Configuration:
CPU0:1200 MHz, CPU1:1200 MHz, 
CCB:600 MHz,

DDR:400 MHz (800 MT/s data rate) (Asynchronous), LBC:37.500 MHz
L1: D-cache 32 KiB enabled
I-cache 32 KiB enabled
Board: P2020RDB-PCA CPLD: V4.1 PCBA: V4.0
Error reading i2c boot information!
I2C: ready
SPI: ready
DRAM: DDR: failed to read SPD from address 82
SPD error on controller 0! Trying fallback to raw timing calculation
Detected UDIMM Fixed DDR on board
1 GiB (DDR3, 64-bit, CL=6, ECC off)
Flash: 16 MiB
L2: 512 KiB enabled
NAND: 256 MiB
MMC: FSL_SDHC: 0
*** Warning - bad CRC, using default environment

PCIe1: Root Complex of mini PCIe SLOT, no link, regs @ 0xffe0a000
PCIe1: Bus 00 - 00
PCIe2: Root Complex of PCIe SLOT, no link, regs @ 0xffe09000
PCIe2: Bus 01 - 01
In: serial
Out: serial
Err: serial
Net: No address specified for VSC7385 microcode.
eTSEC1 [PRIME]
Error: eTSEC1 address not set.
, eTSEC2
Error: eTSEC2 address not set.
, eTSEC3
Error: eTSEC3 address not set.

Hit any key to stop autoboot: 0 
= protect off 0xEFF0 0xEFFF

Un-Protected 8 sectors
= era 0xEFF0 0xEFFF

 done
Erased 8 sectors
Bad trap at PC: 3fef785c, SR: 29200, vector=d00
NIP: 3FEF785C XER:  LR: 3FF4C6C8 REGS: 3fdedc50 TRAP: 0d00 DAR: 
F000

MSR: 00029200 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 00

GPR00: 00FF 3FDEDD40 3FDEDF08 EFFA5C28 EFFF 3FDEDD98 3FF6D5D4 
 
GPR08: 0080 3FDEDDD8  EFFF 44002084 49858508 3FFB0224 
000A 
GPR16: 3FF55C40 3FF55C38 3FF55C30 000A   3FFB0220 
EFFA5C28 
GPR24:  0002   3FDEDDD8 3FDEDD98 3FF689F4 
3FF6D5D4 
Call backtrace: 
3FDF3668 3FF12D4C 3FEFAAA0 3FEFB15C 3FF186F4 3FEFB8F0 3FF46C34 
3FEFBCAC 3FEF164C 
Exception in kernel pc 3fef785c signal 0


ERROR ### Please RESET the board

I looked into that and it seems that the exception occurs when hush calls 
getenv(IFS) (common/cli_hush.c:3133) in a subsequent strcat() because 
IFS is actually a pointer to already-erased flash (0xeff...).


I have to admit that I don't understand reloc code for this CPU so I am 
asking this question or requesting help since I was unable to fix it or 
find out what is wrong on my own yet.


Thanks,
Tomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 00/67] net: net subsystem ops cleanup

2012-11-21 Thread Tomas Hlavacek
This patchi series is a first stage of preparation of the net subsystem
for the driver model.

The idea of this patchset is:
1) Remove ops .init, .send, .recv and .halt from the eth_device struct.
   Add a sparate structure eth_ops which is ready for inclusion to DM core.
2) Replace dynamic init of ops function pointers by static struct.
3) Do minor style cleanup.

There are binary size changes. Example:

before the series applied:

Configuring for colibri_pxa270 board...
   textdata bss dec hex filename
 2479104412  272348  524670   8017e ./u-boot

and after:

Configuring for colibri_pxa270 board...
   textdata bss dec hex filename
 2478784432  272368  524678   80186 ./u-boot

Changes in v2:
  - Fix hidden drivers in arch/*
  - Prove bisectability:

MAKEALL arm (1/67 applied):
Boards compiled: 274

MAKEALL arm (49/67 applied):
Boards compiled: 274

MAKEALL arm (67/67 applied):
Boards compiled: 274

MAKEALL mips (1/67 applied):
Boards compiled: 21

MAKEALL mips (49/67 applied):
Boards compiled: 21

MAKEALL mips (67/67 applied):
Boards compiled: 21

MAKEALL powepc (1/67 applied):
Boards compiled: 623

MAKEALL powepc (49/67 applied):
Boards compiled: 623

MAKEALL powepc (67/67 applied):
Boards compiled: 623


Tomas Hlavacek (67):
  net: dm: Pull out ops from struct eth_device
  net: 4xx_enet: Pull out init of struct eth_ops
  net: altera_tse: Pull out init of struct eth_ops
  net: dm9000x: Pull out init of struct eth_ops
  net: armada100_fec: Pull out init of struct eth_ops
  net: at91_emac: Pull out init of struct eth_ops
  net: ax88180: Pull out init of struct eth_ops
  net: bfin_mac: Pull out init of struct eth_ops
  net: calxedaxgmac: Pull out init of struct eth_ops
  net: cs8900: Pull out init of struct eth_ops
  net: davinci_emac: Pull out init of struct eth_ops
  net: dc2114x: Pull out init of struct eth_ops
  net: designware: Pull out init of struct eth_ops
  net: dnet: Pull out init of struct eth_ops
  net: e1000: Pull out init of struct eth_ops
  net: eepro100: Pull out init of struct eth_ops
  net: enc28j60: Pull out init of struct eth_ops
  net: ep93xx_eth: Pull out init of struct eth_ops
  net: ethoc: Pull out init of struct eth_ops
  net: fec_mxc: Pull out init of struct eth_ops
  net: ftgmac100: Pull out init of struct eth_ops
  net: greth.c: Pull out init of struct eth_ops
  net: fsl_mcdmafec: Pull out init of struct eth_ops
  net: inca-ip_sw: Pull out init of struct eth_ops
  net: ks8695eth: Pull out init of struct eth_ops
  net: lan91c96: Pull out init of struct eth_ops
  net: macb: Pull out init of struct eth_ops
  net: mcffec: Pull out init of struct eth_ops
  net: mpc5xxx_fec: Pull out init of struct eth_ops
  net: mvgbe: Pull out init of struct eth_ops
  net: mpc512x_fec: Pull out init of struct eth_ops
  net: natsemi: Pull out init of struct eth_ops
  net: ne2000: Pull out init of struct eth_ops
  net: npe: Pull out init of struct eth_ops
  net: ns8382x: Pull out init of struct eth_ops
  net: pcnet: Pull out init of struct eth_ops
  net: plb2800_eth: Pull out init of struct eth_ops
  net: rtl8139: Pull out init of struct eth_ops
  net: rtl8169: Pull out init of struct eth_ops
  net: smc9: Pull out init of struct eth_ops
  net: smc911x: Pull out init of struct eth_ops
  net: tsec: Pull out init of struct eth_ops
  net: tsi108_eth: Pull out init of struct eth_ops
  net: uli526x: Pull out init of struct eth_ops
  net: xilinx_axi_emac: Pull out init of struct eth_ops
  net: xilinx_emaclite: Pull out init of struct eth_ops
  net: zynq_gem: Pull out init of struct eth_ops
  net: xilinx_ll_temac: Pull out init of struct eth_ops
  net: sh_eth: Pull out init of struct eth_ops
  net: au1x00_eth: Pull out init of struct eth_ops
  net: mpc8220_fec: Pull out init of struct eth_ops
  net: mpc8260_fec: Pull out init of struct eth_ops
  net: mpc8260_scc: Pull out init of struct eth_ops
  net: mpc85xx_fec: Pull out init of struct eth_ops
  net: mpc8xx_scc: Pull out init of struct eth_ops
  net: db64360/mv_eth: Pull out init of struct eth_ops
  net: mpc8xx_fec: Pull out init of struct eth_ops
  net: db64460/mv_eth: Pull out init of struct eth_ops
  net: cpci750/mv_eth: Pull out init of struct eth_ops
  net: evb64260: Pull out init of struct eth_ops
  net: p3mx/mv_eth: Pull out init of struct eth_ops
  net: cpsw: Pull out init of struct eth_ops
  net: fm_eth: Pull out init of struct eth_ops
  net: ftmac100: Pull out init of struct eth_ops
  net: qe: uec: Pull out init of struct eth_ops
  net: usb: asix: Pull out init of struct eth_ops
  net: usb: smsc95xx: Pull out init of struct eth_ops

 arch/mips/cpu/mips32/au1x00/au1x00_eth.c |   14 +-
 arch/powerpc/cpu/mpc8220/fec.c   |   11 +++
 arch/powerpc/cpu/mpc8260/ether_fcc.c |   14 +-
 arch/powerpc/cpu/mpc8260/ether_scc.c |   12 
 arch/powerpc/cpu/mpc85xx/ether_fcc.c |   14 +-
 arch/powerpc/cpu/mpc8xx/fec.c|   12

[U-Boot] [PATCH v2 05/67] net: armada100_fec: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/armada100_fec.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/armada100_fec.c b/drivers/net/armada100_fec.c
index f256381..d826e11 100644
--- a/drivers/net/armada100_fec.c
+++ b/drivers/net/armada100_fec.c
@@ -678,6 +678,13 @@ static int armdfec_recv(struct eth_device *dev)
return 0;
 }
 
+static struct eth_ops armada100_fec_ops = {
+   .init = armdfec_init,
+   .halt = armdfec_halt,
+   .send = armdfec_send,
+   .recv = armdfec_recv
+};
+
 int armada100_fec_register(unsigned long base_addr)
 {
struct armdfec_device *darmdfec;
@@ -718,10 +725,7 @@ int armada100_fec_register(unsigned long base_addr)
/* must be less than sizeof(dev-name) */
strcpy(dev-name, armd-fec0);
 
-   dev-eo-init = armdfec_init;
-   dev-eo-halt = armdfec_halt;
-   dev-eo-send = armdfec_send;
-   dev-eo-recv = armdfec_recv;
+   dev-eo = armada100_fec_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 04/67] net: dm9000x: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/dm9000x.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
index bd96948..f6b226c 100644
--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -623,6 +623,13 @@ dm9000_phy_write(int reg, u16 value)
DM9000_DBG(dm9000_phy_write(reg:0x%x, value:0x%x)\n, reg, value);
 }
 
+static struct eth_ops dm9000_ops = {
+   .init = dm9000_init,
+   .send = dm9000_send,
+   .recv = dm9000_rx,
+   .halt = dm9000_halt
+};
+
 int dm9000_initialize(bd_t *bis)
 {
struct eth_device *dev = (dm9000_info.netdev);
@@ -630,10 +637,7 @@ int dm9000_initialize(bd_t *bis)
/* Load MAC address from EEPROM */
dm9000_get_enetaddr(dev);
 
-   dev-eo-init = dm9000_init;
-   dev-eo-halt = dm9000_halt;
-   dev-eo-send = dm9000_send;
-   dev-eo-recv = dm9000_rx;
+   dev-eo = dm9000_ops;
sprintf(dev-name, dm9000);
 
eth_register(dev);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 03/67] net: altera_tse: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/altera_tse.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c
index ee1a1f6..89cd23e 100644
--- a/drivers/net/altera_tse.c
+++ b/drivers/net/altera_tse.c
@@ -890,6 +890,14 @@ static int tse_eth_init(struct eth_device *dev, bd_t * bd)
return priv-link ? 0 : -1;
 }
 
+static struct eth_ops altera_tse_ops = {
+   .init = tse_eth_init,
+   .halt = tse_eth_halt,
+   .send = tse_eth_send,
+   .recv = tse_eth_rx,
+   .write_hwaddr = tse_set_mac_address
+};
+
 /* TSE init code */
 int altera_tse_initialize(u8 dev_num, int mac_base,
  int sgdma_rx_base, int sgdma_tx_base,
@@ -951,11 +959,7 @@ int altera_tse_initialize(u8 dev_num, int mac_base,
 
/* init eth structure */
dev-priv = priv;
-   dev-eo-init = tse_eth_init;
-   dev-eo-halt = tse_eth_halt;
-   dev-eo-send = tse_eth_send;
-   dev-eo-recv = tse_eth_rx;
-   dev-eo-write_hwaddr = tse_set_mac_address;
+   dev-eo = altera_tse_ops;
sprintf(dev-name, %s-%hu, ALTERA_TSE, dev_num);
 
eth_register(dev);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 08/67] net: bfin_mac: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/bfin_mac.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index ef4736f..b2c4b0f 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -91,6 +91,14 @@ static int bfin_miiphy_write(const char *devname, uchar 
addr, uchar reg, ushort
return 0;
 }
 
+static struct eth_ops bfin_emac_ops = {
+   .init = bfin_EMAC_init,
+   .halt = bfin_EMAC_halt,
+   .send = bfin_EMAC_send,
+   .recv = bfin_EMAC_recv,
+   .write_hwaddr = bfin_EMAC_setup_addr
+};
+
 int bfin_EMAC_initialize(bd_t *bis)
 {
struct eth_device *dev;
@@ -103,11 +111,7 @@ int bfin_EMAC_initialize(bd_t *bis)
 
dev-iobase = 0;
dev-priv = 0;
-   dev-eo-init = bfin_EMAC_init;
-   dev-eo-halt = bfin_EMAC_halt;
-   dev-eo-send = bfin_EMAC_send;
-   dev-eo-recv = bfin_EMAC_recv;
-   dev-eo-write_hwaddr = bfin_EMAC_setup_addr;
+   dev-eo = bfin_emac_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 10/67] net: cs8900: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/cs8900.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c
index 65a4254..a78eada 100644
--- a/drivers/net/cs8900.c
+++ b/drivers/net/cs8900.c
@@ -299,6 +299,13 @@ int cs8900_e2prom_write(struct eth_device *dev, u8 addr, 
u16 value)
return 0;
 }
 
+static struct eth_ops cs8900_ops = {
+   .init = cs8900_init,
+   .halt = cs8900_halt,
+   .send = cs8900_send,
+   .recv = cs8900_recv
+};
+
 int cs8900_initialize(u8 dev_num, int base_addr)
 {
struct eth_device *dev;
@@ -320,10 +327,7 @@ int cs8900_initialize(u8 dev_num, int base_addr)
 
dev-iobase = base_addr;
dev-priv = priv;
-   dev-eo-init = cs8900_init;
-   dev-eo-halt = cs8900_halt;
-   dev-eo-send = cs8900_send;
-   dev-eo-recv = cs8900_recv;
+   dev-eo = cs8900_ops;
 
/* Load MAC address from EEPROM */
cs8900_get_enetaddr(dev);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 01/67] net: dm: Pull out ops from struct eth_device

2012-11-21 Thread Tomas Hlavacek
Add struct eth_ops into include/net.h.
Pull out ops (function pointers to functions init, send recv, halt etc.)
from struct eth_device to the new struct eth_ops.
Fix ops usage in all affected drivers.

This is the first preparation step for DM in the net subsystem. Idea is
to have pointers to the ops functions stored in a separate static
structure. The structure then will be passed to the DM driver instance on
driver init.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 arch/mips/cpu/mips32/au1x00/au1x00_eth.c |   10 +-
 arch/powerpc/cpu/mpc8220/fec.c   |8 
 arch/powerpc/cpu/mpc8260/ether_fcc.c |   10 +-
 arch/powerpc/cpu/mpc8260/ether_scc.c |8 
 arch/powerpc/cpu/mpc85xx/ether_fcc.c |   10 +-
 arch/powerpc/cpu/mpc8xx/fec.c|8 
 arch/powerpc/cpu/mpc8xx/scc.c|8 
 board/Marvell/db64360/mv_eth.c   |8 
 board/Marvell/db64460/mv_eth.c   |8 
 board/davinci/da8xxevm/da830evm.c|2 +-
 board/esd/cpci750/mv_eth.c   |8 
 board/evb64260/eth.c |8 
 board/prodrive/p3mx/mv_eth.c |8 
 drivers/net/4xx_enet.c   |8 
 drivers/net/altera_tse.c |   10 +-
 drivers/net/armada100_fec.c  |8 
 drivers/net/at91_emac.c  |   10 +-
 drivers/net/ax88180.c|8 
 drivers/net/bfin_mac.c   |   10 +-
 drivers/net/calxedaxgmac.c   |8 
 drivers/net/cpsw.c   |8 
 drivers/net/cs8900.c |8 
 drivers/net/davinci_emac.c   |   10 +-
 drivers/net/dc2114x.c|8 
 drivers/net/designware.c |   10 +-
 drivers/net/dm9000x.c|8 
 drivers/net/dnet.c   |   10 +-
 drivers/net/e1000.c  |8 
 drivers/net/eepro100.c   |8 
 drivers/net/enc28j60.c   |   10 +-
 drivers/net/ep93xx_eth.c |8 
 drivers/net/ethoc.c  |   10 +-
 drivers/net/fec_mxc.c|   10 +-
 drivers/net/fm/eth.c |8 
 drivers/net/fsl_mcdmafec.c   |8 
 drivers/net/ftgmac100.c  |8 
 drivers/net/ftmac100.c   |8 
 drivers/net/greth.c  |8 
 drivers/net/inca-ip_sw.c |8 
 drivers/net/ks8695eth.c  |8 
 drivers/net/lan91c96.c   |8 
 drivers/net/macb.c   |   10 +-
 drivers/net/mcffec.c |8 
 drivers/net/mpc512x_fec.c|8 
 drivers/net/mpc5xxx_fec.c|8 
 drivers/net/mvgbe.c  |   10 +-
 drivers/net/natsemi.c|8 
 drivers/net/ne2000_base.c|8 
 drivers/net/npe/npe.c|8 
 drivers/net/ns8382x.c|8 
 drivers/net/pcnet.c  |8 
 drivers/net/plb2800_eth.c|8 
 drivers/net/rtl8139.c|   10 +-
 drivers/net/rtl8169.c|8 
 drivers/net/sh_eth.c |8 
 drivers/net/smc9.c   |   10 +-
 drivers/net/smc911x.c|8 
 drivers/net/tsec.c   |   10 +-
 drivers/net/tsi108_eth.c |8 
 drivers/net/uli526x.c|8 
 drivers/net/xilinx_axi_emac.c|   10 +-
 drivers/net/xilinx_emaclite.c|8 
 drivers/net/xilinx_ll_temac.c|   14 +++---
 drivers/net/zynq_gem.c   |   10 +-
 drivers/qe/uec.c |8 
 drivers/usb/eth/asix.c   |   10 +-
 drivers/usb/eth/smsc95xx.c   |   10 +-
 include/net.h|   17 +++--
 net/eth.c|   16 
 69 files changed, 308 insertions(+), 303 deletions(-)

diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_eth.c 
b/arch/mips/cpu/mips32/au1x00/au1x00_eth.c
index ac03a45..2909fb3 100644
--- a/arch/mips/cpu/mips32/au1x00/au1x00_eth.c
+++ b/arch/mips/cpu/mips32/au1x00/au1x00_eth.c
@@ -295,11 +295,11 @@ int au1x00_enet_initialize(bd_t *bis){
 
sprintf(dev-name, Au1X00 ethernet);
dev-iobase = 0;
-   dev-priv   = 0;
-   dev-init

[U-Boot] [PATCH v2 09/67] net: calxedaxgmac: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/calxedaxgmac.c |   14 ++
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/net/calxedaxgmac.c b/drivers/net/calxedaxgmac.c
index 2346feb..3550160 100644
--- a/drivers/net/calxedaxgmac.c
+++ b/drivers/net/calxedaxgmac.c
@@ -508,6 +508,15 @@ static void xgmac_halt(struct eth_device *dev)
priv-rx_currdesc = 0;
 }
 
+static struct eth_ops xgmac_ops = {
+   .init = xgmac_init,
+   .send = xgmac_tx,
+   .recv = xgmac_rx,
+   .halt = xgmac_halt
+};
+
+
+
 int calxedaxgmac_initialize(u32 id, ulong base_addr)
 {
struct eth_device *dev;
@@ -543,10 +552,7 @@ int calxedaxgmac_initialize(u32 id, ulong base_addr)
macaddr[0] = readl(regs-macaddr[0].lo);
memcpy(dev-enetaddr, macaddr, 6);
 
-   dev-eo-init = xgmac_init;
-   dev-eo-send = xgmac_tx;
-   dev-eo-recv = xgmac_rx;
-   dev-eo-halt = xgmac_halt;
+   dev-eo = xgmac_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 11/67] net: davinci_emac: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/davinci_emac.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index a221092..5701f75 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -769,6 +769,14 @@ static int davinci_eth_rcv_packet (struct eth_device *dev)
return (0);
 }
 
+static struct eth_ops davinci_emac_ops = {
+   .init = davinci_eth_open,
+   .halt = davinci_eth_close,
+   .send = davinci_eth_send_packet,
+   .recv = davinci_eth_rcv_packet,
+   .write_hwaddr = davinci_eth_set_mac_addr
+};
+
 /*
  * This function initializes the emac hardware. It does NOT initialize
  * EMAC modules power or pin multiplexors, that is done by board_init()
@@ -791,11 +799,7 @@ int davinci_emac_initialize(void)
sprintf(dev-name, DaVinci-EMAC);
 
dev-iobase = 0;
-   dev-eo-init = davinci_eth_open;
-   dev-eo-halt = davinci_eth_close;
-   dev-eo-send = davinci_eth_send_packet;
-   dev-eo-recv = davinci_eth_rcv_packet;
-   dev-eo-write_hwaddr = davinci_eth_set_mac_addr;
+   dev-eo = davinci_emac_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 06/67] net: at91_emac: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/at91_emac.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/at91_emac.c b/drivers/net/at91_emac.c
index 3395dcc..464d539 100644
--- a/drivers/net/at91_emac.c
+++ b/drivers/net/at91_emac.c
@@ -494,6 +494,14 @@ static int at91emac_write_hwaddr(struct eth_device *netdev)
return 0;
 }
 
+static struct eth_ops at91emac_ops = {
+   .init = at91emac_init,
+   .halt = at91emac_halt,
+   .send = at91emac_send,
+   .recv = at91emac_recv,
+   .write_hwaddr = at91emac_write_hwaddr
+};
+
 int at91emac_register(bd_t *bis, unsigned long iobase)
 {
emac_device *emac;
@@ -518,11 +526,7 @@ int at91emac_register(bd_t *bis, unsigned long iobase)
sprintf(dev-name, emac);
dev-iobase = iobase;
dev-priv = emacfix;
-   dev-eo-init = at91emac_init;
-   dev-eo-halt = at91emac_halt;
-   dev-eo-send = at91emac_send;
-   dev-eo-recv = at91emac_recv;
-   dev-eo-write_hwaddr = at91emac_write_hwaddr;
+   dev-eo = at91emac_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 02/67] net: 4xx_enet: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/4xx_enet.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/4xx_enet.c b/drivers/net/4xx_enet.c
index 27b66dd..309e616 100644
--- a/drivers/net/4xx_enet.c
+++ b/drivers/net/4xx_enet.c
@@ -1905,6 +1905,13 @@ static int ppc_4xx_eth_rx (struct eth_device *dev)
return length;
 }
 
+static struct eth_ops ppc_4xx_eth_ops = {
+   .init = ppc_4xx_eth_init,
+   .send = ppc_4xx_eth_send,
+   .recv = ppc_4xx_eth_rx,
+   .halt = ppc_4xx_eth_halt
+};
+
 int ppc_4xx_eth_initialize (bd_t * bis)
 {
static int virgin = 0;
@@ -2023,10 +2030,7 @@ int ppc_4xx_eth_initialize (bd_t * bis)
 
sprintf (dev-name, ppc_4xx_eth%d, eth_num - 
CONFIG_EMAC_NR_START);
dev-priv = (void *) hw;
-   dev-eo-init = ppc_4xx_eth_init;
-   dev-eo-halt = ppc_4xx_eth_halt;
-   dev-eo-send = ppc_4xx_eth_send;
-   dev-eo-recv = ppc_4xx_eth_rx;
+   dev-eo = ppc_4xx_eth_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 14/67] net: dnet: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/dnet.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dnet.c b/drivers/net/dnet.c
index be0891f..126828e 100644
--- a/drivers/net/dnet.c
+++ b/drivers/net/dnet.c
@@ -355,6 +355,13 @@ static void dnet_halt(struct eth_device *netdev)
dnet_writew_mac(dnet, DNET_INTERNAL_MODE_REG, 0);
 }
 
+static struct eth_ops dnet_ops = {
+   .init = dnet_init,
+   .halt = dnet_halt,
+   .send = dnet_send,
+   .recv = dnet_recv
+};
+
 int dnet_eth_initialize(int id, void *regs, unsigned int phy_addr)
 {
struct dnet_device *dnet;
@@ -374,10 +381,7 @@ int dnet_eth_initialize(int id, void *regs, unsigned int 
phy_addr)
dnet-phy_addr = phy_addr;
 
sprintf(netdev-name, dnet%d, id);
-   netdev-eo-init = dnet_init;
-   netdev-eo-halt = dnet_halt;
-   netdev-eo-send = dnet_send;
-   netdev-eo-recv = dnet_recv;
+   netdev-eo = dnet_ops;
 
dev_capa = readl(dnet-regs-VERCAPS)  0x;
debug(%s: has %smdio, %sirq, %sgigabit, %sdma\n, netdev-name,
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 15/67] net: e1000: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/e1000.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
index c9f9fb3..82e89d8 100644
--- a/drivers/net/e1000.c
+++ b/drivers/net/e1000.c
@@ -5118,6 +5118,13 @@ void e1000_get_bus_type(struct e1000_hw *hw)
 /* A list of all registered e1000 devices */
 static LIST_HEAD(e1000_hw_list);
 
+static struct eth_ops e1000_ops = {
+   .init = e1000_init,
+   .recv = e1000_poll,
+   .send = e1000_transmit,
+   .halt = e1000_disable
+};
+
 /**
 PROBE - Look for an adapter, this routine's visible to the outside
 You should omit the last argument struct pci_device * for a non-PCI NIC
@@ -5218,10 +5225,7 @@ e1000_initialize(bd_t * bis)
   nic-enetaddr[3], nic-enetaddr[4], nic-enetaddr[5]);
 
/* Set up the function pointers and register the device */
-   nic-eo-init = e1000_init;
-   nic-eo-recv = e1000_poll;
-   nic-eo-send = e1000_transmit;
-   nic-eo-halt = e1000_disable;
+   nic-eo = e1000_ops;
eth_register(nic);
}
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 13/67] net: designware: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/designware.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 2d92591..255819e 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -523,6 +523,14 @@ static int dw_mii_write(const char *devname, u8 addr, u8 
reg, u16 val)
 }
 #endif
 
+static struct eth_ops dw_eth_ops = {
+   .init = dw_eth_init,
+   .send = dw_eth_send,
+   .recv = dw_eth_recv,
+   .halt = dw_eth_halt,
+   .write_hwaddr = dw_write_hwaddr
+};
+
 int designware_initialize(u32 id, ulong base_addr, u32 phy_addr, u32 interface)
 {
struct eth_device *dev;
@@ -559,11 +567,7 @@ int designware_initialize(u32 id, ulong base_addr, u32 
phy_addr, u32 interface)
priv-phy_configured = 0;
priv-interface = interface;
 
-   dev-eo-init = dw_eth_init;
-   dev-eo-send = dw_eth_send;
-   dev-eo-recv = dw_eth_recv;
-   dev-eo-halt = dw_eth_halt;
-   dev-eo-write_hwaddr = dw_write_hwaddr;
+   dev-eo = dw_eth_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 07/67] net: ax88180: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/ax88180.c |   13 +
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ax88180.c b/drivers/net/ax88180.c
index 464f261..fc237ba 100644
--- a/drivers/net/ax88180.c
+++ b/drivers/net/ax88180.c
@@ -698,6 +698,14 @@ static void ax88180_read_mac_addr (struct eth_device *dev)
}
 }
 
+static struct eth_ops ax88180_ops = {
+   .init = ax88180_init,
+   .halt = ax88180_halt,
+   .send = ax88180_send,
+   .recv = ax88180_recv
+};
+
+
 /*
 ===
  Exported SubProgram Bodies  
@@ -725,10 +733,7 @@ int ax88180_initialize (bd_t * bis)
sprintf (dev-name, ax88180);
dev-iobase = AX88180_BASE;
dev-priv = priv;
-   dev-eo-init = ax88180_init;
-   dev-eo-halt = ax88180_halt;
-   dev-eo-send = ax88180_send;
-   dev-eo-recv = ax88180_recv;
+   dev-eo = ax88180_ops;
 
priv-BusWidth = BUS_WIDTH_32;
priv-PadSize = 3;
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 12/67] net: dc2114x: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/dc2114x.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/dc2114x.c b/drivers/net/dc2114x.c
index 0361699..afdc088 100644
--- a/drivers/net/dc2114x.c
+++ b/drivers/net/dc2114x.c
@@ -207,6 +207,13 @@ static struct pci_device_id supported[] = {
{ }
 };
 
+static struct eth_ops dc21x4x_ops = {
+   .init = dc21x4x_init,
+   .halt = dc21x4x_halt,
+   .send = dc21x4x_send,
+   .recv = dc21x4x_recv
+};
+
 int dc21x4x_initialize(bd_t *bis)
 {
int idx=0;
@@ -299,11 +306,8 @@ int dc21x4x_initialize(bd_t *bis)
 #else
dev-iobase = pci_mem_to_phys(devbusfn, iobase);
 #endif
-   dev-priv   = (void*) devbusfn;
-   dev-eo-init   = dc21x4x_init;
-   dev-eo-halt   = dc21x4x_halt;
-   dev-eo-send   = dc21x4x_send;
-   dev-eo-recv   = dc21x4x_recv;
+   dev-priv = (void *) devbusfn;
+   dev-eo = dc21x4x_ops;
 
/* Ensure we're not sleeping. */
pci_write_config_byte(devbusfn, PCI_CFDA_PSM, WAKEUP);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 16/67] net: eepro100: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/eepro100.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
index e3aa720..91d7f0b 100644
--- a/drivers/net/eepro100.c
+++ b/drivers/net/eepro100.c
@@ -408,6 +408,13 @@ static struct pci_device_id supported[] = {
{}
 };
 
+static struct eth_ops eepro100_ops = {
+   .init = eepro100_init,
+   .halt = eepro100_halt,
+   .send = eepro100_send,
+   .recv = eepro100_recv
+};
+
 int eepro100_initialize (bd_t * bis)
 {
pci_dev_t devno;
@@ -458,10 +465,7 @@ int eepro100_initialize (bd_t * bis)
sprintf (dev-name, i82559#%d, card_number);
dev-priv = (void *) devno; /* this have to come before 
bus_to_phys() */
dev-iobase = bus_to_phys (iobase);
-   dev-eo-init = eepro100_init;
-   dev-eo-halt = eepro100_halt;
-   dev-eo-send = eepro100_send;
-   dev-eo-recv = eepro100_recv;
+   dev-eo = eepro100_ops;
 
eth_register (dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 28/67] net: mcffec: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/mcffec.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c
index 0aeb24e..31c8dcd 100644
--- a/drivers/net/mcffec.c
+++ b/drivers/net/mcffec.c
@@ -551,6 +551,13 @@ void fec_halt(struct eth_device *dev)
memset(info-txbuf, 0, DBUF_LENGTH);
 }
 
+static struct eth_ops fec_ops = {
+   .init = fec_init,
+   .halt = fec_halt,
+   .send = fec_send,
+   .recv = fec_recv
+};
+
 int mcffec_initialize(bd_t * bis)
 {
struct eth_device *dev;
@@ -572,10 +579,7 @@ int mcffec_initialize(bd_t * bis)
sprintf(dev-name, FEC%d, fec_info[i].index);
 
dev-priv = fec_info[i];
-   dev-eo-init = fec_init;
-   dev-eo-halt = fec_halt;
-   dev-eo-send = fec_send;
-   dev-eo-recv = fec_recv;
+   dev-eo = fec_ops;
 
/* setup Receive and Transmit buffer descriptor */
 #ifdef CONFIG_SYS_FEC_BUF_USE_SRAM
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 23/67] net: fsl_mcdmafec: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/fsl_mcdmafec.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/fsl_mcdmafec.c b/drivers/net/fsl_mcdmafec.c
index 2e70d22..6a18809 100644
--- a/drivers/net/fsl_mcdmafec.c
+++ b/drivers/net/fsl_mcdmafec.c
@@ -512,6 +512,13 @@ static void fec_halt(struct eth_device *dev)
 #endif
 }
 
+static struct eth_ops fec_ops = {
+   .init = fec_init,
+   .halt = fec_halt,
+   .send = fec_send,
+   .recv = fec_recv
+};
+
 int mcdmafec_initialize(bd_t * bis)
 {
struct eth_device *dev;
@@ -533,10 +540,7 @@ int mcdmafec_initialize(bd_t * bis)
sprintf(dev-name, FEC%d, fec_info[i].index);
 
dev-priv = fec_info[i];
-   dev-eo-init = fec_init;
-   dev-eo-halt = fec_halt;
-   dev-eo-send = fec_send;
-   dev-eo-recv = fec_recv;
+   dev-eo = fec_ops;
 
/* setup Receive and Transmit buffer descriptor */
 #ifdef CONFIG_SYS_DMA_USE_INTSRAM
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 30/67] net: mvgbe: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/mvgbe.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c
index 6ddb6d6..eeb0741 100644
--- a/drivers/net/mvgbe.c
+++ b/drivers/net/mvgbe.c
@@ -647,6 +647,14 @@ static int mvgbe_recv(struct eth_device *dev)
return 0;
 }
 
+static struct eth_ops mvgbe_ops = {
+   .init = (int (*) (struct eth_device *, bd_t *))mvgbe_init,
+   .halt = (void (*) (struct eth_device *))mvgbe_halt,
+   .send = mvgbe_send,
+   .recv = mvgbe_recv,
+   .write_hwaddr = mvgbe_write_hwaddr
+};
+
 int mvgbe_initialize(bd_t *bis)
 {
struct mvgbe_device *dmvgbe;
@@ -721,11 +729,7 @@ error1:
return -1;
}
 
-   dev-eo-init = (void *)mvgbe_init;
-   dev-eo-halt = (void *)mvgbe_halt;
-   dev-eo-send = (void *)mvgbe_send;
-   dev-eo-recv = (void *)mvgbe_recv;
-   dev-eo-write_hwaddr = (void *)mvgbe_write_hwaddr;
+   dev-eo = mvgbe_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 31/67] net: mpc512x_fec: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/mpc512x_fec.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mpc512x_fec.c b/drivers/net/mpc512x_fec.c
index 4aa3b28..d10a70a 100644
--- a/drivers/net/mpc512x_fec.c
+++ b/drivers/net/mpc512x_fec.c
@@ -608,6 +608,13 @@ static int mpc512x_fec_recv (struct eth_device *dev)
return frame_length;
 }
 
+static struct eth_ops mpc512x_fec_ops = {
+   .init = mpc512x_fec_init,
+   .halt = mpc512x_fec_halt,
+   .send = mpc512x_fec_send,
+   .recv = mpc512x_fec_recv
+};
+
 //
 int mpc512x_fec_initialize (bd_t * bis)
 {
@@ -629,10 +636,7 @@ int mpc512x_fec_initialize (bd_t * bis)
 # endif
dev-priv = (void *)fec;
dev-iobase = (int)im-fec;
-   dev-eo-init = mpc512x_fec_init;
-   dev-eo-halt = mpc512x_fec_halt;
-   dev-eo-send = mpc512x_fec_send;
-   dev-eo-recv = mpc512x_fec_recv;
+   dev-eo = mpc512x_fec_ops;
 
sprintf (dev-name, FEC);
eth_register (dev);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 36/67] net: pcnet: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/pcnet.c |   13 -
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c
index 35254c3..8bb8c67 100644
--- a/drivers/net/pcnet.c
+++ b/drivers/net/pcnet.c
@@ -154,6 +154,12 @@ static struct pci_device_id supported[] = {
{}
 };
 
+static struct eth_ops pcnet_ops = {
+   .init = pcnet_init,
+   .halt = pcnet_halt,
+   .send = pcnet_send,
+   .recv = pcnet_recv
+};
 
 int pcnet_initialize (bd_t * bis)
 {
@@ -216,12 +222,9 @@ int pcnet_initialize (bd_t * bis)
}
 
/*
-* Setup device structure and register the driver.
+* Setup device ops and register the driver.
 */
-   dev-eo-init = pcnet_init;
-   dev-eo-halt = pcnet_halt;
-   dev-eo-send = pcnet_send;
-   dev-eo-recv = pcnet_recv;
+   dev-eo = pcnet_ops;
 
eth_register (dev);
}
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 35/67] net: ns8382x: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/ns8382x.c |   13 +
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ns8382x.c b/drivers/net/ns8382x.c
index 8b08e0b..c433d3a 100644
--- a/drivers/net/ns8382x.c
+++ b/drivers/net/ns8382x.c
@@ -294,6 +294,14 @@ OUTL(struct eth_device *dev, int command, u_long addr)
*(vu_long *) ((addr + dev-iobase)) = cpu_to_le32(command);
 }
 
+static struct eth_ops ns8382x_ops = {
+   .init = ns8382x_init,
+   .halt = ns8382x_disable,
+   .send = ns8382x_send,
+   .recv = ns8382x_poll
+};
+
+
 /* Function: ns8382x_initialize
  * Description: Retrieves the MAC address of the card, and sets up some
  *  globals required by other routines, and initializes the NIC, making it
@@ -346,10 +354,7 @@ ns8382x_initialize(bd_t * bis)
sprintf(dev-name, dp8382x#%d, card_number);
dev-iobase = bus_to_phys(iobase);
dev-priv = (void *) devno;
-   dev-eo-init = ns8382x_init;
-   dev-eo-halt = ns8382x_disable;
-   dev-eo-send = ns8382x_send;
-   dev-eo-recv = ns8382x_poll;
+   dev-eo = ns8382x_ops;
 
/* ns8382x has a non-standard PM control register
 * in PCI config space.  Some boards apparently need
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 39/67] net: rtl8169: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/rtl8169.c |   13 +
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c
index c75fd4f..80f8443 100644
--- a/drivers/net/rtl8169.c
+++ b/drivers/net/rtl8169.c
@@ -872,6 +872,14 @@ static int rtl_init(struct eth_device *dev, bd_t *bis)
return 1;
 }
 
+static struct eth_ops rtl_ops = {
+   .init = rtl_reset,
+   .halt = rtl_halt,
+   .send = rtl_send,
+   .recv = rtl_recv
+};
+
+
 int rtl8169_initialize(bd_t *bis)
 {
pci_dev_t devno;
@@ -902,10 +910,7 @@ int rtl8169_initialize(bd_t *bis)
dev-priv = (void *) devno;
dev-iobase = (int)pci_mem_to_phys(devno, iobase);
 
-   dev-eo-init = rtl_reset;
-   dev-eo-halt = rtl_halt;
-   dev-eo-send = rtl_send;
-   dev-eo-recv = rtl_recv;
+   dev-eo = rtl_ops;
 
eth_register (dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 37/67] net: plb2800_eth: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/plb2800_eth.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/plb2800_eth.c b/drivers/net/plb2800_eth.c
index d3eb692..3b5861f 100644
--- a/drivers/net/plb2800_eth.c
+++ b/drivers/net/plb2800_eth.c
@@ -92,6 +92,12 @@ static unsigned char * plb2800_get_mac_addr(void);
 static int rx_new;
 static int mac_addr_set = 0;
 
+static struct eth_ops plb2800_eth_ops = {
+   .init = plb2800_eth_init,
+   .halt = plb2800_eth_halt,
+   .send = plb2800_eth_send,
+   .recv = plb2800_eth_recv
+};
 
 int plb2800_eth_initialize(bd_t * bis)
 {
@@ -110,10 +116,7 @@ int plb2800_eth_initialize(bd_t * bis)
memset(dev, 0, sizeof(*dev));
 
sprintf(dev-name, PLB2800 Switch);
-   dev-eo-init = plb2800_eth_init;
-   dev-eo-halt = plb2800_eth_halt;
-   dev-eo-send = plb2800_eth_send;
-   dev-eo-recv = plb2800_eth_recv;
+   dev-eo = plb2800_eth_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 33/67] net: ne2000: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/ne2000_base.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ne2000_base.c b/drivers/net/ne2000_base.c
index 2cc9743..f1fed0e 100644
--- a/drivers/net/ne2000_base.c
+++ b/drivers/net/ne2000_base.c
@@ -774,6 +774,13 @@ static int ne2k_send(struct eth_device *dev, void *packet, 
int length)
return 0;
 }
 
+static struct eth_ops ne2k_ops = {
+   .init = ne2k_init,
+   .halt = ne2k_halt,
+   .send = ne2k_send,
+   .recv = ne2k_recv
+};
+
 /**
  * Setup the driver for use and register it with the eth layer
  * @return 0 on success, -1 on error (causing caller to print error msg)
@@ -789,10 +796,7 @@ int ne2k_register(void)
if (ne2k_setup_driver(dev))
return -1;
 
-   dev-eo-init = ne2k_init;
-   dev-eo-halt = ne2k_halt;
-   dev-eo-send = ne2k_send;
-   dev-eo-recv = ne2k_recv;
+   dev-eo = ne2k_ops;
 
sprintf(dev-name, NE2000);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 34/67] net: npe: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/npe/npe.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/npe/npe.c b/drivers/net/npe/npe.c
index d376c21..adff561 100644
--- a/drivers/net/npe/npe.c
+++ b/drivers/net/npe/npe.c
@@ -576,6 +576,13 @@ static int npe_rx(struct eth_device *dev)
return 0;
 }
 
+static struct eth_ops npe_ops = {
+   .init = npe_init,
+   .halt = npe_halt,
+   .send = npe_send,
+   .recv = npe_rx
+};
+
 int npe_initialize(bd_t * bis)
 {
static int virgin = 0;
@@ -625,10 +632,7 @@ int npe_initialize(bd_t * bis)
 
sprintf(dev-name, NPE%d, eth_num);
dev-priv = (void *)p_npe;
-   dev-eo-init = npe_init;
-   dev-eo-halt = npe_halt;
-   dev-eo-send = npe_send;
-   dev-eo-recv = npe_rx;
+   dev-eo = npe_ops;
 
p_npe-print_speed = 1;
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 18/67] net: ep93xx_eth: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/ep93xx_eth.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ep93xx_eth.c b/drivers/net/ep93xx_eth.c
index 0b5cb3c..a2a1502 100644
--- a/drivers/net/ep93xx_eth.c
+++ b/drivers/net/ep93xx_eth.c
@@ -439,6 +439,13 @@ int ep93xx_miiphy_initialize(bd_t * const bd)
 }
 #endif
 
+static struct eth_dev ep93xx_eth_ops = {
+   .init = ep93xx_eth_open,
+   .halt = ep93xx_eth_close,
+   .send = ep93xx_eth_send_packet,
+   .recv = ep93xx_eth_rcv_packet
+};
+
 /**
  * Initialize the EP93xx MAC.  The MAC hardware is reset.  Buffers are
  * allocated, if necessary, for the TX and RX descriptor and status queues,
@@ -499,10 +506,7 @@ int ep93xx_eth_initialize(u8 dev_num, int base_addr)
 
dev-iobase = base_addr;
dev-priv = priv;
-   dev-eo-init = ep93xx_eth_open;
-   dev-eo-halt = ep93xx_eth_close;
-   dev-eo-send = ep93xx_eth_send_packet;
-   dev-eo-recv = ep93xx_eth_rcv_packet;
+   dev-eo = ep93xx_eth_ops;
 
sprintf(dev-name, ep93xx_eth-%hu, dev_num);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 22/67] net: greth.c: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/greth.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/greth.c b/drivers/net/greth.c
index 150dccf..3794005 100644
--- a/drivers/net/greth.c
+++ b/drivers/net/greth.c
@@ -597,6 +597,13 @@ void greth_set_hwaddr(greth_priv * greth, unsigned char 
*mac)
   mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
 }
 
+static struct eth_ops greth_ops = {
+   .init = greth_init,
+   .halt = greth_halt,
+   .send = greth_send,
+   .recv = greth_recv
+};
+
 int greth_initialize(bd_t * bis)
 {
greth_priv *greth;
@@ -623,10 +630,7 @@ int greth_initialize(bd_t * bis)
debug(Found GRETH at %p, irq %d\n, greth-regs, greth-irq);
dev-priv = (void *)greth;
dev-iobase = (unsigned int)greth-regs;
-   dev-eo-init = greth_init;
-   dev-eo-halt = greth_halt;
-   dev-eo-send = greth_send;
-   dev-eo-recv = greth_recv;
+   dev-eo = greth_ops;
greth-dev = dev;
 
/* Reset Core */
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 20/67] net: fec_mxc: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/fec_mxc.c |   15 ++-
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index f8a5556..3259f07 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -915,6 +915,15 @@ static int fec_recv(struct eth_device *dev)
return len;
 }
 
+static struct eth_ops fec_ops = {
+   .init = fec_init,
+   .send = fec_send,
+   .recv = fec_recv,
+   .halt = fec_halt,
+   .write_hwaddr = fec_set_hwaddr
+};
+
+
 static int fec_probe(bd_t *bd, int dev_id, int phy_id, uint32_t base_addr)
 {
struct eth_device *edev;
@@ -943,11 +952,7 @@ static int fec_probe(bd_t *bd, int dev_id, int phy_id, 
uint32_t base_addr)
memset(fec, 0, sizeof(*fec));
 
edev-priv = fec;
-   edev-eo-init = fec_init;
-   edev-eo-send = fec_send;
-   edev-eo-recv = fec_recv;
-   edev-eo-halt = fec_halt;
-   edev-eo-write_hwaddr = fec_set_hwaddr;
+   edev-eo = fec_ops;
 
fec-eth = (struct ethernet_regs *)base_addr;
fec-bd = bd;
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 21/67] net: ftgmac100: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/ftgmac100.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ftgmac100.c b/drivers/net/ftgmac100.c
index 76391c1..7046829 100644
--- a/drivers/net/ftgmac100.c
+++ b/drivers/net/ftgmac100.c
@@ -525,6 +525,13 @@ static int ftgmac100_send(struct eth_device *dev, void 
*packet, int length)
return 0;
 }
 
+static struct eth_ops ftgmac100_ops = {
+   .init = ftgmac100_init,
+   .halt = ftgmac100_halt,
+   .send = ftgmac100_send,
+   .recv = ftgmac100_recv
+};
+
 int ftgmac100_initialize(bd_t *bd)
 {
struct eth_device *dev;
@@ -548,10 +555,7 @@ int ftgmac100_initialize(bd_t *bd)
 
sprintf(dev-name, FTGMAC100);
dev-iobase = CONFIG_FTGMAC100_BASE;
-   dev-eo-init   = ftgmac100_init;
-   dev-eo-halt   = ftgmac100_halt;
-   dev-eo-send   = ftgmac100_send;
-   dev-eo-recv   = ftgmac100_recv;
+   dev-eo = ftgmac100_ops;
dev-priv   = priv;
 
eth_register(dev);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 19/67] net: ethoc: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/ethoc.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index 946b8e2..6a78605 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -482,6 +482,14 @@ static int ethoc_recv(struct eth_device *dev)
return 0;
 }
 
+static struct eth_ops ethoc_ops = {
+   .init = ethoc_init,
+   .halt = ethoc_halt,
+   .send = ethoc_send,
+   .recv = ethoc_recv,
+   .write_hwaddr = ethoc_set_mac_address
+};
+
 int ethoc_initialize(u8 dev_num, int base_addr)
 {
struct ethoc *priv;
@@ -499,11 +507,7 @@ int ethoc_initialize(u8 dev_num, int base_addr)
memset(dev, 0, sizeof(*dev));
dev-priv = priv;
dev-iobase = base_addr;
-   dev-eo-init = ethoc_init;
-   dev-eo-halt = ethoc_halt;
-   dev-eo-send = ethoc_send;
-   dev-eo-recv = ethoc_recv;
-   dev-eo-write_hwaddr = ethoc_set_mac_address;
+   dev-eo = ethoc_ops;
sprintf(dev-name, %s-%hu, ETHOC, dev_num);
 
eth_register(dev);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 25/67] net: ks8695eth: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/ks8695eth.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ks8695eth.c b/drivers/net/ks8695eth.c
index b0703ef..4a5a27e 100644
--- a/drivers/net/ks8695eth.c
+++ b/drivers/net/ks8695eth.c
@@ -220,6 +220,13 @@ static int ks8695_eth_send(struct eth_device *dev, void 
*packet, int len)
 
 //
 
+static struct eth_ops ks8695_eth_ops = {
+   .init = ks8695_eth_init,
+   .halt = ks8695_eth_halt,
+   .send = ks8695_eth_send,
+   .recv = ks8695_eth_recv
+};
+
 int ks8695_eth_initialize(void)
 {
struct eth_device *dev;
@@ -230,10 +237,7 @@ int ks8695_eth_initialize(void)
memset(dev, 0, sizeof(*dev));
 
dev-iobase = KS8695_IO_BASE + KS8695_LAN_DMA_TX;
-   dev-eo-init = ks8695_eth_init;
-   dev-eo-halt = ks8695_eth_halt;
-   dev-eo-send = ks8695_eth_send;
-   dev-eo-recv = ks8695_eth_recv;
+   dev-eo = ks8695_eth_ops;
strcpy(dev-name, ks8695eth);
 
eth_register(dev);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 45/67] net: xilinx_axi_emac: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/xilinx_axi_emac.c |   15 ++-
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c
index 54a871b..44ece48 100644
--- a/drivers/net/xilinx_axi_emac.c
+++ b/drivers/net/xilinx_axi_emac.c
@@ -622,6 +622,15 @@ static int axiemac_bus_reset(struct mii_dev *bus)
return 0;
 }
 
+static struct eth_ops axiemac_ops = {
+   .init = axiemac_init,
+   .halt = axiemac_halt,
+   .send = axiemac_send,
+   .recv = axiemac_recv,
+   .write_hwaddr = axiemac_setup_mac
+};
+
+
 int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr,
unsigned long dma_addr)
 {
@@ -645,11 +654,7 @@ int xilinx_axiemac_initialize(bd_t *bis, unsigned long 
base_addr,
priv-dmatx = (struct axidma_reg *)dma_addr;
/* RX channel offset is 0x30 */
priv-dmarx = (struct axidma_reg *)(dma_addr + 0x30);
-   dev-eo-init = axiemac_init;
-   dev-eo-halt = axiemac_halt;
-   dev-eo-send = axiemac_send;
-   dev-eo-recv = axiemac_recv;
-   dev-eo-write_hwaddr = axiemac_setup_mac;
+   dev-eo = axiemac_ops;
 
 #ifdef CONFIG_PHY_ADDR
priv-phyaddr = CONFIG_PHY_ADDR;
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 40/67] net: smc91111: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/smc9.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/smc9.c b/drivers/net/smc9.c
index 3ea7213..f237ef8 100644
--- a/drivers/net/smc9.c
+++ b/drivers/net/smc9.c
@@ -1331,6 +1331,14 @@ static void print_packet( byte * buf, int length )
 }
 #endif
 
+static struct eth_ops smc_ops = {
+   .init = smc_init,
+   .halt = smc_halt,
+   .send = smc_send,
+   .recv = smc_rcv,
+   .write_hwaddr = smc_write_hwaddr
+};
+
 int smc9_initialize(u8 dev_num, int base_addr)
 {
struct smc9_priv *priv;
@@ -1357,11 +1365,7 @@ int smc9_initialize(u8 dev_num, int base_addr)
dev-enetaddr[i] = SMC_inb(dev, (ADDR0_REG + i));
swap_to(FLASH);
 
-   dev-eo-init = smc_init;
-   dev-eo-halt = smc_halt;
-   dev-eo-send = smc_send;
-   dev-eo-recv = smc_rcv;
-   dev-eo-write_hwaddr = smc_write_hwaddr;
+   dev-eo = smc_ops;
sprintf(dev-name, %s-%hu, SMC_DEV_NAME, dev_num);
 
eth_register(dev);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 43/67] net: tsi108_eth: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/tsi108_eth.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c
index bed09d5..ea26c2c 100644
--- a/drivers/net/tsi108_eth.c
+++ b/drivers/net/tsi108_eth.c
@@ -718,6 +718,13 @@ static int marvell_88e_phy_config (struct eth_device *dev, 
int *speed,
return 1;
 }
 
+static struct eth_ops tsi108_eth_ops = {
+   .init = tsi108_eth_probe,
+   .halt = tsi108_eth_halt,
+   .send = tsi108_eth_send,
+   .recv = tsi108_eth_recv
+};
+
 /*
  * External interface
  *
@@ -739,10 +746,7 @@ int tsi108_eth_initialize (bd_t * bis)
 
dev-iobase = ETH_BASE + (index * ETH_PORT_OFFSET);
dev-priv = (void *)(phy_address[index]);
-   dev-eo-init = tsi108_eth_probe;
-   dev-eo-halt = tsi108_eth_halt;
-   dev-eo-send = tsi108_eth_send;
-   dev-eo-recv = tsi108_eth_recv;
+   dev-eo = tsi108_eth_ops;
 
eth_register(dev);
}
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 41/67] net: smc911x: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/smc911x.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 5ba1bdf..0369376 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -251,6 +251,13 @@ static int smc911x_miiphy_write(const char *devname, u8 
phy, u8 reg, u16 val)
 }
 #endif
 
+static struct eth_ops smc911x_ops = {
+   .init = smc911x_init,
+   .halt = smc911x_halt,
+   .send = smc911x_send,
+   .recv = smc911x_rx
+};
+
 int smc911x_initialize(u8 dev_num, int base_addr)
 {
unsigned long addrl, addrh;
@@ -282,10 +289,7 @@ int smc911x_initialize(u8 dev_num, int base_addr)
dev-enetaddr[5] = addrh  8;
}
 
-   dev-eo-init = smc911x_init;
-   dev-eo-halt = smc911x_halt;
-   dev-eo-send = smc911x_send;
-   dev-eo-recv = smc911x_rx;
+   dev-eo = smc911x_ops;
sprintf(dev-name, %s-%hu, DRIVERNAME, dev_num);
 
eth_register(dev);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 47/67] net: zynq_gem: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/zynq_gem.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index 3cba176..0a9a0f0 100644
--- a/drivers/net/zynq_gem.c
+++ b/drivers/net/zynq_gem.c
@@ -399,6 +399,14 @@ static int zynq_gem_miiphy_write(const char *devname, 
uchar addr,
return phywrite(dev, addr, reg, val);
 }
 
+static struct eth_ops zynq_gem_ops = {
+   .init = zynq_gem_init,
+   .halt = zynq_gem_halt,
+   .send = zynq_gem_send,
+   .recv = zynq_gem_recv,
+   .write_hwaddr = zynq_gem_setup_mac
+};
+
 int zynq_gem_initialize(bd_t *bis, int base_addr)
 {
struct eth_device *dev;
@@ -425,11 +433,7 @@ int zynq_gem_initialize(bd_t *bis, int base_addr)
 
dev-iobase = base_addr;
 
-   dev-eo-init = zynq_gem_init;
-   dev-eo-halt = zynq_gem_halt;
-   dev-eo-send = zynq_gem_send;
-   dev-eo-recv = zynq_gem_recv;
-   dev-eo-write_hwaddr = zynq_gem_setup_mac;
+   dev-eo = zynq_gem_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 46/67] net: xilinx_emaclite: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/xilinx_emaclite.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index c0fefa7..b5be0a3 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -345,6 +345,13 @@ static int emaclite_recv(struct eth_device *dev)
 
 }
 
+static struct eth_ops emaclite_ops = {
+   init = emaclite_init,
+   halt = emaclite_halt,
+   send = emaclite_send,
+   recv = emaclite_recv
+};
+
 int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,
int txpp, int rxpp)
 {
@@ -369,10 +376,7 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long 
base_addr,
sprintf(dev-name, Xelite.%lx, base_addr);
 
dev-iobase = base_addr;
-   dev-eo-init = emaclite_init;
-   dev-eo-halt = emaclite_halt;
-   dev-eo-send = emaclite_send;
-   dev-eo-recv = emaclite_recv;
+   dev-eo = emaclite_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 54/67] net: mpc85xx_fec: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 arch/powerpc/cpu/mpc85xx/ether_fcc.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/ether_fcc.c 
b/arch/powerpc/cpu/mpc85xx/ether_fcc.c
index 3b9eafa..f3c188d 100644
--- a/arch/powerpc/cpu/mpc85xx/ether_fcc.c
+++ b/arch/powerpc/cpu/mpc85xx/ether_fcc.c
@@ -435,6 +435,13 @@ static void fec_halt(struct eth_device* dev)
 }
 }
 
+static struct eth_ops fec_ops = {
+   .init = fec_init,
+   .halt = fec_halt,
+   .send = fec_send,
+   .recv = fec_recv
+};
+
 int fec_initialize(bd_t *bis)
 {
struct eth_device* dev;
@@ -448,10 +455,7 @@ int fec_initialize(bd_t *bis)
sprintf(dev-name, FCC%d,
ether_fcc_info[i].ether_index + 1);
dev-priv = ether_fcc_info[i];
-   dev-eo-init = fec_init;
-   dev-eo-halt = fec_halt;
-   dev-eo-send = fec_send;
-   dev-eo-recv = fec_recv;
+   dev-eo = fec_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 52/67] net: mpc8260_fec: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 arch/powerpc/cpu/mpc8260/ether_fcc.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8260/ether_fcc.c 
b/arch/powerpc/cpu/mpc8260/ether_fcc.c
index 6b78235..c8dbc66 100644
--- a/arch/powerpc/cpu/mpc8260/ether_fcc.c
+++ b/arch/powerpc/cpu/mpc8260/ether_fcc.c
@@ -372,6 +372,13 @@ static void fec_halt(struct eth_device* dev)
~(FCC_GFMR_ENT | FCC_GFMR_ENR);
 }
 
+static struct eth_ops fec_ops = {
+   .init = fec_init,
+   .halt = fec_halt,
+   .send = fec_send,
+   .recv = fec_recv
+};
+
 int fec_initialize(bd_t *bis)
 {
struct eth_device* dev;
@@ -385,10 +392,7 @@ int fec_initialize(bd_t *bis)
sprintf(dev-name, FCC%d,
ether_fcc_info[i].ether_index + 1);
dev-priv = ether_fcc_info[i];
-   dev-eo-init = fec_init;
-   dev-eo-halt = fec_halt;
-   dev-eo-send = fec_send;
-   dev-eo-recv = fec_recv;
+   dev-eo = fec_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 44/67] net: uli526x: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/uli526x.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/uli526x.c b/drivers/net/uli526x.c
index 33d8b49..65670db 100644
--- a/drivers/net/uli526x.c
+++ b/drivers/net/uli526x.c
@@ -198,6 +198,13 @@ static struct pci_device_id uli526x_pci_tbl[] = {
{}
 };
 
+static struct eth_ops uli526x_ops = {
+   .init = uli526x_init_one,
+   .halt = uli526x_disable,
+   .send = uli526x_start_xmit,
+   .recv = uli526x_rx_packet
+};
+
 /* ULI526X network board routine */
 
 /*
@@ -237,10 +244,7 @@ int uli526x_initialize(bd_t *bis)
db-pdev = devno;
dev-iobase = iobase;
 
-   dev-eo-init = uli526x_init_one;
-   dev-eo-halt = uli526x_disable;
-   dev-eo-send = uli526x_start_xmit;
-   dev-eo-recv = uli526x_rx_packet;
+   dev-eo = uli526x_ops;
 
/* init db */
db-ioaddr = dev-iobase;
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 57/67] net: mpc8xx_fec: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 arch/powerpc/cpu/mpc8xx/fec.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8xx/fec.c b/arch/powerpc/cpu/mpc8xx/fec.c
index 5934d92..5544f20 100644
--- a/arch/powerpc/cpu/mpc8xx/fec.c
+++ b/arch/powerpc/cpu/mpc8xx/fec.c
@@ -147,6 +147,13 @@ static void fec_halt(struct eth_device* dev);
 static void __mii_init(void);
 #endif
 
+static struct eth_ops fec_ops = {
+   .init = fec_init,
+   .halt = fec_halt,
+   .send = fec_send,
+   .recv = fec_recv
+};
+
 int fec_initialize(bd_t *bis)
 {
struct eth_device* dev;
@@ -178,10 +185,7 @@ int fec_initialize(bd_t *bis)
efis-actual_phy_addr = -1;
 
dev-priv = efis;
-   dev-eo-init = fec_init;
-   dev-eo-halt = fec_halt;
-   dev-eo-send = fec_send;
-   dev-eo-recv = fec_recv;
+   dev-eo = fec_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 56/67] net: db64360/mv_eth: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 board/Marvell/db64360/mv_eth.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/board/Marvell/db64360/mv_eth.c b/board/Marvell/db64360/mv_eth.c
index 226b964..a0aafc7 100644
--- a/board/Marvell/db64360/mv_eth.c
+++ b/board/Marvell/db64360/mv_eth.c
@@ -202,6 +202,13 @@ void db64360_eth_disable (struct eth_device *dev)
 }
 
 
+static struct eth_ops mv6436x_eth_ops = {
+   .init = (void *) db64360_eth_probe,
+   .halt = (void *) ethernet_phy_reset,
+   .send = (void *) db64360_eth_transmit,
+   .recv = (void *) db64360_eth_poll
+};
+
 void mv6436x_eth_initialize (bd_t * bis)
 {
struct eth_device *dev;
@@ -259,10 +266,7 @@ void mv6436x_eth_initialize (bd_t * bis)
/* ronen - set the MAC addr in the HW */
eth_port_uc_addr_set (devnum, dev-enetaddr, 0);
 
-   dev-eo-init = (void *) db64360_eth_probe;
-   dev-eo-halt = (void *) ethernet_phy_reset;
-   dev-eo-send = (void *) db64360_eth_transmit;
-   dev-eo-recv = (void *) db64360_eth_poll;
+   dev-eo = mv6436x_eth_ops;
 
ethernet_private = calloc (sizeof (*ethernet_private), 1);
dev-priv = (void *) ethernet_private;
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 24/67] net: inca-ip_sw: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/inca-ip_sw.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/inca-ip_sw.c b/drivers/net/inca-ip_sw.c
index 216122d..ab91553 100644
--- a/drivers/net/inca-ip_sw.c
+++ b/drivers/net/inca-ip_sw.c
@@ -165,6 +165,12 @@ static void inca_init_switch_chip(void);
 static void inca_dma_init(void);
 static int inca_amdix(void);
 
+static struct eth_ops inca_switch_ops = {
+   .init = inca_switch_init,
+   .halt = inca_switch_halt,
+   .send = inca_switch_send,
+   .recv = inca_switch_recv
+};
 
 int inca_switch_initialize(bd_t * bis)
 {
@@ -189,10 +195,7 @@ int inca_switch_initialize(bd_t * bis)
 #endif
 
sprintf(dev-name, INCA-IP Switch);
-   dev-eo-init = inca_switch_init;
-   dev-eo-halt = inca_switch_halt;
-   dev-eo-send = inca_switch_send;
-   dev-eo-recv = inca_switch_recv;
+   dev-eo = inca_switch_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 17/67] net: enc28j60: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/enc28j60.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c
index 95f0b93..cde4e1a 100644
--- a/drivers/net/enc28j60.c
+++ b/drivers/net/enc28j60.c
@@ -924,6 +924,14 @@ static void enc_halt(struct eth_device *dev)
enc_release_bus(enc);
 }
 
+static struct eth_ops enc28j60_ops = {
+   .init = enc_init,
+   .halt = enc_halt,
+   .send = enc_send,
+   .recv = enc_recv,
+   .write_hwaddr = enc_write_hwaddr
+};
+
 /*
  * This is the only exported function.
  *
@@ -962,11 +970,7 @@ int enc28j60_initialize(unsigned int bus, unsigned int cs,
enc-dev = dev;
/* now fill the eth_device object */
dev-priv = enc;
-   dev-eo-init = enc_init;
-   dev-eo-halt = enc_halt;
-   dev-eo-send = enc_send;
-   dev-eo-recv = enc_recv;
-   dev-eo-write_hwaddr = enc_write_hwaddr;
+   dev-eo = enc28j60_ops;
sprintf(dev-name, enc%i.%i, bus, cs);
eth_register(dev);
 #if defined(CONFIG_CMD_MII)
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 26/67] net: lan91c96: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/lan91c96.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/lan91c96.c b/drivers/net/lan91c96.c
index d87302b..4e4e2e4 100644
--- a/drivers/net/lan91c96.c
+++ b/drivers/net/lan91c96.c
@@ -785,6 +785,13 @@ static int lan91c96_detect_chip(struct eth_device *dev)
return 0;
 }
 
+static struct eth_ops lan91c96_ops = {
+   .init = lan91c96_init,
+   .halt = lan91c96_halt,
+   .send = lan91c96_send,
+   .recv = lan91c96_recv
+};
+
 int lan91c96_initialize(u8 dev_num, int base_addr)
 {
struct eth_device *dev;
@@ -806,10 +813,7 @@ int lan91c96_initialize(u8 dev_num, int base_addr)
}
get_rom_mac(dev, dev-enetaddr);
 
-   dev-eo-init = lan91c96_init;
-   dev-eo-halt = lan91c96_halt;
-   dev-eo-send = lan91c96_send;
-   dev-eo-recv = lan91c96_recv;
+   dev-eo = lan91c96_ops;
sprintf(dev-name, %s-%hu, supported_chips[r].name, dev_num);
 
eth_register(dev);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 29/67] net: mpc5xxx_fec: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/mpc5xxx_fec.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mpc5xxx_fec.c b/drivers/net/mpc5xxx_fec.c
index 73503da..50f8100 100644
--- a/drivers/net/mpc5xxx_fec.c
+++ b/drivers/net/mpc5xxx_fec.c
@@ -879,6 +879,12 @@ static int mpc5xxx_fec_recv(struct eth_device *dev)
return len;
 }
 
+static struct eth_ops mpc5xxx_fec_ops = {
+   .init = mpc5xxx_fec_init,
+   .halt = mpc5xxx_fec_halt,
+   .send = mpc5xxx_fec_send,
+   .recv = mpc5xxx_fec_recv
+};
 
 //
 int mpc5xxx_fec_initialize(bd_t * bis)
@@ -915,10 +921,7 @@ int mpc5xxx_fec_initialize(bd_t * bis)
 
dev-priv = (void *)fec;
dev-iobase = MPC5XXX_FEC;
-   dev-eo-init = mpc5xxx_fec_init;
-   dev-eo-halt = mpc5xxx_fec_halt;
-   dev-eo-send = mpc5xxx_fec_send;
-   dev-eo-recv = mpc5xxx_fec_recv;
+   dev-eo = mpc5xxx_fec_ops;
 
sprintf(dev-name, FEC);
eth_register(dev);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 53/67] net: mpc8260_scc: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 arch/powerpc/cpu/mpc8260/ether_scc.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8260/ether_scc.c 
b/arch/powerpc/cpu/mpc8260/ether_scc.c
index e56bfdf..5afe905 100644
--- a/arch/powerpc/cpu/mpc8260/ether_scc.c
+++ b/arch/powerpc/cpu/mpc8260/ether_scc.c
@@ -364,6 +364,13 @@ static void sec_restart(void)
 }
 #endif
 
+static struct eth_ops sec_ops = {
+   .init = sec_init,
+   .halt = sec_halt,
+   .send = sec_send,
+   .recv = sec_rx
+};
+
 int mpc82xx_scc_enet_initialize(bd_t *bis)
 {
struct eth_device *dev;
@@ -372,10 +379,7 @@ int mpc82xx_scc_enet_initialize(bd_t *bis)
memset(dev, 0, sizeof *dev);
 
sprintf(dev-name, SCC);
-   dev-eo-init   = sec_init;
-   dev-eo-halt   = sec_halt;
-   dev-eo-send   = sec_send;
-   dev-eo-recv   = sec_rx;
+   dev-eo = sec_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 63/67] net: fm_eth: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/fm/eth.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c
index 8d881d4..d148957 100644
--- a/drivers/net/fm/eth.c
+++ b/drivers/net/fm/eth.c
@@ -611,6 +611,13 @@ static int init_phy(struct eth_device *dev)
return 0;
 }
 
+static struct eth_ops fm_eth_ops = {
+   .init = fm_eth_open,
+   .halt = fm_eth_halt,
+   .send = fm_eth_send,
+   .recv = fm_eth_recv
+};
+
 int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info)
 {
struct eth_device *dev;
@@ -653,10 +660,7 @@ int fm_eth_initialize(struct ccsr_fman *reg, struct 
fm_eth_info *info)
devlist[num_controllers++] = dev;
dev-iobase = 0;
dev-priv = (void *)fm_eth;
-   dev-eo-init = fm_eth_open;
-   dev-eo-halt = fm_eth_halt;
-   dev-eo-send = fm_eth_send;
-   dev-eo-recv = fm_eth_recv;
+   dev-eo = fm_eth_ops;
fm_eth-dev = dev;
fm_eth-bus = info-bus;
fm_eth-phyaddr = info-phy_addr;
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 66/67] net: usb: asix: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/usb/eth/asix.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/eth/asix.c b/drivers/usb/eth/asix.c
index f2cea6b..ed8bcdd 100644
--- a/drivers/usb/eth/asix.c
+++ b/drivers/usb/eth/asix.c
@@ -692,6 +692,13 @@ int asix_eth_probe(struct usb_device *dev, unsigned int 
ifnum,
return 1;
 }
 
+static struct eth_ops asix_ops = {
+   .init = asix_init,
+   .halt = asix_halt,
+   .send = asix_send,
+   .recv = asix_recv
+};
+
 int asix_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
struct eth_device *eth)
 {
@@ -702,10 +709,7 @@ int asix_eth_get_info(struct usb_device *dev, struct 
ueth_data *ss,
return 0;
}
sprintf(eth-name, %s%d, ASIX_BASE_NAME, curr_eth_dev++);
-   eth-eo-init = asix_init;
-   eth-eo-send = asix_send;
-   eth-eo-recv = asix_recv;
-   eth-eo-halt = asix_halt;
+   eth-eo = asix_ops;
if (!(priv-flags  FLAG_TYPE_AX88172))
eth-eo-write_hwaddr = asix_write_hwaddr;
eth-priv = ss;
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 55/67] net: mpc8xx_scc: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 arch/powerpc/cpu/mpc8xx/scc.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8xx/scc.c b/arch/powerpc/cpu/mpc8xx/scc.c
index 801c689..1d154f5 100644
--- a/arch/powerpc/cpu/mpc8xx/scc.c
+++ b/arch/powerpc/cpu/mpc8xx/scc.c
@@ -70,6 +70,13 @@ static int scc_recv(struct eth_device* dev);
 static int scc_init (struct eth_device* dev, bd_t * bd);
 static void scc_halt(struct eth_device* dev);
 
+static struct eth_ops sec_ops = {
+   .init = scc_init,
+   .halt = scc_halt,
+   .send = scc_send,
+   .recv = scc_recv
+};
+
 int scc_initialize(bd_t *bis)
 {
struct eth_device* dev;
@@ -80,10 +87,7 @@ int scc_initialize(bd_t *bis)
sprintf(dev-name, SCC);
dev-iobase = 0;
dev-priv   = 0;
-   dev-eo-init = scc_init;
-   dev-eo-halt = scc_halt;
-   dev-eo-send = scc_send;
-   dev-eo-recv = scc_recv;
+   dev-eo = sec_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 65/67] net: qe: uec: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/qe/uec.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c
index 0aded61..09e267a 100644
--- a/drivers/qe/uec.c
+++ b/drivers/qe/uec.c
@@ -1361,6 +1361,13 @@ static int uec_recv(struct eth_device* dev)
return 1;
 }
 
+static struct eth_ops uec_ops = {
+   .init = uec_init,
+   .halt = uec_halt,
+   .send = uec_send,
+   .recv = uec_recv
+};
+
 int uec_initialize(bd_t *bis, uec_info_t *uec_info)
 {
struct eth_device   *dev;
@@ -1394,10 +1401,7 @@ int uec_initialize(bd_t *bis, uec_info_t *uec_info)
sprintf(dev-name, UEC%d, uec_info-uf_info.ucc_num);
dev-iobase = 0;
dev-priv = (void *)uec;
-   dev-eo-init = uec_init;
-   dev-eo-halt = uec_halt;
-   dev-eo-send = uec_send;
-   dev-eo-recv = uec_recv;
+   dev-eo = uec_ops;
 
/* Clear the ethnet address */
for (i = 0; i  6; i++)
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 51/67] net: mpc8220_fec: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 arch/powerpc/cpu/mpc8220/fec.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8220/fec.c b/arch/powerpc/cpu/mpc8220/fec.c
index 9d6fcc1..289e7c2 100644
--- a/arch/powerpc/cpu/mpc8220/fec.c
+++ b/arch/powerpc/cpu/mpc8220/fec.c
@@ -799,6 +799,12 @@ static int mpc8220_fec_recv (struct eth_device *dev)
return len;
 }
 
+static struct eth_ops mpc8220_fec_ops = {
+   .init = mpc8220_fec_init,
+   .halt = mpc8220_fec_halt,
+   .send = mpc8220_fec_send,
+   .recv = mpc8220_fec_recv
+};
 
 //
 int mpc8220_fec_initialize (bd_t * bis)
@@ -833,10 +839,7 @@ int mpc8220_fec_initialize (bd_t * bis)
 
dev-priv = (void *) fec;
dev-iobase = MMAP_FEC1;
-   dev-eo-init = mpc8220_fec_init;
-   dev-eo-halt = mpc8220_fec_halt;
-   dev-eo-send = mpc8220_fec_send;
-   dev-eo-recv = mpc8220_fec_recv;
+   dev-eo = mpc8220_fec_ops;
 
sprintf (dev-name, FEC);
eth_register (dev);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 67/67] net: usb: smsc95xx: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/usb/eth/smsc95xx.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/eth/smsc95xx.c b/drivers/usb/eth/smsc95xx.c
index b8c2f2e..9f278c5 100644
--- a/drivers/usb/eth/smsc95xx.c
+++ b/drivers/usb/eth/smsc95xx.c
@@ -881,6 +881,14 @@ int smsc95xx_eth_probe(struct usb_device *dev, unsigned 
int ifnum,
return 1;
 }
 
+static struct eth_ops smsc95xx_ops = {
+   .init = smsc95xx_init,
+   .halt = smsc95xx_halt,
+   .send = smsc95xx_send,
+   .recv = smsc95xx_recv,
+   .write_hwaddr = smsc95xx_write_hwaddr
+};
+
 int smsc95xx_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
struct eth_device *eth)
 {
@@ -890,11 +898,7 @@ int smsc95xx_eth_get_info(struct usb_device *dev, struct 
ueth_data *ss,
return 0;
}
sprintf(eth-name, %s%d, SMSC95XX_BASE_NAME, curr_eth_dev++);
-   eth-eo-init = smsc95xx_init;
-   eth-eo-send = smsc95xx_send;
-   eth-eo-recv = smsc95xx_recv;
-   eth-eo-halt = smsc95xx_halt;
-   eth-eo-write_hwaddr = smsc95xx_write_hwaddr;
+   eth-eo = smsc95xx_ops;
eth-priv = ss;
return 1;
 }
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 58/67] net: db64460/mv_eth: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 board/Marvell/db64460/mv_eth.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/board/Marvell/db64460/mv_eth.c b/board/Marvell/db64460/mv_eth.c
index df09be1..22bdafc 100644
--- a/board/Marvell/db64460/mv_eth.c
+++ b/board/Marvell/db64460/mv_eth.c
@@ -202,6 +202,13 @@ void db64460_eth_disable (struct eth_device *dev)
 }
 
 
+static struct eth_ops mv6446x_eth_ops = {
+   .init = (void *) db64460_eth_probe,
+   .halt = (void *) ethernet_phy_reset,
+   .send = (void *) db64460_eth_transmit,
+   .recv = (void *) db64460_eth_poll
+};
+
 void mv6446x_eth_initialize (bd_t * bis)
 {
struct eth_device *dev;
@@ -259,10 +266,7 @@ void mv6446x_eth_initialize (bd_t * bis)
/* ronen - set the MAC addr in the HW */
eth_port_uc_addr_set (devnum, dev-enetaddr, 0);
 
-   dev-eo-init = (void *) db64460_eth_probe;
-   dev-eo-halt = (void *) ethernet_phy_reset;
-   dev-eo-send = (void *) db64460_eth_transmit;
-   dev-eo-recv = (void *) db64460_eth_poll;
+   dev-eo = mv6446x_eth_ops;
 
ethernet_private = calloc (sizeof (*ethernet_private), 1);
dev-priv = (void *)ethernet_private;
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 59/67] net: cpci750/mv_eth: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 board/esd/cpci750/mv_eth.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/board/esd/cpci750/mv_eth.c b/board/esd/cpci750/mv_eth.c
index 8be3f9b..f825780 100644
--- a/board/esd/cpci750/mv_eth.c
+++ b/board/esd/cpci750/mv_eth.c
@@ -202,6 +202,13 @@ void db64360_eth_disable (struct eth_device *dev)
 }
 
 
+static struct eth_ops mv6436x_eth_ops = {
+   .init = (void *) db64360_eth_probe,
+   .halt = (void *) ethernet_phy_reset,
+   .send = (void *) db64360_eth_transmit,
+   .recv = (void *) db64360_eth_poll
+};
+
 void mv6436x_eth_initialize (bd_t * bis)
 {
struct eth_device *dev;
@@ -259,10 +266,7 @@ void mv6436x_eth_initialize (bd_t * bis)
/* ronen - set the MAC addr in the HW */
eth_port_uc_addr_set (devnum, dev-enetaddr, 0);
 
-   dev-eo-init = (void *) db64360_eth_probe;
-   dev-eo-halt = (void *) ethernet_phy_reset;
-   dev-eo-send = (void *) db64360_eth_transmit;
-   dev-eo-recv = (void *) db64360_eth_poll;
+   dev-eo = mv6436x_eth_ops;
 
ethernet_private =
calloc (sizeof (*ethernet_private), 1);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 60/67] net: evb64260: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 board/evb64260/eth.c |   13 +
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/board/evb64260/eth.c b/board/evb64260/eth.c
index 783e0ae..6f4300d 100644
--- a/board/evb64260/eth.c
+++ b/board/evb64260/eth.c
@@ -664,6 +664,14 @@ gt6426x_eth_probe(void *v, bd_t *bis)
return 1;
 }
 
+
+static struct eth_ops gt6426x_eth_ops = {
+   .init = (void *) gt6426x_eth_probe,
+   .halt = (void *) gt6426x_eth_reset,
+   .send = (void *) gt6426x_eth_transmit,
+   .recv = (void *) gt6426x_eth_poll
+};
+
 /* enter all the galileo ethernet devs into MULTI-BOOT */
 void
 gt6426x_eth_initialize(bd_t *bis)
@@ -720,10 +728,7 @@ gt6426x_eth_initialize(bd_t *bis)
s = (*e) ? e+1 : e;
}
 
-   dev-eo-init = (void *)gt6426x_eth_probe;
-   dev-eo-halt = (void *)gt6426x_eth_reset;
-   dev-eo-send = (void *)gt6426x_eth_transmit;
-   dev-eo-recv = (void *)gt6426x_eth_poll;
+   dev-eo = gt6426x_eth_ops;
 
p = calloc( sizeof(*p), 1 );
dev-priv = (void*)p;
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 61/67] net: p3mx/mv_eth: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 board/prodrive/p3mx/mv_eth.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/board/prodrive/p3mx/mv_eth.c b/board/prodrive/p3mx/mv_eth.c
index 69c2dba..cba749b 100644
--- a/board/prodrive/p3mx/mv_eth.c
+++ b/board/prodrive/p3mx/mv_eth.c
@@ -246,6 +246,13 @@ void mv_eth_phy_init (void)
MV_REG_WRITE (ETH_PHY_DFCDL_CONFIG0_REG, 0x30);
 }
 
+static struct eth_ops db64460_eth_ops = {
+   .init = (void *) db64460_eth_probe,
+   .halt = (void *) ethernet_phy_reset,
+   .send = (void *) db64460_eth_transmit,
+   .recv = (void *) db64460_eth_poll
+};
+
 void mv6446x_eth_initialize (bd_t * bis)
 {
struct eth_device *dev;
@@ -309,10 +316,7 @@ void mv6446x_eth_initialize (bd_t * bis)
/* ronen - set the MAC addr in the HW */
eth_port_uc_addr_set (devnum, dev-enetaddr, 0);
 
-   dev-eo-init = (void *) db64460_eth_probe;
-   dev-eo-halt = (void *) ethernet_phy_reset;
-   dev-eo-send = (void *) db64460_eth_transmit;
-   dev-eo-recv = (void *) db64460_eth_poll;
+   dev-eo = db64460_eth_ops;
 
ethernet_private = calloc (sizeof (*ethernet_private), 1);
dev-priv = (void *)ethernet_private;
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 49/67] net: sh_eth: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/sh_eth.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index 1f8d0c1..e801bcb 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -502,6 +502,13 @@ void sh_eth_halt(struct eth_device *dev)
sh_eth_stop(eth);
 }
 
+static struct eth_ops sh_eth_ops = {
+   .init = sh_eth_init,
+   .halt = sh_eth_halt,
+   .send = sh_eth_send,
+   .recv = sh_eth_recv
+};
+
 int sh_eth_initialize(bd_t *bd)
 {
 int ret = 0;
@@ -529,10 +536,7 @@ int sh_eth_initialize(bd_t *bd)
 
 dev-priv = (void *)eth;
 dev-iobase = 0;
-   dev-eo-init = sh_eth_init;
-   dev-eo-halt = sh_eth_halt;
-   dev-eo-send = sh_eth_send;
-   dev-eo-recv = sh_eth_recv;
+   dev-eo = sh_eth_ops;
 eth-port_info[eth-port].dev = dev;
 
sprintf(dev-name, SHETHER_NAME);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 38/67] net: rtl8139: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/rtl8139.c |   18 +++---
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c
index ed02cf6..0e4e5d5 100644
--- a/drivers/net/rtl8139.c
+++ b/drivers/net/rtl8139.c
@@ -200,6 +200,16 @@ static struct pci_device_id supported[] = {
{}
 };
 
+static struct eth_ops rtl8139_ops = {
+   .init = rtl8139_probe,
+   .halt = rtl_disable,
+   .send = rtl_transmit,
+   .recv = rtl_poll,
+#ifdef CONFIG_MCAST_TFTP
+   .mcast = rtl_bcast_addr
+#endif
+};
+
 int rtl8139_initialize(bd_t *bis)
 {
pci_dev_t devno;
@@ -229,13 +239,7 @@ int rtl8139_initialize(bd_t *bis)
 
dev-priv = (void *) devno;
dev-iobase = (int)bus_to_phys(iobase);
-   dev-eo-init = rtl8139_probe;
-   dev-eo-halt = rtl_disable;
-   dev-eo-send = rtl_transmit;
-   dev-eo-recv = rtl_poll;
-#ifdef CONFIG_MCAST_TFTP
-   dev-eo-mcast = rtl_bcast_addr;
-#endif
+   dev-eo = rtl8139_ops;
 
eth_register (dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 48/67] net: xilinx_ll_temac: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/xilinx_ll_temac.c |   27 ---
 1 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/drivers/net/xilinx_ll_temac.c b/drivers/net/xilinx_ll_temac.c
index 8f67417..5f52251 100644
--- a/drivers/net/xilinx_ll_temac.c
+++ b/drivers/net/xilinx_ll_temac.c
@@ -282,6 +282,24 @@ static int ll_temac_phy_init(struct eth_device *dev)
return 1;
 }
 
+static struct eth_ops ll_temac_ops_sdma = {
+   .init = ll_temac_init,
+   .halt = ll_temac_halt,
+   .write_hwaddr = ll_temac_setup_mac_addr,
+   .recv = ll_temac_recv_sdma,
+   .send = ll_temac_send_sdma
+};
+
+static struct eth_ops ll_temac_ops_fifo = {
+   .init = ll_temac_init,
+   .halt = ll_temac_halt,
+   .write_hwaddr = ll_temac_setup_mac_addr,
+   .recv = ll_temac_recv_fifo,
+   .send = ll_temac_send_fifo
+};
+
+
+
 /*
  * Initialize a single ll_temac devices
  *
@@ -313,9 +331,6 @@ int xilinx_ll_temac_initialize(bd_t *bis, struct 
ll_temac_info *devinf)
dev-iobase = devinf-base_addr;
 
dev-priv = ll_temac;
-   dev-eo-init = ll_temac_init;
-   dev-eo-halt = ll_temac_halt;
-   dev-eo-write_hwaddr = ll_temac_setup_mac_addr;
 
ll_temac-ctrladdr = devinf-ctrl_addr;
if (devinf-flags  XILINX_LL_TEMAC_M_SDMA_PLB) {
@@ -334,16 +349,14 @@ int xilinx_ll_temac_initialize(bd_t *bis, struct 
ll_temac_info *devinf)
ll_temac-ctrlinit = ll_temac_init_sdma;
ll_temac-ctrlhalt = ll_temac_halt_sdma;
ll_temac-ctrlreset = ll_temac_reset_sdma;
-   dev-eo-recv = ll_temac_recv_sdma;
-   dev-eo-send = ll_temac_send_sdma;
+   dev-eo = ll_temac_ops_sdma;
} else {
ll_temac-in32 = NULL;
ll_temac-out32 = NULL;
ll_temac-ctrlinit = NULL;
ll_temac-ctrlhalt = NULL;
ll_temac-ctrlreset = ll_temac_reset_fifo;
-   dev-eo-recv = ll_temac_recv_fifo;
-   dev-eo-send = ll_temac_send_fifo;
+   dev-eo = ll_temac_ops_fifo;
}
 
/* Link to specified MDIO bus */
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 32/67] net: natsemi: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/natsemi.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 4288d1f..a3d78b9 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -273,6 +273,13 @@ OUTL(struct eth_device *dev, int command, u_long addr)
*(vu_long *) ((addr + dev-iobase)) = cpu_to_le32(command);
 }
 
+static struct eth_ops natsemi_ops = {
+   .init = natsemi_init,
+   .halt = natsemi_disable,
+   .send = natsemi_send,
+   .recv = natsemi_poll
+};
+
 /*
  * Function: natsemi_initialize
  *
@@ -332,10 +339,7 @@ natsemi_initialize(bd_t * bis)
printf(natsemi: NatSemi ns8381[56] @ %#x\n, dev-iobase);
 #endif
dev-priv = (void *) devno;
-   dev-eo-init = natsemi_init;
-   dev-eo-halt = natsemi_disable;
-   dev-eo-send = natsemi_send;
-   dev-eo-recv = natsemi_poll;
+   dev-eo = natsemi_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 50/67] net: au1x00_eth: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 arch/mips/cpu/mips32/au1x00/au1x00_eth.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_eth.c 
b/arch/mips/cpu/mips32/au1x00/au1x00_eth.c
index 2909fb3..cd4c518 100644
--- a/arch/mips/cpu/mips32/au1x00/au1x00_eth.c
+++ b/arch/mips/cpu/mips32/au1x00/au1x00_eth.c
@@ -283,6 +283,13 @@ static void au1x00_halt(struct eth_device* dev){
*macen = 0;
 }
 
+static struct eth_ops au1x00_ops = {
+   .init = au1x00_init,
+   .halt = au1x00_halt,
+   .send = au1x00_send,
+   .recv = au1x00_recv
+};
+
 int au1x00_enet_initialize(bd_t *bis){
struct eth_device* dev;
 
@@ -296,10 +303,7 @@ int au1x00_enet_initialize(bd_t *bis){
sprintf(dev-name, Au1X00 ethernet);
dev-iobase = 0;
dev-priv = 0;
-   dev-eo-init = au1x00_init;
-   dev-eo-halt = au1x00_halt;
-   dev-eo-send = au1x00_send;
-   dev-eo-recv = au1x00_recv;
+   dev-eo = au1x00_ops;
 
eth_register(dev);
 
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 42/67] net: tsec: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/tsec.c |   18 +++---
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index 345d563..034f0ed 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -605,6 +605,16 @@ static int init_phy(struct eth_device *dev)
return 1;
 }
 
+static struct eth_ops tsec_ops = {
+   .init = tsec_init,
+   .halt = tsec_halt,
+   .send = tsec_send,
+   .recv = tsec_recv,
+#ifdef CONFIG_MCAST_TFTP
+   .mcast = tsec_mcast_addr
+#endif
+};
+
 /* Initialize device structure. Returns success if PHY
  * initialization succeeded (i.e. if it recognizes the PHY)
  */
@@ -638,13 +648,7 @@ static int tsec_initialize(bd_t *bis, struct 
tsec_info_struct *tsec_info)
priv-bus = miiphy_get_dev_by_name(tsec_info-mii_devname);
dev-iobase = 0;
dev-priv = priv;
-   dev-eo-init = tsec_init;
-   dev-eo-halt = tsec_halt;
-   dev-eo-send = tsec_send;
-   dev-eo-recv = tsec_recv;
-#ifdef CONFIG_MCAST_TFTP
-   dev-eo-mcast = tsec_mcast_addr;
-#endif
+   dev-eo = tsec_ops;
 
/* Tell u-boot to get the addr from the env */
for (i = 0; i  6; i++)
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 62/67] net: cpsw: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/cpsw.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index c120d4e..1e2ca40 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -931,6 +931,13 @@ static int cpsw_phy_init(struct eth_device *dev, struct 
cpsw_slave *slave)
return 1;
 }
 
+static struct eth_ops cpsw_ops = {
+   .init = cpsw_init,
+   .halt = cpsw_halt,
+   .send = cpsw_send,
+   .recv = cpsw_recv
+};
+
 int cpsw_register(struct cpsw_platform_data *data)
 {
struct cpsw_priv*priv;
@@ -974,10 +981,7 @@ int cpsw_register(struct cpsw_platform_data *data)
 
strcpy(dev-name, cpsw);
dev-iobase = 0;
-   dev-eo-init   = cpsw_init;
-   dev-eo-halt   = cpsw_halt;
-   dev-eo-send   = cpsw_send;
-   dev-eo-recv   = cpsw_recv;
+   dev-eo = cpsw_ops;
dev-priv   = priv;
 
eth_register(dev);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 64/67] net: ftmac100: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/ftmac100.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c
index 6fd2bde..c353b3d 100644
--- a/drivers/net/ftmac100.c
+++ b/drivers/net/ftmac100.c
@@ -236,6 +236,13 @@ static int ftmac100_send(struct eth_device *dev, void 
*packet, int length)
return 0;
 }
 
+static struct eth_ops ftmac100_ops = {
+   .init = ftmac100_init,
+   .halt = ftmac100_halt,
+   .send = ftmac100_send,
+   .recv = ftmac100_recv
+};
+
 int ftmac100_initialize (bd_t *bd)
 {
struct eth_device *dev;
@@ -260,10 +267,7 @@ int ftmac100_initialize (bd_t *bd)
 
sprintf (dev-name, FTMAC100);
dev-iobase = CONFIG_FTMAC100_BASE;
-   dev-eo-init   = ftmac100_init;
-   dev-eo-halt   = ftmac100_halt;
-   dev-eo-send   = ftmac100_send;
-   dev-eo-recv   = ftmac100_recv;
+   dev-eo = ftmac100_ops;
dev-priv   = priv;
 
eth_register (dev);
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 27/67] net: macb: Pull out init of struct eth_ops

2012-11-21 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/macb.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 2c53902..c0f1202 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -529,6 +529,14 @@ static int macb_write_hwaddr(struct eth_device *dev)
return 0;
 }
 
+static struct eth_ops macb_ops = {
+   .init = macb_init,
+   .halt = macb_halt,
+   .send = macb_send,
+   .recv = macb_recv,
+   .write_hwaddr = macb_write_hwaddr
+};
+
 int macb_eth_initialize(int id, void *regs, unsigned int phy_addr)
 {
struct macb_device *macb;
@@ -558,11 +566,7 @@ int macb_eth_initialize(int id, void *regs, unsigned int 
phy_addr)
macb-phy_addr = phy_addr;
 
sprintf(netdev-name, macb%d, id);
-   netdev-eo-init = macb_init;
-   netdev-eo-halt = macb_halt;
-   netdev-eo-send = macb_send;
-   netdev-eo-recv = macb_recv;
-   netdev-eo-write_hwaddr = macb_write_hwaddr;
+   netdev-eo = macb_ops;
 
/*
 * Do some basic initialization so that we at least can talk
-- 
1.7.2.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 00/67] net: net subsystem ops cleanup

2012-11-21 Thread Tomas Hlavacek
Hello Thomas!

On Wed, Nov 21, 2012 at 7:45 PM, Langer Thomas (LQDE RD ST PON SW)
thomas.lan...@lantiq.com wrote:
 Hello Tomas,

 sorry for not replying to V1 series already. I have a remark:

 2) Replace dynamic init of ops function pointers by static struct.

 Some ARCHs don't have full relocation until now, which breaks the static 
 initialization of pointers!
 Please see this:
 $ grep -r #define.*CONFIG_NEEDS_MANUAL_RELOC *
 arch/nds32/include/asm/config.h:#define CONFIG_NEEDS_MANUAL_RELOC
 arch/sparc/include/asm/config.h:#define CONFIG_NEEDS_MANUAL_RELOC
 arch/m68k/include/asm/config.h:#define CONFIG_NEEDS_MANUAL_RELOC
 arch/avr32/include/asm/config.h:#define CONFIG_NEEDS_MANUAL_RELOC
 arch/mips/include/asm/config.h:#define CONFIG_NEEDS_MANUAL_RELOC

 I don't see any fixups for these cases. I assume, you haven't done any 
 runtime test on any
 of the relevant platforms?

No... With only two exceptions and both were tested in QEMU, not on real HW.


 Adding this manual relocation to eth_register() should be no problem.
 But to be bisectable, please be careful to detect the difference of 
 statically or dynamically initialized structures, because  you may have both 
 while applying the series.

Thanks for the remark. I will do that in the next version.

Tomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 00/50] net: net subsystem ops cleanup

2012-11-19 Thread Tomas Hlavacek
Hello Joe!

On Wed, Nov 14, 2012 at 1:06 AM, Joe Hershberger
joe.hershber...@gmail.com wrote:
 Hi Tomas,

 On Sat, Nov 3, 2012 at 6:23 PM, Tomas Hlavacek tmshl...@gmail.com wrote:
 Dear Wolfgang,

 On Sat, Nov 3, 2012 at 4:09 PM, Wolfgang Denk w...@denx.de wrote:
 Dear Tomas Hlavacek,

 In message 1351876722-5183-1-git-send-email-tmshl...@gmail.com you wrote:
 This patchset is a first stage of preparation of the net subsystem
 for the driver model.

 The idea of this patchset is:
 1) Remove ops .init, .send, .recv and .halt from the eth_device struct.
Add a sparate structure eth_ops which is ready for inclusion
to DM core.
 2) Replace dynamic init of ops function pointers by static struct.
 3) Do minor style cleanup.

 Tomas Hlavacek (50):
   net: dm: Pull out ops from struct eth_device
   net: 4xx_enet: Pull out init of struct eth_ops
   net: altera_tse: Pull out init of struct eth_ops
   net: dm9000x: Pull out init of struct eth_ops
   net: armada100_fec: Pull out init of struct eth_ops

 Hm... looking at this patch series, I wonder if it is really
 bisectable?  Can I really apply any number of these patches (the first
 N, with N  50) and expect the code to build and to work?

 It should be, because the first patch adds new struct eth_ops and
 changes all accesses to its' members in one step. Patches 2 .. 50
 remove dynamic ops settings and add static initialization to each
 affected driver - one patch per driver. I would rather try that by
 compiling U-Boot with only 1/50 applied and after some random N, say
 30/50 to be absolutely sure. Let me get back later when I have my
 MAKEALL results.

 Have you completed this bisectability test yet?  How about run
 testing?  What boards did you test this on?

Yes. In fact I have found some problems during the process, so I have
a new updated patch series almost ready. I will send it tomorrow.

I tested it on all ARM, MIPS, PowerPC and x86 boards. I tried to
verify cover of drivers by this tests by means of git grep but I have
to admit that I may be still missing some boards hidden in boards/* or
arch/* ... :-(

Tomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 00/50] net: net subsystem ops cleanup

2012-11-03 Thread Tomas Hlavacek
Dear Wolfgang,

On Sat, Nov 3, 2012 at 4:09 PM, Wolfgang Denk w...@denx.de wrote:
 Dear Tomas Hlavacek,

 In message 1351876722-5183-1-git-send-email-tmshl...@gmail.com you wrote:
 This patchset is a first stage of preparation of the net subsystem
 for the driver model.

 The idea of this patchset is:
 1) Remove ops .init, .send, .recv and .halt from the eth_device struct.
Add a sparate structure eth_ops which is ready for inclusion
to DM core.
 2) Replace dynamic init of ops function pointers by static struct.
 3) Do minor style cleanup.

 Tomas Hlavacek (50):
   net: dm: Pull out ops from struct eth_device
   net: 4xx_enet: Pull out init of struct eth_ops
   net: altera_tse: Pull out init of struct eth_ops
   net: dm9000x: Pull out init of struct eth_ops
   net: armada100_fec: Pull out init of struct eth_ops

 Hm... looking at this patch series, I wonder if it is really
 bisectable?  Can I really apply any number of these patches (the first
 N, with N  50) and expect the code to build and to work?

It should be, because the first patch adds new struct eth_ops and
changes all accesses to its' members in one step. Patches 2 .. 50
remove dynamic ops settings and add static initialization to each
affected driver - one patch per driver. I would rather try that by
compiling U-Boot with only 1/50 applied and after some random N, say
30/50 to be absolutely sure. Let me get back later when I have my
MAKEALL results.

Tomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 00/50] net: net subsystem ops cleanup

2012-11-02 Thread Tomas Hlavacek
This patchset is a first stage of preparation of the net subsystem
for the driver model.

The idea of this patchset is:
1) Remove ops .init, .send, .recv and .halt from the eth_device struct.
   Add a sparate structure eth_ops which is ready for inclusion
   to DM core.
2) Replace dynamic init of ops function pointers by static struct.
3) Do minor style cleanup.

Tomas Hlavacek (50):
  net: dm: Pull out ops from struct eth_device
  net: 4xx_enet: Pull out init of struct eth_ops
  net: altera_tse: Pull out init of struct eth_ops
  net: dm9000x: Pull out init of struct eth_ops
  net: armada100_fec: Pull out init of struct eth_ops
  net: at91_emac: Pull out init of struct eth_ops
  net: ax88180: Pull out init of struct eth_ops
  net: bfin_mac: Pull out init of struct eth_ops
  net: calxedaxgmac: Pull out init of struct eth_ops
  net: cpsw: Pull out init of struct eth_ops
  net: cs8900: Pull out init of struct eth_ops
  net: davinci_emac: Pull out init of struct eth_ops
  net: dc2114x: Pull out init of struct eth_ops
  net: designware: Pull out init of struct eth_ops
  net: dnet: Pull out init of struct eth_ops
  net: e1000: Pull out init of struct eth_ops
  net: eepro100: Pull out init of struct eth_ops
  net: enc28j60: Pull out init of struct eth_ops
  net: ep93xx_eth: Pull out init of struct eth_ops
  net: ethoc: Pull out init of struct eth_ops
  net: fec_mxc: Pull out init of struct eth_ops
  net: ftgmac100: Pull out init of struct eth_ops
  net: greth.c: Pull out init of struct eth_ops
  net: fsl_mcdmafec: Pull out init of struct eth_ops
  net: inca-ip_sw: Pull out init of struct eth_ops
  net: ks8695eth: Pull out init of struct eth_ops
  net: lan91c96: Pull out init of struct eth_ops
  net: macb: Pull out init of struct eth_ops
  net: mcffec: Pull out init of struct eth_ops
  net: mpc5xxx_fec: Pull out init of struct eth_ops
  net: mvgbe: Pull out init of struct eth_ops
  net: mpc512x_fec: Pull out init of struct eth_ops
  net: natsemi: Pull out init of struct eth_ops
  net: ne2000: Pull out init of struct eth_ops
  net: npe: Pull out init of struct eth_ops
  net: ns8382x: Pull out init of struct eth_ops
  net: pcnet: Pull out init of struct eth_ops
  net: plb2800_eth: Pull out init of struct eth_ops
  net: rtl8139: Pull out init of struct eth_ops
  net: rtl8169: Pull out init of struct eth_ops
  net: smc9: Pull out init of struct eth_ops
  net: smc911x: Pull out init of struct eth_ops
  net: tsec: Pull out init of struct eth_ops
  net: tsi108_eth: Pull out init of struct eth_ops
  net: uli526x: Pull out init of struct eth_ops
  net: xilinx_axi_emac: Pull out init of struct eth_ops
  net: xilinx_emaclite: Pull out init of struct eth_ops
  net: zynq_gem: Pull out init of struct eth_ops
  net: xilinx_ll_temac: Pull out init of struct eth_ops
  net: sh_eth: Pull out init of struct eth_ops

 board/davinci/da8xxevm/da830evm.c |2 +-
 drivers/net/4xx_enet.c|   12 
 drivers/net/altera_tse.c  |   14 +-
 drivers/net/armada100_fec.c   |   12 
 drivers/net/at91_emac.c   |   14 +-
 drivers/net/ax88180.c |   13 +
 drivers/net/bfin_mac.c|   14 +-
 drivers/net/calxedaxgmac.c|   14 ++
 drivers/net/cpsw.c|   12 
 drivers/net/cs8900.c  |   12 
 drivers/net/davinci_emac.c|   14 +-
 drivers/net/dc2114x.c |   14 +-
 drivers/net/designware.c  |   14 +-
 drivers/net/dm9000x.c |   12 
 drivers/net/dnet.c|   14 +-
 drivers/net/e1000.c   |   12 
 drivers/net/eepro100.c|   12 
 drivers/net/enc28j60.c|   14 +-
 drivers/net/ep93xx_eth.c  |   12 
 drivers/net/ethoc.c   |   14 +-
 drivers/net/fec_mxc.c |   15 ++-
 drivers/net/fm/eth.c  |8 
 drivers/net/fsl_mcdmafec.c|   12 
 drivers/net/ftgmac100.c   |   12 
 drivers/net/ftmac100.c|8 
 drivers/net/greth.c   |   12 
 drivers/net/inca-ip_sw.c  |   11 +++
 drivers/net/ks8695eth.c   |   12 
 drivers/net/lan91c96.c|   12 
 drivers/net/macb.c|   14 +-
 drivers/net/mcffec.c  |   12 
 drivers/net/mpc512x_fec.c |   12 
 drivers/net/mpc5xxx_fec.c |   11 +++
 drivers/net/mvgbe.c   |   14 +-
 drivers/net/natsemi.c |   12 
 drivers/net/ne2000_base.c |   12 
 drivers/net/npe/npe.c |   12 
 drivers/net/ns8382x.c |   13 +
 drivers/net/pcnet.c   |   13

[U-Boot] [RFC PATCH 02/50] net: 4xx_enet: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/4xx_enet.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/4xx_enet.c b/drivers/net/4xx_enet.c
index 27b66dd..309e616 100644
--- a/drivers/net/4xx_enet.c
+++ b/drivers/net/4xx_enet.c
@@ -1905,6 +1905,13 @@ static int ppc_4xx_eth_rx (struct eth_device *dev)
return length;
 }
 
+static struct eth_ops ppc_4xx_eth_ops = {
+   .init = ppc_4xx_eth_init,
+   .send = ppc_4xx_eth_send,
+   .recv = ppc_4xx_eth_rx,
+   .halt = ppc_4xx_eth_halt
+};
+
 int ppc_4xx_eth_initialize (bd_t * bis)
 {
static int virgin = 0;
@@ -2023,10 +2030,7 @@ int ppc_4xx_eth_initialize (bd_t * bis)
 
sprintf (dev-name, ppc_4xx_eth%d, eth_num - 
CONFIG_EMAC_NR_START);
dev-priv = (void *) hw;
-   dev-eo-init = ppc_4xx_eth_init;
-   dev-eo-halt = ppc_4xx_eth_halt;
-   dev-eo-send = ppc_4xx_eth_send;
-   dev-eo-recv = ppc_4xx_eth_rx;
+   dev-eo = ppc_4xx_eth_ops;
 
eth_register(dev);
 
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 05/50] net: armada100_fec: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/armada100_fec.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/armada100_fec.c b/drivers/net/armada100_fec.c
index f256381..d826e11 100644
--- a/drivers/net/armada100_fec.c
+++ b/drivers/net/armada100_fec.c
@@ -678,6 +678,13 @@ static int armdfec_recv(struct eth_device *dev)
return 0;
 }
 
+static struct eth_ops armada100_fec_ops = {
+   .init = armdfec_init,
+   .halt = armdfec_halt,
+   .send = armdfec_send,
+   .recv = armdfec_recv
+};
+
 int armada100_fec_register(unsigned long base_addr)
 {
struct armdfec_device *darmdfec;
@@ -718,10 +725,7 @@ int armada100_fec_register(unsigned long base_addr)
/* must be less than sizeof(dev-name) */
strcpy(dev-name, armd-fec0);
 
-   dev-eo-init = armdfec_init;
-   dev-eo-halt = armdfec_halt;
-   dev-eo-send = armdfec_send;
-   dev-eo-recv = armdfec_recv;
+   dev-eo = armada100_fec_ops;
 
eth_register(dev);
 
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 03/50] net: altera_tse: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/altera_tse.c |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c
index ee1a1f6..89cd23e 100644
--- a/drivers/net/altera_tse.c
+++ b/drivers/net/altera_tse.c
@@ -890,6 +890,14 @@ static int tse_eth_init(struct eth_device *dev, bd_t * bd)
return priv-link ? 0 : -1;
 }
 
+static struct eth_ops altera_tse_ops = {
+   .init = tse_eth_init,
+   .halt = tse_eth_halt,
+   .send = tse_eth_send,
+   .recv = tse_eth_rx,
+   .write_hwaddr = tse_set_mac_address
+};
+
 /* TSE init code */
 int altera_tse_initialize(u8 dev_num, int mac_base,
  int sgdma_rx_base, int sgdma_tx_base,
@@ -951,11 +959,7 @@ int altera_tse_initialize(u8 dev_num, int mac_base,
 
/* init eth structure */
dev-priv = priv;
-   dev-eo-init = tse_eth_init;
-   dev-eo-halt = tse_eth_halt;
-   dev-eo-send = tse_eth_send;
-   dev-eo-recv = tse_eth_rx;
-   dev-eo-write_hwaddr = tse_set_mac_address;
+   dev-eo = altera_tse_ops;
sprintf(dev-name, %s-%hu, ALTERA_TSE, dev_num);
 
eth_register(dev);
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 04/50] net: dm9000x: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/dm9000x.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
index bd96948..f6b226c 100644
--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -623,6 +623,13 @@ dm9000_phy_write(int reg, u16 value)
DM9000_DBG(dm9000_phy_write(reg:0x%x, value:0x%x)\n, reg, value);
 }
 
+static struct eth_ops dm9000_ops = {
+   .init = dm9000_init,
+   .send = dm9000_send,
+   .recv = dm9000_rx,
+   .halt = dm9000_halt
+};
+
 int dm9000_initialize(bd_t *bis)
 {
struct eth_device *dev = (dm9000_info.netdev);
@@ -630,10 +637,7 @@ int dm9000_initialize(bd_t *bis)
/* Load MAC address from EEPROM */
dm9000_get_enetaddr(dev);
 
-   dev-eo-init = dm9000_init;
-   dev-eo-halt = dm9000_halt;
-   dev-eo-send = dm9000_send;
-   dev-eo-recv = dm9000_rx;
+   dev-eo = dm9000_ops;
sprintf(dev-name, dm9000);
 
eth_register(dev);
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 06/50] net: at91_emac: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/at91_emac.c |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/at91_emac.c b/drivers/net/at91_emac.c
index 3395dcc..464d539 100644
--- a/drivers/net/at91_emac.c
+++ b/drivers/net/at91_emac.c
@@ -494,6 +494,14 @@ static int at91emac_write_hwaddr(struct eth_device *netdev)
return 0;
 }
 
+static struct eth_ops at91emac_ops = {
+   .init = at91emac_init,
+   .halt = at91emac_halt,
+   .send = at91emac_send,
+   .recv = at91emac_recv,
+   .write_hwaddr = at91emac_write_hwaddr
+};
+
 int at91emac_register(bd_t *bis, unsigned long iobase)
 {
emac_device *emac;
@@ -518,11 +526,7 @@ int at91emac_register(bd_t *bis, unsigned long iobase)
sprintf(dev-name, emac);
dev-iobase = iobase;
dev-priv = emacfix;
-   dev-eo-init = at91emac_init;
-   dev-eo-halt = at91emac_halt;
-   dev-eo-send = at91emac_send;
-   dev-eo-recv = at91emac_recv;
-   dev-eo-write_hwaddr = at91emac_write_hwaddr;
+   dev-eo = at91emac_ops;
 
eth_register(dev);
 
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 08/50] net: bfin_mac: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/bfin_mac.c |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index ef4736f..b2c4b0f 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -91,6 +91,14 @@ static int bfin_miiphy_write(const char *devname, uchar 
addr, uchar reg, ushort
return 0;
 }
 
+static struct eth_ops bfin_emac_ops = {
+   .init = bfin_EMAC_init,
+   .halt = bfin_EMAC_halt,
+   .send = bfin_EMAC_send,
+   .recv = bfin_EMAC_recv,
+   .write_hwaddr = bfin_EMAC_setup_addr
+};
+
 int bfin_EMAC_initialize(bd_t *bis)
 {
struct eth_device *dev;
@@ -103,11 +111,7 @@ int bfin_EMAC_initialize(bd_t *bis)
 
dev-iobase = 0;
dev-priv = 0;
-   dev-eo-init = bfin_EMAC_init;
-   dev-eo-halt = bfin_EMAC_halt;
-   dev-eo-send = bfin_EMAC_send;
-   dev-eo-recv = bfin_EMAC_recv;
-   dev-eo-write_hwaddr = bfin_EMAC_setup_addr;
+   dev-eo = bfin_emac_ops;
 
eth_register(dev);
 
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 07/50] net: ax88180: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/ax88180.c |   13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ax88180.c b/drivers/net/ax88180.c
index 464f261..fc237ba 100644
--- a/drivers/net/ax88180.c
+++ b/drivers/net/ax88180.c
@@ -698,6 +698,14 @@ static void ax88180_read_mac_addr (struct eth_device *dev)
}
 }
 
+static struct eth_ops ax88180_ops = {
+   .init = ax88180_init,
+   .halt = ax88180_halt,
+   .send = ax88180_send,
+   .recv = ax88180_recv
+};
+
+
 /*
 ===
  Exported SubProgram Bodies  
@@ -725,10 +733,7 @@ int ax88180_initialize (bd_t * bis)
sprintf (dev-name, ax88180);
dev-iobase = AX88180_BASE;
dev-priv = priv;
-   dev-eo-init = ax88180_init;
-   dev-eo-halt = ax88180_halt;
-   dev-eo-send = ax88180_send;
-   dev-eo-recv = ax88180_recv;
+   dev-eo = ax88180_ops;
 
priv-BusWidth = BUS_WIDTH_32;
priv-PadSize = 3;
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 01/50] net: Pull out ops from struct eth_device

2012-11-02 Thread Tomas Hlavacek
Add struct eth_ops into include/net.h.
Pull out ops (function pointers to functions init, send recv, halt etc.)
from struct eth_device to the new struct eth_ops.
Fix ops usage in all affected drivers.

This is the first preparation step for DM in the net subsystem. Idea is
to have pointers to the ops functions stored in a separate static
structure. The structure then will be passed to the DM driver instance on
driver init.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 board/davinci/da8xxevm/da830evm.c |2 +-
 drivers/net/4xx_enet.c|8 
 drivers/net/altera_tse.c  |   10 +-
 drivers/net/armada100_fec.c   |8 
 drivers/net/at91_emac.c   |   10 +-
 drivers/net/ax88180.c |8 
 drivers/net/bfin_mac.c|   10 +-
 drivers/net/calxedaxgmac.c|8 
 drivers/net/cpsw.c|   10 +-
 drivers/net/cs8900.c  |8 
 drivers/net/davinci_emac.c|   10 +-
 drivers/net/dc2114x.c |8 
 drivers/net/designware.c  |   10 +-
 drivers/net/dm9000x.c |8 
 drivers/net/dnet.c|   10 +-
 drivers/net/e1000.c   |8 
 drivers/net/eepro100.c|8 
 drivers/net/enc28j60.c|   10 +-
 drivers/net/ep93xx_eth.c  |8 
 drivers/net/ethoc.c   |   10 +-
 drivers/net/fec_mxc.c |   10 +-
 drivers/net/fm/eth.c  |8 
 drivers/net/fsl_mcdmafec.c|8 
 drivers/net/ftgmac100.c   |8 
 drivers/net/ftmac100.c|8 
 drivers/net/greth.c   |8 
 drivers/net/inca-ip_sw.c  |8 
 drivers/net/ks8695eth.c   |8 
 drivers/net/lan91c96.c|8 
 drivers/net/macb.c|   10 +-
 drivers/net/mcffec.c  |8 
 drivers/net/mpc512x_fec.c |8 
 drivers/net/mpc5xxx_fec.c |8 
 drivers/net/mvgbe.c   |   10 +-
 drivers/net/natsemi.c |8 
 drivers/net/ne2000_base.c |8 
 drivers/net/npe/npe.c |8 
 drivers/net/ns8382x.c |8 
 drivers/net/pcnet.c   |8 
 drivers/net/plb2800_eth.c |8 
 drivers/net/rtl8139.c |   10 +-
 drivers/net/rtl8169.c |8 
 drivers/net/sh_eth.c  |8 
 drivers/net/smc9.c|   10 +-
 drivers/net/smc911x.c |8 
 drivers/net/tsec.c|   10 +-
 drivers/net/tsi108_eth.c  |8 
 drivers/net/uli526x.c |8 
 drivers/net/xilinx_axi_emac.c |   10 +-
 drivers/net/xilinx_emaclite.c |8 
 drivers/net/xilinx_ll_temac.c |   14 +++---
 drivers/net/zynq_gem.c|   10 +-
 drivers/usb/eth/asix.c|   10 +-
 drivers/usb/eth/smsc95xx.c|   10 +-
 include/net.h |   17 +++--
 net/eth.c |   16 
 56 files changed, 254 insertions(+), 249 deletions(-)

diff --git a/board/davinci/da8xxevm/da830evm.c 
b/board/davinci/da8xxevm/da830evm.c
index c45c94b..6463a08 100644
--- a/board/davinci/da8xxevm/da830evm.c
+++ b/board/davinci/da8xxevm/da830evm.c
@@ -284,7 +284,7 @@ int board_eth_init(bd_t *bis)
 
/* provide the resulting addr to the driver */
memcpy(dev-enetaddr, mac_addr, 6);
-   dev-write_hwaddr(dev);
+   dev-eo-write_hwaddr(dev);
 
return 0;
 }
diff --git a/drivers/net/4xx_enet.c b/drivers/net/4xx_enet.c
index 7c6e362..27b66dd 100644
--- a/drivers/net/4xx_enet.c
+++ b/drivers/net/4xx_enet.c
@@ -2023,10 +2023,10 @@ int ppc_4xx_eth_initialize (bd_t * bis)
 
sprintf (dev-name, ppc_4xx_eth%d, eth_num - 
CONFIG_EMAC_NR_START);
dev-priv = (void *) hw;
-   dev-init = ppc_4xx_eth_init;
-   dev-halt = ppc_4xx_eth_halt;
-   dev-send = ppc_4xx_eth_send;
-   dev-recv = ppc_4xx_eth_rx;
+   dev-eo-init = ppc_4xx_eth_init;
+   dev-eo-halt = ppc_4xx_eth_halt;
+   dev-eo-send = ppc_4xx_eth_send;
+   dev-eo-recv = ppc_4xx_eth_rx;
 
eth_register(dev);
 
diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c
index de517f8..ee1a1f6 100644
--- a/drivers/net/altera_tse.c
+++ b/drivers/net/altera_tse.c
@@ -951,11 +951,11 @@ int altera_tse_initialize(u8 dev_num, int mac_base,
 
/* init eth structure */
dev-priv = priv;
-   dev-init = tse_eth_init;
-   dev-halt = tse_eth_halt;
-   dev

[U-Boot] [RFC PATCH 15/50] net: dnet: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/dnet.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dnet.c b/drivers/net/dnet.c
index be0891f..126828e 100644
--- a/drivers/net/dnet.c
+++ b/drivers/net/dnet.c
@@ -355,6 +355,13 @@ static void dnet_halt(struct eth_device *netdev)
dnet_writew_mac(dnet, DNET_INTERNAL_MODE_REG, 0);
 }
 
+static struct eth_ops dnet_ops = {
+   .init = dnet_init,
+   .halt = dnet_halt,
+   .send = dnet_send,
+   .recv = dnet_recv
+};
+
 int dnet_eth_initialize(int id, void *regs, unsigned int phy_addr)
 {
struct dnet_device *dnet;
@@ -374,10 +381,7 @@ int dnet_eth_initialize(int id, void *regs, unsigned int 
phy_addr)
dnet-phy_addr = phy_addr;
 
sprintf(netdev-name, dnet%d, id);
-   netdev-eo-init = dnet_init;
-   netdev-eo-halt = dnet_halt;
-   netdev-eo-send = dnet_send;
-   netdev-eo-recv = dnet_recv;
+   netdev-eo = dnet_ops;
 
dev_capa = readl(dnet-regs-VERCAPS)  0x;
debug(%s: has %smdio, %sirq, %sgigabit, %sdma\n, netdev-name,
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 11/50] net: cs8900: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/cs8900.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c
index 65a4254..a78eada 100644
--- a/drivers/net/cs8900.c
+++ b/drivers/net/cs8900.c
@@ -299,6 +299,13 @@ int cs8900_e2prom_write(struct eth_device *dev, u8 addr, 
u16 value)
return 0;
 }
 
+static struct eth_ops cs8900_ops = {
+   .init = cs8900_init,
+   .halt = cs8900_halt,
+   .send = cs8900_send,
+   .recv = cs8900_recv
+};
+
 int cs8900_initialize(u8 dev_num, int base_addr)
 {
struct eth_device *dev;
@@ -320,10 +327,7 @@ int cs8900_initialize(u8 dev_num, int base_addr)
 
dev-iobase = base_addr;
dev-priv = priv;
-   dev-eo-init = cs8900_init;
-   dev-eo-halt = cs8900_halt;
-   dev-eo-send = cs8900_send;
-   dev-eo-recv = cs8900_recv;
+   dev-eo = cs8900_ops;
 
/* Load MAC address from EEPROM */
cs8900_get_enetaddr(dev);
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 10/50] net: cpsw: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/cpsw.c |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index 0a88bc0..8992b66 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -931,6 +931,13 @@ static int cpsw_phy_init(struct eth_device *dev, struct 
cpsw_slave *slave)
return 1;
 }
 
+static struct eth_ops cpsw_ops = {
+   .init = cpsw_init,
+   .halt = cpsw_halt,
+   .send = cpsw_send,
+   .recv = cpsw_recv
+};
+
 int cpsw_register(struct cpsw_platform_data *data)
 {
struct cpsw_priv*priv;
@@ -974,11 +981,8 @@ int cpsw_register(struct cpsw_platform_data *data)
 
strcpy(dev-name, cpsw);
dev-iobase = 0;
-   dev-eo-init   = cpsw_init;
-   dev-eo-halt   = cpsw_halt;
-   dev-eo-send   = cpsw_send;
-   dev-eo-recv   = cpsw_recv;
-   dev-eo-priv   = priv;
+   dev-eo = cpsw_ops;
+   dev-priv   = priv;
 
eth_register(dev);
 
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 09/50] net: calxedaxgmac: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/calxedaxgmac.c |   14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/net/calxedaxgmac.c b/drivers/net/calxedaxgmac.c
index 2346feb..3550160 100644
--- a/drivers/net/calxedaxgmac.c
+++ b/drivers/net/calxedaxgmac.c
@@ -508,6 +508,15 @@ static void xgmac_halt(struct eth_device *dev)
priv-rx_currdesc = 0;
 }
 
+static struct eth_ops xgmac_ops = {
+   .init = xgmac_init,
+   .send = xgmac_tx,
+   .recv = xgmac_rx,
+   .halt = xgmac_halt
+};
+
+
+
 int calxedaxgmac_initialize(u32 id, ulong base_addr)
 {
struct eth_device *dev;
@@ -543,10 +552,7 @@ int calxedaxgmac_initialize(u32 id, ulong base_addr)
macaddr[0] = readl(regs-macaddr[0].lo);
memcpy(dev-enetaddr, macaddr, 6);
 
-   dev-eo-init = xgmac_init;
-   dev-eo-send = xgmac_tx;
-   dev-eo-recv = xgmac_rx;
-   dev-eo-halt = xgmac_halt;
+   dev-eo = xgmac_ops;
 
eth_register(dev);
 
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 14/50] net: designware: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/designware.c |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 2d92591..255819e 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -523,6 +523,14 @@ static int dw_mii_write(const char *devname, u8 addr, u8 
reg, u16 val)
 }
 #endif
 
+static struct eth_ops dw_eth_ops = {
+   .init = dw_eth_init,
+   .send = dw_eth_send,
+   .recv = dw_eth_recv,
+   .halt = dw_eth_halt,
+   .write_hwaddr = dw_write_hwaddr
+};
+
 int designware_initialize(u32 id, ulong base_addr, u32 phy_addr, u32 interface)
 {
struct eth_device *dev;
@@ -559,11 +567,7 @@ int designware_initialize(u32 id, ulong base_addr, u32 
phy_addr, u32 interface)
priv-phy_configured = 0;
priv-interface = interface;
 
-   dev-eo-init = dw_eth_init;
-   dev-eo-send = dw_eth_send;
-   dev-eo-recv = dw_eth_recv;
-   dev-eo-halt = dw_eth_halt;
-   dev-eo-write_hwaddr = dw_write_hwaddr;
+   dev-eo = dw_eth_ops;
 
eth_register(dev);
 
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 19/50] net: ep93xx_eth: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/ep93xx_eth.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ep93xx_eth.c b/drivers/net/ep93xx_eth.c
index 0b5cb3c..a2a1502 100644
--- a/drivers/net/ep93xx_eth.c
+++ b/drivers/net/ep93xx_eth.c
@@ -439,6 +439,13 @@ int ep93xx_miiphy_initialize(bd_t * const bd)
 }
 #endif
 
+static struct eth_dev ep93xx_eth_ops = {
+   .init = ep93xx_eth_open,
+   .halt = ep93xx_eth_close,
+   .send = ep93xx_eth_send_packet,
+   .recv = ep93xx_eth_rcv_packet
+};
+
 /**
  * Initialize the EP93xx MAC.  The MAC hardware is reset.  Buffers are
  * allocated, if necessary, for the TX and RX descriptor and status queues,
@@ -499,10 +506,7 @@ int ep93xx_eth_initialize(u8 dev_num, int base_addr)
 
dev-iobase = base_addr;
dev-priv = priv;
-   dev-eo-init = ep93xx_eth_open;
-   dev-eo-halt = ep93xx_eth_close;
-   dev-eo-send = ep93xx_eth_send_packet;
-   dev-eo-recv = ep93xx_eth_rcv_packet;
+   dev-eo = ep93xx_eth_ops;
 
sprintf(dev-name, ep93xx_eth-%hu, dev_num);
 
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 20/50] net: ethoc: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/ethoc.c |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index 946b8e2..6a78605 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -482,6 +482,14 @@ static int ethoc_recv(struct eth_device *dev)
return 0;
 }
 
+static struct eth_ops ethoc_ops = {
+   .init = ethoc_init,
+   .halt = ethoc_halt,
+   .send = ethoc_send,
+   .recv = ethoc_recv,
+   .write_hwaddr = ethoc_set_mac_address
+};
+
 int ethoc_initialize(u8 dev_num, int base_addr)
 {
struct ethoc *priv;
@@ -499,11 +507,7 @@ int ethoc_initialize(u8 dev_num, int base_addr)
memset(dev, 0, sizeof(*dev));
dev-priv = priv;
dev-iobase = base_addr;
-   dev-eo-init = ethoc_init;
-   dev-eo-halt = ethoc_halt;
-   dev-eo-send = ethoc_send;
-   dev-eo-recv = ethoc_recv;
-   dev-eo-write_hwaddr = ethoc_set_mac_address;
+   dev-eo = ethoc_ops;
sprintf(dev-name, %s-%hu, ETHOC, dev_num);
 
eth_register(dev);
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 21/50] net: fec_mxc: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/fec_mxc.c |   15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index f8a5556..3259f07 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -915,6 +915,15 @@ static int fec_recv(struct eth_device *dev)
return len;
 }
 
+static struct eth_ops fec_ops = {
+   .init = fec_init,
+   .send = fec_send,
+   .recv = fec_recv,
+   .halt = fec_halt,
+   .write_hwaddr = fec_set_hwaddr
+};
+
+
 static int fec_probe(bd_t *bd, int dev_id, int phy_id, uint32_t base_addr)
 {
struct eth_device *edev;
@@ -943,11 +952,7 @@ static int fec_probe(bd_t *bd, int dev_id, int phy_id, 
uint32_t base_addr)
memset(fec, 0, sizeof(*fec));
 
edev-priv = fec;
-   edev-eo-init = fec_init;
-   edev-eo-send = fec_send;
-   edev-eo-recv = fec_recv;
-   edev-eo-halt = fec_halt;
-   edev-eo-write_hwaddr = fec_set_hwaddr;
+   edev-eo = fec_ops;
 
fec-eth = (struct ethernet_regs *)base_addr;
fec-bd = bd;
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 18/50] net: enc28j60: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/enc28j60.c |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c
index 95f0b93..e73fef8 100644
--- a/drivers/net/enc28j60.c
+++ b/drivers/net/enc28j60.c
@@ -924,6 +924,14 @@ static void enc_halt(struct eth_device *dev)
enc_release_bus(enc);
 }
 
+static struct eth_ops enc28j60_ops = {
+   init = enc_init,
+   halt = enc_halt,
+   send = enc_send,
+   recv = enc_recv,
+   write_hwaddr = enc_write_hwaddr
+};
+
 /*
  * This is the only exported function.
  *
@@ -962,11 +970,7 @@ int enc28j60_initialize(unsigned int bus, unsigned int cs,
enc-dev = dev;
/* now fill the eth_device object */
dev-priv = enc;
-   dev-eo-init = enc_init;
-   dev-eo-halt = enc_halt;
-   dev-eo-send = enc_send;
-   dev-eo-recv = enc_recv;
-   dev-eo-write_hwaddr = enc_write_hwaddr;
+   dev-eo = enc28j60_ops;
sprintf(dev-name, enc%i.%i, bus, cs);
eth_register(dev);
 #if defined(CONFIG_CMD_MII)
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 12/50] net: davinci_emac: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/davinci_emac.c |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index a221092..5701f75 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -769,6 +769,14 @@ static int davinci_eth_rcv_packet (struct eth_device *dev)
return (0);
 }
 
+static struct eth_ops davinci_emac_ops = {
+   .init = davinci_eth_open,
+   .halt = davinci_eth_close,
+   .send = davinci_eth_send_packet,
+   .recv = davinci_eth_rcv_packet,
+   .write_hwaddr = davinci_eth_set_mac_addr
+};
+
 /*
  * This function initializes the emac hardware. It does NOT initialize
  * EMAC modules power or pin multiplexors, that is done by board_init()
@@ -791,11 +799,7 @@ int davinci_emac_initialize(void)
sprintf(dev-name, DaVinci-EMAC);
 
dev-iobase = 0;
-   dev-eo-init = davinci_eth_open;
-   dev-eo-halt = davinci_eth_close;
-   dev-eo-send = davinci_eth_send_packet;
-   dev-eo-recv = davinci_eth_rcv_packet;
-   dev-eo-write_hwaddr = davinci_eth_set_mac_addr;
+   dev-eo = davinci_emac_ops;
 
eth_register(dev);
 
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 17/50] net: eepro100: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/eepro100.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
index e3aa720..91d7f0b 100644
--- a/drivers/net/eepro100.c
+++ b/drivers/net/eepro100.c
@@ -408,6 +408,13 @@ static struct pci_device_id supported[] = {
{}
 };
 
+static struct eth_ops eepro100_ops = {
+   .init = eepro100_init,
+   .halt = eepro100_halt,
+   .send = eepro100_send,
+   .recv = eepro100_recv
+};
+
 int eepro100_initialize (bd_t * bis)
 {
pci_dev_t devno;
@@ -458,10 +465,7 @@ int eepro100_initialize (bd_t * bis)
sprintf (dev-name, i82559#%d, card_number);
dev-priv = (void *) devno; /* this have to come before 
bus_to_phys() */
dev-iobase = bus_to_phys (iobase);
-   dev-eo-init = eepro100_init;
-   dev-eo-halt = eepro100_halt;
-   dev-eo-send = eepro100_send;
-   dev-eo-recv = eepro100_recv;
+   dev-eo = eepro100_ops;
 
eth_register (dev);
 
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 23/50] net: greth.c: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/greth.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/greth.c b/drivers/net/greth.c
index 150dccf..3794005 100644
--- a/drivers/net/greth.c
+++ b/drivers/net/greth.c
@@ -597,6 +597,13 @@ void greth_set_hwaddr(greth_priv * greth, unsigned char 
*mac)
   mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
 }
 
+static struct eth_ops greth_ops = {
+   .init = greth_init,
+   .halt = greth_halt,
+   .send = greth_send,
+   .recv = greth_recv
+};
+
 int greth_initialize(bd_t * bis)
 {
greth_priv *greth;
@@ -623,10 +630,7 @@ int greth_initialize(bd_t * bis)
debug(Found GRETH at %p, irq %d\n, greth-regs, greth-irq);
dev-priv = (void *)greth;
dev-iobase = (unsigned int)greth-regs;
-   dev-eo-init = greth_init;
-   dev-eo-halt = greth_halt;
-   dev-eo-send = greth_send;
-   dev-eo-recv = greth_recv;
+   dev-eo = greth_ops;
greth-dev = dev;
 
/* Reset Core */
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 13/50] net: dc2114x: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/dc2114x.c |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/dc2114x.c b/drivers/net/dc2114x.c
index 0361699..afdc088 100644
--- a/drivers/net/dc2114x.c
+++ b/drivers/net/dc2114x.c
@@ -207,6 +207,13 @@ static struct pci_device_id supported[] = {
{ }
 };
 
+static struct eth_ops dc21x4x_ops = {
+   .init = dc21x4x_init,
+   .halt = dc21x4x_halt,
+   .send = dc21x4x_send,
+   .recv = dc21x4x_recv
+};
+
 int dc21x4x_initialize(bd_t *bis)
 {
int idx=0;
@@ -299,11 +306,8 @@ int dc21x4x_initialize(bd_t *bis)
 #else
dev-iobase = pci_mem_to_phys(devbusfn, iobase);
 #endif
-   dev-priv   = (void*) devbusfn;
-   dev-eo-init   = dc21x4x_init;
-   dev-eo-halt   = dc21x4x_halt;
-   dev-eo-send   = dc21x4x_send;
-   dev-eo-recv   = dc21x4x_recv;
+   dev-priv = (void *) devbusfn;
+   dev-eo = dc21x4x_ops;
 
/* Ensure we're not sleeping. */
pci_write_config_byte(devbusfn, PCI_CFDA_PSM, WAKEUP);
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 22/50] net: ftgmac100: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/ftgmac100.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ftgmac100.c b/drivers/net/ftgmac100.c
index 76391c1..7046829 100644
--- a/drivers/net/ftgmac100.c
+++ b/drivers/net/ftgmac100.c
@@ -525,6 +525,13 @@ static int ftgmac100_send(struct eth_device *dev, void 
*packet, int length)
return 0;
 }
 
+static struct eth_ops ftgmac100_ops = {
+   .init = ftgmac100_init,
+   .halt = ftgmac100_halt,
+   .send = ftgmac100_send,
+   .recv = ftgmac100_recv
+};
+
 int ftgmac100_initialize(bd_t *bd)
 {
struct eth_device *dev;
@@ -548,10 +555,7 @@ int ftgmac100_initialize(bd_t *bd)
 
sprintf(dev-name, FTGMAC100);
dev-iobase = CONFIG_FTGMAC100_BASE;
-   dev-eo-init   = ftgmac100_init;
-   dev-eo-halt   = ftgmac100_halt;
-   dev-eo-send   = ftgmac100_send;
-   dev-eo-recv   = ftgmac100_recv;
+   dev-eo = ftgmac100_ops;
dev-priv   = priv;
 
eth_register(dev);
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 16/50] net: e1000: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/e1000.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
index c9f9fb3..82e89d8 100644
--- a/drivers/net/e1000.c
+++ b/drivers/net/e1000.c
@@ -5118,6 +5118,13 @@ void e1000_get_bus_type(struct e1000_hw *hw)
 /* A list of all registered e1000 devices */
 static LIST_HEAD(e1000_hw_list);
 
+static struct eth_ops e1000_ops = {
+   .init = e1000_init,
+   .recv = e1000_poll,
+   .send = e1000_transmit,
+   .halt = e1000_disable
+};
+
 /**
 PROBE - Look for an adapter, this routine's visible to the outside
 You should omit the last argument struct pci_device * for a non-PCI NIC
@@ -5218,10 +5225,7 @@ e1000_initialize(bd_t * bis)
   nic-enetaddr[3], nic-enetaddr[4], nic-enetaddr[5]);
 
/* Set up the function pointers and register the device */
-   nic-eo-init = e1000_init;
-   nic-eo-recv = e1000_poll;
-   nic-eo-send = e1000_transmit;
-   nic-eo-halt = e1000_disable;
+   nic-eo = e1000_ops;
eth_register(nic);
}
 
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 37/50] net: pcnet: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/pcnet.c |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c
index 35254c3..8bb8c67 100644
--- a/drivers/net/pcnet.c
+++ b/drivers/net/pcnet.c
@@ -154,6 +154,12 @@ static struct pci_device_id supported[] = {
{}
 };
 
+static struct eth_ops pcnet_ops = {
+   .init = pcnet_init,
+   .halt = pcnet_halt,
+   .send = pcnet_send,
+   .recv = pcnet_recv
+};
 
 int pcnet_initialize (bd_t * bis)
 {
@@ -216,12 +222,9 @@ int pcnet_initialize (bd_t * bis)
}
 
/*
-* Setup device structure and register the driver.
+* Setup device ops and register the driver.
 */
-   dev-eo-init = pcnet_init;
-   dev-eo-halt = pcnet_halt;
-   dev-eo-send = pcnet_send;
-   dev-eo-recv = pcnet_recv;
+   dev-eo = pcnet_ops;
 
eth_register (dev);
}
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 24/50] net: fsl_mcdmafec: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/fsl_mcdmafec.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/fsl_mcdmafec.c b/drivers/net/fsl_mcdmafec.c
index 2e70d22..6a18809 100644
--- a/drivers/net/fsl_mcdmafec.c
+++ b/drivers/net/fsl_mcdmafec.c
@@ -512,6 +512,13 @@ static void fec_halt(struct eth_device *dev)
 #endif
 }
 
+static struct eth_ops fec_ops = {
+   .init = fec_init,
+   .halt = fec_halt,
+   .send = fec_send,
+   .recv = fec_recv
+};
+
 int mcdmafec_initialize(bd_t * bis)
 {
struct eth_device *dev;
@@ -533,10 +540,7 @@ int mcdmafec_initialize(bd_t * bis)
sprintf(dev-name, FEC%d, fec_info[i].index);
 
dev-priv = fec_info[i];
-   dev-eo-init = fec_init;
-   dev-eo-halt = fec_halt;
-   dev-eo-send = fec_send;
-   dev-eo-recv = fec_recv;
+   dev-eo = fec_ops;
 
/* setup Receive and Transmit buffer descriptor */
 #ifdef CONFIG_SYS_DMA_USE_INTSRAM
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 27/50] net: lan91c96: Pull out init of struct eth_ops

2012-11-02 Thread Tomas Hlavacek
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek tmshl...@gmail.com
---
 drivers/net/lan91c96.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/lan91c96.c b/drivers/net/lan91c96.c
index d87302b..4e4e2e4 100644
--- a/drivers/net/lan91c96.c
+++ b/drivers/net/lan91c96.c
@@ -785,6 +785,13 @@ static int lan91c96_detect_chip(struct eth_device *dev)
return 0;
 }
 
+static struct eth_ops lan91c96_ops = {
+   .init = lan91c96_init,
+   .halt = lan91c96_halt,
+   .send = lan91c96_send,
+   .recv = lan91c96_recv
+};
+
 int lan91c96_initialize(u8 dev_num, int base_addr)
 {
struct eth_device *dev;
@@ -806,10 +813,7 @@ int lan91c96_initialize(u8 dev_num, int base_addr)
}
get_rom_mac(dev, dev-enetaddr);
 
-   dev-eo-init = lan91c96_init;
-   dev-eo-halt = lan91c96_halt;
-   dev-eo-send = lan91c96_send;
-   dev-eo-recv = lan91c96_recv;
+   dev-eo = lan91c96_ops;
sprintf(dev-name, %s-%hu, supported_chips[r].name, dev_num);
 
eth_register(dev);
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   >