@ -434,7 +434,7 @@ static int pcnet_send(struct eth_device *dev, void *packet, int pkt_len)
/* Wait for completion by testing the OWN bit */
/* Wait for completion by testing the OWN bit */
for ( i = 1000 ; i > 0 ; i - - ) {
for ( i = 1000 ; i > 0 ; i - - ) {
status = le16_to_cpu ( entry - > status ) ;
status = readw ( & entry - > status ) ;
if ( ( status & 0x8000 ) = = 0 )
if ( ( status & 0x8000 ) = = 0 )
break ;
break ;
udelay ( 100 ) ;
udelay ( 100 ) ;
@ -451,11 +451,10 @@ static int pcnet_send(struct eth_device *dev, void *packet, int pkt_len)
* Setup Tx ring . Caution : the write order is important here ,
* Setup Tx ring . Caution : the write order is important here ,
* set the status with the " ownership " bits last .
* set the status with the " ownership " bits last .
*/
*/
status = 0x8300 ;
writew ( - pkt_len , & entry - > length ) ;
entry - > length = cpu_to_le16 ( - pkt_len ) ;
writel ( 0 , & entry - > misc ) ;
entry - > misc = 0x00000000 ;
writel ( PCI_TO_MEM ( dev , packet ) , & entry - > base ) ;
entry - > base = PCI_TO_MEM_LE ( dev , packet ) ;
writew ( 0x8300 , & entry - > status ) ;
entry - > status = cpu_to_le16 ( status ) ;
/* Trigger an immediate send poll. */
/* Trigger an immediate send poll. */
pcnet_write_csr ( dev , 0 , 0x0008 ) ;
pcnet_write_csr ( dev , 0 , 0x0008 ) ;
@ -473,34 +472,34 @@ static int pcnet_recv (struct eth_device *dev)
struct pcnet_rx_head * entry ;
struct pcnet_rx_head * entry ;
unsigned char * buf ;
unsigned char * buf ;
int pkt_len = 0 ;
int pkt_len = 0 ;
u16 status ;
u16 status , err_status ;
while ( 1 ) {
while ( 1 ) {
entry = & lp - > uc - > rx_ring [ lp - > cur_rx ] ;
entry = & lp - > uc - > rx_ring [ lp - > cur_rx ] ;
/*
/*
* If we own the next entry , it ' s a new packet . Send it up .
* If we own the next entry , it ' s a new packet . Send it up .
*/
*/
status = le16_to_cpu ( entry - > status ) ;
status = readw ( & entry - > status ) ;
if ( ( status & 0x8000 ) ! = 0 )
if ( ( status & 0x8000 ) ! = 0 )
break ;
break ;
status > > = 8 ;
err_status = status > > 8 ;
if ( status ! = 0x03 ) { /* There was an error. */
if ( err_ status ! = 0x03 ) { /* There was an error. */
printf ( " %s: Rx%d " , dev - > name , lp - > cur_rx ) ;
printf ( " %s: Rx%d " , dev - > name , lp - > cur_rx ) ;
PCNET_DEBUG1 ( " (status=0x%x) " , status ) ;
PCNET_DEBUG1 ( " (status=0x%x) " , err_ status) ;
if ( status & 0x20 )
if ( err_ status & 0x20 )
printf ( " Frame " ) ;
printf ( " Frame " ) ;
if ( status & 0x10 )
if ( err_ status & 0x10 )
printf ( " Overflow " ) ;
printf ( " Overflow " ) ;
if ( status & 0x08 )
if ( err_ status & 0x08 )
printf ( " CRC " ) ;
printf ( " CRC " ) ;
if ( status & 0x04 )
if ( err_ status & 0x04 )
printf ( " Fifo " ) ;
printf ( " Fifo " ) ;
printf ( " Error \n " ) ;
printf ( " Error \n " ) ;
entry - > status & = le16_to_cpu ( 0x03ff ) ;
status & = 0x03ff ;
} else {
} else {
pkt_len = ( le32_to_cpu ( entry - > msg_length ) & 0xfff ) - 4 ;
pkt_len = ( readl ( & entry - > msg_length ) & 0xfff ) - 4 ;
if ( pkt_len < 60 ) {
if ( pkt_len < 60 ) {
printf ( " %s: Rx%d: invalid packet length %d \n " ,
printf ( " %s: Rx%d: invalid packet length %d \n " ,
dev - > name , lp - > cur_rx , pkt_len ) ;
dev - > name , lp - > cur_rx , pkt_len ) ;
@ -513,7 +512,9 @@ static int pcnet_recv (struct eth_device *dev)
lp - > cur_rx , pkt_len , buf ) ;
lp - > cur_rx , pkt_len , buf ) ;
}
}
}
}
entry - > status | = cpu_to_le16 ( 0x8000 ) ;
status | = 0x8000 ;
writew ( status , & entry - > status ) ;
if ( + + lp - > cur_rx > = RX_RING_SIZE )
if ( + + lp - > cur_rx > = RX_RING_SIZE )
lp - > cur_rx = 0 ;
lp - > cur_rx = 0 ;