303,7 → 303,7 |
int index; |
measured_string_t names[ 2 ] = {{ "ETH_MODE", 8 }, { "ETH_DUMMY", 9 }}; |
measured_string_ref configuration; |
int count = 2; |
size_t count = sizeof( names ) / sizeof( measured_string_t ); |
char * data; |
|
rwlock_write_lock( & eth_globals.devices_lock ); |
565,6 → 565,7 |
// TODO LSAP only device |
if( IS_DIX( flags ) || IS_8023_2_LSAP( flags )){ |
header_dix = PACKET_PREFIX( packet, eth_header_t ); |
if( ! header_dix ) return ENOMEM; |
header_dix->ethertype = ( uint16_t ) ethertype; |
memcpy( header_dix->src, src_addr, ETH_ADDR ); |
memcpy( header_dix->dest, dest, ETH_ADDR ); |
615,6 → 616,7 |
if( ERROR_OCCURRED( eth_prepare_packet( device->flags, next, ( uint8_t * ) device->addr->value, ethertype, device->mtu ))){ |
// release invalid packet |
tmp = pq_detach( next ); |
if( next == packet ) packet = tmp; |
pq_release( eth_globals.net_phone, packet_get_id( next )); |
next = tmp; |
}else{ |
622,7 → 624,9 |
} |
}while( next ); |
// send packet queue |
netif_send_msg( device->phone, device_id, packet, SERVICE_ETHERNET ); |
if( packet ){ |
netif_send_msg( device->phone, device_id, packet, SERVICE_ETHERNET ); |
} |
rwlock_read_unlock( & eth_globals.devices_lock ); |
return EOK; |
} |
645,7 → 649,7 |
return eth_send_message( IPC_GET_DEVICE( call ), packet, IPC_GET_SERVICE( call )); |
case NET_NIL_PACKET_SPACE: |
ERROR_PROPAGATE( eth_packet_space_message( IPC_GET_DEVICE( call ), IPC_SET_ADDR( answer ), IPC_SET_PREFIX( answer ), IPC_SET_CONTENT( answer ), IPC_SET_SUFFIX( answer ))); |
* answer_count = 3; |
* answer_count = 4; |
return EOK; |
case NET_NIL_ADDR: |
ERROR_PROPAGATE( eth_addr_message( IPC_GET_DEVICE( call ), ETH_LOCAL_ADDR, & address )); |