Changes in uspace/lib/c/generic/iplink.c [dc12262:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/iplink.c
rdc12262 rb7fd2a0 47 47 static void iplink_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg); 48 48 49 int iplink_open(async_sess_t *sess, iplink_ev_ops_t *ev_ops, void *arg,49 errno_t iplink_open(async_sess_t *sess, iplink_ev_ops_t *ev_ops, void *arg, 50 50 iplink_t **riplink) 51 51 { … … 61 61 62 62 port_id_t port; 63 int rc = async_create_callback_port(exch, INTERFACE_IPLINK_CB, 0, 0,63 errno_t rc = async_create_callback_port(exch, INTERFACE_IPLINK_CB, 0, 0, 64 64 iplink_cb_conn, iplink, &port); 65 65 … … 85 85 } 86 86 87 int iplink_send(iplink_t *iplink, iplink_sdu_t *sdu)87 errno_t iplink_send(iplink_t *iplink, iplink_sdu_t *sdu) 88 88 { 89 89 async_exch_t *exch = async_exchange_begin(iplink->sess); … … 93 93 (sysarg_t) sdu->dest, &answer); 94 94 95 int rc = async_data_write_start(exch, sdu->data, sdu->size);96 97 async_exchange_end(exch); 98 99 if (rc != EOK) { 100 async_forget(req); 101 return rc; 102 } 103 104 sysarg_t retval;105 async_wait_for(req, &retval); 106 107 return (int)retval;108 } 109 110 int iplink_send6(iplink_t *iplink, iplink_sdu6_t *sdu)95 errno_t rc = async_data_write_start(exch, sdu->data, sdu->size); 96 97 async_exchange_end(exch); 98 99 if (rc != EOK) { 100 async_forget(req); 101 return rc; 102 } 103 104 errno_t retval; 105 async_wait_for(req, &retval); 106 107 return retval; 108 } 109 110 errno_t iplink_send6(iplink_t *iplink, iplink_sdu6_t *sdu) 111 111 { 112 112 async_exch_t *exch = async_exchange_begin(iplink->sess); … … 115 115 aid_t req = async_send_0(exch, IPLINK_SEND6, &answer); 116 116 117 int rc = async_data_write_start(exch, &sdu->dest, sizeof(addr48_t));117 errno_t rc = async_data_write_start(exch, &sdu->dest, sizeof(addr48_t)); 118 118 if (rc != EOK) { 119 119 async_exchange_end(exch); … … 131 131 } 132 132 133 sysarg_t retval;134 async_wait_for(req, &retval); 135 136 return (int)retval;137 } 138 139 int iplink_get_mtu(iplink_t *iplink, size_t *rmtu)133 errno_t retval; 134 async_wait_for(req, &retval); 135 136 return retval; 137 } 138 139 errno_t iplink_get_mtu(iplink_t *iplink, size_t *rmtu) 140 140 { 141 141 async_exch_t *exch = async_exchange_begin(iplink->sess); 142 142 143 143 sysarg_t mtu; 144 int rc = async_req_0_1(exch, IPLINK_GET_MTU, &mtu);144 errno_t rc = async_req_0_1(exch, IPLINK_GET_MTU, &mtu); 145 145 146 146 async_exchange_end(exch); … … 153 153 } 154 154 155 int iplink_get_mac48(iplink_t *iplink, addr48_t *mac)155 errno_t iplink_get_mac48(iplink_t *iplink, addr48_t *mac) 156 156 { 157 157 async_exch_t *exch = async_exchange_begin(iplink->sess); … … 160 160 aid_t req = async_send_0(exch, IPLINK_GET_MAC48, &answer); 161 161 162 int rc = async_data_read_start(exch, mac, sizeof(addr48_t));162 errno_t rc = async_data_read_start(exch, mac, sizeof(addr48_t)); 163 163 164 164 loc_exchange_end(exch); … … 169 169 } 170 170 171 sysarg_t retval;172 async_wait_for(req, &retval); 173 174 return (int)retval;175 } 176 177 int iplink_set_mac48(iplink_t *iplink, addr48_t mac)171 errno_t retval; 172 async_wait_for(req, &retval); 173 174 return retval; 175 } 176 177 errno_t iplink_set_mac48(iplink_t *iplink, addr48_t mac) 178 178 { 179 179 async_exch_t *exch = async_exchange_begin(iplink->sess); … … 182 182 aid_t req = async_send_0(exch, IPLINK_GET_MAC48, &answer); 183 183 184 int rc = async_data_read_start(exch, mac, sizeof(addr48_t));184 errno_t rc = async_data_read_start(exch, mac, sizeof(addr48_t)); 185 185 186 186 loc_exchange_end(exch); … … 191 191 } 192 192 193 sysarg_t retval;194 async_wait_for(req, &retval); 195 196 return (int)retval;197 } 198 199 200 int iplink_addr_add(iplink_t *iplink, inet_addr_t *addr)193 errno_t retval; 194 async_wait_for(req, &retval); 195 196 return retval; 197 } 198 199 200 errno_t iplink_addr_add(iplink_t *iplink, inet_addr_t *addr) 201 201 { 202 202 async_exch_t *exch = async_exchange_begin(iplink->sess); … … 205 205 aid_t req = async_send_0(exch, IPLINK_ADDR_ADD, &answer); 206 206 207 int rc = async_data_write_start(exch, addr, sizeof(inet_addr_t));208 async_exchange_end(exch); 209 210 if (rc != EOK) { 211 async_forget(req); 212 return rc; 213 } 214 215 sysarg_t retval;216 async_wait_for(req, &retval); 217 218 return (int)retval;219 } 220 221 int iplink_addr_remove(iplink_t *iplink, inet_addr_t *addr)207 errno_t rc = async_data_write_start(exch, addr, sizeof(inet_addr_t)); 208 async_exchange_end(exch); 209 210 if (rc != EOK) { 211 async_forget(req); 212 return rc; 213 } 214 215 errno_t retval; 216 async_wait_for(req, &retval); 217 218 return retval; 219 } 220 221 errno_t iplink_addr_remove(iplink_t *iplink, inet_addr_t *addr) 222 222 { 223 223 async_exch_t *exch = async_exchange_begin(iplink->sess); … … 226 226 aid_t req = async_send_0(exch, IPLINK_ADDR_REMOVE, &answer); 227 227 228 int rc = async_data_write_start(exch, addr, sizeof(inet_addr_t));229 async_exchange_end(exch); 230 231 if (rc != EOK) { 232 async_forget(req); 233 return rc; 234 } 235 236 sysarg_t retval;237 async_wait_for(req, &retval); 238 239 return (int)retval;228 errno_t rc = async_data_write_start(exch, addr, sizeof(inet_addr_t)); 229 async_exchange_end(exch); 230 231 if (rc != EOK) { 232 async_forget(req); 233 return rc; 234 } 235 236 errno_t retval; 237 async_wait_for(req, &retval); 238 239 return retval; 240 240 } 241 241 … … 252 252 ip_ver_t ver = IPC_GET_ARG1(*icall); 253 253 254 int rc = async_data_write_accept(&sdu.data, false, 0, 0, 0,254 errno_t rc = async_data_write_accept(&sdu.data, false, 0, 0, 0, 255 255 &sdu.size); 256 256 if (rc != EOK) { … … 270 270 size_t size; 271 271 272 int rc = async_data_write_accept((void **)&addr, false,272 errno_t rc = async_data_write_accept((void **)&addr, false, 273 273 sizeof(addr48_t), sizeof(addr48_t), 0, &size); 274 274 if (rc != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.