Changeset 0b749a3 in mainline for uspace/srv/net/nil/eth/eth_module.c
- Timestamp:
- 2010-11-22T15:39:53Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0eddb76, aae339e9
- Parents:
- 9a1d8ab (diff), 8cd1aa5e (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 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/nil/eth/eth_module.c
r9a1d8ab r0b749a3 36 36 */ 37 37 38 #include "eth.h" 39 38 40 #include <async.h> 39 41 #include <stdio.h> 42 #include <errno.h> 40 43 41 44 #include <ipc/ipc.h> 42 45 #include <ipc/services.h> 43 46 44 #include <net_err.h> 45 #include <net_modules.h> 47 #include <net/modules.h> 46 48 #include <net_interface.h> 47 #include < packet/packet.h>49 #include <net/packet.h> 48 50 #include <nil_local.h> 49 51 50 #include "eth.h"51 52 /** Starts the Ethernet module.53 * Initializes the client connection serving function, initializes the module, registers the module service and starts the async manager, processing IPC messages in an infinite loop.54 * @param[in] client_connection The client connection processing function. The module skeleton propagates its own one.55 * @returns EOK on success.56 * @returns Other error codes as defined for the pm_init() function.57 * @returns Other error codes as defined for the nil_initialize() function.58 * @returns Other error codes as defined for the REGISTER_ME() macro function.59 */60 52 int nil_module_start_standalone(async_client_conn_t client_connection) 61 53 { 62 ERROR_DECLARE; 54 ipcarg_t phonehash; 55 int rc; 63 56 64 57 async_set_client_connection(client_connection); 65 int net_phone = net_connect_module(SERVICE_NETWORKING); 66 ERROR_PROPAGATE(pm_init()); 58 int net_phone = net_connect_module(); 59 60 rc = pm_init(); 61 if (rc != EOK) 62 return rc; 67 63 68 ipcarg_t phonehash; 69 if (ERROR_OCCURRED(nil_initialize(net_phone)) 70 || ERROR_OCCURRED(REGISTER_ME(SERVICE_ETHERNET, &phonehash))) { 71 pm_destroy(); 72 return ERROR_CODE; 73 } 64 rc = nil_initialize(net_phone); 65 if (rc != EOK) 66 goto out; 67 68 rc = REGISTER_ME(SERVICE_ETHERNET, &phonehash); 69 if (rc != EOK) 70 goto out; 74 71 75 72 async_manager(); 76 73 74 out: 77 75 pm_destroy(); 78 return EOK;76 return rc; 79 77 } 80 78 81 /** Pass the parameters to the module specific nil_message() function. 82 * 83 * @param[in] name Module name. 84 * @param[in] callid The message identifier. 85 * @param[in] call The message parameters. 86 * @param[out] answer The message answer parameters. 87 * @param[out] answer_count The last parameter for the actual answer 88 * in the answer parameter. 89 * 90 * @return EOK on success. 91 * @return ENOTSUP if the message is not known. 92 * @return Other error codes as defined for each 93 * specific module message function. 94 * 95 */ 96 int nil_module_message_standalone(const char *name, ipc_callid_t callid, ipc_call_t *call, 97 ipc_call_t *answer, int *answer_count) 79 int nil_module_message_standalone(const char *name, ipc_callid_t callid, 80 ipc_call_t *call, ipc_call_t *answer, int *answer_count) 98 81 { 99 82 return nil_message_standalone(name, callid, call, answer, answer_count);
Note:
See TracChangeset
for help on using the changeset viewer.