Changeset b5e68c8 in mainline for uspace/lib/net/generic/generic.c
- Timestamp:
- 2011-05-12T16:49:44Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f36787d7
- Parents:
- e80329d6 (diff), 750636a (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/net/generic/generic.c
re80329d6 rb5e68c8 36 36 37 37 #include <generic.h> 38 39 38 #include <async.h> 40 #include <ipc/ipc.h>41 39 #include <ipc/services.h> 42 43 40 #include <net/device.h> 44 41 #include <adt/measured_strings.h> … … 59 56 int state, services_t target) 60 57 { 61 async_msg_3(phone, ( ipcarg_t) message, (ipcarg_t) device_id,62 ( ipcarg_t) state, target);58 async_msg_3(phone, (sysarg_t) message, (sysarg_t) device_id, 59 (sysarg_t) state, target); 63 60 64 61 return EOK; … … 81 78 int arg2, services_t service) 82 79 { 83 return (int) async_req_3_0(phone, ( ipcarg_t) message,84 ( ipcarg_t) device_id, (ipcarg_t) arg2, (ipcarg_t) service);80 return (int) async_req_3_0(phone, (sysarg_t) message, 81 (sysarg_t) device_id, (sysarg_t) arg2, (sysarg_t) service); 85 82 } 86 83 … … 92 89 * @param[out] address The desired address. 93 90 * @param[out] data The address data container. 94 * @return sEOK on success.95 * @return sEBADMEM if the address parameter and/or the data91 * @return EOK on success. 92 * @return EBADMEM if the address parameter and/or the data 96 93 * parameter is NULL. 97 * @return sOther error codes as defined for the specific service94 * @return Other error codes as defined for the specific service 98 95 * message. 99 96 */ 100 97 int 101 98 generic_get_addr_req(int phone, int message, device_id_t device_id, 102 measured_string_ ref *address, char **data)99 measured_string_t **address, uint8_t **data) 103 100 { 104 101 aid_t message_id; 105 ipcarg_t result;102 sysarg_t result; 106 103 int string; 107 104 … … 109 106 return EBADMEM; 110 107 111 / / request the address112 message_id = async_send_1(phone, ( ipcarg_t) message,113 ( ipcarg_t) device_id, NULL);108 /* Request the address */ 109 message_id = async_send_1(phone, (sysarg_t) message, 110 (sysarg_t) device_id, NULL); 114 111 string = measured_strings_return(phone, address, data, 1); 115 112 async_wait_for(message_id, &result); 116 113 117 / / if not successful114 /* If not successful */ 118 115 if ((string == EOK) && (result != EOK)) { 119 / / clear the data116 /* Clear the data */ 120 117 free(*address); 121 118 free(*data); … … 138 135 int 139 136 generic_packet_size_req_remote(int phone, int message, device_id_t device_id, 140 packet_dimension_ refpacket_dimension)137 packet_dimension_t *packet_dimension) 141 138 { 142 139 if (!packet_dimension) 143 140 return EBADMEM; 144 141 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);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); 152 149 153 150 packet_dimension->prefix = (size_t) prefix; … … 175 172 { 176 173 if (error) { 177 async_msg_4(phone, ( ipcarg_t) message, (ipcarg_t) device_id,178 ( ipcarg_t) packet_id, (ipcarg_t) target, (ipcarg_t) error);174 async_msg_4(phone, (sysarg_t) message, (sysarg_t) device_id, 175 (sysarg_t) packet_id, (sysarg_t) target, (sysarg_t) error); 179 176 } else { 180 async_msg_3(phone, ( ipcarg_t) message, (ipcarg_t) device_id,181 ( ipcarg_t) packet_id, (ipcarg_t) target);177 async_msg_3(phone, (sysarg_t) message, (sysarg_t) device_id, 178 (sysarg_t) packet_id, (sysarg_t) target); 182 179 } 183 180 … … 201 198 { 202 199 if (error) { 203 async_msg_4(phone, ( ipcarg_t) message, (ipcarg_t) device_id,204 ( ipcarg_t) packet_id, (ipcarg_t) sender, (ipcarg_t) error);200 async_msg_4(phone, (sysarg_t) message, (sysarg_t) device_id, 201 (sysarg_t) packet_id, (sysarg_t) sender, (sysarg_t) error); 205 202 } else { 206 async_msg_3(phone, ( ipcarg_t) message, (ipcarg_t) device_id,207 ( ipcarg_t) packet_id, (ipcarg_t) sender);203 async_msg_3(phone, (sysarg_t) message, (sysarg_t) device_id, 204 (sysarg_t) packet_id, (sysarg_t) sender); 208 205 } 209 206 … … 223 220 * @param[out] translation The translated values. 224 221 * @param[out] data The translation data container. 225 * @return sEOK on success.226 * @return sEINVAL if the configuration parameter is NULL.227 * @return sEINVAL if the count parameter is zero.228 * @return sEBADMEM if the translation or the data parameters are222 * @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 are 229 226 * NULL. 230 * @return sOther error codes as defined for the specific service227 * @return Other error codes as defined for the specific service 231 228 * message. 232 229 */ 233 230 int 234 231 generic_translate_req(int phone, int message, device_id_t device_id, 235 services_t service, measured_string_ refconfiguration, size_t count,236 measured_string_ ref *translation, char**data)232 services_t service, measured_string_t *configuration, size_t count, 233 measured_string_t **translation, uint8_t **data) 237 234 { 238 235 aid_t message_id; 239 ipcarg_t result;236 sysarg_t result; 240 237 int string; 241 238 … … 245 242 return EBADMEM; 246 243 247 / / request the translation248 message_id = async_send_3(phone, ( ipcarg_t) message,249 ( ipcarg_t) device_id, (ipcarg_t) count, (ipcarg_t) service, NULL);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); 250 247 measured_strings_send(phone, configuration, count); 251 248 string = measured_strings_return(phone, translation, data, count); 252 249 async_wait_for(message_id, &result); 253 250 254 / / if not successful251 /* If not successful */ 255 252 if ((string == EOK) && (result != EOK)) { 256 / / clear the data253 /* Clear the data */ 257 254 free(*translation); 258 255 free(*data);
Note:
See TracChangeset
for help on using the changeset viewer.