Changeset 6b82009 in mainline for uspace/lib/net/tl


Ignore:
Timestamp:
2011-06-22T20:41:41Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ef09a7a
Parents:
55091847
Message:

networking stack: convert to the new async framework

Location:
uspace/lib/net/tl
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/tl/icmp_remote.c

    r55091847 r6b82009  
    3939#include <net/modules.h>
    4040#include <packet_client.h>
    41 
    42 #include <async.h>
    43 #include <async_obsolete.h>
    44 #include <errno.h>
    4541#include <ipc/services.h>
    4642#include <ipc/icmp.h>
    4743#include <sys/types.h>
     44#include <async.h>
     45#include <errno.h>
    4846
    49 /** Sends the Destination Unreachable error notification packet.
     47/** Send the Destination Unreachable error notification packet.
    5048 *
    5149 * Beginning of the packet is sent as the notification packet data.
     
    5351 * packet.
    5452 *
    55  * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls.
    56  * @param[in] code      The error specific code.
    57  * @param[in] mtu       The error MTU value.
    58  * @param[in] packet    The original packet.
    59  * @return              EOK on success.
    60  * @return              EPERM if the ICMP error notifications are disabled.
    61  * @return              ENOMEM if there is not enough memory left.
     53 * @param[in] sess   ICMP module session.
     54 * @param[in] code   Error specific code.
     55 * @param[in] mtu    Error MTU value.
     56 * @param[in] packet Original packet.
     57 *
     58 * @return EOK on success.
     59 * @return EPERM if the ICMP error notifications are disabled.
     60 * @return ENOMEM if there is not enough memory left.
     61 *
    6262 */
    63 int
    64 icmp_destination_unreachable_msg(int icmp_phone, icmp_code_t code,
     63int icmp_destination_unreachable_msg(async_sess_t *sess, icmp_code_t code,
    6564    icmp_param_t mtu, packet_t *packet)
    6665{
    67         async_obsolete_msg_3(icmp_phone, NET_ICMP_DEST_UNREACH, (sysarg_t) code,
     66        async_exch_t *exch = async_exchange_begin(sess);
     67        async_msg_3(exch, NET_ICMP_DEST_UNREACH, (sysarg_t) code,
    6868            (sysarg_t) packet_get_id(packet), (sysarg_t) mtu);
     69        async_exchange_end(exch);
     70       
    6971        return EOK;
    7072}
    7173
    72 /** Sends the Source Quench error notification packet.
     74/** Send the Source Quench error notification packet.
    7375 *
    7476 * Beginning of the packet is sent as the notification packet data.
     
    7678 * packet.
    7779 *
    78  * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls.
    79  * @param[in] packet    The original packet.
    80  * @return              EOK on success.
    81  * @return              EPERM if the ICMP error notifications are disabled.
    82  * @return              ENOMEM if there is not enough memory left.
     80 * @param[in] sess   ICMP module session.
     81 * @param[in] packet Original packet.
     82 *
     83 * @return EOK on success.
     84 * @return EPERM if the ICMP error notifications are disabled.
     85 * @return ENOMEM if there is not enough memory left.
     86 *
    8387 */
    84 int icmp_source_quench_msg(int icmp_phone, packet_t *packet)
     88int icmp_source_quench_msg(async_sess_t *sess, packet_t *packet)
    8589{
    86         async_obsolete_msg_2(icmp_phone, NET_ICMP_SOURCE_QUENCH, 0,
     90        async_exch_t *exch = async_exchange_begin(sess);
     91        async_msg_2(exch, NET_ICMP_SOURCE_QUENCH, 0,
    8792            (sysarg_t) packet_get_id(packet));
     93        async_exchange_end(exch);
     94       
    8895        return EOK;
    8996}
    9097
    91 /** Sends the Time Exceeded error notification packet.
     98/** Send the Time Exceeded error notification packet.
    9299 *
    93100 * Beginning of the packet is sent as the notification packet data.
     
    95102 * packet.
    96103 *
    97  * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls.
    98  * @param[in] code      The error specific code.
    99  * @param[in] packet    The original packet.
    100  * @return              EOK on success.
    101  * @return              EPERM if the ICMP error notifications are disabled.
    102  * @return              ENOMEM if there is not enough memory left.
     104 * @param[in] sess   ICMP module session.
     105 * @param[in] code   Error specific code.
     106 * @param[in] packet Original packet.
     107 *
     108 * @return EOK on success.
     109 * @return EPERM if the ICMP error notifications are disabled.
     110 * @return ENOMEM if there is not enough memory left.
     111 *
    103112 */
    104 int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t *packet)
     113int icmp_time_exceeded_msg(async_sess_t *sess, icmp_code_t code,
     114    packet_t *packet)
    105115{
    106         async_obsolete_msg_2(icmp_phone, NET_ICMP_TIME_EXCEEDED, (sysarg_t) code,
     116        async_exch_t *exch = async_exchange_begin(sess);
     117        async_msg_2(exch, NET_ICMP_TIME_EXCEEDED, (sysarg_t) code,
    107118            (sysarg_t) packet_get_id(packet));
     119        async_exchange_end(exch);
     120       
    108121        return EOK;
    109122}
    110123
    111 /** Sends the Parameter Problem error notification packet.
     124/** Send the Parameter Problem error notification packet.
    112125 *
    113126 * Beginning of the packet is sent as the notification packet data.
     
    115128 * packet.
    116129 *
    117  * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls.
    118  * @param[in] code      The error specific code.
    119  * @param[in] pointer   The problematic parameter offset.
    120  * @param[in] packet    The original packet.
    121  * @return              EOK on success.
    122  * @return              EPERM if the ICMP error notifications are disabled.
    123  * @return              ENOMEM if there is not enough memory left.
     130 * @param[in] sess    ICMP module session.
     131 * @param[in] code    Error specific code.
     132 * @param[in] pointer Problematic parameter offset.
     133 * @param[in] packet  Original packet.
     134 *
     135 * @return EOK on success.
     136 * @return EPERM if the ICMP error notifications are disabled.
     137 * @return ENOMEM if there is not enough memory left.
     138 *
    124139 */
    125 int icmp_parameter_problem_msg(int icmp_phone, icmp_code_t code,
     140int icmp_parameter_problem_msg(async_sess_t *sess, icmp_code_t code,
    126141    icmp_param_t pointer, packet_t *packet)
    127142{
    128         async_obsolete_msg_3(icmp_phone, NET_ICMP_PARAMETERPROB, (sysarg_t) code,
     143        async_exch_t *exch = async_exchange_begin(sess);
     144        async_msg_3(exch, NET_ICMP_PARAMETERPROB, (sysarg_t) code,
    129145            (sysarg_t) packet_get_id(packet), (sysarg_t) pointer);
     146        async_exchange_end(exch);
     147       
    130148        return EOK;
    131149}
     
    133151/** @}
    134152 */
    135 
  • uspace/lib/net/tl/socket_core.c

    r55091847 r6b82009  
    3838#include <packet_client.h>
    3939#include <packet_remote.h>
    40 
    4140#include <net/socket_codes.h>
    4241#include <net/in.h>
     
    4443#include <net/packet.h>
    4544#include <net/modules.h>
    46 
    4745#include <stdint.h>
    4846#include <stdlib.h>
    4947#include <errno.h>
    50 
    5148#include <adt/dynamic_fifo.h>
    5249#include <adt/int_map.h>
     
    5653 * switching to the sequence.
    5754 */
    58 #define SOCKET_ID_TRIES 100
     55#define SOCKET_ID_TRIES  100
    5956
    6057/** Bound port sockets.*/
     
    7269INT_MAP_IMPLEMENT(socket_ports, socket_port_t);
    7370
    74 /** Destroys the socket.
     71/** Destroy the socket.
    7572 *
    7673 * If the socket is bound, the port is released.
    77  * Releases all buffered packets, calls the release function and removes the
     74 * Release all buffered packets, call the release function and remove the
    7875 * socket from the local sockets.
    7976 *
    80  * @param[in] packet_phone The packet server phone to release buffered packets.
    81  * @param[in] socket    The socket to be destroyed.
    82  * @param[in,out] local_sockets The local sockets to be updated.
    83  * @param[in,out] global_sockets The global sockets to be updated.
    84  * @param[in] socket_release The client release callback function.
    85  */
    86 static void
    87 socket_destroy_core(int packet_phone, socket_core_t *socket,
     77 * @param[in]     sess           Packet server session.
     78 * @param[in]     socket         Socket to be destroyed.
     79 * @param[in,out] local_sockets  Local sockets to be updated.
     80 * @param[in,out] global_sockets Global sockets to be updated.
     81 * @param[in]     socket_release Client release callback function.
     82 *
     83 */
     84static void socket_destroy_core(async_sess_t *sess, socket_core_t *socket,
    8885    socket_cores_t *local_sockets, socket_ports_t *global_sockets,
    8986    void (* socket_release)(socket_core_t *socket))
    9087{
    91         int packet_id;
    92 
    9388        /* If bound */
    9489        if (socket->port) {
     
    9893       
    9994        /* Release all received packets */
     95        int packet_id;
    10096        while ((packet_id = dyn_fifo_pop(&socket->received)) >= 0)
    101                 pq_release_remote(packet_phone, packet_id);
    102 
     97                pq_release_remote(sess, packet_id);
     98       
    10399        dyn_fifo_destroy(&socket->received);
    104100        dyn_fifo_destroy(&socket->accepted);
    105 
     101       
    106102        if (socket_release)
    107103                socket_release(socket);
    108 
     104       
    109105        socket_cores_exclude(local_sockets, socket->socket_id, free);
    110106}
    111107
    112 /** Destroys local sockets.
    113  *
    114  * Releases all buffered packets and calls the release function for each of the
     108/** Destroy local sockets.
     109 *
     110 * Release all buffered packets and call the release function for each of the
    115111 * sockets.
    116112 *
    117  * @param[in] packet_phone The packet server phone to release buffered packets.
    118  * @param[in] local_sockets The local sockets to be destroyed.
    119  * @param[in,out] global_sockets The global sockets to be updated.
    120  * @param[in] socket_release The client release callback function.
    121  */
    122 void
    123 socket_cores_release(int packet_phone, socket_cores_t *local_sockets,
     113 * @param[in]     sess           Packet server session.
     114 * @param[in]     local_sockets  Local sockets to be destroyed.
     115 * @param[in,out] global_sockets Global sockets to be updated.
     116 * @param[in]     socket_release Client release callback function.
     117 *
     118 */
     119void socket_cores_release(async_sess_t *sess, socket_cores_t *local_sockets,
    124120    socket_ports_t *global_sockets,
    125121    void (* socket_release)(socket_core_t *socket))
    126122{
    127         int index;
    128 
    129123        if (!socket_cores_is_valid(local_sockets))
    130124                return;
    131 
     125       
    132126        local_sockets->magic = 0;
    133 
     127       
     128        int index;
    134129        for (index = 0; index < local_sockets->next; ++index) {
    135130                if (socket_cores_item_is_valid(&local_sockets->items[index])) {
    136131                        local_sockets->items[index].magic = 0;
    137 
     132                       
    138133                        if (local_sockets->items[index].value) {
    139                                 socket_destroy_core(packet_phone,
     134                                socket_destroy_core(sess,
    140135                                    local_sockets->items[index].value,
    141136                                    local_sockets, global_sockets,
     
    146141                }
    147142        }
    148 
     143       
    149144        free(local_sockets->items);
    150145}
     
    406401}
    407402
    408 /** Creates a new socket.
    409  *
    410  * @param[in,out] local_sockets The local sockets to be updated.
    411  * @param[in] app_phone The application phone.
    412  * @param[in] specific_data The socket specific data.
    413  * @param[in,out] socket_id The new socket identifier. A new identifier is
    414  *                      chosen if set to zero or negative. A negative identifier
    415  *                      is chosen if set to negative.
    416  * @return              EOK on success.
    417  * @return              EINVAL if the socket_id parameter is NULL.
    418  * @return              ENOMEM if there is not enough memory left.
    419  */
    420 int
    421 socket_create(socket_cores_t *local_sockets, int app_phone,
     403/** Create a new socket.
     404 *
     405 * @param[in,out] local_sockets Local sockets to be updated.
     406 * @param[in]     sess          Application session.
     407 * @param[in]     specific_data Socket specific data.
     408 * @param[in,out] socket_id     New socket identifier. A new identifier
     409 *                              is chosen if set to zero or negative.
     410 *                              A negative identifier is chosen if set
     411 *                              to negative.
     412 *
     413 * @return EOK on success.
     414 * @return EINVAL if the socket_id parameter is NULL.
     415 * @return ENOMEM if there is not enough memory left.
     416 *
     417 */
     418int socket_create(socket_cores_t *local_sockets, async_sess_t* sess,
    422419    void *specific_data, int *socket_id)
    423420{
     
    446443       
    447444        /* Initialize */
    448         socket->phone = app_phone;
     445        socket->sess = sess;
    449446        socket->port = -1;
    450447        socket->key = NULL;
     
    475472}
    476473
    477 /** Destroys the socket.
     474/** Destroy the socket.
    478475 *
    479476 * If the socket is bound, the port is released.
    480  * Releases all buffered packets, calls the release function and removes the
     477 * Release all buffered packets, call the release function and remove the
    481478 * socket from the local sockets.
    482479 *
    483  * @param[in] packet_phone The packet server phone to release buffered packets.
    484  * @param[in] socket_id The socket identifier.
    485  * @param[in,out] local_sockets The local sockets to be updated.
    486  * @param[in,out] global_sockets The global sockets to be updated.
    487  * @param[in] socket_release The client release callback function.
    488  * @return              EOK on success.
    489  * @return              ENOTSOCK if the socket is not found.
     480 * @param[in]     sess           Packet server session.
     481 * @param[in]     socket_id      Socket identifier.
     482 * @param[in,out] local_sockets  Local sockets to be updated.
     483 * @param[in,out] global_sockets Global sockets to be updated.
     484 * @param[in]     socket_release Client release callback function.
     485 *
     486 * @return EOK on success.
     487 * @return ENOTSOCK if the socket is not found.
     488 *
    490489 */
    491490int
    492 socket_destroy(int packet_phone, int socket_id, socket_cores_t *local_sockets,
     491socket_destroy(async_sess_t *sess, int socket_id, socket_cores_t *local_sockets,
    493492    socket_ports_t *global_sockets,
    494493    void (*socket_release)(socket_core_t *socket))
    495494{
    496         socket_core_t *socket;
    497         int accepted_id;
    498 
    499495        /* Find the socket */
    500         socket = socket_cores_find(local_sockets, socket_id);
     496        socket_core_t *socket = socket_cores_find(local_sockets, socket_id);
    501497        if (!socket)
    502498                return ENOTSOCK;
    503499       
    504500        /* Destroy all accepted sockets */
     501        int accepted_id;
    505502        while ((accepted_id = dyn_fifo_pop(&socket->accepted)) >= 0)
    506                 socket_destroy(packet_phone, accepted_id, local_sockets,
     503                socket_destroy(sess, accepted_id, local_sockets,
    507504                    global_sockets, socket_release);
    508505       
    509         socket_destroy_core(packet_phone, socket, local_sockets, global_sockets,
     506        socket_destroy_core(sess, socket, local_sockets, global_sockets,
    510507            socket_release);
    511508       
  • uspace/lib/net/tl/tl_common.c

    r55091847 r6b82009  
    4343#include <ip_interface.h>
    4444#include <tl_remote.h>
    45 
    4645#include <net/socket_codes.h>
    4746#include <net/in.h>
     
    5049#include <net/device.h>
    5150#include <net/packet.h>
    52 
    5351#include <async.h>
    5452#include <ipc/services.h>
     
    107105 * The reply is cached then.
    108106 *
    109  * @param[in] ip_phone  The IP moduel phone for (semi)remote calls.
    110  * @param[in] packet_dimensions The packet dimensions cache.
    111  * @param[in] device_id The device identifier.
    112  * @param[out] packet_dimension The IP packet dimensions.
    113  * @return              EOK on success.
    114  * @return              EBADMEM if the packet_dimension parameter is NULL.
    115  * @return              ENOMEM if there is not enough memory left.
    116  * @return              EINVAL if the packet_dimensions cache is not valid.
    117  * @return              Other codes as defined for the ip_packet_size_req()
    118  *                      function.
    119  */
    120 int
    121 tl_get_ip_packet_dimension(int ip_phone,
     107 * @param[in]  sess              IP module session.
     108 * @param[in]  packet_dimensions Packet dimensions cache.
     109 * @param[in]  device_id         Device identifier.
     110 * @param[out] packet_dimension  IP packet dimensions.
     111 *
     112 * @return EOK on success.
     113 * @return EBADMEM if the packet_dimension parameter is NULL.
     114 * @return ENOMEM if there is not enough memory left.
     115 * @return EINVAL if the packet_dimensions cache is not valid.
     116 * @return Other codes as defined for the ip_packet_size_req()
     117 *         function.
     118 *
     119 */
     120int tl_get_ip_packet_dimension(async_sess_t *sess,
    122121    packet_dimensions_t *packet_dimensions, device_id_t device_id,
    123122    packet_dimension_t **packet_dimension)
    124123{
    125         int rc;
    126        
    127124        if (!packet_dimension)
    128125                return EBADMEM;
     
    133130                /* Ask for and remember them if not found */
    134131                *packet_dimension = malloc(sizeof(**packet_dimension));
    135                 if(!*packet_dimension)
     132                if (!*packet_dimension)
    136133                        return ENOMEM;
    137134               
    138                 rc = ip_packet_size_req(ip_phone, device_id, *packet_dimension);
     135                int rc = ip_packet_size_req(sess, device_id, *packet_dimension);
    139136                if (rc != EOK) {
    140137                        free(*packet_dimension);
     
    236233/** Prepares the packet for ICMP error notification.
    237234 *
    238  * Keeps the first packet and releases all the others.
    239  * Releases all the packets on error.
    240  *
    241  * @param[in] packet_phone The packet server module phone.
    242  * @param[in] icmp_phone The ICMP module phone.
    243  * @param[in] packet    The packet to be send.
    244  * @param[in] error     The packet error reporting service. Prefixes the
    245  *                      received packet.
    246  * @return              EOK on success.
    247  * @return              ENOENT if no packet may be sent.
    248  */
    249 int
    250 tl_prepare_icmp_packet(int packet_phone, int icmp_phone, packet_t *packet,
    251     services_t error)
    252 {
    253         packet_t *next;
     235 * Keep the first packet and release all the others.
     236 * Release all the packets on error.
     237 *
     238 * @param[in] packet_sess Packet server module session.
     239 * @param[in] icmp_sess   ICMP module phone.
     240 * @param[in] packet      Packet to be send.
     241 * @param[in] error       Packet error reporting service. Prefixes the
     242 *                        received packet.
     243 *
     244 * @return EOK on success.
     245 * @return ENOENT if no packet may be sent.
     246 *
     247 */
     248int tl_prepare_icmp_packet(async_sess_t *packet_sess, async_sess_t *icmp_sess,
     249    packet_t *packet, services_t error)
     250{
     251        /* Detach the first packet and release the others */
     252        packet_t *next = pq_detach(packet);
     253        if (next)
     254                pq_release_remote(packet_sess, packet_get_id(next));
     255       
    254256        uint8_t *src;
    255         int length;
    256 
    257         /* Detach the first packet and release the others */
    258         next = pq_detach(packet);
    259         if (next)
    260                 pq_release_remote(packet_phone, packet_get_id(next));
    261        
    262         length = packet_get_addr(packet, &src, NULL);
    263         if ((length > 0) && (!error) && (icmp_phone >= 0) &&
     257        int length = packet_get_addr(packet, &src, NULL);
     258        if ((length > 0) && (!error) && (icmp_sess) &&
    264259            /*
    265260             * Set both addresses to the source one (avoids the source address
     
    269264                return EOK;
    270265        } else
    271                 pq_release_remote(packet_phone, packet_get_id(packet));
    272 
     266                pq_release_remote(packet_sess, packet_get_id(packet));
     267       
    273268        return ENOENT;
    274269}
     
    276271/** Receives data from the socket into a packet.
    277272 *
    278  * @param[in] packet_phone The packet server module phone.
    279  * @param[out] packet   The new created packet.
    280  * @param[in] prefix    Reserved packet data prefix length.
    281  * @param[in] dimension The packet dimension.
    282  * @param[in] addr      The destination address.
    283  * @param[in] addrlen   The address length.
    284  * @return              Number of bytes received.
    285  * @return              EINVAL if the client does not send data.
    286  * @return              ENOMEM if there is not enough memory left.
    287  * @return              Other error codes as defined for the
    288  *                      async_data_read_finalize() function.
    289  */
    290 int
    291 tl_socket_read_packet_data(int packet_phone, packet_t **packet, size_t prefix,
    292     const packet_dimension_t *dimension, const struct sockaddr *addr,
    293     socklen_t addrlen)
     273 * @param[in]  sess      Packet server module session.
     274 * @param[out] packet    New created packet.
     275 * @param[in]  prefix    Reserved packet data prefix length.
     276 * @param[in]  dimension Packet dimension.
     277 * @param[in]  addr      Destination address.
     278 * @param[in]  addrlen   Address length.
     279 *
     280 * @return Number of bytes received.
     281 * @return EINVAL if the client does not send data.
     282 * @return ENOMEM if there is not enough memory left.
     283 * @return Other error codes as defined for the
     284 *         async_data_read_finalize() function.
     285 *
     286 */
     287int tl_socket_read_packet_data(async_sess_t *sess, packet_t **packet,
     288    size_t prefix, const packet_dimension_t *dimension,
     289    const struct sockaddr *addr, socklen_t addrlen)
    294290{
    295291        ipc_callid_t callid;
     
    306302
    307303        /* Get a new packet */
    308         *packet = packet_get_4_remote(packet_phone, length, dimension->addr_len,
     304        *packet = packet_get_4_remote(sess, length, dimension->addr_len,
    309305            prefix + dimension->prefix, dimension->suffix);
    310306        if (!packet)
     
    314310        data = packet_suffix(*packet, length);
    315311        if (!data) {
    316                 pq_release_remote(packet_phone, packet_get_id(*packet));
     312                pq_release_remote(sess, packet_get_id(*packet));
    317313                return ENOMEM;
    318314        }
     
    321317        rc = async_data_write_finalize(callid, data, length);
    322318        if (rc != EOK) {
    323                 pq_release_remote(packet_phone, packet_get_id(*packet));
     319                pq_release_remote(sess, packet_get_id(*packet));
    324320                return rc;
    325321        }
     
    328324        rc = packet_set_addr(*packet, NULL, (uint8_t *) addr, addrlen);
    329325        if (rc != EOK) {
    330                 pq_release_remote(packet_phone, packet_get_id(*packet));
     326                pq_release_remote(sess, packet_get_id(*packet));
    331327                return rc;
    332328        }
  • uspace/lib/net/tl/tl_remote.c

    r55091847 r6b82009  
    3434#include <generic.h>
    3535#include <packet_client.h>
    36 
    3736#include <ipc/services.h>
    3837#include <ipc/tl.h>
    39 
    4038#include <net/device.h>
    4139#include <net/packet.h>
     40#include <async.h>
    4241
    4342/** Notify the remote transport layer modules about the received packet/s.
    4443 *
    45  * @param[in] tl_phone  The transport layer module phone used for remote calls.
    46  * @param[in] device_id The device identifier.
    47  * @param[in] packet    The received packet or the received packet queue.
     44 * @param[in] sess      Transport layer module session.
     45 * @param[in] device_id Device identifier.
     46 * @param[in] packet    Received packet or the received packet queue.
    4847 *                      The packet queue is used to carry a fragmented
    4948 *                      datagram. The first packet contains the headers,
    5049 *                      the others contain only data.
    51  * @param[in] target    The target transport layer module service to be
     50 * @param[in] target    Target transport layer module service to be
    5251 *                      delivered to.
    53  * @param[in] error     The packet error reporting service. Prefixes the
     52 * @param[in] error     Packet error reporting service. Prefixes the
    5453 *                      received packet.
    5554 *
     
    5756 *
    5857 */
    59 int tl_received_msg(int tl_phone, device_id_t device_id, packet_t *packet,
     58int tl_received_msg(async_sess_t *sess, device_id_t device_id, packet_t *packet,
    6059    services_t target, services_t error)
    6160{
    62         return generic_received_msg_remote(tl_phone, NET_TL_RECEIVED, device_id,
     61        return generic_received_msg_remote(sess, NET_TL_RECEIVED, device_id,
    6362            packet_get_id(packet), target, error);
    6463}
  • uspace/lib/net/tl/tl_skel.c

    r55091847 r6b82009  
    3838#include <bool.h>
    3939#include <errno.h>
     40#include <ns.h>
    4041#include <tl_skel.h>
    4142#include <net_interface.h>
    4243#include <net/modules.h>
    43 #include <async_obsolete.h>
    44 
    45 // FIXME: remove this header
    46 #include <kernel/ipc/ipc_methods.h>
    4744
    4845/** Default thread for new connections.
    4946 *
    50  * @param[in] iid       The initial message identifier.
    51  * @param[in] icall     The initial message call structure.
    52  * @param[in] arg       Local argument.
     47 * @param[in] iid   The initial message identifier.
     48 * @param[in] icall The initial message call structure.
     49 * @param[in] arg   Local argument.
    5350 *
    5451 */
     
    107104 *
    108105 */
    109 int tl_module_start(int service)
     106int tl_module_start(sysarg_t service)
    110107{
    111108        async_set_client_connection(tl_client_connection);
    112         int net_phone = net_connect_module();
    113         if (net_phone < 0)
    114                 return net_phone;
     109        async_sess_t *sess = net_connect_module();
     110        if (!sess)
     111                return ENOENT;
    115112       
    116113        int rc = pm_init();
     
    118115                return rc;
    119116       
    120         rc = tl_initialize(net_phone);
     117        rc = tl_initialize(sess);
    121118        if (rc != EOK)
    122119                goto out;
    123120       
    124         rc = async_obsolete_connect_to_me(PHONE_NS, service, 0, 0, NULL, NULL);
     121        rc = service_register(service);
    125122        if (rc != EOK)
    126123                goto out;
Note: See TracChangeset for help on using the changeset viewer.