mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 15:15:44 +00:00
2004-05-21 Till Strauman <strauman@slac.stanford.edu>
* PR/625/networking * network/dec21140.c: Prevent name clashes by making 'ld_le32()' etc. static inlines. Let dec21140 attach routine return an error rather than panic if no chip is detected (thus allowing for probing). * network/elnk.c: Let elnk bail out if autoneg never completes instead of looping forever. Avoid divide by zero (crashed my PC). * network/if_fxp.c: Enable more fxp chip variants but warn that they are UNTESTED.
This commit is contained in:
@@ -1,3 +1,14 @@
|
|||||||
|
2004-05-21 Till Strauman <strauman@slac.stanford.edu>
|
||||||
|
|
||||||
|
* PR/625/networking
|
||||||
|
* network/dec21140.c: Prevent name clashes by making 'ld_le32()' etc.
|
||||||
|
static inlines. Let dec21140 attach routine return an error rather
|
||||||
|
than panic if no chip is detected (thus allowing for probing).
|
||||||
|
* network/elnk.c: Let elnk bail out if autoneg never completes
|
||||||
|
instead of looping forever. Avoid divide by zero (crashed my PC).
|
||||||
|
* network/if_fxp.c: Enable more fxp chip variants but warn that
|
||||||
|
they are UNTESTED.
|
||||||
|
|
||||||
2003-09-26 Cedric Aubert <cedric_aubert@yahoo.fr>
|
2003-09-26 Cedric Aubert <cedric_aubert@yahoo.fr>
|
||||||
|
|
||||||
PR 499/rtems_misc
|
PR 499/rtems_misc
|
||||||
|
|||||||
@@ -243,12 +243,12 @@ extern void Wait_X_ms( unsigned int timeToWait );
|
|||||||
#define rtems_bsp_delay_in_bus_cycles(cycle) Wait_X_ms( cycle/100 )
|
#define rtems_bsp_delay_in_bus_cycles(cycle) Wait_X_ms( cycle/100 )
|
||||||
#define CPU_CACHE_ALIGNMENT_FOR_BUFFER PG_SIZE
|
#define CPU_CACHE_ALIGNMENT_FOR_BUFFER PG_SIZE
|
||||||
|
|
||||||
inline void st_le32(volatile unsigned32 *addr, unsigned32 value)
|
static inline void st_le32(volatile unsigned32 *addr, unsigned32 value)
|
||||||
{
|
{
|
||||||
*(addr)=value ;
|
*(addr)=value ;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline unsigned32 ld_le32(volatile unsigned32 *addr)
|
static inline unsigned32 ld_le32(volatile unsigned32 *addr)
|
||||||
{
|
{
|
||||||
return(*addr);
|
return(*addr);
|
||||||
}
|
}
|
||||||
@@ -1061,7 +1061,10 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
|
|||||||
if ( diag == PCIB_ERR_SUCCESS)
|
if ( diag == PCIB_ERR_SUCCESS)
|
||||||
printk( "DEC/Intel 21143 PCI network card found\n" );
|
printk( "DEC/Intel 21143 PCI network card found\n" );
|
||||||
else
|
else
|
||||||
rtems_panic("DEC PCI network card not found !!\n");
|
{
|
||||||
|
printk("No DEC/Intel 21140/3 PCI network card found !!\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(__PPC)
|
#if defined(__PPC)
|
||||||
|
|||||||
@@ -204,12 +204,12 @@ extern void Wait_X_ms( unsigned int timeToWait );
|
|||||||
#define rtems_bsp_delay_in_bus_cycles(cycle) Wait_X_ms( cycle/100 )
|
#define rtems_bsp_delay_in_bus_cycles(cycle) Wait_X_ms( cycle/100 )
|
||||||
#define CPU_CACHE_ALIGNMENT_FOR_BUFFER PG_SIZE
|
#define CPU_CACHE_ALIGNMENT_FOR_BUFFER PG_SIZE
|
||||||
|
|
||||||
inline void st_le32(volatile unsigned32 *addr, unsigned32 value)
|
static inline void st_le32(volatile unsigned32 *addr, unsigned32 value)
|
||||||
{
|
{
|
||||||
*(addr)=value ;
|
*(addr)=value ;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline unsigned32 ld_le32(volatile unsigned32 *addr)
|
static inline unsigned32 ld_le32(volatile unsigned32 *addr)
|
||||||
{
|
{
|
||||||
return(*addr);
|
return(*addr);
|
||||||
}
|
}
|
||||||
@@ -2669,7 +2669,9 @@ elnk_init (void *arg)
|
|||||||
xl_miibus_writereg(sc, 0x18, MII_ANAR, ANAR_10 | ANAR_TX | ANAR_10_FD | ANAR_TX_FD ); /* ANAR_T4 */
|
xl_miibus_writereg(sc, 0x18, MII_ANAR, ANAR_10 | ANAR_TX | ANAR_10_FD | ANAR_TX_FD ); /* ANAR_T4 */
|
||||||
xl_miibus_writereg(sc, 0x18, MII_BMCR, BMCR_STARTNEG | BMCR_AUTOEN );
|
xl_miibus_writereg(sc, 0x18, MII_BMCR, BMCR_STARTNEG | BMCR_AUTOEN );
|
||||||
|
|
||||||
while( ((sr = xl_miibus_readreg(sc, 0x18, MII_BMSR)) & BMSR_ACOMP) == 0 );
|
|
||||||
|
for (i=0; ((sr = xl_miibus_readreg(sc, 0x18, MII_BMSR)) & BMSR_ACOMP) == 0 && i < 20; i++)
|
||||||
|
DELAY(10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2997,7 +2999,7 @@ elnk_stats (struct elnk_softc *sc)
|
|||||||
printf(" interrupts:%-9d txcmp_ints:%-5d avg_chain_len:%-4d\n",
|
printf(" interrupts:%-9d txcmp_ints:%-5d avg_chain_len:%-4d\n",
|
||||||
sc->xl_stats.device_interrupts,
|
sc->xl_stats.device_interrupts,
|
||||||
sc->xl_stats.txcomplete_ints,
|
sc->xl_stats.txcomplete_ints,
|
||||||
(totalLengths / numLengths) );
|
numLengths ? (totalLengths / numLengths) : -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(" carrier_lost:%-5d sqe_errs:%-5d\n",
|
printf(" carrier_lost:%-5d sqe_errs:%-5d\n",
|
||||||
@@ -3120,8 +3122,6 @@ struct el_boards
|
|||||||
int pbus,pdev,pfun, vid, did, tindex;
|
int pbus,pdev,pfun, vid, did, tindex;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Attach an ELNK driver to the system
|
* Attach an ELNK driver to the system
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -182,8 +182,11 @@ static u_char fxp_cb_config_template[] = {
|
|||||||
struct fxp_ident {
|
struct fxp_ident {
|
||||||
u_int16_t devid;
|
u_int16_t devid;
|
||||||
char *name;
|
char *name;
|
||||||
|
int warn;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define UNTESTED 1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Claim various Intel PCI device identifiers for this driver. The
|
* Claim various Intel PCI device identifiers for this driver. The
|
||||||
* sub-vendor and sub-device field are extensively used to identify
|
* sub-vendor and sub-device field are extensively used to identify
|
||||||
@@ -191,28 +194,19 @@ struct fxp_ident {
|
|||||||
* them.
|
* them.
|
||||||
*/
|
*/
|
||||||
static struct fxp_ident fxp_ident_table[] = {
|
static struct fxp_ident fxp_ident_table[] = {
|
||||||
#ifdef NOTUSED
|
{ 0x1229, "Intel Pro 10/100B/100+ Ethernet", UNTESTED },
|
||||||
/* currently untested */
|
{ 0x2449, "Intel Pro/100 Ethernet", UNTESTED },
|
||||||
{ 0x1229, "Intel Pro 10/100B/100+ Ethernet" },
|
{ 0x1209, "Intel Embedded 10/100 Ethernet", 0 },
|
||||||
{ 0x2449, "Intel Pro/100 Ethernet" },
|
{ 0x1029, "Intel Pro/100 Ethernet", UNTESTED },
|
||||||
#endif
|
{ 0x1030, "Intel Pro/100 Ethernet", 0 },
|
||||||
{ 0x1209, "Intel Embedded 10/100 Ethernet" },
|
{ 0x1031, "Intel Pro/100 Ethernet", UNTESTED },
|
||||||
#ifdef NOTUSED
|
{ 0x1032, "Intel Pro/100 Ethernet", UNTESTED },
|
||||||
/* currently untested */
|
{ 0x1033, "Intel Pro/100 Ethernet", UNTESTED },
|
||||||
{ 0x1029, "Intel Pro/100 Ethernet" },
|
{ 0x1034, "Intel Pro/100 Ethernet", UNTESTED },
|
||||||
#endif
|
{ 0x1035, "Intel Pro/100 Ethernet", UNTESTED },
|
||||||
{ 0x1030, "Intel Pro/100 Ethernet" },
|
{ 0x1036, "Intel Pro/100 Ethernet", UNTESTED },
|
||||||
#ifdef NOTUSED
|
{ 0x1037, "Intel Pro/100 Ethernet", UNTESTED },
|
||||||
/* currently untested */
|
{ 0x1038, "Intel Pro/100 Ethernet", UNTESTED },
|
||||||
{ 0x1031, "Intel Pro/100 Ethernet" },
|
|
||||||
{ 0x1032, "Intel Pro/100 Ethernet" },
|
|
||||||
{ 0x1033, "Intel Pro/100 Ethernet" },
|
|
||||||
{ 0x1034, "Intel Pro/100 Ethernet" },
|
|
||||||
{ 0x1035, "Intel Pro/100 Ethernet" },
|
|
||||||
{ 0x1036, "Intel Pro/100 Ethernet" },
|
|
||||||
{ 0x1037, "Intel Pro/100 Ethernet" },
|
|
||||||
{ 0x1038, "Intel Pro/100 Ethernet" },
|
|
||||||
#endif
|
|
||||||
{ 0, NULL },
|
{ 0, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -473,10 +467,15 @@ rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
|
|||||||
DBGLVL_PRINTK(2,"fxp_attach: find_devid returned %d "
|
DBGLVL_PRINTK(2,"fxp_attach: find_devid returned %d "
|
||||||
"and pci signature 0x%x\n",
|
"and pci signature 0x%x\n",
|
||||||
i,sc->pci_signature);
|
i,sc->pci_signature);
|
||||||
if (PCIB_ERR_SUCCESS == i)
|
if (PCIB_ERR_SUCCESS == i) {
|
||||||
|
if ( UNTESTED == fxp_ident_table[j].warn ) {
|
||||||
|
device_printf(dev,"WARNING: this chip version has NOT been reported to work under RTEMS yet.\n");
|
||||||
|
device_printf(dev," If it works OK, report it as tested in 'c/src/libchip/network/if_fxp.c'\n");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIXME: add search for more device types...
|
* FIXME: add search for more device types...
|
||||||
|
|||||||
Reference in New Issue
Block a user