|
@@ -65,14 +65,6 @@ struct mii_if_info {
|
65
|
65
|
unsigned int full_duplex:1; /* is full duplex? */
|
66
|
66
|
};
|
67
|
67
|
|
68
|
|
-//#define EDEBUG
|
69
|
|
-#ifdef EDEBUG
|
70
|
|
-#define dprintf(x) printf x
|
71
|
|
-#else
|
72
|
|
-#define dprintf(x)
|
73
|
|
-#endif
|
74
|
|
-
|
75
|
|
-
|
76
|
68
|
/* Set the mtu */
|
77
|
69
|
static int mtu = 1514;
|
78
|
70
|
|
|
@@ -319,10 +311,10 @@ static void check_duplex(struct nic *nic)
|
319
|
311
|
duplex = (negotiated & 0x0100) || (negotiated & 0x01C0) == 0x0040;
|
320
|
312
|
if (sdc->mii_if.full_duplex != duplex) {
|
321
|
313
|
sdc->mii_if.full_duplex = duplex;
|
322
|
|
- dprintf(("%s: Setting %s-duplex based on MII #%d "
|
|
314
|
+ DBG ("%s: Setting %s-duplex based on MII #%d "
|
323
|
315
|
"negotiated capability %4.4x.\n", sdc->nic_name,
|
324
|
316
|
duplex ? "full" : "half", sdc->phys[0],
|
325
|
|
- negotiated));
|
|
317
|
+ negotiated );
|
326
|
318
|
outw(inw(BASE + MACCtrl0) | duplex ? 0x20 : 0,
|
327
|
319
|
BASE + MACCtrl0);
|
328
|
320
|
}
|
|
@@ -424,11 +416,11 @@ static void sundance_reset(struct nic *nic)
|
424
|
416
|
txb[4] = nic->node_addr[4];
|
425
|
417
|
txb[5] = nic->node_addr[5];
|
426
|
418
|
|
427
|
|
- dprintf(("%s: Done sundance_reset, status: Rx %hX Tx %hX "
|
428
|
|
- "MAC Control %hX, %hX %hX\n",
|
429
|
|
- sdc->nic_name, (int) inl(BASE + RxStatus),
|
430
|
|
- (int) inw(BASE + TxStatus), (int) inl(BASE + MACCtrl0),
|
431
|
|
- (int) inw(BASE + MACCtrl1), (int) inw(BASE + MACCtrl0)));
|
|
419
|
+ DBG ( "%s: Done sundance_reset, status: Rx %hX Tx %hX "
|
|
420
|
+ "MAC Control %hX, %hX %hX\n",
|
|
421
|
+ sdc->nic_name, (int) inl(BASE + RxStatus),
|
|
422
|
+ (int) inw(BASE + TxStatus), (int) inl(BASE + MACCtrl0),
|
|
423
|
+ (int) inw(BASE + MACCtrl1), (int) inw(BASE + MACCtrl0) );
|
432
|
424
|
}
|
433
|
425
|
|
434
|
426
|
/**************************************************************************
|
|
@@ -477,7 +469,7 @@ static int sundance_poll(struct nic *nic, int retreive)
|
477
|
469
|
pkt_len = frame_status & 0x1fff;
|
478
|
470
|
|
479
|
471
|
if (frame_status & 0x001f4000) {
|
480
|
|
- dprintf(("Polling frame_status error\n")); /* Do we really care about this */
|
|
472
|
+ DBG ( "Polling frame_status error\n" ); /* Do we really care about this */
|
481
|
473
|
} else {
|
482
|
474
|
if (pkt_len < rx_copybreak) {
|
483
|
475
|
/* FIXME: What should happen Will this ever occur */
|
|
@@ -615,9 +607,12 @@ static int sundance_probe ( struct nic *nic, struct pci_device *pci ) {
|
615
|
607
|
sdc->mtu = mtu;
|
616
|
608
|
|
617
|
609
|
pci_read_config_byte(pci, PCI_REVISION_ID, &sdc->pci_rev_id);
|
618
|
|
- dprintf(("Device revision id: %hx\n", sdc->pci_rev_id));
|
|
610
|
+
|
|
611
|
+ DBG ( "Device revision id: %hx\n", sdc->pci_rev_id );
|
|
612
|
+
|
619
|
613
|
/* Print out some hardware info */
|
620
|
|
- printf("%s: %! at ioaddr %hX, ", pci->name, nic->node_addr, BASE);
|
|
614
|
+ DBG ( "%s: %s at ioaddr %hX, ", pci->name, nic->node_addr, BASE);
|
|
615
|
+
|
621
|
616
|
sdc->mii_preamble_required = 0;
|
622
|
617
|
if (1) {
|
623
|
618
|
int phy, phy_idx = 0;
|
|
@@ -631,8 +626,8 @@ static int sundance_probe ( struct nic *nic, struct pci_device *pci ) {
|
631
|
626
|
mdio_read(nic, phy, MII_ADVERTISE);
|
632
|
627
|
if ((mii_status & 0x0040) == 0)
|
633
|
628
|
sdc->mii_preamble_required++;
|
634
|
|
- dprintf
|
635
|
|
- (("%s: MII PHY found at address %d, status " "%hX advertising %hX\n", sdc->nic_name, phy, mii_status, sdc->mii_if.advertising));
|
|
629
|
+ DBG
|
|
630
|
+ ( "%s: MII PHY found at address %d, status " "%hX advertising %hX\n", sdc->nic_name, phy, mii_status, sdc->mii_if.advertising );
|
636
|
631
|
}
|
637
|
632
|
}
|
638
|
633
|
sdc->mii_preamble_required--;
|
|
@@ -695,9 +690,9 @@ static int sundance_probe ( struct nic *nic, struct pci_device *pci ) {
|
695
|
690
|
}
|
696
|
691
|
|
697
|
692
|
/* Reset the chip to erase previous misconfiguration */
|
698
|
|
- dprintf(("ASIC Control is %x.\n", inl(BASE + ASICCtrl)));
|
|
693
|
+ DBG ( "ASIC Control is %#lx\n", inl(BASE + ASICCtrl) );
|
699
|
694
|
outw(0x007f, BASE + ASICCtrl + 2);
|
700
|
|
- dprintf(("ASIC Control is now %x.\n", inl(BASE + ASICCtrl)));
|
|
695
|
+ DBG ( "ASIC Control is now %#lx.\n", inl(BASE + ASICCtrl) );
|
701
|
696
|
|
702
|
697
|
sundance_reset(nic);
|
703
|
698
|
if (sdc->an_enable) {
|