Changes in uspace/lib/c/generic/iplink.c [a17356fd:02a09ed] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/iplink.c
ra17356fd r02a09ed 86 86 87 87 ipc_call_t answer; 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); 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)); 91 if (rc != EOK) { 92 async_exchange_end(exch); 93 async_forget(req); 94 return rc; 95 } 96 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 rc = async_data_write_start(exch, sdu->data, sdu->size); 92 105 93 106 async_exchange_end(exch); … … 104 117 } 105 118 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));114 if (rc != EOK) {115 async_exchange_end(exch);116 async_forget(req);117 return rc;118 }119 120 rc = async_data_write_start(exch, sdu->data, sdu->size);121 122 async_exchange_end(exch);123 124 if (rc != EOK) {125 async_forget(req);126 return rc;127 }128 129 sysarg_t retval;130 async_wait_for(req, &retval);131 132 return (int) retval;133 }134 135 119 int iplink_get_mtu(iplink_t *iplink, size_t *rmtu) 136 120 { 137 async_exch_t *exch = async_exchange_begin(iplink->sess);138 139 121 sysarg_t mtu; 122 async_exch_t *exch = async_exchange_begin(iplink->sess); 123 140 124 int rc = async_req_0_1(exch, IPLINK_GET_MTU, &mtu); 141 142 async_exchange_end(exch); 143 125 async_exchange_end(exch); 126 144 127 if (rc != EOK) 145 128 return rc; 146 129 147 130 *rmtu = mtu; 148 131 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;171 132 } 172 133
Note:
See TracChangeset
for help on using the changeset viewer.