Changeset 89c57b6 in mainline for uspace/lib/net/netif/netif_remote.c
- 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 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/netif/netif_remote.c
rcefb126 r89c57b6 27 27 */ 28 28 29 /** @addtogroup netif29 /** @addtogroup libnet 30 30 * @{ 31 31 */ … … 35 35 */ 36 36 37 #include <netif_remote.h> 38 #include <packet_client.h> 39 #include <generic.h> 40 37 41 #include <ipc/services.h> 42 #include <ipc/netif.h> 38 43 39 #include <net _modules.h>44 #include <net/modules.h> 40 45 #include <adt/measured_strings.h> 41 #include <packet/packet.h> 42 #include <packet/packet_client.h> 43 #include <net_device.h> 44 #include <netif_remote.h> 45 #include <netif_messages.h> 46 #include <net/packet.h> 47 #include <net/device.h> 46 48 47 int netif_get_addr_req_remote(int netif_phone, device_id_t device_id, 48 measured_string_ref *address, char **data) 49 /** Return the device local hardware address. 50 * 51 * @param[in] netif_phone Network interface phone. 52 * @param[in] device_id Device identifier. 53 * @param[out] address Device local hardware address. 54 * @param[out] data Address data. 55 * 56 * @return EOK on success. 57 * @return EBADMEM if the address parameter is NULL. 58 * @return ENOENT if there no such device. 59 * @return Other error codes as defined for the 60 * netif_get_addr_message() function. 61 * 62 */ 63 int netif_get_addr_req(int netif_phone, device_id_t device_id, 64 measured_string_t **address, uint8_t **data) 49 65 { 50 66 return generic_get_addr_req(netif_phone, NET_NETIF_GET_ADDR, device_id, … … 52 68 } 53 69 54 int netif_probe_req_remote(int netif_phone, device_id_t device_id, int irq, int io) 70 /** Probe the existence of the device. 71 * 72 * @param[in] netif_phone Network interface phone. 73 * @param[in] device_id Device identifier. 74 * @param[in] irq Device interrupt number. 75 * @param[in] io Device input/output address. 76 * 77 * @return EOK on success. 78 * @return Other error codes as defined for the 79 * netif_probe_message(). 80 * 81 */ 82 int netif_probe_req(int netif_phone, device_id_t device_id, int irq, void *io) 55 83 { 56 return async_req_3_0(netif_phone, NET_NETIF_PROBE, device_id, irq, io); 84 return async_req_3_0(netif_phone, NET_NETIF_PROBE, device_id, irq, 85 (sysarg_t) io); 57 86 } 58 87 59 int netif_send_msg_remote(int netif_phone, device_id_t device_id, packet_t packet, 88 /** Send the packet queue. 89 * 90 * @param[in] netif_phone Network interface phone. 91 * @param[in] device_id Device identifier. 92 * @param[in] packet Packet queue. 93 * @param[in] sender Sending module service. 94 * 95 * @return EOK on success. 96 * @return Other error codes as defined for the generic_send_msg() 97 * function. 98 * 99 */ 100 int netif_send_msg(int netif_phone, device_id_t device_id, packet_t *packet, 60 101 services_t sender) 61 102 { … … 64 105 } 65 106 66 int netif_start_req_remote(int netif_phone, device_id_t device_id) 107 /** Start the device. 108 * 109 * @param[in] netif_phone Network interface phone. 110 * @param[in] device_id Device identifier. 111 * 112 * @return EOK on success. 113 * @return Other error codes as defined for the find_device() 114 * function. 115 * @return Other error codes as defined for the 116 * netif_start_message() function. 117 * 118 */ 119 int netif_start_req(int netif_phone, device_id_t device_id) 67 120 { 68 121 return async_req_1_0(netif_phone, NET_NETIF_START, device_id); 69 122 } 70 123 71 int netif_stop_req_remote(int netif_phone, device_id_t device_id) 124 /** Stop the device. 125 * 126 * @param[in] netif_phone Network interface phone. 127 * @param[in] device_id Device identifier. 128 * 129 * @return EOK on success. 130 * @return Other error codes as defined for the find_device() 131 * function. 132 * @return Other error codes as defined for the 133 * netif_stop_message() function. 134 * 135 */ 136 int netif_stop_req(int netif_phone, device_id_t device_id) 72 137 { 73 138 return async_req_1_0(netif_phone, NET_NETIF_STOP, device_id); 74 139 } 75 140 76 int netif_stats_req_remote(int netif_phone, device_id_t device_id, 77 device_stats_ref stats) 141 /** Return the device usage statistics. 142 * 143 * @param[in] netif_phone Network interface phone. 144 * @param[in] device_id Device identifier. 145 * @param[out] stats Device usage statistics. 146 * 147 * @return EOK on success. 148 * 149 */ 150 int netif_stats_req(int netif_phone, device_id_t device_id, 151 device_stats_t *stats) 78 152 { 79 153 if (!stats) … … 81 155 82 156 aid_t message_id = async_send_1(netif_phone, NET_NETIF_STATS, 83 ( ipcarg_t) device_id, NULL);157 (sysarg_t) device_id, NULL); 84 158 async_data_read_start(netif_phone, stats, sizeof(*stats)); 85 159 86 ipcarg_t result;160 sysarg_t result; 87 161 async_wait_for(message_id, &result); 88 162 … … 90 164 } 91 165 92 int netif_bind_service_remote(services_t service, device_id_t device_id, services_t me, 93 async_client_conn_t receiver) 166 /** Create bidirectional connection with the network interface module 167 * 168 * Create bidirectional connection with the network interface module and 169 * register the message receiver. 170 * 171 * @param[in] service The network interface module service. 172 * @param[in] device_id The device identifier. 173 * @param[in] me The requesting module service. 174 * @param[in] receiver The message receiver. 175 * 176 * @return The phone of the needed service. 177 * @return EOK on success. 178 * @return Other error codes as defined for the bind_service() 179 * function. 180 * 181 */ 182 int netif_bind_service(services_t service, device_id_t device_id, 183 services_t me, async_client_conn_t receiver) 94 184 { 95 185 return bind_service(service, device_id, me, 0, receiver);
Note:
See TracChangeset
for help on using the changeset viewer.