Changeset b86a32e in mainline for uspace/lib/c/generic/iplink.c
- Timestamp:
- 2013-07-15T12:14:55Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c84146d3
- Parents:
- 87159eb8 (diff), 956d4281 (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
r87159eb8 rb86a32e 86 86 87 87 ipc_call_t answer; 88 aid_t req = async_send_0(exch, IPLINK_SEND, &answer); 89 90 int rc = async_data_write_start(exch, &sdu->src, sizeof(inet_addr_t)); 88 aid_t req = async_send_2(exch, IPLINK_SEND, (sysarg_t) sdu->src, 89 (sysarg_t) sdu->dest, &answer); 90 91 int rc = async_data_write_start(exch, sdu->data, sdu->size); 92 93 async_exchange_end(exch); 94 95 if (rc != EOK) { 96 async_forget(req); 97 return rc; 98 } 99 100 sysarg_t retval; 101 async_wait_for(req, &retval); 102 103 return (int) retval; 104 } 105 106 int iplink_send6(iplink_t *iplink, iplink_sdu6_t *sdu) 107 { 108 async_exch_t *exch = async_exchange_begin(iplink->sess); 109 110 ipc_call_t answer; 111 aid_t req = async_send_0(exch, IPLINK_SEND6, &answer); 112 113 int rc = async_data_write_start(exch, &sdu->dest, sizeof(addr48_t)); 91 114 if (rc != EOK) { 92 115 async_exchange_end(exch); … … 95 118 } 96 119 97 rc = async_data_write_start(exch, &sdu->dest, sizeof(inet_addr_t));98 if (rc != EOK) {99 async_exchange_end(exch);100 async_forget(req);101 return rc;102 }103 104 120 rc = async_data_write_start(exch, sdu->data, sdu->size); 105 121 … … 119 135 int iplink_get_mtu(iplink_t *iplink, size_t *rmtu) 120 136 { 137 async_exch_t *exch = async_exchange_begin(iplink->sess); 138 121 139 sysarg_t mtu; 122 async_exch_t *exch = async_exchange_begin(iplink->sess);123 124 140 int rc = async_req_0_1(exch, IPLINK_GET_MTU, &mtu); 125 async_exchange_end(exch); 126 141 142 async_exchange_end(exch); 143 127 144 if (rc != EOK) 128 145 return rc; 129 146 130 147 *rmtu = mtu; 131 148 return EOK; 149 } 150 151 int iplink_get_mac48(iplink_t *iplink, addr48_t *mac) 152 { 153 async_exch_t *exch = async_exchange_begin(iplink->sess); 154 155 ipc_call_t answer; 156 aid_t req = async_send_0(exch, IPLINK_GET_MAC48, &answer); 157 158 int rc = async_data_read_start(exch, mac, sizeof(addr48_t)); 159 160 loc_exchange_end(exch); 161 162 if (rc != EOK) { 163 async_forget(req); 164 return rc; 165 } 166 167 sysarg_t retval; 168 async_wait_for(req, &retval); 169 170 return (int) retval; 132 171 } 133 172
Note:
See TracChangeset
for help on using the changeset viewer.