2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-12-04 02:24:35 +00:00

[rtl8139] Split debug messages into DBGLVL_LOG and DBGLVL_EXTRA

This commit is contained in:
Michael Brown 2009-06-23 20:41:44 +01:00
parent 198ae0a131
commit ded4d3a703

View File

@ -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 );
}