Changeset b40bfac in mainline for uspace/srv/net/tl/udp/udp_module.c


Ignore:
Timestamp:
2010-11-08T07:13:25Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
63a1e60
Parents:
d70a463 (diff), 3da12d74 (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 mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tl/udp/udp_module.c

    rd70a463 rb40bfac  
    2828
    2929/** @addtogroup udp
    30  *  @{
     30 * @{
    3131 */
    3232
    3333/** @file
    34  *  UDP 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 * UDP 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 */
     40
     41#include "udp.h"
     42#include "udp_module.h"
    3943
    4044#include <async.h>
    4145#include <stdio.h>
    42 #include <err.h>
     46#include <errno.h>
    4347#include <ipc/ipc.h>
    4448#include <ipc/services.h>
     
    4650#include <net/modules.h>
    4751#include <net/packet.h>
     52
    4853#include <net_interface.h>
    4954#include <tl_local.h>
    5055
    51 #include "udp.h"
    52 #include "udp_module.h"
     56/** UDP module global data. */
     57extern udp_globals_t udp_globals;
    5358
    54 /** UDP module global data.
    55  */
    56 extern udp_globals_t    udp_globals;
    57 
    58 /** Starts the UDP module.
    59  *  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.
    60  *  @param[in] client_connection The client connection processing function. The module skeleton propagates its own one.
    61  *  @returns EOK on successful module termination.
    62  *  @returns Other error codes as defined for the udp_initialize() function.
    63  *  @returns Other error codes as defined for the REGISTER_ME() macro function.
    64  */
    65 int tl_module_start_standalone(async_client_conn_t client_connection){
    66         ERROR_DECLARE;
    67 
     59int tl_module_start_standalone(async_client_conn_t client_connection)
     60{
    6861        ipcarg_t phonehash;
     62        int rc;
    6963
    7064        async_set_client_connection(client_connection);
    7165        udp_globals.net_phone = net_connect_module();
    72         if(udp_globals.net_phone < 0){
     66        if (udp_globals.net_phone < 0)
    7367                return udp_globals.net_phone;
    74         }
    75         ERROR_PROPAGATE(pm_init());
    76         if(ERROR_OCCURRED(udp_initialize(client_connection))
    77                 || ERROR_OCCURRED(REGISTER_ME(SERVICE_UDP, &phonehash))){
    78                 pm_destroy();
    79                 return ERROR_CODE;
    80         }
     68       
     69        rc = pm_init();
     70        if (rc != EOK)
     71                return EOK;
     72               
     73        rc = udp_initialize(client_connection);
     74        if (rc != EOK)
     75                goto out;
     76       
     77        rc = REGISTER_ME(SERVICE_UDP, &phonehash);
     78        if (rc != EOK)
     79                goto out;
    8180
    8281        async_manager();
    8382
     83out:
    8484        pm_destroy();
    85         return EOK;
     85        return rc;
    8686}
    8787
    88 /** Processes the UDP message.
    89  *  @param[in] callid The message identifier.
    90  *  @param[in] call The message parameters.
    91  *  @param[out] answer The message answer parameters.
    92  *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
    93  *  @returns EOK on success.
    94  *  @returns Other error codes as defined for the udp_message() function.
    95  */
    96 int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     88int
     89tl_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
     90    ipc_call_t *answer, int *answer_count)
     91{
    9792        return udp_message_standalone(callid, call, answer, answer_count);
    9893}
Note: See TracChangeset for help on using the changeset viewer.