Changeset 24ab58b3 in mainline for uspace/srv/net/netif/lo/lo.c


Ignore:
Timestamp:
2010-04-06T11:41:48Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
14f1db0
Parents:
4dd8529
Message:

more compact network startup messages (usually one line instead of multiple lines)
pass module name as an argument to nil_message() and friends
deeper cstyle changes (replace forward prototypes with proper extern declarations and static functions, change doxygen comments, stick more closely to the 80-column rule, no argument names in header files, spacing, comments, etc.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/netif/lo/lo.c

    r4dd8529 r24ab58b3  
    6464/** Loopback module name.
    6565 */
    66 #define NAME    "lo - loopback interface"
     66#define NAME  "lo"
    6767
    6868/** Network interface global data.
     
    113113}
    114114
    115 int change_state_message(device_ref device, device_state_t state){
    116         if(device->state != state){
     115int change_state_message(device_ref device, device_state_t state)
     116{
     117        if (device->state != state) {
    117118                device->state = state;
    118                 printf("State changed to %s\n", (state == NETIF_ACTIVE) ? "ACTIVE" : "STOPPED");
     119               
     120                printf("%s: State changed to %s\n", NAME,
     121                    (state == NETIF_ACTIVE) ? "active" : "stopped");
     122               
    119123                return state;
    120124        }
     125       
    121126        return EOK;
    122127}
     
    166171        ERROR_PROPAGATE(create(device_id, &device));
    167172        // print the settings
    168         printf("New device created:\n\tid\t= %d\n", device->device_id);
     173        printf("%s: Device created (id: %d)\n", NAME, device->device_id);
    169174        return EOK;
    170175}
     
    237242               
    238243                /* Process the message */
    239                 int res = netif_module_message(callid, &call, &answer, &answer_count);
     244                int res = netif_module_message(NAME, callid, &call, &answer,
     245                    &answer_count);
    240246               
    241247                /* End if said to either by the message or the processing result */
     
    261267        ERROR_DECLARE;
    262268       
    263         /* Print the module label */
    264         printf("Task %d - %s\n", task_get_id(), NAME);
    265        
    266269        /* Start the module */
    267         if (ERROR_OCCURRED(netif_module_start(netif_client_connection))) {
    268                 printf(" - ERROR %i\n", ERROR_CODE);
     270        if (ERROR_OCCURRED(netif_module_start(netif_client_connection)))
    269271                return ERROR_CODE;
    270         }
    271272       
    272273        return EOK;
Note: See TracChangeset for help on using the changeset viewer.