diff options
73 files changed, 228 insertions, 233 deletions
@@ -3158,10 +3158,10 @@ List of environment variables (most likely not complete): interface is currently active. For example you can do the following - => setenv ethact FEC ETHERNET - => ping 192.168.0.1 # traffic sent on FEC ETHERNET - => setenv ethact SCC ETHERNET - => ping 10.0.0.1 # traffic sent on SCC ETHERNET + => setenv ethact FEC + => ping 192.168.0.1 # traffic sent on FEC + => setenv ethact SCC + => ping 10.0.0.1 # traffic sent on SCC ethrotate - When set to "no" U-Boot does not go through all available network interfaces. diff --git a/arch/arm/cpu/arm920t/at91rm9200/ether.c b/arch/arm/cpu/arm920t/at91rm9200/ether.c index 91eab95..e1cdeba 100644 --- a/arch/arm/cpu/arm920t/at91rm9200/ether.c +++ b/arch/arm/cpu/arm920t/at91rm9200/ether.c @@ -283,7 +283,7 @@ void eth_halt (void) }; #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) -int at91rm9200_miiphy_read(char *devname, unsigned char addr, +int at91rm9200_miiphy_read(const char *devname, unsigned char addr, unsigned char reg, unsigned short * value) { at91rm9200_EmacEnableMDIO (p_mac); @@ -292,7 +292,7 @@ int at91rm9200_miiphy_read(char *devname, unsigned char addr, return 0; } -int at91rm9200_miiphy_write(char *devname, unsigned char addr, +int at91rm9200_miiphy_write(const char *devname, unsigned char addr, unsigned char reg, unsigned short value) { at91rm9200_EmacEnableMDIO (p_mac); diff --git a/arch/arm/cpu/ixp/npe/include/npe.h b/arch/arm/cpu/ixp/npe/include/npe.h index 3d6f727..b5eef86 100644 --- a/arch/arm/cpu/ixp/npe/include/npe.h +++ b/arch/arm/cpu/ixp/npe/include/npe.h @@ -82,9 +82,9 @@ struct npe { /* * prototypes... */ -extern int npe_miiphy_read (char *devname, unsigned char addr, +extern int npe_miiphy_read (const char *devname, unsigned char addr, unsigned char reg, unsigned short *value); -extern int npe_miiphy_write (char *devname, unsigned char addr, +extern int npe_miiphy_write (const char *devname, unsigned char addr, unsigned char reg, unsigned short value); #endif /* ifndef NPE_H */ diff --git a/arch/arm/cpu/ixp/npe/miiphy.c b/arch/arm/cpu/ixp/npe/miiphy.c index b208c51..4b0201a 100644 --- a/arch/arm/cpu/ixp/npe/miiphy.c +++ b/arch/arm/cpu/ixp/npe/miiphy.c @@ -100,7 +100,7 @@ int phy_setup_aneg (char *devname, unsigned char addr) } -int npe_miiphy_read (char *devname, unsigned char addr, +int npe_miiphy_read (const char *devname, unsigned char addr, unsigned char reg, unsigned short *value) { u16 val; @@ -112,7 +112,7 @@ int npe_miiphy_read (char *devname, unsigned char addr, } /* phy_read */ -int npe_miiphy_write (char *devname, unsigned char addr, +int npe_miiphy_write (const char *devname, unsigned char addr, unsigned char reg, unsigned short value) { ixEthAccMiiWriteRtn(addr, reg, value); diff --git a/arch/m68k/include/asm/fec.h b/arch/m68k/include/asm/fec.h index 49311e5..cecec59 100644 --- a/arch/m68k/include/asm/fec.h +++ b/arch/m68k/include/asm/fec.h @@ -357,9 +357,9 @@ int fecpin_setclear(struct eth_device *dev, int setclear); void __mii_init(void); uint mii_send(uint mii_cmd); int mii_discover_phy(struct eth_device *dev); -int mcffec_miiphy_read(char *devname, unsigned char addr, +int mcffec_miiphy_read(const char *devname, unsigned char addr, unsigned char reg, unsigned short *value); -int mcffec_miiphy_write(char *devname, unsigned char addr, +int mcffec_miiphy_write(const char *devname, unsigned char addr, unsigned char reg, unsigned short value); #endif diff --git a/arch/mips/cpu/au1x00_eth.c b/arch/mips/cpu/au1x00_eth.c index 5074997..c510799 100644 --- a/arch/mips/cpu/au1x00_eth.c +++ b/arch/mips/cpu/au1x00_eth.c @@ -89,7 +89,7 @@ mac_fifo_t mac_fifo[NO_OF_FIFOS]; #define MAX_WAIT 1000 #if defined(CONFIG_CMD_MII) -int au1x00_miiphy_read(char *devname, unsigned char addr, +int au1x00_miiphy_read(const char *devname, unsigned char addr, unsigned char reg, unsigned short * value) { volatile u32 *mii_control_reg = (volatile u32*)(ETH0_BASE+MAC_MII_CNTRL); @@ -122,7 +122,7 @@ int au1x00_miiphy_read(char *devname, unsigned char addr, return 0; } -int au1x00_miiphy_write(char *devname, unsigned char addr, +int au1x00_miiphy_write(const char *devname, unsigned char addr, unsigned char reg, unsigned short value) { volatile u32 *mii_control_reg = (volatile u32*)(ETH0_BASE+MAC_MII_CNTRL); diff --git a/arch/powerpc/cpu/mpc8220/fec.c b/arch/powerpc/cpu/mpc8220/fec.c index 5df9735..00879df 100644 --- a/arch/powerpc/cpu/mpc8220/fec.c +++ b/arch/powerpc/cpu/mpc8220/fec.c @@ -34,8 +34,8 @@ typedef struct { u8 head[16]; /* MAC header(6 + 6 + 2) + 2(aligned) */ } NBUF; -int fec8220_miiphy_read (char *devname, u8 phyAddr, u8 regAddr, u16 * retVal); -int fec8220_miiphy_write (char *devname, u8 phyAddr, u8 regAddr, u16 data); +int fec8220_miiphy_read (const char *devname, u8 phyAddr, u8 regAddr, u16 *retVal); +int fec8220_miiphy_write (const char *devname, u8 phyAddr, u8 regAddr, u16 data); /********************************************************************/ #ifdef DEBUG @@ -840,7 +840,7 @@ int mpc8220_fec_initialize (bd_t * bis) dev->send = mpc8220_fec_send; dev->recv = mpc8220_fec_recv; - sprintf (dev->name, "FEC ETHERNET"); + sprintf (dev->name, "FEC"); eth_register (dev); #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) @@ -881,7 +881,7 @@ int mpc8220_fec_initialize (bd_t * bis) /* MII-interface related functions */ /********************************************************************/ -int fec8220_miiphy_read (char *devname, u8 phyAddr, u8 regAddr, u16 * retVal) +int fec8220_miiphy_read (const char *devname, u8 phyAddr, u8 regAddr, u16 *retVal) { ethernet_regs *eth = (ethernet_regs *) MMAP_FEC1; u32 reg; /* convenient holder for the PHY register */ @@ -925,7 +925,7 @@ int fec8220_miiphy_read (char *devname, u8 phyAddr, u8 regAddr, u16 * retVal) } /********************************************************************/ -int fec8220_miiphy_write (char *devname, u8 phyAddr, u8 regAddr, u16 data) +int fec8220_miiphy_write(const char *devname, u8 phyAddr, u8 regAddr, u16 data) { ethernet_regs *eth = (ethernet_regs *) MMAP_FEC1; u32 reg; /* convenient holder for the PHY register */ diff --git a/arch/powerpc/cpu/mpc8260/ether_fcc.c b/arch/powerpc/cpu/mpc8260/ether_fcc.c index 5ac02a0..c82958d 100644 --- a/arch/powerpc/cpu/mpc8260/ether_fcc.c +++ b/arch/powerpc/cpu/mpc8260/ether_fcc.c @@ -383,7 +383,7 @@ int fec_initialize(bd_t *bis) dev = (struct eth_device*) malloc(sizeof *dev); memset(dev, 0, sizeof *dev); - sprintf(dev->name, "FCC%d ETHERNET", + sprintf(dev->name, "FCC%d", ether_fcc_info[i].ether_index + 1); dev->priv = ðer_fcc_info[i]; dev->init = fec_init; diff --git a/arch/powerpc/cpu/mpc8260/ether_scc.c b/arch/powerpc/cpu/mpc8260/ether_scc.c index 432111d..2870a9c 100644 --- a/arch/powerpc/cpu/mpc8260/ether_scc.c +++ b/arch/powerpc/cpu/mpc8260/ether_scc.c @@ -375,7 +375,7 @@ int mpc82xx_scc_enet_initialize(bd_t *bis) dev = (struct eth_device *) malloc(sizeof *dev); memset(dev, 0, sizeof *dev); - sprintf(dev->name, "SCC ETHERNET"); + sprintf(dev->name, "SCC"); dev->init = sec_init; dev->halt = sec_halt; dev->send = sec_send; diff --git a/arch/powerpc/cpu/mpc85xx/ether_fcc.c b/arch/powerpc/cpu/mpc85xx/ether_fcc.c index 5f1414d..f69b2e6 100644 --- a/arch/powerpc/cpu/mpc85xx/ether_fcc.c +++ b/arch/powerpc/cpu/mpc85xx/ether_fcc.c @@ -446,7 +446,7 @@ int fec_initialize(bd_t *bis) dev = (struct eth_device*) malloc(sizeof *dev); memset(dev, 0, sizeof *dev); - sprintf(dev->name, "FCC%d ETHERNET", + sprintf(dev->name, "FCC%d", ether_fcc_info[i].ether_index + 1); dev->priv = ðer_fcc_info[i]; dev->init = fec_init; diff --git a/arch/powerpc/cpu/mpc8xx/fec.c b/arch/powerpc/cpu/mpc8xx/fec.c index 89c1ff9..d4abeb1 100644 --- a/arch/powerpc/cpu/mpc8xx/fec.c +++ b/arch/powerpc/cpu/mpc8xx/fec.c @@ -63,9 +63,9 @@ DECLARE_GLOBAL_DATA_PTR; static int mii_discover_phy(struct eth_device *dev); #endif -int fec8xx_miiphy_read(char *devname, unsigned char addr, +int fec8xx_miiphy_read(const char *devname, unsigned char addr, unsigned char reg, unsigned short *value); -int fec8xx_miiphy_write(char *devname, unsigned char addr, +int fec8xx_miiphy_write(const char *devname, unsigned char addr, unsigned char reg, unsigned short value); static struct ether_fcc_info_s @@ -164,9 +164,9 @@ int fec_initialize(bd_t *bis) /* for FEC1 make sure that the name of the interface is the same as the old one for compatibility reasons */ if (i == 0) { - sprintf (dev->name, "FEC ETHERNET"); + sprintf (dev->name, "FEC"); } else { - sprintf (dev->name, "FEC%d ETHERNET", + sprintf (dev->name, "FEC%d", ether_fcc_info[i].ether_index + 1); } @@ -990,7 +990,7 @@ void mii_init (void) * Otherwise they hang in mii_send() !!! Sorry! *****************************************************************************/ -int fec8xx_miiphy_read(char *devname, unsigned char addr, +int fec8xx_miiphy_read(const char *devname, unsigned char addr, unsigned char reg, unsigned short *value) { short rdreg; /* register working value */ @@ -1007,7 +1007,7 @@ int fec8xx_miiphy_read(char *devname, unsigned char addr, return 0; } -int fec8xx_miiphy_write(char *devname, unsigned char addr, +int fec8xx_miiphy_write(const char *devname, unsigned char addr, unsigned char reg, unsigned short value) { short rdreg; /* register working value */ diff --git a/arch/powerpc/cpu/mpc8xx/scc.c b/arch/powerpc/cpu/mpc8xx/scc.c index effb967..e376c64 100644 --- a/arch/powerpc/cpu/mpc8xx/scc.c +++ b/arch/powerpc/cpu/mpc8xx/scc.c @@ -77,7 +77,7 @@ int scc_initialize(bd_t *bis) dev = (struct eth_device*) malloc(sizeof *dev); memset(dev, 0, sizeof *dev); - sprintf(dev->name, "SCC ETHERNET"); + sprintf(dev->name, "SCC"); dev->iobase = 0; dev->priv = 0; dev->init = scc_init; diff --git a/arch/powerpc/cpu/ppc4xx/miiphy.c b/arch/powerpc/cpu/ppc4xx/miiphy.c index 22ed5c2..4fec126 100644 --- a/arch/powerpc/cpu/ppc4xx/miiphy.c +++ b/arch/powerpc/cpu/ppc4xx/miiphy.c @@ -338,7 +338,7 @@ static int emac_miiphy_command(u8 addr, u8 reg, int cmd, u16 value) return 0; } -int emac4xx_miiphy_read (char *devname, unsigned char addr, unsigned char reg, +int emac4xx_miiphy_read (const char *devname, unsigned char addr, unsigned char reg, unsigned short *value) { unsigned long sta_reg; @@ -359,7 +359,7 @@ int emac4xx_miiphy_read (char *devname, unsigned char addr, unsigned char reg, /* write a phy reg and return the value with a rc */ /***********************************************************/ -int emac4xx_miiphy_write (char *devname, unsigned char addr, unsigned char reg, +int emac4xx_miiphy_write (const char *devname, unsigned char addr, unsigned char reg, unsigned short value) { return emac_miiphy_command(addr, reg, EMAC_STACR_WRITE, value); diff --git a/board/evb64260/eth.c b/board/evb64260/eth.c index 8d1b606..a96e655 100644 --- a/board/evb64260/eth.c +++ b/board/evb64260/eth.c @@ -89,7 +89,7 @@ static const char ether_port_phy_addr[3]={4,5,6}; /* MII PHY access routines are common for all i/f, use gal_ent0 */ #define GT6426x_MII_DEVNAME "gal_enet0" -int gt6426x_miiphy_read(char *devname, unsigned char phy, +int gt6426x_miiphy_read(const char *devname, unsigned char phy, unsigned char reg, unsigned short *val); static inline unsigned short @@ -345,7 +345,7 @@ gt6426x_eth_disable(void *v) MII utilities - write: write to an MII register via SMI ***************************************************************************/ int -gt6426x_miiphy_write(char *devname, unsigned char phy, +gt6426x_miiphy_write(const char *devname, unsigned char phy, unsigned char reg, unsigned short data) { unsigned int temp= (reg<<21) | (phy<<16) | data; @@ -360,7 +360,7 @@ gt6426x_miiphy_write(char *devname, unsigned char phy, MII utilities - read: read from an MII register via SMI ***************************************************************************/ int -gt6426x_miiphy_read(char *devname, unsigned char phy, +gt6426x_miiphy_read(const char *devname, unsigned char phy, unsigned char reg, unsigned short *val) { unsigned int temp= (reg<<21) | (phy<<16) | 1<<26; diff --git a/board/freescale/mpc8560ads/mpc8560ads.c b/board/freescale/mpc8560ads/mpc8560ads.c index 489f90b..423e9d7 100644 --- a/board/freescale/mpc8560ads/mpc8560ads.c +++ b/board/freescale/mpc8560ads/mpc8560ads.c @@ -236,7 +236,7 @@ void reset_phy (void) #endif #if defined(CONFIG_MII) && defined(CONFIG_ETHER_ON_FCC) /* reset PHY */ - miiphy_reset("FCC1 ETHERNET", 0x0); + miiphy_reset("FCC1", 0x0); /* change PHY address to 0x02 */ bb_miiphy_write(NULL, 0, PHY_MIPSCR, 0xf028); diff --git a/board/funkwerk/vovpn-gw/vovpn-gw.c b/board/funkwerk/vovpn-gw/vovpn-gw.c index 889ba3f..e856ada 100644 --- a/board/funkwerk/vovpn-gw/vovpn-gw.c +++ b/board/funkwerk/vovpn-gw/vovpn-gw.c @@ -198,7 +198,7 @@ void reset_phy (void) iop->pdat |= 0x00080000; for (i=0; i<100; i++) { udelay(20000); - if (bb_miiphy_read("FCC1 ETHERNET", CONFIG_SYS_PHY_ADDR,2,&val ) == 0) { + if (bb_miiphy_read("FCC1", CONFIG_SYS_PHY_ADDR,2,&val ) == 0) { break; } } diff --git a/board/keymile/common/keymile_hdlc_enet.c b/board/keymile/common/keymile_hdlc_enet.c index ce5e4d6..a545211 100644 --- a/board/keymile/common/keymile_hdlc_enet.c +++ b/board/keymile/common/keymile_hdlc_enet.c @@ -40,7 +40,7 @@ extern char keymile_slot; /* our slot number in the backplane */ #define TOUT_LOOP 50000 /* - * Since, except during initialization, ethact is always HDLC ETHERNET + * Since, except during initialization, ethact is always HDLC * while we're in the driver, just use serial_printf() everywhere for * output. This avoids possible conflicts when netconsole is being * used. @@ -124,7 +124,7 @@ int keymile_hdlc_enet_initialize(bd_t *bis) seth = dev; #endif - sprintf(dev->name, "HDLC ETHERNET"); + sprintf(dev->name, "HDLC"); dev->init = keymile_hdlc_enet_init; dev->halt = keymile_hdlc_enet_halt; dev->send = keymile_hdlc_enet_send; diff --git a/board/keymile/km8xx/km8xx_hdlc_enet.c b/board/keymile/km8xx/km8xx_hdlc_enet.c index 0478288..ca00576 100644 --- a/board/keymile/km8xx/km8xx_hdlc_enet.c +++ b/board/keymile/km8xx/km8xx_hdlc_enet.c @@ -34,7 +34,7 @@ char keymile_slot; /* our slot number in the backplane */ /* - * Since, except during initialization, ethact is always HDLC ETHERNET + * Since, except during initialization, ethact is always HDLC * while we're in the driver, just use serial_printf() everywhere for * output. This avoids possible conflicts when netconsole is being * used. diff --git a/board/motionpro/motionpro.c b/board/motionpro/motionpro.c index b369219..47ef6e5 100644 --- a/board/motionpro/motionpro.c +++ b/board/motionpro/motionpro.c @@ -90,8 +90,8 @@ void reset_phy(void) { unsigned short mode_control; - miiphy_read("FEC ETHERNET", CONFIG_PHY_ADDR, 0x15, &mode_control); - miiphy_write("FEC ETHERNET", CONFIG_PHY_ADDR, 0x15, + miiphy_read("FEC", CONFIG_PHY_ADDR, 0x15, &mode_control); + miiphy_write("FEC", CONFIG_PHY_ADDR, 0x15, mode_control & 0xfffe); return; } diff --git a/board/prodrive/p3mx/mv_eth.c b/board/prodrive/p3mx/mv_eth.c index e67596b..567ae99 100644 --- a/board/prodrive/p3mx/mv_eth.c +++ b/board/prodrive/p3mx/mv_eth.c @@ -99,9 +99,9 @@ int mv64460_eth_receive (struct eth_device *dev); int mv64460_eth_xmit (struct eth_device *, volatile void *packet, int length); -int mv_miiphy_read(char *devname, unsigned char phy_addr, +int mv_miiphy_read(const char *devname, unsigned char phy_addr, unsigned char phy_reg, unsigned short *value); -int mv_miiphy_write(char *devname, unsigned char phy_addr, +int mv_miiphy_write(const char *devname, unsigned char phy_addr, unsigned char phy_reg, unsigned short value); int phy_setup_aneg (char *devname, unsigned char addr); @@ -2544,7 +2544,7 @@ static bool eth_port_read_smi_reg (ETH_PORT eth_port_num, return true; } -int mv_miiphy_read(char *devname, unsigned char phy_addr, +int mv_miiphy_read(const char *devname, unsigned char phy_addr, unsigned char phy_reg, unsigned short *value) { unsigned int reg_value; @@ -2629,7 +2629,7 @@ static bool eth_port_write_smi_reg (ETH_PORT eth_port_num, return true; } -int mv_miiphy_write(char *devname, unsigned char phy_addr, +int mv_miiphy_write(const char *devname, unsigned char phy_addr, unsigned char phy_reg, unsigned short value) { unsigned int reg_value; diff --git a/board/sbc8560/sbc8560.c b/board/sbc8560/sbc8560.c index 10ba62f..77abde5 100644 --- a/board/sbc8560/sbc8560.c +++ b/board/sbc8560/sbc8560.c @@ -225,7 +225,7 @@ void reset_phy (void) #endif #if defined(CONFIG_MII) && defined(CONFIG_ETHER_ON_FCC) /* reset PHY */ - miiphy_reset("FCC1 ETHERNET", 0x0); + miiphy_reset("FCC1", 0x0); /* change PHY address to 0x02 */ bb_miiphy_write(NULL, 0, PHY_MIPSCR, 0xf028); diff --git a/board/stx/stxgp3/stxgp3.c b/board/stx/stxgp3/stxgp3.c index 3804fe0..25d5211 100644 --- a/board/stx/stxgp3/stxgp3.c +++ b/board/stx/stxgp3/stxgp3.c @@ -239,7 +239,7 @@ reset_phy(void) #endif #if defined(CONFIG_MII) && defined(CONFIG_ETHER_ON_FCC) /* reset PHY */ - miiphy_reset("FCC1 ETHERNET", 0x0); + miiphy_reset("FCC1", 0x0); /* change PHY address to 0x02 */ bb_miiphy_write(NULL, 0, PHY_MIPSCR, 0xf028); diff --git a/board/stx/stxssa/stxssa.c b/board/stx/stxssa/stxssa.c index 0b2584c..1e0acab 100644 --- a/board/stx/stxssa/stxssa.c +++ b/board/stx/stxssa/stxssa.c @@ -238,7 +238,7 @@ reset_phy(void) #endif #if defined(CONFIG_MII) && defined(CONFIG_ETHER_ON_FCC) /* reset PHY */ - miiphy_reset("FCC1 ETHERNET", 0x0); + miiphy_reset("FCC1", 0x0); /* change PHY address to 0x02 */ bb_miiphy_write(NULL, 0, PHY_MIPSCR, 0xf028); diff --git a/board/stx/stxxtc/stxxtc.c b/board/stx/stxxtc/stxxtc.c index 717dbe2..6693a70 100644 --- a/board/stx/stxxtc/stxxtc.c +++ b/board/stx/stxxtc/stxxtc.c @@ -481,12 +481,12 @@ void reset_phys(void) mii_init(); for (phyno = 0; phyno < 32; ++phyno) { - miiphy_read("FEC ETHERNET", phyno, PHY_PHYIDR1, &v); + miiphy_read("FEC", phyno, PHY_PHYIDR1, &v); if (v == 0xFFFF) continue; - miiphy_write("FEC ETHERNET", phyno, PHY_BMCR, PHY_BMCR_POWD); + miiphy_write("FEC", phyno, PHY_BMCR, PHY_BMCR_POWD); udelay(10000); - miiphy_write("FEC ETHERNET", phyno, PHY_BMCR, PHY_BMCR_RESET | PHY_BMCR_AUTON); + miiphy_write("FEC", phyno, PHY_BMCR, PHY_BMCR_RESET | PHY_BMCR_AUTON); udelay(10000); } } diff --git a/board/tqc/tqm8xx/tqm8xx.c b/board/tqc/tqm8xx/tqm8xx.c index 53f79e8..cde780b 100644 --- a/board/tqc/tqm8xx/tqm8xx.c +++ b/board/tqc/tqm8xx/tqm8xx.c @@ -745,13 +745,13 @@ int last_stage_init(void) return 0; for (i = 0; i < 2; i++) { - ret = miiphy_read("FEC ETHERNET", phy[i], PHY_BMCR, ®); + ret = miiphy_read("FEC", phy[i], PHY_BMCR, ®); if (ret) { printf("Cannot read BMCR on PHY %d\n", phy[i]); return 0; } /* Auto-negotiation off, hard set full duplex, 100Mbps */ - ret = miiphy_write("FEC ETHERNET", phy[i], + ret = miiphy_write("FEC", phy[i], PHY_BMCR, (reg | PHY_BMCR_100MB | PHY_BMCR_DPLX) & ~PHY_BMCR_AUTON); if (ret) { diff --git a/common/cmd_mii.c b/common/cmd_mii.c index bb94186..3ea493b 100644 --- a/common/cmd_mii.c +++ b/common/cmd_mii.c @@ -299,7 +299,7 @@ int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) unsigned char addr, reg; unsigned short data; int rcode = 0; - char *devname; + const char *devname; if (argc < 2) return cmd_usage(cmdtp); diff --git a/common/miiphyutil.c b/common/miiphyutil.c index 4b186dd..9cf845f 100644 --- a/common/miiphyutil.c +++ b/common/miiphyutil.c @@ -46,21 +46,45 @@ struct mii_dev { struct list_head link; - char *name; - int (*read) (char *devname, unsigned char addr, + const char *name; + int (*read) (const char *devname, unsigned char addr, unsigned char reg, unsigned short *value); - int (*write) (char *devname, unsigned char addr, + int (*write) (const char *devname, unsigned char addr, unsigned char reg, unsigned short value); }; static struct list_head mii_devs; static struct mii_dev *current_mii; +/* + * Lookup the mii_dev struct by the registered device name. + */ +static struct mii_dev *miiphy_get_dev_by_name(const char *devname, int quiet) +{ + struct list_head *entry; + struct mii_dev *dev; + + if (!devname) { + printf("NULL device name!\n"); + return NULL; + } + + list_for_each(entry, &mii_devs) { + dev = list_entry(entry, struct mii_dev, link); + if (strcmp(dev->name, devname) == 0) + return dev; + } + + if (!quiet) + printf("No such device: %s\n", devname); + return NULL; +} + /***************************************************************************** * * Initialize global data. Need to be called before any other miiphy routine. */ -void miiphy_init () +void miiphy_init(void) { INIT_LIST_HEAD (&mii_devs); current_mii = NULL; @@ -70,25 +94,21 @@ void miiphy_init () * * Register read and write MII access routines for the device <name>. */ -void miiphy_register (char *name, - int (*read) (char *devname, unsigned char addr, +void miiphy_register(const char *name, + int (*read) (const char *devname, unsigned char addr, unsigned char reg, unsigned short *value), - int (*write) (char *devname, unsigned char addr, + int (*write) (const char *devname, unsigned char addr, unsigned char reg, unsigned short value)) { - struct list_head *entry; struct mii_dev *new_dev; - struct mii_dev *miidev; unsigned int name_len; + char *new_name; /* check if we have unique name */ - list_for_each (entry, &mii_devs) { - miidev = list_entry (entry, struct mii_dev, link); - if (strcmp (miidev->name, name) == 0) { - printf ("miiphy_register: non unique device name " - "'%s'\n", name); - return; - } + new_dev = miiphy_get_dev_by_name(name, 1); + if (new_dev) { + printf("miiphy_register: non unique device name '%s'\n", name); + return; } /* allocate memory */ @@ -107,9 +127,9 @@ void miiphy_register (char *name, INIT_LIST_HEAD (&new_dev->link); new_dev->read = read; new_dev->write = write; - new_dev->name = (char *)(new_dev + 1); - strncpy (new_dev->name, name, name_len); - new_dev->name[name_len] = '\0'; + new_dev->name = new_name = (char *)(new_dev + 1); + strncpy (new_name, name, name_len); + new_name[name_len] = '\0'; debug ("miiphy_register: added '%s', read=0x%08lx, write=0x%08lx\n", new_dev->name, new_dev->read, new_dev->write); @@ -121,25 +141,20 @@ void miiphy_register (char *name, current_mii = new_dev; } -int miiphy_set_current_dev (char *devname) +int miiphy_set_current_dev(const char *devname) { - struct list_head *entry; struct mii_dev *dev; - list_for_each (entry, &mii_devs) { - dev = list_entry (entry, struct mii_dev, link); - - if (strcmp (devname, dev->name) == 0) { - current_mii = dev; - return 0; - } + dev = miiphy_get_dev_by_name(devname, 0); + if (dev) { + current_mii = dev; + return 0; } - printf ("No such device: %s\n", devname); return 1; } -char *miiphy_get_current_dev () +const char *miiphy_get_current_dev(void) { if (current_mii) return current_mii->name; @@ -147,6 +162,20 @@ char *miiphy_get_current_dev () return NULL; } +static struct mii_dev *miiphy_get_active_dev(const char *devname) +{ + /* If the current mii is the one we want, return it */ + if (current_mii) + if (strcmp(current_mii->name, devname) == 0) + return current_mii; + + /* Otherwise, set the active one to the one we want */ + if (miiphy_set_current_dev(devname)) + return NULL; + else + return current_mii; +} + /***************************************************************************** * * Read to variable <value> from the PHY attached to device <devname>, @@ -155,33 +184,16 @@ char *miiphy_get_current_dev () * Returns: * 0 on success */ -int miiphy_read (char *devname, unsigned char addr, unsigned char reg, +int miiphy_read(const char *devname, unsigned char addr, unsigned char reg, unsigned short *value) { - struct list_head *entry; struct mii_dev *dev; - int found_dev = 0; - int read_ret = 0; - - if (!devname) { - printf ("NULL device name!\n"); - return 1; - } - - list_for_each (entry, &mii_devs) { - dev = list_entry (entry, struct mii_dev, link); - - if (strcmp (devname, dev->name) == 0) { - found_dev = 1; - read_ret = dev->read (devname, addr, reg, value); - break; - } - } - if (found_dev == 0) - printf ("No such device: %s\n", devname); + dev = miiphy_get_active_dev(devname); + if (dev) + return dev->read(devname, addr, reg, value); - return ((found_dev) ? read_ret : 1); + return 1; } /***************************************************************************** @@ -192,33 +204,16 @@ int miiphy_read (char *devname, unsigned char addr, unsigned char reg, * Returns: * 0 on success */ -int miiphy_write (char *devname, unsigned char addr, unsigned char reg, +int miiphy_write(const char *devname, unsigned char addr, unsigned char reg, unsigned short value) { - struct list_head *entry; struct mii_dev *dev; - int found_dev = 0; - int write_ret = 0; - - if (!devname) { - printf ("NULL device name!\n"); - return 1; - } - - list_for_each (entry, &mii_devs) { - dev = list_entry (entry, struct mii_dev, link); - - if (strcmp (devname, dev->name) == 0) { - found_dev = 1; - write_ret = dev->write (devname, addr, reg, value); - break; - } - } - if (found_dev == 0) - printf ("No such device: %s\n", devname); + dev = miiphy_get_active_dev(devname); + if (dev) + return dev->write(devname, addr, reg, value); - return ((found_dev) ? write_ret : 1); + return 1; } /***************************************************************************** @@ -252,7 +247,7 @@ void miiphy_listdev (void) * Returns: * 0 on success */ -int miiphy_info (char *devname, unsigned char addr, unsigned int *oui, +int miiphy_info(const char *devname, unsigned char addr, unsigned int *oui, unsigned char *model, unsigned char *rev) { unsigned int reg = 0; @@ -290,7 +285,7 @@ int miiphy_info (char *devname, unsigned char addr, unsigned int *oui, * Returns: * 0 on success */ -int miiphy_reset (char *devname, unsigned char addr) +int miiphy_reset(const char *devname, unsigned char addr) { unsigned short reg; int timeout = 500; @@ -332,7 +327,7 @@ int miiphy_reset (char *devname, unsigned char addr) * * Determine the ethernet speed (10/100/1000). Return 10 on error. */ -int miiphy_speed (char *devname, unsigned char addr) +int miiphy_speed(const char *devname, unsigned char addr) { u16 bmcr, anlpar; @@ -386,7 +381,7 @@ miiphy_read_failed: * * Determine full/half duplex. Return half on error. */ -int miiphy_duplex (char *devname, unsigned char addr) +int miiphy_duplex(const char *devname, unsigned char addr) { u16 bmcr, anlpar; @@ -446,7 +441,7 @@ miiphy_read_failed: * Return 1 if PHY supports 1000BASE-X, 0 if PHY supports 10BASE-T/100BASE-TX/ * 1000BASE-T, or on error. */ -int miiphy_is_1000base_x (char *devname, unsigned char addr) +int miiphy_is_1000base_x(const char *devname, unsigned char addr) { #if defined(CONFIG_PHY_GIGE) u16 exsr; @@ -467,7 +462,7 @@ int miiphy_is_1000base_x (char *devname, unsigned char addr) * * Determine link status */ -int miiphy_link (char *devname, unsigned char addr) +int miiphy_link(const char *devname, unsigned char addr) { unsigned short reg; diff --git a/doc/README.kmeter1 b/doc/README.kmeter1 index 44ebb7a..7f4fc99 100644 --- a/doc/README.kmeter1 +++ b/doc/README.kmeter1 @@ -51,7 +51,7 @@ Keymile kmeter1 Board tftp 10000 u-boot.bin => run load - Using FSL UEC0 device + Using UEC0 device TFTP from server 192.168.1.1; our IP address is 192.168.205.4 Filename '/tftpboot/kmeter1/u-boot.bin'. Load address: 0x200000 diff --git a/doc/uImage.FIT/howto.txt b/doc/uImage.FIT/howto.txt index 8065e9e..59e21e9 100644 --- a/doc/uImage.FIT/howto.txt +++ b/doc/uImage.FIT/howto.txt @@ -93,7 +93,7 @@ nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath} addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off panic=1 => run nfsargs addip => tftp 900000 /path/to/tftp/location/kernel.itb -Using FEC ETHERNET device +Using FEC device TFTP from server 192.168.1.1; our IP address is 192.168.160.5 Filename '/path/to/tftp/location/kernel.itb'. Load address: 0x900000 @@ -207,7 +207,7 @@ inspected and booted: [on the target system] => tftp 900000 /path/to/tftp/location/kernel_fdt.itb -Using FEC ETHERNET device +Using FEC device TFTP from server 192.168.1.1; our IP address is 192.168.160.5 Filename '/path/to/tftp/location/kernel_fdt.itb'. Load address: 0x900000 diff --git a/drivers/net/4xx_enet.c b/drivers/net/4xx_enet.c index 144b851..d9487ad 100644 --- a/drivers/net/4xx_enet.c +++ b/drivers/net/4xx_enet.c @@ -305,9 +305,9 @@ static void mal_err (struct eth_device *dev, unsigned long isr, static void emac_err (struct eth_device *dev, unsigned long isr); extern int phy_setup_aneg (char *devname, unsigned char addr); -extern int emac4xx_miiphy_read (char *devname, unsigned char addr, +extern int emac4xx_miiphy_read (const char *devname, unsigned char addr, unsigned char reg, unsigned short *value); -extern int emac4xx_miiphy_write (char *devname, unsigned char addr, +extern int emac4xx_miiphy_write (const char *devname, unsigned char addr, unsigned char reg, unsigned short value); int board_emac_count(void); diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c index 5c0c274..d45aab1 100644 --- a/drivers/net/altera_tse.c +++ b/drivers/net/altera_tse.c @@ -426,7 +426,7 @@ static int tse_mdio_write(struct altera_tse_priv *priv, unsigned int regnum, /* MDIO access to phy */ #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) && !defined(BITBANGMII) -static int altera_tse_miiphy_write(char *devname, unsigned char addr, +static int altera_tse_miiphy_write(const char *devname, unsigned char addr, unsigned char reg, unsigned short value) { struct eth_device *dev; @@ -439,7 +439,7 @@ static int altera_tse_miiphy_write(char *devname, unsigned char addr, return 0; } -static int altera_tse_miiphy_read(char *devname, unsigned char addr, +static int altera_tse_miiphy_read(const char *devname, unsigned char addr, unsigned char reg, unsigned short *value) { struct eth_device *dev; diff --git a/drivers/net/at91_emac.c b/drivers/net/at91_emac.c index 245da12..d82459b 100644 --- a/drivers/net/at91_emac.c +++ b/drivers/net/at91_emac.c @@ -162,7 +162,7 @@ int at91emac_write(at91_emac_t *at91mac, unsigned char addr, #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) -at91_emac_t *get_emacbase_by_name(char *devname) +at91_emac_t *get_emacbase_by_name(const char *devname) { struct eth_device *netdev; @@ -170,7 +170,7 @@ at91_emac_t *get_emacbase_by_name(char *devname) return (at91_emac_t *) netdev->iobase; } -int at91emac_mii_read(char *devname, unsigned char addr, +int at91emac_mii_read(const char *devname, unsigned char addr, unsigned char reg, unsigned short *value) { at91_emac_t *emac; @@ -181,7 +181,7 @@ int at91emac_mii_read(char *devname, unsigned char addr, } -int at91emac_mii_write(char *devname, unsigned char addr, +int at91emac_mii_write(const char *devname, unsigned char addr, unsigned char reg, unsigned short value) { at91_emac_t *emac; diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c index e691bdf..36d4046 100644 --- a/drivers/net/bfin_mac.c +++ b/drivers/net/bfin_mac.c @@ -71,7 +71,7 @@ static int bfin_miiphy_wait(void) return 0; } -static int bfin_miiphy_read(char *devname, uchar addr, uchar reg, ushort *val) +static int bfin_miiphy_read(const char *devname, uchar addr, uchar reg, ushort *val) { if (bfin_miiphy_wait()) return 1; @@ -82,7 +82,7 @@ static int bfin_miiphy_read(char *devname, uchar addr, uchar reg, ushort *val) return 0; } -static int bfin_miiphy_write(char *devname, uchar addr, uchar reg, ushort val) +static int bfin_miiphy_write(const char *devname, uchar addr, uchar reg, ushort val) { if (bfin_miiphy_wait()) return 1; diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 02bbb8c..41a9910 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c @@ -252,12 +252,12 @@ static int gen_auto_negotiate(int phy_addr) #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) -static int davinci_mii_phy_read(char *devname, unsigned char addr, unsigned char reg, unsigned short *value) +static int davinci_mii_phy_read(const char *devname, unsigned char addr, unsigned char reg, unsigned short *value) { return(davinci_eth_phy_read(addr, reg, value) ? 0 : 1); } -static int davinci_mii_phy_write(char *devname, unsigned char addr, unsigned char reg, unsigned short value) +static int davinci_mii_phy_write(const char *devname, unsigned char addr, unsigned char reg, unsigned short value) { return(davinci_eth_phy_write(addr, reg, value) ? 0 : 1); } diff --git a/drivers/net/designware.c b/drivers/net/designware.c index d0d9827..2f923f2 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -451,7 +451,7 @@ static int configure_phy(struct eth_device *dev) } #if defined(CONFIG_MII) -static int dw_mii_read(char *devname, u8 addr, u8 reg, u16 *val) +static int dw_mii_read(const char *devname, u8 addr, u8 reg, u16 *val) { struct eth_device *dev; @@ -462,7 +462,7 @@ static int dw_mii_read(char *devname, u8 addr, u8 reg, u16 *val) return 0; } -static int dw_mii_write(char *devname, u8 addr, u8 reg, u16 val) +static int dw_mii_write(const char *devname, u8 addr, u8 reg, u16 val) { struct eth_device *dev; diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c index 9c06b25..22e14e3 100644 --- a/drivers/net/eepro100.c +++ b/drivers/net/eepro100.c @@ -321,7 +321,8 @@ static int set_phyreg (struct eth_device *dev, unsigned char addr, /* Check if given phyaddr is valid, i.e. there is a PHY connected. * Do this by checking model value field from ID2 register. */ -static struct eth_device* verify_phyaddr (char *devname, unsigned char addr) +static struct eth_device* verify_phyaddr (const char *devname, + unsigned char addr) { struct eth_device *dev; unsigned short value; @@ -350,7 +351,7 @@ static struct eth_device* verify_phyaddr (char *devname, unsigned char addr) return dev; } -static int eepro100_miiphy_read (char *devname, unsigned char addr, +static int eepro100_miiphy_read(const char *devname, unsigned char addr, unsigned char reg, unsigned short *value) { struct eth_device *dev; @@ -367,7 +368,7 @@ static int eepro100_miiphy_read (char *devname, unsigned char addr, return 0; } -static int eepro100_miiphy_write (char *devname, unsigned char addr, +static int eepro100_miiphy_write(const char *devname, unsigned char addr, unsigned char reg, unsigned short value) { struct eth_device *dev; diff --git a/drivers/net/ep93xx_eth.c b/drivers/net/ep93xx_eth.c index 4e39948..c09384c 100644 --- a/drivers/net/ep93xx_eth.c +++ b/drivers/net/ep93xx_eth.c @@ -44,9 +44,9 @@ #define GET_REGS(eth_dev) (GET_PRIV(eth_dev)->regs) /* ep93xx_miiphy ops forward declarations */ -static int ep93xx_miiphy_read(char * const dev, unsigned char const addr, +static int ep93xx_miiphy_read(const char * const dev, unsigned char const addr, unsigned char const reg, unsigned short * const value); -static int ep93xx_miiphy_write(char * const dev, unsigned char const addr, +static int ep93xx_miiphy_write(const char * const dev, unsigned char const addr, unsigned char const reg, unsigned short const value); #if defined(EP93XX_MAC_DEBUG) @@ -555,7 +555,7 @@ eth_init_done: /** * Read a 16-bit value from an MII register. */ -static int ep93xx_miiphy_read(char * const dev, unsigned char const addr, +static int ep93xx_miiphy_read(const char * const dev, unsigned char const addr, unsigned char const reg, unsigned short * const value) { struct mac_regs *mac = (struct mac_regs *)MAC_BASE; @@ -607,7 +607,7 @@ static int ep93xx_miiphy_read(char * const dev, unsigned char const addr, /** * Write a 16-bit value to an MII register. */ -static int ep93xx_miiphy_write(char * const dev, unsigned char const addr, +static int ep93xx_miiphy_write(const char * const dev, unsigned char const addr, unsigned char const reg, unsigned short const value) { struct mac_regs *mac = (struct mac_regs *)MAC_BASE; diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 57f89a3..2d4ffed 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -62,7 +62,7 @@ struct fec_priv gfec = { /* * MII-interface related functions */ -static int fec_miiphy_read(char *dev, uint8_t phyAddr, uint8_t regAddr, +static int fec_miiphy_read(const char *dev, uint8_t phyAddr, uint8_t regAddr, uint16_t *retVal) { struct eth_device *edev = eth_get_dev_by_name(dev); @@ -119,7 +119,7 @@ static void fec_mii_setspeed(struct fec_priv *fec) debug("fec_init: mii_speed %#lx\n", fec->eth->mii_speed); } -static int fec_miiphy_write(char *dev, uint8_t phyAddr, uint8_t regAddr, +static int fec_miiphy_write(const char *dev, uint8_t phyAddr, uint8_t regAddr, uint16_t data) { struct eth_device *edev = eth_get_dev_by_name(dev); @@ -743,7 +743,7 @@ static int fec_probe(bd_t *bd) writel(0x05ee0024, &fec->eth->r_cntrl); /* FIXME 0x05ee0004 */ fec_mii_setspeed(fec); - sprintf(edev->name, "FEC_MXC"); + sprintf(edev->name, "FEC"); miiphy_register(edev->name, fec_miiphy_read, fec_miiphy_write); diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 6a58a37..acb8d20 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -167,7 +167,7 @@ static u16 macb_mdio_read(struct macb_device *macb, u8 reg) #if defined(CONFIG_CMD_MII) -int macb_miiphy_read(char *devname, u8 phy_adr, u8 reg, u16 *value) +int macb_miiphy_read(const char *devname, u8 phy_adr, u8 reg, u16 *value) { struct eth_device *dev = eth_get_dev_by_name(devname); struct macb_device *macb = to_macb(dev); @@ -180,7 +180,7 @@ int macb_miiphy_read(char *devname, u8 phy_adr, u8 reg, u16 *value) return 0; } -int macb_miiphy_write(char *devname, u8 phy_adr, u8 reg, u16 value) +int macb_miiphy_write(const char *devname, u8 phy_adr, u8 reg, u16 value) { struct eth_device *dev = eth_get_dev_by_name(devname); struct macb_device *macb = to_macb(dev); diff --git a/drivers/net/mcfmii.c b/drivers/net/mcfmii.c index 060bdd7..401182d 100644 --- a/drivers/net/mcfmii.c +++ b/drivers/net/mcfmii.c @@ -293,7 +293,7 @@ void __mii_init(void) * Otherwise they hang in mii_send() !!! Sorry! */ -int mcffec_miiphy_read(char *devname, unsigned char addr, unsigned char reg, +int mcffec_miiphy_read(const char *devname, unsigned char addr, unsigned char reg, unsigned short *value) { short rdreg; /* register working value */ @@ -312,7 +312,7 @@ int mcffec_miiphy_read(char *devname, unsigned char addr, unsigned char reg, return 0; } -int mcffec_miiphy_write(char *devname, unsigned char addr, unsigned char reg, +int mcffec_miiphy_write(const char *devname, unsigned char addr, unsigned char reg, unsigned short value) { short rdreg; /* register working value */ diff --git a/drivers/net/mpc512x_fec.c b/drivers/net/mpc512x_fec.c index c580c82..f56d940 100644 --- a/drivers/net/mpc512x_fec.c +++ b/drivers/net/mpc512x_fec.c @@ -25,8 +25,8 @@ DECLARE_GLOBAL_DATA_PTR; #error "CONFIG_MII has to be defined!" #endif -int fec512x_miiphy_read(char *devname, u8 phyAddr, u8 regAddr, u16 * retVal); -int fec512x_miiphy_write(char *devname, u8 phyAddr, u8 regAddr, u16 data); +int fec512x_miiphy_read(const char *devname, u8 phyAddr, u8 regAddr, u16 * retVal); +int fec512x_miiphy_write(const char *devname, u8 phyAddr, u8 regAddr, u16 data); int mpc512x_fec_init_phy(struct eth_device *dev, bd_t * bis); static uchar rx_buff[FEC_BUFFER_SIZE]; @@ -637,7 +637,7 @@ int mpc512x_fec_initialize (bd_t * bis) dev->send = mpc512x_fec_send; dev->recv = mpc512x_fec_recv; - sprintf (dev->name, "FEC ETHERNET"); + sprintf (dev->name, "FEC"); eth_register (dev); #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) @@ -672,7 +672,7 @@ int mpc512x_fec_initialize (bd_t * bis) /* MII-interface related functions */ /********************************************************************/ -int fec512x_miiphy_read (char *devname, u8 phyAddr, u8 regAddr, u16 * retVal) +int fec512x_miiphy_read(const char *devname, u8 phyAddr, u8 regAddr, u16 *retVal) { volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; volatile fec512x_t *eth = &im->fec; @@ -719,7 +719,7 @@ int fec512x_miiphy_read (char *devname, u8 phyAddr, u8 regAddr, u16 * retVal) } /********************************************************************/ -int fec512x_miiphy_write (char *devname, u8 phyAddr, u8 regAddr, u16 data) +int fec512x_miiphy_write(const char *devname, u8 phyAddr, u8 regAddr, u16 data) { volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; volatile fec512x_t *eth = &im->fec; diff --git a/drivers/net/mpc5xxx_fec.c b/drivers/net/mpc5xxx_fec.c index 4a1c8e6..c88e596 100644 --- a/drivers/net/mpc5xxx_fec.c +++ b/drivers/net/mpc5xxx_fec.c @@ -35,8 +35,8 @@ typedef struct { uint8 head[16]; /* MAC header(6 + 6 + 2) + 2(aligned) */ } NBUF; -int fec5xxx_miiphy_read(char *devname, uint8 phyAddr, uint8 regAddr, uint16 * retVal); -int fec5xxx_miiphy_write(char *devname, uint8 phyAddr, uint8 regAddr, uint16 data); +int fec5xxx_miiphy_read(const char *devname, uint8 phyAddr, uint8 regAddr, uint16 *retVal); +int fec5xxx_miiphy_write(const char *devname, uint8 phyAddr, uint8 regAddr, uint16 data); static int mpc5xxx_fec_init_phy(struct eth_device *dev, bd_t * bis); @@ -941,7 +941,7 @@ int mpc5xxx_fec_initialize(bd_t * bis) /* MII-interface related functions */ /********************************************************************/ -int fec5xxx_miiphy_read(char *devname, uint8 phyAddr, uint8 regAddr, uint16 * retVal) +int fec5xxx_miiphy_read(const char *devname, uint8 phyAddr, uint8 regAddr, uint16 * retVal) { ethernet_regs *eth = (ethernet_regs *)MPC5XXX_FEC; uint32 reg; /* convenient holder for the PHY register */ @@ -983,7 +983,7 @@ int fec5xxx_miiphy_read(char *devname, uint8 phyAddr, uint8 regAddr, uint16 * re } /********************************************************************/ -int fec5xxx_miiphy_write(char *devname, uint8 phyAddr, uint8 regAddr, uint16 data) +int fec5xxx_miiphy_write(const char *devname, uint8 phyAddr, uint8 regAddr, uint16 data) { ethernet_regs *eth = (ethernet_regs *)MPC5XXX_FEC; uint32 reg; /* convenient holder for the PHY register */ diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c index cad4023..c701f43 100644 --- a/drivers/net/mvgbe.c +++ b/drivers/net/mvgbe.c @@ -54,7 +54,7 @@ DECLARE_GLOBAL_DATA_PTR; * * Returns 16bit phy register value, or 0xffff on error */ -static int smi_reg_read(char *devname, u8 phy_adr, u8 reg_ofs, u16 * data) +static int smi_reg_read(const char *devname, u8 phy_adr, u8 reg_ofs, u16 * data) { struct eth_device *dev = eth_get_dev_by_name(devname); struct mvgbe_device *dmvgbe = to_mvgbe(dev); @@ -131,7 +131,7 @@ static int smi_reg_read(char *devname, u8 phy_adr, u8 reg_ofs, u16 * data) * Returns 0 if write succeed, -EINVAL on bad parameters * -ETIME on timeout */ -static int smi_reg_write(char *devname, u8 phy_adr, u8 reg_ofs, u16 data) +static int smi_reg_write(const char *devname, u8 phy_adr, u8 reg_ofs, u16 data) { struct eth_device *dev = eth_get_dev_by_name(devname); struct mvgbe_device *dmvgbe = to_mvgbe(dev); diff --git a/drivers/net/ns7520_eth.c b/drivers/net/ns7520_eth.c index c28726e..bfa651b 100644 --- a/drivers/net/ns7520_eth.c +++ b/drivers/net/ns7520_eth.c @@ -761,7 +761,7 @@ enum mii_status { /** * Read a 16-bit value from an MII register. */ -extern int ns7520_miiphy_read(char *devname, unsigned char const addr, +extern int ns7520_miiphy_read(const char *devname, unsigned char const addr, unsigned char const reg, unsigned short *const value) { int ret = MII_STATUS_FAILURE; @@ -807,7 +807,7 @@ extern int ns7520_miiphy_read(char *devname, unsigned char const addr, /** * Write a 16-bit value to an MII register. */ -extern int ns7520_miiphy_write(char *devname, unsigned char const addr, +extern int ns7520_miiphy_write(const char *devname, unsigned char const addr, unsigned char const reg, unsigned short const value) { int ret = MII_STATUS_FAILURE; diff --git a/drivers/net/phy/miiphybb.c b/drivers/net/phy/miiphybb.c index 2768c75..1045cf1 100644 --- a/drivers/net/phy/miiphybb.c +++ b/drivers/net/phy/miiphybb.c @@ -143,7 +143,7 @@ void bb_miiphy_init(void) } } -static inline struct bb_miiphy_bus *bb_miiphy_getbus(char *devname) +static inline struct bb_miiphy_bus *bb_miiphy_getbus(const char *devname) { #ifdef CONFIG_BITBANGMII_MULTI int i; @@ -246,7 +246,7 @@ static void miiphy_pre(struct bb_miiphy_bus *bus, char read, * Returns: * 0 on success */ -int bb_miiphy_read(char *devname, unsigned char addr, +int bb_miiphy_read(const char *devname, unsigned char addr, unsigned char reg, unsigned short *value) { short rdreg; /* register working value */ @@ -327,7 +327,7 @@ int bb_miiphy_read(char *devname, unsigned char addr, * Returns: * 0 on success */ -int bb_miiphy_write (char *devname, unsigned char addr, +int bb_miiphy_write (const char *devname, unsigned char addr, unsigned char reg, unsigned short value) { struct bb_miiphy_bus *bus; diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 54c4a70..9b5dd92 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -60,9 +60,9 @@ static void phy_run_commands(struct tsec_private *priv, struct phy_cmd *cmd); static void adjust_link(struct eth_device *dev); #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \ && !defined(BITBANGMII) -static int tsec_miiphy_write(char *devname, unsigned char addr, +static int tsec_miiphy_write(const char *devname, unsigned char addr, unsigned char reg, unsigned short value); -static int tsec_miiphy_read(char *devname, unsigned char addr, +static int tsec_miiphy_read(const char *devname, unsigned char addr, unsigned char reg, unsigned short *value); #endif #ifdef CONFIG_MCAST_TFTP @@ -1919,7 +1919,7 @@ static void phy_run_commands(struct tsec_private *priv, struct phy_cmd *cmd) * Returns: * 0 on success */ -static int tsec_miiphy_read(char *devname, unsigned char addr, +static int tsec_miiphy_read(const char *devname, unsigned char addr, unsigned char reg, unsigned short *value) { unsigned short ret; @@ -1942,7 +1942,7 @@ static int tsec_miiphy_read(char *devname, unsigned char addr, * Returns: * 0 on success */ -static int tsec_miiphy_write(char *devname, unsigned char addr, +static int tsec_miiphy_write(const char *devname, unsigned char addr, unsigned char reg, unsigned short value) { struct tsec_private *priv = privlist[0]; diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c index ccbf27d..e10c0f3 100644 --- a/drivers/qe/uec.c +++ b/drivers/qe/uec.c @@ -603,7 +603,7 @@ static void phy_change(struct eth_device *dev) * Returns: * The index where the device is located, -1 on error */ -static int uec_miiphy_find_dev_by_name(char *devname) +static int uec_miiphy_find_dev_by_name(const char *devname) { int i; @@ -628,7 +628,7 @@ static int uec_miiphy_find_dev_by_name(char *devname) * Returns: * 0 on success */ -static int uec_miiphy_read(char *devname, unsigned char addr, +static int uec_miiphy_read(const char *devname, unsigned char addr, unsigned char reg, unsigned short *value) { int devindex = 0; @@ -650,7 +650,7 @@ static int uec_miiphy_read(char *devname, unsigned char addr, * Returns: * 0 on success */ -static int uec_miiphy_write(char *devname, unsigned char addr, +static int uec_miiphy_write(const char *devname, unsigned char addr, unsigned char reg, unsigned short value) { int devindex = 0; @@ -1367,7 +1367,7 @@ int uec_initialize(bd_t *bis, uec_info_t *uec_info) uec->uec_info = uec_info; uec->dev = dev; - sprintf(dev->name, "FSL UEC%d", uec_info->uf_info.ucc_num); + sprintf(dev->name, "UEC%d", uec_info->uf_info.ucc_num); dev->iobase = 0; dev->priv = (void *)uec; dev->init = uec_init; diff --git a/drivers/qe/uec_phy.c b/drivers/qe/uec_phy.c index 3baffe4..2d3a896 100644 --- a/drivers/qe/uec_phy.c +++ b/drivers/qe/uec_phy.c @@ -71,8 +71,8 @@ * {name, speed, duplex}, * * #define CONFIG_SYS_FIXED_PHY_PORTS \ - * CONFIG_SYS_FIXED_PHY_PORT("FSL UEC0",SPEED_100,DUPLEX_FULL) \ - * CONFIG_SYS_FIXED_PHY_PORT("FSL UEC2",SPEED_100,DUPLEX_HALF) + * CONFIG_SYS_FIXED_PHY_PORT("UEC0",SPEED_100,DUPLEX_FULL) \ + * CONFIG_SYS_FIXED_PHY_PORT("UEC2",SPEED_100,DUPLEX_HALF) */ #ifndef CONFIG_FIXED_PHY @@ -102,7 +102,7 @@ static const struct fixed_phy_port fixed_phy_port[] = { * Example board header file to define bitbang ethernet ports: * * #define CONFIG_SYS_BITBANG_PHY_PORT(name) name, - * #define CONFIG_SYS_BITBANG_PHY_PORTS CONFIG_SYS_BITBANG_PHY_PORT("FSL UEC0") + * #define CONFIG_SYS_BITBANG_PHY_PORTS CONFIG_SYS_BITBANG_PHY_PORT("UEC0") */ #ifndef CONFIG_SYS_BITBANG_PHY_PORTS #define CONFIG_SYS_BITBANG_PHY_PORTS /* default is an empty array */ diff --git a/include/configs/MPC8323ERDB.h b/include/configs/MPC8323ERDB.h index 7c84393..9a296a1 100644 --- a/include/configs/MPC8323ERDB.h +++ b/include/configs/MPC8323ERDB.h @@ -338,7 +338,7 @@ * QE UEC ethernet configuration */ #define CONFIG_UEC_ETH -#define CONFIG_ETHPRIME "FSL UEC0" +#define CONFIG_ETHPRIME "UEC0" #define CONFIG_UEC_ETH1 /* ETH3 */ diff --git a/include/configs/MPC832XEMDS.h b/include/configs/MPC832XEMDS.h index 7bd2793..68ff191 100644 --- a/include/configs/MPC832XEMDS.h +++ b/include/configs/MPC832XEMDS.h @@ -353,7 +353,7 @@ * QE UEC ethernet configuration */ #define CONFIG_UEC_ETH -#define CONFIG_ETHPRIME "FSL UEC0" +#define CONFIG_ETHPRIME "UEC0" #define CONFIG_UEC_ETH1 /* ETH3 */ diff --git a/include/configs/MPC8360EMDS.h b/include/configs/MPC8360EMDS.h index 87a137b..c58e003 100644 --- a/include/configs/MPC8360EMDS.h +++ b/include/configs/MPC8360EMDS.h @@ -390,7 +390,7 @@ * QE UEC ethernet configuration */ #define CONFIG_UEC_ETH -#define CONFIG_ETHPRIME "FSL UEC0" +#define CONFIG_ETHPRIME "UEC0" #define CONFIG_PHY_MODE_NEED_CHANGE #define CONFIG_UEC_ETH1 /* GETH1 */ diff --git a/include/configs/MPC8360ERDK.h b/include/configs/MPC8360ERDK.h index e78cf60..9fa577d 100644 --- a/include/configs/MPC8360ERDK.h +++ b/include/configs/MPC8360ERDK.h @@ -309,7 +309,7 @@ * QE UEC ethernet configuration */ #define CONFIG_UEC_ETH -#define CONFIG_ETHPRIME "FSL UEC0" +#define CONFIG_ETHPRIME "UEC0" #define CONFIG_UEC_ETH1 /* GETH1 */ diff --git a/include/configs/MPC8568MDS.h b/include/configs/MPC8568MDS.h index ea7a134..2dc2932 100644 --- a/include/configs/MPC8568MDS.h +++ b/include/configs/MPC8568MDS.h @@ -313,7 +313,7 @@ extern unsigned long get_clock_freq(void); */ #define CONFIG_UEC_ETH #ifndef CONFIG_TSEC_ENET -#define CONFIG_ETHPRIME "FSL UEC0" +#define CONFIG_ETHPRIME "UEC0" #endif #define CONFIG_PHY_MODE_NEED_CHANGE #define CONFIG_eTSEC_MDIO_BUS diff --git a/include/configs/MPC8569MDS.h b/include/configs/MPC8569MDS.h index f69b650..8177db3 100644 --- a/include/configs/MPC8569MDS.h +++ b/include/configs/MPC8569MDS.h @@ -363,7 +363,7 @@ extern unsigned long get_clock_freq(void); #define CONFIG_MIIM_ADDRESS (CONFIG_SYS_CCSRBAR + 0x82120) #define CONFIG_UEC_ETH -#define CONFIG_ETHPRIME "FSL UEC0" +#define CONFIG_ETHPRIME "UEC0" #define CONFIG_PHY_MODE_NEED_CHANGE #define CONFIG_UEC_ETH1 /* GETH1 */ diff --git a/include/configs/NSCU.h b/include/configs/NSCU.h index 5724f45..6a4c47d 100644 --- a/include/configs/NSCU.h +++ b/include/configs/NSCU.h @@ -485,7 +485,6 @@ #undef CONFIG_SCC1_ENET #define CONFIG_FEC_ENET -/* #define CONFIG_ETHPRIME "FEC ETHERNET" */ /* pass open firmware flat tree */ #define CONFIG_OF_LIBFDT 1 diff --git a/include/configs/TK885D.h b/include/configs/TK885D.h index 0df1b6e..7cefa32 100644 --- a/include/configs/TK885D.h +++ b/include/configs/TK885D.h @@ -65,8 +65,8 @@ #undef CONFIG_BOOTARGS #define CONFIG_EXTRA_ENV_SETTINGS \ - "ethprime=FEC ETHERNET\0" \ - "ethact=FEC ETHERNET\0" \ + "ethprime=FEC\0" \ + "ethact=FEC\0" \ "netdev=eth0\0" \ "nfsargs=setenv bootargs root=/dev/nfs rw " \ "nfsroot=${serverip}:${rootpath}\0" \ @@ -514,7 +514,7 @@ #define CONFIG_MII_INIT 1 #define CONFIG_NET_RETRY_COUNT 3 -#define CONFIG_ETHPRIME "FEC ETHERNET" +#define CONFIG_ETHPRIME "FEC" /* pass open firmware flat tree */ #define CONFIG_OF_LIBFDT 1 diff --git a/include/configs/TQM855L.h b/include/configs/TQM855L.h index 32a7e79..5bf8f02 100644 --- a/include/configs/TQM855L.h +++ b/include/configs/TQM855L.h @@ -481,7 +481,7 @@ #define CONFIG_SCC1_ENET #define CONFIG_FEC_ENET -#define CONFIG_ETHPRIME "SCC ETHERNET" +#define CONFIG_ETHPRIME "SCC" /* pass open firmware flat tree */ #define CONFIG_OF_LIBFDT 1 diff --git a/include/configs/TQM855M.h b/include/configs/TQM855M.h index 4f44be3..456ed7e 100644 --- a/include/configs/TQM855M.h +++ b/include/configs/TQM855M.h @@ -516,7 +516,7 @@ #define CONFIG_SCC1_ENET #define CONFIG_FEC_ENET -#define CONFIG_ETHPRIME "SCC ETHERNET" +#define CONFIG_ETHPRIME "SCC" /* pass open firmware flat tree */ #define CONFIG_OF_LIBFDT 1 diff --git a/include/configs/TQM860L.h b/include/configs/TQM860L.h index e86fe5e..94b9a3b 100644 --- a/include/configs/TQM860L.h +++ b/include/configs/TQM860L.h @@ -480,7 +480,7 @@ #define CONFIG_SCC1_ENET #define CONFIG_FEC_ENET -#define CONFIG_ETHPRIME "SCC ETHERNET" +#define CONFIG_ETHPRIME "SCC" /* pass open firmware flat tree */ #define CONFIG_OF_LIBFDT 1 diff --git a/include/configs/TQM860M.h b/include/configs/TQM860M.h index 4fd873b..ce5e691 100644 --- a/include/configs/TQM860M.h +++ b/include/configs/TQM860M.h @@ -484,7 +484,7 @@ #define CONFIG_SCC1_ENET #define CONFIG_FEC_ENET -#define CONFIG_ETHPRIME "SCC ETHERNET" +#define CONFIG_ETHPRIME "SCC" /* pass open firmware flat tree */ #define CONFIG_OF_LIBFDT 1 diff --git a/include/configs/TQM862L.h b/include/configs/TQM862L.h index 0c966c9..d77df9c 100644 --- a/include/configs/TQM862L.h +++ b/include/configs/TQM862L.h @@ -486,7 +486,7 @@ #define CONFIG_NET_MULTI #define CONFIG_SCC1_ENET #define CONFIG_FEC_ENET -#define CONFIG_ETHPRIME "SCC ETHERNET" +#define CONFIG_ETHPRIME "SCC" /* pass open firmware flat tree */ #define CONFIG_OF_LIBFDT 1 diff --git a/include/configs/TQM862M.h b/include/configs/TQM862M.h index 178e6e2..a6c465b 100644 --- a/include/configs/TQM862M.h +++ b/include/configs/TQM862M.h @@ -487,7 +487,7 @@ #define CONFIG_NET_MULTI #define CONFIG_SCC1_ENET #define CONFIG_FEC_ENET -#define CONFIG_ETHPRIME "SCC ETHERNET" +#define CONFIG_ETHPRIME "SCC" /* pass open firmware flat tree */ #define CONFIG_OF_LIBFDT 1 diff --git a/include/configs/TQM866M.h b/include/configs/TQM866M.h index a65946d..9ec815c 100644 --- a/include/configs/TQM866M.h +++ b/include/configs/TQM866M.h @@ -506,7 +506,7 @@ #define CONFIG_SCC1_ENET #define CONFIG_FEC_ENET -#define CONFIG_ETHPRIME "SCC ETHERNET" +#define CONFIG_ETHPRIME "SCC" /* pass open firmware flat tree */ #define CONFIG_OF_LIBFDT 1 diff --git a/include/configs/TQM885D.h b/include/configs/TQM885D.h index 0fc4b69..c715c07 100644 --- a/include/configs/TQM885D.h +++ b/include/configs/TQM885D.h @@ -506,7 +506,7 @@ switching to another netwok (if the tried network is unreachable) */ -#define CONFIG_ETHPRIME "SCC ETHERNET" +#define CONFIG_ETHPRIME "SCC" /* pass open firmware flat tree */ #define CONFIG_OF_LIBFDT 1 diff --git a/include/configs/ep82xxm.h b/include/configs/ep82xxm.h index c737f10..b52b941 100644 --- a/include/configs/ep82xxm.h +++ b/include/configs/ep82xxm.h @@ -147,7 +147,7 @@ #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */ #define CONFIG_ENV_IN_OWN_SECT 1 #define CONFIG_AUTO_COMPLETE 1 -#define CONFIG_EXTRA_ENV_SETTINGS "ethprime=FCC3 ETHERNET" +#define CONFIG_EXTRA_ENV_SETTINGS "ethprime=FCC3" #if defined(CONFIG_CMD_KGDB) #undef CONFIG_KGDB_ON_SMC /* define if kgdb on SMC */ diff --git a/include/configs/idmr.h b/include/configs/idmr.h index 61e3bad..8105876 100644 --- a/include/configs/idmr.h +++ b/include/configs/idmr.h @@ -74,7 +74,7 @@ "net_nfs=tftp 200000 $(bootfile);run nfsargs addip;bootm\0" \ "nfsargs=setenv bootargs root=/dev/nfs rw " \ "nfsroot=$(serverip):$(rootpath)\0" \ - "ethact=FEC ETHERNET\0" \ + "ethact=FEC\0 " \ "update=prot off ff800000 ff81ffff; era ff800000 ff81ffff; " \ "cp.b 200000 ff800000 $(filesize);" \ "prot on ff800000 ff81ffff\0" \ diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h index 3a9f790..6c14ca0 100644 --- a/include/configs/keymile-common.h +++ b/include/configs/keymile-common.h @@ -139,8 +139,8 @@ #ifdef CONFIG_IO_MUXING #define CONFIG_KM_DEF_ENV_IOMUX \ - "nc=setenv ethact HDLC ETHERNET \0" \ - "nce=setenv ethact SCC ETHERNET \0" \ + "nc=setenv ethact HDLC \0" \ + "nce=setenv ethact SCC \0" \ "stderr=serial,nc \0" \ "stdin=serial,nc \0" \ "stdout=serial,nc \0" \ diff --git a/include/configs/km8xx.h b/include/configs/km8xx.h index b5552d2..a10744e 100644 --- a/include/configs/km8xx.h +++ b/include/configs/km8xx.h @@ -280,7 +280,7 @@ #define BOOTFLAG_WARM 0x02 /* Software reboot */ #define CONFIG_SCC3_ENET -#define CONFIG_ETHPRIME "SCC ETHERNET" +#define CONFIG_ETHPRIME "SCC" #define CONFIG_HAS_ETH0 /* pass open firmware flat tree */ diff --git a/include/configs/kmeter1.h b/include/configs/kmeter1.h index 6497231..f7d36b1 100644 --- a/include/configs/kmeter1.h +++ b/include/configs/kmeter1.h @@ -284,7 +284,7 @@ * QE UEC ethernet configuration */ #define CONFIG_UEC_ETH -#define CONFIG_ETHPRIME "FSL UEC0" +#define CONFIG_ETHPRIME "UEC0" #define CONFIG_UEC_ETH1 /* GETH1 */ #define UEC_VERBOSE_DEBUG 1 diff --git a/include/configs/v38b.h b/include/configs/v38b.h index d462ed0..600ccfb 100644 --- a/include/configs/v38b.h +++ b/include/configs/v38b.h @@ -154,7 +154,7 @@ "nfsargs=setenv bootargs root=/dev/nfs rw " \ "nfsroot=$(serverip):$(rootpath) wdt=off\0" \ "hostname=v38b\0" \ - "ethact=FEC ETHERNET\0" \ + "ethact=FEC\0" \ "rootpath=/opt/eldk-3.1.1/ppc_6xx\0" \ "update=prot off ff000000 ff03ffff; era ff000000 ff03ffff; " \ "cp.b 200000 ff000000 $(filesize);" \ diff --git a/include/miiphy.h b/include/miiphy.h index 5362125..2f7d915 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -36,30 +36,30 @@ #include <net.h> -int miiphy_read (char *devname, unsigned char addr, unsigned char reg, +int miiphy_read (const char *devname, unsigned char addr, unsigned char reg, unsigned short *value); -int miiphy_write (char *devname, unsigned char addr, unsigned char reg, +int miiphy_write (const char *devname, unsigned char addr, unsigned char reg, unsigned short value); -int miiphy_info (char *devname, unsigned char addr, unsigned int *oui, +int miiphy_info (const char *devname, unsigned char addr, unsigned int *oui, unsigned char *model, unsigned char *rev); -int miiphy_reset (char *devname, unsigned char addr); -int miiphy_speed (char *devname, unsigned char addr); -int miiphy_duplex (char *devname, unsigned char addr); -int miiphy_is_1000base_x (char *devname, unsigned char addr); +int miiphy_reset (const char *devname, unsigned char addr); +int miiphy_speed (const char *devname, unsigned char addr); +int miiphy_duplex (const char *devname, unsigned char addr); +int miiphy_is_1000base_x (const char *devname, unsigned char addr); #ifdef CONFIG_SYS_FAULT_ECHO_LINK_DOWN -int miiphy_link (char *devname, unsigned char addr); +int miiphy_link (const char *devname, unsigned char addr); #endif void miiphy_init (void); -void miiphy_register (char *devname, - int (*read) (char *devname, unsigned char addr, +void miiphy_register (const char *devname, + int (*read) (const char *devname, unsigned char addr, unsigned char reg, unsigned short *value), - int (*write) (char *devname, unsigned char addr, + int (*write) (const char *devname, unsigned char addr, unsigned char reg, unsigned short value)); -int miiphy_set_current_dev (char *devname); -char *miiphy_get_current_dev (void); +int miiphy_set_current_dev (const char *devname); +const char *miiphy_get_current_dev (void); void miiphy_listdev (void); @@ -85,9 +85,9 @@ extern struct bb_miiphy_bus bb_miiphy_buses[]; extern int bb_miiphy_buses_num; void bb_miiphy_init (void); -int bb_miiphy_read (char *devname, unsigned char addr, +int bb_miiphy_read (const char *devname, unsigned char addr, unsigned char reg, unsigned short *value); -int bb_miiphy_write (char *devname, unsigned char addr, +int bb_miiphy_write (const char *devname, unsigned char addr, unsigned char reg, unsigned short value); #endif diff --git a/include/net.h b/include/net.h index a180881..ab571eb 100644 --- a/include/net.h +++ b/include/net.h @@ -117,7 +117,7 @@ extern void eth_try_another(int first_restart); /* Change the device */ extern void eth_set_current(void); /* set nterface to ethcur var */ #endif extern struct eth_device *eth_get_dev(void); /* get the current device MAC */ -extern struct eth_device *eth_get_dev_by_name(char *devname); /* get device */ +extern struct eth_device *eth_get_dev_by_name(const char *devname); extern struct eth_device *eth_get_dev_by_index(int index); /* get dev @ index */ extern int eth_get_dev_index (void); /* get the device index */ extern void eth_parse_enetaddr(const char *addr, uchar *enetaddr); @@ -102,7 +102,7 @@ struct eth_device *eth_get_dev(void) return eth_current; } -struct eth_device *eth_get_dev_by_name(char *devname) +struct eth_device *eth_get_dev_by_name(const char *devname) { struct eth_device *dev, *target_dev; |