Browse Source

Updated to current API

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
a713813596
1 changed files with 8 additions and 10 deletions
  1. 8
    10
      src/drivers/net/pnic.c

+ 8
- 10
src/drivers/net/pnic.c View File

@@ -176,7 +176,8 @@ static void pnic_transmit ( struct nic *nic, const char *dest,
176 176
 /**************************************************************************
177 177
 DISABLE - Turn off ethernet interface
178 178
 ***************************************************************************/
179
-static void pnic_disable ( struct nic *nic ) {
179
+static void pnic_disable ( struct nic *nic, struct pci_device *pci __unused ) {
180
+	nic_disable ( nic );
180 181
 	pnic_command ( nic, PNIC_CMD_RESET, NULL, 0, NULL, 0, NULL );
181 182
 }
182 183
 
@@ -208,21 +209,17 @@ static struct nic_operations pnic_operations = {
208 209
 	.poll		= pnic_poll,
209 210
 	.transmit	= pnic_transmit,
210 211
 	.irq		= pnic_irq,
211
-	.disable        = pnic_disable,
212 212
 };
213 213
 
214 214
 /**************************************************************************
215 215
 PROBE - Look for an adapter, this routine's visible to the outside
216 216
 ***************************************************************************/
217
-
218
-static int pnic_probe ( struct dev *dev, struct pci_device *pci ) {
219
-	struct nic *nic = nic_device ( dev );
217
+static int pnic_probe ( struct nic *nic, struct pci_device *pci ) {
220 218
 	uint16_t api_version;
221 219
 	uint16_t status;
222 220
 
223 221
 	/* Retrieve relevant information about PCI device */
224
-	nic->ioaddr = pci->ioaddr;
225
-	nic->irqno = pci->irq;
222
+	pci_fill_nic ( nic, pci );
226 223
 
227 224
 	/* API version check */
228 225
 	status = pnic_command_quiet( nic, PNIC_CMD_API_VER, NULL, 0,
@@ -249,7 +246,8 @@ static struct pci_id pnic_nics[] = {
249 246
 PCI_ROM ( 0xfefe, 0xefef, "pnic", "Bochs Pseudo NIC Adaptor" ),
250 247
 };
251 248
 
252
-static struct pci_driver pnic_driver =
253
-	PCI_DRIVER ( "PNIC", pnic_nics, PCI_NO_CLASS );
249
+static struct pci_driver_info pnic_driver =
250
+	PCI_DRIVER ( pnic_nics, PCI_NO_CLASS );
254 251
 
255
-BOOT_DRIVER ( "PNIC", find_pci_boot_device, pnic_driver, pnic_probe );
252
+DRIVER ( "PNIC", nic_driver, pci_driver, pnic_driver,
253
+	 pnic_probe, pnic_disable );

Loading…
Cancel
Save