199,7 → 199,7 |
* @returns ENOENT if the service is not known. |
* @returns ENOMEM if there is not enough memory left. |
*/ |
int nil_register_message( services_t service, int phone ); |
int eth_register_message( services_t service, int phone ); |
|
/** Returns the device packet dimensions for sending. |
* @param device_id The device identifier. Input parameter. |
306,6 → 306,7 |
measured_string_ref configuration; |
size_t count = sizeof( names ) / sizeof( measured_string_t ); |
char * data; |
eth_proto_ref proto; |
|
fibril_rwlock_write_lock( & eth_globals.devices_lock ); |
// an existing device? |
319,6 → 320,17 |
// update mtu |
device->mtu = mtu; |
printf( "Device %d already exists:\tMTU\t= %d\n", device->device_id, device->mtu ); |
fibril_rwlock_write_unlock( & eth_globals.devices_lock ); |
// notify all upper layer modules |
fibril_rwlock_read_lock( & eth_globals.protos_lock ); |
for( index = 0; index < eth_protos_count( & eth_globals.protos ); ++ index ){ |
proto = eth_protos_get_index( & eth_globals.protos, index ); |
if ( proto->phone ){ |
il_mtu_changed_msg( proto->phone, device->device_id, device->mtu, proto->service ); |
} |
} |
fibril_rwlock_read_unlock( & eth_globals.protos_lock ); |
return EOK; |
} |
}else{ |
// create a new device |
506,7 → 518,7 |
return ( * address ) ? EOK : ENOENT; |
} |
|
int nil_register_message( services_t service, int phone ){ |
int eth_register_message( services_t service, int phone ){ |
eth_proto_ref proto; |
int protocol; |
int index; |
648,7 → 660,7 |
case IPC_M_PHONE_HUNGUP: |
return EOK; |
case NET_NIL_DEVICE: |
return eth_device_message( IPC_GET_DEVICE( call ), IPC_GET_SERVICE( call ), NIL_GET_MTU( call )); |
return eth_device_message( IPC_GET_DEVICE( call ), IPC_GET_SERVICE( call ), IPC_GET_MTU( call )); |
case NET_NIL_SEND: |
ERROR_PROPAGATE( packet_translate( eth_globals.net_phone, & packet, IPC_GET_PACKET( call ))); |
return eth_send_message( IPC_GET_DEVICE( call ), packet, IPC_GET_SERVICE( call )); |
663,7 → 675,7 |
ERROR_PROPAGATE( eth_addr_message( IPC_GET_DEVICE( call ), ETH_BROADCAST_ADDR, & address )); |
return measured_strings_reply( address, 1 ); |
case IPC_M_CONNECT_TO_ME: |
return nil_register_message( NIL_GET_PROTO( call ), IPC_GET_PHONE( call )); |
return eth_register_message( NIL_GET_PROTO( call ), IPC_GET_PHONE( call )); |
} |
return ENOTSUP; |
} |