Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4702 → Rev 4703

/branches/network/uspace/srv/net/netif/netif_module.h
51,10 → 51,6
*/
int netif_initialize( void );
 
/** Automatically probes all known devices.
*/
int netif_probe_auto_message( void );
 
/** Probes the existence of the device.
* @param device_id The device identifier. Input parameter.
* @param irq The device interrupt number. Input parameter.
102,6 → 98,16
*/
int netif_get_addr_message( device_id_t device_id, measured_string_ref address );
 
/** Processes the netif driver specific message.
* This function is called for uncommon messages received by the netif skeleton.
* @param callid The message identifier. Input parameter.
* @param call The message parameters. Input parameter.
* @param answer The message answer parameters. Output parameter.
* @param answer_count The last parameter for the actual answer in the answer parameter. Output parameter.
* @returns EOK on success.
* @returns ENOTSUP if the message is not known.
* @returns Other error codes as defined for the specific module message implementation.
*/
int netif_specific_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count );
 
/** Returns the device usage statistics.
/branches/network/uspace/srv/net/netif/netif_remote.c
68,6 → 68,17
return async_req_1_0( netif_phone, NET_NETIF_STOP, device_id );
}
 
int netif_stats_req( int netif_phone, device_id_t device_id, device_stats_ref stats ){
aid_t message_id;
ipcarg_t result;
 
if( ! stats ) return EBADMEM;
message_id = async_send_1( netif_phone, NET_NETIF_STATS, ( ipcarg_t ) device_id, NULL );
ipc_data_read_start( netif_phone, stats, sizeof( * stats ));
async_wait_for( message_id, & result );
return ( int ) result;
}
 
int netif_bind_service( services_t service, device_id_t device_id, services_t me, async_client_conn_t receiver ){
return bind_service( service, device_id, me, 0, receiver );
}
/branches/network/uspace/srv/net/netif/netif_messages.h
30,8 → 30,9
* @{
*/
 
/**
* @file
/** @file
* Network interface common module messages.
* @see netif_interface.h
*/
 
#ifndef __NET_NETIF_MESSAGES_H__
41,29 → 42,51
 
#include "../messages.h"
 
/** Network interface common module messages.
*/
typedef enum {
/* ( device_id, irq, io ) */
/** Probe device message.
* @see netif_probe_req()
*/
NET_NETIF_PROBE = NET_NETIF_FIRST,
/* () not supported, should ask networking for a name and register device */
NET_NETIF_PROBE_AUTO,
/* ( device_id, packet_id ) */
/** Send packet message.
* @see netif_send_msg()
*/
NET_NETIF_SEND,
/* ( device_id ) */
/** Start device message.
* @see netif_start_req()
*/
NET_NETIF_START,
/* ( device_id ), ipc_data_read( stats ) */
/** Get device usage statistics message.
* @see netif_stats_req()
*/
NET_NETIF_STATS,
/* ( device_id ) */
/** Stop device message.
* @see netif_stop_req()
*/
NET_NETIF_STOP,
/* */
NET_NETIF_SET_ADDR,
/* */
/** Get device address message.
* @see netif_get_addr_req()
*/
NET_NETIF_GET_ADDR,
} netif_messages;
 
/** @name Network interface specific message parameters definitions
*/
/*@{*/
 
/** Returns the interrupt number message parameter.
* @param call The message call structure. Input parameter.
*/
#define NETIF_GET_IRQ( call ) ( int ) IPC_GET_ARG2( * call )
 
/** Returns the input/output address message parameter.
* @param call The message call structure. Input parameter.
*/
#define NETIF_GET_IO( call ) ( int ) IPC_GET_ARG3( * call )
 
/*@}*/
 
#endif
 
/** @}
/branches/network/uspace/srv/net/netif/netif.c
65,6 → 65,10
 
DEVICE_MAP_IMPLEMENT( device_map, device_t )
 
/** @name Message processing functions
*/
/*@{*/
 
/** Registers the device notification receiver, the network interface layer module.
* @param device_id The device identifier. Input parameter.
* @param phone The network interface layer module phone. Input parameter.
74,6 → 78,8
*/
int register_message( device_id_t device_id, int phone );
 
/*@}*/
 
int netif_probe_req( int netif_phone, device_id_t device_id, int irq, int io ){
int result;
 
140,6 → 146,15
return result;
}
 
int netif_stats_req( int netif_phone, device_id_t device_id, device_stats_ref stats ){
int res;
 
fibril_rwlock_read_lock( & netif_globals.lock );
res = netif_get_device_stats( device_id, stats );
fibril_rwlock_read_unlock( & netif_globals.lock );
return res;
}
 
int netif_get_addr( int netif_phone, device_id_t device_id, measured_string_ref * address, char ** data ){
ERROR_DECLARE;
 
197,11 → 212,6
switch( IPC_GET_METHOD( * call )){
case IPC_M_PHONE_HUNGUP:
return EOK;
case NET_NETIF_PROBE_AUTO:
fibril_rwlock_write_lock( & netif_globals.lock );
ERROR_CODE = netif_probe_auto_message();
fibril_rwlock_write_unlock( & netif_globals.lock );
return ERROR_CODE;
case NET_NETIF_PROBE:
return netif_probe_req( 0, IPC_GET_DEVICE( call ), NETIF_GET_IRQ( call ), NETIF_GET_IO( call ));
case IPC_M_CONNECT_TO_ME:
/branches/network/uspace/srv/net/netif/dp8390/dp8390_module.c
176,10 → 176,6
ipc_answer_0( iid, EOK );
}
 
int netif_probe_auto_message( void ){
return ENOTSUP;
}
 
int netif_probe_message( device_id_t device_id, int irq, int io ){
ERROR_DECLARE;
 
/branches/network/uspace/srv/net/netif/lo/lo.c
165,16 → 165,6
printf( "%s", NAME );
}
 
int netif_probe_auto_message( void ){
/* ERROR_DECLARE;
 
device_ref device;
 
ERROR_PROPAGATE( create( arg1, & device ));
ipc_call_sync_3_3( netif_globals.net_phone, NET_NET_DEVICE, device->device_id, NULL, NULL, NULL, NULL, NULL );
*/ return ENOTSUP;
}
 
int netif_probe_message( device_id_t device_id, int irq, int io ){
ERROR_DECLARE;