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

Loading…
Cancel
Save