[davicom] Use iPXE debugging infrastructure
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
ae34edbd3b
commit
24403fba6e
|
@ -48,9 +48,6 @@ FILE_LICENCE ( GPL_ANY );
|
||||||
#include <ipxe/pci.h>
|
#include <ipxe/pci.h>
|
||||||
#include <ipxe/ethernet.h>
|
#include <ipxe/ethernet.h>
|
||||||
|
|
||||||
#undef DAVICOM_DEBUG
|
|
||||||
#undef DAVICOM_DEBUG_WHERE
|
|
||||||
|
|
||||||
#define TX_TIME_OUT 2*TICKS_PER_SEC
|
#define TX_TIME_OUT 2*TICKS_PER_SEC
|
||||||
|
|
||||||
/* Register offsets for davicom device */
|
/* Register offsets for davicom device */
|
||||||
|
@ -163,9 +160,6 @@ static void davicom_transmit(struct nic *nic, const char *d, unsigned int t,
|
||||||
unsigned int s, const char *p);
|
unsigned int s, const char *p);
|
||||||
static int davicom_poll(struct nic *nic, int retrieve);
|
static int davicom_poll(struct nic *nic, int retrieve);
|
||||||
static void davicom_disable(struct nic *nic);
|
static void davicom_disable(struct nic *nic);
|
||||||
#ifdef DAVICOM_DEBUG
|
|
||||||
static void davicom_more(void);
|
|
||||||
#endif /* DAVICOM_DEBUG */
|
|
||||||
static void davicom_wait(unsigned int nticks);
|
static void davicom_wait(unsigned int nticks);
|
||||||
static int phy_read(int);
|
static int phy_read(int);
|
||||||
static void phy_write(int, u16);
|
static void phy_write(int, u16);
|
||||||
|
@ -179,21 +173,10 @@ static void davicom_media_chk(struct nic *);
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
static inline void whereami(const char *str)
|
static inline void whereami(const char *str)
|
||||||
{
|
{
|
||||||
printf("%s\n", str);
|
DBGP("%s\n", str);
|
||||||
/* sleep(2); */
|
/* sleep(2); */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DAVICOM_DEBUG
|
|
||||||
static void davicom_more()
|
|
||||||
{
|
|
||||||
printf("\n\n-- more --");
|
|
||||||
while (!iskey())
|
|
||||||
/* wait */;
|
|
||||||
getchar();
|
|
||||||
printf("\n\n");
|
|
||||||
}
|
|
||||||
#endif /* DAVICOM_DEBUG */
|
|
||||||
|
|
||||||
static void davicom_wait(unsigned int nticks)
|
static void davicom_wait(unsigned int nticks)
|
||||||
{
|
{
|
||||||
unsigned int to = currticks() + nticks;
|
unsigned int to = currticks() + nticks;
|
||||||
|
@ -519,16 +502,14 @@ static void davicom_reset(struct nic *nic)
|
||||||
/* wait */ ;
|
/* wait */ ;
|
||||||
|
|
||||||
if (currticks() >= to) {
|
if (currticks() >= to) {
|
||||||
printf ("TX Setup Timeout!\n");
|
DBG ("TX Setup Timeout!\n");
|
||||||
}
|
}
|
||||||
/* Point to next TX descriptor */
|
/* Point to next TX descriptor */
|
||||||
TxPtr = (++TxPtr >= NTXD) ? 0:TxPtr; /* Sten 10/9 */
|
TxPtr = (++TxPtr >= NTXD) ? 0:TxPtr; /* Sten 10/9 */
|
||||||
|
|
||||||
#ifdef DAVICOM_DEBUG
|
DBG("txd.status = %lX\n", txd[TxPtr].status);
|
||||||
printf("txd.status = %X\n", txd.status);
|
DBG("ticks = %ld\n", currticks() - (to - TX_TIME_OUT));
|
||||||
printf("ticks = %d\n", currticks() - (to - TX_TIME_OUT));
|
DBG_MORE();
|
||||||
davicom_more();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* enable RX */
|
/* enable RX */
|
||||||
outl(inl(ioaddr + CSR6) | 0x00000002, ioaddr + CSR6);
|
outl(inl(ioaddr + CSR6) | 0x00000002, ioaddr + CSR6);
|
||||||
|
@ -570,7 +551,7 @@ static void davicom_transmit(struct nic *nic, const char *d, unsigned int t,
|
||||||
/* wait */ ;
|
/* wait */ ;
|
||||||
|
|
||||||
if (currticks() >= to) {
|
if (currticks() >= to) {
|
||||||
printf ("TX Timeout!\n");
|
DBG ("TX Timeout!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Point to next TX descriptor */
|
/* Point to next TX descriptor */
|
||||||
|
|
Reference in New Issue