Changeset 26e7d6d in mainline for uspace/lib/net/netif/netif_remote.c
- Timestamp:
- 2011-09-19T16:31:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a347a11
- Parents:
- 3842a955 (diff), 086290d (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
r3842a955 r26e7d6d 38 38 #include <packet_client.h> 39 39 #include <generic.h> 40 #include <async_obsolete.h>41 40 #include <ipc/services.h> 42 41 #include <ipc/netif.h> 43 44 42 #include <net/modules.h> 45 43 #include <adt/measured_strings.h> … … 49 47 /** Return the device local hardware address. 50 48 * 51 * @param[in] netif_phone Network interface phone.52 * @param[in] device_id 53 * @param[out] address 54 * @param[out] data 49 * @param[in] sess Network interface session. 50 * @param[in] device_id Device identifier. 51 * @param[out] address Device local hardware address. 52 * @param[out] data Address data. 55 53 * 56 54 * @return EOK on success. … … 61 59 * 62 60 */ 63 int netif_get_addr_req( int netif_phone, device_id_t device_id,61 int netif_get_addr_req(async_sess_t *sess, device_id_t device_id, 64 62 measured_string_t **address, uint8_t **data) 65 63 { 66 return generic_get_addr_req( netif_phone, NET_NETIF_GET_ADDR, device_id,64 return generic_get_addr_req(sess, NET_NETIF_GET_ADDR, device_id, 67 65 address, data); 68 66 } … … 70 68 /** Probe the existence of the device. 71 69 * 72 * @param[in] netif_phone Network interface phone.73 * @param[in] device_id 74 * @param[in] irq 75 * @param[in] io 70 * @param[in] sess Network interface session. 71 * @param[in] device_id Device identifier. 72 * @param[in] irq Device interrupt number. 73 * @param[in] io Device input/output address. 76 74 * 77 75 * @return EOK on success. … … 80 78 * 81 79 */ 82 int netif_probe_req( int netif_phone, device_id_t device_id, int irq, void *io)80 int netif_probe_req(async_sess_t *sess, device_id_t device_id, int irq, void *io) 83 81 { 84 return async_obsolete_req_3_0(netif_phone, NET_NETIF_PROBE, device_id, irq, 82 async_exch_t *exch = async_exchange_begin(sess); 83 int rc = async_req_3_0(exch, NET_NETIF_PROBE, device_id, (sysarg_t) irq, 85 84 (sysarg_t) io); 85 async_exchange_end(exch); 86 87 return rc; 86 88 } 87 89 88 90 /** Send the packet queue. 89 91 * 90 * @param[in] netif_phone Network interface phone.91 * @param[in] device_id 92 * @param[in] packet 93 * @param[in] sender 92 * @param[in] sess Network interface session. 93 * @param[in] device_id Device identifier. 94 * @param[in] packet Packet queue. 95 * @param[in] sender Sending module service. 94 96 * 95 97 * @return EOK on success. … … 98 100 * 99 101 */ 100 int netif_send_msg( int netif_phone, device_id_t device_id, packet_t *packet,102 int netif_send_msg(async_sess_t *sess, device_id_t device_id, packet_t *packet, 101 103 services_t sender) 102 104 { 103 return generic_send_msg_remote( netif_phone, NET_NETIF_SEND, device_id,105 return generic_send_msg_remote(sess, NET_NETIF_SEND, device_id, 104 106 packet_get_id(packet), sender, 0); 105 107 } … … 107 109 /** Start the device. 108 110 * 109 * @param[in] netif_phone Network interface phone.110 * @param[in] device_id 111 * @param[in] sess Network interface session. 112 * @param[in] device_id Device identifier. 111 113 * 112 114 * @return EOK on success. … … 117 119 * 118 120 */ 119 int netif_start_req( int netif_phone, device_id_t device_id)121 int netif_start_req(async_sess_t *sess, device_id_t device_id) 120 122 { 121 return async_obsolete_req_1_0(netif_phone, NET_NETIF_START, device_id); 123 async_exch_t *exch = async_exchange_begin(sess); 124 int rc = async_req_1_0(exch, NET_NETIF_START, device_id); 125 async_exchange_end(exch); 126 127 return rc; 122 128 } 123 129 124 130 /** Stop the device. 125 131 * 126 * @param[in] netif_phone Network interface phone.127 * @param[in] device_id 132 * @param[in] sess Network interface session. 133 * @param[in] device_id Device identifier. 128 134 * 129 135 * @return EOK on success. … … 134 140 * 135 141 */ 136 int netif_stop_req( int netif_phone, device_id_t device_id)142 int netif_stop_req(async_sess_t *sess, device_id_t device_id) 137 143 { 138 return async_obsolete_req_1_0(netif_phone, NET_NETIF_STOP, device_id); 144 async_exch_t *exch = async_exchange_begin(sess); 145 int rc = async_req_1_0(exch, NET_NETIF_STOP, device_id); 146 async_exchange_end(exch); 147 148 return rc; 139 149 } 140 150 141 151 /** Return the device usage statistics. 142 152 * 143 * @param[in] netif_phone Network interface phone.144 * @param[in] device_idDevice identifier.145 * @param[out] stats 153 * @param[in] sess Network interface session. 154 * @param[in] device_id Device identifier. 155 * @param[out] stats Device usage statistics. 146 156 * 147 157 * @return EOK on success. 148 158 * 149 159 */ 150 int netif_stats_req( int netif_phone, device_id_t device_id,160 int netif_stats_req(async_sess_t *sess, device_id_t device_id, 151 161 device_stats_t *stats) 152 162 { … … 154 164 return EBADMEM; 155 165 156 aid_t message_id = async_obsolete_send_1(netif_phone, NET_NETIF_STATS, 166 async_exch_t *exch = async_exchange_begin(sess); 167 aid_t message_id = async_send_1(exch, NET_NETIF_STATS, 157 168 (sysarg_t) device_id, NULL); 158 async_obsolete_data_read_start(netif_phone, stats, sizeof(*stats)); 169 async_data_read_start(exch, stats, sizeof(*stats)); 170 async_exchange_end(exch); 159 171 160 172 sysarg_t result; … … 169 181 * register the message receiver. 170 182 * 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.183 * @param[in] service Network interface module service. 184 * @param[in] device_id Device identifier. 185 * @param[in] me Requesting module service. 186 * @param[in] receiver Message receiver. 175 187 * 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. 188 * @return Session to the needed service. 189 * @return NULL on failure. 180 190 * 181 191 */ 182 intnetif_bind_service(services_t service, device_id_t device_id,192 async_sess_t *netif_bind_service(services_t service, device_id_t device_id, 183 193 services_t me, async_client_conn_t receiver) 184 194 {
Note:
See TracChangeset
for help on using the changeset viewer.