Changeset 8e7c9fe in mainline for uspace/lib/c/generic/iplink.c
- Timestamp:
- 2014-09-12T03:45:25Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c53b58e
- Parents:
- 3eb0c85 (diff), 105d8d6 (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/c/generic/iplink.c
r3eb0c85 r8e7c9fe 171 171 } 172 172 173 int iplink_set_mac48(iplink_t *iplink, addr48_t mac) 174 { 175 async_exch_t *exch = async_exchange_begin(iplink->sess); 176 177 ipc_call_t answer; 178 aid_t req = async_send_0(exch, IPLINK_GET_MAC48, &answer); 179 180 int rc = async_data_read_start(exch, mac, sizeof(addr48_t)); 181 182 loc_exchange_end(exch); 183 184 if (rc != EOK) { 185 async_forget(req); 186 return rc; 187 } 188 189 sysarg_t retval; 190 async_wait_for(req, &retval); 191 192 return (int) retval; 193 } 194 195 173 196 int iplink_addr_add(iplink_t *iplink, inet_addr_t *addr) 174 197 { … … 230 253 free(sdu.data); 231 254 async_answer_0(iid, rc); 255 } 256 257 static void iplink_ev_change_addr(iplink_t *iplink, ipc_callid_t iid, 258 ipc_call_t *icall) 259 { 260 addr48_t *addr; 261 size_t size; 262 263 int rc = async_data_write_accept((void **)&addr, false, 264 sizeof(addr48_t), sizeof(addr48_t), 0, &size); 265 if (rc != EOK) { 266 async_answer_0(iid, rc); 267 return; 268 } 269 270 rc = iplink->ev_ops->change_addr(iplink, *addr); 271 free(addr); 272 async_answer_0(iid, EOK); 232 273 } 233 274 … … 249 290 iplink_ev_recv(iplink, callid, &call); 250 291 break; 292 case IPLINK_EV_CHANGE_ADDR: 293 iplink_ev_change_addr(iplink, callid, &call); 251 294 default: 252 295 async_answer_0(callid, ENOTSUP);
Note:
See TracChangeset
for help on using the changeset viewer.