Changes in uspace/lib/drv/generic/remote_nic.c [d5c1051:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_nic.c
rd5c1051 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 }
Note:
See TracChangeset
for help on using the changeset viewer.