Changes in / [ae972834:b278b4e] in mainline


Ignore:
Files:
3 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • HelenOS.config

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

    rae972834 rb278b4e  
    2727 */
    2828
    29 /** @addtogroup libc 
     29/** @addtogroup libc
    3030 *  @{
    3131 */
     
    177177//      .last_id = 0,
    178178        .sockets = NULL,
    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         }
     179        .lock = FIBRIL_RWLOCK_INITIALIZER(socket_globals.lock)
    187180};
    188181
     
    516509/** Sends message to the socket parent module with specified data.
    517510 *
    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.
     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.
    528521 */
    529522static int
     
    805798/** Sends data via the socket to the remote address.
    806799 *
    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
     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
    815808 *                      sockets.
    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
     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
    821814 *                      zero (0).
    822  *  @returns            Other error codes as defined for the NET_SOCKET_SENDTO
     815 * @returns             Other error codes as defined for the NET_SOCKET_SENDTO
    823816 *                      message.
    824817 */
     
    966959/** Receives data via the socket.
    967960 *
    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
     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
    975968 *                      read. The actual address length is set. Used only if
    976969 *                      fromaddr is not NULL.
    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.
     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.
    982975 */
    983976static int
  • uspace/lib/c/include/fibril_synch.h

    rae972834 rb278b4e  
    4747} fibril_mutex_t;
    4848
    49 #define FIBRIL_MUTEX_INITIALIZE(name) \
    50         fibril_mutex_t name = { \
     49#define FIBRIL_MUTEX_INITIALIZER(name) \
     50        { \
    5151                .counter = 1, \
    5252                .waiters = { \
     
    5555                } \
    5656        }
     57       
     58#define FIBRIL_MUTEX_INITIALIZE(name) \
     59        fibril_mutex_t name = FIBRIL_MUTEX_INITIALIZER(name)
    5760
    5861typedef struct {
     
    6265} fibril_rwlock_t;
    6366
    64 #define FIBRIL_RWLOCK_INITIALIZE(name) \
    65         fibril_rwlock_t name = { \
     67#define FIBRIL_RWLOCK_INITIALIZER(name) \
     68        { \
    6669                .readers = 0, \
    6770                .writers = 0, \
     
    7275        }
    7376
     77#define FIBRIL_RWLOCK_INITIALIZE(name) \
     78        fibril_rwlock_t name = FIBRIL_RWLOCK_INITIALIZER(name)
     79
    7480typedef struct {
    7581        link_t waiters;
    7682} fibril_condvar_t;
    7783
    78 #define FIBRIL_CONDVAR_INITIALIZE(name) \
    79         fibril_condvar_t name = { \
     84#define FIBRIL_CONDVAR_INITIALIZER(name) \
     85        { \
    8086                .waiters = { \
    8187                        .next = &name.waiters, \
     
    8389                } \
    8490        }
     91
     92#define FIBRIL_CONDVAR_INITIALIZE(name) \
     93        fibril_condvar_t name = FIBRIL_CONDVAR_INITIALIZER(name)
    8594
    8695extern void fibril_mutex_initialize(fibril_mutex_t *);
  • uspace/lib/net/Makefile

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

    rae972834 rb278b4e  
    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.
    107106 */
    108107extern int arp_connect_module(services_t service);
    109108
    110109/** Returns the ARP task identifier.
    111  *  @returns The current task identifier if called by the bundle module.
    112110 *  @returns 0 if called by the remote module.
    113111 */
  • uspace/lib/net/include/ip_interface.h

    rae972834 rb278b4e  
    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 
    6046#include <ip_remote.h>
    6147
     
    6753#define ip_send_msg            ip_send_msg_remote
    6854#define ip_get_route_req       ip_get_route_req_remote
    69 
    70 #endif
    7155
    7256/** @name IP module interface
     
    10084 *  @param service The IP module service. Ignored parameter.
    10185 *  @returns The IP module phone on success.
    102  *  @returns 0 if called by the bundle module.
    10386 */
    10487extern int ip_connect_module(services_t service);
  • uspace/lib/net/include/net_interface.h

    rae972834 rb278b4e  
    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.
    8887 */
    8988extern int net_connect_module(services_t service);
  • uspace/lib/net/include/netif_interface.h

    rae972834 rb278b4e  
    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 
    5436#include <netif_remote.h>
    5537#include <packet_client.h>
     
    6547#define netif_bind_service      netif_bind_service_remote
    6648
    67 #endif /* CONFIG_NETIF_NIL_BUNDLE */
    68 
    6949#endif
    7050
  • uspace/lib/net/include/netif_local.h

    rae972834 rb278b4e  
    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.
    3736 */
    3837
  • uspace/lib/net/include/nil_interface.h

    rae972834 rb278b4e  
    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 
    8070#include <nil_remote.h>
    8171#include <packet/packet_server.h>
     
    8474#define nil_received_msg      nil_received_msg_remote
    8575
    86 #endif /* CONFIG_NETIF_NIL_BUNDLE */
    87 
    8876#endif
    8977
  • uspace/lib/net/tl/tl_common.c

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

    rae972834 rb278b4e  
    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.
    5352 *  @returns ETIMEOUT if the connection timeouted.
    5453 */
  • uspace/lib/socket/packet/packet_server.c

    rae972834 rb278b4e  
    8585        unsigned int count;
    8686} ps_globals = {
    87         .lock = {
    88                 .counter = 1,
    89                 .waiters = {
    90                         .prev = &ps_globals.lock.waiters,
    91                         .next = &ps_globals.lock.waiters,
    92                 }
    93         },
     87        .lock = FIBRIL_MUTEX_INITIALIZER(ps_globals.lock),
    9488        .free = {NULL, NULL, NULL, NULL, NULL, NULL, NULL},
    9589        .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

    rae972834 rb278b4e  
    623623int ip_connect_module(services_t service){
    624624        return EOK;
    625 }
    626 
    627 int 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);
    629625}
    630626
  • uspace/srv/net/net/net_standalone.c

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

    rae972834 rb278b4e  
    788788}
    789789
    790 #ifndef CONFIG_NETIF_NIL_BUNDLE
    791 
    792790/** Default thread for new connections.
    793791 *
     
    839837}
    840838
    841 #endif /* CONFIG_NETIF_NIL_BUNDLE */
    842 
    843839/** @}
    844840 */
  • uspace/srv/net/nil/nildummy/nildummy.c

    rae972834 rb278b4e  
    410410}
    411411
    412 #ifndef CONFIG_NETIF_NIL_BUNDLE
    413 
    414412/** Default thread for new connections.
    415413 *
     
    461459}
    462460
    463 #endif /* CONFIG_NETIF_NIL_BUNDLE */
    464 
    465461/** @}
    466462 */
Note: See TracChangeset for help on using the changeset viewer.