Changeset 89c57b6 in mainline for uspace/lib/net/include/netif_skel.h
- Timestamp:
- 2011-04-13T14:45:41Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 88634420
- Parents:
- cefb126 (diff), 17279ead (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/netif_skel.h
rcefb126 r89c57b6 27 27 */ 28 28 29 /** @addtogroup netif29 /** @addtogroup libnet 30 30 * @{ 31 31 */ … … 34 34 * Network interface module skeleton. 35 35 * The skeleton has to be part of each network interface module. 36 * The skeleton can be also part of the module bundled with the network interface layer. 37 */ 38 39 #ifndef __NET_NETIF_LOCAL_H__ 40 #define __NET_NETIF_LOCAL_H__ 36 */ 37 38 #ifndef NET_NETIF_SKEL_H_ 39 #define NET_NETIF_SKEL_H_ 41 40 42 41 #include <async.h> 43 42 #include <fibril_synch.h> 44 #include <ipc/ipc.h>45 43 #include <ipc/services.h> 46 44 47 45 #include <adt/measured_strings.h> 48 #include <net_err.h> 49 #include <net_device.h> 50 #include <packet/packet.h> 51 52 /** Network interface device specific data. 53 * 54 */ 46 #include <net/device.h> 47 #include <net/packet.h> 48 49 /** Network interface device specific data. */ 55 50 typedef struct { 56 51 device_id_t device_id; /**< Device identifier. */ … … 68 63 DEVICE_MAP_DECLARE(netif_device_map, netif_device_t); 69 64 70 /** Network interface module skeleton global data. 71 * 72 */ 65 /** Network interface module skeleton global data. */ 73 66 typedef struct { 74 67 int net_phone; /**< Networking module phone. */ … … 90 83 * This has to be implemented in user code. 91 84 * 92 * @param[in] device_id The device identifier. 93 * @param[in] irq The device interrupt number. 94 * @param[in] io The device input/output address. 95 * 96 * @return EOK on success. 97 * @return Other error codes as defined for the find_device() function. 98 * @return Other error codes as defined for the specific module message 99 * implementation. 100 * 101 */ 102 extern int netif_probe_message(device_id_t device_id, int irq, uintptr_t io); 85 * @param[in] device_id Device identifier. 86 * @param[in] irq Device interrupt number. 87 * @param[in] io Device input/output address. 88 * 89 * @return EOK on success. 90 * @return Other error codes as defined for the find_device() 91 * function. 92 * @return Other error codes as defined for the specific module 93 * message implementation. 94 * 95 */ 96 extern int netif_probe_message(device_id_t device_id, int irq, void *io); 103 97 104 98 /** Send the packet queue. … … 106 100 * This has to be implemented in user code. 107 101 * 108 * @param[in] device_id The device identifier. 109 * @param[in] packet The packet queue. 110 * @param[in] sender The sending module service. 111 * 112 * @return EOK on success. 113 * @return EFORWARD if the device is not active (in the NETIF_ACTIVE state). 114 * @return Other error codes as defined for the find_device() function. 115 * @return Other error codes as defined for the specific module message 116 * implementation. 117 * 118 */ 119 extern int netif_send_message(device_id_t device_id, packet_t packet, 102 * @param[in] device_id Device identifier. 103 * @param[in] packet Packet queue. 104 * @param[in] sender Sending module service. 105 * 106 * @return EOK on success. 107 * @return EFORWARD if the device is not active (in the 108 * NETIF_ACTIVE state). 109 * @return Other error codes as defined for the find_device() 110 * function. 111 * @return Other error codes as defined for the specific module 112 * message implementation. 113 * 114 */ 115 extern int netif_send_message(device_id_t device_id, packet_t *packet, 120 116 services_t sender); 121 117 … … 124 120 * This has to be implemented in user code. 125 121 * 126 * @param[in] device The device structure. 127 * 128 * @return EOK on success. 129 * @return Other error codes as defined for the find_device() function. 130 * @return Other error codes as defined for the specific module message 131 * implementation. 122 * @param[in] device Device structure. 123 * 124 * @return New network interface state (non-negative values). 125 * @return Other error codes as defined for the find_device() 126 * function. 127 * @return Other error codes as defined for the specific module 128 * message implementation. 129 132 130 * 133 131 */ … … 138 136 * This has to be implemented in user code. 139 137 * 140 * @param[in] device The device structure. 141 * 142 * @return EOK on success. 143 * @return Other error codes as defined for the find_device() function. 144 * @return Other error codes as defined for the specific module message 145 * implementation. 138 * @param[in] device Device structure. 139 * 140 * @return EOK on success. 141 * @return Other error codes as defined for the find_device() 142 * function. 143 * @return Other error codes as defined for the specific module 144 * message implementation. 146 145 * 147 146 */ … … 152 151 * This has to be implemented in user code. 153 152 * 154 * @param[in] device_id The device identifier.155 * @param[out] address The device local hardware address.153 * @param[in] device_id Device identifier. 154 * @param[out] address Device local hardware address. 156 155 * 157 156 * @return EOK on success. 158 157 * @return EBADMEM if the address parameter is NULL. 159 158 * @return ENOENT if there no such device. 160 * @return Other error codes as defined for the find_device() function. 161 * @return Other error codes as defined for the specific module message 162 * implementation. 159 * @return Other error codes as defined for the find_device() 160 * function. 161 * @return Other error codes as defined for the specific module 162 * message implementation. 163 163 * 164 164 */ 165 165 extern int netif_get_addr_message(device_id_t device_id, 166 measured_string_ refaddress);166 measured_string_t *address); 167 167 168 168 /** Process the netif driver specific message. … … 171 171 * skeleton. This has to be implemented in user code. 172 172 * 173 * @param[in] callid The message identifier. 174 * @param[in] call The message parameters. 175 * @param[out] answer The message answer parameters. 176 * @param[out] answer_count The last parameter for the actual answer in 177 * the answer parameter. 173 * @param[in] callid Message identifier. 174 * @param[in] call Message. 175 * @param[out] answer Answer. 176 * @param[out] count Number of answer arguments. 178 177 * 179 178 * @return EOK on success. 180 179 * @return ENOTSUP if the message is not known. 181 * @return Other error codes as defined for the specific module message182 * implementation.180 * @return Other error codes as defined for the specific module 181 * message implementation. 183 182 * 184 183 */ 185 184 extern int netif_specific_message(ipc_callid_t callid, ipc_call_t *call, 186 ipc_call_t *answer, int *answer_count);185 ipc_call_t *answer, size_t *count); 187 186 188 187 /** Return the device usage statistics. … … 190 189 * This has to be implemented in user code. 191 190 * 192 * @param[in] device_id The device identifier. 193 * @param[out] stats The device usage statistics. 194 * 195 * @return EOK on success. 196 * @return Other error codes as defined for the find_device() function. 197 * @return Other error codes as defined for the specific module message 198 * implementation. 191 * @param[in] device_id Device identifier. 192 * @param[out] stats Device usage statistics. 193 * 194 * @return EOK on success. 195 * @return Other error codes as defined for the find_device() 196 * function. 197 * @return Other error codes as defined for the specific module 198 * message implementation. 199 199 * 200 200 */ 201 201 extern int netif_get_device_stats(device_id_t device_id, 202 device_stats_ref stats); 203 204 extern int netif_get_addr_req_local(int, device_id_t, measured_string_ref *, 205 char **); 206 extern int netif_probe_req_local(int, device_id_t, int, int); 207 extern int netif_send_msg_local(int, device_id_t, packet_t, services_t); 208 extern int netif_start_req_local(int, device_id_t); 209 extern int netif_stop_req_local(int, device_id_t); 210 extern int netif_stats_req_local(int, device_id_t, device_stats_ref); 211 extern int netif_bind_service_local(services_t, device_id_t, services_t, 212 async_client_conn_t); 202 device_stats_t *stats); 213 203 214 204 extern int find_device(device_id_t, netif_device_t **); 215 extern void null_device_stats(device_stats_ ref);205 extern void null_device_stats(device_stats_t *); 216 206 extern void netif_pq_release(packet_id_t); 217 extern packet_t netif_packet_get_1(size_t); 218 extern int netif_init_module(async_client_conn_t); 219 220 extern int netif_module_message_standalone(const char *, ipc_callid_t, 221 ipc_call_t *, ipc_call_t *, int *); 222 extern int netif_module_start_standalone(async_client_conn_t); 207 extern packet_t *netif_packet_get_1(size_t); 208 209 extern int netif_module_start(void); 223 210 224 211 #endif
Note:
See TracChangeset
for help on using the changeset viewer.