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
 /**************************************************************************
176
 /**************************************************************************
177
 DISABLE - Turn off ethernet interface
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
 	pnic_command ( nic, PNIC_CMD_RESET, NULL, 0, NULL, 0, NULL );
181
 	pnic_command ( nic, PNIC_CMD_RESET, NULL, 0, NULL, 0, NULL );
181
 }
182
 }
182
 
183
 
208
 	.poll		= pnic_poll,
209
 	.poll		= pnic_poll,
209
 	.transmit	= pnic_transmit,
210
 	.transmit	= pnic_transmit,
210
 	.irq		= pnic_irq,
211
 	.irq		= pnic_irq,
211
-	.disable        = pnic_disable,
212
 };
212
 };
213
 
213
 
214
 /**************************************************************************
214
 /**************************************************************************
215
 PROBE - Look for an adapter, this routine's visible to the outside
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
 	uint16_t api_version;
218
 	uint16_t api_version;
221
 	uint16_t status;
219
 	uint16_t status;
222
 
220
 
223
 	/* Retrieve relevant information about PCI device */
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
 	/* API version check */
224
 	/* API version check */
228
 	status = pnic_command_quiet( nic, PNIC_CMD_API_VER, NULL, 0,
225
 	status = pnic_command_quiet( nic, PNIC_CMD_API_VER, NULL, 0,
249
 PCI_ROM ( 0xfefe, 0xefef, "pnic", "Bochs Pseudo NIC Adaptor" ),
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