/branches/network/uspace/srv/net/netif/netif_device_id_type.h |
---|
File deleted |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/branches/network/uspace/srv/net/netif/device.h |
---|
0,0 → 1,97 |
/* |
* Copyright (c) 2008 Lukas Mejdrech |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup net |
* @{ |
*/ |
/** |
* @file |
*/ |
#include "../int_map.h" |
#ifndef __NET_DEVICE_ID_TYPE_H__ |
#define __NET_DEVICE_ID_TYPE_H__ |
#define DEVICE_MAP_DECLARE INT_MAP_DECLARE |
#define DEVICE_MAP_IMPLEMENT INT_MAP_IMPLEMENT |
typedef int device_id_t; |
typedef enum device_state device_state_t; |
typedef struct device_stats device_stats_t; |
typedef device_stats_t * device_stats_ref; |
enum device_state{ |
NETIF_NULL = 0, |
NETIF_STOPPED, |
NETIF_ACTIVE, |
NETIF_CARRIER_LOST |
}; |
// based on linux_kernel/include/linux/netdevice.h |
struct device_stats{ |
unsigned long rx_packets; /* total packets received */ |
unsigned long tx_packets; /* total packets transmitted */ |
unsigned long rx_bytes; /* total bytes received */ |
unsigned long tx_bytes; /* total bytes transmitted */ |
unsigned long rx_errors; /* bad packets received */ |
unsigned long tx_errors; /* packet transmit problems */ |
unsigned long rx_dropped; /* no space in linux buffers */ |
unsigned long tx_dropped; /* no space available in linux */ |
unsigned long multicast; /* multicast packets received */ |
unsigned long collisions; |
/* detailed rx_errors: */ |
unsigned long rx_length_errors; |
unsigned long rx_over_errors; /* receiver ring buff overflow */ |
unsigned long rx_crc_errors; /* recved pkt with crc error */ |
unsigned long rx_frame_errors; /* recv'd frame alignment error */ |
unsigned long rx_fifo_errors; /* recv'r fifo overrun */ |
unsigned long rx_missed_errors; /* receiver missed packet */ |
/* detailed tx_errors */ |
unsigned long tx_aborted_errors; |
unsigned long tx_carrier_errors; |
unsigned long tx_fifo_errors; |
unsigned long tx_heartbeat_errors; |
unsigned long tx_window_errors; |
/* for cslip etc */ |
unsigned long rx_compressed; |
unsigned long tx_compressed; |
}; |
#endif |
/** @} |
*/ |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:mergeinfo |
/branches/network/uspace/srv/net/netif/netif.c |
---|
35,6 → 35,7 |
#include <async.h> |
#include <stdio.h> |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
//#include <sys/mman.h> |
42,36 → 43,53 |
#include "../err.h" |
#include "../messages.h" |
#include "../modules.h" |
#include "../packet.h" |
#include "device.h" |
#include "netif.h" |
#include "netif_device_id_type.h" |
#define IPC_GET_DEVICE( call ) ( device_id_t ) IPC_GET_ARG1( * call ) |
#define IPC_GET_IRQ( call ) ( int ) IPC_GET_ARG2( * call ) |
#define IPC_GET_IO( call ) ( int ) IPC_GET_ARG3( * call ) |
#define IPC_GET_PHONE( call ) ( int ) IPC_GET_ARG5( * call ) |
extern netif_globals_t netif_globals; |
extern int netif_initialize( void ); |
extern void netif_print_name( void ); |
extern int netif_probe_auto_message( ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ); |
extern int netif_probe_message( ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ); |
extern int netif_send_message( ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ); |
extern int netif_start_message( ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ); |
extern int netif_stop_message( ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ); |
extern int initialize( void ); |
extern int probe_auto_message( void ); |
extern int probe_message( device_id_t device_id, int irq, int io ); |
extern int send_message( device_id_t device_id, packet_t packet ); |
extern int start_message( device_id_t device_id ); |
extern int stop_message( device_id_t device_id ); |
DEVICE_MAP_IMPLEMENT( netif_device_map, netif_device_t ) |
DEVICE_MAP_IMPLEMENT( device_map, device_t ) |
int netif_message( ipc_callid_t callid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ); |
int netif_start_module( void ( * client_connection )( ipc_callid_t iid, ipc_call_t * icall )); |
int module_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count ); |
int netif_start_module( async_client_conn_t client_connection ); |
int register_message( device_id_t device_id, int phone ); |
int get_device_stats( device_id_t device_id, device_stats_ref * stats ); |
int netif_device_find( netif_device_id_t device_id, netif_device_ref * device ){ |
* device = netif_device_map_find( & netif_globals.netif_device_map, device_id ); |
int find_device( device_id_t device_id, device_ref * device ){ |
* device = device_map_find( & netif_globals.device_map, device_id ); |
if( ! * device ) return ENOENT; |
if(( ** device ).state == NETIF_NULL ) return EPERM; |
return EOK; |
} |
void netif_device_stats_null( netif_device_stats_ref stats ) |
{ |
//memset( stats, 0, sizeof( netif_device_t )); |
stats->rx_packets = 0; |
int get_device_stats( device_id_t device_id, device_stats_ref * stats ){ |
ERROR_DECLARE; |
device_ref device; |
if( ! stats ) return EINVAL; |
ERROR_PROPAGATE( find_device( device_id, & device )); |
* stats = & device->stats; |
return EOK; |
} |
void null_device_stats( device_stats_ref stats ){ |
memset( stats, 0, sizeof( device_stats_t )); |
/* stats->rx_packets = 0; |
stats->tx_packets = 0; |
stats->rx_bytes = 0; |
stats->tx_bytes = 0; |
94,58 → 112,65 |
stats->tx_window_errors = 0; |
stats->rx_compressed = 0; |
stats->tx_compressed = 0; |
*/ |
} |
int netif_message( ipc_callid_t callid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ){ |
int register_message( device_id_t device_id, int phone ){ |
ERROR_DECLARE; |
device_ref device; |
ERROR_PROPAGATE( find_device( device_id, & device )); |
if( device->nil_phone ) return ELIMIT; |
device->nil_phone = phone; |
return EOK; |
} |
int netif_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count ){ |
ERROR_DECLARE; |
size_t length; |
netif_device_ref device; |
device_stats_ref stats; |
packet_t packet; |
// printf( "\nNETIF message %d", method ); |
switch( method ){ |
* answer_count = 0; |
switch( IPC_GET_METHOD( * call )){ |
case IPC_M_PHONE_HUNGUP: |
return EOK; |
case NET_NETIF_PROBE_AUTO: |
return netif_probe_auto_message( arg1, arg2, arg3, result1, result2, result3 ); |
return probe_auto_message(); |
case NET_NETIF_PROBE: |
return netif_probe_message( arg1, arg2, arg3, result1, result2, result3 ); |
case NET_NETIF_REGISTER: |
case NET_LL_REGISTER: |
ERROR_PROPAGATE( netif_device_find( arg1, & device )); |
device->ll_registered = connect_to_service( arg2 ); |
return EOK; |
return probe_message( IPC_GET_DEVICE( call ), IPC_GET_IRQ( call ), IPC_GET_IO( call )); |
case IPC_M_CONNECT_TO_ME: |
return register_message( IPC_GET_DEVICE( call ), IPC_GET_PHONE( call )); |
case NET_NETIF_SEND: |
return netif_send_message( arg1, arg2, arg3, result1, result2, result3 ); |
ERROR_PROPAGATE( packet_receive( & packet )); |
return send_message( IPC_GET_DEVICE( call ), packet ); |
case NET_NETIF_START: |
return netif_start_message( arg1, arg2, arg3, result1, result2, result3 ); |
return start_message( IPC_GET_DEVICE( call )); |
case NET_NETIF_STATS: |
ERROR_PROPAGATE( ipc_data_read_receive( & callid, & length )); |
if( length < sizeof( netif_device_stats_t )){ |
ipc_answer_0( callid, EOVERFLOW ); |
return EOVERFLOW; |
} |
if( ERROR_OCCURED( netif_device_find( arg1, & device ))){ |
ipc_answer_0( callid, ERROR_CODE ); |
return ERROR_CODE; |
} |
return ipc_data_read_finalize( callid, & device->stats, sizeof( netif_device_stats_t )); |
if( length < sizeof( device_stats_t )) return EOVERFLOW; |
ERROR_PROPAGATE( get_device_stats( IPC_GET_DEVICE( call ), & stats )); |
return ipc_data_read_finalize( callid, stats, sizeof( device_stats_t )); |
case NET_NETIF_STOP: |
return netif_stop_message( arg1, arg2, arg3, result1, result2, result3 ); |
return stop_message( IPC_GET_DEVICE( call )); |
} |
return ENOTSUP; |
} |
int netif_start_module( void ( * client_connection )( ipc_callid_t iid, ipc_call_t * icall )){ |
services_t need[ 2 ]; |
int * need_phone[ 2 ]; |
int netif_start_module( async_client_conn_t client_connection ){ |
ERROR_DECLARE; |
need[ 0 ] = SERVICE_NETWORKING; |
need[ 1 ] = NULL; |
need_phone[ 0 ] = & netif_globals.networking_phone; |
need_phone[ 1 ] = NULL; |
netif_device_map_initialize( & netif_globals.netif_device_map ); |
return start_service( NULL, need, need_phone, client_connection, netif_initialize ); |
async_set_client_connection( client_connection ); |
netif_globals.networking_phone = connect_to_service( SERVICE_NETWORKING ); |
device_map_initialize( & netif_globals.device_map ); |
ERROR_PROPAGATE( initialize()); |
async_manager(); |
return EOK; |
} |
/** @} |
/branches/network/uspace/srv/net/netif/lo.c |
---|
36,14 → 36,15 |
#include <async.h> |
#include <errno.h> |
#include <stdio.h> |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
//#include <sys/mman.h> |
#include "../err.h" |
#include "../measured_strings.h" |
#include "../messages.h" |
#include "../modules.h" |
#include "../packet.h" |
#include "netif.h" |
53,49 → 54,45 |
netif_globals_t netif_globals; |
void change_state( netif_device_ref device, netif_state_t state ); |
int change_state_message( netif_device_id_t device_id, netif_state_t state ); |
int netif_create( netif_device_id_t device_id, netif_device_ref * device ); |
int netif_call( ipc_callid_t callid ); |
int netif_initialize( void ); |
int change_state_message( device_id_t device_id, device_state_t state ); |
int create( device_id_t device_id, device_ref * device ); |
int initialize( void ); |
void netif_print_name( void ); |
int netif_probe_auto_message( ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ); |
int netif_probe_message( ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ); |
int netif_send_message( ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ); |
int netif_start_message( ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ); |
int netif_stop_message( ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ); |
int probe_auto_message( void ); |
int probe_message( device_id_t device_id, int irq, int io ); |
int send_message( device_id_t device_id, packet_t packet ); |
int start_message( device_id_t device_id ); |
int stop_message( device_id_t device_id ); |
void change_state( netif_device_ref device, netif_state_t state ){ |
device->state = state; |
ll_message( device, NET_LL_DEVICE_STATE_CHANGED, device->state, NULL, NULL, NULL, NULL ); |
} |
int change_state_message( netif_device_id_t device_id, netif_state_t state ){ |
int change_state_message( device_id_t device_id, device_state_t state ){ |
ERROR_DECLARE; |
netif_device_ref device; |
device_ref device; |
ERROR_PROPAGATE( netif_device_find( device_id, & device )); |
change_state( device, state ); |
ERROR_PROPAGATE( find_device( device_id, & device )); |
if( device->state != state ){ |
device->state = state; |
nil_message( device, NET_NIL_DEVICE_STATE, device->state, NULL, NULL, NULL, NULL ); |
} |
return EOK; |
} |
int netif_create( netif_device_id_t device_id, netif_device_ref * device ){ |
int create( device_id_t device_id, device_ref * device ){ |
ERROR_DECLARE; |
if( netif_device_map_count( & netif_globals.netif_device_map ) > 0 ){ |
if( device_map_count( & netif_globals.device_map ) > 0 ){ |
return EXDEV; |
}else{ |
* device = ( netif_device_ref ) malloc( sizeof( netif_device_t )); |
* device = ( device_ref ) malloc( sizeof( device_t )); |
if( !( * device )) return ENOMEM; |
( ** device ).device_id = device_id; |
( ** device ).ll_registered = -1; |
( ** device ).nil_phone = -1; |
( ** device ).specific = NULL; |
netif_device_stats_null( &(( ** device ).stats )); |
null_device_stats( &(( ** device ).stats )); |
( ** device ).state = NETIF_STOPPED; |
( ** device ).flags = NULL; |
( ** device ).mtu = DEFAULT_MTU; |
if( ERROR_OCCURED( netif_device_map_add( & netif_globals.netif_device_map, ( ** device ).device_id, * device ))){ |
if( ERROR_OCCURED( device_map_add( & netif_globals.device_map, ( ** device ).device_id, * device ))){ |
free( * device ); |
* device = NULL; |
return ERROR_CODE; |
104,11 → 101,7 |
return EOK; |
} |
int netif_call( ipc_callid_t callid ){ |
return EOK; |
} |
int netif_initialize( void ){ |
int initialize( void ){ |
ipcarg_t phonehash; |
return REGISTER_ME( SERVICE_LO, & phonehash ); |
118,20 → 111,20 |
printf( NAME ); |
} |
int netif_probe_auto_message( ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ){ |
int probe_auto_message( void ){ |
/* ERROR_DECLARE; |
netif_device_ref device; |
device_ref device; |
ERROR_PROPAGATE( netif_create( arg1, & device )); |
ipc_call_sync_3_3( netif_globals.networking_phone, NET_NETWORKING_DEVICE, device->device_id, NULL, NULL, NULL, NULL, NULL ); |
ERROR_PROPAGATE( create( arg1, & device )); |
ipc_call_sync_3_3( netif_globals.networking_phone, NET_NET_DEVICE, device->device_id, NULL, NULL, NULL, NULL, NULL ); |
*/ return ENOTSUP; |
} |
int netif_probe_message( ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ){ |
int probe_message( device_id_t device_id, int irq, int io ){ |
ERROR_DECLARE; |
netif_device_ref device; |
device_ref device; |
aid_t message; |
ipc_call_t answer; |
measured_string_t configuration[ 1 ] = {{ "MTU", 3 }}; |
140,9 → 133,9 |
char * data; |
// create a new device |
ERROR_PROPAGATE( netif_create( arg1, & device )); |
ERROR_PROPAGATE( create( device_id, & device )); |
// get configuration |
message = async_send_2( netif_globals.networking_phone, NET_NETWORKING_GET_DEVICE_CONFIGURATION, device->device_id, count, & answer ); |
message = async_send_2( netif_globals.networking_phone, NET_NET_GET_DEVICE_CONF, device->device_id, count, & answer ); |
// send names and get settings |
if( ERROR_OCCURED( measured_strings_send( netif_globals.networking_phone, configuration, count )) |
|| ERROR_OCCURED( measured_strings_return( netif_globals.networking_phone, & settings, & data, count ))){ |
156,7 → 149,7 |
device->mtu = DEFAULT_MTU; |
} |
// print the settings |
printf("\n -MTU=%d", device->mtu ); |
printf("\n -MTU =\t%d", device->mtu ); |
free( settings ); |
free( data ); |
// end request |
164,31 → 157,44 |
return EOK; |
} |
int netif_send_message( ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ){ |
int send_message( device_id_t device_id, packet_t packet ){ |
ERROR_DECLARE; |
netif_device_ref device; |
device_ref device; |
size_t length; |
aid_t message; |
ipc_call_t answer; |
ipcarg_t result; |
packet_t received; |
ERROR_PROPAGATE( netif_device_find( arg1, & device )); |
if( device->state == NETIF_ACTIVE ){ |
++ device->stats.tx_packets; |
++ device->stats.rx_packets; |
// TODO packet size |
//device->stats->tx_bytes += ; |
//device->stats->rx_bytes += ; |
ll_message( device, NET_LL_RECEIVED, arg2, NULL, NULL, NULL, NULL ); |
ERROR_PROPAGATE( find_device( device_id, & device )); |
if( device->state != NETIF_ACTIVE ) return EPERM; |
++ device->stats.tx_packets; |
++ device->stats.rx_packets; |
length = packet_get_data_length( packet ); |
device->stats.tx_bytes += length; |
device->stats.rx_bytes += length; |
received = packet_copy( packet ); |
packet_destroy( packet ); |
if( ! received ){ |
++ device->stats.rx_dropped; |
return EOK; |
}else{ |
return EPERM; |
} |
message = async_send_1( device->nil_phone, NET_NIL_RECEIVED, ( device_id ), & answer ); |
if( ERROR_OCCURED( packet_send( received, device->nil_phone ))){ |
++ device->stats.rx_dropped; |
} |
async_wait_for( message, & result ); |
if( result != EOK ) ++ device->stats.rx_dropped; |
return EOK; |
} |
int netif_start_message( ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ){ |
return change_state_message( arg1, NETIF_ACTIVE ); |
int start_message( device_id_t device_id ){ |
return change_state_message( device_id, NETIF_ACTIVE ); |
} |
int netif_stop_message( ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t * result1, ipcarg_t * result2, ipcarg_t * result3 ){ |
return change_state_message( arg1, NETIF_STOPPED ); |
int stop_message( device_id_t device_id ){ |
return change_state_message( device_id, NETIF_STOPPED ); |
} |
/** @} |
/branches/network/uspace/srv/net/netif/netif.h |
---|
37,79 → 37,34 |
#ifndef __NET_NETIF_H__ |
#define __NET_NETIF_H__ |
#include "netif_device_id_type.h" |
#include "device.h" |
#define ll_message( device, message, arg2, arg3, result1, result2, result3 ) \ |
if(( device )->ll_registered >= 0 ) async_msg_3(( device )->ll_registered, ( message ), ( device )->device_id, arg2, arg3 ) |
#define nil_message( device, message, arg2, arg3, result1, result2, result3 ) \ |
if(( device )->nil_phone >= 0 ) async_msg_3(( device )->nil_phone, ( message ), ( device )->device_id, arg2, arg3 ) |
typedef enum netif_state netif_state_t; |
typedef struct device device_t; |
typedef device_t * device_ref; |
typedef struct netif_globals netif_globals_t; |
typedef struct netif_device_stats netif_device_stats_t; |
typedef netif_device_stats_t * netif_device_stats_ref; |
typedef struct netif_device netif_device_t; |
typedef netif_device_t * netif_device_ref; |
typedef struct netif_globals netif_globals_t; |
DEVICE_MAP_DECLARE( device_map, device_t ); |
DEVICE_MAP_DECLARE( netif_device_map, netif_device_t ); |
enum netif_state{ |
NETIF_NULL = 0, |
NETIF_STOPPED, |
NETIF_ACTIVE, |
NETIF_CARRIER_LOST |
struct device{ |
device_id_t device_id; |
int nil_phone; |
device_stats_t stats; |
device_state_t state; |
int flags; |
size_t mtu; |
void * specific; |
}; |
// based on linux_kernel/include/linux/netdevice.h |
struct netif_device_stats{ |
unsigned long rx_packets; /* total packets received */ |
unsigned long tx_packets; /* total packets transmitted */ |
unsigned long rx_bytes; /* total bytes received */ |
unsigned long tx_bytes; /* total bytes transmitted */ |
unsigned long rx_errors; /* bad packets received */ |
unsigned long tx_errors; /* packet transmit problems */ |
unsigned long rx_dropped; /* no space in linux buffers */ |
unsigned long tx_dropped; /* no space available in linux */ |
unsigned long multicast; /* multicast packets received */ |
unsigned long collisions; |
/* detailed rx_errors: */ |
unsigned long rx_length_errors; |
unsigned long rx_over_errors; /* receiver ring buff overflow */ |
unsigned long rx_crc_errors; /* recved pkt with crc error */ |
unsigned long rx_frame_errors; /* recv'd frame alignment error */ |
unsigned long rx_fifo_errors; /* recv'r fifo overrun */ |
unsigned long rx_missed_errors; /* receiver missed packet */ |
/* detailed tx_errors */ |
unsigned long tx_aborted_errors; |
unsigned long tx_carrier_errors; |
unsigned long tx_fifo_errors; |
unsigned long tx_heartbeat_errors; |
unsigned long tx_window_errors; |
/* for cslip etc */ |
unsigned long rx_compressed; |
unsigned long tx_compressed; |
}; |
struct netif_device{ |
netif_device_id_t device_id; |
int ll_registered; |
netif_device_stats_t stats; |
netif_state_t state; |
int flags; |
size_t mtu; |
void * specific; |
}; |
struct netif_globals{ |
int networking_phone; |
netif_device_map_t netif_device_map; |
int networking_phone; |
device_map_t device_map; |
}; |
int netif_device_find( netif_device_id_t device_id, netif_device_ref * device ); |
void netif_device_stats_null( netif_device_stats_ref stats ); |
int find_device( device_id_t device_id, device_ref * device ); |
void null_device_stats( device_stats_ref stats ); |
#endif |
/branches/network/uspace/srv/net/netif/Makefile |
---|
45,9 → 45,10 |
$(NETIF).c \ |
../measured_strings.h \ |
../module.c \ |
../modules.c |
../modules.c \ |
../packet.c |
DEFS += -D NETWORKING_$(NETWORKING) -D $(NETIF)_call=module_call -D $(NETIF)_message=module_message -D $(NETIF)_start_module=module_start -D $(NETIF)_print_name=module_print_name |
DEFS += -D $(NETIF)_message=module_message -D $(NETIF)_start_module=module_start -D $(NETIF)_print_name=module_print_name |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
OBJECTS += $(addsuffix .o,$(basename $(OUTPUT))) |