|
@@ -18,6 +18,8 @@
|
18
|
18
|
|
19
|
19
|
struct nic nic;
|
20
|
20
|
|
|
21
|
+static int legacy_registered = 0;
|
|
22
|
+
|
21
|
23
|
static int legacy_transmit ( struct net_device *netdev, struct pk_buff *pkb ) {
|
22
|
24
|
struct nic *nic = netdev->priv;
|
23
|
25
|
struct ethhdr *ethhdr = pkb->data;
|
|
@@ -58,6 +60,9 @@ int legacy_probe ( struct pci_device *pci,
|
58
|
60
|
void ( * disable ) ( struct nic *nic ) ) {
|
59
|
61
|
struct net_device *netdev;
|
60
|
62
|
int rc;
|
|
63
|
+
|
|
64
|
+ if ( legacy_registered )
|
|
65
|
+ return -EBUSY;
|
61
|
66
|
|
62
|
67
|
netdev = alloc_etherdev ( 0 );
|
63
|
68
|
if ( ! netdev )
|
|
@@ -84,6 +89,7 @@ int legacy_probe ( struct pci_device *pci,
|
84
|
89
|
/* Do not remove this message */
|
85
|
90
|
printf ( "WARNING: Using legacy NIC wrapper\n" );
|
86
|
91
|
|
|
92
|
+ legacy_registered = 1;
|
87
|
93
|
return 0;
|
88
|
94
|
}
|
89
|
95
|
|
|
@@ -95,6 +101,7 @@ void legacy_remove ( struct pci_device *pci,
|
95
|
101
|
unregister_netdev ( netdev );
|
96
|
102
|
disable ( nic );
|
97
|
103
|
free_netdev ( netdev );
|
|
104
|
+ legacy_registered = 0;
|
98
|
105
|
}
|
99
|
106
|
|
100
|
107
|
void pci_fill_nic ( struct nic *nic, struct pci_device *pci ) {
|