Subversion Repositories HelenOS

Rev

Rev 4261 | Rev 4332 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright (c) 2009 Lukas Mejdrech
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  *
  9.  * - Redistributions of source code must retain the above copyright
  10.  *   notice, this list of conditions and the following disclaimer.
  11.  * - Redistributions in binary form must reproduce the above copyright
  12.  *   notice, this list of conditions and the following disclaimer in the
  13.  *   documentation and/or other materials provided with the distribution.
  14.  * - The name of the author may not be used to endorse or promote products
  15.  *   derived from this software without specific prior written permission.
  16.  *
  17.  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  18.  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  19.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  20.  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  21.  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  22.  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  23.  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  24.  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25.  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  26.  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27.  */
  28.  
  29. /** @addtogroup eth
  30.  *  @{
  31.  */
  32.  
  33. /** @file
  34.  *  Ethernet module implementation.
  35.  *  @see eth.h
  36.  */
  37.  
  38. #include <async.h>
  39. #include <malloc.h>
  40. #include <mem.h>
  41. #include <stdio.h>
  42.  
  43. #include <ipc/ipc.h>
  44. #include <ipc/services.h>
  45.  
  46. #include "../../err.h"
  47. #include "../../messages.h"
  48. #include "../../modules.h"
  49.  
  50. #include "../../include/byteorder.h"
  51. #include "../../include/crc.h"
  52. #include "../../include/ethernet_lsap.h"
  53. #include "../../include/ethernet_protocols.h"
  54. #include "../../include/protocol_map.h"
  55. #include "../../include/device.h"
  56. #include "../../include/netif_interface.h"
  57. #include "../../include/nil_interface.h"
  58. #include "../../include/il_interface.h"
  59.  
  60. #include "../../structures/measured_strings.h"
  61. #include "../../structures/packet/packet_client.h"
  62.  
  63. #include "../nil_module.h"
  64.  
  65. #include "eth.h"
  66. #include "eth_header.h"
  67.  
  68. #define ETH_PREFIX      ( sizeof( eth_header_t ) + sizeof( eth_header_lsap_t ) + sizeof( eth_header_snap_t ))
  69. #define ETH_SUFFIX      sizeof( eth_fcs_t )
  70. #define ETH_MAX_CONTENT 1500
  71. #define ETH_MIN_CONTENT 46
  72. #define ETH_MAX_TAGGED_CONTENT  ( ETH_MAX_CONTENT - sizeof( eth_header_lsap_t ) - sizeof( eth_header_snap_t ))
  73. #define ETH_MIN_TAGGED_CONTENT  ( ETH_MIN_CONTENT - sizeof( eth_header_lsap_t ) - sizeof( eth_header_snap_t ))
  74.  
  75. typedef enum eth_addr_type  eth_addr_type_t;
  76. typedef eth_addr_type_t *   eth_addr_type_ref;
  77.  
  78. enum eth_addr_type{
  79.     ETH_LOCAL_ADDR,
  80.     ETH_BROADCAST_ADDR
  81. };
  82.  
  83. /** Ethernet global data.
  84.  */
  85. eth_globals_t   eth_globals;
  86.  
  87. /** Processes IPC messages from the registered device driver modules in an infinite loop.
  88.  *  @param iid The message identifier. Input parameter.
  89.  *  @param icall The message parameters. Input/output parameter.
  90.  */
  91. void    eth_receiver( ipc_callid_t iid, ipc_call_t * icall );
  92.  
  93. DEVICE_MAP_IMPLEMENT( eth_devices, eth_device_t )
  94.  
  95. INT_MAP_IMPLEMENT( eth_protos, eth_proto_t )
  96.  
  97. int eth_device_message( device_id_t device_id, services_t service, size_t mtu );
  98. int nil_receive_msg( int nil_phone, device_id_t device_id, packet_t packet );
  99. int nil_register_message( services_t service, int phone );
  100. int eth_packet_space_message( device_id_t device_id, size_t * addr_len, size_t * prefix, size_t * content, size_t * suffix );
  101. int eth_addr_message( device_id_t device_id, eth_addr_type_t type, measured_string_ref * address );
  102. int eth_send_message( device_id_t device_id, packet_t packet, services_t sender );
  103. eth_proto_ref   eth_process_packet( int dummy, packet_t packet );
  104. int eth_prepare_packet( int dummy, packet_t packet, uint8_t * src_addr, int ethertype );
  105.  
  106. int nil_device_state_msg( int nil_phone, device_id_t device_id, int state ){
  107.     int             index;
  108.     eth_proto_ref   proto;
  109.  
  110.     //TODO clear device if off?
  111.     rwlock_read_lock( & eth_globals.protos_lock );
  112.     for( index = eth_protos_count( & eth_globals.protos ) - 1; index >= 0; -- index ){
  113.         proto = eth_protos_get_index( & eth_globals.protos, index );
  114.         if( proto && proto->phone ) il_device_state_msg( proto->phone, device_id, state );
  115.     }
  116.     rwlock_read_unlock( & eth_globals.protos_lock );
  117.     return EOK;
  118. }
  119.  
  120. int nil_initialize( int net_phone ){
  121.     ERROR_DECLARE;
  122.  
  123.     rwlock_initialize( & eth_globals.devices_lock );
  124.     rwlock_initialize( & eth_globals.protos_lock );
  125.     rwlock_write_lock( & eth_globals.devices_lock );
  126.     rwlock_write_lock( & eth_globals.protos_lock );
  127.     eth_globals.net_phone = net_phone;
  128.     eth_globals.broadcast_addr = measured_string_create_bulk( "\xFF\xFF\xFF\xFF\xFF\xFF", CONVERT_SIZE( uint8_t, char, ETH_ADDR ));
  129.     if( ! eth_globals.broadcast_addr ) return ENOMEM;
  130.     ERROR_PROPAGATE( eth_devices_initialize( & eth_globals.devices ));
  131.     if( ERROR_OCCURRED( eth_protos_initialize( & eth_globals.protos ))){
  132.         eth_devices_destroy( & eth_globals.devices );
  133.         return ERROR_CODE;
  134.     }
  135.     rwlock_write_unlock( & eth_globals.protos_lock );
  136.     rwlock_write_unlock( & eth_globals.devices_lock );
  137.     return EOK;
  138. }
  139.  
  140. int eth_device_message( device_id_t device_id, services_t service, size_t mtu ){
  141.     ERROR_DECLARE;
  142.  
  143.     eth_device_ref  device;
  144.     int             index;
  145.  
  146.     rwlock_write_lock( & eth_globals.devices_lock );
  147.     // an existing device?
  148.     device = eth_devices_find( & eth_globals.devices, device_id );
  149.     if( device ){
  150.         if( device->service != service ){
  151.             printf( "Device %d already exists\n", device->device_id );
  152.             rwlock_write_unlock( & eth_globals.devices_lock );
  153.             return EEXIST;
  154.         }else{
  155.             // update mtu
  156.             device->mtu = mtu;
  157.             printf( "Device %d already exists:\tMTU\t= %d\n", device->device_id, device->mtu );
  158.         }
  159.     }else{
  160.         // create a new device
  161.         device = ( eth_device_ref ) malloc( sizeof( eth_device_t ));
  162.         if( ! device ) return ENOMEM;
  163.         device->device_id = device_id;
  164.         device->service = service;
  165.         device->mtu = (( mtu > 0 ) && ( mtu <= ETH_MAX_TAGGED_CONTENT )) ? mtu : ETH_MAX_TAGGED_CONTENT;
  166.         // TODO get dummy setting
  167.         device->dummy = 0;
  168.         // bind the device driver
  169.         device->phone = netif_bind_service( device->service, device->device_id, SERVICE_ETHERNET, eth_receiver );
  170.         if( device->phone < 0 ){
  171.             rwlock_write_unlock( & eth_globals.devices_lock );
  172.             free( device );
  173.             return device->phone;
  174.         }
  175.         // get hardware address
  176.         if( ERROR_OCCURRED( netif_get_addr( device->phone, device->device_id, & device->addr, & device->addr_data ))){
  177.             rwlock_write_unlock( & eth_globals.devices_lock );
  178.             free( device );
  179.             return ERROR_CODE;
  180.         }
  181.         // add to the cache
  182.         index = eth_devices_add( & eth_globals.devices, device->device_id, device );
  183.         if( index < 0 ){
  184.             rwlock_write_unlock( & eth_globals.devices_lock );
  185.             free( device->addr );
  186.             free( device->addr_data );
  187.             free( device );
  188.             return index;
  189.         }
  190.         printf( "New device registered:\n\tid\t= %d\n\tservice\t= %d\n\tMTU\t= %d\n\taddress\t= %X:%X:%X:%X:%X:%X\n", device->device_id, device->service, device->mtu, device->addr_data[ 0 ], device->addr_data[ 1 ], device->addr_data[ 2 ], device->addr_data[ 3 ], device->addr_data[ 4 ], device->addr_data[ 5 ] );
  191.     }
  192.     rwlock_write_unlock( & eth_globals.devices_lock );
  193.     return EOK;
  194. }
  195.  
  196. eth_proto_ref eth_process_packet( int dummy, packet_t packet ){
  197.     ERROR_DECLARE;
  198.  
  199.     eth_header_ex_ref   header;
  200.     size_t              length;
  201.     int                 type;
  202.     size_t              prefix;
  203.     size_t              suffix;
  204.     eth_fcs_ref         fcs;
  205.  
  206.     length = packet_get_data_length( packet );
  207.     if( dummy ){
  208.         packet_trim( packet, sizeof( eth_preamble_t ), 0 );
  209.     }
  210.     if( length <= sizeof( eth_header_t ) + ETH_MIN_CONTENT + ETH_SUFFIX ) return NULL;
  211.     header = ( eth_header_ex_ref ) packet_get_data( packet );
  212.     type = ntohs( header->header.ethertype );
  213.     if( type >= ETH_MIN_PROTO ){
  214.         // DIX Ethernet
  215.         prefix = sizeof( eth_header_t );
  216.         suffix = sizeof( eth_fcs_t );
  217.         fcs = (( void * ) header ) + length - suffix;
  218.     }else if( type <= ETH_MAX_CONTENT ){
  219.         // translate "LSAP" values
  220.         if(( header->lsap.dsap == ETH_LSAP_GLSAP ) && ( header->lsap.ssap == ETH_LSAP_GLSAP )){
  221.             // raw packet
  222.             // discard
  223.             return NULL;
  224.         }else if(( header->lsap.dsap == ETH_LSAP_SNAP ) && ( header->lsap.ssap == ETH_LSAP_SNAP )){
  225.             // IEEE 802.3 + 802.2 + LSAP + SNAP
  226.             // organization code not supported
  227.             type = ntohs( header->snap.ethertype );
  228.             prefix = sizeof( eth_header_t ) + sizeof( eth_header_lsap_t ) + sizeof( eth_header_snap_t );
  229.         }else{
  230.             // IEEE 802.3 + 802.2 LSAP
  231.             type = lsap_map( header->lsap.dsap );
  232.             prefix = sizeof( eth_header_t ) + sizeof( eth_header_lsap_t);
  233.         }
  234.         suffix = ( type < ETH_MIN_CONTENT ) ? ETH_MIN_CONTENT - type : 0;
  235.         fcs = (( void * ) header ) + prefix + type + suffix;
  236.         suffix += length - prefix - type;
  237.     }else{
  238.         // invalid length/type, should not occurr
  239.         return NULL;
  240.     }
  241.     if( dummy ){
  242.         if(( ~ compute_crc32( ~ 0, & header->header.dest, ((( void * ) fcs ) - (( void * ) & header->header.dest )) * 8 )) != ntohl( * fcs )){
  243.             return NULL;
  244.         }
  245.     }
  246.     if( ERROR_OCCURRED( packet_set_addr( packet, header->header.src, header->header.dest, ETH_ADDR ))
  247.     || ERROR_OCCURRED( packet_trim( packet, prefix, suffix ))){
  248.         return NULL;
  249.     }
  250.     return eth_protos_find( & eth_globals.protos, type );
  251. }
  252.  
  253. int nil_received_msg( int nil_phone, device_id_t device_id, packet_t packet, services_t target ){
  254.     eth_proto_ref   proto;
  255.     packet_t        next;
  256.     eth_device_ref  device;
  257.     int             dummy;
  258.  
  259.     rwlock_read_lock( & eth_globals.devices_lock );
  260.     device = eth_devices_find( & eth_globals.devices, device_id );
  261.     if( ! device ){
  262.         rwlock_read_unlock( & eth_globals.devices_lock );
  263.         return ENOENT;
  264.     }
  265.     dummy = device->dummy;
  266.     rwlock_read_unlock( & eth_globals.devices_lock );
  267.     rwlock_read_lock( & eth_globals.protos_lock );
  268.     do{
  269.         next = pq_detach( packet );
  270.         proto = eth_process_packet( dummy, packet );
  271.         if( proto ){
  272.             il_received_msg( proto->phone, device_id, packet, proto->service );
  273.         }else{
  274.             // drop invalid/unknown
  275.             pq_release( eth_globals.net_phone, packet_get_id( packet ));
  276.         }
  277.         packet = next;
  278.     }while( packet );
  279.     rwlock_read_unlock( & eth_globals.protos_lock );
  280.     return EOK;
  281. }
  282.  
  283. int eth_packet_space_message( device_id_t device_id, size_t * addr_len, size_t * prefix, size_t * content, size_t * suffix ){
  284.     eth_device_ref  device;
  285.  
  286.     if( !( addr_len && prefix && content && suffix )) return EINVAL;
  287.     rwlock_read_lock( & eth_globals.devices_lock );
  288.     device = eth_devices_find( & eth_globals.devices, device_id );
  289.     if( ! device ){
  290.         rwlock_read_unlock( & eth_globals.devices_lock );
  291.         return ENOENT;
  292.     }
  293.     * content = device->mtu;
  294.     rwlock_read_unlock( & eth_globals.devices_lock );
  295.     * addr_len = ETH_ADDR;
  296.     * prefix = ETH_PREFIX;
  297.     * suffix = ETH_MIN_CONTENT + ETH_SUFFIX;
  298.     return EOK;
  299. }
  300.  
  301. int eth_addr_message( device_id_t device_id, eth_addr_type_t type, measured_string_ref * address ){
  302.     eth_device_ref  device;
  303.  
  304.     if( ! address ) return EINVAL;
  305.     if( type == ETH_BROADCAST_ADDR ){
  306.         * address = eth_globals.broadcast_addr;
  307.     }else{
  308.         rwlock_read_lock( & eth_globals.devices_lock );
  309.         device = eth_devices_find( & eth_globals.devices, device_id );
  310.         if( ! device ){
  311.             rwlock_read_unlock( & eth_globals.devices_lock );
  312.             return ENOENT;
  313.         }
  314.         * address = device->addr;
  315.         rwlock_read_unlock( & eth_globals.devices_lock );
  316.     }
  317.     return ( * address ) ? EOK : ENOENT;
  318. }
  319.  
  320. int nil_register_message( services_t service, int phone ){
  321.     eth_proto_ref   proto;
  322.     int             protocol;
  323.     int             index;
  324.  
  325.     protocol = protocol_map( SERVICE_ETHERNET, service );
  326.     if( ! protocol ) return ENOENT;
  327.     rwlock_write_lock( & eth_globals.protos_lock );
  328.     proto = eth_protos_find( & eth_globals.protos, protocol );
  329.     if( proto ){
  330.         proto->phone = phone;
  331.         rwlock_write_unlock( & eth_globals.protos_lock );
  332.         return EOK;
  333.     }else{
  334.         proto = ( eth_proto_ref ) malloc( sizeof( eth_proto_t ));
  335.         if( ! proto ){
  336.             rwlock_write_unlock( & eth_globals.protos_lock );
  337.             return ENOMEM;
  338.         }
  339.         proto->service = service;
  340.         proto->protocol = protocol;
  341.         proto->phone = phone;
  342.         index = eth_protos_add( & eth_globals.protos, protocol, proto );
  343.         if( index < 0 ){
  344.             rwlock_write_unlock( & eth_globals.protos_lock );
  345.             free( proto );
  346.             return index;
  347.         }
  348.     }
  349.     printf( "New protocol registered:\n\tprotocol\t= 0x%x\n\tservice\t= %d\n\tphone\t= %d\n", proto->protocol, proto->service, proto->phone );
  350.     rwlock_write_unlock( & eth_globals.protos_lock );
  351.     return EOK;
  352. }
  353.  
  354. int eth_prepare_packet( int dummy, packet_t packet, uint8_t * src_addr, int ethertype ){
  355.     eth_header_ex_ref   header;
  356.     eth_fcs_ref         fcs;
  357.     uint8_t *           src;
  358.     uint8_t *           dest;
  359.     int                 length;
  360.     int                 i;
  361.     void *              padding;
  362.     eth_preamble_ref    preamble;
  363.  
  364.     length = packet_get_data_length( packet );
  365.     if( length > ETH_MAX_TAGGED_CONTENT ) return EINVAL;
  366.     if( length < ETH_MIN_TAGGED_CONTENT ){
  367.         padding = packet_suffix( packet, ETH_MIN_TAGGED_CONTENT - length );
  368.         if( ! padding ) return ENOMEM;
  369.         bzero( padding, ETH_MIN_TAGGED_CONTENT - length );
  370.     }
  371.     if( dummy ){
  372.         preamble = PACKET_PREFIX( packet, eth_preamble_t );
  373.         if( ! preamble ) return ENOMEM;
  374.         for( i = 0; i < 7; ++ i ) preamble->preamble[ i ] = ETH_PREAMBLE;
  375.         preamble->sfd = ETH_SFD;
  376.     }
  377.     header = PACKET_PREFIX( packet, eth_header_ex_t );
  378.     if( ! header ) return ENOMEM;
  379.     header->header.ethertype = htons( length + sizeof( eth_header_lsap_t ) + sizeof( eth_header_snap_t ));
  380.     header->lsap.dsap = ( uint16_t ) ETH_LSAP_SNAP;
  381.     header->lsap.ssap = header->lsap.dsap;
  382.     header->lsap.ctrl = 0;
  383.     for( i = 0; i < 3; ++ i ) header->snap.proto[ i ] = 0;
  384.     header->snap.ethertype = ( uint16_t ) ethertype;
  385.     length = packet_get_addr( packet, & src, & dest );
  386.     if( length < 0 ) return length;
  387.     if( length < ETH_ADDR ) return EINVAL;
  388.     memcpy( header->header.src, src_addr, ETH_ADDR );
  389.     memcpy( header->header.dest, dest, ETH_ADDR );
  390.     if( dummy ){
  391.         fcs = PACKET_SUFFIX( packet, eth_fcs_t );
  392.         if( ! fcs ) return ENOMEM;
  393.         * fcs = htonl( ~ compute_crc32( ~ 0, & header->header.dest, ((( void * ) fcs ) - (( void * ) & header->header.dest )) * 8 ));
  394.     }
  395.     return EOK;
  396. }
  397.  
  398. int eth_send_message( device_id_t device_id, packet_t packet, services_t sender ){
  399.     ERROR_DECLARE;
  400.  
  401.     eth_device_ref      device;
  402.     packet_t            next;
  403.     packet_t            tmp;
  404.     int                 ethertype;
  405.  
  406.     ethertype = htons( protocol_map( SERVICE_ETHERNET, sender ));
  407.     if( ! ethertype ){
  408.         pq_release( eth_globals.net_phone, packet_get_id( packet ));
  409.         return EINVAL;
  410.     }
  411.     rwlock_read_lock( & eth_globals.devices_lock );
  412.     device = eth_devices_find( & eth_globals.devices, device_id );
  413.     if( ! device ){
  414.         rwlock_read_unlock( & eth_globals.devices_lock );
  415.         return ENOENT;
  416.     }
  417.     // process packet queue
  418.     next = packet;
  419.     do{
  420.         if( ERROR_OCCURRED( eth_prepare_packet( device->dummy, next, ( uint8_t * ) device->addr->value, ethertype ))){
  421.             // release invalid packet
  422.             tmp = pq_detach( next );
  423.             pq_release( eth_globals.net_phone, packet_get_id( next ));
  424.             next = tmp;
  425.         }else{
  426.             next = pq_next( next );
  427.         }
  428.     }while( next );
  429.     // send packet queue
  430.     netif_send_msg( device->phone, device_id, packet, SERVICE_ETHERNET );
  431.     rwlock_read_unlock( & eth_globals.devices_lock );
  432.     return EOK;
  433. }
  434.  
  435. int nil_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count ){
  436.     ERROR_DECLARE;
  437.  
  438.     measured_string_ref address;
  439.     packet_t            packet;
  440.  
  441. //  printf( "message %d - %d\n", IPC_GET_METHOD( * call ), NET_NIL_FIRST );
  442.     * answer_count = 0;
  443.     switch( IPC_GET_METHOD( * call )){
  444.         case IPC_M_PHONE_HUNGUP:
  445.             return EOK;
  446.         case NET_NIL_DEVICE:
  447.             return eth_device_message( IPC_GET_DEVICE( call ), IPC_GET_SERVICE( call ), NIL_GET_MTU( call ));
  448.         case NET_NIL_SEND:
  449.             ERROR_PROPAGATE( packet_translate( eth_globals.net_phone, & packet, IPC_GET_PACKET( call )));
  450.             return eth_send_message( IPC_GET_DEVICE( call ), packet, IPC_GET_SERVICE( call ));
  451.         case NET_NIL_PACKET_SPACE:
  452.             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 )));
  453.             * answer_count = 3;
  454.             return EOK;
  455.         case NET_NIL_ADDR:
  456.             ERROR_PROPAGATE( eth_addr_message( IPC_GET_DEVICE( call ), ETH_LOCAL_ADDR, & address ));
  457.             return measured_strings_reply( address, 1 );
  458.         case NET_NIL_BROADCAST_ADDR:
  459.             ERROR_PROPAGATE( eth_addr_message( IPC_GET_DEVICE( call ), ETH_BROADCAST_ADDR, & address ));
  460.             return measured_strings_reply( address, 1 );
  461.         case IPC_M_CONNECT_TO_ME:
  462.             return nil_register_message( NIL_GET_PROTO( call ), IPC_GET_PHONE( call ));
  463.     }
  464.     return ENOTSUP;
  465. }
  466.  
  467. void eth_receiver( ipc_callid_t iid, ipc_call_t * icall ){
  468.     ERROR_DECLARE;
  469.  
  470.     packet_t        packet;
  471.  
  472.     while( true ){
  473.         switch( IPC_GET_METHOD( * icall )){
  474.             case NET_NIL_DEVICE_STATE:
  475.                 nil_device_state_msg( 0, IPC_GET_DEVICE( icall ), IPC_GET_STATE( icall ));
  476.                 ipc_answer_0( iid, EOK );
  477.                 break;
  478.             case NET_NIL_RECEIVED:
  479.                 if( ! ERROR_OCCURRED( packet_translate( eth_globals.net_phone, & packet, IPC_GET_PACKET( icall )))){
  480.                     ERROR_CODE = nil_received_msg( 0, IPC_GET_DEVICE( icall ), packet, 0 );
  481.                 }
  482.                 ipc_answer_0( iid, ERROR_CODE );
  483.                 break;
  484.             default:
  485.                 ipc_answer_0( iid, ENOTSUP );
  486.         }
  487.         iid = async_get_call( icall );
  488.     }
  489. }
  490.  
  491. /** @}
  492.  */
  493.