From ded4d3a703e42a2d57eb72467fafe8e06f32e40d Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 23 Jun 2009 20:41:44 +0100 Subject: [PATCH] [rtl8139] Split debug messages into DBGLVL_LOG and DBGLVL_EXTRA --- src/drivers/net/rtl8139.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/drivers/net/rtl8139.c b/src/drivers/net/rtl8139.c index 99830d7a..a4ee9692 100644 --- a/src/drivers/net/rtl8139.c +++ b/src/drivers/net/rtl8139.c @@ -279,10 +279,10 @@ static void rtl_init_eeprom ( struct net_device *netdev ) { /* Detect EEPROM type and initialise three-wire device */ ee9356 = ( inw ( rtl->ioaddr + RxConfig ) & Eeprom9356 ); if ( ee9356 ) { - DBG ( "EEPROM is an AT93C56\n" ); + DBGC ( rtl, "rtl8139 %p EEPROM is an AT93C56\n", rtl ); init_at93c56 ( &rtl->eeprom, 16 ); } else { - DBG ( "EEPROM is an AT93C46\n" ); + DBGC ( rtl, "rtl8139 %p EEPROM is an AT93C46\n", rtl ); init_at93c46 ( &rtl->eeprom, 16 ); } rtl->eeprom.bus = &rtl->spibit.bus; @@ -290,7 +290,8 @@ static void rtl_init_eeprom ( struct net_device *netdev ) { /* Initialise space for non-volatile options, if available */ vpd = ( inw ( rtl->ioaddr + Config1 ) & VPDEnable ); if ( vpd ) { - DBG ( "EEPROM in use for VPD; cannot use for options\n" ); + DBGC ( rtl, "rtl8139 %p EEPROM in use for VPD; cannot use " + "for options\n", rtl ); } else { nvo_init ( &rtl->nvo, &rtl->eeprom.nvs, rtl_nvo_fragments, &netdev->refcnt ); @@ -333,7 +334,8 @@ static int rtl_open ( struct net_device *netdev ) { if ( ! rtl->rx.ring ) return -ENOMEM; outl ( virt_to_bus ( rtl->rx.ring ), rtl->ioaddr + RxBuf ); - DBG ( "RX ring at %lx\n", virt_to_bus ( rtl->rx.ring ) ); + DBGC ( rtl, "rtl8139 %p RX ring at %lx\n", + rtl, virt_to_bus ( rtl->rx.ring ) ); /* Enable TX and RX */ outb ( ( CmdRxEnb | CmdTxEnb ), rtl->ioaddr + ChipCmd ); @@ -377,7 +379,7 @@ static int rtl_transmit ( struct net_device *netdev, /* Check for space in TX ring */ if ( rtl->tx.iobuf[rtl->tx.next] != NULL ) { - DBG ( "TX overflow\n" ); + DBGC ( rtl, "rtl8139 %p TX overflow\n", rtl ); return -ENOBUFS; } @@ -385,8 +387,8 @@ static int rtl_transmit ( struct net_device *netdev, iob_pad ( iobuf, ETH_ZLEN ); /* Add to TX ring */ - DBG ( "TX id %d at %lx+%zx\n", rtl->tx.next, - virt_to_bus ( iobuf->data ), iob_len ( iobuf ) ); + DBGC2 ( rtl, "rtl8139 %p TX id %d at %lx+%zx\n", rtl, rtl->tx.next, + virt_to_bus ( iobuf->data ), iob_len ( iobuf ) ); rtl->tx.iobuf[rtl->tx.next] = iobuf; outl ( virt_to_bus ( iobuf->data ), rtl->ioaddr + TxAddr0 + 4 * rtl->tx.next ); @@ -422,7 +424,8 @@ static void rtl_poll ( struct net_device *netdev ) { tsad = inw ( rtl->ioaddr + TxSummary ); for ( i = 0 ; i < TX_RING_SIZE ; i++ ) { if ( ( rtl->tx.iobuf[i] != NULL ) && ( tsad & ( 1 << i ) ) ) { - DBG ( "TX id %d complete\n", i ); + DBGC2 ( rtl, "rtl8139 %p TX id %d complete\n", + rtl, i ); netdev_tx_complete ( netdev, rtl->tx.iobuf[i] ); rtl->tx.iobuf[i] = NULL; } @@ -435,8 +438,8 @@ static void rtl_poll ( struct net_device *netdev ) { rx_len = * ( ( uint16_t * ) ( rtl->rx.ring + rtl->rx.offset + 2 ) ); if ( rx_status & RxOK ) { - DBG ( "RX packet at offset %x+%x\n", rtl->rx.offset, - rx_len ); + DBGC2 ( rtl, "rtl8139 %p RX packet at offset " + "%x+%x\n", rtl, rtl->rx.offset, rx_len ); rx_iob = alloc_iob ( rx_len ); if ( ! rx_iob ) { @@ -458,8 +461,8 @@ static void rtl_poll ( struct net_device *netdev ) { netdev_rx ( netdev, rx_iob ); } else { - DBG ( "RX bad packet (status %#04x len %d)\n", - rx_status, rx_len ); + DBGC ( rtl, "rtl8139 %p RX bad packet (status %#04x " + "len %d)\n", rtl, rx_status, rx_len ); netdev_rx_err ( netdev, NULL, -EINVAL ); } rtl->rx.offset = ( ( ( rtl->rx.offset + 4 + rx_len + 3 ) & ~3 ) @@ -476,7 +479,9 @@ static void rtl_poll ( struct net_device *netdev ) { */ static void rtl_irq ( struct net_device *netdev, int enable ) { struct rtl8139_nic *rtl = netdev->priv; - + + DBGC ( rtl, "rtl8139 %p interrupts %s\n", + rtl, ( enable ? "enabled" : "disabled" ) ); outw ( ( enable ? ( ROK | RER | TOK | TER ) : 0 ), rtl->ioaddr + IntrMask ); }