Bladeren bron

Improved debugging output

tags/v0.9.3
Michael Brown 19 jaren geleden
bovenliggende
commit
e1a9798af4
3 gewijzigde bestanden met toevoegingen van 27 en 7 verwijderingen
  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 Bestand weergeven

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

+ 10
- 4
src/drivers/bus/isapnp.c Bestand weergeven

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

+ 15
- 3
src/drivers/bus/mca.c Bestand weergeven

@@ -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
 }

Laden…
Annuleren
Opslaan