Changeset 0b749a3 in mainline for uspace/srv/net/il/arp/arp_module.c


Ignore:
Timestamp:
2010-11-22T15:39:53Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0eddb76, aae339e9
Parents:
9a1d8ab (diff), 8cd1aa5e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge development/ changes

File:
1 edited

Legend:

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

    r9a1d8ab r0b749a3  
    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 points.
    37  *  @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
     37 * points.
     38 * @see module.c
    3839 */
    3940
    4041#include <async.h>
    4142#include <stdio.h>
     43#include <errno.h>
    4244
    4345#include <ipc/ipc.h>
    4446#include <ipc/services.h>
    4547
    46 #include <net_err.h>
    47 #include <net_modules.h>
     48#include <net/modules.h>
    4849#include <net_interface.h>
    49 #include <packet/packet.h>
     50#include <net/packet.h>
    5051#include <il_local.h>
    5152
     
    5354#include "arp_module.h"
    5455
    55 /** ARP module global data.
    56  */
    57 extern arp_globals_t    arp_globals;
     56/** ARP module global data. */
     57extern arp_globals_t arp_globals;
    5858
    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  */
    67 int il_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     59int il_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
     60    ipc_call_t *answer, int *answer_count)
     61{
    6862        return arp_message_standalone(callid, call, answer, answer_count);
    6963}
    7064
    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  */
    78 int il_module_start_standalone(async_client_conn_t client_connection){
    79         ERROR_DECLARE;
     65int il_module_start_standalone(async_client_conn_t client_connection)
     66{
     67        ipcarg_t phonehash;
     68        int rc;
    8069       
    8170        async_set_client_connection(client_connection);
    82         arp_globals.net_phone = net_connect_module(SERVICE_NETWORKING);
    83         ERROR_PROPAGATE(pm_init());
     71        arp_globals.net_phone = net_connect_module();
    8472       
    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         }
     73        rc = pm_init();
     74        if (rc != EOK)
     75                return rc;
     76       
     77        rc = arp_initialize(client_connection);
     78        if (rc != EOK)
     79                goto out;
     80       
     81        rc = REGISTER_ME(SERVICE_ARP, &phonehash);
     82        if (rc != EOK)
     83                goto out;
    9184       
    9285        async_manager();
    93        
     86
     87out:
    9488        pm_destroy();
    95         return EOK;
     89        return rc;
    9690}
    9791
Note: See TracChangeset for help on using the changeset viewer.