Changeset 89c57b6 in mainline for uspace/lib/net/include/netif_skel.h


Ignore:
Timestamp:
2011-04-13T14:45:41Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
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.
Message:

Merge mainline changes.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/include/netif_skel.h

    rcefb126 r89c57b6  
    2727 */
    2828
    29 /** @addtogroup netif
     29/** @addtogroup libnet
    3030 * @{
    3131 */
     
    3434 * Network interface module skeleton.
    3535 * 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_
    4140
    4241#include <async.h>
    4342#include <fibril_synch.h>
    44 #include <ipc/ipc.h>
    4543#include <ipc/services.h>
    4644
    4745#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. */
    5550typedef struct {
    5651        device_id_t device_id;  /**< Device identifier. */
     
    6863DEVICE_MAP_DECLARE(netif_device_map, netif_device_t);
    6964
    70 /** Network interface module skeleton global data.
    71  *
    72  */
     65/** Network interface module skeleton global data. */
    7366typedef struct {
    7467        int net_phone;                  /**< Networking module phone. */
     
    9083 * This has to be implemented in user code.
    9184 *
    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 */
     96extern int netif_probe_message(device_id_t device_id, int irq, void *io);
    10397
    10498/** Send the packet queue.
     
    106100 * This has to be implemented in user code.
    107101 *
    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 */
     115extern int netif_send_message(device_id_t device_id, packet_t *packet,
    120116    services_t sender);
    121117
     
    124120 * This has to be implemented in user code.
    125121 *
    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 
    132130 *
    133131 */
     
    138136 * This has to be implemented in user code.
    139137 *
    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.
    146145 *
    147146 */
     
    152151 * This has to be implemented in user code.
    153152 *
    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.
    156155 *
    157156 * @return EOK on success.
    158157 * @return EBADMEM if the address parameter is NULL.
    159158 * @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.
    163163 *
    164164 */
    165165extern int netif_get_addr_message(device_id_t device_id,
    166     measured_string_ref address);
     166    measured_string_t *address);
    167167
    168168/** Process the netif driver specific message.
     
    171171 * skeleton. This has to be implemented in user code.
    172172 *
    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.
    178177 *
    179178 * @return EOK on success.
    180179 * @return ENOTSUP if the message is not known.
    181  * @return Other error codes as defined for the specific module message
    182  *         implementation.
     180 * @return Other error codes as defined for the specific module
     181 *         message implementation.
    183182 *
    184183 */
    185184extern 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);
    187186
    188187/** Return the device usage statistics.
     
    190189 * This has to be implemented in user code.
    191190 *
    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.
    199199 *
    200200 */
    201201extern 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);
    213203
    214204extern int find_device(device_id_t, netif_device_t **);
    215 extern void null_device_stats(device_stats_ref);
     205extern void null_device_stats(device_stats_t *);
    216206extern 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);
     207extern packet_t *netif_packet_get_1(size_t);
     208
     209extern int netif_module_start(void);
    223210
    224211#endif
Note: See TracChangeset for help on using the changeset viewer.