Rev 4698 | Rev 4743 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4698 | Rev 4703 | ||
|---|---|---|---|
| Line 63... | Line 63... | ||
| 63 | */ |
63 | */ |
| 64 | extern netif_globals_t netif_globals; |
64 | extern netif_globals_t netif_globals; |
| 65 | 65 | ||
| 66 | DEVICE_MAP_IMPLEMENT( device_map, device_t ) |
66 | DEVICE_MAP_IMPLEMENT( device_map, device_t ) |
| 67 | 67 | ||
| - | 68 | /** @name Message processing functions |
|
| - | 69 | */ |
|
| - | 70 | /*@{*/ |
|
| - | 71 | ||
| 68 | /** Registers the device notification receiver, the network interface layer module. |
72 | /** Registers the device notification receiver, the network interface layer module. |
| 69 | * @param device_id The device identifier. Input parameter. |
73 | * @param device_id The device identifier. Input parameter. |
| 70 | * @param phone The network interface layer module phone. Input parameter. |
74 | * @param phone The network interface layer module phone. Input parameter. |
| 71 | * @returns EOK on success. |
75 | * @returns EOK on success. |
| 72 | * @returns ENOENT if there is no such device. |
76 | * @returns ENOENT if there is no such device. |
| 73 | * @returns ELIMIT if there is another module registered. |
77 | * @returns ELIMIT if there is another module registered. |
| 74 | */ |
78 | */ |
| 75 | int register_message( device_id_t device_id, int phone ); |
79 | int register_message( device_id_t device_id, int phone ); |
| 76 | 80 | ||
| - | 81 | /*@}*/ |
|
| - | 82 | ||
| 77 | int netif_probe_req( int netif_phone, device_id_t device_id, int irq, int io ){ |
83 | int netif_probe_req( int netif_phone, device_id_t device_id, int irq, int io ){ |
| 78 | int result; |
84 | int result; |
| 79 | 85 | ||
| 80 | fibril_rwlock_write_lock( & netif_globals.lock ); |
86 | fibril_rwlock_write_lock( & netif_globals.lock ); |
| 81 | result = netif_probe_message( device_id, irq, io ); |
87 | result = netif_probe_message( device_id, irq, io ); |
| Line 138... | Line 144... | ||
| 138 | fibril_rwlock_write_unlock( & netif_globals.lock ); |
144 | fibril_rwlock_write_unlock( & netif_globals.lock ); |
| 139 | } |
145 | } |
| 140 | return result; |
146 | return result; |
| 141 | } |
147 | } |
| 142 | 148 | ||
| - | 149 | int netif_stats_req( int netif_phone, device_id_t device_id, device_stats_ref stats ){ |
|
| - | 150 | int res; |
|
| - | 151 | ||
| - | 152 | fibril_rwlock_read_lock( & netif_globals.lock ); |
|
| - | 153 | res = netif_get_device_stats( device_id, stats ); |
|
| - | 154 | fibril_rwlock_read_unlock( & netif_globals.lock ); |
|
| - | 155 | return res; |
|
| - | 156 | } |
|
| - | 157 | ||
| 143 | int netif_get_addr( int netif_phone, device_id_t device_id, measured_string_ref * address, char ** data ){ |
158 | int netif_get_addr( int netif_phone, device_id_t device_id, measured_string_ref * address, char ** data ){ |
| 144 | ERROR_DECLARE; |
159 | ERROR_DECLARE; |
| 145 | 160 | ||
| 146 | measured_string_t translation; |
161 | measured_string_t translation; |
| 147 | 162 | ||
| Line 195... | Line 210... | ||
| 195 | // printf( "message %d - %d\n", IPC_GET_METHOD( * call ), NET_NETIF_FIRST ); |
210 | // printf( "message %d - %d\n", IPC_GET_METHOD( * call ), NET_NETIF_FIRST ); |
| 196 | * answer_count = 0; |
211 | * answer_count = 0; |
| 197 | switch( IPC_GET_METHOD( * call )){ |
212 | switch( IPC_GET_METHOD( * call )){ |
| 198 | case IPC_M_PHONE_HUNGUP: |
213 | case IPC_M_PHONE_HUNGUP: |
| 199 | return EOK; |
214 | return EOK; |
| 200 | case NET_NETIF_PROBE_AUTO: |
- | |
| 201 | fibril_rwlock_write_lock( & netif_globals.lock ); |
- | |
| 202 | ERROR_CODE = netif_probe_auto_message(); |
- | |
| 203 | fibril_rwlock_write_unlock( & netif_globals.lock ); |
- | |
| 204 | return ERROR_CODE; |
- | |
| 205 | case NET_NETIF_PROBE: |
215 | case NET_NETIF_PROBE: |
| 206 | return netif_probe_req( 0, IPC_GET_DEVICE( call ), NETIF_GET_IRQ( call ), NETIF_GET_IO( call )); |
216 | return netif_probe_req( 0, IPC_GET_DEVICE( call ), NETIF_GET_IRQ( call ), NETIF_GET_IO( call )); |
| 207 | case IPC_M_CONNECT_TO_ME: |
217 | case IPC_M_CONNECT_TO_ME: |
| 208 | fibril_rwlock_write_lock( & netif_globals.lock ); |
218 | fibril_rwlock_write_lock( & netif_globals.lock ); |
| 209 | ERROR_CODE = register_message( IPC_GET_DEVICE( call ), IPC_GET_PHONE( call )); |
219 | ERROR_CODE = register_message( IPC_GET_DEVICE( call ), IPC_GET_PHONE( call )); |