Changes in / [b278b4e:ae972834] in mainline


Ignore:
Files:
3 added
17 edited

Legend:

Unmodified
Added
Removed
  • HelenOS.config

    rb278b4e rae972834  
    534534! CONFIG_WRITE_CORE_FILES (n/y)
    535535
     536% Bundle netif/nil network layer
     537! CONFIG_NETIF_NIL_BUNDLE (n/y)
     538
    536539% Strip binaries
    537540! CONFIG_STRIP_BINARIES (n/y)
  • uspace/lib/c/generic/net/socket_client.c

    rb278b4e rae972834  
    2727 */
    2828
    29 /** @addtogroup libc
     29/** @addtogroup libc 
    3030 *  @{
    3131 */
     
    177177//      .last_id = 0,
    178178        .sockets = NULL,
    179         .lock = FIBRIL_RWLOCK_INITIALIZER(socket_globals.lock)
     179        .lock = {
     180                .readers = 0,
     181                .writers = 0,
     182                .waiters = {
     183                        .prev = &socket_globals.lock.waiters,   /* XXX */
     184                        .next = &socket_globals.lock.waiters    /* XXX */
     185                }
     186        }
    180187};
    181188
     
    509516/** Sends message to the socket parent module with specified data.
    510517 *
    511  * @param[in] socket_id Socket identifier.
    512  * @param[in] message   The action message.
    513  * @param[in] arg2      The second message parameter.
    514  * @param[in] data      The data to be sent.
    515  * @param[in] datalength The data length.
    516  * @returns             EOK on success.
    517  * @returns             ENOTSOCK if the socket is not found.
    518  * @returns             EBADMEM if the data parameter is NULL.
    519  * @returns             NO_DATA if the datalength parameter is zero (0).
    520  * @returns             Other error codes as defined for the spcific message.
     518 *  @param[in] socket_id Socket identifier.
     519 *  @param[in] message  The action message.
     520 *  @param[in] arg2     The second message parameter.
     521 *  @param[in] data     The data to be sent.
     522 *  @param[in] datalength The data length.
     523 *  @returns            EOK on success.
     524 *  @returns            ENOTSOCK if the socket is not found.
     525 *  @returns            EBADMEM if the data parameter is NULL.
     526 *  @returns            NO_DATA if the datalength parameter is zero (0).
     527 *  @returns            Other error codes as defined for the spcific message.
    521528 */
    522529static int
     
    798805/** Sends data via the socket to the remote address.
    799806 *
    800  * Binds the socket to a free port if not already connected/bound.
    801  *
    802  * @param[in] message   The action message.
    803  * @param[in] socket_id Socket identifier.
    804  * @param[in] data      The data to be sent.
    805  * @param[in] datalength The data length.
    806  * @param[in] flags     Various send flags.
    807  * @param[in] toaddr    The destination address. May be NULL for connected
     807 *  Binds the socket to a free port if not already connected/bound.
     808 *
     809 *  @param[in] message  The action message.
     810 *  @param[in] socket_id Socket identifier.
     811 *  @param[in] data     The data to be sent.
     812 *  @param[in] datalength The data length.
     813 *  @param[in] flags    Various send flags.
     814 *  @param[in] toaddr   The destination address. May be NULL for connected
    808815 *                      sockets.
    809  * @param[in] addrlen   The address length. Used only if toaddr is not NULL.
    810  * @returns             EOK on success.
    811  * @returns             ENOTSOCK if the socket is not found.
    812  * @returns             EBADMEM if the data or toaddr parameter is NULL.
    813  * @returns             NO_DATA if the datalength or the addrlen parameter is
     816 *  @param[in] addrlen  The address length. Used only if toaddr is not NULL.
     817 *  @returns            EOK on success.
     818 *  @returns            ENOTSOCK if the socket is not found.
     819 *  @returns            EBADMEM if the data or toaddr parameter is NULL.
     820 *  @returns            NO_DATA if the datalength or the addrlen parameter is
    814821 *                      zero (0).
    815  * @returns             Other error codes as defined for the NET_SOCKET_SENDTO
     822 *  @returns            Other error codes as defined for the NET_SOCKET_SENDTO
    816823 *                      message.
    817824 */
     
    959966/** Receives data via the socket.
    960967 *
    961  * @param[in] message   The action message.
    962  * @param[in] socket_id Socket identifier.
    963  * @param[out] data     The data buffer to be filled.
    964  * @param[in] datalength The data length.
    965  * @param[in] flags     Various receive flags.
    966  * @param[out] fromaddr The source address. May be NULL for connected sockets.
    967  * @param[in,out] addrlen The address length. The maximum address length is
     968 *  @param[in] message  The action message.
     969 *  @param[in] socket_id Socket identifier.
     970 *  @param[out] data    The data buffer to be filled.
     971 *  @param[in] datalength The data length.
     972 *  @param[in] flags    Various receive flags.
     973 *  @param[out] fromaddr The source address. May be NULL for connected sockets.
     974 *  @param[in,out] addrlen The address length. The maximum address length is
    968975 *                      read. The actual address length is set. Used only if
    969976 *                      fromaddr is not NULL.
    970  * @returns             EOK on success.
    971  * @returns             ENOTSOCK if the socket is not found.
    972  * @returns             EBADMEM if the data parameter is NULL.
    973  * @returns             NO_DATA if the datalength or addrlen parameter is zero.
    974  * @returns             Other error codes as defined for the spcific message.
     977 *  @returns            EOK on success.
     978 *  @returns            ENOTSOCK if the socket is not found.
     979 *  @returns            EBADMEM if the data parameter is NULL.
     980 *  @returns            NO_DATA if the datalength or addrlen parameter is zero.
     981 *  @returns            Other error codes as defined for the spcific message.
    975982 */
    976983static int
  • uspace/lib/c/include/fibril_synch.h

    rb278b4e rae972834  
    4747} fibril_mutex_t;
    4848
    49 #define FIBRIL_MUTEX_INITIALIZER(name) \
    50         { \
     49#define FIBRIL_MUTEX_INITIALIZE(name) \
     50        fibril_mutex_t name = { \
    5151                .counter = 1, \
    5252                .waiters = { \
     
    5555                } \
    5656        }
    57        
    58 #define FIBRIL_MUTEX_INITIALIZE(name) \
    59         fibril_mutex_t name = FIBRIL_MUTEX_INITIALIZER(name)
    6057
    6158typedef struct {
     
    6562} fibril_rwlock_t;
    6663
    67 #define FIBRIL_RWLOCK_INITIALIZER(name) \
    68         { \
     64#define FIBRIL_RWLOCK_INITIALIZE(name) \
     65        fibril_rwlock_t name = { \
    6966                .readers = 0, \
    7067                .writers = 0, \
     
    7572        }
    7673
    77 #define FIBRIL_RWLOCK_INITIALIZE(name) \
    78         fibril_rwlock_t name = FIBRIL_RWLOCK_INITIALIZER(name)
    79 
    8074typedef struct {
    8175        link_t waiters;
    8276} fibril_condvar_t;
    8377
    84 #define FIBRIL_CONDVAR_INITIALIZER(name) \
    85         { \
     78#define FIBRIL_CONDVAR_INITIALIZE(name) \
     79        fibril_condvar_t name = { \
    8680                .waiters = { \
    8781                        .next = &name.waiters, \
     
    8983                } \
    9084        }
    91 
    92 #define FIBRIL_CONDVAR_INITIALIZE(name) \
    93         fibril_condvar_t name = FIBRIL_CONDVAR_INITIALIZER(name)
    9485
    9586extern void fibril_mutex_initialize(fibril_mutex_t *);
  • uspace/lib/net/Makefile

    rb278b4e rae972834  
    4141        netif/netif_local.c \
    4242        netif/netif_remote.c \
     43        netif/netif_nil_bundle.c \
    4344        nil/nil_remote.c \
    4445        il/ip_remote.c \
  • uspace/lib/net/include/arp_interface.h

    rb278b4e rae972834  
    104104 *  @param service The ARP module service. Ignored parameter.
    105105 *  @returns The ARP module phone on success.
     106 *  @returns 0 if called by the bundle module.
    106107 */
    107108extern int arp_connect_module(services_t service);
    108109
    109110/** Returns the ARP task identifier.
     111 *  @returns The current task identifier if called by the bundle module.
    110112 *  @returns 0 if called by the remote module.
    111113 */
  • uspace/lib/net/include/ip_interface.h

    rb278b4e rae972834  
    4444#include <ip_codes.h>
    4545
     46#ifdef CONFIG_IL_TL_BUNDLE
     47
     48#include <ip_local.h>
     49
     50#define ip_received_error_msg  ip_received_error_msg_local
     51#define ip_set_gateway_req     ip_set_gateway_req_local
     52#define ip_packet_size_req     ip_packet_size_req_local
     53#define ip_device_req          ip_device_req_local
     54#define ip_add_route_req       ip_add_route_req_local
     55#define ip_send_msg            ip_send_msg_local
     56#define ip_get_route_req       ip_get_route_req_local
     57
     58#else
     59
    4660#include <ip_remote.h>
    4761
     
    5367#define ip_send_msg            ip_send_msg_remote
    5468#define ip_get_route_req       ip_get_route_req_remote
     69
     70#endif
    5571
    5672/** @name IP module interface
     
    84100 *  @param service The IP module service. Ignored parameter.
    85101 *  @returns The IP module phone on success.
     102 *  @returns 0 if called by the bundle module.
    86103 */
    87104extern int ip_connect_module(services_t service);
  • uspace/lib/net/include/net_interface.h

    rb278b4e rae972834  
    8585 *  @param service The networking module service. Ignored parameter.
    8686 *  @returns The networking module phone on success.
     87 *  @returns 0 if called by the bundle module.
    8788 */
    8889extern int net_connect_module(services_t service);
  • uspace/lib/net/include/netif_interface.h

    rb278b4e rae972834  
    3434#define __NET_NETIF_INTERFACE_H__
    3535
     36#ifdef CONFIG_NETIF_NIL_BUNDLE
     37
     38#include <netif_local.h>
     39#include <netif_nil_bundle.h>
     40#include <packet/packet_server.h>
     41
     42#define netif_module_message    netif_nil_module_message
     43#define netif_module_start      netif_nil_module_start
     44#define netif_get_addr_req      netif_get_addr_req_local
     45#define netif_probe_req         netif_probe_req_local
     46#define netif_send_msg          netif_send_msg_local
     47#define netif_start_req         netif_start_req_local
     48#define netif_stop_req          netif_stop_req_local
     49#define netif_stats_req         netif_stats_req_local
     50#define netif_bind_service      netif_bind_service_local
     51
     52#else /* CONFIG_NETIF_NIL_BUNDLE */
     53
    3654#include <netif_remote.h>
    3755#include <packet_client.h>
     
    4765#define netif_bind_service      netif_bind_service_remote
    4866
     67#endif /* CONFIG_NETIF_NIL_BUNDLE */
     68
    4969#endif
    5070
  • uspace/lib/net/include/netif_local.h

    rb278b4e rae972834  
    3434 * Network interface module skeleton.
    3535 * The skeleton has to be part of each network interface module.
     36 * The skeleton can be also part of the module bundled with the network interface layer.
    3637 */
    3738
  • uspace/lib/net/include/nil_interface.h

    rb278b4e rae972834  
    6868
    6969
     70#ifdef CONFIG_NETIF_NIL_BUNDLE
     71
     72#include <nil_local.h>
     73#include <packet/packet_server.h>
     74
     75#define nil_device_state_msg  nil_device_state_msg_local
     76#define nil_received_msg      nil_received_msg_local
     77
     78#else /* CONFIG_NETIF_NIL_BUNDLE */
     79
    7080#include <nil_remote.h>
    7181#include <packet/packet_server.h>
     
    7484#define nil_received_msg      nil_received_msg_remote
    7585
     86#endif /* CONFIG_NETIF_NIL_BUNDLE */
     87
    7688#endif
    7789
  • uspace/lib/net/tl/tl_common.c

    rb278b4e rae972834  
    5050#include <net_device.h>
    5151#include <icmp_interface.h>
     52#include <ip_local.h>
    5253#include <ip_remote.h>
    5354#include <ip_interface.h>
  • uspace/lib/socket/include/icmp_common.h

    rb278b4e rae972834  
    5050 *  @param[in] timeout The connection timeout in microseconds. No timeout if set to zero (0).
    5151 *  @returns The ICMP module phone on success.
     52 *  @returns The ICMP socket identifier if called by the bundle module.
    5253 *  @returns ETIMEOUT if the connection timeouted.
    5354 */
  • uspace/lib/socket/packet/packet_server.c

    rb278b4e rae972834  
    8585        unsigned int count;
    8686} ps_globals = {
    87         .lock = FIBRIL_MUTEX_INITIALIZER(ps_globals.lock),
     87        .lock = {
     88                .counter = 1,
     89                .waiters = {
     90                        .prev = &ps_globals.lock.waiters,
     91                        .next = &ps_globals.lock.waiters,
     92                }
     93        },
    8894        .free = {NULL, NULL, NULL, NULL, NULL, NULL, NULL},
    8995        .sizes = {PAGE_SIZE, PAGE_SIZE * 2, PAGE_SIZE * 4, PAGE_SIZE * 8, PAGE_SIZE * 16, PAGE_SIZE * 32, PAGE_SIZE * 64},
  • uspace/srv/net/il/ip/ip.c

    rb278b4e rae972834  
    623623int ip_connect_module(services_t service){
    624624        return EOK;
     625}
     626
     627int ip_bind_service(services_t service, int protocol, services_t me, async_client_conn_t receiver, tl_received_msg_t received_msg){
     628        return ip_register(protocol, me, 0, received_msg);
    625629}
    626630
  • uspace/srv/net/net/net_standalone.c

    rb278b4e rae972834  
    9494 * @return EOK on success.
    9595 * @return ENOTSUP if the message is not known.
    96  * @return Other error codes.
     96 * @return Other error codes as defined for each bundled module
     97 *         message function.
    9798 *
    9899 */
  • uspace/srv/net/nil/eth/eth.c

    rb278b4e rae972834  
    788788}
    789789
     790#ifndef CONFIG_NETIF_NIL_BUNDLE
     791
    790792/** Default thread for new connections.
    791793 *
     
    837839}
    838840
     841#endif /* CONFIG_NETIF_NIL_BUNDLE */
     842
    839843/** @}
    840844 */
  • uspace/srv/net/nil/nildummy/nildummy.c

    rb278b4e rae972834  
    410410}
    411411
     412#ifndef CONFIG_NETIF_NIL_BUNDLE
     413
    412414/** Default thread for new connections.
    413415 *
     
    459461}
    460462
     463#endif /* CONFIG_NETIF_NIL_BUNDLE */
     464
    461465/** @}
    462466 */
Note: See TracChangeset for help on using the changeset viewer.