Browse Source

[3c90x] More fine-grained debugging levels

DBG is reserved for errors and important warnings only.
DBG2 for additional information, e.g. "received packet".
DBGP is used to print the name of every function as it is called.

Signed-off-by: Thomas Miletich<thomas.miletich@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Thomas Miletich 13 years ago
parent
commit
db331b535a
1 changed files with 23 additions and 23 deletions
  1. 23
    23
      src/drivers/net/3c90x.c

+ 23
- 23
src/drivers/net/3c90x.c View File

@@ -205,7 +205,7 @@ static void a3c90x_reset(struct INF_3C90X *inf_3c90x)
205 205
 {
206 206
 	DBGP("a3c90x_reset\n");
207 207
 	/* Send the reset command to the card */
208
-	DBG("3c90x: Issuing RESET\n");
208
+	DBG2("3c90x: Issuing RESET\n");
209 209
 	a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdGlobalReset, 0);
210 210
 
211 211
 	/* global reset command resets station mask, non-B revision cards
@@ -282,14 +282,14 @@ static void a3c90x_process_tx_packets(struct net_device *netdev)
282 282
 
283 283
 	DBGP("a3c90x_process_tx_packets\n");
284 284
 
285
-	DBG("    tx_cnt: %d\n", p->tx_cnt);
285
+	DBG2("    tx_cnt: %d\n", p->tx_cnt);
286 286
 
287 287
 	while (p->tx_tail != p->tx_cur) {
288 288
 
289 289
 		downlist_ptr = inl(p->IOAddr + regDnListPtr_l);
290 290
 
291
-		DBG("    downlist_ptr: %#08x\n", downlist_ptr);
292
-		DBG("    tx_tail: %d tx_cur: %d\n", p->tx_tail, p->tx_cur);
291
+		DBG2("    downlist_ptr: %#08x\n", downlist_ptr);
292
+		DBG2("    tx_tail: %d tx_cur: %d\n", p->tx_tail, p->tx_cur);
293 293
 
294 294
 		/* NIC is currently working on this tx desc */
295 295
 		if(downlist_ptr == virt_to_bus(p->tx_ring + p->tx_tail))
@@ -297,8 +297,8 @@ static void a3c90x_process_tx_packets(struct net_device *netdev)
297 297
 
298 298
 		netdev_tx_complete(netdev, p->tx_iobuf[p->tx_tail]);
299 299
 
300
-		DBG("transmitted packet\n");
301
-		DBG("    size: %zd\n", iob_len(p->tx_iobuf[p->tx_tail]));
300
+		DBG2("transmitted packet\n");
301
+		DBG2("    size: %zd\n", iob_len(p->tx_iobuf[p->tx_tail]));
302 302
 
303 303
 		p->tx_tail = (p->tx_tail + 1) % TX_RING_SIZE;
304 304
 		p->tx_cnt--;
@@ -397,7 +397,7 @@ static int a3c90x_transmit(struct net_device *netdev,
397 397
 static void a3c90x_prepare_rx_desc(struct INF_3C90X *p, unsigned int index)
398 398
 {
399 399
 	DBGP("a3c90x_prepare_rx_desc\n");
400
-	DBG("Populating rx_desc %d\n", index);
400
+	DBG2("Populating rx_desc %d\n", index);
401 401
 
402 402
 	/* We have to stall the upload engine, so the NIC won't access the
403 403
 	 * rx descriptor while we modify it. There is a way around this
@@ -538,7 +538,7 @@ static void a3c90x_process_rx_packets(struct net_device *netdev)
538 538
 			break;
539 539
 
540 540
 		if (rx_status & upError) {
541
-			DBG("Corrupted packet received\n");
541
+			DBG("Corrupted packet received: %#x\n", rx_status);
542 542
 			netdev_rx_err(netdev, p->rx_iobuf[p->rx_cur],
543 543
 				      -EINVAL);
544 544
 		} else {
@@ -548,8 +548,8 @@ static void a3c90x_process_rx_packets(struct net_device *netdev)
548 548
 			packet_len = rx_status & 0x1FFF;
549 549
 			iob_put(p->rx_iobuf[p->rx_cur], packet_len);
550 550
 
551
-			DBG("received packet\n");
552
-			DBG("    size: %d\n", packet_len);
551
+			DBG2("received packet\n");
552
+			DBG2("    size: %d\n", packet_len);
553 553
 
554 554
 			netdev_rx(netdev, p->rx_iobuf[p->rx_cur]);
555 555
 		}
@@ -588,7 +588,7 @@ static void a3c90x_poll(struct net_device *netdev)
588 588
 	if (int_status & INT_TXCOMPLETE)
589 589
 		outb(0x00, p->IOAddr + regTxStatus_b);
590 590
 
591
-	DBG("poll: status = %#04x\n", raw_status);
591
+	DBG2("poll: status = %#04x\n", raw_status);
592 592
 
593 593
 	a3c90x_process_tx_packets(netdev);
594 594
 
@@ -696,40 +696,40 @@ static void a3c90x_hw_start(struct net_device *netdev)
696 696
 		mopt &= 0x7F;
697 697
 	}
698 698
 
699
-	DBG("Connectors present: ");
699
+	DBG2("Connectors present: ");
700 700
 	c = 0;
701 701
 	linktype = 0x0008;
702 702
 	if (mopt & 0x01) {
703
-		DBG("%s100Base-T4", (c++) ? ", " : "");
703
+		DBG2("%s100Base-T4", (c++) ? ", " : "");
704 704
 		linktype = linkMII;
705 705
 	}
706 706
 	if (mopt & 0x04) {
707
-		DBG("%s100Base-FX", (c++) ? ", " : "");
707
+		DBG2("%s100Base-FX", (c++) ? ", " : "");
708 708
 		linktype = link100BaseFX;
709 709
 	}
710 710
 	if (mopt & 0x10) {
711
-		DBG("%s10Base-2", (c++) ? ", " : "");
711
+		DBG2("%s10Base-2", (c++) ? ", " : "");
712 712
 		linktype = link10Base2;
713 713
 	}
714 714
 	if (mopt & 0x20) {
715
-		DBG("%sAUI", (c++) ? ", " : "");
715
+		DBG2("%sAUI", (c++) ? ", " : "");
716 716
 		linktype = linkAUI;
717 717
 	}
718 718
 	if (mopt & 0x40) {
719
-		DBG("%sMII", (c++) ? ", " : "");
719
+		DBG2("%sMII", (c++) ? ", " : "");
720 720
 		linktype = linkMII;
721 721
 	}
722 722
 	if ((mopt & 0xA) == 0xA) {
723
-		DBG("%s10Base-T / 100Base-TX", (c++) ? ", " : "");
723
+		DBG2("%s10Base-T / 100Base-TX", (c++) ? ", " : "");
724 724
 		linktype = linkAutoneg;
725 725
 	} else if ((mopt & 0xA) == 0x2) {
726
-		DBG("%s100Base-TX", (c++) ? ", " : "");
726
+		DBG2("%s100Base-TX", (c++) ? ", " : "");
727 727
 		linktype = linkAutoneg;
728 728
 	} else if ((mopt & 0xA) == 0x8) {
729
-		DBG("%s10Base-T", (c++) ? ", " : "");
729
+		DBG2("%s10Base-T", (c++) ? ", " : "");
730 730
 		linktype = linkAutoneg;
731 731
 	}
732
-	DBG(".\n");
732
+	DBG2(".\n");
733 733
 
734 734
 	/* Determine transceiver type to use, depending on value stored in
735 735
 	* eeprom 0x16
@@ -760,7 +760,7 @@ static void a3c90x_hw_start(struct net_device *netdev)
760 760
 	cfg &= ~(0xF << 20);
761 761
 	cfg |= (linktype << 20);
762 762
 
763
-	DBG("Setting internal cfg register: 0x%08X (linktype: 0x%02X)\n",
763
+	DBG2("Setting internal cfg register: 0x%08X (linktype: 0x%02X)\n",
764 764
 	    cfg, linktype);
765 765
 
766 766
 	outl(cfg, inf_3c90x->IOAddr + regInternalConfig_3_l);
@@ -911,7 +911,7 @@ static int a3c90x_probe(struct pci_device *pci,
911 911
 		break;
912 912
 	}
913 913
 
914
-	DBG("[3c90x]: found NIC(0x%04X, 0x%04X), isBrev=%d, is3c556=%d\n",
914
+	DBG2("[3c90x]: found NIC(0x%04X, 0x%04X), isBrev=%d, is3c556=%d\n",
915 915
 	    pci->vendor, pci->device, inf_3c90x->isBrev,
916 916
 	    inf_3c90x->is3c556);
917 917
 

Loading…
Cancel
Save