Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/nil/eth/eth_module.c

    r614d065 r08e3ca4  
    3636 */
    3737
     38#include "eth.h"
     39
    3840#include <async.h>
    3941#include <stdio.h>
    40 #include <err.h>
     42#include <errno.h>
    4143
    4244#include <ipc/ipc.h>
     
    4850#include <nil_local.h>
    4951
    50 #include "eth.h"
    51 
    52 /** Starts the Ethernet module.
    53  *  Initializes the client connection serving function, initializes the module, registers the module service and starts the async manager, processing IPC messages in an infinite loop.
    54  *  @param[in] client_connection The client connection processing function. The module skeleton propagates its own one.
    55  *  @returns EOK on success.
    56  *  @returns Other error codes as defined for the pm_init() function.
    57  *  @returns Other error codes as defined for the nil_initialize() function.
    58  *  @returns Other error codes as defined for the REGISTER_ME() macro function.
    59  */
    6052int nil_module_start_standalone(async_client_conn_t client_connection)
    6153{
    62         ERROR_DECLARE;
     54        ipcarg_t phonehash;
     55        int rc;
    6356       
    6457        async_set_client_connection(client_connection);
    6558        int net_phone = net_connect_module();
    66         ERROR_PROPAGATE(pm_init());
     59
     60        rc = pm_init();
     61        if (rc != EOK)
     62                return rc;
    6763       
    68         ipcarg_t phonehash;
    69         if (ERROR_OCCURRED(nil_initialize(net_phone))
    70             || ERROR_OCCURRED(REGISTER_ME(SERVICE_ETHERNET, &phonehash))) {
    71                 pm_destroy();
    72                 return ERROR_CODE;
    73         }
     64        rc = nil_initialize(net_phone);
     65        if (rc != EOK)
     66                goto out;
     67
     68        rc = REGISTER_ME(SERVICE_ETHERNET, &phonehash);
     69        if (rc != EOK)
     70                goto out;
    7471       
    7572        async_manager();
    76        
     73
     74out:
    7775        pm_destroy();
    78         return EOK;
     76        return rc;
    7977}
    8078
    81 /** Pass the parameters to the module specific nil_message() function.
    82  *
    83  * @param[in]  name         Module name.
    84  * @param[in]  callid       The message identifier.
    85  * @param[in]  call         The message parameters.
    86  * @param[out] answer       The message answer parameters.
    87  * @param[out] answer_count The last parameter for the actual answer
    88  *                          in the answer parameter.
    89  *
    90  * @return EOK on success.
    91  * @return ENOTSUP if the message is not known.
    92  * @return Other error codes as defined for each
    93  *         specific module message function.
    94  *
    95  */
    96 int nil_module_message_standalone(const char *name, ipc_callid_t callid, ipc_call_t *call,
    97     ipc_call_t *answer, int *answer_count)
     79int
     80nil_module_message_standalone(const char *name, ipc_callid_t callid,
     81    ipc_call_t *call, ipc_call_t *answer, int *answer_count)
    9882{
    9983        return nil_message_standalone(name, callid, call, answer, answer_count);
Note: See TracChangeset for help on using the changeset viewer.