Changeset 1433ecda in mainline for uspace/lib/nic/src/nic_driver.c
- Timestamp:
- 2018-04-04T15:42:37Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/nic/src/nic_driver.c
r47b2d7e3 r1433ecda 170 170 */ 171 171 void nic_set_state_change_handlers(nic_t *nic_data, 172 173 172 state_change_handler on_activating, state_change_handler on_going_down, 173 state_change_handler on_stopping) 174 174 { 175 175 nic_data->on_activating = on_activating; … … 190 190 */ 191 191 void nic_set_filtering_change_handlers(nic_t *nic_data, 192 193 194 195 196 192 unicast_mode_change_handler on_unicast_mode_change, 193 multicast_mode_change_handler on_multicast_mode_change, 194 broadcast_mode_change_handler on_broadcast_mode_change, 195 blocked_sources_change_handler on_blocked_sources_change, 196 vlan_mask_change_handler on_vlan_mask_change) 197 197 { 198 198 nic_data->on_unicast_mode_change = on_unicast_mode_change; … … 212 212 */ 213 213 void nic_set_wol_virtue_change_handlers(nic_t *nic_data, 214 214 wol_virtue_add_handler on_wv_add, wol_virtue_remove_handler on_wv_remove) 215 215 { 216 216 assert(on_wv_add != NULL && on_wv_remove != NULL); … … 227 227 */ 228 228 void nic_set_poll_handlers(nic_t *nic_data, 229 229 poll_mode_change_handler on_poll_mode_change, poll_request_handler on_poll_req) 230 230 { 231 231 nic_data->on_poll_mode_change = on_poll_mode_change; … … 369 369 */ 370 370 void nic_frame_list_append(nic_frame_list_t *frames, 371 371 nic_frame_t *frame) 372 372 { 373 373 assert(frame != NULL && frames != NULL); … … 400 400 */ 401 401 errno_t nic_report_poll_mode(nic_t *nic_data, nic_poll_mode_t mode, 402 402 struct timeval *period) 403 403 { 404 404 errno_t rc = EOK; … … 408 408 if (mode == NIC_POLL_PERIODIC) { 409 409 if (period) { 410 memcpy(&nic_data->default_poll_period, period, sizeof 411 memcpy(&nic_data->poll_period, period, sizeof 410 memcpy(&nic_data->default_poll_period, period, sizeof(struct timeval)); 411 memcpy(&nic_data->poll_period, period, sizeof(struct timeval)); 412 412 } else { 413 413 rc = EINVAL; … … 482 482 * @param address The output for address. 483 483 */ 484 void nic_query_address(nic_t *nic_data, nic_address_t *addr) { 484 void nic_query_address(nic_t *nic_data, nic_address_t *addr) 485 { 485 486 if (!addr) 486 487 return; … … 575 576 while (!list_empty(frames)) { 576 577 nic_frame_t *frame = 577 578 list_get_instance(list_first(frames), nic_frame_t, link); 578 579 579 580 list_remove(&frame->link); … … 685 686 */ 686 687 void nic_report_hw_filtering(nic_t *nic_data, 687 688 int unicast_exact, int multicast_exact, int vlan_exact) 688 689 { 689 690 nic_rxc_hw_filtering(&nic_data->rx_control, 690 691 unicast_exact, multicast_exact, vlan_exact); 691 692 } 692 693 … … 739 740 */ 740 741 void nic_query_unicast(const nic_t *nic_data, 741 742 742 nic_unicast_mode_t *mode, 743 size_t max_count, nic_address_t *address_list, size_t *address_count) 743 744 { 744 745 assert(mode != NULL); 745 746 nic_rxc_unicast_get_mode(&nic_data->rx_control, mode, 746 747 max_count, address_list, address_count); 747 748 } 748 749 … … 759 760 */ 760 761 void nic_query_multicast(const nic_t *nic_data, 761 762 762 nic_multicast_mode_t *mode, 763 size_t max_count, nic_address_t *address_list, size_t *address_count) 763 764 { 764 765 assert(mode != NULL); 765 766 nic_rxc_multicast_get_mode(&nic_data->rx_control, mode, 766 767 max_count, address_list, address_count); 767 768 } 768 769 … … 775 776 */ 776 777 void nic_query_broadcast(const nic_t *nic_data, 777 778 nic_broadcast_mode_t *mode) 778 779 { 779 780 assert(mode != NULL); … … 792 793 */ 793 794 void nic_query_blocked_sources(const nic_t *nic_data, 794 795 size_t max_count, nic_address_t *address_list, size_t *address_count) 795 796 { 796 797 nic_rxc_blocked_sources_get(&nic_data->rx_control, 797 798 max_count, address_list, address_count); 798 799 } 799 800 … … 979 980 */ 980 981 void nic_report_receive_error(nic_t *nic_data, 981 982 nic_receive_error_cause_t cause, unsigned count) 982 983 { 983 984 fibril_rwlock_write_lock(&nic_data->stats_lock); … … 1027 1028 * @returns Nonzero if t is zero interval 1028 1029 */ 1029 static int timeval_nonpositive(struct timeval t) { 1030 static int timeval_nonpositive(struct timeval t) 1031 { 1030 1032 return (t.tv_sec <= 0) && (t.tv_usec <= 0); 1031 1033 }
Note:
See TracChangeset
for help on using the changeset viewer.