Changeset 24ab58b3 in mainline for uspace/srv/hw/netif/dp8390/dp8390_module.c
- Timestamp:
- 2010-04-06T11:41:48Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 14f1db0
- Parents:
- 4dd8529
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/netif/dp8390/dp8390_module.c
r4dd8529 r24ab58b3 59 59 /** DP8390 module name. 60 60 */ 61 #define NAME "dp8390 network interface"61 #define NAME "dp8390" 62 62 63 63 /** Returns the device from the interrupt call. … … 302 302 } 303 303 304 int change_state(device_ref device, device_state_t state){ 305 device->state = state; 306 printf("State changed to %s\n", (state == NETIF_ACTIVE) ? "ACTIVE" : "STOPPED"); 307 return state; 304 int change_state(device_ref device, device_state_t state) 305 { 306 if (device->state != state) { 307 device->state = state; 308 309 printf("%s: State changed to %s\n", NAME, 310 (state == NETIF_ACTIVE) ? "active" : "stopped"); 311 312 return state; 313 } 314 315 return EOK; 308 316 } 309 317 … … 346 354 347 355 /* Process the message */ 348 int res = netif_module_message(callid, &call, &answer, &answer_count); 356 int res = netif_module_message(NAME, callid, &call, &answer, 357 &answer_count); 349 358 350 359 /* End if said to either by the message or the processing result */ … … 370 379 ERROR_DECLARE; 371 380 372 /* Print the module label */ 373 printf("Task %d - %s\n", task_get_id(), NAME); 381 /* Start the module */ 382 if (ERROR_OCCURRED(netif_module_start(netif_client_connection))) 383 return ERROR_CODE; 374 384 375 /* Start the module */376 if (ERROR_OCCURRED(netif_module_start(netif_client_connection))) {377 printf(" - ERROR %i\n", ERROR_CODE);378 return ERROR_CODE;379 }380 381 385 return EOK; 382 386 }
Note:
See TracChangeset
for help on using the changeset viewer.