50,8 → 50,8 |
#define NET_NET_COUNT 9 |
#define NET_NIL_COUNT 7 |
#define NET_ETH_COUNT 0 |
#define NET_IL_COUNT 3 |
#define NET_IP_COUNT 2 |
#define NET_IL_COUNT 4 |
#define NET_IP_COUNT 0 |
#define NET_ARP_COUNT 4 |
#define NET_RARP_COUNT 0 |
#define NET_ICMP_COUNT 0 |
60,7 → 60,7 |
#define NET_PACKET_COUNT 5 |
#define NET_SOCKET_COUNT 0 |
|
#define NET_FIRST 2000 |
#define NET_FIRST 2000 |
|
#define NET_NETIF_FIRST NET_FIRST |
#define NET_NETIF_LAST ( NET_NETIF_FIRST + NET_NETIF_COUNT ) |
74,9 → 74,9 |
#define NET_ETH_LAST ( NET_ETH_FIRST + NET_ETH_COUNT ) |
|
#define NET_IL_FIRST ( NET_ETH_LAST + 0 ) |
#define NET_IL_LAST ( NET_IL_FIRST + NET_IL_COUNT ) |
#define NET_IL_LAST ( NET_IL_FIRST + NET_IL_COUNT ) |
#define NET_IP_FIRST ( NET_IL_LAST + 0 ) |
#define NET_IP_LAST ( NET_IP_FIRST + NET_IP_COUNT ) |
#define NET_IP_LAST ( NET_IP_FIRST + NET_IP_COUNT ) |
|
#define NET_ARP_FIRST ( NET_IP_LAST + 0 ) |
#define NET_ARP_LAST ( NET_ARP_FIRST + NET_ARP_COUNT ) |
95,9 → 95,9 |
#define NET_PACKET_FIRST ( NET_SOCKET_LAST + 0 ) |
#define NET_PACKET_LAST ( NET_PACKET_FIRST + NET_PACKET_COUNT ) |
|
#define NET_LAST NET_PACKET_LAST |
#define NET_LAST NET_PACKET_LAST |
|
#define NET_COUNT ( NET_LAST - NET_FIRST ) |
#define NET_COUNT ( NET_LAST - NET_FIRST ) |
|
#define IS_IN_INTERVAL( item, first_inclusive, last_exclusive ) ((( item ) >= ( first_inclusive )) && (( item ) < ( last_exclusive ))) |
|
121,7 → 121,7 |
/** Returns the packet identifier message parameter. |
*/ |
#define IPC_GET_PACKET( call ) ( packet_id_t ) IPC_GET_ARG2( * call ) |
|
#define IPC_GET_COUNT( call ) ( int ) IPC_GET_ARG2( * call ) |
#define IPC_GET_STATE( call ) ( device_state_t ) IPC_GET_ARG2( * call ) |
|
/** Returns the device driver service message parameter. |
156,22 → 156,6 |
NET_NET_STOP, |
/* ( device_id ) ipc_data_read( stats ) */ |
NET_NET_STATS, |
/* ( device_id, nil_service ) */ |
NET_IL_DEVICE = NET_IL_FIRST, |
/* ( device_id, state ) */ |
NET_IL_DEVICE_STATE, |
/* ( device_id ), packet_send */ |
NET_IL_RECEIVED, |
/* ( device_id ), measured_strings_send( address ) */ |
// NET_IL_MY_ADDR, |
NET_IP_ECHO = NET_IP_FIRST, |
/* ( packet_id ) */ |
NET_IP_SEND, |
NET_PACKET_CREATE_1 = NET_PACKET_FIRST, |
NET_PACKET_CREATE_4, |
NET_PACKET_GET, |
NET_PACKET_GET_SIZE, |
NET_PACKET_RELEASE |
} net_messages; |
|
static inline int generic_get_addr( int phone, int message, device_id_t device_id, measured_string_ref * address, char ** data ){ |
180,7 → 164,7 |
int string; |
|
if( !( address && data )) return EBADMEM; |
message_id = async_send_1( phone, message, device_id, NULL ); |
message_id = async_send_1( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, NULL ); |
string = measured_strings_return( phone, address, data, 1 ); |
async_wait_for( message_id, & result ); |
if(( string == EOK ) && ( result != EOK )){ |
187,27 → 171,48 |
free( * address ); |
free( * data ); |
} |
return result; |
return ( int ) result; |
} |
|
static inline void generic_send_msg( int phone, int message, device_id_t device_id, packet_id_t packet_id, services_t sender ){ |
async_msg_3( phone, message, device_id, packet_id, sender ); |
static inline int generic_translate_req( int phone, int message, device_id_t device_id, services_t service, measured_string_ref configuration, size_t count, measured_string_ref * translation, char ** data ){ |
aid_t message_id; |
ipcarg_t result; |
int string; |
|
if( !( configuration && ( count > 0 ))) return EINVAL; |
if( !( translation && data )) return EBADMEM; |
message_id = async_send_3( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t ) count, ( ipcarg_t ) service, NULL ); |
measured_strings_send( phone, configuration, count ); |
string = measured_strings_return( phone, translation, data, count ); |
async_wait_for( message_id, & result ); |
if(( string == EOK ) && ( result != EOK )){ |
free( * translation ); |
free( * data ); |
} |
return ( int ) result; |
} |
|
static inline int generic_send_msg( int phone, int message, device_id_t device_id, packet_id_t packet_id, services_t sender ){ |
async_msg_3( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t ) packet_id, ( ipcarg_t ) sender ); |
return EOK; |
} |
|
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 ){ |
return async_req_1_4( phone, message, device_id, ( ipcarg_t * ) addr_len, ( ipcarg_t * ) prefix, ( ipcarg_t * ) content, ( ipcarg_t * ) suffix ); |
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 ); |
} |
|
static inline void generic_device_state_msg( int phone, int message, device_id_t device_id, int state ){ |
async_msg_2( phone, message, device_id, state ); |
static inline int generic_device_state_msg( int phone, int message, device_id_t device_id, int state ){ |
async_msg_2( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t ) state ); |
return EOK; |
} |
|
static inline void generic_received_msg( int phone, int message, device_id_t device_id, packet_id_t packet_id, services_t target ){ |
async_msg_3( phone, message, device_id, packet_id, target ); |
static inline int generic_received_msg( int phone, int message, device_id_t device_id, packet_id_t packet_id, services_t target ){ |
async_msg_3( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t ) packet_id, ( ipcarg_t ) target ); |
return EOK; |
} |
|
static inline int generic_device_req( int phone, int message, device_id_t device_id, int arg2, services_t service ){ |
return async_req_3_0( phone, message, device_id, arg2, service ); |
return ( int ) async_req_3_0( phone, ( ipcarg_t ) message, ( ipcarg_t ) device_id, ( ipcarg_t ) arg2, ( ipcarg_t ) service ); |
} |
|
#endif |