mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 05:21:49 +03:00
Added net device TX queue; this will be needed to support the PXE UNDI API
(which will need us to wait for TX completions). Added debug autocolourisation to netdevice.c
This commit is contained in:
@@ -34,7 +34,7 @@ static int legacy_transmit ( struct net_device *netdev, struct pk_buff *pkb ) {
|
||||
nic->nic_op->transmit ( nic, ( const char * ) ethhdr->h_dest,
|
||||
ntohs ( ethhdr->h_protocol ),
|
||||
pkb_len ( pkb ), pkb->data );
|
||||
free_pkb ( pkb );
|
||||
netdev_tx_complete ( netdev, pkb );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ static int pnic_transmit ( struct net_device *netdev, struct pk_buff *pkb ) {
|
||||
pnic_command ( pnic, PNIC_CMD_XMIT, pkb->data, pkb_len ( pkb ),
|
||||
NULL, 0, NULL );
|
||||
|
||||
free_pkb ( pkb );
|
||||
netdev_tx_complete ( netdev, pkb );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ static void rtl_reset ( struct rtl8139_nic *rtl ) {
|
||||
/* Reset chip */
|
||||
outb ( CmdReset, rtl->ioaddr + ChipCmd );
|
||||
mdelay ( 10 );
|
||||
rtl->tx.next = 0;
|
||||
memset ( &rtl->tx, 0, sizeof ( rtl->tx ) );
|
||||
rtl->rx.offset = 0;
|
||||
}
|
||||
|
||||
@@ -349,7 +349,6 @@ static int rtl_open ( struct net_device *netdev ) {
|
||||
*/
|
||||
static void rtl_close ( struct net_device *netdev ) {
|
||||
struct rtl8139_nic *rtl = netdev->priv;
|
||||
int i;
|
||||
|
||||
/* Reset the hardware to disable everything in one go */
|
||||
rtl_reset ( rtl );
|
||||
@@ -357,15 +356,6 @@ static void rtl_close ( struct net_device *netdev ) {
|
||||
/* Free RX ring */
|
||||
free ( rtl->rx.ring );
|
||||
rtl->rx.ring = NULL;
|
||||
|
||||
/* Free any old TX buffers that hadn't yet completed */
|
||||
for ( i = 0 ; i < TX_RING_SIZE ; i++ ) {
|
||||
if ( rtl->tx.pkb[i] ) {
|
||||
free_pkb ( rtl->tx.pkb[i] );
|
||||
rtl->tx.pkb[i] = NULL;
|
||||
DBG ( "TX id %d discarded\n", i );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -383,7 +373,6 @@ static int rtl_transmit ( struct net_device *netdev, struct pk_buff *pkb ) {
|
||||
/* Check for space in TX ring */
|
||||
if ( rtl->tx.pkb[rtl->tx.next] != NULL ) {
|
||||
printf ( "TX overflow\n" );
|
||||
free_pkb ( pkb );
|
||||
return -ENOBUFS;
|
||||
}
|
||||
|
||||
@@ -437,7 +426,7 @@ static void rtl_poll ( struct net_device *netdev ) {
|
||||
for ( i = 0 ; i < TX_RING_SIZE ; i++ ) {
|
||||
if ( ( rtl->tx.pkb[i] != NULL ) && ( tsad & ( 1 << i ) ) ) {
|
||||
DBG ( "TX id %d complete\n", i );
|
||||
free_pkb ( rtl->tx.pkb[i] );
|
||||
netdev_tx_complete ( netdev, rtl->tx.pkb[i] );
|
||||
rtl->tx.pkb[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user