Browse Source

Fixed up PCI-scanning code to use new PCI interface.

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
8fa0e38233
1 changed files with 14 additions and 21 deletions
  1. 14
    21
      src/drivers/net/sis900.c

+ 14
- 21
src/drivers/net/sis900.c View File

@@ -118,14 +118,10 @@ static struct pci_id   pci_isa_bridge_list[] = {
118 118
 		"SIS 85C503/5513 PCI to ISA bridge"},
119 119
 };
120 120
 
121
-static struct pci_driver sis_bridge_driver __pci_driver = {
122
-	.type     = BRIDGE_DRIVER,
123
-	.name     = "",
124
-	.probe    = 0,
125
-	.ids      = pci_isa_bridge_list,
126
-	.id_count = sizeof(pci_isa_bridge_list)/sizeof(pci_isa_bridge_list[0]),
127
-	.class    = 0,
128
-};
121
+
122
+
123
+static struct pci_driver sis_bridge_driver =
124
+	PCI_DRIVER ( "sis_bridge", pci_isa_bridge_list, PCI_NO_CLASS );
129 125
 
130 126
 /* Function Prototypes */
131 127
 
@@ -241,27 +237,22 @@ static int sis630e_get_mac_addr(struct pci_device * pci_dev __unused, struct nic
241 237
 {
242 238
 	u8 reg;
243 239
 	int i;
244
-	struct pci_device	p[1];
240
+	struct pci_device	isa_bridge;
245 241
 
246 242
 	/* find PCI to ISA bridge */
247
-	memset(p, 0, sizeof(p));
248
-	do {
249
-		find_pci(BRIDGE_DRIVER, p);
250
-	} while(p->driver && p->driver != &sis_bridge_driver);
251
-
252
-	/* error on failure */
253
-	if (!p->driver)
243
+	memset(&isa_bridge, 0, sizeof(isa_bridge));
244
+	if ( ! find_pci_device ( &isa_bridge, &sis_bridge_driver ) )
254 245
 	    return 0;
255 246
 
256
-	pcibios_read_config_byte(p->bus,p->devfn, 0x48, &reg);
257
-	pcibios_write_config_byte(p->bus,p->devfn, 0x48, reg | 0x40);
247
+	pci_read_config_byte(&isa_bridge, 0x48, &reg);
248
+	pci_write_config_byte(&isa_bridge, 0x48, reg | 0x40);
258 249
 
259 250
 	for (i = 0; i < ETH_ALEN; i++)
260 251
 	{
261 252
 		outb(0x09 + i, 0x70);
262 253
 		((u8 *)(nic->node_addr))[i] = inb(0x71);
263 254
 	}
264
-	pcibios_write_config_byte(p->bus,p->devfn, 0x48, reg & ~0x40);
255
+	pci_write_config_byte(&isa_bridge, 0x48, reg & ~0x40);
265 256
 
266 257
 	return 1;
267 258
 }
@@ -335,13 +326,13 @@ static int sis900_probe(struct dev *dev, struct pci_device *pci)
335 326
     dev_id  = pci->dev_id;
336 327
 
337 328
     /* wakeup chip */
338
-    pcibios_write_config_dword(pci->bus, pci->devfn, 0x40, 0x00000000);
329
+    pci_write_config_dword(pci, 0x40, 0x00000000);
339 330
 
340 331
     adjust_pci_device(pci);
341 332
 
342 333
     /* get MAC address */
343 334
     ret = 0;
344
-    pcibios_read_config_byte(pci->bus,pci->devfn, PCI_REVISION, &revision);
335
+    pci_read_config_byte(pci, PCI_REVISION, &revision);
345 336
     
346 337
     /* save for use later in sis900_reset() */
347 338
     pci_revision = revision; 
@@ -425,6 +416,8 @@ static int sis900_probe(struct dev *dev, struct pci_device *pci)
425 416
     return 1;
426 417
 }
427 418
 
419
+
420
+
428 421
 
429 422
 /* 
430 423
  * EEPROM Routines:  These functions read and write to EEPROM for 

Loading…
Cancel
Save