net: net subsystem ops cleanup
Subsystems (7)
cover net: net subsystem ops cleanup
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: smc91111: 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 ++++++++----- drivers/net/plb2800_eth.c | 11 +++++++---- drivers/net/rtl8139.c | 18 +++++++++++------- drivers/net/rtl8169.c | 13 +++++++++---- drivers/net/sh_eth.c | 12 ++++++++---- drivers/net/smc91111.c | 14 +++++++++----- drivers/net/smc911x.c | 12 ++++++++---- drivers/net/tsec.c | 18 +++++++++++------- drivers/net/tsi108_eth.c | 12 ++++++++---- drivers/net/uli526x.c | 12 ++++++++---- drivers/net/xilinx_axi_emac.c | 15 ++++++++++----- drivers/net/xilinx_emaclite.c | 12 ++++++++---- drivers/net/xilinx_ll_temac.c | 27 ++++++++++++++++++++------- drivers/net/zynq_gem.c | 14 +++++++++----- drivers/usb/eth/asix.c | 10 +++++----- drivers/usb/eth/smsc95xx.c | 10 +++++----- include/net.h | 17 +++++++++++------ net/eth.c | 16 ++++++++-------- 56 files changed, 467 insertions(+), 254 deletions(-)
Signature · 1 line
1.7.10.4
RFC PATCH 1/50 net: Pull out ops from struct eth_device
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.
--- 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/smc91111.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(-)
board/davinci/da8xxevm/da830evm.c +1 -1
@@ -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 ; }
drivers/net/4xx_enet.c +4 -4
@@ -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);
drivers/net/altera_tse.c +5 -5
@@ -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->send = tse_eth_send; - dev->recv = tse_eth_rx; - dev->write_hwaddr = tse_set_mac_address; + 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;sprintf (dev->name,"%s-%hu" ,"ALTERA_TSE" , dev_num);eth_register (dev);
drivers/net/armada100_fec.c +4 -4
@@ -718,10 +718,10 @@ int armada100_fec_register(unsigned long base_addr)/* must be less than sizeof(dev->name) */ strcpy (dev->name,"armd-fec0" ); - dev->init = armdfec_init; - dev->halt = armdfec_halt; - dev->send = armdfec_send; - dev->recv = armdfec_recv; + dev->eo->init = armdfec_init; + dev->eo->halt = armdfec_halt; + dev->eo->send = armdfec_send; + dev->eo->recv = armdfec_recv;eth_register (dev);
drivers/net/at91_emac.c +5 -5
@@ -518,11 +518,11 @@ int at91emac_register(bd_t *bis, unsigned long iobase)sprintf (dev->name,"emac" ); dev->iobase = iobase; dev->priv = emacfix; - dev->init = at91emac_init; - dev->halt = at91emac_halt; - dev->send = at91emac_send; - dev->recv = at91emac_recv; - dev->write_hwaddr = at91emac_write_hwaddr; + 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;eth_register (dev);
drivers/net/ax88180.c +4 -4
@@ -725,10 +725,10 @@ int ax88180_initialize (bd_t * bis)sprintf (dev->name,"ax88180" ); dev->iobase =AX88180_BASE ; dev->priv = priv; - dev->init = ax88180_init; - dev->halt = ax88180_halt; - dev->send = ax88180_send; - dev->recv = ax88180_recv; + dev->eo->init = ax88180_init; + dev->eo->halt = ax88180_halt; + dev->eo->send = ax88180_send; + dev->eo->recv = ax88180_recv; priv->BusWidth =BUS_WIDTH_32 ; priv->PadSize =3 ;
drivers/net/bfin_mac.c +5 -5
@@ -103,11 +103,11 @@ int bfin_EMAC_initialize(bd_t *bis) dev->iobase =0 ; dev->priv =0 ; - dev->init = bfin_EMAC_init; - dev->halt = bfin_EMAC_halt; - dev->send = bfin_EMAC_send; - dev->recv = bfin_EMAC_recv; - dev->write_hwaddr = bfin_EMAC_setup_addr; + 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;eth_register (dev);
drivers/net/calxedaxgmac.c +4 -4
@@ -543,10 +543,10 @@ int calxedaxgmac_initialize(u32 id, ulong base_addr) macaddr[0 ] =readl (®s->macaddr[0 ].lo);memcpy (dev->enetaddr, macaddr,6 ); - dev->init = xgmac_init; - dev->send = xgmac_tx; - dev->recv = xgmac_rx; - dev->halt = xgmac_halt; + dev->eo->init = xgmac_init; + dev->eo->send = xgmac_tx; + dev->eo->recv = xgmac_rx; + dev->eo->halt = xgmac_halt;eth_register (dev);
drivers/net/cpsw.c +5 -5
@@ -974,11 +974,11 @@ int cpsw_register(struct cpsw_platform_data *data)strcpy (dev->name,"cpsw" ); dev->iobase =0 ; - dev->init = cpsw_init; - dev->halt = cpsw_halt; - dev->send = cpsw_send; - dev->recv = cpsw_recv; - dev->priv = priv; + dev->eo->init = cpsw_init; + dev->eo->halt = cpsw_halt; + dev->eo->send = cpsw_send; + dev->eo->recv = cpsw_recv; + dev->eo->priv = priv;eth_register (dev);
drivers/net/cs8900.c +4 -4
@@ -320,10 +320,10 @@ int cs8900_initialize(u8 dev_num, int base_addr) dev->iobase = base_addr; dev->priv = priv; - dev->init = cs8900_init; - dev->halt = cs8900_halt; - dev->send = cs8900_send; - dev->recv = cs8900_recv; + dev->eo->init = cs8900_init; + dev->eo->halt = cs8900_halt; + dev->eo->send = cs8900_send; + dev->eo->recv = cs8900_recv;/* Load MAC address from EEPROM */ cs8900_get_enetaddr (dev);
drivers/net/davinci_emac.c +5 -5
@@ -791,11 +791,11 @@ int davinci_emac_initialize(void)sprintf (dev->name,"DaVinci-EMAC" ); dev->iobase =0 ; - dev->init = davinci_eth_open; - dev->halt = davinci_eth_close; - dev->send = davinci_eth_send_packet; - dev->recv = davinci_eth_rcv_packet; - dev->write_hwaddr = davinci_eth_set_mac_addr; + 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;eth_register (dev);
drivers/net/dc2114x.c +4 -4
@@ -300,10 +300,10 @@ int dc21x4x_initialize(bd_t *bis) dev->iobase =pci_mem_to_phys (devbusfn, iobase);#endif dev->priv = (void *) devbusfn; - dev->init = dc21x4x_init; - dev->halt = dc21x4x_halt; - dev->send = dc21x4x_send; - dev->recv = dc21x4x_recv; + dev->eo->init = dc21x4x_init; + dev->eo->halt = dc21x4x_halt; + dev->eo->send = dc21x4x_send; + dev->eo->recv = dc21x4x_recv;/* Ensure we're not sleeping. */ pci_write_config_byte (devbusfn,PCI_CFDA_PSM ,WAKEUP );
drivers/net/designware.c +5 -5
@@ -559,11 +559,11 @@ int designware_initialize(u32 id, ulong base_addr, u32 phy_addr, u32 interface) priv->phy_configured =0 ; priv->interface = interface; - dev->init = dw_eth_init; - dev->send = dw_eth_send; - dev->recv = dw_eth_recv; - dev->halt = dw_eth_halt; - dev->write_hwaddr = dw_write_hwaddr; + 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;eth_register (dev);
drivers/net/dm9000x.c +4 -4
@@ -630,10 +630,10 @@ int dm9000_initialize(bd_t *bis)/* Load MAC address from EEPROM */ dm9000_get_enetaddr (dev); - dev->init = dm9000_init; - dev->halt = dm9000_halt; - dev->send = dm9000_send; - dev->recv = dm9000_rx; + dev->eo->init = dm9000_init; + dev->eo->halt = dm9000_halt; + dev->eo->send = dm9000_send; + dev->eo->recv = dm9000_rx;sprintf (dev->name,"dm9000" );eth_register (dev);
drivers/net/dnet.c +5 -5
@@ -374,13 +374,13 @@ int dnet_eth_initialize(int id, void *regs, unsigned int phy_addr) dnet->phy_addr = phy_addr;sprintf (netdev->name,"dnet%d" , id); - netdev->init = dnet_init; - netdev->halt = dnet_halt; - netdev->send = dnet_send; - netdev->recv = dnet_recv; + netdev->eo->init = dnet_init; + netdev->eo->halt = dnet_halt; + netdev->eo->send = dnet_send; + netdev->eo->recv = dnet_recv; dev_capa =readl (&dnet->regs->VERCAPS) &0xFFFF ; - debug("%s: has %smdio, %sirq, %sgigabit, %sdma \n", netdev->name, + debug("%s: has %smdio, %sirq, %sgigabit, %sdma\n", netdev->name, (dev_capa & DNET_HAS_MDIO) ? "" : "no ", (dev_capa & DNET_HAS_IRQ) ? "" : "no ", (dev_capa & DNET_HAS_GIGABIT) ? "" : "no ",
drivers/net/e1000.c +4 -4
@@ -5218,10 +5218,10 @@ e1000_initialize(bd_t * bis) nic->enetaddr[3], nic->enetaddr[4], nic->enetaddr[5]);/* Set up the function pointers and register the device */ - nic->init = e1000_init; - nic->recv = e1000_poll; - nic->send = e1000_transmit; - nic->halt = e1000_disable; + nic->eo->init = e1000_init; + nic->eo->recv = e1000_poll; + nic->eo->send = e1000_transmit; + nic->eo->halt = e1000_disable;eth_register (nic); }
drivers/net/eepro100.c +4 -4
@@ -458,10 +458,10 @@ 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->init = eepro100_init; - dev->halt = eepro100_halt; - dev->send = eepro100_send; - dev->recv = eepro100_recv; + dev->eo->init = eepro100_init; + dev->eo->halt = eepro100_halt; + dev->eo->send = eepro100_send; + dev->eo->recv = eepro100_recv;eth_register (dev);
drivers/net/enc28j60.c +5 -5
@@ -962,11 +962,11 @@ int enc28j60_initialize(unsigned int bus, unsigned int cs, enc->dev = dev;/* now fill the eth_device object */ dev->priv = enc; - dev->init = enc_init; - dev->halt = enc_halt; - dev->send = enc_send; - dev->recv = enc_recv; - dev->write_hwaddr = enc_write_hwaddr; + 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;sprintf (dev->name,"enc%i.%i" , bus, cs);eth_register (dev);#if defined(CONFIG_CMD_MII )
drivers/net/ep93xx_eth.c +4 -4
@@ -499,10 +499,10 @@ int ep93xx_eth_initialize(u8 dev_num, int base_addr) dev->iobase = base_addr; dev->priv = priv; - dev->init = ep93xx_eth_open; - dev->halt = ep93xx_eth_close; - dev->send = ep93xx_eth_send_packet; - dev->recv = ep93xx_eth_rcv_packet; + 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;sprintf (dev->name,"ep93xx_eth-%hu" , dev_num);
drivers/net/ethoc.c +5 -5
@@ -499,11 +499,11 @@ int ethoc_initialize(u8 dev_num, int base_addr)memset (dev,0 ,sizeof (*dev)); dev->priv = priv; dev->iobase = base_addr; - dev->init = ethoc_init; - dev->halt = ethoc_halt; - dev->send = ethoc_send; - dev->recv = ethoc_recv; - dev->write_hwaddr = ethoc_set_mac_address; + 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;sprintf (dev->name,"%s-%hu" ,"ETHOC" , dev_num);eth_register (dev);
drivers/net/fec_mxc.c +5 -5
@@ -943,11 +943,11 @@ 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->init = fec_init; - edev->send = fec_send; - edev->recv = fec_recv; - edev->halt = fec_halt; - edev->write_hwaddr = fec_set_hwaddr; + 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; fec->eth = (struct ethernet_regs *)base_addr; fec->bd = bd;
drivers/net/fm/eth.c +4 -4
@@ -653,10 +653,10 @@ 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->init = fm_eth_open; - dev->halt = fm_eth_halt; - dev->send = fm_eth_send; - dev->recv = fm_eth_recv; + dev->eo->init = fm_eth_open; + dev->eo->halt = fm_eth_halt; + dev->eo->send = fm_eth_send; + dev->eo->recv = fm_eth_recv; fm_eth->dev = dev; fm_eth->bus = info->bus; fm_eth->phyaddr = info->phy_addr;
drivers/net/fsl_mcdmafec.c +4 -4
@@ -533,10 +533,10 @@ int mcdmafec_initialize(bd_t * bis)sprintf (dev->name,"FEC%d" , fec_info[i].index); dev->priv = &fec_info[i]; - dev->init = fec_init; - dev->halt = fec_halt; - dev->send = fec_send; - dev->recv = fec_recv; + dev->eo->init = fec_init; + dev->eo->halt = fec_halt; + dev->eo->send = fec_send; + dev->eo->recv = fec_recv;/* setup Receive and Transmit buffer descriptor */ #ifdef CONFIG_SYS_DMA_USE_INTSRAM
drivers/net/ftgmac100.c +4 -4
@@ -548,10 +548,10 @@ int ftgmac100_initialize(bd_t *bd)sprintf (dev->name,"FTGMAC100" ); dev->iobase =CONFIG_FTGMAC100_BASE ; - dev->init = ftgmac100_init; - dev->halt = ftgmac100_halt; - dev->send = ftgmac100_send; - dev->recv = ftgmac100_recv; + dev->eo->init = ftgmac100_init; + dev->eo->halt = ftgmac100_halt; + dev->eo->send = ftgmac100_send; + dev->eo->recv = ftgmac100_recv; dev->priv = priv;eth_register (dev);
drivers/net/ftmac100.c +4 -4
@@ -260,10 +260,10 @@ int ftmac100_initialize (bd_t *bd)sprintf (dev->name,"FTMAC100" ); dev->iobase =CONFIG_FTMAC100_BASE ; - dev->init = ftmac100_init; - dev->halt = ftmac100_halt; - dev->send = ftmac100_send; - dev->recv = ftmac100_recv; + dev->eo->init = ftmac100_init; + dev->eo->halt = ftmac100_halt; + dev->eo->send = ftmac100_send; + dev->eo->recv = ftmac100_recv; dev->priv = priv;eth_register (dev);
drivers/net/greth.c +4 -4
@@ -623,10 +623,10 @@ 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->init = greth_init; - dev->halt = greth_halt; - dev->send = greth_send; - dev->recv = greth_recv; + dev->eo->init = greth_init; + dev->eo->halt = greth_halt; + dev->eo->send = greth_send; + dev->eo->recv = greth_recv; greth->dev = dev;/* Reset Core */
drivers/net/inca-ip_sw.c +4 -4
@@ -189,10 +189,10 @@ int inca_switch_initialize(bd_t * bis)#endif sprintf (dev->name,"INCA-IP Switch" ); - dev->init = inca_switch_init; - dev->halt = inca_switch_halt; - dev->send = inca_switch_send; - dev->recv = inca_switch_recv; + dev->eo->init = inca_switch_init; + dev->eo->halt = inca_switch_halt; + dev->eo->send = inca_switch_send; + dev->eo->recv = inca_switch_recv;eth_register (dev);
drivers/net/ks8695eth.c +4 -4
@@ -230,10 +230,10 @@ int ks8695_eth_initialize(void)memset (dev,0 ,sizeof (*dev)); dev->iobase =KS8695_IO_BASE +KS8695_LAN_DMA_TX ; - dev->init = ks8695_eth_init; - dev->halt = ks8695_eth_halt; - dev->send = ks8695_eth_send; - dev->recv = ks8695_eth_recv; + dev->eo->init = ks8695_eth_init; + dev->eo->halt = ks8695_eth_halt; + dev->eo->send = ks8695_eth_send; + dev->eo->recv = ks8695_eth_recv;strcpy (dev->name,"ks8695eth" );eth_register (dev);
drivers/net/lan91c96.c +4 -4
@@ -806,10 +806,10 @@ int lan91c96_initialize(u8 dev_num, int base_addr) }get_rom_mac (dev, dev->enetaddr); - dev->init = lan91c96_init; - dev->halt = lan91c96_halt; - dev->send = lan91c96_send; - dev->recv = lan91c96_recv; + dev->eo->init = lan91c96_init; + dev->eo->halt = lan91c96_halt; + dev->eo->send = lan91c96_send; + dev->eo->recv = lan91c96_recv;sprintf (dev->name,"%s-%hu" , supported_chips[r].name, dev_num);eth_register (dev);
drivers/net/macb.c +5 -5
@@ -558,11 +558,11 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr) macb->phy_addr = phy_addr;sprintf (netdev->name,"macb%d" , id); - netdev->init = macb_init; - netdev->halt = macb_halt; - netdev->send = macb_send; - netdev->recv = macb_recv; - netdev->write_hwaddr = macb_write_hwaddr; + 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;/* * Do some basic initialization so that we at least can talk
drivers/net/mcffec.c +4 -4
@@ -572,10 +572,10 @@ int mcffec_initialize(bd_t * bis)sprintf (dev->name,"FEC%d" , fec_info[i].index); dev->priv = &fec_info[i]; - dev->init = fec_init; - dev->halt = fec_halt; - dev->send = fec_send; - dev->recv = fec_recv; + dev->eo->init = fec_init; + dev->eo->halt = fec_halt; + dev->eo->send = fec_send; + dev->eo->recv = fec_recv;/* setup Receive and Transmit buffer descriptor */ #ifdef CONFIG_SYS_FEC_BUF_USE_SRAM
drivers/net/mpc512x_fec.c +4 -4
@@ -629,10 +629,10 @@ int mpc512x_fec_initialize (bd_t * bis)# endif dev->priv = (void *)fec; dev->iobase = (int )&im->fec; - dev->init = mpc512x_fec_init; - dev->halt = mpc512x_fec_halt; - dev->send = mpc512x_fec_send; - dev->recv = mpc512x_fec_recv; + dev->eo->init = mpc512x_fec_init; + dev->eo->halt = mpc512x_fec_halt; + dev->eo->send = mpc512x_fec_send; + dev->eo->recv = mpc512x_fec_recv;sprintf (dev->name,"FEC" );eth_register (dev);
drivers/net/mpc5xxx_fec.c +4 -4
@@ -915,10 +915,10 @@ int mpc5xxx_fec_initialize(bd_t * bis) dev->priv = (void *)fec; dev->iobase =MPC5XXX_FEC ; - dev->init = mpc5xxx_fec_init; - dev->halt = mpc5xxx_fec_halt; - dev->send = mpc5xxx_fec_send; - dev->recv = mpc5xxx_fec_recv; + dev->eo->init = mpc5xxx_fec_init; + dev->eo->halt = mpc5xxx_fec_halt; + dev->eo->send = mpc5xxx_fec_send; + dev->eo->recv = mpc5xxx_fec_recv;sprintf (dev->name,"FEC" );eth_register (dev);
drivers/net/mvgbe.c +5 -5
@@ -721,11 +721,11 @@ error1:return -1 ; } - dev->init = (void *)mvgbe_init; - dev->halt = (void *)mvgbe_halt; - dev->send = (void *)mvgbe_send; - dev->recv = (void *)mvgbe_recv; - dev->write_hwaddr = (void *)mvgbe_write_hwaddr; + 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;eth_register (dev);
drivers/net/natsemi.c +4 -4
@@ -332,10 +332,10 @@ natsemi_initialize(bd_t * bis)printf ("natsemi: NatSemi ns8381[56] @ %#x\n" , dev->iobase);#endif dev->priv = (void *) devno; - dev->init = natsemi_init; - dev->halt = natsemi_disable; - dev->send = natsemi_send; - dev->recv = natsemi_poll; + dev->eo->init = natsemi_init; + dev->eo->halt = natsemi_disable; + dev->eo->send = natsemi_send; + dev->eo->recv = natsemi_poll;eth_register (dev);
drivers/net/ne2000_base.c +4 -4
@@ -789,10 +789,10 @@ int ne2k_register(void)if (ne2k_setup_driver (dev))return -1 ; - dev->init = ne2k_init; - dev->halt = ne2k_halt; - dev->send = ne2k_send; - dev->recv = ne2k_recv; + dev->eo->init = ne2k_init; + dev->eo->halt = ne2k_halt; + dev->eo->send = ne2k_send; + dev->eo->recv = ne2k_recv;sprintf (dev->name,"NE2000" );
drivers/net/npe/npe.c +4 -4
@@ -625,10 +625,10 @@ int npe_initialize(bd_t * bis)sprintf (dev->name,"NPE%d" , eth_num); dev->priv = (void *)p_npe; - dev->init = npe_init; - dev->halt = npe_halt; - dev->send = npe_send; - dev->recv = npe_rx; + dev->eo->init = npe_init; + dev->eo->halt = npe_halt; + dev->eo->send = npe_send; + dev->eo->recv = npe_rx; p_npe->print_speed =1 ;
drivers/net/ns8382x.c +4 -4
@@ -346,10 +346,10 @@ ns8382x_initialize(bd_t * bis)sprintf (dev->name,"dp8382x#%d" , card_number); dev->iobase =bus_to_phys (iobase); dev->priv = (void *) devno; - dev->init = ns8382x_init; - dev->halt = ns8382x_disable; - dev->send = ns8382x_send; - dev->recv = ns8382x_poll; + dev->eo->init = ns8382x_init; + dev->eo->halt = ns8382x_disable; + dev->eo->send = ns8382x_send; + dev->eo->recv = ns8382x_poll;/* ns8382x has a non-standard PM control register * in PCI config space. Some boards apparently need
drivers/net/pcnet.c +4 -4
@@ -218,10 +218,10 @@ int pcnet_initialize (bd_t * bis)/* * Setup device structure and register the driver. */ - dev->init = pcnet_init; - dev->halt = pcnet_halt; - dev->send = pcnet_send; - dev->recv = pcnet_recv; + dev->eo->init = pcnet_init; + dev->eo->halt = pcnet_halt; + dev->eo->send = pcnet_send; + dev->eo->recv = pcnet_recv;eth_register (dev); }
drivers/net/plb2800_eth.c +4 -4
@@ -110,10 +110,10 @@ int plb2800_eth_initialize(bd_t * bis)memset (dev,0 ,sizeof (*dev));sprintf (dev->name,"PLB2800 Switch" ); - dev->init = plb2800_eth_init; - dev->halt = plb2800_eth_halt; - dev->send = plb2800_eth_send; - dev->recv = plb2800_eth_recv; + dev->eo->init = plb2800_eth_init; + dev->eo->halt = plb2800_eth_halt; + dev->eo->send = plb2800_eth_send; + dev->eo->recv = plb2800_eth_recv;eth_register (dev);
drivers/net/rtl8139.c +5 -5
@@ -229,12 +229,12 @@ int rtl8139_initialize(bd_t *bis) dev->priv = (void *) devno; dev->iobase = (int )bus_to_phys (iobase); - dev->init = rtl8139_probe; - dev->halt = rtl_disable; - dev->send = rtl_transmit; - dev->recv = rtl_poll; + 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->mcast = rtl_bcast_addr; + dev->eo->mcast = rtl_bcast_addr;#endif eth_register (dev);
drivers/net/rtl8169.c +4 -4
@@ -902,10 +902,10 @@ int rtl8169_initialize(bd_t *bis) dev->priv = (void *) devno; dev->iobase = (int )pci_mem_to_phys (devno, iobase); - dev->init = rtl_reset; - dev->halt = rtl_halt; - dev->send = rtl_send; - dev->recv = rtl_recv; + dev->eo->init = rtl_reset; + dev->eo->halt = rtl_halt; + dev->eo->send = rtl_send; + dev->eo->recv = rtl_recv;eth_register (dev);
drivers/net/sh_eth.c +4 -4
@@ -529,10 +529,10 @@ int sh_eth_initialize(bd_t *bd) dev->priv = (void *)eth; dev->iobase =0 ; - dev->init = sh_eth_init; - dev->halt = sh_eth_halt; - dev->send = sh_eth_send; - dev->recv = sh_eth_recv; + dev->eo->init = sh_eth_init; + dev->eo->halt = sh_eth_halt; + dev->eo->send = sh_eth_send; + dev->eo->recv = sh_eth_recv; eth->port_info[eth->port].dev = dev;sprintf (dev->name,SHETHER_NAME );
drivers/net/smc91111.c +5 -5
@@ -1357,11 +1357,11 @@ int smc91111_initialize(u8 dev_num, int base_addr) dev->enetaddr[i] =SMC_inb (dev, (ADDR0_REG + i));swap_to (FLASH ); - dev->init = smc_init; - dev->halt = smc_halt; - dev->send = smc_send; - dev->recv = smc_rcv; - dev->write_hwaddr = smc_write_hwaddr; + 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;sprintf (dev->name,"%s-%hu" ,SMC_DEV_NAME , dev_num);eth_register (dev);
drivers/net/smc911x.c +4 -4
@@ -282,10 +282,10 @@ int smc911x_initialize(u8 dev_num, int base_addr) dev->enetaddr[5 ] = addrh >>8 ; } - dev->init = smc911x_init; - dev->halt = smc911x_halt; - dev->send = smc911x_send; - dev->recv = smc911x_rx; + dev->eo->init = smc911x_init; + dev->eo->halt = smc911x_halt; + dev->eo->send = smc911x_send; + dev->eo->recv = smc911x_rx;sprintf (dev->name,"%s-%hu" ,DRIVERNAME , dev_num);eth_register (dev);
drivers/net/tsec.c +5 -5
@@ -638,12 +638,12 @@ 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->init = tsec_init; - dev->halt = tsec_halt; - dev->send = tsec_send; - dev->recv = tsec_recv; + 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->mcast = tsec_mcast_addr; + dev->eo->mcast = tsec_mcast_addr;#endif /* Tell u-boot to get the addr from the env */
drivers/net/tsi108_eth.c +4 -4
@@ -739,10 +739,10 @@ int tsi108_eth_initialize (bd_t * bis) dev->iobase =ETH_BASE + (index *ETH_PORT_OFFSET ); dev->priv = (void *)(phy_address[index]); - dev->init = tsi108_eth_probe; - dev->halt = tsi108_eth_halt; - dev->send = tsi108_eth_send; - dev->recv = tsi108_eth_recv; + dev->eo->init = tsi108_eth_probe; + dev->eo->halt = tsi108_eth_halt; + dev->eo->send = tsi108_eth_send; + dev->eo->recv = tsi108_eth_recv;eth_register (dev); }
drivers/net/uli526x.c +4 -4
@@ -237,10 +237,10 @@ int uli526x_initialize(bd_t *bis) db->pdev = devno; dev->iobase = iobase; - dev->init = uli526x_init_one; - dev->halt = uli526x_disable; - dev->send = uli526x_start_xmit; - dev->recv = uli526x_rx_packet; + dev->eo->init = uli526x_init_one; + dev->eo->halt = uli526x_disable; + dev->eo->send = uli526x_start_xmit; + dev->eo->recv = uli526x_rx_packet;/* init db */ db->ioaddr = dev->iobase;
drivers/net/xilinx_axi_emac.c +5 -5
@@ -645,11 +645,11 @@ 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->init = axiemac_init; - dev->halt = axiemac_halt; - dev->send = axiemac_send; - dev->recv = axiemac_recv; - dev->write_hwaddr = axiemac_setup_mac; + 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;#ifdef CONFIG_PHY_ADDR priv->phyaddr =CONFIG_PHY_ADDR ;
drivers/net/xilinx_emaclite.c +4 -4
@@ -369,10 +369,10 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,sprintf (dev->name,"Xelite.%lx" , base_addr); dev->iobase = base_addr; - dev->init = emaclite_init; - dev->halt = emaclite_halt; - dev->send = emaclite_send; - dev->recv = emaclite_recv; + dev->eo->init = emaclite_init; + dev->eo->halt = emaclite_halt; + dev->eo->send = emaclite_send; + dev->eo->recv = emaclite_recv;eth_register (dev);
drivers/net/xilinx_ll_temac.c +7 -7
@@ -313,9 +313,9 @@ int xilinx_ll_temac_initialize(bd_t *bis, struct ll_temac_info *devinf) dev->iobase = devinf->base_addr; dev->priv = ll_temac; - dev->init = ll_temac_init; - dev->halt = ll_temac_halt; - dev->write_hwaddr = ll_temac_setup_mac_addr; + 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 +334,16 @@ 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->recv = ll_temac_recv_sdma; - dev->send = ll_temac_send_sdma; + dev->eo->recv = ll_temac_recv_sdma; + dev->eo->send = ll_temac_send_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->recv = ll_temac_recv_fifo; - dev->send = ll_temac_send_fifo; + dev->eo->recv = ll_temac_recv_fifo; + dev->eo->send = ll_temac_send_fifo; }/* Link to specified MDIO bus */
drivers/net/zynq_gem.c +5 -5
@@ -425,11 +425,11 @@ int zynq_gem_initialize(bd_t *bis, int base_addr) dev->iobase = base_addr; - dev->init = zynq_gem_init; - dev->halt = zynq_gem_halt; - dev->send = zynq_gem_send; - dev->recv = zynq_gem_recv; - dev->write_hwaddr = zynq_gem_setup_mac; + 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;eth_register (dev);
drivers/usb/eth/asix.c +5 -5
@@ -702,12 +702,12 @@ 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->init = asix_init; - eth->send = asix_send; - eth->recv = asix_recv; - eth->halt = asix_halt; + eth->eo->init = asix_init; + eth->eo->send = asix_send; + eth->eo->recv = asix_recv; + eth->eo->halt = asix_halt;if (!(priv->flags &FLAG_TYPE_AX88172 )) - eth->write_hwaddr = asix_write_hwaddr; + eth->eo->write_hwaddr = asix_write_hwaddr; eth->priv = ss;if (asix_basic_reset (ss))
drivers/usb/eth/smsc95xx.c +5 -5
@@ -890,11 +890,11 @@ 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->init = smsc95xx_init; - eth->send = smsc95xx_send; - eth->recv = smsc95xx_recv; - eth->halt = smsc95xx_halt; - eth->write_hwaddr = smsc95xx_write_hwaddr; + 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->priv = ss;return 1 ; }
include/net.h +11 -6
@@ -78,12 +78,9 @@ enum eth_state_t {ETH_STATE_ACTIVE }; -struct eth_device { -char name[16 ]; -unsigned char enetaddr[6 ]; -int iobase; -int state; +struct eth_device ; +struct eth_ops {int (*init) (struct eth_device *,bd_t *);int (*send) (struct eth_device *,void *packet,int length);int (*recv) (struct eth_device *);
@@ -91,7 +88,15 @@ struct eth_device {#ifdef CONFIG_MCAST_TFTP int (*mcast) (struct eth_device *,u32 ip,u8 set);#endif -int (*write_hwaddr) (struct eth_device *); +int (*write_hwaddr) (struct eth_device *); +}; + +struct eth_device { +char name[16 ]; +unsigned char enetaddr[6 ]; +int iobase; +int state; +struct eth_ops *eo;struct eth_device *next;int index;void *priv;
net/eth.c +8 -8
@@ -217,12 +217,12 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name, dev->name); } -if (dev->write_hwaddr && +if (dev->eo->write_hwaddr && !eth_mac_skip (eth_number)) {if (!is_valid_ether_addr (dev->enetaddr))return -1 ; - ret = dev->write_hwaddr (dev); + ret = dev->eo->write_hwaddr (dev); }return ret;
@@ -363,7 +363,7 @@ int eth_initialize(bd_t *bis)int eth_mcast_join (IPaddr_t mcast_ip,u8 join) {u8 mcast_mac[6 ]; -if (!eth_current || !eth_current->mcast) +if (!eth_current || !eth_current->eo->mcast)return -1 ; mcast_mac[5 ] =htonl (mcast_ip) &0xff ; mcast_mac[4 ] = (htonl (mcast_ip)>>8 ) &0xff ;
@@ -371,7 +371,7 @@ int eth_mcast_join(IPaddr_t mcast_ip, u8 join) mcast_mac[2 ] =0x5e ; mcast_mac[1 ] =0x0 ; mcast_mac[0 ] =0x1 ; -return eth_current->mcast (eth_current, mcast_mac, join); +return eth_current->eo->mcast (eth_current, mcast_mac, join); }/* the 'way' for ethernet-CRC-32. Spliced in from Linux lib/crc32.c
@@ -426,7 +426,7 @@ int eth_init(bd_t *bis) do { debug("Trying %s\n", eth_current->name); - if (eth_current->init(eth_current, bis) >= 0) { + if (eth_current->eo->init(eth_current, bis) >= 0) { eth_current->state = ETH_STATE_ACTIVE; return 0;
@@ -444,7 +444,7 @@ void eth_halt(void)if (!eth_current)return ; - eth_current->halt (eth_current); + eth_current->eo->halt (eth_current); eth_current->state =ETH_STATE_PASSIVE ; }
@@ -454,7 +454,7 @@ int eth_send(void *packet, int length)if (!eth_current)return -1 ; -return eth_current->send (eth_current, packet, length); +return eth_current->eo->send (eth_current, packet, length); }int eth_rx (void )
@@ -462,7 +462,7 @@ int eth_rx(void)if (!eth_current)return -1 ; -return eth_current->recv (eth_current); +return eth_current->eo->recv (eth_current); }#ifdef CONFIG_API
Signature · 1 line
1.7.10.4
RFC PATCH 2/50 net: 4xx_enet: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/4xx_enet.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/4xx_enet.c +8 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 3/50 net: altera_tse: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/altera_tse.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/altera_tse.c +9 -5
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 4/50 net: dm9000x: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/dm9000x.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/dm9000x.c +8 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 5/50 net: armada100_fec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/armada100_fec.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/armada100_fec.c +8 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 6/50 net: at91_emac: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/at91_emac.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/at91_emac.c +9 -5
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 7/50 net: ax88180: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/ax88180.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/net/ax88180.c +9 -4
@@ -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 ;
Signature · 1 line
1.7.10.4
RFC PATCH 8/50 net: bfin_mac: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/bfin_mac.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/bfin_mac.c +9 -5
@@ -91,6 +91,14 @@ static int bfin_miiphy_write(const char *devname, uchar addr, uchar reg, ushortreturn 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);
Signature · 1 line
1.7.10.4
RFC PATCH 9/50 net: calxedaxgmac: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/calxedaxgmac.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/net/calxedaxgmac.c +10 -4
@@ -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 (®s->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);
Signature · 1 line
1.7.10.4
RFC PATCH 10/50 net: cpsw: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/cpsw.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/cpsw.c +9 -5
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 11/50 net: cs8900: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/cs8900.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/cs8900.c +8 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 12/50 net: davinci_emac: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/davinci_emac.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/davinci_emac.c +9 -5
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 13/50 net: dc2114x: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/dc2114x.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/dc2114x.c +9 -5
@@ -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 );
Signature · 1 line
1.7.10.4
RFC PATCH 14/50 net: designware: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/designware.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/designware.c +9 -5
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 15/50 net: dnet: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/dnet.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/dnet.c +8 -4
@@ -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) &0xFFFF ; debug("%s: has %smdio, %sirq, %sgigabit, %sdma\n", netdev->name,
Signature · 1 line
1.7.10.4
RFC PATCH 16/50 net: e1000: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/e1000.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/e1000.c +8 -4
@@ -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); }
Signature · 1 line
1.7.10.4
RFC PATCH 17/50 net: eepro100: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/eepro100.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/eepro100.c +8 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 18/50 net: enc28j60: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/enc28j60.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/enc28j60.c +9 -5
@@ -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 )
Signature · 1 line
1.7.10.4
RFC PATCH 19/50 net: ep93xx_eth: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/ep93xx_eth.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/ep93xx_eth.c +8 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 20/50 net: ethoc: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/ethoc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/ethoc.c +9 -5
@@ -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 = ðoc_ops;sprintf (dev->name,"%s-%hu" ,"ETHOC" , dev_num);eth_register (dev);
Signature · 1 line
1.7.10.4
RFC PATCH 21/50 net: fec_mxc: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/fec_mxc.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/net/fec_mxc.c +10 -5
@@ -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;
Signature · 1 line
1.7.10.4
RFC PATCH 22/50 net: ftgmac100: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/ftgmac100.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/ftgmac100.c +8 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 23/50 net: greth.c: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/greth.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/greth.c +8 -4
@@ -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 */
Signature · 1 line
1.7.10.4
RFC PATCH 24/50 net: fsl_mcdmafec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/fsl_mcdmafec.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/fsl_mcdmafec.c +8 -4
@@ -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
Signature · 1 line
1.7.10.4
RFC PATCH 25/50 net: inca-ip_sw: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/inca-ip_sw.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/net/inca-ip_sw.c +7 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 26/50 net: ks8695eth: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/ks8695eth.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/ks8695eth.c +8 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 27/50 net: lan91c96: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/lan91c96.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/lan91c96.c +8 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 28/50 net: macb: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/macb.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/macb.c +9 -5
@@ -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
Signature · 1 line
1.7.10.4
RFC PATCH 29/50 net: mcffec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/mcffec.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/mcffec.c +8 -4
@@ -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
Signature · 1 line
1.7.10.4
RFC PATCH 30/50 net: mpc5xxx_fec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/mpc5xxx_fec.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/net/mpc5xxx_fec.c +7 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 31/50 net: mvgbe: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/mvgbe.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/mvgbe.c +9 -5
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 32/50 net: mpc512x_fec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/mpc512x_fec.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/mpc512x_fec.c +8 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 33/50 net: natsemi: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/natsemi.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/natsemi.c +8 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 34/50 net: ne2000: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/ne2000_base.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/ne2000_base.c +8 -4
@@ -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" );
Signature · 1 line
1.7.10.4
RFC PATCH 35/50 net: npe: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/npe/npe.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/npe/npe.c +8 -4
@@ -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 ;
Signature · 1 line
1.7.10.4
RFC PATCH 36/50 net: ns8382x: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/ns8382x.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/net/ns8382x.c +9 -4
@@ -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
Signature · 1 line
1.7.10.4
RFC PATCH 37/50 net: pcnet: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/pcnet.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/pcnet.c +8 -5
@@ -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); }
Signature · 1 line
1.7.10.4
RFC PATCH 38/50 net: plb2800_eth: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/plb2800_eth.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/net/plb2800_eth.c +7 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 39/50 net: rtl8139: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/rtl8139.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/net/rtl8139.c +11 -7
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 40/50 net: rtl8169: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/rtl8169.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/net/rtl8169.c +9 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 41/50 net: smc91111: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/smc91111.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/smc91111.c +9 -5
@@ -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 smc91111_initialize (u8 dev_num,int base_addr) {struct smc91111_priv *priv;
@@ -1357,11 +1365,7 @@ int smc91111_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);
Signature · 1 line
1.7.10.4
RFC PATCH 42/50 net: smc911x: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/smc911x.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/smc911x.c +8 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 43/50 net: tsec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/tsec.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/net/tsec.c +11 -7
@@ -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++)
Signature · 1 line
1.7.10.4
RFC PATCH 44/50 net: tsi108_eth: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/tsi108_eth.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/tsi108_eth.c +8 -4
@@ -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); }
Signature · 1 line
1.7.10.4
RFC PATCH 45/50 net: uli526x: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/uli526x.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/uli526x.c +8 -4
@@ -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;
Signature · 1 line
1.7.10.4
RFC PATCH 46/50 net: xilinx_axi_emac: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/xilinx_axi_emac.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/net/xilinx_axi_emac.c +10 -5
@@ -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 ;
Signature · 1 line
1.7.10.4
RFC PATCH 47/50 net: xilinx_emaclite: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/xilinx_emaclite.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/xilinx_emaclite.c +8 -4
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 48/50 net: zynq_gem: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/zynq_gem.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/zynq_gem.c +9 -5
@@ -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);
Signature · 1 line
1.7.10.4
RFC PATCH 49/50 net: xilinx_ll_temac: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/xilinx_ll_temac.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-)
drivers/net/xilinx_ll_temac.c +20 -7
@@ -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 */
Signature · 1 line
1.7.10.4
RFC PATCH 50/50 net: sh_eth: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/sh_eth.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/sh_eth.c +8 -4
@@ -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 );
Signature · 1 line
1.7.10.4
cover net: net subsystem ops cleanup
In reply to Tomas HlavacekDear Tomas Hlavacek,
Quoted 9 lines
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 theeth_devicestruct. Add a sparate structureeth_opswhich is ready for inclusion to DM core.
2) Replace dynamic init of ops function pointers by static struct.
3) Do minor style cleanup.
CCing Joe ...
Quoted 109 lines
Tomas Hlavacek (50):
net: dm: Pull out ops from structeth_device
net: 4xx_enet: Pull out init of structeth_ops
net:altera_tse: Pull out init of structeth_ops
net: dm9000x: Pull out init of structeth_ops
net:armada100_fec: Pull out init of structeth_ops
net:at91_emac: Pull out init of structeth_ops
net: ax88180: Pull out init of structeth_ops
net:bfin_mac: Pull out init of structeth_ops
net: calxedaxgmac: Pull out init of structeth_ops
net: cpsw: Pull out init of structeth_ops
net: cs8900: Pull out init of structeth_ops
net:davinci_emac: Pull out init of structeth_ops
net: dc2114x: Pull out init of structeth_ops
net: designware: Pull out init of structeth_ops
net: dnet: Pull out init of structeth_ops
net: e1000: Pull out init of structeth_ops
net: eepro100: Pull out init of structeth_ops
net: enc28j60: Pull out init of structeth_ops
net:ep93xx_eth: Pull out init of structeth_ops
net: ethoc: Pull out init of structeth_ops
net:fec_mxc: Pull out init of structeth_ops
net: ftgmac100: Pull out init of structeth_ops
net:greth.c: Pull out init of structeth_ops
net:fsl_mcdmafec: Pull out init of structeth_ops
net: inca-ip_sw: Pull out init of structeth_ops
net: ks8695eth: Pull out init of structeth_ops
net: lan91c96: Pull out init of structeth_ops
net: macb: Pull out init of structeth_ops
net: mcffec: Pull out init of structeth_ops
net:mpc5xxx_fec: Pull out init of structeth_ops
net: mvgbe: Pull out init of structeth_ops
net:mpc512x_fec: Pull out init of structeth_ops
net: natsemi: Pull out init of structeth_ops
net: ne2000: Pull out init of structeth_ops
net: npe: Pull out init of structeth_ops
net: ns8382x: Pull out init of structeth_ops
net: pcnet: Pull out init of structeth_ops
net:plb2800_eth: Pull out init of structeth_ops
net: rtl8139: Pull out init of structeth_ops
net: rtl8169: Pull out init of structeth_ops
net: smc91111: Pull out init of structeth_ops
net: smc911x: Pull out init of structeth_ops
net: tsec: Pull out init of structeth_ops
net:tsi108_eth: Pull out init of structeth_ops
net: uli526x: Pull out init of structeth_ops
net:xilinx_axi_emac: Pull out init of structeth_ops
net:xilinx_emaclite: Pull out init of structeth_ops
net:zynq_gem: Pull out init of structeth_ops
net:xilinx_ll_temac: Pull out init of structeth_ops
net:sh_eth: Pull out init of structeth_opsboard/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 ++++++++----- drivers/net/plb2800_eth.c | 11 +++++++---- drivers/net/rtl8139.c | 18 +++++++++++------- drivers/net/rtl8169.c | 13 +++++++++---- drivers/net/sh_eth.c | 12 ++++++++---- drivers/net/smc91111.c | 14 +++++++++----- drivers/net/smc911x.c | 12 ++++++++---- drivers/net/tsec.c | 18 +++++++++++------- drivers/net/tsi108_eth.c | 12 ++++++++---- drivers/net/uli526x.c | 12 ++++++++---- drivers/net/xilinx_axi_emac.c | 15 ++++++++++----- drivers/net/xilinx_emaclite.c | 12 ++++++++---- drivers/net/xilinx_ll_temac.c | 27 ++++++++++++++++++++------- drivers/net/zynq_gem.c | 14 +++++++++----- drivers/usb/eth/asix.c | 10 +++++----- drivers/usb/eth/smsc95xx.c | 10 +++++----- include/net.h | 17 +++++++++++------ net/eth.c | 16 ++++++++-------- 56 files changed, 467 insertions(+), 254 deletions(-)
cover net: net subsystem ops cleanup
In reply to Tomas HlavacekDear Tomas Hlavacek,
Quoted 10 lines · In message <[email protected]> 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 theeth_devicestruct. Add a sparate structureeth_opswhich is ready for inclusion to DM core.
2) Replace dynamic init of ops function pointers by static struct.
3) Do minor style cleanup.
Quoted 6 lines
Tomas Hlavacek (50):
net: dm: Pull out ops from structeth_device
net: 4xx_enet: Pull out init of structeth_ops
net:altera_tse: Pull out init of structeth_ops
net: dm9000x: Pull out init of structeth_ops
net:armada100_fec: Pull out init of structeth_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?
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] Put your Nose to the Grindstone! -- Amalgamated Plastic Surgeons and Toolmakers, Ltd.
cover net: net subsystem ops cleanup
Dear Wolfgang,
Quoted 20 lines · Wolfgang Denk
Dear Tomas Hlavacek,
Quoted 10 lines · In message <[email protected]> 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 theeth_devicestruct. Add a sparate structureeth_opswhich is ready for inclusion to DM core.
2) Replace dynamic init of ops function pointers by static struct.
3) Do minor style cleanup.Quoted 6 lines
Tomas Hlavacek (50):
net: dm: Pull out ops from structeth_device
net: 4xx_enet: Pull out init of structeth_ops
net:altera_tse: Pull out init of structeth_ops
net: dm9000x: Pull out init of structeth_ops
net:armada100_fec: Pull out init of structeth_ops
Quoted 3 lines
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
cover net: net subsystem ops cleanup
Hi Tomas,
Quoted 27 lines · Tomas Hlavacek
Dear Wolfgang,
Quoted 20 lines · Wolfgang Denk
Dear Tomas Hlavacek,
Quoted 10 lines · In message <[email protected]> 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 theeth_devicestruct. Add a sparate structureeth_opswhich is ready for inclusion to DM core.
2) Replace dynamic init of ops function pointers by static struct.
3) Do minor style cleanup.Quoted 6 lines
Tomas Hlavacek (50):
net: dm: Pull out ops from structeth_device
net: 4xx_enet: Pull out init of structeth_ops
net:altera_tse: Pull out init of structeth_ops
net: dm9000x: Pull out init of structeth_ops
net:armada100_fec: Pull out init of structeth_opsQuoted 3 lines
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?
Quoted 7 lines
It should be, because the first patch adds new struct
eth_opsand 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?
Thanks,
-Joe
cover net: net subsystem ops cleanup
Hello Joe!
Quoted 38 lines · Joe Hershberger
Hi Tomas,
Quoted 27 lines · Tomas Hlavacek
Dear Wolfgang,
Quoted 20 lines · Wolfgang Denk
Dear Tomas Hlavacek,
Quoted 10 lines · In message <[email protected]> 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 theeth_devicestruct. Add a sparate structureeth_opswhich is ready for inclusion to DM core.
2) Replace dynamic init of ops function pointers by static struct.
3) Do minor style cleanup.Quoted 6 lines
Tomas Hlavacek (50):
net: dm: Pull out ops from structeth_device
net: 4xx_enet: Pull out init of structeth_ops
net:altera_tse: Pull out init of structeth_ops
net: dm9000x: Pull out init of structeth_ops
net:armada100_fec: Pull out init of structeth_opsQuoted 3 lines
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?
Quoted 7 lines
It should be, because the first patch adds new struct
eth_opsand 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.
Quoted 2 lines
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
v2 cover net: net subsystem ops cleanup
In reply to Tomas HlavacekThis 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...
text data bss dec hex filename
247910 4412 272348 524670 8017e ./u-boot
and after:
Configuring for colibri_pxa270 board...
text data bss dec hex filename
247878 4432 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: smc91111: 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 ++++++++---- arch/powerpc/cpu/mpc8xx/scc.c | 12 ++++++++---- board/Marvell/db64360/mv_eth.c | 12 ++++++++---- board/Marvell/db64460/mv_eth.c | 12 ++++++++---- board/davinci/da8xxevm/da830evm.c | 2 +- board/esd/cpci750/mv_eth.c | 12 ++++++++---- board/evb64260/eth.c | 13 +++++++++---- board/prodrive/p3mx/mv_eth.c | 12 ++++++++---- 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 | 12 ++++++++---- drivers/net/fsl_mcdmafec.c | 12 ++++++++---- drivers/net/ftgmac100.c | 12 ++++++++---- drivers/net/ftmac100.c | 12 ++++++++---- 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 ++++++++----- drivers/net/plb2800_eth.c | 11 +++++++---- drivers/net/rtl8139.c | 18 +++++++++++------- drivers/net/rtl8169.c | 13 +++++++++---- drivers/net/sh_eth.c | 12 ++++++++---- drivers/net/smc91111.c | 14 +++++++++----- drivers/net/smc911x.c | 12 ++++++++---- drivers/net/tsec.c | 18 +++++++++++------- drivers/net/tsi108_eth.c | 12 ++++++++---- drivers/net/uli526x.c | 12 ++++++++---- drivers/net/xilinx_axi_emac.c | 15 ++++++++++----- drivers/net/xilinx_emaclite.c | 12 ++++++++---- drivers/net/xilinx_ll_temac.c | 27 ++++++++++++++++++++------- drivers/net/zynq_gem.c | 14 +++++++++----- drivers/qe/uec.c | 12 ++++++++---- drivers/usb/eth/asix.c | 14 +++++++++----- drivers/usb/eth/smsc95xx.c | 14 +++++++++----- include/net.h | 17 +++++++++++------ net/eth.c | 16 ++++++++-------- 69 files changed, 590 insertions(+), 309 deletions(-)
Signature · 1 line
1.7.2.5
PATCH v2 1/67 net: dm: Pull out ops from struct eth_device
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.
--- 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/smc91111.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(-)
arch/mips/cpu/mips32/au1x00/au1x00_eth.c +5 -5
@@ -295,11 +295,11 @@ int au1x00_enet_initialize(bd_t *bis){sprintf (dev->name,"Au1X00 ethernet" ); dev->iobase =0 ; - dev->priv =0 ; - dev->init = au1x00_init; - dev->halt = au1x00_halt; - dev->send = au1x00_send; - dev->recv = au1x00_recv; + dev->priv =0 ; + dev->eo->init = au1x00_init; + dev->eo->halt = au1x00_halt; + dev->eo->send = au1x00_send; + dev->eo->recv = au1x00_recv;eth_register (dev);
arch/powerpc/cpu/mpc8220/fec.c +4 -4
@@ -833,10 +833,10 @@ int mpc8220_fec_initialize (bd_t * bis) dev->priv = (void *) fec; dev->iobase =MMAP_FEC1 ; - dev->init = mpc8220_fec_init; - dev->halt = mpc8220_fec_halt; - dev->send = mpc8220_fec_send; - dev->recv = mpc8220_fec_recv; + dev->eo->init = mpc8220_fec_init; + dev->eo->halt = mpc8220_fec_halt; + dev->eo->send = mpc8220_fec_send; + dev->eo->recv = mpc8220_fec_recv;sprintf (dev->name,"FEC" );eth_register (dev);
arch/powerpc/cpu/mpc8260/ether_fcc.c +5 -5
@@ -384,11 +384,11 @@ int fec_initialize(bd_t *bis)sprintf (dev->name,"FCC%d" , ether_fcc_info[i].ether_index +1 ); - dev->priv = ðer_fcc_info[i]; - dev->init = fec_init; - dev->halt = fec_halt; - dev->send = fec_send; - dev->recv = fec_recv; + dev->priv = ðer_fcc_info[i]; + dev->eo->init = fec_init; + dev->eo->halt = fec_halt; + dev->eo->send = fec_send; + dev->eo->recv = fec_recv;eth_register (dev);
arch/powerpc/cpu/mpc8260/ether_scc.c +4 -4
@@ -372,10 +372,10 @@ int mpc82xx_scc_enet_initialize(bd_t *bis)memset (dev,0 ,sizeof *dev);sprintf (dev->name,"SCC" ); - dev->init = sec_init; - dev->halt = sec_halt; - dev->send = sec_send; - dev->recv = sec_rx; + dev->eo->init = sec_init; + dev->eo->halt = sec_halt; + dev->eo->send = sec_send; + dev->eo->recv = sec_rx;eth_register (dev);
arch/powerpc/cpu/mpc85xx/ether_fcc.c +5 -5
@@ -447,11 +447,11 @@ int fec_initialize(bd_t *bis)sprintf (dev->name,"FCC%d" , ether_fcc_info[i].ether_index +1 ); - dev->priv = ðer_fcc_info[i]; - dev->init = fec_init; - dev->halt = fec_halt; - dev->send = fec_send; - dev->recv = fec_recv; + dev->priv = ðer_fcc_info[i]; + dev->eo->init = fec_init; + dev->eo->halt = fec_halt; + dev->eo->send = fec_send; + dev->eo->recv = fec_recv;eth_register (dev);
arch/powerpc/cpu/mpc8xx/fec.c +4 -4
@@ -178,10 +178,10 @@ int fec_initialize(bd_t *bis) efis->actual_phy_addr =-1 ; dev->priv = efis; - dev->init = fec_init; - dev->halt = fec_halt; - dev->send = fec_send; - dev->recv = fec_recv; + dev->eo->init = fec_init; + dev->eo->halt = fec_halt; + dev->eo->send = fec_send; + dev->eo->recv = fec_recv;eth_register (dev);
arch/powerpc/cpu/mpc8xx/scc.c +4 -4
@@ -80,10 +80,10 @@ int scc_initialize(bd_t *bis)sprintf (dev->name,"SCC" ); dev->iobase =0 ; dev->priv =0 ; - dev->init = scc_init; - dev->halt = scc_halt; - dev->send = scc_send; - dev->recv = scc_recv; + dev->eo->init = scc_init; + dev->eo->halt = scc_halt; + dev->eo->send = scc_send; + dev->eo->recv = scc_recv;eth_register (dev);
board/Marvell/db64360/mv_eth.c +4 -4
@@ -259,10 +259,10 @@ 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->init = (void *) db64360_eth_probe; - dev->halt = (void *) ethernet_phy_reset; - dev->send = (void *) db64360_eth_transmit; - dev->recv = (void *) db64360_eth_poll; + 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; ethernet_private =calloc (sizeof (*ethernet_private),1 ); dev->priv = (void *) ethernet_private;
board/Marvell/db64460/mv_eth.c +4 -4
@@ -259,10 +259,10 @@ 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->init = (void *) db64460_eth_probe; - dev->halt = (void *) ethernet_phy_reset; - dev->send = (void *) db64460_eth_transmit; - dev->recv = (void *) db64460_eth_poll; + 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; ethernet_private =calloc (sizeof (*ethernet_private),1 ); dev->priv = (void *)ethernet_private;
board/davinci/da8xxevm/da830evm.c +1 -1
@@ -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 ; }
board/esd/cpci750/mv_eth.c +4 -4
@@ -259,10 +259,10 @@ 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->init = (void *) db64360_eth_probe; - dev->halt = (void *) ethernet_phy_reset; - dev->send = (void *) db64360_eth_transmit; - dev->recv = (void *) db64360_eth_poll; + 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; ethernet_private =calloc (sizeof (*ethernet_private),1 );
board/evb64260/eth.c +4 -4
@@ -720,10 +720,10 @@ gt6426x_eth_initialize(bd_t *bis) s = (*e) ? e+1 : e; } - dev->init = (void *)gt6426x_eth_probe; - dev->halt = (void *)gt6426x_eth_reset; - dev->send = (void *)gt6426x_eth_transmit; - dev->recv = (void *)gt6426x_eth_poll; + 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; p =calloc (sizeof (*p),1 ); dev->priv = (void *)p;
board/prodrive/p3mx/mv_eth.c +4 -4
@@ -309,10 +309,10 @@ 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->init = (void *) db64460_eth_probe; - dev->halt = (void *) ethernet_phy_reset; - dev->send = (void *) db64460_eth_transmit; - dev->recv = (void *) db64460_eth_poll; + 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; ethernet_private =calloc (sizeof (*ethernet_private),1 ); dev->priv = (void *)ethernet_private;
drivers/net/4xx_enet.c +4 -4
@@ -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);
drivers/net/altera_tse.c +5 -5
@@ -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->send = tse_eth_send; - dev->recv = tse_eth_rx; - dev->write_hwaddr = tse_set_mac_address; + 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;sprintf (dev->name,"%s-%hu" ,"ALTERA_TSE" , dev_num);eth_register (dev);
drivers/net/armada100_fec.c +4 -4
@@ -718,10 +718,10 @@ int armada100_fec_register(unsigned long base_addr)/* must be less than sizeof(dev->name) */ strcpy (dev->name,"armd-fec0" ); - dev->init = armdfec_init; - dev->halt = armdfec_halt; - dev->send = armdfec_send; - dev->recv = armdfec_recv; + dev->eo->init = armdfec_init; + dev->eo->halt = armdfec_halt; + dev->eo->send = armdfec_send; + dev->eo->recv = armdfec_recv;eth_register (dev);
drivers/net/at91_emac.c +5 -5
@@ -518,11 +518,11 @@ int at91emac_register(bd_t *bis, unsigned long iobase)sprintf (dev->name,"emac" ); dev->iobase = iobase; dev->priv = emacfix; - dev->init = at91emac_init; - dev->halt = at91emac_halt; - dev->send = at91emac_send; - dev->recv = at91emac_recv; - dev->write_hwaddr = at91emac_write_hwaddr; + 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;eth_register (dev);
drivers/net/ax88180.c +4 -4
@@ -725,10 +725,10 @@ int ax88180_initialize (bd_t * bis)sprintf (dev->name,"ax88180" ); dev->iobase =AX88180_BASE ; dev->priv = priv; - dev->init = ax88180_init; - dev->halt = ax88180_halt; - dev->send = ax88180_send; - dev->recv = ax88180_recv; + dev->eo->init = ax88180_init; + dev->eo->halt = ax88180_halt; + dev->eo->send = ax88180_send; + dev->eo->recv = ax88180_recv; priv->BusWidth =BUS_WIDTH_32 ; priv->PadSize =3 ;
drivers/net/bfin_mac.c +5 -5
@@ -103,11 +103,11 @@ int bfin_EMAC_initialize(bd_t *bis) dev->iobase =0 ; dev->priv =0 ; - dev->init = bfin_EMAC_init; - dev->halt = bfin_EMAC_halt; - dev->send = bfin_EMAC_send; - dev->recv = bfin_EMAC_recv; - dev->write_hwaddr = bfin_EMAC_setup_addr; + 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;eth_register (dev);
drivers/net/calxedaxgmac.c +4 -4
@@ -543,10 +543,10 @@ int calxedaxgmac_initialize(u32 id, ulong base_addr) macaddr[0 ] =readl (®s->macaddr[0 ].lo);memcpy (dev->enetaddr, macaddr,6 ); - dev->init = xgmac_init; - dev->send = xgmac_tx; - dev->recv = xgmac_rx; - dev->halt = xgmac_halt; + dev->eo->init = xgmac_init; + dev->eo->send = xgmac_tx; + dev->eo->recv = xgmac_rx; + dev->eo->halt = xgmac_halt;eth_register (dev);
drivers/net/cpsw.c +4 -4
@@ -974,10 +974,10 @@ int cpsw_register(struct cpsw_platform_data *data)strcpy (dev->name,"cpsw" ); dev->iobase =0 ; - dev->init = cpsw_init; - dev->halt = cpsw_halt; - dev->send = cpsw_send; - dev->recv = cpsw_recv; + dev->eo->init = cpsw_init; + dev->eo->halt = cpsw_halt; + dev->eo->send = cpsw_send; + dev->eo->recv = cpsw_recv; dev->priv = priv;eth_register (dev);
drivers/net/cs8900.c +4 -4
@@ -320,10 +320,10 @@ int cs8900_initialize(u8 dev_num, int base_addr) dev->iobase = base_addr; dev->priv = priv; - dev->init = cs8900_init; - dev->halt = cs8900_halt; - dev->send = cs8900_send; - dev->recv = cs8900_recv; + dev->eo->init = cs8900_init; + dev->eo->halt = cs8900_halt; + dev->eo->send = cs8900_send; + dev->eo->recv = cs8900_recv;/* Load MAC address from EEPROM */ cs8900_get_enetaddr (dev);
drivers/net/davinci_emac.c +5 -5
@@ -791,11 +791,11 @@ int davinci_emac_initialize(void)sprintf (dev->name,"DaVinci-EMAC" ); dev->iobase =0 ; - dev->init = davinci_eth_open; - dev->halt = davinci_eth_close; - dev->send = davinci_eth_send_packet; - dev->recv = davinci_eth_rcv_packet; - dev->write_hwaddr = davinci_eth_set_mac_addr; + 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;eth_register (dev);
drivers/net/dc2114x.c +4 -4
@@ -300,10 +300,10 @@ int dc21x4x_initialize(bd_t *bis) dev->iobase =pci_mem_to_phys (devbusfn, iobase);#endif dev->priv = (void *) devbusfn; - dev->init = dc21x4x_init; - dev->halt = dc21x4x_halt; - dev->send = dc21x4x_send; - dev->recv = dc21x4x_recv; + dev->eo->init = dc21x4x_init; + dev->eo->halt = dc21x4x_halt; + dev->eo->send = dc21x4x_send; + dev->eo->recv = dc21x4x_recv;/* Ensure we're not sleeping. */ pci_write_config_byte (devbusfn,PCI_CFDA_PSM ,WAKEUP );
drivers/net/designware.c +5 -5
@@ -559,11 +559,11 @@ int designware_initialize(u32 id, ulong base_addr, u32 phy_addr, u32 interface) priv->phy_configured =0 ; priv->interface = interface; - dev->init = dw_eth_init; - dev->send = dw_eth_send; - dev->recv = dw_eth_recv; - dev->halt = dw_eth_halt; - dev->write_hwaddr = dw_write_hwaddr; + 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;eth_register (dev);
drivers/net/dm9000x.c +4 -4
@@ -630,10 +630,10 @@ int dm9000_initialize(bd_t *bis)/* Load MAC address from EEPROM */ dm9000_get_enetaddr (dev); - dev->init = dm9000_init; - dev->halt = dm9000_halt; - dev->send = dm9000_send; - dev->recv = dm9000_rx; + dev->eo->init = dm9000_init; + dev->eo->halt = dm9000_halt; + dev->eo->send = dm9000_send; + dev->eo->recv = dm9000_rx;sprintf (dev->name,"dm9000" );eth_register (dev);
drivers/net/dnet.c +5 -5
@@ -374,13 +374,13 @@ int dnet_eth_initialize(int id, void *regs, unsigned int phy_addr) dnet->phy_addr = phy_addr;sprintf (netdev->name,"dnet%d" , id); - netdev->init = dnet_init; - netdev->halt = dnet_halt; - netdev->send = dnet_send; - netdev->recv = dnet_recv; + netdev->eo->init = dnet_init; + netdev->eo->halt = dnet_halt; + netdev->eo->send = dnet_send; + netdev->eo->recv = dnet_recv; dev_capa =readl (&dnet->regs->VERCAPS) &0xFFFF ; - debug("%s: has %smdio, %sirq, %sgigabit, %sdma \n", netdev->name, + debug("%s: has %smdio, %sirq, %sgigabit, %sdma\n", netdev->name, (dev_capa & DNET_HAS_MDIO) ? "" : "no ", (dev_capa & DNET_HAS_IRQ) ? "" : "no ", (dev_capa & DNET_HAS_GIGABIT) ? "" : "no ",
drivers/net/e1000.c +4 -4
@@ -5218,10 +5218,10 @@ e1000_initialize(bd_t * bis) nic->enetaddr[3], nic->enetaddr[4], nic->enetaddr[5]);/* Set up the function pointers and register the device */ - nic->init = e1000_init; - nic->recv = e1000_poll; - nic->send = e1000_transmit; - nic->halt = e1000_disable; + nic->eo->init = e1000_init; + nic->eo->recv = e1000_poll; + nic->eo->send = e1000_transmit; + nic->eo->halt = e1000_disable;eth_register (nic); }
drivers/net/eepro100.c +4 -4
@@ -458,10 +458,10 @@ 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->init = eepro100_init; - dev->halt = eepro100_halt; - dev->send = eepro100_send; - dev->recv = eepro100_recv; + dev->eo->init = eepro100_init; + dev->eo->halt = eepro100_halt; + dev->eo->send = eepro100_send; + dev->eo->recv = eepro100_recv;eth_register (dev);
drivers/net/enc28j60.c +5 -5
@@ -962,11 +962,11 @@ int enc28j60_initialize(unsigned int bus, unsigned int cs, enc->dev = dev;/* now fill the eth_device object */ dev->priv = enc; - dev->init = enc_init; - dev->halt = enc_halt; - dev->send = enc_send; - dev->recv = enc_recv; - dev->write_hwaddr = enc_write_hwaddr; + 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;sprintf (dev->name,"enc%i.%i" , bus, cs);eth_register (dev);#if defined(CONFIG_CMD_MII )
drivers/net/ep93xx_eth.c +4 -4
@@ -499,10 +499,10 @@ int ep93xx_eth_initialize(u8 dev_num, int base_addr) dev->iobase = base_addr; dev->priv = priv; - dev->init = ep93xx_eth_open; - dev->halt = ep93xx_eth_close; - dev->send = ep93xx_eth_send_packet; - dev->recv = ep93xx_eth_rcv_packet; + 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;sprintf (dev->name,"ep93xx_eth-%hu" , dev_num);
drivers/net/ethoc.c +5 -5
@@ -499,11 +499,11 @@ int ethoc_initialize(u8 dev_num, int base_addr)memset (dev,0 ,sizeof (*dev)); dev->priv = priv; dev->iobase = base_addr; - dev->init = ethoc_init; - dev->halt = ethoc_halt; - dev->send = ethoc_send; - dev->recv = ethoc_recv; - dev->write_hwaddr = ethoc_set_mac_address; + 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;sprintf (dev->name,"%s-%hu" ,"ETHOC" , dev_num);eth_register (dev);
drivers/net/fec_mxc.c +5 -5
@@ -943,11 +943,11 @@ 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->init = fec_init; - edev->send = fec_send; - edev->recv = fec_recv; - edev->halt = fec_halt; - edev->write_hwaddr = fec_set_hwaddr; + 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; fec->eth = (struct ethernet_regs *)base_addr; fec->bd = bd;
drivers/net/fm/eth.c +4 -4
@@ -653,10 +653,10 @@ 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->init = fm_eth_open; - dev->halt = fm_eth_halt; - dev->send = fm_eth_send; - dev->recv = fm_eth_recv; + dev->eo->init = fm_eth_open; + dev->eo->halt = fm_eth_halt; + dev->eo->send = fm_eth_send; + dev->eo->recv = fm_eth_recv; fm_eth->dev = dev; fm_eth->bus = info->bus; fm_eth->phyaddr = info->phy_addr;
drivers/net/fsl_mcdmafec.c +4 -4
@@ -533,10 +533,10 @@ int mcdmafec_initialize(bd_t * bis)sprintf (dev->name,"FEC%d" , fec_info[i].index); dev->priv = &fec_info[i]; - dev->init = fec_init; - dev->halt = fec_halt; - dev->send = fec_send; - dev->recv = fec_recv; + dev->eo->init = fec_init; + dev->eo->halt = fec_halt; + dev->eo->send = fec_send; + dev->eo->recv = fec_recv;/* setup Receive and Transmit buffer descriptor */ #ifdef CONFIG_SYS_DMA_USE_INTSRAM
drivers/net/ftgmac100.c +4 -4
@@ -548,10 +548,10 @@ int ftgmac100_initialize(bd_t *bd)sprintf (dev->name,"FTGMAC100" ); dev->iobase =CONFIG_FTGMAC100_BASE ; - dev->init = ftgmac100_init; - dev->halt = ftgmac100_halt; - dev->send = ftgmac100_send; - dev->recv = ftgmac100_recv; + dev->eo->init = ftgmac100_init; + dev->eo->halt = ftgmac100_halt; + dev->eo->send = ftgmac100_send; + dev->eo->recv = ftgmac100_recv; dev->priv = priv;eth_register (dev);
drivers/net/ftmac100.c +4 -4
@@ -260,10 +260,10 @@ int ftmac100_initialize (bd_t *bd)sprintf (dev->name,"FTMAC100" ); dev->iobase =CONFIG_FTMAC100_BASE ; - dev->init = ftmac100_init; - dev->halt = ftmac100_halt; - dev->send = ftmac100_send; - dev->recv = ftmac100_recv; + dev->eo->init = ftmac100_init; + dev->eo->halt = ftmac100_halt; + dev->eo->send = ftmac100_send; + dev->eo->recv = ftmac100_recv; dev->priv = priv;eth_register (dev);
drivers/net/greth.c +4 -4
@@ -623,10 +623,10 @@ 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->init = greth_init; - dev->halt = greth_halt; - dev->send = greth_send; - dev->recv = greth_recv; + dev->eo->init = greth_init; + dev->eo->halt = greth_halt; + dev->eo->send = greth_send; + dev->eo->recv = greth_recv; greth->dev = dev;/* Reset Core */
drivers/net/inca-ip_sw.c +4 -4
@@ -189,10 +189,10 @@ int inca_switch_initialize(bd_t * bis)#endif sprintf (dev->name,"INCA-IP Switch" ); - dev->init = inca_switch_init; - dev->halt = inca_switch_halt; - dev->send = inca_switch_send; - dev->recv = inca_switch_recv; + dev->eo->init = inca_switch_init; + dev->eo->halt = inca_switch_halt; + dev->eo->send = inca_switch_send; + dev->eo->recv = inca_switch_recv;eth_register (dev);
drivers/net/ks8695eth.c +4 -4
@@ -230,10 +230,10 @@ int ks8695_eth_initialize(void)memset (dev,0 ,sizeof (*dev)); dev->iobase =KS8695_IO_BASE +KS8695_LAN_DMA_TX ; - dev->init = ks8695_eth_init; - dev->halt = ks8695_eth_halt; - dev->send = ks8695_eth_send; - dev->recv = ks8695_eth_recv; + dev->eo->init = ks8695_eth_init; + dev->eo->halt = ks8695_eth_halt; + dev->eo->send = ks8695_eth_send; + dev->eo->recv = ks8695_eth_recv;strcpy (dev->name,"ks8695eth" );eth_register (dev);
drivers/net/lan91c96.c +4 -4
@@ -806,10 +806,10 @@ int lan91c96_initialize(u8 dev_num, int base_addr) }get_rom_mac (dev, dev->enetaddr); - dev->init = lan91c96_init; - dev->halt = lan91c96_halt; - dev->send = lan91c96_send; - dev->recv = lan91c96_recv; + dev->eo->init = lan91c96_init; + dev->eo->halt = lan91c96_halt; + dev->eo->send = lan91c96_send; + dev->eo->recv = lan91c96_recv;sprintf (dev->name,"%s-%hu" , supported_chips[r].name, dev_num);eth_register (dev);
drivers/net/macb.c +5 -5
@@ -558,11 +558,11 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr) macb->phy_addr = phy_addr;sprintf (netdev->name,"macb%d" , id); - netdev->init = macb_init; - netdev->halt = macb_halt; - netdev->send = macb_send; - netdev->recv = macb_recv; - netdev->write_hwaddr = macb_write_hwaddr; + 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;/* * Do some basic initialization so that we at least can talk
drivers/net/mcffec.c +4 -4
@@ -572,10 +572,10 @@ int mcffec_initialize(bd_t * bis)sprintf (dev->name,"FEC%d" , fec_info[i].index); dev->priv = &fec_info[i]; - dev->init = fec_init; - dev->halt = fec_halt; - dev->send = fec_send; - dev->recv = fec_recv; + dev->eo->init = fec_init; + dev->eo->halt = fec_halt; + dev->eo->send = fec_send; + dev->eo->recv = fec_recv;/* setup Receive and Transmit buffer descriptor */ #ifdef CONFIG_SYS_FEC_BUF_USE_SRAM
drivers/net/mpc512x_fec.c +4 -4
@@ -629,10 +629,10 @@ int mpc512x_fec_initialize (bd_t * bis)# endif dev->priv = (void *)fec; dev->iobase = (int )&im->fec; - dev->init = mpc512x_fec_init; - dev->halt = mpc512x_fec_halt; - dev->send = mpc512x_fec_send; - dev->recv = mpc512x_fec_recv; + dev->eo->init = mpc512x_fec_init; + dev->eo->halt = mpc512x_fec_halt; + dev->eo->send = mpc512x_fec_send; + dev->eo->recv = mpc512x_fec_recv;sprintf (dev->name,"FEC" );eth_register (dev);
drivers/net/mpc5xxx_fec.c +4 -4
@@ -915,10 +915,10 @@ int mpc5xxx_fec_initialize(bd_t * bis) dev->priv = (void *)fec; dev->iobase =MPC5XXX_FEC ; - dev->init = mpc5xxx_fec_init; - dev->halt = mpc5xxx_fec_halt; - dev->send = mpc5xxx_fec_send; - dev->recv = mpc5xxx_fec_recv; + dev->eo->init = mpc5xxx_fec_init; + dev->eo->halt = mpc5xxx_fec_halt; + dev->eo->send = mpc5xxx_fec_send; + dev->eo->recv = mpc5xxx_fec_recv;sprintf (dev->name,"FEC" );eth_register (dev);
drivers/net/mvgbe.c +5 -5
@@ -721,11 +721,11 @@ error1:return -1 ; } - dev->init = (void *)mvgbe_init; - dev->halt = (void *)mvgbe_halt; - dev->send = (void *)mvgbe_send; - dev->recv = (void *)mvgbe_recv; - dev->write_hwaddr = (void *)mvgbe_write_hwaddr; + 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;eth_register (dev);
drivers/net/natsemi.c +4 -4
@@ -332,10 +332,10 @@ natsemi_initialize(bd_t * bis)printf ("natsemi: NatSemi ns8381[56] @ %#x\n" , dev->iobase);#endif dev->priv = (void *) devno; - dev->init = natsemi_init; - dev->halt = natsemi_disable; - dev->send = natsemi_send; - dev->recv = natsemi_poll; + dev->eo->init = natsemi_init; + dev->eo->halt = natsemi_disable; + dev->eo->send = natsemi_send; + dev->eo->recv = natsemi_poll;eth_register (dev);
drivers/net/ne2000_base.c +4 -4
@@ -789,10 +789,10 @@ int ne2k_register(void)if (ne2k_setup_driver (dev))return -1 ; - dev->init = ne2k_init; - dev->halt = ne2k_halt; - dev->send = ne2k_send; - dev->recv = ne2k_recv; + dev->eo->init = ne2k_init; + dev->eo->halt = ne2k_halt; + dev->eo->send = ne2k_send; + dev->eo->recv = ne2k_recv;sprintf (dev->name,"NE2000" );
drivers/net/npe/npe.c +4 -4
@@ -625,10 +625,10 @@ int npe_initialize(bd_t * bis)sprintf (dev->name,"NPE%d" , eth_num); dev->priv = (void *)p_npe; - dev->init = npe_init; - dev->halt = npe_halt; - dev->send = npe_send; - dev->recv = npe_rx; + dev->eo->init = npe_init; + dev->eo->halt = npe_halt; + dev->eo->send = npe_send; + dev->eo->recv = npe_rx; p_npe->print_speed =1 ;
drivers/net/ns8382x.c +4 -4
@@ -346,10 +346,10 @@ ns8382x_initialize(bd_t * bis)sprintf (dev->name,"dp8382x#%d" , card_number); dev->iobase =bus_to_phys (iobase); dev->priv = (void *) devno; - dev->init = ns8382x_init; - dev->halt = ns8382x_disable; - dev->send = ns8382x_send; - dev->recv = ns8382x_poll; + dev->eo->init = ns8382x_init; + dev->eo->halt = ns8382x_disable; + dev->eo->send = ns8382x_send; + dev->eo->recv = ns8382x_poll;/* ns8382x has a non-standard PM control register * in PCI config space. Some boards apparently need
drivers/net/pcnet.c +4 -4
@@ -218,10 +218,10 @@ int pcnet_initialize (bd_t * bis)/* * Setup device structure and register the driver. */ - dev->init = pcnet_init; - dev->halt = pcnet_halt; - dev->send = pcnet_send; - dev->recv = pcnet_recv; + dev->eo->init = pcnet_init; + dev->eo->halt = pcnet_halt; + dev->eo->send = pcnet_send; + dev->eo->recv = pcnet_recv;eth_register (dev); }
drivers/net/plb2800_eth.c +4 -4
@@ -110,10 +110,10 @@ int plb2800_eth_initialize(bd_t * bis)memset (dev,0 ,sizeof (*dev));sprintf (dev->name,"PLB2800 Switch" ); - dev->init = plb2800_eth_init; - dev->halt = plb2800_eth_halt; - dev->send = plb2800_eth_send; - dev->recv = plb2800_eth_recv; + dev->eo->init = plb2800_eth_init; + dev->eo->halt = plb2800_eth_halt; + dev->eo->send = plb2800_eth_send; + dev->eo->recv = plb2800_eth_recv;eth_register (dev);
drivers/net/rtl8139.c +5 -5
@@ -229,12 +229,12 @@ int rtl8139_initialize(bd_t *bis) dev->priv = (void *) devno; dev->iobase = (int )bus_to_phys (iobase); - dev->init = rtl8139_probe; - dev->halt = rtl_disable; - dev->send = rtl_transmit; - dev->recv = rtl_poll; + 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->mcast = rtl_bcast_addr; + dev->eo->mcast = rtl_bcast_addr;#endif eth_register (dev);
drivers/net/rtl8169.c +4 -4
@@ -902,10 +902,10 @@ int rtl8169_initialize(bd_t *bis) dev->priv = (void *) devno; dev->iobase = (int )pci_mem_to_phys (devno, iobase); - dev->init = rtl_reset; - dev->halt = rtl_halt; - dev->send = rtl_send; - dev->recv = rtl_recv; + dev->eo->init = rtl_reset; + dev->eo->halt = rtl_halt; + dev->eo->send = rtl_send; + dev->eo->recv = rtl_recv;eth_register (dev);
drivers/net/sh_eth.c +4 -4
@@ -529,10 +529,10 @@ int sh_eth_initialize(bd_t *bd) dev->priv = (void *)eth; dev->iobase =0 ; - dev->init = sh_eth_init; - dev->halt = sh_eth_halt; - dev->send = sh_eth_send; - dev->recv = sh_eth_recv; + dev->eo->init = sh_eth_init; + dev->eo->halt = sh_eth_halt; + dev->eo->send = sh_eth_send; + dev->eo->recv = sh_eth_recv; eth->port_info[eth->port].dev = dev;sprintf (dev->name,SHETHER_NAME );
drivers/net/smc91111.c +5 -5
@@ -1357,11 +1357,11 @@ int smc91111_initialize(u8 dev_num, int base_addr) dev->enetaddr[i] =SMC_inb (dev, (ADDR0_REG + i));swap_to (FLASH ); - dev->init = smc_init; - dev->halt = smc_halt; - dev->send = smc_send; - dev->recv = smc_rcv; - dev->write_hwaddr = smc_write_hwaddr; + 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;sprintf (dev->name,"%s-%hu" ,SMC_DEV_NAME , dev_num);eth_register (dev);
drivers/net/smc911x.c +4 -4
@@ -282,10 +282,10 @@ int smc911x_initialize(u8 dev_num, int base_addr) dev->enetaddr[5 ] = addrh >>8 ; } - dev->init = smc911x_init; - dev->halt = smc911x_halt; - dev->send = smc911x_send; - dev->recv = smc911x_rx; + dev->eo->init = smc911x_init; + dev->eo->halt = smc911x_halt; + dev->eo->send = smc911x_send; + dev->eo->recv = smc911x_rx;sprintf (dev->name,"%s-%hu" ,DRIVERNAME , dev_num);eth_register (dev);
drivers/net/tsec.c +5 -5
@@ -638,12 +638,12 @@ 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->init = tsec_init; - dev->halt = tsec_halt; - dev->send = tsec_send; - dev->recv = tsec_recv; + 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->mcast = tsec_mcast_addr; + dev->eo->mcast = tsec_mcast_addr;#endif /* Tell u-boot to get the addr from the env */
drivers/net/tsi108_eth.c +4 -4
@@ -739,10 +739,10 @@ int tsi108_eth_initialize (bd_t * bis) dev->iobase =ETH_BASE + (index *ETH_PORT_OFFSET ); dev->priv = (void *)(phy_address[index]); - dev->init = tsi108_eth_probe; - dev->halt = tsi108_eth_halt; - dev->send = tsi108_eth_send; - dev->recv = tsi108_eth_recv; + dev->eo->init = tsi108_eth_probe; + dev->eo->halt = tsi108_eth_halt; + dev->eo->send = tsi108_eth_send; + dev->eo->recv = tsi108_eth_recv;eth_register (dev); }
drivers/net/uli526x.c +4 -4
@@ -237,10 +237,10 @@ int uli526x_initialize(bd_t *bis) db->pdev = devno; dev->iobase = iobase; - dev->init = uli526x_init_one; - dev->halt = uli526x_disable; - dev->send = uli526x_start_xmit; - dev->recv = uli526x_rx_packet; + dev->eo->init = uli526x_init_one; + dev->eo->halt = uli526x_disable; + dev->eo->send = uli526x_start_xmit; + dev->eo->recv = uli526x_rx_packet;/* init db */ db->ioaddr = dev->iobase;
drivers/net/xilinx_axi_emac.c +5 -5
@@ -645,11 +645,11 @@ 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->init = axiemac_init; - dev->halt = axiemac_halt; - dev->send = axiemac_send; - dev->recv = axiemac_recv; - dev->write_hwaddr = axiemac_setup_mac; + 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;#ifdef CONFIG_PHY_ADDR priv->phyaddr =CONFIG_PHY_ADDR ;
drivers/net/xilinx_emaclite.c +4 -4
@@ -369,10 +369,10 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,sprintf (dev->name,"Xelite.%lx" , base_addr); dev->iobase = base_addr; - dev->init = emaclite_init; - dev->halt = emaclite_halt; - dev->send = emaclite_send; - dev->recv = emaclite_recv; + dev->eo->init = emaclite_init; + dev->eo->halt = emaclite_halt; + dev->eo->send = emaclite_send; + dev->eo->recv = emaclite_recv;eth_register (dev);
drivers/net/xilinx_ll_temac.c +7 -7
@@ -313,9 +313,9 @@ int xilinx_ll_temac_initialize(bd_t *bis, struct ll_temac_info *devinf) dev->iobase = devinf->base_addr; dev->priv = ll_temac; - dev->init = ll_temac_init; - dev->halt = ll_temac_halt; - dev->write_hwaddr = ll_temac_setup_mac_addr; + 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 +334,16 @@ 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->recv = ll_temac_recv_sdma; - dev->send = ll_temac_send_sdma; + dev->eo->recv = ll_temac_recv_sdma; + dev->eo->send = ll_temac_send_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->recv = ll_temac_recv_fifo; - dev->send = ll_temac_send_fifo; + dev->eo->recv = ll_temac_recv_fifo; + dev->eo->send = ll_temac_send_fifo; }/* Link to specified MDIO bus */
drivers/net/zynq_gem.c +5 -5
@@ -425,11 +425,11 @@ int zynq_gem_initialize(bd_t *bis, int base_addr) dev->iobase = base_addr; - dev->init = zynq_gem_init; - dev->halt = zynq_gem_halt; - dev->send = zynq_gem_send; - dev->recv = zynq_gem_recv; - dev->write_hwaddr = zynq_gem_setup_mac; + 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;eth_register (dev);
drivers/qe/uec.c +4 -4
@@ -1394,10 +1394,10 @@ 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->init = uec_init; - dev->halt = uec_halt; - dev->send = uec_send; - dev->recv = uec_recv; + dev->eo->init = uec_init; + dev->eo->halt = uec_halt; + dev->eo->send = uec_send; + dev->eo->recv = uec_recv;/* Clear the ethnet address */ for (i =0 ; i <6 ; i++)
drivers/usb/eth/asix.c +5 -5
@@ -702,12 +702,12 @@ 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->init = asix_init; - eth->send = asix_send; - eth->recv = asix_recv; - eth->halt = asix_halt; + eth->eo->init = asix_init; + eth->eo->send = asix_send; + eth->eo->recv = asix_recv; + eth->eo->halt = asix_halt;if (!(priv->flags &FLAG_TYPE_AX88172 )) - eth->write_hwaddr = asix_write_hwaddr; + eth->eo->write_hwaddr = asix_write_hwaddr; eth->priv = ss;if (asix_basic_reset (ss))
drivers/usb/eth/smsc95xx.c +5 -5
@@ -890,11 +890,11 @@ 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->init = smsc95xx_init; - eth->send = smsc95xx_send; - eth->recv = smsc95xx_recv; - eth->halt = smsc95xx_halt; - eth->write_hwaddr = smsc95xx_write_hwaddr; + 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->priv = ss;return 1 ; }
include/net.h +11 -6
@@ -78,12 +78,9 @@ enum eth_state_t {ETH_STATE_ACTIVE }; -struct eth_device { -char name[16 ]; -unsigned char enetaddr[6 ]; -int iobase; -int state; +struct eth_device ; +struct eth_ops {int (*init) (struct eth_device *,bd_t *);int (*send) (struct eth_device *,void *packet,int length);int (*recv) (struct eth_device *);
@@ -91,7 +88,15 @@ struct eth_device {#ifdef CONFIG_MCAST_TFTP int (*mcast) (struct eth_device *,u32 ip,u8 set);#endif -int (*write_hwaddr) (struct eth_device *); +int (*write_hwaddr) (struct eth_device *); +}; + +struct eth_device { +char name[16 ]; +unsigned char enetaddr[6 ]; +int iobase; +int state; +struct eth_ops *eo;struct eth_device *next;int index;void *priv;
net/eth.c +8 -8
@@ -217,12 +217,12 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name, dev->name); } -if (dev->write_hwaddr && +if (dev->eo->write_hwaddr && !eth_mac_skip (eth_number)) {if (!is_valid_ether_addr (dev->enetaddr))return -1 ; - ret = dev->write_hwaddr (dev); + ret = dev->eo->write_hwaddr (dev); }return ret;
@@ -363,7 +363,7 @@ int eth_initialize(bd_t *bis)int eth_mcast_join (IPaddr_t mcast_ip,u8 join) {u8 mcast_mac[6 ]; -if (!eth_current || !eth_current->mcast) +if (!eth_current || !eth_current->eo->mcast)return -1 ; mcast_mac[5 ] =htonl (mcast_ip) &0xff ; mcast_mac[4 ] = (htonl (mcast_ip)>>8 ) &0xff ;
@@ -371,7 +371,7 @@ int eth_mcast_join(IPaddr_t mcast_ip, u8 join) mcast_mac[2 ] =0x5e ; mcast_mac[1 ] =0x0 ; mcast_mac[0 ] =0x1 ; -return eth_current->mcast (eth_current, mcast_mac, join); +return eth_current->eo->mcast (eth_current, mcast_mac, join); }/* the 'way' for ethernet-CRC-32. Spliced in from Linux lib/crc32.c
@@ -426,7 +426,7 @@ int eth_init(bd_t *bis) do { debug("Trying %s\n", eth_current->name); - if (eth_current->init(eth_current, bis) >= 0) { + if (eth_current->eo->init(eth_current, bis) >= 0) { eth_current->state = ETH_STATE_ACTIVE; return 0;
@@ -444,7 +444,7 @@ void eth_halt(void)if (!eth_current)return ; - eth_current->halt (eth_current); + eth_current->eo->halt (eth_current); eth_current->state =ETH_STATE_PASSIVE ; }
@@ -454,7 +454,7 @@ int eth_send(void *packet, int length)if (!eth_current)return -1 ; -return eth_current->send (eth_current, packet, length); +return eth_current->eo->send (eth_current, packet, length); }int eth_rx (void )
@@ -462,7 +462,7 @@ int eth_rx(void)if (!eth_current)return -1 ; -return eth_current->recv (eth_current); +return eth_current->eo->recv (eth_current); }#ifdef CONFIG_API
Signature · 1 line
1.7.2.5
PATCH v2 2/67 net: 4xx_enet: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/4xx_enet.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/4xx_enet.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 3/67 net: altera_tse: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/altera_tse.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/altera_tse.c +9 -5
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 4/67 net: dm9000x: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/dm9000x.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/dm9000x.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 5/67 net: armada100_fec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/armada100_fec.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/armada100_fec.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 6/67 net: at91_emac: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/at91_emac.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/at91_emac.c +9 -5
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 7/67 net: ax88180: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/ax88180.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-)
drivers/net/ax88180.c +9 -4
@@ -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 ;
Signature · 1 line
1.7.2.5
PATCH v2 8/67 net: bfin_mac: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/bfin_mac.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/bfin_mac.c +9 -5
@@ -91,6 +91,14 @@ static int bfin_miiphy_write(const char *devname, uchar addr, uchar reg, ushortreturn 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);
Signature · 1 line
1.7.2.5
PATCH v2 9/67 net: calxedaxgmac: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/calxedaxgmac.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-)
drivers/net/calxedaxgmac.c +10 -4
@@ -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 (®s->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);
Signature · 1 line
1.7.2.5
PATCH v2 10/67 net: cs8900: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/cs8900.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/cs8900.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 11/67 net: davinci_emac: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/davinci_emac.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/davinci_emac.c +9 -5
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 12/67 net: dc2114x: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/dc2114x.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/dc2114x.c +9 -5
@@ -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 );
Signature · 1 line
1.7.2.5
PATCH v2 13/67 net: designware: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/designware.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/designware.c +9 -5
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 14/67 net: dnet: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/dnet.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/dnet.c +8 -4
@@ -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) &0xFFFF ; debug("%s: has %smdio, %sirq, %sgigabit, %sdma\n", netdev->name,
Signature · 1 line
1.7.2.5
PATCH v2 15/67 net: e1000: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/e1000.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/e1000.c +8 -4
@@ -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); }
Signature · 1 line
1.7.2.5
PATCH v2 16/67 net: eepro100: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/eepro100.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/eepro100.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 17/67 net: enc28j60: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/enc28j60.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/enc28j60.c +9 -5
@@ -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 )
Signature · 1 line
1.7.2.5
PATCH v2 18/67 net: ep93xx_eth: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/ep93xx_eth.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/ep93xx_eth.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 19/67 net: ethoc: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/ethoc.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/ethoc.c +9 -5
@@ -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 = ðoc_ops;sprintf (dev->name,"%s-%hu" ,"ETHOC" , dev_num);eth_register (dev);
Signature · 1 line
1.7.2.5
PATCH v2 20/67 net: fec_mxc: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/fec_mxc.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-)
drivers/net/fec_mxc.c +10 -5
@@ -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;
Signature · 1 line
1.7.2.5
PATCH v2 21/67 net: ftgmac100: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/ftgmac100.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/ftgmac100.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 22/67 net: greth.c: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/greth.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/greth.c +8 -4
@@ -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 */
Signature · 1 line
1.7.2.5
PATCH v2 23/67 net: fsl_mcdmafec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/fsl_mcdmafec.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/fsl_mcdmafec.c +8 -4
@@ -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
Signature · 1 line
1.7.2.5
PATCH v2 24/67 net: inca-ip_sw: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/inca-ip_sw.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)
drivers/net/inca-ip_sw.c +7 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 25/67 net: ks8695eth: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/ks8695eth.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/ks8695eth.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 26/67 net: lan91c96: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/lan91c96.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/lan91c96.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 27/67 net: macb: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/macb.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/macb.c +9 -5
@@ -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
Signature · 1 line
1.7.2.5
PATCH v2 28/67 net: mcffec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/mcffec.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/mcffec.c +8 -4
@@ -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
Signature · 1 line
1.7.2.5
PATCH v2 29/67 net: mpc5xxx_fec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/mpc5xxx_fec.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)
drivers/net/mpc5xxx_fec.c +7 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 30/67 net: mvgbe: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/mvgbe.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/mvgbe.c +9 -5
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 31/67 net: mpc512x_fec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/mpc512x_fec.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/mpc512x_fec.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 32/67 net: natsemi: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/natsemi.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/natsemi.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 33/67 net: ne2000: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/ne2000_base.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/ne2000_base.c +8 -4
@@ -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" );
Signature · 1 line
1.7.2.5
PATCH v2 34/67 net: npe: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/npe/npe.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/npe/npe.c +8 -4
@@ -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 ;
Signature · 1 line
1.7.2.5
PATCH v2 35/67 net: ns8382x: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/ns8382x.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-)
drivers/net/ns8382x.c +9 -4
@@ -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
Signature · 1 line
1.7.2.5
PATCH v2 36/67 net: pcnet: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/pcnet.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)
drivers/net/pcnet.c +8 -5
@@ -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); }
Signature · 1 line
1.7.2.5
PATCH v2 37/67 net: plb2800_eth: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/plb2800_eth.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)
drivers/net/plb2800_eth.c +7 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 38/67 net: rtl8139: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/rtl8139.c | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-)
drivers/net/rtl8139.c +11 -7
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 39/67 net: rtl8169: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/rtl8169.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-)
drivers/net/rtl8169.c +9 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 40/67 net: smc91111: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/smc91111.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/smc91111.c +9 -5
@@ -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 smc91111_initialize (u8 dev_num,int base_addr) {struct smc91111_priv *priv;
@@ -1357,11 +1365,7 @@ int smc91111_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);
Signature · 1 line
1.7.2.5
PATCH v2 41/67 net: smc911x: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/smc911x.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/smc911x.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 42/67 net: tsec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/tsec.c | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-)
drivers/net/tsec.c +11 -7
@@ -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++)
Signature · 1 line
1.7.2.5
PATCH v2 43/67 net: tsi108_eth: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/tsi108_eth.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/tsi108_eth.c +8 -4
@@ -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); }
Signature · 1 line
1.7.2.5
PATCH v2 44/67 net: uli526x: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/uli526x.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/uli526x.c +8 -4
@@ -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;
Signature · 1 line
1.7.2.5
PATCH v2 45/67 net: xilinx_axi_emac: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/xilinx_axi_emac.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-)
drivers/net/xilinx_axi_emac.c +10 -5
@@ -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 ;
Signature · 1 line
1.7.2.5
PATCH v2 46/67 net: xilinx_emaclite: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/xilinx_emaclite.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/xilinx_emaclite.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 47/67 net: zynq_gem: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/zynq_gem.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/zynq_gem.c +9 -5
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 48/67 net: xilinx_ll_temac: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/xilinx_ll_temac.c | 27 ++++++++++++++++++++------- 1 files changed, 20 insertions(+), 7 deletions(-)
drivers/net/xilinx_ll_temac.c +20 -7
@@ -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 */
Signature · 1 line
1.7.2.5
PATCH v2 49/67 net: sh_eth: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/sh_eth.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/sh_eth.c +8 -4
@@ -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 );
Signature · 1 line
1.7.2.5
PATCH v2 50/67 net: au1x00_eth: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- arch/mips/cpu/mips32/au1x00/au1x00_eth.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
arch/mips/cpu/mips32/au1x00/au1x00_eth.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 51/67 net: mpc8220_fec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- arch/powerpc/cpu/mpc8220/fec.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)
arch/powerpc/cpu/mpc8220/fec.c +7 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 52/67 net: mpc8260_fec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- arch/powerpc/cpu/mpc8260/ether_fcc.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
arch/powerpc/cpu/mpc8260/ether_fcc.c +8 -4
@@ -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 = ðer_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);
Signature · 1 line
1.7.2.5
PATCH v2 53/67 net: mpc8260_scc: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- arch/powerpc/cpu/mpc8260/ether_scc.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
arch/powerpc/cpu/mpc8260/ether_scc.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 54/67 net: mpc85xx_fec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- arch/powerpc/cpu/mpc85xx/ether_fcc.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
arch/powerpc/cpu/mpc85xx/ether_fcc.c +8 -4
@@ -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 = ðer_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);
Signature · 1 line
1.7.2.5
PATCH v2 55/67 net: mpc8xx_scc: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- arch/powerpc/cpu/mpc8xx/scc.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
arch/powerpc/cpu/mpc8xx/scc.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 56/67 net: db64360/mv_eth: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- board/Marvell/db64360/mv_eth.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
board/Marvell/db64360/mv_eth.c +8 -4
@@ -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;
Signature · 1 line
1.7.2.5
PATCH v2 57/67 net: mpc8xx_fec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- arch/powerpc/cpu/mpc8xx/fec.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
arch/powerpc/cpu/mpc8xx/fec.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 58/67 net: db64460/mv_eth: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- board/Marvell/db64460/mv_eth.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
board/Marvell/db64460/mv_eth.c +8 -4
@@ -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;
Signature · 1 line
1.7.2.5
PATCH v2 59/67 net: cpci750/mv_eth: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- board/esd/cpci750/mv_eth.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
board/esd/cpci750/mv_eth.c +8 -4
@@ -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 );
Signature · 1 line
1.7.2.5
PATCH v2 60/67 net: evb64260: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- board/evb64260/eth.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-)
board/evb64260/eth.c +9 -4
@@ -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 = >6426x_eth_ops; p =calloc (sizeof (*p),1 ); dev->priv = (void *)p;
Signature · 1 line
1.7.2.5
PATCH v2 61/67 net: p3mx/mv_eth: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- board/prodrive/p3mx/mv_eth.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
board/prodrive/p3mx/mv_eth.c +8 -4
@@ -246,6 +246,13 @@ void mv_eth_phy_init (void)MV_REG_WRITE (ETH_PHY_DFCDL_CONFIG0_REG ,0x300000 ); } +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;
Signature · 1 line
1.7.2.5
PATCH v2 62/67 net: cpsw: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/cpsw.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/cpsw.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 63/67 net: fm_eth: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/fm/eth.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/fm/eth.c +8 -4
@@ -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;
Signature · 1 line
1.7.2.5
PATCH v2 64/67 net: ftmac100: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/net/ftmac100.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/ftmac100.c +8 -4
@@ -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);
Signature · 1 line
1.7.2.5
PATCH v2 65/67 net: qe: uec: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/qe/uec.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/qe/uec.c +8 -4
@@ -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++)
Signature · 1 line
1.7.2.5
PATCH v2 66/67 net: usb: asix: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/usb/eth/asix.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/usb/eth/asix.c +8 -4
@@ -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;
Signature · 1 line
1.7.2.5
PATCH v2 67/67 net: usb: smsc95xx: Pull out init of struct eth_ops
In reply to Tomas HlavacekAdd 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.
--- drivers/usb/eth/smsc95xx.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
drivers/usb/eth/smsc95xx.c +9 -5
@@ -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 ; }
Signature · 1 line
1.7.2.5
v2 cover net: net subsystem ops cleanup
In reply to Tomas HlavacekDear Tomas Hlavacek,
Quoted 11 lines · In message <[email protected]> you wrote:
- Prove bisectability:
MAKEALL arm (1/67 applied):
Boards compiled: 274MAKEALL arm (49/67 applied):
Boards compiled: 274MAKEALL arm (67/67 applied):
Boards compiled: 274
To actually prove bisectability, so have to build all architectures (and not only a selection) for each and every commit (not only for a
selection). And in addition to building, you have to verify that the
resulting code actually works.
Quoted 1 line
69 files changed, 590 insertions(+), 309 deletions(-)
What's the impact on the memory footprint?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "If a computer can't directly address all the RAM you can use, it's
just a toy." - anonymous comp.sys.amiga posting, non-sequitir
v2 cover net: net subsystem ops cleanup
In reply to Tomas HlavacekHello Tomas,
sorry for not replying to V1 series already. I have a remark:
Quoted 1 line
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?
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.
Best Regards,
Thomas
v2 cover net: net subsystem ops cleanup
Hello Thomas!
Quoted 15 lines · Langer Thomas (LQDE RD ST PON SW)
Hello Tomas,
sorry for not replying to V1 series already. I have a remark:
Quoted 1 line
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
Quoted 2 lines
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.
Quoted 3 lines
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