|
1 | 1 | /*
|
2 |
| - * Copyright 2019 Cypress Semiconductor Corporation |
| 2 | + * Copyright 2020 Cypress Semiconductor Corporation |
3 | 3 | * SPDX-License-Identifier: Apache-2.0
|
4 | 4 | *
|
5 | 5 | * Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -745,6 +745,280 @@ extern uint32_t whd_wifi_send_action_frame(whd_interface_t ifp, whd_af_params_t
|
745 | 745 | */
|
746 | 746 | extern uint32_t whd_wifi_set_coex_config(whd_interface_t ifp, whd_coex_config_t *coex_config);
|
747 | 747 |
|
| 748 | +/** Get version of Device (WLAN) Firmware |
| 749 | + * |
| 750 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 751 | + * @param[out] version : pointer to store version # |
| 752 | + * |
| 753 | + * @return whd_result_t |
| 754 | + */ |
| 755 | +whd_result_t whd_arp_version(whd_interface_t ifp, uint32_t *version); |
| 756 | + |
| 757 | +/** Get ARP Offload Peer Age from Device (WLAN) |
| 758 | + * Length of time in seconds before aging out an entry in the WLAN processor ARP table. |
| 759 | + * |
| 760 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 761 | + * @param[out] seconds : pointer to store value |
| 762 | + * |
| 763 | + * @return whd_result_t |
| 764 | + */ |
| 765 | +whd_result_t whd_arp_peerage_get(whd_interface_t ifp, uint32_t *seconds); |
| 766 | + |
| 767 | +/** Set ARP Offload Peer Age in Device (WLAN) |
| 768 | + * Length of time in seconds before aging out an entry in the WLAN processor ARP table. |
| 769 | + * |
| 770 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 771 | + * @param[in] seconds : Seconds to age out IP |
| 772 | + * |
| 773 | + * @return whd_result_t |
| 774 | + */ |
| 775 | +whd_result_t whd_arp_peerage_set(whd_interface_t ifp, uint32_t seconds); |
| 776 | + |
| 777 | +/** Get ARP Offload Agent Enable from Device (WLAN) |
| 778 | + * |
| 779 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 780 | + * @param[out] agent_enable : pointer to store value |
| 781 | + * |
| 782 | + * @return whd_result_t |
| 783 | + */ |
| 784 | +whd_result_t whd_arp_arpoe_get(whd_interface_t ifp, uint32_t *agent_enable); |
| 785 | + |
| 786 | +/** Set ARP Offload Agent Enable in Device (WLAN) |
| 787 | + * Set Enable/Disable of ARP Offload Agent |
| 788 | + * |
| 789 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 790 | + * @param[in] agent_enable : Enable=1 / Disable=0 |
| 791 | + * |
| 792 | + * @return whd_result_t |
| 793 | + */ |
| 794 | +whd_result_t whd_arp_arpoe_set(whd_interface_t ifp, uint32_t agent_enable); |
| 795 | + |
| 796 | +/** Clear ARP Offload cache in Device (WLAN) |
| 797 | + * |
| 798 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 799 | + * |
| 800 | + * @return whd_result_t |
| 801 | + */ |
| 802 | +whd_result_t whd_arp_cache_clear(whd_interface_t ifp); |
| 803 | + |
| 804 | +/** Get ARP Offload Feature Flags from Device (WLAN) |
| 805 | + * |
| 806 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 807 | + * @param[out] features : ptr to store currently set features - bit flags @ref CY_ARP_OL_AGENT_ENABLE, etc. |
| 808 | + * ARL_OL_AGENT | ARL_OL_SNOOP | ARP_OL_HOST_AUTO_REPLY | ARP_OL_PEER_AUTO_REPLY |
| 809 | + * |
| 810 | + * @return whd_result_t |
| 811 | + */ |
| 812 | +whd_result_t whd_arp_features_get(whd_interface_t ifp, uint32_t *features); |
| 813 | + |
| 814 | +/** Set ARP Offload Feature Flags in Device (WLAN) |
| 815 | + * |
| 816 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 817 | + * @param[in] features : features to set value (you can OR ('|') multiple flags) @ref CY_ARP_OL_AGENT_ENABLE, etc. |
| 818 | + * ARL_OL_AGENT | ARL_OL_SNOOP | ARP_OL_HOST_AUTO_REPLY | ARP_OL_PEER_AUTO_REPLY |
| 819 | + * |
| 820 | + * @return whd_result_t |
| 821 | + */ |
| 822 | +whd_result_t whd_arp_features_set(whd_interface_t ifp, uint32_t features); |
| 823 | + |
| 824 | +/** Print ARP Offload Feature Flags in Human readable form to console |
| 825 | + * |
| 826 | + * @param[in] features : feature flags to set (you can OR '|' multiple flags) @ref CY_ARP_OL_AGENT_ENABLE, etc. |
| 827 | + * ARL_OL_AGENT | ARL_OL_SNOOP | ARP_OL_HOST_AUTO_REPLY | ARP_OL_PEER_AUTO_REPLY |
| 828 | + * @param[in] title : Optional: Title for output (NULL == no title) |
| 829 | + * |
| 830 | + * @return whd_result_t |
| 831 | + */ |
| 832 | +whd_result_t whd_arp_features_print(uint32_t features, const char *title); |
| 833 | + |
| 834 | +/** Add ARP Offload Host IP Identifier(s) to HostIP List to Device (WLAN) |
| 835 | + * |
| 836 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 837 | + * @param[in] host_ipv4_list : pointer to host_ip data (IPv4, 1 uint32_t per ip addr) |
| 838 | + * @param[in] count : Number of array elements in host_ip |
| 839 | + * |
| 840 | + * @return whd_result_t |
| 841 | + */ |
| 842 | +whd_result_t whd_arp_hostip_list_add(whd_interface_t ifp, uint32_t *host_ipv4_list, uint32_t count); |
| 843 | + |
| 844 | +/** Add One ARP Offload Host IP Identifier to HostIP List (mbed-style IP string) to Device (WLAN) |
| 845 | + * |
| 846 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 847 | + * @param[in] ip_addr : pointer to ip string (as returned from mbedos calls) |
| 848 | + * |
| 849 | + * @return whd_result_t |
| 850 | + */ |
| 851 | +whd_result_t whd_arp_hostip_list_add_string(whd_interface_t ifp, const char *ip_addr); |
| 852 | + |
| 853 | +/** Clear One ARP Offload Host IP Identifier from Host IP List in Device (WLAN) |
| 854 | + * |
| 855 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 856 | + * @param[in] ipv4_addr : ip addr expressed as a uint32_t |
| 857 | + * |
| 858 | + * @return whd_result_t |
| 859 | + */ |
| 860 | +whd_result_t whd_arp_hostip_list_clear_id(whd_interface_t ifp, uint32_t ipv4_addr); |
| 861 | + |
| 862 | +/** Clear One ARP Offload Host IP Identifier from Host IP List (mbed-style IP string) in Device (WLAN) |
| 863 | + * |
| 864 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 865 | + * @param[in] ip_addr : pointer to ip string (as returned from mbedos calls) |
| 866 | + * |
| 867 | + * @return whd_result_t |
| 868 | + */ |
| 869 | +whd_result_t whd_arp_hostip_list_clear_id_string(whd_interface_t ifp, const char *ip_addr); |
| 870 | + |
| 871 | +/** Clear all ARP Offload Host IP Identifier List |
| 872 | + * |
| 873 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 874 | + * |
| 875 | + * @return whd_result_t |
| 876 | + */ |
| 877 | +whd_result_t whd_arp_hostip_list_clear(whd_interface_t ifp); |
| 878 | + |
| 879 | +/** Get ARP Offload Host IP Identifiers from Device (WLAN) |
| 880 | + * |
| 881 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 882 | + * @param[in] count : Number of array elements in host_ip |
| 883 | + * @param[out] host_ipv4_list : Pointer to structure array to store host_ip data |
| 884 | + * @param[out] filled : Number of array elements filled by this routine |
| 885 | + * |
| 886 | + * @return whd_result_t |
| 887 | + */ |
| 888 | +whd_result_t whd_arp_hostip_list_get(whd_interface_t ifp, uint32_t count, uint32_t *host_ipv4_list, uint32_t *filled); |
| 889 | + |
| 890 | +/** Clear ARP Offload statistics in Device (WLAN) |
| 891 | + * |
| 892 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 893 | + * |
| 894 | + * @return whd_result_t |
| 895 | + */ |
| 896 | +whd_result_t whd_arp_stats_clear(whd_interface_t ifp); |
| 897 | + |
| 898 | +/** Get ARP Offload statistics from Device (WLAN) |
| 899 | + * |
| 900 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 901 | + * @param[out] stats : Ptr to store statistics @ref whd_arp_stats_t |
| 902 | + * |
| 903 | + * @return whd_result_t |
| 904 | + */ |
| 905 | +whd_result_t whd_arp_stats_get(whd_interface_t ifp, whd_arp_stats_t *stats); |
| 906 | + |
| 907 | +/** Print ARP Offload statistics |
| 908 | + * NOTE: call whd_arp_stats_get(), then print them using this function. |
| 909 | + * |
| 910 | + * @param[in] arp_stats : Ptr to ARP statistics structure |
| 911 | + * @param[in] title : Optional: Title for output (NULL == no title) |
| 912 | + * |
| 913 | + * @return whd_result_t |
| 914 | + */ |
| 915 | +whd_result_t whd_arp_stats_print(whd_arp_stats_t *arp_stats, const char *title); |
| 916 | + |
| 917 | +/** A filter must be added (e.g. created) before it can be enabled. |
| 918 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 919 | + * @param[in] settings : Ptr to filter settings @ref whd_packet_filter_t |
| 920 | + * @return whd_result_t |
| 921 | + */ |
| 922 | +whd_result_t whd_pf_add_packet_filter(whd_interface_t ifp, const whd_packet_filter_t *settings); |
| 923 | + |
| 924 | +/** Remove a previously added filter. |
| 925 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 926 | + * @param[in] filter_id : filter to remove |
| 927 | + * @return whd_result_t |
| 928 | + */ |
| 929 | +whd_result_t whd_pf_remove_packet_filter(whd_interface_t ifp, uint8_t filter_id); |
| 930 | + |
| 931 | +/** After a filter has been added it can be enabled or disabled as needed. |
| 932 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 933 | + * @param[in] filter_id : filter to enable |
| 934 | + * @return whd_result_t |
| 935 | + */ |
| 936 | +whd_result_t whd_pf_enable_packet_filter(whd_interface_t ifp, uint8_t filter_id); |
| 937 | + |
| 938 | +/** After a filter has been added it can be enabled or disabled as needed. |
| 939 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 940 | + * @param[in] filter_id : filter to disable |
| 941 | + * @return whd_result_t |
| 942 | + */ |
| 943 | +whd_result_t whd_pf_disable_packet_filter(whd_interface_t ifp, uint8_t filter_id); |
| 944 | + |
| 945 | +/** After a filter has been added it can be enabled or disabled as needed. |
| 946 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 947 | + * @param[in] filter_id : filter to disable/enable |
| 948 | + * @param[in] enable : Enable/Disable Flag |
| 949 | + * @return whd_result_t |
| 950 | + */ |
| 951 | +whd_result_t whd_wifi_toggle_packet_filter(whd_interface_t ifp, uint8_t filter_id, whd_bool_t enable); |
| 952 | + |
| 953 | +/** Filters are implemented in WLAN subsystem as a bit pattern and matching bit mask that |
| 954 | + * are applied to incoming packets. This API retrieves the pattern and mask. |
| 955 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 956 | + * @param[in] filter_id : which filter to retrieve |
| 957 | + * @param[in] max_size : size of both mask and pattern buffers |
| 958 | + * @param[out] mask : mask for this filter |
| 959 | + * @param[out] pattern : pattern for this filter |
| 960 | + * @param[out] size_out : length of both mask and pattern |
| 961 | + * @return whd_result_t |
| 962 | + */ |
| 963 | +whd_result_t whd_pf_get_packet_filter_mask_and_pattern(whd_interface_t ifp, uint8_t filter_id, uint32_t max_size, |
| 964 | + uint8_t *mask, |
| 965 | + uint8_t *pattern, uint32_t *size_out); |
| 966 | + |
| 967 | +/** Clear the packet filter stats associated with a filter id |
| 968 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 969 | + * @param[in] filter_id : which filter |
| 970 | + * @return whd_result_t |
| 971 | + */ |
| 972 | +whd_result_t whd_wifi_clear_packet_filter_stats(whd_interface_t ifp, uint32_t filter_id); |
| 973 | + |
| 974 | +/** Return the stats associated with a filter |
| 975 | + * @param[in] ifp : pointer to handle instance of whd interface |
| 976 | + * @param[in] filter_id : which filter |
| 977 | + * @param[out] stats : Ptr to store statistics wl_pkt_filter_stats_t |
| 978 | + * @return whd_result_t |
| 979 | + */ |
| 980 | +whd_result_t whd_pf_get_packet_filter_stats(whd_interface_t ifp, uint8_t filter_id, whd_pkt_filter_stats_t *stats); |
| 981 | + |
| 982 | +/** Set/Get TKO retry & interval parameters |
| 983 | + * @param[in] ifp : Pointer to handle instance of whd interface |
| 984 | + * @param[in] whd_tko_retry : whd retry & interval parameters structure |
| 985 | + * @param[in] set : Set/Get Flag |
| 986 | + * @return whd_result_t |
| 987 | + */ |
| 988 | +whd_result_t whd_tko_param(whd_interface_t ifp, whd_tko_retry_t *whd_tko_retry, int set); |
| 989 | + |
| 990 | +/** Return the tko status for all indexes |
| 991 | + * @param[in] ifp : Pointer to handle instance of whd interface |
| 992 | + * @param[out] tko_status : Ptr to store tko_status |
| 993 | + * @return whd_result_t |
| 994 | + */ |
| 995 | +whd_result_t whd_tko_get_status(whd_interface_t ifp, whd_tko_status_t *tko_status); |
| 996 | + |
| 997 | +/** Return the stats associated with a filter |
| 998 | + * @param[in] ifp : Pointer to handle instance of whd interface |
| 999 | + * @param[out] max : returns Max TCP connections supported by WLAN Firmware |
| 1000 | + * @return whd_result_t |
| 1001 | + */ |
| 1002 | +whd_result_t whd_tko_max_assoc(whd_interface_t ifp, uint8_t *max); |
| 1003 | + |
| 1004 | +/** Return the stats associated with a filter |
| 1005 | + * @param[in] ifp : Pointer to handle instance of whd interface |
| 1006 | + * @param[in] index : index for TCP offload connection |
| 1007 | + * @param[out] whd_connect : tko_connect structure buffer from Firmware |
| 1008 | + * @param[in] buflen : Buffer given for tko_connect |
| 1009 | + * @return whd_result_t |
| 1010 | + */ |
| 1011 | +whd_result_t whd_tko_get_FW_connect(whd_interface_t ifp, uint8_t index, whd_tko_connect_t *whd_connect, |
| 1012 | + uint16_t buflen); |
| 1013 | + |
| 1014 | +/** Return the stats associated with a filter |
| 1015 | + * @param[in] ifp : Pointer to handle instance of whd interface |
| 1016 | + * @param[in] enable : Enable/Disable TCP Keepalive offload |
| 1017 | + * @return whd_result_t |
| 1018 | + */ |
| 1019 | +whd_result_t whd_tko_toggle(whd_interface_t ifp, whd_bool_t enable); |
| 1020 | + |
| 1021 | + |
748 | 1022 | /* @} */
|
749 | 1023 |
|
750 | 1024 | /** @addtogroup wifiioctl WHD Wi-Fi IOCTL Set/Get API
|
@@ -893,6 +1167,7 @@ extern uint32_t whd_wifi_get_bss_info(whd_interface_t ifp, wl_bss_info_t *bi);
|
893 | 1167 | * @return WHD_SUCCESS or Error code
|
894 | 1168 | */
|
895 | 1169 | extern uint32_t whd_print_stats(whd_driver_t whd_drv, whd_bool_t reset_after_print);
|
| 1170 | + |
896 | 1171 | /* @} */
|
897 | 1172 | /* @} */
|
898 | 1173 |
|
|
0 commit comments