Bläddra i källkod

Add dummy_connect and dummy_irq

tags/v0.9.3
Michael Brown 19 år sedan
förälder
incheckning
d9f34bfdfc
2 ändrade filer med 18 tillägg och 4 borttagningar
  1. 16
    4
      src/core/nic.c
  2. 2
    0
      src/include/nic.h

+ 16
- 4
src/core/nic.c Visa fil

@@ -257,9 +257,9 @@ static int nic_load_configuration(struct dev *dev __unused)
257 257
 #endif
258 258
 	if (!server_found) {
259 259
 		printf("No Server found\n");
260
-		longjmp(restart_etherboot, -1);
260
+		return 0;
261 261
 	}
262
-	return 0;
262
+	return 1;
263 263
 }
264 264
 
265 265
 
@@ -312,7 +312,7 @@ static int nic_load(struct dev *dev __unused)
312 312
 		printf("No filename\n");
313 313
 	}
314 314
 	interruptible_sleep(2);		/* lay off the server for a while */
315
-	longjmp(restart_etherboot, -1);
315
+	return 0;
316 316
 }
317 317
 
318 318
 
@@ -329,12 +329,19 @@ static void nic_disable ( struct dev *dev ) {
329 329
 	nic->nic_op->disable ( nic );
330 330
 }
331 331
 
332
+static void nic_print_info ( struct dev *dev ) {
333
+	struct nic *nic = &dev->nic;
334
+
335
+	printf ( "Found %s NIC (MAC %!)\n", dev->name, nic->node_addr );
336
+}
337
+
332 338
 /* 
333 339
  * Device operations tables
334 340
  *
335 341
  */
336 342
 static struct dev_operations nic_operations = {
337 343
 	.disable = nic_disable,
344
+	.print_info = nic_print_info,
338 345
 	.load_configuration = nic_load_configuration,
339 346
 	.load = nic_load,
340 347
 };
@@ -363,8 +370,13 @@ struct nic * nic_device ( struct dev *dev ) {
363 370
 
364 371
 
365 372
 
373
+int dummy_connect ( struct nic *nic ) {
374
+	return 1;
375
+}
366 376
 
367
-
377
+int dummy_irq ( struct nic *nic ) {
378
+	return 1;
379
+}
368 380
 
369 381
 /**************************************************************************
370 382
 DEFAULT_NETMASK - Return default netmask for IP address

+ 2
- 0
src/include/nic.h Visa fil

@@ -44,6 +44,8 @@ struct nic_operations {
44 44
  */
45 45
 struct dev;
46 46
 extern struct nic * nic_device ( struct dev * dev );
47
+extern int dummy_connect ( struct nic *nic );
48
+extern int dummy_irq ( struct nic *nic );
47 49
 
48 50
 /*
49 51
  * Functions that implicitly operate on the current boot device

Laddar…
Avbryt
Spara