Subversion Repositories HelenOS

Rev

Rev 4703 | Rev 4715 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4703 Rev 4707
Line 50... Line 50...
50
#define NET_NETIF_COUNT     6
50
#define NET_NETIF_COUNT     6
51
#define NET_NET_COUNT       9
51
#define NET_NET_COUNT       9
52
#define NET_NIL_COUNT       7
52
#define NET_NIL_COUNT       7
53
#define NET_ETH_COUNT       0
53
#define NET_ETH_COUNT       0
54
#define NET_IL_COUNT        6
54
#define NET_IL_COUNT        6
55
#define NET_IP_COUNT        2
55
#define NET_IP_COUNT        3
56
#define NET_ARP_COUNT       5
56
#define NET_ARP_COUNT       5
57
#define NET_RARP_COUNT      0
57
#define NET_RARP_COUNT      0
58
#define NET_ICMP_COUNT      0
58
#define NET_ICMP_COUNT      6
59
#define NET_TL_COUNT        1
59
#define NET_TL_COUNT        1
60
#define NET_UDP_COUNT       0
60
#define NET_UDP_COUNT       0
61
#define NET_TCP_COUNT       0
61
#define NET_TCP_COUNT       0
62
#define NET_PACKET_COUNT    5
62
#define NET_PACKET_COUNT    5
63
#define NET_SOCKET_COUNT    14
63
#define NET_SOCKET_COUNT    14
Line 112... Line 112...
112
#define IS_NET_ETH_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_ETH_FIRST, NET_ETH_LAST )
112
#define IS_NET_ETH_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_ETH_FIRST, NET_ETH_LAST )
113
#define IS_NET_IL_MESSAGE( call )       IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_IL_FIRST, NET_IL_LAST )
113
#define IS_NET_IL_MESSAGE( call )       IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_IL_FIRST, NET_IL_LAST )
114
#define IS_NET_IP_MESSAGE( call )       IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_IP_FIRST, NET_IP_LAST )
114
#define IS_NET_IP_MESSAGE( call )       IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_IP_FIRST, NET_IP_LAST )
115
#define IS_NET_ARP_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_ARP_FIRST, NET_ARP_LAST )
115
#define IS_NET_ARP_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_ARP_FIRST, NET_ARP_LAST )
116
#define IS_NET_RARP_MESSAGE( call )     IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_RARP_FIRST, NET_RARP_LAST )
116
#define IS_NET_RARP_MESSAGE( call )     IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_RARP_FIRST, NET_RARP_LAST )
-
 
117
#define IS_NET_ICMP_MESSAGE( call )     IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_ICMP_FIRST, NET_ICMP_LAST )
117
#define IS_NET_TL_MESSAGE( call )       IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_TL_FIRST, NET_TL_LAST )
118
#define IS_NET_TL_MESSAGE( call )       IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_TL_FIRST, NET_TL_LAST )
118
#define IS_NET_UDP_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_UDP_FIRST, NET_UDP_LAST )
119
#define IS_NET_UDP_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_UDP_FIRST, NET_UDP_LAST )
119
#define IS_NET_TCP_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_TCP_FIRST, NET_TCP_LAST )
120
#define IS_NET_TCP_MESSAGE( call )      IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_TCP_FIRST, NET_TCP_LAST )
120
#define IS_NET_SOCKET_MESSAGE( call )   IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_SOCKET_FIRST, NET_SOCKET_LAST )
121
#define IS_NET_SOCKET_MESSAGE( call )   IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_SOCKET_FIRST, NET_SOCKET_LAST )
121
#define IS_NET_PACKET_MESSAGE( call )   IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_PACKET_FIRST, NET_PACKET_LAST )
122
#define IS_NET_PACKET_MESSAGE( call )   IS_IN_INTERVAL( IPC_GET_METHOD( * call ), NET_PACKET_FIRST, NET_PACKET_LAST )
Line 138... Line 139...
138
 */
139
 */
139
#define IPC_GET_SERVICE( call )     ( services_t ) IPC_GET_ARG3( * call )
140
#define IPC_GET_SERVICE( call )     ( services_t ) IPC_GET_ARG3( * call )
140
#define IPC_GET_TARGET( call )      ( services_t ) IPC_GET_ARG3( * call )
141
#define IPC_GET_TARGET( call )      ( services_t ) IPC_GET_ARG3( * call )
141
#define IPC_GET_SENDER( call )      ( services_t ) IPC_GET_ARG3( * call )
142
#define IPC_GET_SENDER( call )      ( services_t ) IPC_GET_ARG3( * call )
142
 
143
 
-
 
144
#define IPC_GET_ERROR( call )       ( services_t ) IPC_GET_ARG4( * call )
-
 
145
 
143
#define IPC_GET_PHONE( call )       ( int ) IPC_GET_ARG5( * call )
146
#define IPC_GET_PHONE( call )       ( int ) IPC_GET_ARG5( * call )
144
 
147
 
145
#define IPC_SET_ADDR( answer )      (( size_t * ) & IPC_GET_ARG1( * answer ))
148
#define IPC_SET_ADDR( answer )      (( size_t * ) & IPC_GET_ARG1( * answer ))
146
#define IPC_SET_PREFIX( answer )    (( size_t * ) & IPC_GET_ARG2( * answer ))
149
#define IPC_SET_PREFIX( answer )    (( size_t * ) & IPC_GET_ARG2( * answer ))
147
#define IPC_SET_CONTENT( answer )   (( size_t * ) & IPC_GET_ARG3( * answer ))
150
#define IPC_SET_CONTENT( answer )   (( size_t * ) & IPC_GET_ARG3( * answer ))
Line 200... Line 203...
200
        free( * data );
203
        free( * data );
201
    }
204
    }
202
    return ( int ) result;
205
    return ( int ) result;
203
}
206
}
204
 
207
 
205
static inline int   generic_send_msg( int phone, int message, device_id_t device_id, packet_id_t packet_id, services_t sender ){
208
static inline int   generic_send_msg( int phone, int message, device_id_t device_id, packet_id_t packet_id, services_t sender, services_t error ){
-
 
209
    if( error ){
-
 
210
        async_msg_4( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t ) packet_id, ( ipcarg_t ) sender, ( ipcarg_t ) error );
-
 
211
    }else{
206
    async_msg_3( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t ) packet_id, ( ipcarg_t ) sender );
212
        async_msg_3( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t ) packet_id, ( ipcarg_t ) sender );
-
 
213
    }
207
    return EOK;
214
    return EOK;
208
}
215
}
209
 
216
 
210
static inline int   generic_packet_size_req( int phone, int message, device_id_t device_id, size_t * addr_len, size_t * prefix, size_t * content, size_t * suffix ){
217
static inline int   generic_packet_size_req( int phone, int message, device_id_t device_id, size_t * addr_len, size_t * prefix, size_t * content, size_t * suffix ){
211
    return ( int ) async_req_1_4( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t * ) addr_len, ( ipcarg_t * ) prefix, ( ipcarg_t * ) content, ( ipcarg_t * ) suffix );
218
    return ( int ) async_req_1_4( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t * ) addr_len, ( ipcarg_t * ) prefix, ( ipcarg_t * ) content, ( ipcarg_t * ) suffix );
Line 214... Line 221...
214
static inline int   generic_device_state_msg( int phone, int message, device_id_t device_id, int state, services_t target ){
221
static inline int   generic_device_state_msg( int phone, int message, device_id_t device_id, int state, services_t target ){
215
    async_msg_3( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t ) state, target );
222
    async_msg_3( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t ) state, target );
216
    return EOK;
223
    return EOK;
217
}
224
}
218
 
225
 
219
static inline int   generic_received_msg( int phone, int message, device_id_t device_id, packet_id_t packet_id, services_t target ){
226
static inline int   generic_received_msg( int phone, int message, device_id_t device_id, packet_id_t packet_id, services_t target, services_t error ){
-
 
227
    if( error ){
-
 
228
        async_msg_4( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t ) packet_id, ( ipcarg_t ) target, ( ipcarg_t ) error );
-
 
229
    }else{
220
    async_msg_3( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t ) packet_id, ( ipcarg_t ) target );
230
        async_msg_3( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t ) packet_id, ( ipcarg_t ) target );
-
 
231
    }
221
    return EOK;
232
    return EOK;
222
}
233
}
223
 
234
 
224
static inline int   generic_device_req( int phone, int message, device_id_t device_id, int arg2, services_t service ){
235
static inline int   generic_device_req( int phone, int message, device_id_t device_id, int arg2, services_t service ){
225
    return ( int ) async_req_3_0( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t ) arg2, ( ipcarg_t ) service );
236
    return ( int ) async_req_3_0( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t ) arg2, ( ipcarg_t ) service );