Kaynağa Gözat

Legacy drivers cannot cope with multiple active devices.

tags/v0.9.3
Michael Brown 18 yıl önce
ebeveyn
işleme
1697c78848
1 değiştirilmiş dosya ile 7 ekleme ve 0 silme
  1. 7
    0
      src/drivers/net/legacy.c

+ 7
- 0
src/drivers/net/legacy.c Dosyayı Görüntüle

@@ -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 ) {

Loading…
İptal
Kaydet