Browse Source

Improved debug messages

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
f5dde85e16
1 changed files with 13 additions and 12 deletions
  1. 13
    12
      src/core/dev.c

+ 13
- 12
src/core/dev.c View File

47
 		return 1;
47
 		return 1;
48
 
48
 
49
 	/* Move to first (zeroed) location on next bus, if any */
49
 	/* Move to first (zeroed) location on next bus, if any */
50
-	if ( ++(*bus_driver) < bus_drivers_end )
50
+	if ( ++(*bus_driver) < bus_drivers_end ) {
51
+		DBG ( "DEV scanning %s bus\n", (*bus_driver)->name );
51
 		return 1;
52
 		return 1;
53
+	}
52
 
54
 
53
 	/* Reset to first bus, return "no more locations" */
55
 	/* Reset to first bus, return "no more locations" */
54
 	*bus_driver = bus_drivers;
56
 	*bus_driver = bus_drivers;
63
  */
65
  */
64
 int find_any ( struct bus_driver **bus_driver, struct bus_loc *bus_loc,
66
 int find_any ( struct bus_driver **bus_driver, struct bus_loc *bus_loc,
65
 	       struct bus_dev *bus_dev, signed int skip ) {
67
 	       struct bus_dev *bus_dev, signed int skip ) {
66
-	DBG ( "DEV searching for any device\n" );
68
+	DBG ( "DEV scanning %s bus\n", (*bus_driver)->name );
67
 	do {
69
 	do {
68
 		if ( --skip >= 0 )
70
 		if ( --skip >= 0 )
69
 			continue;
71
 			continue;
70
 		if ( ! (*bus_driver)->fill_device ( bus_dev, bus_loc ) )
72
 		if ( ! (*bus_driver)->fill_device ( bus_dev, bus_loc ) )
71
 			continue;
73
 			continue;
72
 		DBG ( "DEV found device %s\n",
74
 		DBG ( "DEV found device %s\n",
73
-		      (*bus_driver)->describe ( bus_dev ) );
75
+		      (*bus_driver)->describe_device ( bus_dev ) );
74
 		return 1;
76
 		return 1;
75
 	} while ( next_location ( bus_driver, bus_loc ) );
77
 	} while ( next_location ( bus_driver, bus_loc ) );
76
 
78
 
77
-	DBG ( "DEV found no device\n" );
79
+	DBG ( "DEV found no more devices\n" );
78
 	return 0;
80
 	return 0;
79
 }
81
 }
80
 
82
 
87
 int find_by_device ( struct device_driver **device_driver,
89
 int find_by_device ( struct device_driver **device_driver,
88
 		     struct bus_driver *bus_driver, struct bus_dev *bus_dev,
90
 		     struct bus_driver *bus_driver, struct bus_dev *bus_dev,
89
 		     signed int skip ) {
91
 		     signed int skip ) {
90
-	DBG ( "DEV searching for a driver for device %s\n",
91
-	      bus_driver->describe ( bus_dev ) );
92
 	do {
92
 	do {
93
 		if ( --skip >= 0 )
93
 		if ( --skip >= 0 )
94
 			continue;
94
 			continue;
96
 			continue;
96
 			continue;
97
 		if ( ! bus_driver->check_driver ( bus_dev, *device_driver ))
97
 		if ( ! bus_driver->check_driver ( bus_dev, *device_driver ))
98
 			continue;
98
 			continue;
99
-		DBG ( "DEV found driver %s\n", (*device_driver)->name );
99
+		DBG ( "DEV found driver %s for device %s\n",
100
+		      (*device_driver)->name,
101
+		      bus_driver->describe_device ( bus_dev ) );
100
 		return 1;
102
 		return 1;
101
 	} while ( ++(*device_driver) < device_drivers_end );
103
 	} while ( ++(*device_driver) < device_drivers_end );
102
 	
104
 	
103
 	/* Reset to first driver, return "not found" */
105
 	/* Reset to first driver, return "not found" */
104
 	DBG ( "DEV found no driver for device %s\n",
106
 	DBG ( "DEV found no driver for device %s\n",
105
-	      bus_driver->describe ( bus_dev ) );
107
+	      bus_driver->describe_device ( bus_dev ) );
106
 	*device_driver = device_drivers;
108
 	*device_driver = device_drivers;
107
 	return 0;
109
 	return 0;
108
 }
110
 }
118
 		     signed int skip ) {
120
 		     signed int skip ) {
119
 	struct bus_driver *bus_driver = device_driver->bus_driver;
121
 	struct bus_driver *bus_driver = device_driver->bus_driver;
120
 	
122
 	
121
-	DBG ( "DEV searching for a device for driver %s\n",
122
-	      device_driver->name );
123
 	do {
123
 	do {
124
 		if ( --skip >= 0 )
124
 		if ( --skip >= 0 )
125
 			continue;
125
 			continue;
127
 			continue;
127
 			continue;
128
 		if ( ! bus_driver->check_driver ( bus_dev, device_driver ) )
128
 		if ( ! bus_driver->check_driver ( bus_dev, device_driver ) )
129
 			continue;
129
 			continue;
130
-		DBG ( "DEV found device %s\n",
131
-		      bus_driver->describe ( bus_dev ) );
130
+		DBG ( "DEV found device %s for driver %s\n",
131
+		      bus_driver->describe_device ( bus_dev ),
132
+		      device_driver->name );
132
 		return 1;
133
 		return 1;
133
 	} while ( bus_driver->next_location ( bus_loc ) );
134
 	} while ( bus_driver->next_location ( bus_loc ) );
134
 
135
 

Loading…
Cancel
Save