|
@@ -22,7 +22,7 @@ static char mca_magic[0]; /* guaranteed unique symbol */
|
22
|
22
|
*
|
23
|
23
|
*/
|
24
|
24
|
static int fill_mca_device ( struct mca_device *mca ) {
|
25
|
|
- unsigned int i;
|
|
25
|
+ unsigned int i, seen_non_ff;
|
26
|
26
|
|
27
|
27
|
/* Make sure motherboard setup is off */
|
28
|
28
|
outb_p ( 0xff, MCA_MOTHERBOARD_SETUP_REG );
|
|
@@ -31,10 +31,19 @@ static int fill_mca_device ( struct mca_device *mca ) {
|
31
|
31
|
outb_p ( 0x8 | ( mca->slot & 0xf ), MCA_ADAPTER_SETUP_REG );
|
32
|
32
|
|
33
|
33
|
/* Read the POS registers */
|
|
34
|
+ seen_non_ff = 0;
|
34
|
35
|
for ( i = 0 ; i < ( sizeof ( mca->pos ) / sizeof ( mca->pos[0] ) ) ;
|
35
|
36
|
i++ ) {
|
36
|
37
|
mca->pos[i] = inb_p ( MCA_POS_REG ( i ) );
|
|
38
|
+ if ( mca->pos[i] != 0xff )
|
|
39
|
+ seen_non_ff = 1;
|
37
|
40
|
}
|
|
41
|
+
|
|
42
|
+ /* If all POS registers are 0xff, this means there's no device
|
|
43
|
+ * present
|
|
44
|
+ */
|
|
45
|
+ if ( ! seen_non_ff )
|
|
46
|
+ return 0;
|
38
|
47
|
|
39
|
48
|
/* Kill all setup modes */
|
40
|
49
|
outb_p ( 0, MCA_ADAPTER_SETUP_REG );
|
|
@@ -64,6 +73,7 @@ int find_mca_device ( struct mca_device *mca, struct mca_driver *driver ) {
|
64
|
73
|
/* Iterate through all possible MCA slots, starting where we
|
65
|
74
|
* left off
|
66
|
75
|
*/
|
|
76
|
+ DBG ( "MCA searching for device matching driver %s\n", driver->name );
|
67
|
77
|
for ( ; mca->slot < MCA_MAX_SLOT_NR ; mca->slot++ ) {
|
68
|
78
|
/* If we've already used this device, skip it */
|
69
|
79
|
if ( mca->already_tried ) {
|
|
@@ -81,8 +91,9 @@ int find_mca_device ( struct mca_device *mca, struct mca_driver *driver ) {
|
81
|
91
|
struct mca_id *id = &driver->ids[i];
|
82
|
92
|
|
83
|
93
|
if ( MCA_ID ( mca ) == id->id ) {
|
84
|
|
- DBG ( "Device %s (driver %s) matches ID %hx\n",
|
85
|
|
- id->name, driver->name, id->id );
|
|
94
|
+ DBG ( "MCA found ID %hx (device %s) "
|
|
95
|
+ "matching driver %s\n",
|
|
96
|
+ id->name, id->id, driver->name );
|
86
|
97
|
mca->name = id->name;
|
87
|
98
|
mca->already_tried = 1;
|
88
|
99
|
return 1;
|
|
@@ -91,6 +102,7 @@ int find_mca_device ( struct mca_device *mca, struct mca_driver *driver ) {
|
91
|
102
|
}
|
92
|
103
|
|
93
|
104
|
/* No device found */
|
|
105
|
+ DBG ( "MCA found no device matching driver %s\n", driver->name );
|
94
|
106
|
mca->slot = 0;
|
95
|
107
|
return 0;
|
96
|
108
|
}
|