david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Legacy drivers cannot cope with multiple active devices.

This commit is contained in:
Michael Brown 2006-06-08 15:18:27 +00:00
parent fdf62528ca
commit 1697c78848
1 changed files with 7 additions and 0 deletions

View File

@ -18,6 +18,8 @@
struct nic nic;
static int legacy_registered = 0;
static int legacy_transmit ( struct net_device *netdev, struct pk_buff *pkb ) {
struct nic *nic = netdev->priv;
struct ethhdr *ethhdr = pkb->data;
@ -58,6 +60,9 @@ int legacy_probe ( struct pci_device *pci,
void ( * disable ) ( struct nic *nic ) ) {
struct net_device *netdev;
int rc;
if ( legacy_registered )
return -EBUSY;
netdev = alloc_etherdev ( 0 );
if ( ! netdev )
@ -84,6 +89,7 @@ int legacy_probe ( struct pci_device *pci,
/* Do not remove this message */
printf ( "WARNING: Using legacy NIC wrapper\n" );
legacy_registered = 1;
return 0;
}
@ -95,6 +101,7 @@ void legacy_remove ( struct pci_device *pci,
unregister_netdev ( netdev );
disable ( nic );
free_netdev ( netdev );
legacy_registered = 0;
}
void pci_fill_nic ( struct nic *nic, struct pci_device *pci ) {