Changeset 8426912a in mainline for uspace/lib/net/include/tl_skel.h
- Timestamp:
- 2011-01-14T12:35:19Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d450964
- Parents:
- 6610565b (diff), 08abd81 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/include/tl_skel.h
r6610565b r8426912a 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2010 Martin Decky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup eth29 /** @addtogroup libnet 30 30 * @{ 31 31 */ 32 32 33 #ifndef LIBNET_TL_SKEL_H_ 34 #define LIBNET_TL_SKEL_H_ 35 33 36 /** @file 34 * Ethernet module stub.35 * @see module.c37 * Transport layer module skeleton. 38 * The skeleton has to be part of each transport layer module. 36 39 */ 37 40 38 #include "eth.h"39 40 41 #include <async.h> 41 #include <stdio.h> 42 #include <errno.h> 43 42 #include <fibril_synch.h> 44 43 #include <ipc/ipc.h> 45 44 #include <ipc/services.h> 46 45 47 #include < net/modules.h>48 #include <net _interface.h>46 #include <adt/measured_strings.h> 47 #include <net/device.h> 49 48 #include <net/packet.h> 50 #include <nil_local.h>51 49 52 int nil_module_start_standalone(async_client_conn_t client_connection) 53 { 54 sysarg_t phonehash; 55 int rc; 56 57 async_set_client_connection(client_connection); 58 int net_phone = net_connect_module(); 50 /** Module initialization. 51 * 52 * This has to be implemented in user code. 53 * 54 * @param[in] net_phone Networking module phone. 55 * 56 * @return EOK on success. 57 * @return Other error codes as defined for each specific module 58 * initialize function. 59 * 60 */ 61 extern int tl_initialize(int net_phone); 59 62 60 rc = pm_init(); 61 if (rc != EOK) 62 return rc; 63 64 rc = nil_initialize(net_phone); 65 if (rc != EOK) 66 goto out; 63 /** Process the transport layer module message. 64 * 65 * This has to be implemented in user code. 66 * 67 * @param[in] callid Message identifier. 68 * @param[in] call Message parameters. 69 * @param[out] answer Answer. 70 * @param[out] count Number of arguments of the answer. 71 * 72 * @return EOK on success. 73 * @return Other error codes as defined for each specific module. 74 * 75 */ 76 extern int tl_module_message(ipc_callid_t, ipc_call_t *, 77 ipc_call_t *, size_t *); 67 78 68 rc = ipc_connect_to_me(PHONE_NS, SERVICE_ETHERNET, 0, 0, &phonehash); 69 if (rc != EOK) 70 goto out; 71 72 async_manager(); 79 extern int tl_module_start(int); 73 80 74 out: 75 pm_destroy(); 76 return rc; 77 } 78 79 int nil_module_message_standalone(const char *name, ipc_callid_t callid, 80 ipc_call_t *call, ipc_call_t *answer, size_t *count) 81 { 82 return nil_message_standalone(name, callid, call, answer, count); 83 } 81 #endif 84 82 85 83 /** @}
Note:
See TracChangeset
for help on using the changeset viewer.