Changeset b7fd2a0 in mainline for uspace/lib/drv/generic
- Timestamp:
- 2018-01-13T03:10:29Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- Location:
- uspace/lib/drv/generic
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/driver.c
r36f0738 rb7fd2a0 124 124 125 125 char *dev_name = NULL; 126 int rc = async_data_write_accept((void **) &dev_name, true, 0, 0, 0, 0);126 errno_t rc = async_data_write_accept((void **) &dev_name, true, 0, 0, 0, 0); 127 127 if (rc != EOK) { 128 128 async_answer_0(iid, rc); … … 157 157 (void) parent_fun_handle; 158 158 159 int res = driver->driver_ops->dev_add(dev);159 errno_t res = driver->driver_ops->dev_add(dev); 160 160 161 161 if (res != EOK) { … … 189 189 } 190 190 191 int rc;191 errno_t rc; 192 192 193 193 if (driver->driver_ops->dev_remove != NULL) … … 217 217 } 218 218 219 int rc;219 errno_t rc; 220 220 221 221 if (driver->driver_ops->dev_gone != NULL) … … 253 253 254 254 /* Call driver entry point */ 255 int rc;255 errno_t rc; 256 256 257 257 if (driver->driver_ops->fun_online != NULL) … … 288 288 289 289 /* Call driver entry point */ 290 int rc;290 errno_t rc; 291 291 292 292 if (driver->driver_ops->fun_offline != NULL) … … 404 404 */ 405 405 406 int ret = EOK;406 errno_t ret = EOK; 407 407 /* Open device function */ 408 408 if (fun->ops != NULL && fun->ops->open != NULL) … … 666 666 * @return EOK on success, ENOMEM if out of memory 667 667 */ 668 int ddf_fun_set_name(ddf_fun_t *dev, const char *name)668 errno_t ddf_fun_set_name(ddf_fun_t *dev, const char *name) 669 669 { 670 670 assert(dev->name == NULL); … … 815 815 * 816 816 */ 817 int ddf_fun_bind(ddf_fun_t *fun)817 errno_t ddf_fun_bind(ddf_fun_t *fun) 818 818 { 819 819 assert(fun->bound == false); … … 822 822 823 823 add_to_functions_list(fun); 824 int res = devman_add_function(fun->name, fun->ftype, &fun->match_ids,824 errno_t res = devman_add_function(fun->name, fun->ftype, &fun->match_ids, 825 825 fun->dev->handle, &fun->handle); 826 826 if (res != EOK) { … … 843 843 * 844 844 */ 845 int ddf_fun_unbind(ddf_fun_t *fun)845 errno_t ddf_fun_unbind(ddf_fun_t *fun) 846 846 { 847 847 assert(fun->bound == true); 848 848 849 int res = devman_remove_function(fun->handle);849 errno_t res = devman_remove_function(fun->handle); 850 850 if (res != EOK) 851 851 return res; … … 864 864 * 865 865 */ 866 int ddf_fun_online(ddf_fun_t *fun)866 errno_t ddf_fun_online(ddf_fun_t *fun) 867 867 { 868 868 assert(fun->bound == true); 869 869 870 int res = devman_drv_fun_online(fun->handle);870 errno_t res = devman_drv_fun_online(fun->handle); 871 871 if (res != EOK) 872 872 return res; … … 882 882 * 883 883 */ 884 int ddf_fun_offline(ddf_fun_t *fun)884 errno_t ddf_fun_offline(ddf_fun_t *fun) 885 885 { 886 886 assert(fun->bound == true); 887 887 888 int res = devman_drv_fun_offline(fun->handle);888 errno_t res = devman_drv_fun_offline(fun->handle); 889 889 if (res != EOK) 890 890 return res; … … 906 906 * 907 907 */ 908 int ddf_fun_add_match_id(ddf_fun_t *fun, const char *match_id_str,908 errno_t ddf_fun_add_match_id(ddf_fun_t *fun, const char *match_id_str, 909 909 int match_score) 910 910 { … … 953 953 * 954 954 */ 955 int ddf_fun_add_to_category(ddf_fun_t *fun, const char *cat_name)955 errno_t ddf_fun_add_to_category(ddf_fun_t *fun, const char *cat_name) 956 956 { 957 957 assert(fun->bound == true); … … 974 974 */ 975 975 port_id_t port; 976 int rc = async_create_port(INTERFACE_DDF_DRIVER, driver_connection_driver,976 errno_t rc = async_create_port(INTERFACE_DDF_DRIVER, driver_connection_driver, 977 977 NULL, &port); 978 978 if (rc != EOK) { -
uspace/lib/drv/generic/interrupt.c
r36f0738 rb7fd2a0 43 43 #include "private/driver.h" 44 44 45 int register_interrupt_handler(ddf_dev_t *dev, int irq,45 errno_t register_interrupt_handler(ddf_dev_t *dev, int irq, 46 46 interrupt_handler_t *handler, const irq_code_t *irq_code, 47 47 cap_handle_t *handle) … … 51 51 } 52 52 53 int unregister_interrupt_handler(ddf_dev_t *dev, cap_handle_t cap)53 errno_t unregister_interrupt_handler(ddf_dev_t *dev, cap_handle_t cap) 54 54 { 55 55 return async_irq_unsubscribe(cap); -
uspace/lib/drv/generic/log.c
r36f0738 rb7fd2a0 40 40 * 41 41 */ 42 int ddf_log_init(const char *drv_name)42 errno_t ddf_log_init(const char *drv_name) 43 43 { 44 44 return log_init(drv_name); -
uspace/lib/drv/generic/remote_ahci.c
r36f0738 rb7fd2a0 65 65 66 66 char devn[MAX_NAME_LENGTH]; 67 int rc = devman_fun_get_name(funh, devn, MAX_NAME_LENGTH);67 errno_t rc = devman_fun_get_name(funh, devn, MAX_NAME_LENGTH); 68 68 if (rc != EOK) 69 69 return NULL; … … 83 83 } 84 84 85 int ahci_get_sata_device_name(async_sess_t *sess, size_t sata_dev_name_length,85 errno_t ahci_get_sata_device_name(async_sess_t *sess, size_t sata_dev_name_length, 86 86 char *sata_dev_name) 87 87 { … … 95 95 async_data_read_start(exch, sata_dev_name, sata_dev_name_length); 96 96 97 int rc;97 errno_t rc; 98 98 async_wait_for(req, &rc); 99 99 … … 101 101 } 102 102 103 int ahci_get_num_blocks(async_sess_t *sess, uint64_t *blocks)103 errno_t ahci_get_num_blocks(async_sess_t *sess, uint64_t *blocks) 104 104 { 105 105 async_exch_t *exch = async_exchange_begin(sess); … … 109 109 sysarg_t blocks_hi; 110 110 sysarg_t blocks_lo; 111 int rc = async_req_1_2(exch, DEV_IFACE_ID(AHCI_DEV_IFACE),111 errno_t rc = async_req_1_2(exch, DEV_IFACE_ID(AHCI_DEV_IFACE), 112 112 IPC_M_AHCI_GET_NUM_BLOCKS, &blocks_hi, &blocks_lo); 113 113 … … 122 122 } 123 123 124 int ahci_get_block_size(async_sess_t *sess, size_t *blocks_size)124 errno_t ahci_get_block_size(async_sess_t *sess, size_t *blocks_size) 125 125 { 126 126 async_exch_t *exch = async_exchange_begin(sess); … … 129 129 130 130 sysarg_t bs; 131 int rc = async_req_1_1(exch, DEV_IFACE_ID(AHCI_DEV_IFACE),131 errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(AHCI_DEV_IFACE), 132 132 IPC_M_AHCI_GET_BLOCK_SIZE, &bs); 133 133 … … 140 140 } 141 141 142 int ahci_read_blocks(async_sess_t *sess, uint64_t blocknum, size_t count,142 errno_t ahci_read_blocks(async_sess_t *sess, uint64_t blocknum, size_t count, 143 143 void *buf) 144 144 { … … 155 155 async_exchange_end(exch); 156 156 157 int rc;157 errno_t rc; 158 158 async_wait_for(req, &rc); 159 159 … … 161 161 } 162 162 163 int ahci_write_blocks(async_sess_t *sess, uint64_t blocknum, size_t count,163 errno_t ahci_write_blocks(async_sess_t *sess, uint64_t blocknum, size_t count, 164 164 void* buf) 165 165 { … … 175 175 async_exchange_end(exch); 176 176 177 int rc;177 errno_t rc; 178 178 async_wait_for(req, &rc); 179 179 … … 227 227 } 228 228 229 const int ret = ahci_iface->get_sata_device_name(fun,229 const errno_t ret = ahci_iface->get_sata_device_name(fun, 230 230 sata_dev_name_length, sata_dev_name); 231 231 … … 251 251 252 252 uint64_t blocks; 253 const int ret = ahci_iface->get_num_blocks(fun, &blocks);253 const errno_t ret = ahci_iface->get_num_blocks(fun, &blocks); 254 254 255 255 if (ret != EOK) … … 270 270 271 271 size_t blocks; 272 const int ret = ahci_iface->get_block_size(fun, &blocks);272 const errno_t ret = ahci_iface->get_block_size(fun, &blocks); 273 273 274 274 if (ret != EOK) … … 302 302 const size_t cnt = (size_t) DEV_IPC_GET_ARG3(*call); 303 303 304 const int ret = ahci_iface->read_blocks(fun, blocknum, cnt, buf);304 const errno_t ret = ahci_iface->read_blocks(fun, blocknum, cnt, buf); 305 305 306 306 async_answer_0(callid, ret); … … 331 331 const size_t cnt = (size_t) DEV_IPC_GET_ARG3(*call); 332 332 333 const int ret = ahci_iface->write_blocks(fun, blocknum, cnt, buf);333 const errno_t ret = ahci_iface->write_blocks(fun, blocknum, cnt, buf); 334 334 335 335 async_answer_0(callid, ret); -
uspace/lib/drv/generic/remote_audio_mixer.c
r36f0738 rb7fd2a0 94 94 * @return Error code. 95 95 */ 96 int audio_mixer_get_info(async_exch_t *exch, const char **name, unsigned *items)96 errno_t audio_mixer_get_info(async_exch_t *exch, const char **name, unsigned *items) 97 97 { 98 98 if (!exch) 99 99 return EINVAL; 100 100 sysarg_t name_size, itemc; 101 const int ret = async_req_1_2(exch, DEV_IFACE_ID(AUDIO_MIXER_IFACE),101 const errno_t ret = async_req_1_2(exch, DEV_IFACE_ID(AUDIO_MIXER_IFACE), 102 102 IPC_M_AUDIO_MIXER_GET_INFO, &name_size, &itemc); 103 103 if (ret == EOK && name) { … … 109 109 return ENOMEM; 110 110 } 111 const int ret =111 const errno_t ret = 112 112 async_data_read_start(exch, name_place, name_size); 113 113 if (ret != EOK) { … … 130 130 * @return Error code. 131 131 */ 132 int audio_mixer_get_item_info(async_exch_t *exch, unsigned item,132 errno_t audio_mixer_get_item_info(async_exch_t *exch, unsigned item, 133 133 const char **name, unsigned *levels) 134 134 { … … 136 136 return EINVAL; 137 137 sysarg_t name_size, lvls; 138 const int ret = async_req_2_2(exch, DEV_IFACE_ID(AUDIO_MIXER_IFACE),138 const errno_t ret = async_req_2_2(exch, DEV_IFACE_ID(AUDIO_MIXER_IFACE), 139 139 IPC_M_AUDIO_MIXER_GET_ITEM_INFO, item, &name_size, &lvls); 140 140 if (ret == EOK && name) { … … 146 146 return ENOMEM; 147 147 } 148 const int ret =148 const errno_t ret = 149 149 async_data_read_start(exch, name_place, name_size); 150 150 if (ret != EOK) { … … 166 166 * @return Error code. 167 167 */ 168 int audio_mixer_set_item_level(async_exch_t *exch, unsigned item,168 errno_t audio_mixer_set_item_level(async_exch_t *exch, unsigned item, 169 169 unsigned level) 170 170 { … … 183 183 * @return Error code. 184 184 */ 185 int audio_mixer_get_item_level(async_exch_t *exch, unsigned item,185 errno_t audio_mixer_get_item_level(async_exch_t *exch, unsigned item, 186 186 unsigned *level) 187 187 { … … 189 189 return EINVAL; 190 190 sysarg_t current; 191 const int ret = async_req_2_1(exch, DEV_IFACE_ID(AUDIO_MIXER_IFACE),191 const errno_t ret = async_req_2_1(exch, DEV_IFACE_ID(AUDIO_MIXER_IFACE), 192 192 IPC_M_AUDIO_MIXER_GET_ITEM_LEVEL, item, ¤t); 193 193 if (ret == EOK && level) … … 229 229 const char *name = NULL; 230 230 unsigned items = 0; 231 const int ret = mixer_iface->get_info(fun, &name, &items);231 const errno_t ret = mixer_iface->get_info(fun, &name, &items); 232 232 const size_t name_size = name ? str_size(name) + 1 : 0; 233 233 async_answer_2(callid, ret, name_size, items); … … 261 261 const char *name = NULL; 262 262 unsigned values = 0; 263 const int ret = mixer_iface->get_item_info(fun, item, &name, &values);263 const errno_t ret = mixer_iface->get_item_info(fun, item, &name, &values); 264 264 const size_t name_size = name ? str_size(name) + 1 : 0; 265 265 async_answer_2(callid, ret, name_size, values); … … 291 291 const unsigned item = DEV_IPC_GET_ARG1(*call); 292 292 const unsigned value = DEV_IPC_GET_ARG2(*call); 293 const int ret = mixer_iface->set_item_level(fun, item, value);293 const errno_t ret = mixer_iface->set_item_level(fun, item, value); 294 294 async_answer_0(callid, ret); 295 295 } … … 306 306 const unsigned item = DEV_IPC_GET_ARG1(*call); 307 307 unsigned current = 0; 308 const int ret =308 const errno_t ret = 309 309 mixer_iface->get_item_level(fun, item, ¤t); 310 310 async_answer_1(callid, ret, current); -
uspace/lib/drv/generic/remote_audio_pcm.c
r36f0738 rb7fd2a0 114 114 static category_id_t pcm_id = 0; 115 115 if (!resolved) { 116 const int ret = loc_category_get_id("audio-pcm", &pcm_id,116 const errno_t ret = loc_category_get_id("audio-pcm", &pcm_id, 117 117 IPC_FLAG_BLOCKING); 118 118 if (ret != EOK) … … 123 123 service_id_t *svcs = NULL; 124 124 size_t count = 0; 125 const int ret = loc_category_get_svcs(pcm_id, &svcs, &count);125 const errno_t ret = loc_category_get_svcs(pcm_id, &svcs, &count); 126 126 if (ret != EOK) 127 127 return NULL; … … 143 143 { 144 144 devman_handle_t device_handle = 0; 145 const int ret = devman_fun_get_handle(name, &device_handle, 0);145 const errno_t ret = devman_fun_get_handle(name, &device_handle, 0); 146 146 if (ret != EOK) 147 147 return NULL; … … 184 184 * @note Caller is responsible for freeing newly allocated memory. 185 185 */ 186 int audio_pcm_get_info_str(audio_pcm_sess_t *sess, const char **name)186 errno_t audio_pcm_get_info_str(audio_pcm_sess_t *sess, const char **name) 187 187 { 188 188 if (!name) … … 190 190 async_exch_t *exch = async_exchange_begin(sess); 191 191 sysarg_t name_size; 192 const int ret = async_req_1_1(exch,192 const errno_t ret = async_req_1_1(exch, 193 193 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), 194 194 IPC_M_AUDIO_PCM_GET_INFO_STR, &name_size); … … 202 202 return ENOMEM; 203 203 } 204 const int ret =204 const errno_t ret = 205 205 async_data_read_start(exch, name_place, name_size); 206 206 if (ret != EOK) { … … 225 225 * @return Error code. 226 226 */ 227 int audio_pcm_query_cap(audio_pcm_sess_t *sess, audio_cap_t cap, sysarg_t *value)228 { 229 async_exch_t *exch = async_exchange_begin(sess); 230 const int ret = async_req_2_1(exch,227 errno_t audio_pcm_query_cap(audio_pcm_sess_t *sess, audio_cap_t cap, sysarg_t *value) 228 { 229 async_exch_t *exch = async_exchange_begin(sess); 230 const errno_t ret = async_req_2_1(exch, 231 231 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), IPC_M_AUDIO_PCM_QUERY_CAPS, 232 232 cap, value); … … 245 245 * Works for both playback and capture. 246 246 */ 247 int audio_pcm_get_buffer_pos(audio_pcm_sess_t *sess, size_t *pos)247 errno_t audio_pcm_get_buffer_pos(audio_pcm_sess_t *sess, size_t *pos) 248 248 { 249 249 if (!pos) … … 251 251 async_exch_t *exch = async_exchange_begin(sess); 252 252 sysarg_t value = 0; 253 const int ret = async_req_1_1(exch,253 const errno_t ret = async_req_1_1(exch, 254 254 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), 255 255 IPC_M_AUDIO_PCM_GET_BUFFER_POS, &value); … … 273 273 * parameters to the nearest values supported by the device. 274 274 */ 275 int audio_pcm_test_format(audio_pcm_sess_t *sess, unsigned *channels,275 errno_t audio_pcm_test_format(audio_pcm_sess_t *sess, unsigned *channels, 276 276 unsigned *rate, pcm_sample_format_t *format) 277 277 { … … 280 280 sysarg_t rate_arg = rate ? *rate : 0; 281 281 sysarg_t format_arg = format ? *format : 0; 282 const int ret = async_req_4_3(exch,282 const errno_t ret = async_req_4_3(exch, 283 283 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), 284 284 IPC_M_AUDIO_PCM_TEST_FORMAT, channels_arg, rate_arg, format_arg, … … 311 311 * @return Error code. 312 312 */ 313 int audio_pcm_register_event_callback(audio_pcm_sess_t *sess,313 errno_t audio_pcm_register_event_callback(audio_pcm_sess_t *sess, 314 314 async_port_handler_t event_callback, void *arg) 315 315 { … … 319 319 async_exch_t *exch = async_exchange_begin(sess); 320 320 321 int ret = async_req_1_0(exch, DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),321 errno_t ret = async_req_1_0(exch, DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), 322 322 IPC_M_AUDIO_PCM_REGISTER_EVENTS); 323 323 if (ret == EOK) { … … 338 338 * @return Error code. 339 339 */ 340 int audio_pcm_unregister_event_callback(audio_pcm_sess_t *sess)341 { 342 async_exch_t *exch = async_exchange_begin(sess); 343 const int ret = async_req_1_0(exch,340 errno_t audio_pcm_unregister_event_callback(audio_pcm_sess_t *sess) 341 { 342 async_exch_t *exch = async_exchange_begin(sess); 343 const errno_t ret = async_req_1_0(exch, 344 344 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), 345 345 IPC_M_AUDIO_PCM_UNREGISTER_EVENTS); … … 357 357 * @return Error code. 358 358 */ 359 int audio_pcm_get_buffer(audio_pcm_sess_t *sess, void **buffer, size_t *size)359 errno_t audio_pcm_get_buffer(audio_pcm_sess_t *sess, void **buffer, size_t *size) 360 360 { 361 361 if (!buffer || !size) … … 365 365 366 366 sysarg_t buffer_size = *size; 367 int ret = async_req_2_1(exch, DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),367 errno_t ret = async_req_2_1(exch, DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), 368 368 IPC_M_AUDIO_PCM_GET_BUFFER, (sysarg_t)buffer_size, &buffer_size); 369 369 if (ret == EOK) { … … 388 388 * @return Error code. 389 389 */ 390 int audio_pcm_release_buffer(audio_pcm_sess_t *sess)391 { 392 async_exch_t *exch = async_exchange_begin(sess); 393 const int ret = async_req_1_0(exch,390 errno_t audio_pcm_release_buffer(audio_pcm_sess_t *sess) 391 { 392 async_exch_t *exch = async_exchange_begin(sess); 393 const errno_t ret = async_req_1_0(exch, 394 394 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), 395 395 IPC_M_AUDIO_PCM_RELEASE_BUFFER); … … 412 412 * 0 to turn off event generation. 413 413 */ 414 int audio_pcm_start_playback_fragment(audio_pcm_sess_t *sess, unsigned frames,414 errno_t audio_pcm_start_playback_fragment(audio_pcm_sess_t *sess, unsigned frames, 415 415 unsigned channels, unsigned sample_rate, pcm_sample_format_t format) 416 416 { … … 420 420 const sysarg_t packed = (channels << 16) | (format & UINT16_MAX); 421 421 async_exch_t *exch = async_exchange_begin(sess); 422 const int ret = async_req_4_0(exch,422 const errno_t ret = async_req_4_0(exch, 423 423 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), 424 424 IPC_M_AUDIO_PCM_START_PLAYBACK, … … 434 434 * @return Error code. 435 435 */ 436 int audio_pcm_last_playback_fragment(audio_pcm_sess_t *sess)437 { 438 async_exch_t *exch = async_exchange_begin(sess); 439 const int ret = async_req_2_0(exch,436 errno_t audio_pcm_last_playback_fragment(audio_pcm_sess_t *sess) 437 { 438 async_exch_t *exch = async_exchange_begin(sess); 439 const errno_t ret = async_req_2_0(exch, 440 440 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), 441 441 IPC_M_AUDIO_PCM_STOP_PLAYBACK, false); … … 454 454 * @return Error code. 455 455 */ 456 int audio_pcm_start_playback(audio_pcm_sess_t *sess,456 errno_t audio_pcm_start_playback(audio_pcm_sess_t *sess, 457 457 unsigned channels, unsigned sample_rate, pcm_sample_format_t format) 458 458 { … … 468 468 * @return Error code. 469 469 */ 470 int audio_pcm_stop_playback_immediate(audio_pcm_sess_t *sess)471 { 472 async_exch_t *exch = async_exchange_begin(sess); 473 const int ret = async_req_2_0(exch,470 errno_t audio_pcm_stop_playback_immediate(audio_pcm_sess_t *sess) 471 { 472 async_exch_t *exch = async_exchange_begin(sess); 473 const errno_t ret = async_req_2_0(exch, 474 474 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), 475 475 IPC_M_AUDIO_PCM_STOP_PLAYBACK, true); … … 485 485 * @return Error code. 486 486 */ 487 int audio_pcm_stop_playback(audio_pcm_sess_t *sess)488 { 489 async_exch_t *exch = async_exchange_begin(sess); 490 const int ret = async_req_2_0(exch,487 errno_t audio_pcm_stop_playback(audio_pcm_sess_t *sess) 488 { 489 async_exch_t *exch = async_exchange_begin(sess); 490 const errno_t ret = async_req_2_0(exch, 491 491 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), 492 492 IPC_M_AUDIO_PCM_STOP_PLAYBACK, false); … … 509 509 * 0 to turn off event generation. 510 510 */ 511 int audio_pcm_start_capture_fragment(audio_pcm_sess_t *sess, unsigned frames,511 errno_t audio_pcm_start_capture_fragment(audio_pcm_sess_t *sess, unsigned frames, 512 512 unsigned channels, unsigned sample_rate, pcm_sample_format_t format) 513 513 { … … 517 517 const sysarg_t packed = (channels << 16) | (format & UINT16_MAX); 518 518 async_exch_t *exch = async_exchange_begin(sess); 519 const int ret = async_req_4_0(exch,519 const errno_t ret = async_req_4_0(exch, 520 520 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), IPC_M_AUDIO_PCM_START_CAPTURE, 521 521 frames, sample_rate, packed); … … 534 534 * @return Error code. 535 535 */ 536 int audio_pcm_start_capture(audio_pcm_sess_t *sess,536 errno_t audio_pcm_start_capture(audio_pcm_sess_t *sess, 537 537 unsigned channels, unsigned sample_rate, pcm_sample_format_t format) 538 538 { … … 549 549 * @return Error code. 550 550 */ 551 int audio_pcm_last_capture_fragment(audio_pcm_sess_t *sess)552 { 553 async_exch_t *exch = async_exchange_begin(sess); 554 const int ret = async_req_2_0(exch,551 errno_t audio_pcm_last_capture_fragment(audio_pcm_sess_t *sess) 552 { 553 async_exch_t *exch = async_exchange_begin(sess); 554 const errno_t ret = async_req_2_0(exch, 555 555 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), 556 556 IPC_M_AUDIO_PCM_STOP_CAPTURE, false); … … 566 566 * @return Error code. 567 567 */ 568 int audio_pcm_stop_capture_immediate(audio_pcm_sess_t *sess)569 { 570 async_exch_t *exch = async_exchange_begin(sess); 571 const int ret = async_req_2_0(exch,568 errno_t audio_pcm_stop_capture_immediate(audio_pcm_sess_t *sess) 569 { 570 async_exch_t *exch = async_exchange_begin(sess); 571 const errno_t ret = async_req_2_0(exch, 572 572 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), 573 573 IPC_M_AUDIO_PCM_STOP_CAPTURE, true); … … 583 583 * @return Error code. 584 584 */ 585 int audio_pcm_stop_capture(audio_pcm_sess_t *sess)586 { 587 async_exch_t *exch = async_exchange_begin(sess); 588 const int ret = async_req_2_0(exch,585 errno_t audio_pcm_stop_capture(audio_pcm_sess_t *sess) 586 { 587 async_exch_t *exch = async_exchange_begin(sess); 588 const errno_t ret = async_req_2_0(exch, 589 589 DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), 590 590 IPC_M_AUDIO_PCM_STOP_CAPTURE, false); … … 641 641 } 642 642 const char *name = NULL; 643 const int ret = pcm_iface->get_info_str(fun, &name);643 const errno_t ret = pcm_iface->get_info_str(fun, &name); 644 644 const size_t name_size = name ? str_size(name) + 1 : 0; 645 645 async_answer_1(callid, ret, name_size); … … 692 692 return; 693 693 } 694 const int ret = pcm_iface->set_event_session(fun, sess);694 const errno_t ret = pcm_iface->set_event_session(fun, sess); 695 695 if (ret != EOK) { 696 696 ddf_msg(LVL_DEBUG, "Failed to set event callback."); … … 722 722 const audio_pcm_iface_t *pcm_iface = iface; 723 723 size_t pos = 0; 724 const int ret = pcm_iface->get_buffer_pos ?724 const errno_t ret = pcm_iface->get_buffer_pos ? 725 725 pcm_iface->get_buffer_pos(fun, &pos) : ENOTSUP; 726 726 async_answer_1(callid, ret, pos); … … 733 733 unsigned rate = DEV_IPC_GET_ARG2(*call); 734 734 pcm_sample_format_t format = DEV_IPC_GET_ARG3(*call); 735 const int ret = pcm_iface->test_format ?735 const errno_t ret = pcm_iface->test_format ? 736 736 pcm_iface->test_format(fun, &channels, &rate, &format) : ENOTSUP; 737 737 async_answer_3(callid, ret, channels, rate, format); … … 750 750 void *buffer = NULL; 751 751 size_t size = DEV_IPC_GET_ARG1(*call); 752 int ret = pcm_iface->get_buffer(fun, &buffer, &size);752 errno_t ret = pcm_iface->get_buffer(fun, &buffer, &size); 753 753 async_answer_1(callid, ret, size); 754 754 if (ret != EOK || size == 0) … … 792 792 const audio_pcm_iface_t *pcm_iface = iface; 793 793 794 const int ret = pcm_iface->release_buffer ?794 const errno_t ret = pcm_iface->release_buffer ? 795 795 pcm_iface->release_buffer(fun) : ENOTSUP; 796 796 async_answer_0(callid, ret); … … 807 807 const pcm_sample_format_t format = DEV_IPC_GET_ARG3(*call) & UINT16_MAX; 808 808 809 const int ret = pcm_iface->start_playback809 const errno_t ret = pcm_iface->start_playback 810 810 ? pcm_iface->start_playback(fun, frames, channels, rate, format) 811 811 : ENOTSUP; … … 819 819 const bool immediate = DEV_IPC_GET_ARG1(*call); 820 820 821 const int ret = pcm_iface->stop_playback ?821 const errno_t ret = pcm_iface->stop_playback ? 822 822 pcm_iface->stop_playback(fun, immediate) : ENOTSUP; 823 823 async_answer_0(callid, ret); … … 834 834 const pcm_sample_format_t format = DEV_IPC_GET_ARG3(*call) & UINT16_MAX; 835 835 836 const int ret = pcm_iface->start_capture836 const errno_t ret = pcm_iface->start_capture 837 837 ? pcm_iface->start_capture(fun, frames, channels, rate, format) 838 838 : ENOTSUP; … … 846 846 const bool immediate = DEV_IPC_GET_ARG1(*call); 847 847 848 const int ret = pcm_iface->stop_capture ?848 const errno_t ret = pcm_iface->stop_capture ? 849 849 pcm_iface->stop_capture(fun, immediate) : ENOTSUP; 850 850 async_answer_0(callid, ret); -
uspace/lib/drv/generic/remote_battery_dev.c
r36f0738 rb7fd2a0 47 47 * @return EOK on success or an error code 48 48 */ 49 int49 errno_t 50 50 battery_status_get(async_sess_t *sess, battery_status_t *batt_status) 51 51 { … … 54 54 async_exch_t *exch = async_exchange_begin(sess); 55 55 56 int const rc = async_req_1_1(exch, DEV_IFACE_ID(BATTERY_DEV_IFACE),56 errno_t const rc = async_req_1_1(exch, DEV_IFACE_ID(BATTERY_DEV_IFACE), 57 57 BATTERY_STATUS_GET, &status); 58 58 … … 72 72 * @return EOK on success or an error code 73 73 */ 74 int74 errno_t 75 75 battery_charge_level_get(async_sess_t *sess, int *level) 76 76 { … … 79 79 async_exch_t *exch = async_exchange_begin(sess); 80 80 81 int const rc = async_req_1_1(exch, DEV_IFACE_ID(BATTERY_DEV_IFACE),81 errno_t const rc = async_req_1_1(exch, DEV_IFACE_ID(BATTERY_DEV_IFACE), 82 82 BATTERY_CHARGE_LEVEL_GET, &charge_level); 83 83 … … 129 129 130 130 battery_status_t batt_status; 131 const int rc = bops->battery_status_get(fun, &batt_status);131 const errno_t rc = bops->battery_status_get(fun, &batt_status); 132 132 133 133 if (rc != EOK) … … 155 155 156 156 int battery_level; 157 const int rc = bops->battery_charge_level_get(fun, &battery_level);157 const errno_t rc = bops->battery_charge_level_get(fun, &battery_level); 158 158 159 159 if (rc != EOK) -
uspace/lib/drv/generic/remote_clock_dev.c
r36f0738 rb7fd2a0 75 75 ipc_callid_t cid; 76 76 struct tm t; 77 int rc;77 errno_t rc; 78 78 size_t len; 79 79 … … 114 114 { 115 115 clock_dev_ops_t *clock_dev_ops = (clock_dev_ops_t *) ops; 116 intrc;116 errno_t rc; 117 117 struct tm t; 118 118 ipc_callid_t cid; -
uspace/lib/drv/generic/remote_hw_res.c
r36f0738 rb7fd2a0 79 79 80 80 const int irq = DEV_IPC_GET_ARG1(*call); 81 const int ret = hw_res_ops->enable_interrupt(fun, irq);81 const errno_t ret = hw_res_ops->enable_interrupt(fun, irq); 82 82 async_answer_0(callid, ret); 83 83 } … … 94 94 95 95 const int irq = DEV_IPC_GET_ARG1(*call); 96 const int ret = hw_res_ops->disable_interrupt(fun, irq);96 const errno_t ret = hw_res_ops->disable_interrupt(fun, irq); 97 97 async_answer_0(callid, ret); 98 98 } … … 109 109 110 110 const int irq = DEV_IPC_GET_ARG1(*call); 111 const int ret = hw_res_ops->enable_interrupt(fun, irq);111 const errno_t ret = hw_res_ops->enable_interrupt(fun, irq); 112 112 async_answer_0(callid, ret); 113 113 } … … 153 153 const uint32_t size = DEV_IPC_GET_ARG3(*call); 154 154 155 const int ret = hw_res_ops->dma_channel_setup(155 const errno_t ret = hw_res_ops->dma_channel_setup( 156 156 fun, channel, address, size, mode); 157 157 async_answer_0(callid, ret); … … 169 169 const unsigned channel = DEV_IPC_GET_ARG1(*call); 170 170 size_t remain = 0; 171 const int ret = hw_res_ops->dma_channel_remain(fun, channel, &remain);171 const errno_t ret = hw_res_ops->dma_channel_remain(fun, channel, &remain); 172 172 async_answer_1(callid, ret, remain); 173 173 } -
uspace/lib/drv/generic/remote_ieee80211.c
r36f0738 rb7fd2a0 62 62 * 63 63 */ 64 int ieee80211_get_scan_results(async_sess_t *dev_sess,64 errno_t ieee80211_get_scan_results(async_sess_t *dev_sess, 65 65 ieee80211_scan_results_t *results, bool now) 66 66 { … … 71 71 aid_t aid = async_send_2(exch, DEV_IFACE_ID(IEEE80211_DEV_IFACE), 72 72 IEEE80211_GET_SCAN_RESULTS, now, NULL); 73 int rc = async_data_read_start(exch, results,73 errno_t rc = async_data_read_start(exch, results, 74 74 sizeof(ieee80211_scan_results_t)); 75 75 async_exchange_end(exch); 76 76 77 int res;77 errno_t res; 78 78 async_wait_for(aid, &res); 79 79 80 80 if(res != EOK) 81 return ( int) res;81 return (errno_t) res; 82 82 83 83 return rc; … … 100 100 size_t count; 101 101 102 int rc = inetcfg_get_link_list(&link_list, &count);102 errno_t rc = inetcfg_get_link_list(&link_list, &count); 103 103 if (rc != EOK) 104 104 return -1; … … 126 126 * 127 127 */ 128 int ieee80211_connect(async_sess_t *dev_sess, char *ssid_start, char *password)128 errno_t ieee80211_connect(async_sess_t *dev_sess, char *ssid_start, char *password) 129 129 { 130 130 assert(ssid_start); 131 131 132 int rc_orig;132 errno_t rc_orig; 133 133 134 134 async_exch_t *exch = async_exchange_begin(dev_sess); … … 137 137 IEEE80211_CONNECT, NULL); 138 138 139 int rc = async_data_write_start(exch, ssid_start,139 errno_t rc = async_data_write_start(exch, ssid_start, 140 140 str_size(ssid_start) + 1); 141 141 if (rc != EOK) { … … 144 144 145 145 if (rc_orig == EOK) 146 return ( int) rc;147 148 return ( int) rc_orig;146 return (errno_t) rc; 147 148 return (errno_t) rc_orig; 149 149 } 150 150 … … 159 159 160 160 if (rc_orig == EOK) 161 return ( int) rc;162 163 return ( int) rc_orig;161 return (errno_t) rc; 162 163 return (errno_t) rc_orig; 164 164 } 165 165 … … 182 182 rc = dhcp_discover(link_id); 183 183 184 return ( int) rc;184 return (errno_t) rc; 185 185 } 186 186 … … 193 193 * 194 194 */ 195 int ieee80211_disconnect(async_sess_t *dev_sess)195 errno_t ieee80211_disconnect(async_sess_t *dev_sess) 196 196 { 197 197 async_exch_t *exch = async_exchange_begin(dev_sess); 198 int rc = async_req_1_0(exch, DEV_IFACE_ID(IEEE80211_DEV_IFACE),198 errno_t rc = async_req_1_0(exch, DEV_IFACE_ID(IEEE80211_DEV_IFACE), 199 199 IEEE80211_DISCONNECT); 200 200 async_exchange_end(exch); … … 278 278 bool now = IPC_GET_ARG2(*call); 279 279 280 int rc = ieee80211_iface->get_scan_results(fun, &scan_results, now);280 errno_t rc = ieee80211_iface->get_scan_results(fun, &scan_results, now); 281 281 if (rc == EOK) { 282 282 ipc_callid_t data_callid; … … 324 324 } 325 325 326 int rc = async_data_write_finalize(data_callid, ssid_start, len);326 errno_t rc = async_data_write_finalize(data_callid, ssid_start, len); 327 327 if (rc != EOK) { 328 328 async_answer_0(data_callid, EINVAL); … … 360 360 ieee80211_iface_t *ieee80211_iface = (ieee80211_iface_t *) iface; 361 361 assert(ieee80211_iface->disconnect); 362 int rc = ieee80211_iface->disconnect(fun);362 errno_t rc = ieee80211_iface->disconnect(fun); 363 363 async_answer_0(callid, rc); 364 364 } -
uspace/lib/drv/generic/remote_led_dev.c
r36f0738 rb7fd2a0 77 77 } 78 78 79 int rc = (*led_dev_ops->color_set)(fun, color);79 errno_t rc = (*led_dev_ops->color_set)(fun, color); 80 80 async_answer_0(callid, rc); 81 81 } -
uspace/lib/drv/generic/remote_nic.c
r36f0738 rb7fd2a0 98 98 * 99 99 */ 100 int nic_send_frame(async_sess_t *dev_sess, void *data, size_t size)100 errno_t nic_send_frame(async_sess_t *dev_sess, void *data, size_t size) 101 101 { 102 102 async_exch_t *exch = async_exchange_begin(dev_sess); … … 105 105 aid_t req = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 106 106 NIC_SEND_MESSAGE, &answer); 107 int retval = async_data_write_start(exch, data, size);107 errno_t retval = async_data_write_start(exch, data, size); 108 108 109 109 async_exchange_end(exch); … … 126 126 * 127 127 */ 128 int nic_callback_create(async_sess_t *dev_sess, async_port_handler_t cfun,128 errno_t nic_callback_create(async_sess_t *dev_sess, async_port_handler_t cfun, 129 129 void *carg) 130 130 { 131 131 ipc_call_t answer; 132 int rc;133 int retval;132 errno_t rc; 133 errno_t retval; 134 134 135 135 async_exch_t *exch = async_exchange_begin(dev_sess); … … 158 158 * 159 159 */ 160 int nic_get_state(async_sess_t *dev_sess, nic_device_state_t *state)160 errno_t nic_get_state(async_sess_t *dev_sess, nic_device_state_t *state) 161 161 { 162 162 assert(state); … … 165 165 166 166 async_exch_t *exch = async_exchange_begin(dev_sess); 167 int rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),167 errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 168 168 NIC_GET_STATE, &_state); 169 169 async_exchange_end(exch); … … 182 182 * 183 183 */ 184 int nic_set_state(async_sess_t *dev_sess, nic_device_state_t state)185 { 186 async_exch_t *exch = async_exchange_begin(dev_sess); 187 int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),184 errno_t nic_set_state(async_sess_t *dev_sess, nic_device_state_t state) 185 { 186 async_exch_t *exch = async_exchange_begin(dev_sess); 187 errno_t rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 188 188 NIC_SET_STATE, state); 189 189 async_exchange_end(exch); … … 200 200 * 201 201 */ 202 int nic_get_address(async_sess_t *dev_sess, nic_address_t *address)202 errno_t nic_get_address(async_sess_t *dev_sess, nic_address_t *address) 203 203 { 204 204 assert(address); … … 207 207 aid_t aid = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 208 208 NIC_GET_ADDRESS, NULL); 209 int rc = async_data_read_start(exch, address, sizeof(nic_address_t));210 async_exchange_end(exch); 211 212 int res;209 errno_t rc = async_data_read_start(exch, address, sizeof(nic_address_t)); 210 async_exchange_end(exch); 211 212 errno_t res; 213 213 async_wait_for(aid, &res); 214 214 … … 227 227 * 228 228 */ 229 int nic_set_address(async_sess_t *dev_sess, const nic_address_t *address)229 errno_t nic_set_address(async_sess_t *dev_sess, const nic_address_t *address) 230 230 { 231 231 assert(address); … … 234 234 aid_t aid = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 235 235 NIC_SET_ADDRESS, NULL); 236 int rc = async_data_write_start(exch, address, sizeof(nic_address_t));237 async_exchange_end(exch); 238 239 int res;236 errno_t rc = async_data_write_start(exch, address, sizeof(nic_address_t)); 237 async_exchange_end(exch); 238 239 errno_t res; 240 240 async_wait_for(aid, &res); 241 241 … … 254 254 * 255 255 */ 256 int nic_get_stats(async_sess_t *dev_sess, nic_device_stats_t *stats)256 errno_t nic_get_stats(async_sess_t *dev_sess, nic_device_stats_t *stats) 257 257 { 258 258 assert(stats); … … 260 260 async_exch_t *exch = async_exchange_begin(dev_sess); 261 261 262 int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),262 errno_t rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 263 263 NIC_GET_STATS); 264 264 if (rc != EOK) { … … 284 284 * 285 285 */ 286 int nic_get_device_info(async_sess_t *dev_sess, nic_device_info_t *device_info)286 errno_t nic_get_device_info(async_sess_t *dev_sess, nic_device_info_t *device_info) 287 287 { 288 288 assert(device_info); … … 292 292 aid_t aid = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 293 293 NIC_GET_DEVICE_INFO, NULL); 294 int rc = async_data_read_start(exch, device_info, sizeof(nic_device_info_t));295 async_exchange_end(exch); 296 297 int res;294 errno_t rc = async_data_read_start(exch, device_info, sizeof(nic_device_info_t)); 295 async_exchange_end(exch); 296 297 errno_t res; 298 298 async_wait_for(aid, &res); 299 299 … … 312 312 * 313 313 */ 314 int nic_get_cable_state(async_sess_t *dev_sess, nic_cable_state_t *cable_state)314 errno_t nic_get_cable_state(async_sess_t *dev_sess, nic_cable_state_t *cable_state) 315 315 { 316 316 assert(cable_state); … … 319 319 320 320 async_exch_t *exch = async_exchange_begin(dev_sess); 321 int rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),321 errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 322 322 NIC_GET_CABLE_STATE, &_cable_state); 323 323 async_exchange_end(exch); … … 338 338 * 339 339 */ 340 int nic_get_operation_mode(async_sess_t *dev_sess, int *speed,340 errno_t nic_get_operation_mode(async_sess_t *dev_sess, int *speed, 341 341 nic_channel_mode_t *duplex, nic_role_t *role) 342 342 { … … 346 346 347 347 async_exch_t *exch = async_exchange_begin(dev_sess); 348 int rc = async_req_1_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),348 errno_t rc = async_req_1_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 349 349 NIC_GET_OPERATION_MODE, &_speed, &_duplex, &_role); 350 350 async_exchange_end(exch); … … 375 375 * 376 376 */ 377 int nic_set_operation_mode(async_sess_t *dev_sess, int speed,377 errno_t nic_set_operation_mode(async_sess_t *dev_sess, int speed, 378 378 nic_channel_mode_t duplex, nic_role_t role) 379 379 { 380 380 async_exch_t *exch = async_exchange_begin(dev_sess); 381 int rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),381 errno_t rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 382 382 NIC_SET_OPERATION_MODE, (sysarg_t) speed, (sysarg_t) duplex, 383 383 (sysarg_t) role); … … 400 400 * 401 401 */ 402 int nic_autoneg_enable(async_sess_t *dev_sess, uint32_t advertisement)403 { 404 async_exch_t *exch = async_exchange_begin(dev_sess); 405 int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),402 errno_t nic_autoneg_enable(async_sess_t *dev_sess, uint32_t advertisement) 403 { 404 async_exch_t *exch = async_exchange_begin(dev_sess); 405 errno_t rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 406 406 NIC_AUTONEG_ENABLE, (sysarg_t) advertisement); 407 407 async_exchange_end(exch); … … 417 417 * 418 418 */ 419 int nic_autoneg_disable(async_sess_t *dev_sess)420 { 421 async_exch_t *exch = async_exchange_begin(dev_sess); 422 int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),419 errno_t nic_autoneg_disable(async_sess_t *dev_sess) 420 { 421 async_exch_t *exch = async_exchange_begin(dev_sess); 422 errno_t rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 423 423 NIC_AUTONEG_DISABLE); 424 424 async_exchange_end(exch); … … 444 444 * 445 445 */ 446 int nic_autoneg_probe(async_sess_t *dev_sess, uint32_t *our_advertisement,446 errno_t nic_autoneg_probe(async_sess_t *dev_sess, uint32_t *our_advertisement, 447 447 uint32_t *their_advertisement, nic_result_t *result, 448 448 nic_result_t *their_result) … … 454 454 455 455 async_exch_t *exch = async_exchange_begin(dev_sess); 456 int rc = async_req_1_4(exch, DEV_IFACE_ID(NIC_DEV_IFACE),456 errno_t rc = async_req_1_4(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 457 457 NIC_AUTONEG_PROBE, &_our_advertisement, &_their_advertisement, 458 458 &_result, &_their_result); … … 481 481 * 482 482 */ 483 int nic_autoneg_restart(async_sess_t *dev_sess)484 { 485 async_exch_t *exch = async_exchange_begin(dev_sess); 486 int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),483 errno_t nic_autoneg_restart(async_sess_t *dev_sess) 484 { 485 async_exch_t *exch = async_exchange_begin(dev_sess); 486 errno_t rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 487 487 NIC_AUTONEG_RESTART); 488 488 async_exchange_end(exch); … … 501 501 * 502 502 */ 503 int nic_get_pause(async_sess_t *dev_sess, nic_result_t *we_send,503 errno_t nic_get_pause(async_sess_t *dev_sess, nic_result_t *we_send, 504 504 nic_result_t *we_receive, uint16_t *pause) 505 505 { … … 509 509 510 510 async_exch_t *exch = async_exchange_begin(dev_sess); 511 int rc = async_req_1_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),511 errno_t rc = async_req_1_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 512 512 NIC_GET_PAUSE, &_we_send, &_we_receive, &_pause); 513 513 async_exchange_end(exch); … … 539 539 * 540 540 */ 541 int nic_set_pause(async_sess_t *dev_sess, int allow_send, int allow_receive,541 errno_t nic_set_pause(async_sess_t *dev_sess, int allow_send, int allow_receive, 542 542 uint16_t pause) 543 543 { 544 544 async_exch_t *exch = async_exchange_begin(dev_sess); 545 int rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),545 errno_t rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 546 546 NIC_SET_PAUSE, allow_send, allow_receive, pause); 547 547 async_exchange_end(exch); … … 566 566 * 567 567 */ 568 int nic_unicast_get_mode(async_sess_t *dev_sess, nic_unicast_mode_t *mode,568 errno_t nic_unicast_get_mode(async_sess_t *dev_sess, nic_unicast_mode_t *mode, 569 569 size_t max_count, nic_address_t *address_list, size_t *address_count) 570 570 { … … 579 579 async_exch_t *exch = async_exchange_begin(dev_sess); 580 580 581 int rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),581 errno_t rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 582 582 NIC_UNICAST_GET_MODE, max_count, &_mode, &_address_count); 583 583 if (rc != EOK) { … … 609 609 * 610 610 */ 611 int nic_unicast_set_mode(async_sess_t *dev_sess, nic_unicast_mode_t mode,611 errno_t nic_unicast_set_mode(async_sess_t *dev_sess, nic_unicast_mode_t mode, 612 612 const nic_address_t *address_list, size_t address_count) 613 613 { … … 620 620 NIC_UNICAST_SET_MODE, (sysarg_t) mode, address_count, NULL); 621 621 622 int rc;622 errno_t rc; 623 623 if (address_count) 624 624 rc = async_data_write_start(exch, address_list, … … 629 629 async_exchange_end(exch); 630 630 631 int res;631 errno_t res; 632 632 async_wait_for(message_id, &res); 633 633 … … 655 655 * 656 656 */ 657 int nic_multicast_get_mode(async_sess_t *dev_sess, nic_multicast_mode_t *mode,657 errno_t nic_multicast_get_mode(async_sess_t *dev_sess, nic_multicast_mode_t *mode, 658 658 size_t max_count, nic_address_t *address_list, size_t *address_count) 659 659 { … … 668 668 669 669 sysarg_t ac; 670 int rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),670 errno_t rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 671 671 NIC_MULTICAST_GET_MODE, max_count, &_mode, &ac); 672 672 if (rc != EOK) { … … 697 697 * 698 698 */ 699 int nic_multicast_set_mode(async_sess_t *dev_sess, nic_multicast_mode_t mode,699 errno_t nic_multicast_set_mode(async_sess_t *dev_sess, nic_multicast_mode_t mode, 700 700 const nic_address_t *address_list, size_t address_count) 701 701 { … … 708 708 NIC_MULTICAST_SET_MODE, (sysarg_t) mode, address_count, NULL); 709 709 710 int rc;710 errno_t rc; 711 711 if (address_count) 712 712 rc = async_data_write_start(exch, address_list, … … 717 717 async_exchange_end(exch); 718 718 719 int res;719 errno_t res; 720 720 async_wait_for(message_id, &res); 721 721 … … 734 734 * 735 735 */ 736 int nic_broadcast_get_mode(async_sess_t *dev_sess, nic_broadcast_mode_t *mode)736 errno_t nic_broadcast_get_mode(async_sess_t *dev_sess, nic_broadcast_mode_t *mode) 737 737 { 738 738 assert(mode); … … 741 741 742 742 async_exch_t *exch = async_exchange_begin(dev_sess); 743 int rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),743 errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 744 744 NIC_BROADCAST_GET_MODE, &_mode); 745 745 async_exchange_end(exch); … … 758 758 * 759 759 */ 760 int nic_broadcast_set_mode(async_sess_t *dev_sess, nic_broadcast_mode_t mode)761 { 762 async_exch_t *exch = async_exchange_begin(dev_sess); 763 int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),760 errno_t nic_broadcast_set_mode(async_sess_t *dev_sess, nic_broadcast_mode_t mode) 761 { 762 async_exch_t *exch = async_exchange_begin(dev_sess); 763 errno_t rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 764 764 NIC_BROADCAST_SET_MODE, mode); 765 765 async_exchange_end(exch); … … 776 776 * 777 777 */ 778 int nic_defective_get_mode(async_sess_t *dev_sess, uint32_t *mode)778 errno_t nic_defective_get_mode(async_sess_t *dev_sess, uint32_t *mode) 779 779 { 780 780 assert(mode); … … 783 783 784 784 async_exch_t *exch = async_exchange_begin(dev_sess); 785 int rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),785 errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 786 786 NIC_DEFECTIVE_GET_MODE, &_mode); 787 787 async_exchange_end(exch); … … 800 800 * 801 801 */ 802 int nic_defective_set_mode(async_sess_t *dev_sess, uint32_t mode)803 { 804 async_exch_t *exch = async_exchange_begin(dev_sess); 805 int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),802 errno_t nic_defective_set_mode(async_sess_t *dev_sess, uint32_t mode) 803 { 804 async_exch_t *exch = async_exchange_begin(dev_sess); 805 errno_t rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 806 806 NIC_DEFECTIVE_SET_MODE, mode); 807 807 async_exchange_end(exch); … … 822 822 * 823 823 */ 824 int nic_blocked_sources_get(async_sess_t *dev_sess, size_t max_count,824 errno_t nic_blocked_sources_get(async_sess_t *dev_sess, size_t max_count, 825 825 nic_address_t *address_list, size_t *address_count) 826 826 { … … 831 831 832 832 sysarg_t ac; 833 int rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),833 errno_t rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 834 834 NIC_BLOCKED_SOURCES_GET, max_count, &ac); 835 835 if (rc != EOK) { … … 858 858 * 859 859 */ 860 int nic_blocked_sources_set(async_sess_t *dev_sess,860 errno_t nic_blocked_sources_set(async_sess_t *dev_sess, 861 861 const nic_address_t *address_list, size_t address_count) 862 862 { … … 869 869 NIC_BLOCKED_SOURCES_SET, address_count, NULL); 870 870 871 int rc;871 errno_t rc; 872 872 if (address_count) 873 873 rc = async_data_write_start(exch, address_list, … … 878 878 async_exchange_end(exch); 879 879 880 int res;880 errno_t res; 881 881 async_wait_for(message_id, &res); 882 882 … … 895 895 * 896 896 */ 897 int nic_vlan_get_mask(async_sess_t *dev_sess, nic_vlan_mask_t *mask)897 errno_t nic_vlan_get_mask(async_sess_t *dev_sess, nic_vlan_mask_t *mask) 898 898 { 899 899 assert(mask); 900 900 901 901 async_exch_t *exch = async_exchange_begin(dev_sess); 902 int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),902 errno_t rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 903 903 NIC_VLAN_GET_MASK); 904 904 if (rc != EOK) { … … 923 923 * 924 924 */ 925 int nic_vlan_set_mask(async_sess_t *dev_sess, const nic_vlan_mask_t *mask)925 errno_t nic_vlan_set_mask(async_sess_t *dev_sess, const nic_vlan_mask_t *mask) 926 926 { 927 927 async_exch_t *exch = async_exchange_begin(dev_sess); … … 930 930 NIC_VLAN_SET_MASK, mask != NULL, NULL); 931 931 932 int rc;932 errno_t rc; 933 933 if (mask != NULL) 934 934 rc = async_data_write_start(exch, mask, sizeof(nic_vlan_mask_t)); … … 938 938 async_exchange_end(exch); 939 939 940 int res;940 errno_t res; 941 941 async_wait_for(message_id, &res); 942 942 … … 963 963 * 964 964 */ 965 int nic_vlan_set_tag(async_sess_t *dev_sess, uint16_t tag, bool add, bool strip)966 { 967 async_exch_t *exch = async_exchange_begin(dev_sess); 968 int rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),965 errno_t nic_vlan_set_tag(async_sess_t *dev_sess, uint16_t tag, bool add, bool strip) 966 { 967 async_exch_t *exch = async_exchange_begin(dev_sess); 968 errno_t rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 969 969 NIC_VLAN_SET_TAG, (sysarg_t) tag, (sysarg_t) add, (sysarg_t) strip); 970 970 async_exchange_end(exch); … … 985 985 * 986 986 */ 987 int nic_wol_virtue_add(async_sess_t *dev_sess, nic_wv_type_t type,987 errno_t nic_wol_virtue_add(async_sess_t *dev_sess, nic_wv_type_t type, 988 988 const void *data, size_t length, nic_wv_id_t *id) 989 989 { … … 997 997 NIC_WOL_VIRTUE_ADD, (sysarg_t) type, send_data, &result); 998 998 999 int res;999 errno_t res; 1000 1000 if (send_data) { 1001 int rc = async_data_write_start(exch, data, length);1001 errno_t rc = async_data_write_start(exch, data, length); 1002 1002 if (rc != EOK) { 1003 1003 async_exchange_end(exch); … … 1022 1022 * 1023 1023 */ 1024 int nic_wol_virtue_remove(async_sess_t *dev_sess, nic_wv_id_t id)1025 { 1026 async_exch_t *exch = async_exchange_begin(dev_sess); 1027 int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),1024 errno_t nic_wol_virtue_remove(async_sess_t *dev_sess, nic_wv_id_t id) 1025 { 1026 async_exch_t *exch = async_exchange_begin(dev_sess); 1027 errno_t rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 1028 1028 NIC_WOL_VIRTUE_REMOVE, (sysarg_t) id); 1029 1029 async_exchange_end(exch); … … 1045 1045 * 1046 1046 */ 1047 int nic_wol_virtue_probe(async_sess_t *dev_sess, nic_wv_id_t id,1047 errno_t nic_wol_virtue_probe(async_sess_t *dev_sess, nic_wv_id_t id, 1048 1048 nic_wv_type_t *type, size_t max_length, void *data, size_t *length) 1049 1049 { … … 1056 1056 async_exch_t *exch = async_exchange_begin(dev_sess); 1057 1057 1058 int rc = async_req_3_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),1058 errno_t rc = async_req_3_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 1059 1059 NIC_WOL_VIRTUE_PROBE, (sysarg_t) id, max_length, 1060 1060 &_type, &_length); … … 1095 1095 * 1096 1096 */ 1097 int nic_wol_virtue_list(async_sess_t *dev_sess, nic_wv_type_t type,1097 errno_t nic_wol_virtue_list(async_sess_t *dev_sess, nic_wv_type_t type, 1098 1098 size_t max_count, nic_wv_id_t *id_list, size_t *id_count) 1099 1099 { … … 1104 1104 1105 1105 sysarg_t count; 1106 int rc = async_req_3_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),1106 errno_t rc = async_req_3_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 1107 1107 NIC_WOL_VIRTUE_LIST, (sysarg_t) type, max_count, &count); 1108 1108 … … 1135 1135 * 1136 1136 */ 1137 int nic_wol_virtue_get_caps(async_sess_t *dev_sess, nic_wv_type_t type,1137 errno_t nic_wol_virtue_get_caps(async_sess_t *dev_sess, nic_wv_type_t type, 1138 1138 int *count) 1139 1139 { … … 1143 1143 1144 1144 async_exch_t *exch = async_exchange_begin(dev_sess); 1145 int rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),1145 errno_t rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 1146 1146 NIC_WOL_VIRTUE_GET_CAPS, (sysarg_t) type, &_count); 1147 1147 async_exchange_end(exch); … … 1173 1173 * 1174 1174 */ 1175 int nic_wol_load_info(async_sess_t *dev_sess, nic_wv_type_t *matched_type,1175 errno_t nic_wol_load_info(async_sess_t *dev_sess, nic_wv_type_t *matched_type, 1176 1176 size_t max_length, uint8_t *frame, size_t *frame_length) 1177 1177 { … … 1186 1186 async_exch_t *exch = async_exchange_begin(dev_sess); 1187 1187 1188 int rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),1188 errno_t rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 1189 1189 NIC_WOL_LOAD_INFO, max_length, &_matched_type, &_frame_length); 1190 1190 if (rc != EOK) { … … 1213 1213 * 1214 1214 */ 1215 int nic_offload_probe(async_sess_t *dev_sess, uint32_t *supported,1215 errno_t nic_offload_probe(async_sess_t *dev_sess, uint32_t *supported, 1216 1216 uint32_t *active) 1217 1217 { … … 1223 1223 1224 1224 async_exch_t *exch = async_exchange_begin(dev_sess); 1225 int rc = async_req_1_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),1225 errno_t rc = async_req_1_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 1226 1226 NIC_OFFLOAD_PROBE, &_supported, &_active); 1227 1227 async_exchange_end(exch); … … 1241 1241 * 1242 1242 */ 1243 int nic_offload_set(async_sess_t *dev_sess, uint32_t mask, uint32_t active)1244 { 1245 async_exch_t *exch = async_exchange_begin(dev_sess); 1246 int rc = async_req_3_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),1243 errno_t nic_offload_set(async_sess_t *dev_sess, uint32_t mask, uint32_t active) 1244 { 1245 async_exch_t *exch = async_exchange_begin(dev_sess); 1246 errno_t rc = async_req_3_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 1247 1247 NIC_AUTONEG_RESTART, (sysarg_t) mask, (sysarg_t) active); 1248 1248 async_exchange_end(exch); … … 1261 1261 * 1262 1262 */ 1263 int nic_poll_get_mode(async_sess_t *dev_sess, nic_poll_mode_t *mode,1263 errno_t nic_poll_get_mode(async_sess_t *dev_sess, nic_poll_mode_t *mode, 1264 1264 struct timeval *period) 1265 1265 { … … 1270 1270 async_exch_t *exch = async_exchange_begin(dev_sess); 1271 1271 1272 int rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),1272 errno_t rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE), 1273 1273 NIC_POLL_GET_MODE, period != NULL, &_mode); 1274 1274 if (rc != EOK) { … … 1295 1295 * 1296 1296 */ 1297 int nic_poll_set_mode(async_sess_t *dev_sess, nic_poll_mode_t mode,1297 errno_t nic_poll_set_mode(async_sess_t *dev_sess, nic_poll_mode_t mode, 1298 1298 const struct timeval *period) 1299 1299 { … … 1303 1303 NIC_POLL_SET_MODE, (sysarg_t) mode, period != NULL, NULL); 1304 1304 1305 int rc;1305 errno_t rc; 1306 1306 if (period) 1307 1307 rc = async_data_write_start(exch, period, sizeof(struct timeval)); … … 1311 1311 async_exchange_end(exch); 1312 1312 1313 int res;1313 errno_t res; 1314 1314 async_wait_for(message_id, &res); 1315 1315 … … 1327 1327 * 1328 1328 */ 1329 int nic_poll_now(async_sess_t *dev_sess)1330 { 1331 async_exch_t *exch = async_exchange_begin(dev_sess); 1332 int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), NIC_POLL_NOW);1329 errno_t nic_poll_now(async_sess_t *dev_sess) 1330 { 1331 async_exch_t *exch = async_exchange_begin(dev_sess); 1332 errno_t rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), NIC_POLL_NOW); 1333 1333 async_exchange_end(exch); 1334 1334 … … 1344 1344 void *data; 1345 1345 size_t size; 1346 int rc;1346 errno_t rc; 1347 1347 1348 1348 rc = async_data_write_accept(&data, false, 0, 0, 0, &size); … … 1363 1363 assert(nic_iface->callback_create); 1364 1364 1365 int rc = nic_iface->callback_create(dev);1365 errno_t rc = nic_iface->callback_create(dev); 1366 1366 async_answer_0(callid, rc); 1367 1367 } … … 1375 1375 nic_device_state_t state = NIC_STATE_MAX; 1376 1376 1377 int rc = nic_iface->get_state(dev, &state);1377 errno_t rc = nic_iface->get_state(dev, &state); 1378 1378 async_answer_1(callid, rc, state); 1379 1379 } … … 1387 1387 nic_device_state_t state = (nic_device_state_t) IPC_GET_ARG2(*call); 1388 1388 1389 int rc = nic_iface->set_state(dev, state);1389 errno_t rc = nic_iface->set_state(dev, state); 1390 1390 async_answer_0(callid, rc); 1391 1391 } … … 1400 1400 memset(&address, 0, sizeof(nic_address_t)); 1401 1401 1402 int rc = nic_iface->get_address(dev, &address);1402 errno_t rc = nic_iface->get_address(dev, &address); 1403 1403 if (rc == EOK) { 1404 1404 size_t max_len; … … 1451 1451 1452 1452 if (nic_iface->set_address != NULL) { 1453 int rc = nic_iface->set_address(dev, &address);1453 errno_t rc = nic_iface->set_address(dev, &address); 1454 1454 async_answer_0(callid, rc); 1455 1455 } else … … 1469 1469 memset(&stats, 0, sizeof(nic_device_stats_t)); 1470 1470 1471 int rc = nic_iface->get_stats(dev, &stats);1471 errno_t rc = nic_iface->get_stats(dev, &stats); 1472 1472 if (rc == EOK) { 1473 1473 ipc_callid_t data_callid; … … 1504 1504 memset(&info, 0, sizeof(nic_device_info_t)); 1505 1505 1506 int rc = nic_iface->get_device_info(dev, &info);1506 errno_t rc = nic_iface->get_device_info(dev, &info); 1507 1507 if (rc == EOK) { 1508 1508 ipc_callid_t data_callid; … … 1538 1538 nic_cable_state_t cs = NIC_CS_UNKNOWN; 1539 1539 1540 int rc = nic_iface->get_cable_state(dev, &cs);1540 errno_t rc = nic_iface->get_cable_state(dev, &cs); 1541 1541 async_answer_1(callid, rc, (sysarg_t) cs); 1542 1542 } … … 1555 1555 nic_role_t role = NIC_ROLE_UNKNOWN; 1556 1556 1557 int rc = nic_iface->get_operation_mode(dev, &speed, &duplex, &role);1557 errno_t rc = nic_iface->get_operation_mode(dev, &speed, &duplex, &role); 1558 1558 async_answer_3(callid, rc, (sysarg_t) speed, (sysarg_t) duplex, 1559 1559 (sysarg_t) role); … … 1573 1573 nic_role_t role = (nic_role_t) IPC_GET_ARG4(*call); 1574 1574 1575 int rc = nic_iface->set_operation_mode(dev, speed, duplex, role);1575 errno_t rc = nic_iface->set_operation_mode(dev, speed, duplex, role); 1576 1576 async_answer_0(callid, rc); 1577 1577 } … … 1588 1588 uint32_t advertisement = (uint32_t) IPC_GET_ARG2(*call); 1589 1589 1590 int rc = nic_iface->autoneg_enable(dev, advertisement);1590 errno_t rc = nic_iface->autoneg_enable(dev, advertisement); 1591 1591 async_answer_0(callid, rc); 1592 1592 } … … 1601 1601 } 1602 1602 1603 int rc = nic_iface->autoneg_disable(dev);1603 errno_t rc = nic_iface->autoneg_disable(dev); 1604 1604 async_answer_0(callid, rc); 1605 1605 } … … 1619 1619 nic_result_t their_result = NIC_RESULT_NOT_AVAILABLE; 1620 1620 1621 int rc = nic_iface->autoneg_probe(dev, &our_adv, &their_adv, &result,1621 errno_t rc = nic_iface->autoneg_probe(dev, &our_adv, &their_adv, &result, 1622 1622 &their_result); 1623 1623 async_answer_4(callid, rc, our_adv, their_adv, (sysarg_t) result, … … 1634 1634 } 1635 1635 1636 int rc = nic_iface->autoneg_restart(dev);1636 errno_t rc = nic_iface->autoneg_restart(dev); 1637 1637 async_answer_0(callid, rc); 1638 1638 } … … 1651 1651 uint16_t pause; 1652 1652 1653 int rc = nic_iface->get_pause(dev, &we_send, &we_receive, &pause);1653 errno_t rc = nic_iface->get_pause(dev, &we_send, &we_receive, &pause); 1654 1654 async_answer_3(callid, rc, we_send, we_receive, pause); 1655 1655 } … … 1668 1668 uint16_t pause = (uint16_t) IPC_GET_ARG4(*call); 1669 1669 1670 int rc = nic_iface->set_pause(dev, allow_send, allow_receive,1670 errno_t rc = nic_iface->set_pause(dev, allow_send, allow_receive, 1671 1671 pause); 1672 1672 async_answer_0(callid, rc); … … 1697 1697 size_t address_count = 0; 1698 1698 1699 int rc = nic_iface->unicast_get_mode(dev, &mode, max_count, address_list,1699 errno_t rc = nic_iface->unicast_get_mode(dev, &mode, max_count, address_list, 1700 1700 &address_count); 1701 1701 … … 1768 1768 1769 1769 if (nic_iface->unicast_set_mode != NULL) { 1770 int rc = nic_iface->unicast_set_mode(dev, mode, address_list,1770 errno_t rc = nic_iface->unicast_set_mode(dev, mode, address_list, 1771 1771 address_count); 1772 1772 async_answer_0(callid, rc); … … 1801 1801 size_t address_count = 0; 1802 1802 1803 int rc = nic_iface->multicast_get_mode(dev, &mode, max_count, address_list,1803 errno_t rc = nic_iface->multicast_get_mode(dev, &mode, max_count, address_list, 1804 1804 &address_count); 1805 1805 … … 1872 1872 1873 1873 if (nic_iface->multicast_set_mode != NULL) { 1874 int rc = nic_iface->multicast_set_mode(dev, mode, address_list,1874 errno_t rc = nic_iface->multicast_set_mode(dev, mode, address_list, 1875 1875 address_count); 1876 1876 async_answer_0(callid, rc); … … 1892 1892 nic_broadcast_mode_t mode = NIC_BROADCAST_ACCEPTED; 1893 1893 1894 int rc = nic_iface->broadcast_get_mode(dev, &mode);1894 errno_t rc = nic_iface->broadcast_get_mode(dev, &mode); 1895 1895 async_answer_1(callid, rc, mode); 1896 1896 } … … 1907 1907 nic_broadcast_mode_t mode = IPC_GET_ARG2(*call); 1908 1908 1909 int rc = nic_iface->broadcast_set_mode(dev, mode);1909 errno_t rc = nic_iface->broadcast_set_mode(dev, mode); 1910 1910 async_answer_0(callid, rc); 1911 1911 } … … 1922 1922 uint32_t mode = 0; 1923 1923 1924 int rc = nic_iface->defective_get_mode(dev, &mode);1924 errno_t rc = nic_iface->defective_get_mode(dev, &mode); 1925 1925 async_answer_1(callid, rc, mode); 1926 1926 } … … 1937 1937 uint32_t mode = IPC_GET_ARG2(*call); 1938 1938 1939 int rc = nic_iface->defective_set_mode(dev, mode);1939 errno_t rc = nic_iface->defective_set_mode(dev, mode); 1940 1940 async_answer_0(callid, rc); 1941 1941 } … … 1964 1964 size_t address_count = 0; 1965 1965 1966 int rc = nic_iface->blocked_sources_get(dev, max_count, address_list,1966 errno_t rc = nic_iface->blocked_sources_get(dev, max_count, address_list, 1967 1967 &address_count); 1968 1968 … … 2034 2034 2035 2035 if (nic_iface->blocked_sources_set != NULL) { 2036 int rc = nic_iface->blocked_sources_set(dev, address_list,2036 errno_t rc = nic_iface->blocked_sources_set(dev, address_list, 2037 2037 address_count); 2038 2038 async_answer_0(callid, rc); … … 2055 2055 memset(&vlan_mask, 0, sizeof(nic_vlan_mask_t)); 2056 2056 2057 int rc = nic_iface->vlan_get_mask(dev, &vlan_mask);2057 errno_t rc = nic_iface->vlan_get_mask(dev, &vlan_mask); 2058 2058 if (rc == EOK) { 2059 2059 ipc_callid_t data_callid; … … 2111 2111 2112 2112 if (nic_iface->vlan_set_mask != NULL) { 2113 int rc = nic_iface->vlan_set_mask(dev, vlan_mask_pointer);2113 errno_t rc = nic_iface->vlan_set_mask(dev, vlan_mask_pointer); 2114 2114 async_answer_0(callid, rc); 2115 2115 } else … … 2131 2131 bool strip = (int) IPC_GET_ARG4(*call); 2132 2132 2133 int rc = nic_iface->vlan_set_tag(dev, tag, add, strip);2133 errno_t rc = nic_iface->vlan_set_tag(dev, tag, add, strip); 2134 2134 async_answer_0(callid, rc); 2135 2135 } … … 2180 2180 nic_wv_type_t type = (nic_wv_type_t) IPC_GET_ARG2(*call); 2181 2181 2182 int rc = nic_iface->wol_virtue_add(dev, type, data, length, &id);2182 errno_t rc = nic_iface->wol_virtue_add(dev, type, data, length, &id); 2183 2183 async_answer_1(callid, rc, (sysarg_t) id); 2184 2184 free(data); … … 2197 2197 nic_wv_id_t id = (nic_wv_id_t) IPC_GET_ARG2(*call); 2198 2198 2199 int rc = nic_iface->wol_virtue_remove(dev, id);2199 errno_t rc = nic_iface->wol_virtue_remove(dev, id); 2200 2200 async_answer_0(callid, rc); 2201 2201 } … … 2228 2228 memset(data, 0, max_length); 2229 2229 2230 int rc = nic_iface->wol_virtue_probe(dev, id, &type, max_length,2230 errno_t rc = nic_iface->wol_virtue_probe(dev, id, &type, max_length, 2231 2231 data, &length); 2232 2232 … … 2278 2278 memset(id_list, 0, max_count * sizeof (nic_wv_id_t)); 2279 2279 2280 int rc = nic_iface->wol_virtue_list(dev, type, max_count, id_list,2280 errno_t rc = nic_iface->wol_virtue_list(dev, type, max_count, id_list, 2281 2281 &count); 2282 2282 … … 2315 2315 nic_wv_type_t type = (nic_wv_type_t) IPC_GET_ARG2(*call); 2316 2316 2317 int rc = nic_iface->wol_virtue_get_caps(dev, type, &count);2317 errno_t rc = nic_iface->wol_virtue_get_caps(dev, type, &count); 2318 2318 async_answer_1(callid, rc, (sysarg_t) count); 2319 2319 } … … 2343 2343 memset(data, 0, max_length); 2344 2344 2345 int rc = nic_iface->wol_load_info(dev, &type, max_length, data,2345 errno_t rc = nic_iface->wol_load_info(dev, &type, max_length, data, 2346 2346 &frame_length); 2347 2347 if (rc == EOK) { … … 2376 2376 uint32_t active = 0; 2377 2377 2378 int rc = nic_iface->offload_probe(dev, &supported, &active);2378 errno_t rc = nic_iface->offload_probe(dev, &supported, &active); 2379 2379 async_answer_2(callid, rc, supported, active); 2380 2380 } … … 2392 2392 uint32_t active = (uint32_t) IPC_GET_ARG3(*call); 2393 2393 2394 int rc = nic_iface->offload_set(dev, mask, active);2394 errno_t rc = nic_iface->offload_set(dev, mask, active); 2395 2395 async_answer_0(callid, rc); 2396 2396 } … … 2412 2412 }; 2413 2413 2414 int rc = nic_iface->poll_get_mode(dev, &mode, &period);2414 errno_t rc = nic_iface->poll_get_mode(dev, &mode, &period); 2415 2415 if ((rc == EOK) && (request_data)) { 2416 2416 size_t max_len; … … 2470 2470 2471 2471 if (nic_iface->poll_set_mode != NULL) { 2472 int rc = nic_iface->poll_set_mode(dev, mode, period);2472 errno_t rc = nic_iface->poll_set_mode(dev, mode, period); 2473 2473 async_answer_0(callid, rc); 2474 2474 } else … … 2485 2485 } 2486 2486 2487 int rc = nic_iface->poll_now(dev);2487 errno_t rc = nic_iface->poll_now(dev); 2488 2488 async_answer_0(callid, rc); 2489 2489 } -
uspace/lib/drv/generic/remote_pci.c
r36f0738 rb7fd2a0 51 51 } pci_dev_iface_funcs_t; 52 52 53 int pci_config_space_read_8(async_sess_t *sess, uint32_t address, uint8_t *val)53 errno_t pci_config_space_read_8(async_sess_t *sess, uint32_t address, uint8_t *val) 54 54 { 55 55 sysarg_t res = 0; 56 56 57 57 async_exch_t *exch = async_exchange_begin(sess); 58 int rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE),58 errno_t rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE), 59 59 IPC_M_CONFIG_SPACE_READ_8, address, &res); 60 60 async_exchange_end(exch); … … 64 64 } 65 65 66 int pci_config_space_read_16(async_sess_t *sess, uint32_t address,66 errno_t pci_config_space_read_16(async_sess_t *sess, uint32_t address, 67 67 uint16_t *val) 68 68 { … … 70 70 71 71 async_exch_t *exch = async_exchange_begin(sess); 72 int rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE),72 errno_t rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE), 73 73 IPC_M_CONFIG_SPACE_READ_16, address, &res); 74 74 async_exchange_end(exch); … … 78 78 } 79 79 80 int pci_config_space_read_32(async_sess_t *sess, uint32_t address,80 errno_t pci_config_space_read_32(async_sess_t *sess, uint32_t address, 81 81 uint32_t *val) 82 82 { … … 84 84 85 85 async_exch_t *exch = async_exchange_begin(sess); 86 int rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE),86 errno_t rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE), 87 87 IPC_M_CONFIG_SPACE_READ_32, address, &res); 88 88 async_exchange_end(exch); … … 92 92 } 93 93 94 int pci_config_space_write_8(async_sess_t *sess, uint32_t address, uint8_t val)95 { 96 async_exch_t *exch = async_exchange_begin(sess); 97 int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),94 errno_t pci_config_space_write_8(async_sess_t *sess, uint32_t address, uint8_t val) 95 { 96 async_exch_t *exch = async_exchange_begin(sess); 97 errno_t rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE), 98 98 IPC_M_CONFIG_SPACE_WRITE_8, address, val); 99 99 async_exchange_end(exch); … … 102 102 } 103 103 104 int pci_config_space_write_16(async_sess_t *sess, uint32_t address,104 errno_t pci_config_space_write_16(async_sess_t *sess, uint32_t address, 105 105 uint16_t val) 106 106 { 107 107 async_exch_t *exch = async_exchange_begin(sess); 108 int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),108 errno_t rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE), 109 109 IPC_M_CONFIG_SPACE_WRITE_16, address, val); 110 110 async_exchange_end(exch); … … 113 113 } 114 114 115 int pci_config_space_write_32(async_sess_t *sess, uint32_t address,115 errno_t pci_config_space_write_32(async_sess_t *sess, uint32_t address, 116 116 uint32_t val) 117 117 { 118 118 async_exch_t *exch = async_exchange_begin(sess); 119 int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),119 errno_t rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE), 120 120 IPC_M_CONFIG_SPACE_WRITE_32, address, val); 121 121 async_exchange_end(exch); … … 160 160 uint32_t address = DEV_IPC_GET_ARG1(*call); 161 161 uint8_t value; 162 int ret = pci_iface->config_space_read_8(fun, address, &value);162 errno_t ret = pci_iface->config_space_read_8(fun, address, &value); 163 163 if (ret != EOK) { 164 164 async_answer_0(callid, ret); … … 178 178 uint32_t address = DEV_IPC_GET_ARG1(*call); 179 179 uint16_t value; 180 int ret = pci_iface->config_space_read_16(fun, address, &value);180 errno_t ret = pci_iface->config_space_read_16(fun, address, &value); 181 181 if (ret != EOK) { 182 182 async_answer_0(callid, ret); … … 195 195 uint32_t address = DEV_IPC_GET_ARG1(*call); 196 196 uint32_t value; 197 int ret = pci_iface->config_space_read_32(fun, address, &value);197 errno_t ret = pci_iface->config_space_read_32(fun, address, &value); 198 198 if (ret != EOK) { 199 199 async_answer_0(callid, ret); … … 213 213 uint32_t address = DEV_IPC_GET_ARG1(*call); 214 214 uint8_t value = DEV_IPC_GET_ARG2(*call); 215 int ret = pci_iface->config_space_write_8(fun, address, value);215 errno_t ret = pci_iface->config_space_write_8(fun, address, value); 216 216 if (ret != EOK) { 217 217 async_answer_0(callid, ret); … … 231 231 uint32_t address = DEV_IPC_GET_ARG1(*call); 232 232 uint16_t value = DEV_IPC_GET_ARG2(*call); 233 int ret = pci_iface->config_space_write_16(fun, address, value);233 errno_t ret = pci_iface->config_space_write_16(fun, address, value); 234 234 if (ret != EOK) { 235 235 async_answer_0(callid, ret); … … 249 249 uint32_t address = DEV_IPC_GET_ARG1(*call); 250 250 uint32_t value = DEV_IPC_GET_ARG2(*call); 251 int ret = pci_iface->config_space_write_32(fun, address, value);251 errno_t ret = pci_iface->config_space_write_32(fun, address, value); 252 252 if (ret != EOK) { 253 253 async_answer_0(callid, ret); -
uspace/lib/drv/generic/remote_usb.c
r36f0738 rb7fd2a0 79 79 * @return Error code. 80 80 */ 81 int usb_get_my_interface(async_exch_t *exch, int *usb_iface)81 errno_t usb_get_my_interface(async_exch_t *exch, int *usb_iface) 82 82 { 83 83 if (!exch) 84 84 return EBADMEM; 85 85 sysarg_t iface_no; 86 const int ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),86 const errno_t ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE), 87 87 IPC_M_USB_GET_MY_INTERFACE, &iface_no); 88 88 if (ret == EOK && usb_iface) … … 99 99 * 100 100 */ 101 int usb_get_my_device_handle(async_exch_t *exch, devman_handle_t *handle)101 errno_t usb_get_my_device_handle(async_exch_t *exch, devman_handle_t *handle) 102 102 { 103 103 devman_handle_t h = 0; 104 const int ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),104 const errno_t ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE), 105 105 IPC_M_USB_GET_MY_DEVICE_HANDLE, &h); 106 106 if (ret == EOK && handle) … … 114 114 * @return Error code. 115 115 */ 116 int usb_reserve_default_address(async_exch_t *exch, usb_speed_t speed)116 errno_t usb_reserve_default_address(async_exch_t *exch, usb_speed_t speed) 117 117 { 118 118 if (!exch) … … 129 129 * 130 130 */ 131 int usb_release_default_address(async_exch_t *exch)131 errno_t usb_release_default_address(async_exch_t *exch) 132 132 { 133 133 if (!exch) … … 145 145 * 146 146 */ 147 int usb_device_enumerate(async_exch_t *exch, unsigned port)148 { 149 if (!exch) 150 return EBADMEM; 151 const int ret = async_req_2_0(exch, DEV_IFACE_ID(USB_DEV_IFACE),147 errno_t usb_device_enumerate(async_exch_t *exch, unsigned port) 148 { 149 if (!exch) 150 return EBADMEM; 151 const errno_t ret = async_req_2_0(exch, DEV_IFACE_ID(USB_DEV_IFACE), 152 152 IPC_M_USB_DEVICE_ENUMERATE, port); 153 153 return ret; … … 162 162 * 163 163 */ 164 int usb_device_remove(async_exch_t *exch, unsigned port)164 errno_t usb_device_remove(async_exch_t *exch, unsigned port) 165 165 { 166 166 if (!exch) … … 177 177 } pack8_t; 178 178 179 int usb_register_endpoint(async_exch_t *exch, usb_endpoint_t endpoint,179 errno_t usb_register_endpoint(async_exch_t *exch, usb_endpoint_t endpoint, 180 180 usb_transfer_type_t type, usb_direction_t direction, 181 181 size_t mps, unsigned packets, unsigned interval) … … 194 194 } 195 195 196 int usb_unregister_endpoint(async_exch_t *exch, usb_endpoint_t endpoint,196 errno_t usb_unregister_endpoint(async_exch_t *exch, usb_endpoint_t endpoint, 197 197 usb_direction_t direction) 198 198 { … … 203 203 } 204 204 205 int usb_read(async_exch_t *exch, usb_endpoint_t endpoint, uint64_t setup,205 errno_t usb_read(async_exch_t *exch, usb_endpoint_t endpoint, uint64_t setup, 206 206 void *data, size_t size, size_t *rec_size) 207 207 { … … 233 233 234 234 /* Wait for the answer. */ 235 int data_request_rc;236 int opening_request_rc;235 errno_t data_request_rc; 236 errno_t opening_request_rc; 237 237 async_wait_for(data_request, &data_request_rc); 238 238 async_wait_for(opening_request, &opening_request_rc); … … 241 241 /* Prefer the return code of the opening request. */ 242 242 if (opening_request_rc != EOK) { 243 return ( int) opening_request_rc;243 return (errno_t) opening_request_rc; 244 244 } else { 245 return ( int) data_request_rc;245 return (errno_t) data_request_rc; 246 246 } 247 247 } 248 248 if (opening_request_rc != EOK) { 249 return ( int) opening_request_rc;249 return (errno_t) opening_request_rc; 250 250 } 251 251 … … 254 254 } 255 255 256 int usb_write(async_exch_t *exch, usb_endpoint_t endpoint, uint64_t setup,256 errno_t usb_write(async_exch_t *exch, usb_endpoint_t endpoint, uint64_t setup, 257 257 const void *data, size_t size) 258 258 { … … 273 273 /* Send the data if any. */ 274 274 if (size > 0) { 275 const int ret = async_data_write_start(exch, data, size);275 const errno_t ret = async_data_write_start(exch, data, size); 276 276 if (ret != EOK) { 277 277 async_forget(opening_request); … … 281 281 282 282 /* Wait for the answer. */ 283 int opening_request_rc;283 errno_t opening_request_rc; 284 284 async_wait_for(opening_request, &opening_request_rc); 285 285 286 return ( int) opening_request_rc;286 return (errno_t) opening_request_rc; 287 287 } 288 288 … … 330 330 331 331 int iface_no; 332 const int ret = usb_iface->get_my_interface(fun, &iface_no);332 const errno_t ret = usb_iface->get_my_interface(fun, &iface_no); 333 333 if (ret != EOK) { 334 334 async_answer_0(callid, ret); … … 349 349 350 350 devman_handle_t handle; 351 const int ret = usb_iface->get_my_device_handle(fun, &handle);351 const errno_t ret = usb_iface->get_my_device_handle(fun, &handle); 352 352 if (ret != EOK) { 353 353 async_answer_0(callid, ret); … … 368 368 369 369 usb_speed_t speed = DEV_IPC_GET_ARG1(*call); 370 const int ret = usb_iface->reserve_default_address(fun, speed);370 const errno_t ret = usb_iface->reserve_default_address(fun, speed); 371 371 async_answer_0(callid, ret); 372 372 } … … 382 382 } 383 383 384 const int ret = usb_iface->release_default_address(fun);384 const errno_t ret = usb_iface->release_default_address(fun); 385 385 async_answer_0(callid, ret); 386 386 } … … 397 397 398 398 const unsigned port = DEV_IPC_GET_ARG1(*call); 399 const int ret = usb_iface->device_enumerate(fun, port);399 const errno_t ret = usb_iface->device_enumerate(fun, port); 400 400 async_answer_0(callid, ret); 401 401 } … … 412 412 413 413 const unsigned port = DEV_IPC_GET_ARG1(*call); 414 const int ret = usb_iface->device_remove(fun, port);414 const errno_t ret = usb_iface->device_remove(fun, port); 415 415 async_answer_0(callid, ret); 416 416 } … … 435 435 unsigned interval = pack.arr[3]; 436 436 437 const int ret = usb_iface->register_endpoint(fun, endpoint,437 const errno_t ret = usb_iface->register_endpoint(fun, endpoint, 438 438 transfer_type, direction, max_packet_size, packets, interval); 439 439 … … 454 454 usb_direction_t direction = (usb_direction_t) DEV_IPC_GET_ARG2(*call); 455 455 456 int rc = usb_iface->unregister_endpoint(fun, endpoint, direction);456 errno_t rc = usb_iface->unregister_endpoint(fun, endpoint, direction); 457 457 458 458 async_answer_0(callid, rc); … … 491 491 } 492 492 493 static void callback_out( int outcome, void *arg)493 static void callback_out(errno_t outcome, void *arg) 494 494 { 495 495 async_transaction_t *trans = arg; … … 500 500 } 501 501 502 static void callback_in( int outcome, size_t actual_size, void *arg)502 static void callback_in(errno_t outcome, size_t actual_size, void *arg) 503 503 { 504 504 async_transaction_t *trans = (async_transaction_t *)arg; … … 563 563 } 564 564 565 const int rc = usb_iface->read(565 const errno_t rc = usb_iface->read( 566 566 fun, ep, setup, trans->buffer, size, callback_in, trans); 567 567 … … 601 601 size_t size = 0; 602 602 if (data_buffer_len > 0) { 603 const int rc = async_data_write_accept(&trans->buffer, false,603 const errno_t rc = async_data_write_accept(&trans->buffer, false, 604 604 1, data_buffer_len, 0, &size); 605 605 … … 611 611 } 612 612 613 const int rc = usb_iface->write(613 const errno_t rc = usb_iface->write( 614 614 fun, ep, setup, trans->buffer, size, callback_out, trans); 615 615 -
uspace/lib/drv/generic/remote_usbhc.c
r36f0738 rb7fd2a0 96 96 } usbhc_iface_funcs_t; 97 97 98 int usbhc_read(async_exch_t *exch, usb_address_t address,98 errno_t usbhc_read(async_exch_t *exch, usb_address_t address, 99 99 usb_endpoint_t endpoint, uint64_t setup, void *data, size_t size, 100 100 size_t *rec_size) … … 131 131 132 132 /* Wait for the answer. */ 133 int data_request_rc;134 int opening_request_rc;133 errno_t data_request_rc; 134 errno_t opening_request_rc; 135 135 async_wait_for(data_request, &data_request_rc); 136 136 async_wait_for(opening_request, &opening_request_rc); … … 139 139 /* Prefer the return code of the opening request. */ 140 140 if (opening_request_rc != EOK) { 141 return ( int) opening_request_rc;141 return (errno_t) opening_request_rc; 142 142 } else { 143 return ( int) data_request_rc;143 return (errno_t) data_request_rc; 144 144 } 145 145 } 146 146 if (opening_request_rc != EOK) { 147 return ( int) opening_request_rc;147 return (errno_t) opening_request_rc; 148 148 } 149 149 … … 152 152 } 153 153 154 int usbhc_write(async_exch_t *exch, usb_address_t address,154 errno_t usbhc_write(async_exch_t *exch, usb_address_t address, 155 155 usb_endpoint_t endpoint, uint64_t setup, const void *data, size_t size) 156 156 { … … 174 174 /* Send the data if any. */ 175 175 if (size > 0) { 176 const int ret = async_data_write_start(exch, data, size);176 const errno_t ret = async_data_write_start(exch, data, size); 177 177 if (ret != EOK) { 178 178 async_forget(opening_request); … … 182 182 183 183 /* Wait for the answer. */ 184 int opening_request_rc;184 errno_t opening_request_rc; 185 185 async_wait_for(opening_request, &opening_request_rc); 186 186 187 return ( int) opening_request_rc;187 return (errno_t) opening_request_rc; 188 188 } 189 189 … … 235 235 } 236 236 237 static void callback_out( int outcome, void *arg)237 static void callback_out(errno_t outcome, void *arg) 238 238 { 239 239 async_transaction_t *trans = arg; … … 244 244 } 245 245 246 static void callback_in( int outcome, size_t actual_size, void *arg)246 static void callback_in(errno_t outcome, size_t actual_size, void *arg) 247 247 { 248 248 async_transaction_t *trans = (async_transaction_t *)arg; … … 306 306 } 307 307 308 const int rc = hc_iface->read(308 const errno_t rc = hc_iface->read( 309 309 fun, target, setup, trans->buffer, size, callback_in, trans); 310 310 … … 344 344 size_t size = 0; 345 345 if (data_buffer_len > 0) { 346 const int rc = async_data_write_accept(&trans->buffer, false,346 const errno_t rc = async_data_write_accept(&trans->buffer, false, 347 347 1, USB_MAX_PAYLOAD_SIZE, 348 348 0, &size); … … 355 355 } 356 356 357 const int rc = hc_iface->write(357 const errno_t rc = hc_iface->write( 358 358 fun, target, setup, trans->buffer, size, callback_out, trans); 359 359 -
uspace/lib/drv/generic/remote_usbhid.c
r36f0738 rb7fd2a0 97 97 * 98 98 */ 99 int usbhid_dev_get_event_length(async_sess_t *dev_sess, size_t *size)99 errno_t usbhid_dev_get_event_length(async_sess_t *dev_sess, size_t *size) 100 100 { 101 101 if (!dev_sess) … … 105 105 106 106 sysarg_t len; 107 int rc = async_req_1_1(exch, DEV_IFACE_ID(USBHID_DEV_IFACE),107 errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(USBHID_DEV_IFACE), 108 108 IPC_M_USBHID_GET_EVENT_LENGTH, &len); 109 109 … … 132 132 * 133 133 */ 134 int usbhid_dev_get_event(async_sess_t *dev_sess, uint8_t *buf,134 errno_t usbhid_dev_get_event(async_sess_t *dev_sess, uint8_t *buf, 135 135 size_t size, size_t *actual_size, int *event_nr, unsigned int flags) 136 136 { … … 174 174 } 175 175 176 int data_request_rc;177 int opening_request_rc;176 errno_t data_request_rc; 177 errno_t opening_request_rc; 178 178 async_wait_for(data_request, &data_request_rc); 179 179 async_wait_for(opening_request, &opening_request_rc); … … 182 182 /* Prefer return code of the opening request. */ 183 183 if (opening_request_rc != EOK) 184 return ( int) opening_request_rc;184 return (errno_t) opening_request_rc; 185 185 else 186 return ( int) data_request_rc;186 return (errno_t) data_request_rc; 187 187 } 188 188 189 189 if (opening_request_rc != EOK) 190 return ( int) opening_request_rc;190 return (errno_t) opening_request_rc; 191 191 192 192 size_t act_size = IPC_GET_ARG2(data_request_call); … … 204 204 } 205 205 206 int usbhid_dev_get_report_descriptor_length(async_sess_t *dev_sess,206 errno_t usbhid_dev_get_report_descriptor_length(async_sess_t *dev_sess, 207 207 size_t *size) 208 208 { … … 213 213 214 214 sysarg_t arg_size; 215 int rc = async_req_1_1(exch, DEV_IFACE_ID(USBHID_DEV_IFACE),215 errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(USBHID_DEV_IFACE), 216 216 IPC_M_USBHID_GET_REPORT_DESCRIPTOR_LENGTH, &arg_size); 217 217 … … 226 226 } 227 227 228 int usbhid_dev_get_report_descriptor(async_sess_t *dev_sess, uint8_t *buf,228 errno_t usbhid_dev_get_report_descriptor(async_sess_t *dev_sess, uint8_t *buf, 229 229 size_t size, size_t *actual_size) 230 230 { … … 259 259 } 260 260 261 int data_request_rc;262 int opening_request_rc;261 errno_t data_request_rc; 262 errno_t opening_request_rc; 263 263 async_wait_for(data_request, &data_request_rc); 264 264 async_wait_for(opening_request, &opening_request_rc); … … 267 267 /* Prefer return code of the opening request. */ 268 268 if (opening_request_rc != EOK) 269 return ( int) opening_request_rc;269 return (errno_t) opening_request_rc; 270 270 else 271 return ( int) data_request_rc;271 return (errno_t) data_request_rc; 272 272 } 273 273 274 274 if (opening_request_rc != EOK) 275 return ( int) opening_request_rc;275 return (errno_t) opening_request_rc; 276 276 277 277 size_t act_size = IPC_GET_ARG2(data_request_call); … … 362 362 } 363 363 364 int rc;364 errno_t rc; 365 365 366 366 uint8_t *data = malloc(len); … … 438 438 439 439 size_t act_len = 0; 440 int rc = hid_iface->get_report_descriptor(fun, descriptor, len,440 errno_t rc = hid_iface->get_report_descriptor(fun, descriptor, len, 441 441 &act_len); 442 442 if (act_len > len) {
Note:
See TracChangeset
for help on using the changeset viewer.