Changeset 849ed54 in mainline for uspace/srv/hw/netif/dp8390/dp8390_module.c
- Timestamp:
- 2010-03-30T18:39:04Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7553689
- Parents:
- 7d6fe4db
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/netif/dp8390/dp8390_module.c
r7d6fe4db r849ed54 40 40 #include <errno.h> 41 41 #include <malloc.h> 42 //#include <stdio.h>43 42 #include <ipc/ipc.h> 44 43 #include <ipc/services.h> 45 44 46 #include "../../err.h" 47 #include "../../messages.h" 48 #include "../../modules.h" 49 50 #include "../../structures/packet/packet_client.h" 51 #include "../../structures/measured_strings.h" 52 53 #include "../../include/device.h" 54 #include "../../include/nil_interface.h" 55 56 #include "../netif.h" 57 #include "../netif_module.h" 45 #include <net_err.h> 46 #include <net_messages.h> 47 #include <net_modules.h> 48 #include <packet/packet_client.h> 49 #include <adt/measured_strings.h> 50 #include <net_device.h> 51 #include <nil_interface.h> 52 #include <netif.h> 53 #include <netif_module.h> 58 54 59 55 #include "dp8390.h" … … 102 98 */ 103 99 netif_globals_t netif_globals; 104 105 /** Prints the module name.106 * @see NAME107 */108 void module_print_name(void);109 100 110 101 /** Handles the interrupt messages. … … 151 142 stats->send_window_errors = de_stat->ets_OWC; 152 143 return EOK; 153 }154 155 void module_print_name(void){156 printf("%s", NAME);157 144 } 158 145 … … 329 316 } 330 317 318 #ifdef CONFIG_NETWORKING_modular 319 320 #include <netif_standalone.h> 321 322 /** Default thread for new connections. 323 * 324 * @param[in] iid The initial message identifier. 325 * @param[in] icall The initial message call structure. 326 * 327 */ 328 static void netif_client_connection(ipc_callid_t iid, ipc_call_t * icall) 329 { 330 /* 331 * Accept the connection 332 * - Answer the first IPC_M_CONNECT_ME_TO call. 333 */ 334 ipc_answer_0(iid, EOK); 335 336 while(true) { 337 ipc_call_t answer; 338 int answer_count; 339 340 /* Clear the answer structure */ 341 refresh_answer(&answer, &answer_count); 342 343 /* Fetch the next message */ 344 ipc_call_t call; 345 ipc_callid_t callid = async_get_call(&call); 346 347 /* Process the message */ 348 int res = netif_module_message(callid, &call, &answer, &answer_count); 349 350 /* End if said to either by the message or the processing result */ 351 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP)) 352 return; 353 354 /* Answer the message */ 355 answer_call(callid, res, &answer, answer_count); 356 } 357 } 358 359 /** Starts the module. 360 * 361 * @param argc The count of the command line arguments. Ignored parameter. 362 * @param argv The command line parameters. Ignored parameter. 363 * 364 * @returns EOK on success. 365 * @returns Other error codes as defined for each specific module start function. 366 * 367 */ 368 int main(int argc, char *argv[]) 369 { 370 ERROR_DECLARE; 371 372 /* Print the module label */ 373 printf("Task %d - %s\n", task_get_id(), NAME); 374 375 /* Start the module */ 376 if (ERROR_OCCURRED(netif_module_start(netif_client_connection))) { 377 printf(" - ERROR %i\n", ERROR_CODE); 378 return ERROR_CODE; 379 } 380 381 return EOK; 382 } 383 384 #endif /* CONFIG_NETWORKING_modular */ 385 386 331 387 /** @} 332 388 */
Note:
See TracChangeset
for help on using the changeset viewer.