Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/netif/lo/lo.c

    r849ed54 r19f857a  
    4343#include <ipc/services.h>
    4444
    45 #include <net_err.h>
    46 #include <net_messages.h>
    47 #include <net_modules.h>
    48 #include <adt/measured_strings.h>
    49 #include <packet/packet_client.h>
    50 #include <net_device.h>
    51 #include <nil_interface.h>
    52 #include <nil_messages.h>
    53 #include <netif.h>
    54 #include <netif_module.h>
     45#include "../../err.h"
     46#include "../../messages.h"
     47#include "../../modules.h"
     48
     49#include "../../structures/measured_strings.h"
     50#include "../../structures/packet/packet_client.h"
     51
     52#include "../../include/device.h"
     53#include "../../include/nil_interface.h"
     54
     55#include "../../nil/nil_messages.h"
     56
     57#include "../netif.h"
     58#include "../netif_module.h"
    5559
    5660/** Default hardware address.
     
    8690 */
    8791int create(device_id_t device_id, device_ref * device);
     92
     93/** Prints the module name.
     94 *  @see NAME
     95 */
     96void module_print_name(void);
    8897
    8998int netif_specific_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     
    158167}
    159168
     169void module_print_name(void){
     170        printf("%s", NAME);
     171}
     172
    160173int netif_probe_message(device_id_t device_id, int irq, uintptr_t io){
    161174        ERROR_DECLARE;
     
    207220}
    208221
    209 #ifdef CONFIG_NETWORKING_modular
    210 
    211 #include <netif_standalone.h>
    212 
    213 /** Default thread for new connections.
    214  *
    215  *  @param[in] iid The initial message identifier.
    216  *  @param[in] icall The initial message call structure.
    217  *
    218  */
    219 static void netif_client_connection(ipc_callid_t iid, ipc_call_t * icall)
    220 {
    221         /*
    222          * Accept the connection
    223          *  - Answer the first IPC_M_CONNECT_ME_TO call.
    224          */
    225         ipc_answer_0(iid, EOK);
    226        
    227         while(true) {
    228                 ipc_call_t answer;
    229                 int answer_count;
    230                
    231                 /* Clear the answer structure */
    232                 refresh_answer(&answer, &answer_count);
    233                
    234                 /* Fetch the next message */
    235                 ipc_call_t call;
    236                 ipc_callid_t callid = async_get_call(&call);
    237                
    238                 /* Process the message */
    239                 int res = netif_module_message(callid, &call, &answer, &answer_count);
    240                
    241                 /* End if said to either by the message or the processing result */
    242                 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
    243                         return;
    244                
    245                 /* Answer the message */
    246                 answer_call(callid, res, &answer, answer_count);
    247         }
    248 }
    249 
    250 /** Starts the module.
    251  *
    252  *  @param argc The count of the command line arguments. Ignored parameter.
    253  *  @param argv The command line parameters. Ignored parameter.
    254  *
    255  *  @returns EOK on success.
    256  *  @returns Other error codes as defined for each specific module start function.
    257  *
    258  */
    259 int main(int argc, char *argv[])
    260 {
    261         ERROR_DECLARE;
    262        
    263         /* Print the module label */
    264         printf("Task %d - %s\n", task_get_id(), NAME);
    265        
    266         /* Start the module */
    267         if (ERROR_OCCURRED(netif_module_start(netif_client_connection))) {
    268                 printf(" - ERROR %i\n", ERROR_CODE);
    269                 return ERROR_CODE;
    270         }
    271        
    272         return EOK;
    273 }
    274 
    275 #endif /* CONFIG_NETWORKING_modular */
    276 
    277222/** @}
    278223 */
Note: See TracChangeset for help on using the changeset viewer.