Changes in uspace/lib/net/generic/generic.c [28a3e74:b01f878] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/generic/generic.c
r28a3e74 rb01f878 36 36 37 37 #include <generic.h> 38 38 39 #include <async.h> 40 #include <ipc/ipc.h> 39 41 #include <ipc/services.h> 42 40 43 #include <net/device.h> 41 44 #include <adt/measured_strings.h> … … 56 59 int state, services_t target) 57 60 { 58 async_msg_3(phone, ( sysarg_t) message, (sysarg_t) device_id,59 ( sysarg_t) state, target);61 async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id, 62 (ipcarg_t) state, target); 60 63 61 64 return EOK; … … 78 81 int arg2, services_t service) 79 82 { 80 return (int) async_req_3_0(phone, ( sysarg_t) message,81 ( sysarg_t) device_id, (sysarg_t) arg2, (sysarg_t) service);83 return (int) async_req_3_0(phone, (ipcarg_t) message, 84 (ipcarg_t) device_id, (ipcarg_t) arg2, (ipcarg_t) service); 82 85 } 83 86 … … 89 92 * @param[out] address The desired address. 90 93 * @param[out] data The address data container. 91 * @return EOK on success.92 * @return EBADMEM if the address parameter and/or the data94 * @returns EOK on success. 95 * @returns EBADMEM if the address parameter and/or the data 93 96 * parameter is NULL. 94 * @return Other error codes as defined for the specific service97 * @returns Other error codes as defined for the specific service 95 98 * message. 96 99 */ 97 100 int 98 101 generic_get_addr_req(int phone, int message, device_id_t device_id, 99 measured_string_ t **address, uint8_t **data)102 measured_string_ref *address, char ** data) 100 103 { 101 104 aid_t message_id; 102 sysarg_t result;105 ipcarg_t result; 103 106 int string; 104 107 … … 106 109 return EBADMEM; 107 110 108 / * Request the address */109 message_id = async_send_1(phone, ( sysarg_t) message,110 ( sysarg_t) device_id, NULL);111 // request the address 112 message_id = async_send_1(phone, (ipcarg_t) message, 113 (ipcarg_t) device_id, NULL); 111 114 string = measured_strings_return(phone, address, data, 1); 112 115 async_wait_for(message_id, &result); 113 116 114 / * If not successful */117 // if not successful 115 118 if ((string == EOK) && (result != EOK)) { 116 / * Clear the data */119 // clear the data 117 120 free(*address); 118 121 free(*data); … … 135 138 int 136 139 generic_packet_size_req_remote(int phone, int message, device_id_t device_id, 137 packet_dimension_ t *packet_dimension)140 packet_dimension_ref packet_dimension) 138 141 { 139 142 if (!packet_dimension) 140 143 return EBADMEM; 141 144 142 sysarg_t addr_len;143 sysarg_t prefix;144 sysarg_t content;145 sysarg_t suffix;146 147 sysarg_t result = async_req_1_4(phone, (sysarg_t) message,148 ( sysarg_t) device_id, &addr_len, &prefix, &content, &suffix);145 ipcarg_t addr_len; 146 ipcarg_t prefix; 147 ipcarg_t content; 148 ipcarg_t suffix; 149 150 ipcarg_t result = async_req_1_4(phone, (ipcarg_t) message, 151 (ipcarg_t) device_id, &addr_len, &prefix, &content, &suffix); 149 152 150 153 packet_dimension->prefix = (size_t) prefix; … … 172 175 { 173 176 if (error) { 174 async_msg_4(phone, ( sysarg_t) message, (sysarg_t) device_id,175 ( sysarg_t) packet_id, (sysarg_t) target, (sysarg_t) error);177 async_msg_4(phone, (ipcarg_t) message, (ipcarg_t) device_id, 178 (ipcarg_t) packet_id, (ipcarg_t) target, (ipcarg_t) error); 176 179 } else { 177 async_msg_3(phone, ( sysarg_t) message, (sysarg_t) device_id,178 ( sysarg_t) packet_id, (sysarg_t) target);180 async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id, 181 (ipcarg_t) packet_id, (ipcarg_t) target); 179 182 } 180 183 … … 198 201 { 199 202 if (error) { 200 async_msg_4(phone, ( sysarg_t) message, (sysarg_t) device_id,201 ( sysarg_t) packet_id, (sysarg_t) sender, (sysarg_t) error);203 async_msg_4(phone, (ipcarg_t) message, (ipcarg_t) device_id, 204 (ipcarg_t) packet_id, (ipcarg_t) sender, (ipcarg_t) error); 202 205 } else { 203 async_msg_3(phone, ( sysarg_t) message, (sysarg_t) device_id,204 ( sysarg_t) packet_id, (sysarg_t) sender);206 async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id, 207 (ipcarg_t) packet_id, (ipcarg_t) sender); 205 208 } 206 209 … … 220 223 * @param[out] translation The translated values. 221 224 * @param[out] data The translation data container. 222 * @return EOK on success.223 * @return EINVAL if the configuration parameter is NULL.224 * @return EINVAL if the count parameter is zero.225 * @return EBADMEM if the translation or the data parameters are225 * @returns EOK on success. 226 * @returns EINVAL if the configuration parameter is NULL. 227 * @returns EINVAL if the count parameter is zero. 228 * @returns EBADMEM if the translation or the data parameters are 226 229 * NULL. 227 * @return Other error codes as defined for the specific service230 * @returns Other error codes as defined for the specific service 228 231 * message. 229 232 */ 230 233 int 231 234 generic_translate_req(int phone, int message, device_id_t device_id, 232 services_t service, measured_string_ t *configuration, size_t count,233 measured_string_ t **translation, uint8_t**data)235 services_t service, measured_string_ref configuration, size_t count, 236 measured_string_ref *translation, char **data) 234 237 { 235 238 aid_t message_id; 236 sysarg_t result;239 ipcarg_t result; 237 240 int string; 238 241 … … 242 245 return EBADMEM; 243 246 244 / * Request the translation */245 message_id = async_send_3(phone, ( sysarg_t) message,246 ( sysarg_t) device_id, (sysarg_t) count, (sysarg_t) service, NULL);247 // request the translation 248 message_id = async_send_3(phone, (ipcarg_t) message, 249 (ipcarg_t) device_id, (ipcarg_t) count, (ipcarg_t) service, NULL); 247 250 measured_strings_send(phone, configuration, count); 248 251 string = measured_strings_return(phone, translation, data, count); 249 252 async_wait_for(message_id, &result); 250 253 251 / * If not successful */254 // if not successful 252 255 if ((string == EOK) && (result != EOK)) { 253 / * Clear the data */256 // clear the data 254 257 free(*translation); 255 258 free(*data);
Note:
See TracChangeset
for help on using the changeset viewer.