Browse Source

Improved debugging output

tags/v0.9.3
Michael Brown 20 years ago
parent
commit
e1a9798af4
3 changed files with 27 additions and 7 deletions
  1. 2
    0
      src/drivers/bus/isa.c
  2. 10
    4
      src/drivers/bus/isapnp.c
  3. 15
    3
      src/drivers/bus/mca.c

+ 2
- 0
src/drivers/bus/isa.c View File

44
 	/* Iterate through any ISA probe addresses specified by
44
 	/* Iterate through any ISA probe addresses specified by
45
 	 * config.c, starting where we left off.
45
 	 * config.c, starting where we left off.
46
 	 */
46
 	 */
47
+	DBG ( "ISA searching for device matching driver %s\n", driver->name );
47
 	for ( i = isa->probe_idx ; i < isa_extra_probe_addr_count ; i++ ) {
48
 	for ( i = isa->probe_idx ; i < isa_extra_probe_addr_count ; i++ ) {
48
 		/* If we've already used this device, skip it */
49
 		/* If we've already used this device, skip it */
49
 		if ( isa->already_tried ) {
50
 		if ( isa->already_tried ) {
96
 
97
 
97
  notfound:
98
  notfound:
98
 	/* No device found */
99
 	/* No device found */
100
+	DBG ( "ISA found no device matching driver %s\n", driver->name );
99
 	isa->probe_idx = 0;
101
 	isa->probe_idx = 0;
100
 	return 0;
102
 	return 0;
101
 
103
 

+ 10
- 4
src/drivers/bus/isapnp.c View File

473
 	/* Iterate through all possible ISAPNP CSNs, starting where we
473
 	/* Iterate through all possible ISAPNP CSNs, starting where we
474
 	 * left off.
474
 	 * left off.
475
 	 */
475
 	 */
476
+	DBG ( "ISAPnP searching for device matching driver %s\n",
477
+	      driver->name );
476
 	for ( ; isapnp->csn <= isapnp_max_csn ; isapnp->csn++ ) {
478
 	for ( ; isapnp->csn <= isapnp_max_csn ; isapnp->csn++ ) {
477
 		for ( ; isapnp->logdev <= 0xff ; isapnp->logdev++ ) {
479
 		for ( ; isapnp->logdev <= 0xff ; isapnp->logdev++ ) {
478
 			/* If we've already used this device, skip it */
480
 			/* If we've already used this device, skip it */
499
 				if ( ( isapnp->vendor_id == id->vendor_id ) &&
501
 				if ( ( isapnp->vendor_id == id->vendor_id ) &&
500
 				     ( ISA_PROD_ID ( isapnp->prod_id ) ==
502
 				     ( ISA_PROD_ID ( isapnp->prod_id ) ==
501
 				       ISA_PROD_ID ( id->prod_id ) ) ) {
503
 				       ISA_PROD_ID ( id->prod_id ) ) ) {
502
-					DBG ( "Device %s (driver %s) "
503
-					      "matches ID %s\n",
504
-					      id->name, driver->name,
504
+					DBG ( "ISAPnP found ID %hx:%hx "
505
+					      "(\"%s\") (device %s) "
506
+					      "matching driver %s\n",
507
+					      isapnp->vendor_id,
508
+					      isapnp->prod_id,
505
 					      isa_id_string( isapnp->vendor_id,
509
 					      isa_id_string( isapnp->vendor_id,
506
-							   isapnp->prod_id ) );
510
+							     isapnp->prod_id ),
511
+					      id->name, driver->name );
507
 					isapnp->name = id->name;
512
 					isapnp->name = id->name;
508
 					isapnp->already_tried = 1;
513
 					isapnp->already_tried = 1;
509
 					return 1;
514
 					return 1;
513
 	}
518
 	}
514
 
519
 
515
 	/* No device found */
520
 	/* No device found */
521
+	DBG ( "ISAPnP found no device matching driver %s\n", driver->name );
516
 	isapnp->csn = 1;
522
 	isapnp->csn = 1;
517
 	return 0;
523
 	return 0;
518
 }
524
 }

+ 15
- 3
src/drivers/bus/mca.c View File

22
  *
22
  *
23
  */
23
  */
24
 static int fill_mca_device ( struct mca_device *mca ) {
24
 static int fill_mca_device ( struct mca_device *mca ) {
25
-	unsigned int i;
25
+	unsigned int i, seen_non_ff;
26
 
26
 
27
 	/* Make sure motherboard setup is off */
27
 	/* Make sure motherboard setup is off */
28
 	outb_p ( 0xff, MCA_MOTHERBOARD_SETUP_REG );
28
 	outb_p ( 0xff, MCA_MOTHERBOARD_SETUP_REG );
31
 	outb_p ( 0x8 | ( mca->slot & 0xf ), MCA_ADAPTER_SETUP_REG );
31
 	outb_p ( 0x8 | ( mca->slot & 0xf ), MCA_ADAPTER_SETUP_REG );
32
 
32
 
33
 	/* Read the POS registers */
33
 	/* Read the POS registers */
34
+	seen_non_ff = 0;
34
 	for ( i = 0 ; i < ( sizeof ( mca->pos ) / sizeof ( mca->pos[0] ) ) ;
35
 	for ( i = 0 ; i < ( sizeof ( mca->pos ) / sizeof ( mca->pos[0] ) ) ;
35
 	      i++ ) {
36
 	      i++ ) {
36
 		mca->pos[i] = inb_p ( MCA_POS_REG ( i ) );
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
 	/* Kill all setup modes */
48
 	/* Kill all setup modes */
40
 	outb_p ( 0, MCA_ADAPTER_SETUP_REG );
49
 	outb_p ( 0, MCA_ADAPTER_SETUP_REG );
64
 	/* Iterate through all possible MCA slots, starting where we
73
 	/* Iterate through all possible MCA slots, starting where we
65
 	 * left off
74
 	 * left off
66
 	 */
75
 	 */
76
+	DBG ( "MCA searching for device matching driver %s\n", driver->name );
67
 	for ( ; mca->slot < MCA_MAX_SLOT_NR ; mca->slot++ ) {
77
 	for ( ; mca->slot < MCA_MAX_SLOT_NR ; mca->slot++ ) {
68
 		/* If we've already used this device, skip it */
78
 		/* If we've already used this device, skip it */
69
 		if ( mca->already_tried ) {
79
 		if ( mca->already_tried ) {
81
 			struct mca_id *id = &driver->ids[i];
91
 			struct mca_id *id = &driver->ids[i];
82
 
92
 
83
 			if ( MCA_ID ( mca ) == id->id ) {
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
 				mca->name = id->name;
97
 				mca->name = id->name;
87
 				mca->already_tried = 1;
98
 				mca->already_tried = 1;
88
 				return 1;
99
 				return 1;
91
 	}
102
 	}
92
 
103
 
93
 	/* No device found */
104
 	/* No device found */
105
+	DBG ( "MCA found no device matching driver %s\n", driver->name );
94
 	mca->slot = 0;
106
 	mca->slot = 0;
95
 	return 0;
107
 	return 0;
96
 }
108
 }

Loading…
Cancel
Save