Improved debugging output

pull/1/head
Michael Brown 2005-04-16 10:19:13 +00:00
parent ed7b9109be
commit e1a9798af4
3 changed files with 27 additions and 7 deletions

View File

@ -44,6 +44,7 @@ int find_isa_device ( struct isa_device *isa, struct isa_driver *driver ) {
/* Iterate through any ISA probe addresses specified by /* Iterate through any ISA probe addresses specified by
* config.c, starting where we left off. * config.c, starting where we left off.
*/ */
DBG ( "ISA searching for device matching driver %s\n", driver->name );
for ( i = isa->probe_idx ; i < isa_extra_probe_addr_count ; i++ ) { for ( i = isa->probe_idx ; i < isa_extra_probe_addr_count ; i++ ) {
/* If we've already used this device, skip it */ /* If we've already used this device, skip it */
if ( isa->already_tried ) { if ( isa->already_tried ) {
@ -96,6 +97,7 @@ int find_isa_device ( struct isa_device *isa, struct isa_driver *driver ) {
notfound: notfound:
/* No device found */ /* No device found */
DBG ( "ISA found no device matching driver %s\n", driver->name );
isa->probe_idx = 0; isa->probe_idx = 0;
return 0; return 0;

View File

@ -473,6 +473,8 @@ int find_isapnp_device ( struct isapnp_device *isapnp,
/* Iterate through all possible ISAPNP CSNs, starting where we /* Iterate through all possible ISAPNP CSNs, starting where we
* left off. * left off.
*/ */
DBG ( "ISAPnP searching for device matching driver %s\n",
driver->name );
for ( ; isapnp->csn <= isapnp_max_csn ; isapnp->csn++ ) { for ( ; isapnp->csn <= isapnp_max_csn ; isapnp->csn++ ) {
for ( ; isapnp->logdev <= 0xff ; isapnp->logdev++ ) { for ( ; isapnp->logdev <= 0xff ; isapnp->logdev++ ) {
/* If we've already used this device, skip it */ /* If we've already used this device, skip it */
@ -499,11 +501,14 @@ int find_isapnp_device ( struct isapnp_device *isapnp,
if ( ( isapnp->vendor_id == id->vendor_id ) && if ( ( isapnp->vendor_id == id->vendor_id ) &&
( ISA_PROD_ID ( isapnp->prod_id ) == ( ISA_PROD_ID ( isapnp->prod_id ) ==
ISA_PROD_ID ( id->prod_id ) ) ) { ISA_PROD_ID ( id->prod_id ) ) ) {
DBG ( "Device %s (driver %s) " DBG ( "ISAPnP found ID %hx:%hx "
"matches ID %s\n", "(\"%s\") (device %s) "
id->name, driver->name, "matching driver %s\n",
isapnp->vendor_id,
isapnp->prod_id,
isa_id_string( isapnp->vendor_id, isa_id_string( isapnp->vendor_id,
isapnp->prod_id ) ); isapnp->prod_id ),
id->name, driver->name );
isapnp->name = id->name; isapnp->name = id->name;
isapnp->already_tried = 1; isapnp->already_tried = 1;
return 1; return 1;
@ -513,6 +518,7 @@ int find_isapnp_device ( struct isapnp_device *isapnp,
} }
/* No device found */ /* No device found */
DBG ( "ISAPnP found no device matching driver %s\n", driver->name );
isapnp->csn = 1; isapnp->csn = 1;
return 0; return 0;
} }

View File

@ -22,7 +22,7 @@ static char mca_magic[0]; /* guaranteed unique symbol */
* *
*/ */
static int fill_mca_device ( struct mca_device *mca ) { static int fill_mca_device ( struct mca_device *mca ) {
unsigned int i; unsigned int i, seen_non_ff;
/* Make sure motherboard setup is off */ /* Make sure motherboard setup is off */
outb_p ( 0xff, MCA_MOTHERBOARD_SETUP_REG ); outb_p ( 0xff, MCA_MOTHERBOARD_SETUP_REG );
@ -31,11 +31,20 @@ static int fill_mca_device ( struct mca_device *mca ) {
outb_p ( 0x8 | ( mca->slot & 0xf ), MCA_ADAPTER_SETUP_REG ); outb_p ( 0x8 | ( mca->slot & 0xf ), MCA_ADAPTER_SETUP_REG );
/* Read the POS registers */ /* Read the POS registers */
seen_non_ff = 0;
for ( i = 0 ; i < ( sizeof ( mca->pos ) / sizeof ( mca->pos[0] ) ) ; for ( i = 0 ; i < ( sizeof ( mca->pos ) / sizeof ( mca->pos[0] ) ) ;
i++ ) { i++ ) {
mca->pos[i] = inb_p ( MCA_POS_REG ( i ) ); mca->pos[i] = inb_p ( MCA_POS_REG ( i ) );
if ( mca->pos[i] != 0xff )
seen_non_ff = 1;
} }
/* If all POS registers are 0xff, this means there's no device
* present
*/
if ( ! seen_non_ff )
return 0;
/* Kill all setup modes */ /* Kill all setup modes */
outb_p ( 0, MCA_ADAPTER_SETUP_REG ); outb_p ( 0, MCA_ADAPTER_SETUP_REG );
@ -64,6 +73,7 @@ int find_mca_device ( struct mca_device *mca, struct mca_driver *driver ) {
/* Iterate through all possible MCA slots, starting where we /* Iterate through all possible MCA slots, starting where we
* left off * left off
*/ */
DBG ( "MCA searching for device matching driver %s\n", driver->name );
for ( ; mca->slot < MCA_MAX_SLOT_NR ; mca->slot++ ) { for ( ; mca->slot < MCA_MAX_SLOT_NR ; mca->slot++ ) {
/* If we've already used this device, skip it */ /* If we've already used this device, skip it */
if ( mca->already_tried ) { if ( mca->already_tried ) {
@ -81,8 +91,9 @@ int find_mca_device ( struct mca_device *mca, struct mca_driver *driver ) {
struct mca_id *id = &driver->ids[i]; struct mca_id *id = &driver->ids[i];
if ( MCA_ID ( mca ) == id->id ) { if ( MCA_ID ( mca ) == id->id ) {
DBG ( "Device %s (driver %s) matches ID %hx\n", DBG ( "MCA found ID %hx (device %s) "
id->name, driver->name, id->id ); "matching driver %s\n",
id->name, id->id, driver->name );
mca->name = id->name; mca->name = id->name;
mca->already_tried = 1; mca->already_tried = 1;
return 1; return 1;
@ -91,6 +102,7 @@ int find_mca_device ( struct mca_device *mca, struct mca_driver *driver ) {
} }
/* No device found */ /* No device found */
DBG ( "MCA found no device matching driver %s\n", driver->name );
mca->slot = 0; mca->slot = 0;
return 0; return 0;
} }