Bladeren bron

Obsoleted by new device probing mechanism.

tags/v0.9.3
Michael Brown 19 jaren geleden
bovenliggende
commit
5e807dffe6
2 gewijzigde bestanden met toevoegingen van 0 en 136 verwijderingen
  1. 0
    66
      src/core/isa_probe.c
  2. 0
    70
      src/core/pci_probe.c

+ 0
- 66
src/core/isa_probe.c Bestand weergeven

@@ -1,66 +0,0 @@
1
-#ifdef CONFIG_ISA
2
-/*
3
- * This program is free software; you can redistribute it and/or
4
- * modify it under the terms of the GNU General Public License as
5
- * published by the Free Software Foundation; either version 2, or (at
6
- * your option) any later version.
7
- */
8
-
9
-#include	"etherboot.h"
10
-#include	"nic.h"
11
-#include	"isa.h"
12
-
13
-void isa_enumerate(void)
14
-{
15
-	const struct isa_driver *driver;
16
-	for(driver = isa_drivers; driver < isa_drivers_end; driver++) {
17
-		printf("%s ", driver->name);
18
-	}
19
-
20
-}
21
-
22
-int isa_probe(struct dev *dev, const char *type_name)
23
-{
24
-/*
25
- *	NIC probing is in the order the drivers were linked togeter.
26
- *	If for some reason you want to change the order,
27
- *	just change the order you list the drivers in.
28
- */
29
-	struct isa_probe_state *state = &dev->state.isa;
30
-	printf("Probing isa %s...\n", type_name);
31
-	if (dev->how_probe == PROBE_FIRST) {
32
-		state->advance = 0;
33
-		state->driver  = isa_drivers;
34
-		dev->index     = -1;
35
-	}
36
-	for(;;)
37
-	{
38
-		if ((dev->how_probe != PROBE_AWAKE) && state->advance) {
39
-			state->driver++;
40
-			dev->index = -1;
41
-		}
42
-		state->advance = 1;
43
-		
44
-		if (state->driver >= isa_drivers_end)
45
-			break;
46
-
47
-		if (state->driver->type != dev->type)
48
-			continue;
49
-
50
-		if (dev->how_probe != PROBE_AWAKE) {
51
-			dev->type_index++;
52
-		}
53
-		printf("[%s]", state->driver->name);
54
-		dev->devid.bus_type = ISA_BUS_TYPE;
55
-		/* FIXME how do I handle dev->index + PROBE_AGAIN?? */
56
-		/* driver will fill in vendor and device IDs */
57
-		if (state->driver->probe(dev, state->driver->ioaddrs)) {
58
-			state->advance = (dev->index == -1);
59
-			return PROBE_WORKED;
60
-		}
61
-		putchar('\n');
62
-	}
63
-	return PROBE_FAILED;
64
-}
65
-
66
-#endif

+ 0
- 70
src/core/pci_probe.c Bestand weergeven

@@ -1,70 +0,0 @@
1
-#ifdef CONFIG_PCI
2
-/*
3
- * This program is free software; you can redistribute it and/or
4
- * modify it under the terms of the GNU General Public License as
5
- * published by the Free Software Foundation; either version 2, or (at
6
- * your option) any later version.
7
- */
8
-
9
-#include	"etherboot.h"
10
-#include	"nic.h"
11
-#include	"pci.h"
12
-
13
-void pci_enumerate(void)
14
-{
15
-	const struct pci_driver *driver;
16
-	for(driver = pci_drivers; driver < pci_drivers_end; driver++) {
17
-		printf("%s ", driver->name);
18
-	}
19
-}
20
-
21
-int pci_probe(struct dev *dev, const char *type_name)
22
-{
23
-/*
24
- *	NIC probing is in pci device order, followed by the 
25
- *      link order of the drivers.  A driver that matches 
26
- *      on vendor and device id will supersede a driver
27
- *      that matches on pci class.
28
- *
29
- *	If you want to probe for another device behind the same pci
30
- *      device just increment index.  And the previous probe call
31
- *      will be repeated.
32
- */
33
-	struct pci_probe_state *state = &dev->state.pci;
34
-	printf("Probing pci %s...\n", type_name);
35
-	if (dev->how_probe == PROBE_FIRST) {
36
-		state->advance    = 1;
37
-		state->dev.driver = 0;
38
-		state->dev.bus    = 0;
39
-		state->dev.devfn  = 0;
40
-		dev->index        = -1;
41
-	}
42
-	for(;;) {
43
-		if ((dev->how_probe != PROBE_AWAKE) && state->advance) {
44
-			find_pci(dev->type, &state->dev);
45
-			dev->index = -1;
46
-		}
47
-		state->advance = 1;
48
-		
49
-		if (state->dev.driver == 0)
50
-			break;
51
-		
52
-		if (dev->how_probe != PROBE_AWAKE) {
53
-			dev->type_index++;
54
-		}
55
-		dev->devid.bus_type = PCI_BUS_TYPE;
56
-		dev->devid.vendor_id = htons(state->dev.vendor);
57
-		dev->devid.device_id = htons(state->dev.dev_id);
58
-		/* FIXME how do I handle dev->index + PROBE_AGAIN?? */
59
-		
60
-		printf("[%s]", state->dev.name);
61
-		if (state->dev.driver->probe(dev, &state->dev)) {
62
-			state->advance = (dev->index == -1);
63
-			return PROBE_WORKED;
64
-		}
65
-		putchar('\n');
66
-	}
67
-	return PROBE_FAILED;
68
-}
69
-
70
-#endif

Laden…
Annuleren
Opslaan