Selaa lähdekoodia

Tweaked API to minimise changes to existing drivers even further.

tags/v0.9.3
Michael Brown 19 vuotta sitten
vanhempi
commit
cfe3a663af
4 muutettua tiedostoa jossa 12 lisäystä ja 12 poistoa
  1. 9
    9
      src/drivers/bus/pci.c
  2. 1
    1
      src/drivers/net/pnic.c
  3. 1
    1
      src/include/dev.h
  4. 1
    1
      src/include/pci.h

+ 9
- 9
src/drivers/bus/pci.c Näytä tiedosto

@@ -143,24 +143,24 @@ static int pci_fill_device ( struct bus_dev *bus_dev,
143 143
  *
144 144
  */
145 145
 static int pci_check_driver ( struct bus_dev *bus_dev,
146
-		       struct device_driver *device_driver ) {
146
+			      struct device_driver *device_driver ) {
147 147
 	struct pci_device *pci = ( struct pci_device * ) bus_dev;
148
-	struct pci_driver_info *pci_driver_info
149
-		= ( struct pci_driver_info * ) device_driver->bus_driver_info;
148
+	struct pci_driver *pci_driver
149
+		= ( struct pci_driver * ) device_driver->bus_driver_info;
150 150
 	unsigned int i;
151 151
 
152 152
 	/* If driver has a class, and class matches, use it */
153
-	if ( pci_driver_info->class && 
154
-	     ( pci_driver_info->class == pci->class ) ) {
153
+	if ( pci_driver->class && 
154
+	     ( pci_driver->class == pci->class ) ) {
155 155
 		DBG ( "driver %s matches class %hx\n",
156
-		      device_driver->name, pci_driver_info->class );
156
+		      device_driver->name, pci_driver->class );
157 157
 		pci->name = device_driver->name;
158 158
 		return 1;
159 159
 	}
160 160
 		
161 161
 	/* If any of driver's IDs match, use it */
162
-	for ( i = 0 ; i < pci_driver_info->id_count; i++ ) {
163
-		struct pci_id *id = &pci_driver_info->ids[i];
162
+	for ( i = 0 ; i < pci_driver->id_count; i++ ) {
163
+		struct pci_id *id = &pci_driver->ids[i];
164 164
 		
165 165
 		if ( ( pci->vendor_id == id->vendor_id ) &&
166 166
 		     ( pci->device_id == id->device_id ) ) {
@@ -193,7 +193,7 @@ static char * pci_describe ( struct bus_dev *bus_dev ) {
193 193
  * Name a PCI device
194 194
  *
195 195
  */
196
-static char * pci_name ( struct bus_dev *bus_dev ) {
196
+static const char * pci_name ( struct bus_dev *bus_dev ) {
197 197
 	struct pci_device *pci = ( struct pci_device * ) bus_dev;
198 198
 	
199 199
 	return pci->name;

+ 1
- 1
src/drivers/net/pnic.c Näytä tiedosto

@@ -246,7 +246,7 @@ static struct pci_id pnic_nics[] = {
246 246
 PCI_ROM ( 0xfefe, 0xefef, "pnic", "Bochs Pseudo NIC Adaptor" ),
247 247
 };
248 248
 
249
-static struct pci_driver_info pnic_driver =
249
+static struct pci_driver pnic_driver =
250 250
 	PCI_DRIVER ( pnic_nics, PCI_NO_CLASS );
251 251
 
252 252
 DRIVER ( "PNIC", nic_driver, pci_driver, pnic_driver,

+ 1
- 1
src/include/dev.h Näytä tiedosto

@@ -154,7 +154,7 @@ struct bus_driver {
154 154
 	int ( *check_driver ) ( struct bus_dev *bus_dev,
155 155
 				struct device_driver *device_driver );
156 156
 	char * ( *describe ) ( struct bus_dev *bus_dev );
157
-	char * ( *name ) ( struct bus_dev *bus_dev );
157
+	const char * ( *name ) ( struct bus_dev *bus_dev );
158 158
 };
159 159
 
160 160
 #define __bus_driver __attribute__ (( used, __section__ ( ".drivers.bus" ) ))

+ 1
- 1
src/include/pci.h Näytä tiedosto

@@ -296,7 +296,7 @@ struct pci_id {
296 296
  * can handle an entire class of devices.
297 297
  *
298 298
  */
299
-struct pci_driver_info {
299
+struct pci_driver {
300 300
 	struct pci_id *ids;
301 301
 	unsigned int id_count;
302 302
 	uint16_t class;

Loading…
Peruuta
Tallenna