Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/il/arp/arp_module.c

    r08e3ca4 r614d065  
    3232
    3333/** @file
    34  * ARP standalone module implementation.
    35  * Contains skeleton module functions mapping.
    36  * The functions are used by the module skeleton as module specific entry
    37  * points.
    38  * @see module.c
     34 *  ARP standalone module implementation.
     35 *  Contains skeleton module functions mapping.
     36 *  The functions are used by the module skeleton as module specific entry points.
     37 *  @see module.c
    3938 */
    4039
    4140#include <async.h>
    4241#include <stdio.h>
    43 #include <errno.h>
     42#include <err.h>
    4443
    4544#include <ipc/ipc.h>
     
    5453#include "arp_module.h"
    5554
    56 /** ARP module global data. */
    57 extern arp_globals_t arp_globals;
     55/** ARP module global data.
     56 */
     57extern arp_globals_t    arp_globals;
    5858
    59 int
    60 il_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
    61     ipc_call_t *answer, int *answer_count)
    62 {
     59/** Processes the ARP message.
     60 *  @param[in] callid The message identifier.
     61 *  @param[in] call The message parameters.
     62 *  @param[out] answer The message answer parameters.
     63 *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
     64 *  @returns EOK on success.
     65 *  @returns Other error codes as defined for the arp_message() function.
     66 */
     67int il_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    6368        return arp_message_standalone(callid, call, answer, answer_count);
    6469}
    6570
    66 int il_module_start_standalone(async_client_conn_t client_connection)
    67 {
    68         ipcarg_t phonehash;
    69         int rc;
     71/** Starts the ARP module.
     72 *  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.
     73 *  @param[in] client_connection The client connection processing function. The module skeleton propagates its own one.
     74 *  @returns EOK on successful module termination.
     75 *  @returns Other error codes as defined for the arp_initialize() function.
     76 *  @returns Other error codes as defined for the REGISTER_ME() macro function.
     77 */
     78int il_module_start_standalone(async_client_conn_t client_connection){
     79        ERROR_DECLARE;
    7080       
    7181        async_set_client_connection(client_connection);
    7282        arp_globals.net_phone = net_connect_module();
     83        ERROR_PROPAGATE(pm_init());
    7384       
    74         rc = pm_init();
    75         if (rc != EOK)
    76                 return rc;
    77        
    78         rc = arp_initialize(client_connection);
    79         if (rc != EOK)
    80                 goto out;
    81        
    82         rc = REGISTER_ME(SERVICE_ARP, &phonehash);
    83         if (rc != EOK)
    84                 goto out;
     85        ipcarg_t phonehash;
     86        if (ERROR_OCCURRED(arp_initialize(client_connection))
     87            || ERROR_OCCURRED(REGISTER_ME(SERVICE_ARP, &phonehash))) {
     88                pm_destroy();
     89                return ERROR_CODE;
     90        }
    8591       
    8692        async_manager();
    87 
    88 out:
     93       
    8994        pm_destroy();
    90         return rc;
     95        return EOK;
    9196}
    9297
Note: See TracChangeset for help on using the changeset viewer.