Changes in uspace/lib/c/generic/iplink_srv.c [417a2ba1:c3b25985] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/iplink_srv.c
r417a2ba1 rc3b25985 81 81 } 82 82 83 static void iplink_set_mac48_srv(iplink_srv_t *srv, ipc_callid_t iid, 84 ipc_call_t *icall) 85 { 86 int rc; 87 size_t size; 88 addr48_t mac; 89 ipc_callid_t callid; 90 91 rc = async_data_write_receive(&callid, &size); 92 if (rc != EOK) { 93 async_answer_0(callid, (sysarg_t) rc); 94 async_answer_0(iid, (sysarg_t) rc); 95 } 96 97 rc = srv->ops->set_mac48(srv, &mac); 98 if (rc != EOK) { 99 async_answer_0(iid, rc); 100 return; 101 } 102 103 rc = async_data_read_finalize(callid, &mac, sizeof(addr48_t)); 104 if (rc != EOK) 105 async_answer_0(callid, rc); 106 107 async_answer_0(iid, (sysarg_t) rc); 108 } 109 83 110 static void iplink_addr_add_srv(iplink_srv_t *srv, ipc_callid_t iid, 84 111 ipc_call_t *icall) … … 252 279 iplink_get_mac48_srv(srv, callid, &call); 253 280 break; 281 case IPLINK_SET_MAC48: 282 iplink_set_mac48_srv(srv, callid, &call); 283 break; 254 284 case IPLINK_SEND: 255 285 iplink_send_srv(srv, callid, &call); … … 300 330 } 301 331 332 int iplink_ev_change_addr(iplink_srv_t *srv, addr48_t *addr) 333 { 334 if (srv->client_sess == NULL) 335 return EIO; 336 337 async_exch_t *exch = async_exchange_begin(srv->client_sess); 338 339 ipc_call_t answer; 340 aid_t req = async_send_0(exch, IPLINK_EV_CHANGE_ADDR, &answer); 341 342 int rc = async_data_write_start(exch, addr, sizeof(addr48_t)); 343 async_exchange_end(exch); 344 345 if (rc != EOK) { 346 async_forget(req); 347 return rc; 348 } 349 350 sysarg_t retval; 351 async_wait_for(req, &retval); 352 if (retval != EOK) 353 return retval; 354 355 return EOK; 356 } 357 302 358 /** @} 303 359 */
Note:
See TracChangeset
for help on using the changeset viewer.