unsigned int full_duplex:1; /* is full duplex? */
};
-//#define EDEBUG
-#ifdef EDEBUG
-#define dprintf(x) printf x
-#else
-#define dprintf(x)
-#endif
-
-
/* Set the mtu */
static int mtu = 1514;
duplex = (negotiated & 0x0100) || (negotiated & 0x01C0) == 0x0040;
if (sdc->mii_if.full_duplex != duplex) {
sdc->mii_if.full_duplex = duplex;
- dprintf(("%s: Setting %s-duplex based on MII #%d "
+ DBG ("%s: Setting %s-duplex based on MII #%d "
"negotiated capability %4.4x.\n", sdc->nic_name,
duplex ? "full" : "half", sdc->phys[0],
- negotiated));
+ negotiated );
outw(inw(BASE + MACCtrl0) | duplex ? 0x20 : 0,
BASE + MACCtrl0);
}
txb[4] = nic->node_addr[4];
txb[5] = nic->node_addr[5];
- dprintf(("%s: Done sundance_reset, status: Rx %hX Tx %hX "
- "MAC Control %hX, %hX %hX\n",
- sdc->nic_name, (int) inl(BASE + RxStatus),
- (int) inw(BASE + TxStatus), (int) inl(BASE + MACCtrl0),
- (int) inw(BASE + MACCtrl1), (int) inw(BASE + MACCtrl0)));
+ DBG ( "%s: Done sundance_reset, status: Rx %hX Tx %hX "
+ "MAC Control %hX, %hX %hX\n",
+ sdc->nic_name, (int) inl(BASE + RxStatus),
+ (int) inw(BASE + TxStatus), (int) inl(BASE + MACCtrl0),
+ (int) inw(BASE + MACCtrl1), (int) inw(BASE + MACCtrl0) );
}
/**************************************************************************
pkt_len = frame_status & 0x1fff;
if (frame_status & 0x001f4000) {
- dprintf(("Polling frame_status error\n")); /* Do we really care about this */
+ DBG ( "Polling frame_status error\n" ); /* Do we really care about this */
} else {
if (pkt_len < rx_copybreak) {
/* FIXME: What should happen Will this ever occur */
sdc->mtu = mtu;
pci_read_config_byte(pci, PCI_REVISION_ID, &sdc->pci_rev_id);
- dprintf(("Device revision id: %hx\n", sdc->pci_rev_id));
+
+ DBG ( "Device revision id: %hx\n", sdc->pci_rev_id );
+
/* Print out some hardware info */
- printf("%s: %! at ioaddr %hX, ", pci->name, nic->node_addr, BASE);
+ DBG ( "%s: %s at ioaddr %hX, ", pci->name, nic->node_addr, BASE);
+
sdc->mii_preamble_required = 0;
if (1) {
int phy, phy_idx = 0;
mdio_read(nic, phy, MII_ADVERTISE);
if ((mii_status & 0x0040) == 0)
sdc->mii_preamble_required++;
- dprintf
- (("%s: MII PHY found at address %d, status " "%hX advertising %hX\n", sdc->nic_name, phy, mii_status, sdc->mii_if.advertising));
+ DBG
+ ( "%s: MII PHY found at address %d, status " "%hX advertising %hX\n", sdc->nic_name, phy, mii_status, sdc->mii_if.advertising );
}
}
sdc->mii_preamble_required--;
}
/* Reset the chip to erase previous misconfiguration */
- dprintf(("ASIC Control is %x.\n", inl(BASE + ASICCtrl)));
+ DBG ( "ASIC Control is %#lx\n", inl(BASE + ASICCtrl) );
outw(0x007f, BASE + ASICCtrl + 2);
- dprintf(("ASIC Control is now %x.\n", inl(BASE + ASICCtrl)));
+ DBG ( "ASIC Control is now %#lx.\n", inl(BASE + ASICCtrl) );
sundance_reset(nic);
if (sdc->an_enable) {
#include "etherboot.h"
#include "nic.h"
#include <gpxe/pci.h>
+#include <gpxe/ethernet.h>
#include "timer.h"
#include "string.h"
#include "tg3.h"
}
if (i == MAX_WAIT_CNT) {
- printf("tg3_stop_block timed out, ofs=%lx enable_bit=%x\n",
- ofs, enable_bit);
+ printf( "tg3_stop_block timed out, ofs=%#lx enable_bit=%3lx\n",
+ ofs, enable_bit );
return -ENODEV;
}
}
if (i >= 100000 &&
!(tp->tg3_flags2 & TG3_FLG2_SUN_5704)) {
- printf("Firmware will not restart magic=%x\n",
- val);
+ printf ( "Firmware will not restart magic=%#lx\n",
+ val );
return -ENODEV;
}
if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) {
printf("Could not obtain valid ethernet address, aborting.\n");
goto err_out_iounmap;
}
- printf("Ethernet addr: %!\n", nic->node_addr);
+
+ DBG ( "Ethernet addr: %s\n", eth_ntoa ( nic->node_addr ) );
tg3_setup_dma(tp);