Subversion Repositories HelenOS

Rev

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

Rev 3886 Rev 3901
Line 43... Line 43...
43
#include "../err.h"
43
#include "../err.h"
44
#include "../messages.h"
44
#include "../messages.h"
45
#include "../modules.h"
45
#include "../modules.h"
46
 
46
 
47
#include "../structures/packet/packet.h"
47
#include "../structures/packet/packet.h"
-
 
48
#include "../structures/packet/packet_client.h"
48
 
49
 
49
#include "device.h"
50
#include "device.h"
50
#include "netif.h"
51
#include "netif.h"
51
 
52
 
52
#define IPC_GET_DEVICE( call )      ( device_id_t ) IPC_GET_ARG1( * call )
53
#define IPC_GET_DEVICE( call )      ( device_id_t ) IPC_GET_ARG1( * call )
-
 
54
#define IPC_GET_PACKET( call )      ( packet_id_t ) IPC_GET_ARG2( * call )
53
#define IPC_GET_IRQ( call )     ( int ) IPC_GET_ARG2( * call )
55
#define IPC_GET_IRQ( call )     ( int ) IPC_GET_ARG2( * call )
54
#define IPC_GET_IO( call )      ( int ) IPC_GET_ARG3( * call )
56
#define IPC_GET_IO( call )      ( int ) IPC_GET_ARG3( * call )
55
#define IPC_GET_PHONE( call )       ( int ) IPC_GET_ARG5( * call )
57
#define IPC_GET_PHONE( call )       ( int ) IPC_GET_ARG5( * call )
56
 
58
 
57
extern netif_globals_t netif_globals;
59
extern netif_globals_t netif_globals;
Line 144... Line 146...
144
        case NET_NETIF_PROBE:
146
        case NET_NETIF_PROBE:
145
            return probe_message( IPC_GET_DEVICE( call ), IPC_GET_IRQ( call ), IPC_GET_IO( call ));
147
            return probe_message( IPC_GET_DEVICE( call ), IPC_GET_IRQ( call ), IPC_GET_IO( call ));
146
        case IPC_M_CONNECT_TO_ME:
148
        case IPC_M_CONNECT_TO_ME:
147
            return register_message( IPC_GET_DEVICE( call ), IPC_GET_PHONE( call ));
149
            return register_message( IPC_GET_DEVICE( call ), IPC_GET_PHONE( call ));
148
        case NET_NETIF_SEND:
150
        case NET_NETIF_SEND:
149
            ERROR_PROPAGATE( packet_receive( & packet ));
151
            ERROR_PROPAGATE( packet_translate( netif_globals.networking_phone, & packet, IPC_GET_PACKET( call )));
150
            return send_message( IPC_GET_DEVICE( call ), packet );
152
            return send_message( IPC_GET_DEVICE( call ), packet );
151
        case NET_NETIF_START:
153
        case NET_NETIF_START:
152
            return start_message( IPC_GET_DEVICE( call ));
154
            return start_message( IPC_GET_DEVICE( call ));
153
        case NET_NETIF_STATS:
155
        case NET_NETIF_STATS:
154
            ERROR_PROPAGATE( ipc_data_read_receive( & callid, & length ));
156
            ERROR_PROPAGATE( ipc_data_read_receive( & callid, & length ));
Line 166... Line 168...
166
 
168
 
167
    async_set_client_connection( client_connection );
169
    async_set_client_connection( client_connection );
168
    netif_globals.networking_phone = connect_to_service( SERVICE_NETWORKING );
170
    netif_globals.networking_phone = connect_to_service( SERVICE_NETWORKING );
169
    device_map_initialize( & netif_globals.device_map );
171
    device_map_initialize( & netif_globals.device_map );
170
    ERROR_PROPAGATE( initialize());
172
    ERROR_PROPAGATE( initialize());
171
 
-
 
-
 
173
    ERROR_PROPAGATE( pm_init());
172
    async_manager();
174
    async_manager();
173
 
175
 
174
    return EOK;
176
    return EOK;
175
}
177
}
176
 
178