/* * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * * Copyright 2016 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /********************************************************************** module: wifi_hal.h For CCSP Component: Wifi_Provisioning_and_management --------------------------------------------------------------- description: This header file gives the function call prototypes and structure definitions used for the RDK-Broadband Wifi radio hardware abstraction layer --------------------------------------------------------------- environment: This HAL layer is intended to support Wifi drivers through an open API. --------------------------------------------------------------- HAL version: The version of the Wifi HAL is specified in #defines below. --------------------------------------------------------------- author: zhicheng_qiu@comcast.com Charles Moreman, moremac@cisco.com Paul White, paul@plumewifi.com --------------------------------------------------------------- Notes: What is new for 2.2.0 1. Add Country Code support 2. Add more DCS function 3. Move RadiusSecret from struct wifi_radius_setting_t to wifi_getApSecurityRadiusServer function 4. Add wifi_getApSecuritySecondaryRadiusServer What is new for 2.2.1 1. Add wifi_setRadioTrafficStatsMeasure, wifi_setRadioTrafficStatsRadioStatisticsEnable What is new for 2.2.2 1. Add Band Steering HAL What is new for 2.3.0 1. Add AP Beacon Rate control HAL 2. Add Dynamic Channel Selection (phase 2) HAL 3. Add Air Time Management HAL What is new for 2.4.0 1. Add data structure and HAL for mesh What is new for 2.5.0 1. Add the Channel switch HAL for mesh What is new for 2.6.0 1. Add the Band steering HAL for mesh What is new for 2.7.0 1. Add HAL for Wifi telemetry What is new for 2.8.0 1. Add HAL for 11w What is new for 2.9.0 1. Add HAL function definitions for 802.11r Fast Transition What is new for 2.10.0 1. Add HAL function definitions for 802.11v BSS Transition Management What is new for 2.11.0 1. Add HAL function definitions for 802.11k Neighbor Request and Response definitions What is new for 2.12.0 1. Add HAL function definitions for 802.11k Beacon Request and Response definitions What is new for 2.13.0 1. Add HAL function definitions for DPP What is new for 2.14.0 1. Add HAL function definitions for steering effectiveness telemetry What is new for 2.15.0 1. Add HAL function definitions for 802.11ax 2. Add HAL definitions for dfs channel state 3. Add HAL function definitions for EAP parameters What is new for 2.16.0 1. Modified HAL structure definition for VAP Telemetry What is new for 2.17.0 1. Add HAL function definition for Single Client reporting feature What is new for 2.18.0 1. Add HAL Fuction Definition for Absolute TX-Power retreival What is new for 2.19.0 1. Added zerowait DFS status support 2. Modified HAL definitions for EAP parameters 3. Updated comments for ChannelUtilization, ActivityFactor, CarrierSenseThreshold_Exceeded and RetransmissionMetirc radio metrics **********************************************************************/ /** * @file wifi_hal.h * @author zhicheng_qiu@cable.comcast.com * @brief For CCSP Component: Wifi_Provisioning_and_management * * @brief Wifi subsystem level APIs that are common to Client and Access Point devices. This HAL layer is intended to support Wifi drivers through an open API. This sample implementation file gives the function call prototypes and structure definitions used for the RDK-Broadband Wifi hardware abstraction layer. * This header file gives the function call prototypes and structure definitions used for the RDK-Broadband Wifi radio hardware abstraction layer. */ /** * @defgroup WIFI_HAL Wi-Fi HAL * Wi-Fi Access Point HAL provides an interface (data structures and API) to create, secure and delete the Access point * and also provides APIs to establish the client to connect to the Access point. * * @defgroup WIFI_HAL_TYPES WIFI HAL Data Types * @ingroup WIFI_HAL * * @defgroup WIFI_HAL_APIS WIFI HAL APIs * @ingroup WIFI_HAL * */ #ifndef __WIFI_HAL_H__ #define __WIFI_HAL_H__ #ifdef __cplusplus extern "C"{ #endif #ifndef ULLONG #define ULLONG unsigned long long #endif #ifndef ULONG #define ULONG unsigned long #endif #ifndef USHORT #define USHORT unsigned short #endif #ifndef BOOL #define BOOL unsigned char #endif #ifndef CHAR #define CHAR char #endif #ifndef UCHAR #define UCHAR unsigned char #endif #ifndef INT #define INT int #endif #ifndef UINT #define UINT unsigned int #endif #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #ifndef ENABLE #define ENABLE 1 #endif #ifndef RETURN_OK #define RETURN_OK 0 #endif #ifndef RETURN_ERR #define RETURN_ERR -1 #endif #ifndef RADIO_INDEX_1 #define RADIO_INDEX_1 1 #define RADIO_INDEX_2 2 #define AP_INDEX_1 1 #define AP_INDEX_2 2 #define AP_INDEX_3 3 #define AP_INDEX_4 4 #define AP_INDEX_5 5 #define AP_INDEX_6 6 #define AP_INDEX_7 7 #define AP_INDEX_8 8 #define AP_INDEX_9 9 #define AP_INDEX_10 10 #define AP_INDEX_11 11 #define AP_INDEX_12 12 #define AP_INDEX_13 13 #define AP_INDEX_14 14 #define AP_INDEX_15 15 #define AP_INDEX_16 16 #endif /** * @addtogroup WIFI_HAL_TYPES * @{ */ //defines for HAL version 2.19.0 #define WIFI_HAL_MAJOR_VERSION 2 /**< This is the major verion of this HAL. */ #define WIFI_HAL_MINOR_VERSION 19 /**< This is the minor verson of the HAL. */ #define WIFI_HAL_MAINTENANCE_VERSION 0 /**< This is the maintenance version of the HAL. */ /********************************************************************** STRUCTURE DEFINITIONS **********************************************************************/ typedef unsigned char mac_address_t[6]; typedef char r1_key_holder_t[13]; typedef char nas_id_t[49]; typedef unsigned char r0r1_key_t[16]; typedef char r0r1_key_str_t[33]; typedef char mac_addr_str_t[18]; typedef mac_address_t bssid_t; typedef char ssid_t[32]; typedef unsigned int u_int32_t; typedef struct _wifi_basicTrafficStats { ULONG wifi_BytesSent; ULONG wifi_BytesReceived; ULONG wifi_PacketsSent; ULONG wifi_PacketsReceived; ULONG wifi_Associations; } wifi_basicTrafficStats_t; typedef struct _wifi_trafficStats { ULONG wifi_ErrorsSent; ULONG wifi_ErrorsReceived; ULONG wifi_UnicastPacketsSent; ULONG wifi_UnicastPacketsReceived; ULONG wifi_DiscardedPacketsSent; ULONG wifi_DiscardedPacketsReceived; ULONG wifi_MulticastPacketsSent; ULONG wifi_MulticastPacketsReceived; ULONG wifi_BroadcastPacketsSent; ULONG wifi_BroadcastPacketsRecevied; ULONG wifi_UnknownPacketsReceived; } wifi_trafficStats_t; typedef struct _wifi_radioTrafficStats { ULONG wifi_ErrorsSent; ULONG wifi_ErrorsReceived; ULONG wifi_DiscardPacketsSent; ULONG wifi_DiscardPacketsReceived; ULONG wifi_PLCPErrorCount; ULONG wifi_FCSErrorCount; ULONG wifi_InvalidMACCount; ULONG wifi_PacketsOtherReceived; INT wifi_Noise; } wifi_radioTrafficStats_t; typedef struct _wifi_ssidTrafficStats { ULONG wifi_RetransCount; ULONG wifi_FailedRetransCount; ULONG wifi_RetryCount; ULONG wifi_MultipleRetryCount; ULONG wifi_ACKFailureCount; ULONG wifi_AggregatedPacketCount; } wifi_ssidTrafficStats_t; typedef struct _wifi_neighbor_ap { CHAR ap_Radio[64]; CHAR ap_SSID[64]; CHAR ap_BSSID[64]; CHAR ap_Mode[64]; UINT ap_Channel; INT ap_SignalStrength; CHAR ap_SecurityModeEnabled[64]; CHAR ap_EncryptionMode[64]; CHAR ap_OperatingFrequencyBand[16]; CHAR ap_SupportedStandards[64]; CHAR ap_OperatingStandards[16]; CHAR ap_OperatingChannelBandwidth[16]; UINT ap_BeaconPeriod; INT ap_Noise; CHAR ap_BasicDataTransferRates[256]; CHAR ap_SupportedDataTransferRates[256]; UINT ap_DTIMPeriod; UINT ap_ChannelUtilization; } wifi_neighbor_ap_t; //<< typedef struct _wifi_radioTrafficStats2 { ULONG radio_BytesSent; /**< The total number of bytes transmitted out of the interface, including framing characters. */ ULONG radio_BytesReceived; /**< The total number of bytes received on the interface, including framing characters. */ ULONG radio_PacketsSent; /**< The total number of packets transmitted out of the interface. */ ULONG radio_PacketsReceived; /**< The total number of packets received on the interface. */ ULONG radio_ErrorsSent; /**< The total number of outbound packets that could not be transmitted because of errors. */ ULONG radio_ErrorsReceived; /**< The total number of inbound packets that contained errors preventing them from being delivered to a higher-layer protocol. */ ULONG radio_DiscardPacketsSent; /**< The total number of outbound packets which were chosen to be discarded even though no errors had been detected to prevent their being transmitted. One possible reason for discarding such a packet could be to free up buffer space. */ ULONG radio_DiscardPacketsReceived; /**< The total number of inbound packets which were chosen to be discarded even though no errors had been detected to prevent their being delivered. One possible reason for discarding such a packet could be to free up buffer space. */ ULONG radio_PLCPErrorCount; /**< The number of packets that were received with a detected Physical Layer Convergence Protocol (PLCP) header error. */ ULONG radio_FCSErrorCount; /**< The number of packets that were received with a detected FCS error. This parameter is based on dot11FCSErrorCount from [Annex C/802.11-2012]. */ ULONG radio_InvalidMACCount; /**< The number of packets that were received with a detected invalid MAC header error. */ ULONG radio_PacketsOtherReceived; /**< The number of packets that were received, but which were destined for a MAC address that is not associated with this interface. */ INT radio_NoiseFloor; /**< The noise floor for this radio channel where a recoverable signal can be obtained. Expressed as a signed integer in the range (-110:0). Measurement should capture all energy (in dBm) from sources other than Wi-Fi devices as well as interference from Wi-Fi devices too weak to be decoded. Measured in dBm */ ULONG radio_ChannelUtilization; /**< Percentage of time the channel was occupied by the radio's own activity (Activity Factor) or the activity of other radios. Channel utilization MUST cover all user traffic, management traffic, and time the radio was unavailable for CSMA activities, including DIFS intervals, etc. The metric is calculated and updated in this parameter and if this metric is queried, it MUST return real-time value. Units in Percentage */ INT radio_ActivityFactor; /**< Percentage of time that the radio was transmitting or receiving Wi-Fi packets to/from associated clients. Activity factor MUST include all traffic that deals with communication between the radio and clients associated to the radio as well as management overhead for the radio, including NAV timers, beacons, probe responses,time for receiving devices to send an ACK, SIFC intervals, etc. The metric is calculated and updated in this parameter. If this metric is queried, it MUST return real-time value. Units in Percentage */ INT radio_CarrierSenseThreshold_Exceeded; /**< Percentage of time that the radio was unable to transmit or receive Wi-Fi packets to/from associated clients due to energy detection (ED) on the channel or clear channel assessment (CCA). The metric is calculated and updated in this Parameter. If this metric is queried, it MUST return real-time value. Units in Percentage */ INT radio_RetransmissionMetirc; /**< Percentage of packets that had to be re-transmitted. Multiple re-transmissions of the same packet count as one. The metric is calculated and updated in this parameter. If this metric is queried, it MUST return real-time value. Units in percentage */ INT radio_MaximumNoiseFloorOnChannel; /**< Maximum Noise on the channel during the measuring interval. The metric is updated in this parameter at the end of the interval defined by "Radio Statistics Measuring Interval". The calculation of this metric MUST only use the data collected in the just completed interval. If this metric is queried before it has been updated with an initial calculation, it MUST return -1. Units in dBm */ INT radio_MinimumNoiseFloorOnChannel; /**< Minimum Noise on the channel. The metric is updated in this Parameter at the end of the interval defined by "Radio Statistics Measuring Interval". The calculation of this metric MUST only use the data collected in the just completed interval. If this metric is queried before it has been updated with an initial calculation, it MUST return -1. Units in dBm */ INT radio_MedianNoiseFloorOnChannel; /**< Median Noise on the channel during the measuring interval. The metric is updated in this parameter at the end of the interval defined by "Radio Statistics Measuring Interval". The calculation of this metric MUST only use the data collected in the just completed interval. If this metric is queried before it has been updated with an initial calculation, it MUST return -1. Units in dBm */ ULONG radio_StatisticsStartTime; /**< The date and time at which the collection of the current set of statistics started. This time must be updated whenever the radio statistics are reset. */ } wifi_radioTrafficStats2_t; //for radio only typedef struct _wifi_radioTrafficStatsMeasure { INT radio_RadioStatisticsMeasuringRate; /**< Input //"The rate at which radio related statistics are periodically collected. Only statistics that explicitly indicate the use of this parameter MUST use the rate set in this parameter Other parameter's are assumed to collect data in real-time or nearly real-time. Default value is 30 seconds. This parameter MUST be persistent across reboots. If this parameter is changed, then use of the new rate MUST be deferred until the start of the next interval and all metrics using this rate MUST return -1 until the completion of the next full interval Units in Seconds" */ INT radio_RadioStatisticsMeasuringInterval; /**< Input //The interval for which radio data MUST be retained in order and at the end of which appropriate calculations are executed and reflected in the associated radio object's. Only statistics that explicitly indicate the use of this parameter MUST use the interval set in this parameter Default value is 30 minutes. This parameter MUST be persistent across reboots. If this item is modified, then all metrics leveraging this interval as well as the metrics "Total number 802.11 packet of TX" and "Total number 802.11 packet of RX" MUST be re-initialized immediately. Additionally, the "Statistics Start Time" must be reset to the current time. Units in Seconds */ } wifi_radioTrafficStatsMeasure_t; //for radio only typedef struct _wifi_ssidTrafficStats2 { ULONG ssid_BytesSent; /**< The total number of bytes transmitted out of the interface, including framing characters. */ ULONG ssid_BytesReceived; /**< The total number of bytes received on the interface, including framing characters. */ ULONG ssid_PacketsSent; /**< The total number of packets transmitted out of the interface. */ ULONG ssid_PacketsReceived; /**< The total number of packets received on the interface. */ ULONG ssid_RetransCount; /**< The total number of transmitted packets which were retransmissions. Two retransmissions of the same packet results in this counter incrementing by two. */ ULONG ssid_FailedRetransCount; /**< The number of packets that were not transmitted successfully due to the number of retransmission attempts exceeding an 802.11 retry limit. This parameter is based on dot11FailedCount from [802.11-2012]. */ ULONG ssid_RetryCount; /**< The number of packets that were successfully transmitted after one or more retransmissions. This parameter is based on dot11RetryCount from [802.11-2012]. */ ULONG ssid_MultipleRetryCount; /**< The number of packets that were successfully transmitted after more than one retransmission. This parameter is based on dot11MultipleRetryCount from [802.11-2012]. */ ULONG ssid_ACKFailureCount; /**< The number of expected ACKs that were never received. This parameter is based on dot11ACKFailureCount from [802.11-2012]. */ ULONG ssid_AggregatedPacketCount; /**< The number of aggregated packets that were transmitted. This applies only to 802.11n and 802.11ac. */ ULONG ssid_ErrorsSent; /**< The total number of outbound packets that could not be transmitted because of errors. */ ULONG ssid_ErrorsReceived; /**< The total number of inbound packets that contained errors preventing them from being delivered to a higher-layer protocol. */ ULONG ssid_UnicastPacketsSent; /**< The total number of inbound packets that contained errors preventing them from being delivered to a higher-layer protocol. */ ULONG ssid_UnicastPacketsReceived; /**< The total number of received packets, delivered by this layer to a higher layer, which were not addressed to a multicast or broadcast address at this layer. */ ULONG ssid_DiscardedPacketsSent; /**< The total number of outbound packets which were chosen to be discarded even though no errors had been detected to prevent their being transmitted. One possible reason for discarding such a packet could be to free up buffer space. */ ULONG ssid_DiscardedPacketsReceived; /**< The total number of inbound packets which were chosen to be discarded even though no errors had been detected to prevent their being delivered. One possible reason for discarding such a packet could be to free up buffer space. */ ULONG ssid_MulticastPacketsSent; /**< The total number of packets that higher-level protocols requested for transmission and which were addressed to a multicast address at this layer, including those that were discarded or not sent. */ ULONG ssid_MulticastPacketsReceived; /**< The total number of received packets, delivered by this layer to a higher layer, which were addressed to a multicast address at this layer. */ ULONG ssid_BroadcastPacketsSent; /**< The total number of packets that higher-level protocols requested for transmission and which were addressed to a broadcast address at this layer, including those that were discarded or not sent. */ ULONG ssid_BroadcastPacketsRecevied; /**< The total number of packets that higher-level protocols requested for transmission and which were addressed to a broadcast address at this layer, including those that were discarded or not sent. */ ULONG ssid_UnknownPacketsReceived; /**< The total number of packets received via the interface which were discarded because of an unknown or unsupported protocol. */ } wifi_ssidTrafficStats2_t; //for ssid only //Please do not edit the elements for this data structure typedef struct _wifi_neighbor_ap2 { //CHAR ap_Radio[64]; //The value MUST be the path name of a row in theDevice.WiFi.Radiotable. The Radio that detected the neighboring WiFi SSID. CHAR ap_SSID[64]; /**< The current service set identifier in use by the neighboring WiFi SSID. The value MAY be empty for hidden SSIDs. */ CHAR ap_BSSID[64]; /**< [MACAddress] The BSSID used for the neighboring WiFi SSID. */ CHAR ap_Mode[64]; /**< The mode the neighboring WiFi radio is operating in. Enumeration of: AdHoc, Infrastructure */ UINT ap_Channel; /**< The current radio channel used by the neighboring WiFi radio. */ INT ap_SignalStrength; /**< An indicator of radio signal strength (RSSI) of the neighboring WiFi radio measured indBm, as an average of the last 100 packets received. */ CHAR ap_SecurityModeEnabled[64]; /**< The type of encryption the neighboring WiFi SSID advertises. Enumeration of:None, WPA-WPA2 etc. */ CHAR ap_EncryptionMode[64]; /**< Comma-separated list of strings. The type of encryption the neighboring WiFi SSID advertises. Each list item is an enumeration of: TKIP, AES */ CHAR ap_OperatingFrequencyBand[16]; /**< Indicates the frequency band at which the radio this SSID instance is operating. Enumeration of:2.4GHz, 5GHz */ CHAR ap_SupportedStandards[64]; /**< Comma-separated list of strings. List items indicate which IEEE 802.11 standards thisResultinstance can support simultaneously, in the frequency band specified byOperatingFrequencyBand. Each list item is an enumeration of: */ CHAR ap_OperatingStandards[16]; /**< Comma-separated list of strings. Each list item MUST be a member of the list reported by theSupportedStandardsparameter. List items indicate which IEEE 802.11 standard that is detected for thisResult. */ CHAR ap_OperatingChannelBandwidth[16]; /**< Indicates the bandwidth at which the channel is operating. Enumeration of: */ UINT ap_BeaconPeriod; /**< Time interval (inms) between transmitting beacons. */ INT ap_Noise; /**< Indicator of average noise strength (indBm) received from the neighboring WiFi radio. */ CHAR ap_BasicDataTransferRates[256]; /**< Comma-separated list (maximum list length 256) of strings. Basic data transmit rates (in Mbps) for the SSID. For example, ifBasicDataTransferRatesis "1,2", this indicates that the SSID is operating with basic rates of 1 Mbps and 2 Mbps. */ CHAR ap_SupportedDataTransferRates[256]; /**< Comma-separated list (maximum list length 256) of strings. Data transmit rates (in Mbps) for unicast frames at which the SSID will permit a station to connect. For example, ifSupportedDataTransferRatesis "1,2,5.5", this indicates that the SSID will only permit connections at 1 Mbps, 2 Mbps and 5.5 Mbps. */ UINT ap_DTIMPeriod; /**< The number of beacon intervals that elapse between transmission of Beacon frames containing a TIM element whose DTIM count field is 0. This value is transmitted in the DTIM Period field of beacon frames. [802.11-2012] */ UINT ap_ChannelUtilization; /**< Indicates the fraction of the time AP senses that the channel is in use by the neighboring AP for transmissions. */ } wifi_neighbor_ap2_t; //COSA_DML_NEIGHTBOURING_WIFI_RESULT typedef struct _wifi_diag_ipping_setting { CHAR ipping_Interface[256]; /**< The value MUST be the path name of a row in the IP.Interface table. The IP-layer interface over which the test is to be performed. This identifies the source IP address to use when performing the test. Example: Device.IP.Interface.1. If an empty string is specified, the CPE MUST use the interface as directed by its routing policy (Forwarding table entries) to determine the appropriate interface. */ CHAR ipping_Host[256]; /**< Host name or address of the host to ping. In the case where Host is specified by name, and the name resolves to more than one address, it is up to the device implementation to choose which address to use. */ UINT ipping_NumberOfRepetitions; /**< Number of repetitions of the ping test to perform before reporting the results. */ UINT ipping_Timeout; /**< Timeout in milliseconds for the ping test. */ UINT ipping_DataBlockSize; /**< Size of the data block in bytes to be sent for each ping. */ UINT ipping_DSCP; /**< DiffServ codepoint to be used for the test packets. By default the CPE SHOULD set this value to zero. */ } wifi_diag_ipping_setting_t; typedef struct _wifi_diag_ipping_result { CHAR ipping_DiagnosticsState[64]; /**< Indicates availability of diagnostic data. Enumeration of: Complete, Error_CannotResolveHostName, Error_Internal, Error_Other */ UINT ipping_SuccessCount; /**< Result parameter indicating the number of successful pings (those in which a successful response was received prior to the timeout) in the most recent ping test. */ UINT ipping_FailureCount; /**< Result parameter indicating the number of failed pings in the most recent ping test. */ UINT ipping_AverageResponseTime; /**< Result parameter indicating the average response time in milliseconds over all repetitions with successful responses of the most recent ping test. If there were no successful responses, this value MUST be zero. */ UINT ipping_MinimumResponseTime; /**< Result parameter indicating the minimum response time in milliseconds over all repetitions with successful responses of the most recent ping test. If there were no successful responses, this value MUST be zero. */ UINT ipping_MaximumResponseTime; /**< Result parameter indicating the maximum response time in milliseconds over all repetitions with successful responses of the most recent ping test. If there were no successful responses, this value MUST be zero. */ } wifi_diag_ipping_result_t; //----------------ENVIRONMENT------------------------------------------- typedef struct _wifi_channelStats { INT ch_number; /**< each channel is only 20MHz bandwidth */ BOOL ch_in_pool; /**< If ch_in_pool is false, driver do not need to scan this channel */ INT ch_noise; /**< this is used to return the average noise floor in dbm */ BOOL ch_radar_noise; /**< if ch_number is in DFS channel, this is used to return if radar signal is present on DFS channel (5G only) */ INT ch_max_80211_rssi; /**< max RSSI from the neighbor AP in dbm on this channel. */ INT ch_non_80211_noise; /**< average non 802.11 noise */ INT ch_utilization; /**< this is used to return the 802.11 utilization in percent */ ULLONG ch_utilization_total; /**< Total time radio spent receiveing or transmitting on that channel (ch_utilization_active) */ ULLONG ch_utilization_busy; /**< Time radio detected that channel was busy (Busy = Rx + Tx + Interference) */ ULLONG ch_utilization_busy_tx; /**< Time time radio spent transmitting on channel */ ULLONG ch_utilization_busy_rx; /**< Time radio spent receiving on channel (Rx = Rx_obss + Rx_self + Rx_errr (self and obss errors) */ ULLONG ch_utilization_busy_self; /**< Time radio spend receiving on channel from its own connected clients */ ULLONG ch_utilization_busy_ext; /**< Time radio detected that extended channel was busy (40MHz extention channel busy */ } wifi_channelStats_t; //> Deprecated: used for old RDKB code. typedef struct _wifi_device { UCHAR wifi_devMacAddress[6]; CHAR wifi_devIPAddress[64]; BOOL wifi_devAssociatedDeviceAuthentiationState; INT wifi_devSignalStrength; INT wifi_devTxRate; INT wifi_devRxRate; } wifi_device_t; //<< //Please do not edit the elements for this data structure /** * @brief Client information * * Structure which holds the device information associated with a particular wifi access point. */ typedef struct _wifi_associated_dev { UCHAR cli_MACAddress[6]; /**< The MAC address of an associated device. */ CHAR cli_IPAddress[64]; /**< IP of the associated device */ BOOL cli_AuthenticationState; /**< Whether an associated device has authenticated (true) or not (false). */ UINT cli_LastDataDownlinkRate; /**< The data transmit rate in kbps that was most recently used for transmission from the access point to the associated device. */ UINT cli_LastDataUplinkRate; /**< The data transmit rate in kbps that was most recently used for transmission from the associated device to the access point. */ INT cli_SignalStrength; /**< An indicator of radio signal strength of the uplink from the associated device to the access point, measured in dBm, as an average of the last 100 packets received from the device. */ UINT cli_Retransmissions; /**< The number of packets that had to be re-transmitted, from the last 100 packets sent to the associated device. Multiple re-transmissions of the same packet count as one. */ BOOL cli_Active; /**< boolean - Whether or not this node is currently present in the WiFi AccessPoint network. */ CHAR cli_OperatingStandard[64]; /**< Radio standard the associated Wi-Fi client device is operating under. Enumeration of: */ CHAR cli_OperatingChannelBandwidth[64]; /**< The operating channel bandwidth of the associated device. The channel bandwidth (applicable to 802.11n and 802.11ac specifications only). Enumeration of: */ INT cli_SNR; /**< A signal-to-noise ratio (SNR) compares the level of the Wi-Fi signal to the level of background noise. Sources of noise can include microwave ovens, cordless phone, bluetooth devices, wireless video cameras, wireless game controllers, fluorescent lights and more. It is measured in decibels (dB). */ CHAR cli_InterferenceSources[64]; /**< Wi-Fi operates in two frequency ranges (2.4 Ghz and 5 Ghz) which may become crowded other radio products which operate in the same ranges. This parameter reports the probable interference sources that this Wi-Fi access point may be observing. The value of this parameter is a comma seperated list of the following possible sources: eg: MicrowaveOven,CordlessPhone,BluetoothDevices,FluorescentLights,ContinuousWaves,Others */ ULONG cli_DataFramesSentAck; /**< The DataFramesSentAck parameter indicates the total number of MSDU frames marked as duplicates and non duplicates acknowledged. The value of this counter may be reset to zero when the CPE is rebooted. Refer section A.2.3.14 of CableLabs Wi-Fi MGMT Specification. */ ULONG cli_DataFramesSentNoAck; /**< The DataFramesSentNoAck parameter indicates the total number of MSDU frames retransmitted out of the interface (i.e., marked as duplicate and non-duplicate) and not acknowledged, but does not exclude those defined in the DataFramesLost parameter. The value of this counter may be reset to zero when the CPE is rebooted. Refer section A.2.3.14 of CableLabs Wi-Fi MGMT Specification. */ ULONG cli_BytesSent; /**< The total number of bytes transmitted to the client device, including framing characters. */ ULONG cli_BytesReceived; /**< The total number of bytes received from the client device, including framing characters. */ INT cli_RSSI; /**< The Received Signal Strength Indicator, RSSI, parameter is the energy observed at the antenna receiver for transmissions from the device averaged over past 100 packets recevied from the device. */ INT cli_MinRSSI; /**< The Minimum Received Signal Strength Indicator, RSSI, parameter is the minimum energy observed at the antenna receiver for past transmissions (100 packets). */ INT cli_MaxRSSI; /**< The Maximum Received Signal Strength Indicator, RSSI, parameter is the energy observed at the antenna receiver for past transmissions (100 packets). */ UINT cli_Disassociations; /**< This parameter represents the total number of client disassociations. Reset the parameter evey 24hrs or reboot */ UINT cli_AuthenticationFailures; /**< This parameter indicates the total number of authentication failures. Reset the parameter evey 24hrs or reboot */ } wifi_associated_dev_t; //~COSA_DML_WIFI_AP_ASSOC_DEVICE typedef struct _wifi_associated_dev2 { mac_address_t cli_MACAddress; /**< The MAC address of an associated device. */ CHAR cli_IPAddress[64]; /**< IP of the associated device */ BOOL cli_AuthenticationState; /**< Whether an associated device has authenticated (true) or not (false). */ UINT cli_LastDataDownlinkRate; /**< The data transmit rate in kbps that was most recently used for transmission from the access point to the associated device. */ UINT cli_LastDataUplinkRate; /**< The data transmit rate in kbps that was most recently used for transmission from the associated device to the access point. */ INT cli_SignalStrength; /**< An indicator of radio signal strength of the uplink from the associated device to the access point, measured in dBm, as an average of the last 100 packets received from the device. */ UINT cli_Retransmissions; /**< The number of packets that had to be re-transmitted, from the last 100 packets sent to the associated device. Multiple re-transmissions of the same packet count as one. */ BOOL cli_Active; /**< boolean - Whether or not this node is currently present in the WiFi AccessPoint network. */ CHAR cli_OperatingStandard[64]; /**< Radio standard the associated Wi-Fi client device is operating under. Enumeration of: */ CHAR cli_OperatingChannelBandwidth[64]; /**< The operating channel bandwidth of the associated device. The channel bandwidth (applicable to 802.11n and 802.11ac specifications only). Enumeration of: */ INT cli_SNR; /**< A signal-to-noise ratio (SNR) compares the level of the Wi-Fi signal to the level of background noise. Sources of noise can include microwave ovens, cordless phone, bluetooth devices, wireless video cameras, wireless game controllers, fluorescent lights and more. It is measured in decibels (dB). */ CHAR cli_InterferenceSources[64]; /**< Wi-Fi operates in two frequency ranges (2.4 Ghz and 5 Ghz) which may become crowded other radio products which operate in the same ranges. This parameter reports the probable interference sources that this Wi-Fi access point may be observing. The value of this parameter is a comma seperated list of the following possible sources: eg: MicrowaveOven,CordlessPhone,BluetoothDevices,FluorescentLights,ContinuousWaves,Others */ ULONG cli_DataFramesSentAck; /**< The DataFramesSentAck parameter indicates the total number of MSDU frames marked as duplicates and non duplicates acknowledged. The value of this counter may be reset to zero when the CPE is rebooted. Refer section A.2.3.14 of CableLabs Wi-Fi MGMT Specification. */ ULONG cli_DataFramesSentNoAck; /**< The DataFramesSentNoAck parameter indicates the total number of MSDU frames retransmitted out of the interface (i.e., marked as duplicate and non-duplicate) and not acknowledged, but does not exclude those defined in the DataFramesLost parameter. The value of this counter may be reset to zero when the CPE is rebooted. Refer section A.2.3.14 of CableLabs Wi-Fi MGMT Specification. */ ULONG cli_BytesSent; /**< The total number of bytes transmitted to the client device, including framing characters. */ ULONG cli_BytesReceived; /**< The total number of bytes received from the client device, including framing characters. */ INT cli_RSSI; /**< The Received Signal Strength Indicator, RSSI, parameter is the energy observed at the antenna receiver for transmissions from the device averaged over past 100 packets recevied from the device. */ INT cli_MinRSSI; /**< The Minimum Received Signal Strength Indicator, RSSI, parameter is the minimum energy observed at the antenna receiver for past transmissions (100 packets). */ INT cli_MaxRSSI; /**< The Maximum Received Signal Strength Indicator, RSSI, parameter is the energy observed at the antenna receiver for past transmissions (100 packets). */ UINT cli_Disassociations; /**< This parameter represents the total number of client disassociations. Reset the parameter evey 24hrs or reboot */ UINT cli_AuthenticationFailures; /**< This parameter indicates the total number of authentication failures. Reset the parameter evey 24hrs or reboot */ ULLONG cli_Associations; /**< Stats handle used to determine reconnects; increases for every association (stat delta calcualtion) */ } wifi_associated_dev2_t; /* 802.11ax HAL structure definitions */ #define MAX_RU_ALLOCATIONS 74 #define MAX_BSR 32 typedef enum { wifi_twt_agreement_type_individual, wifi_twt_agreement_type_broadcast, } wifi_twt_agreement_type_t; typedef struct { BOOL implicit; BOOL announced; BOOL trigger_enabled; } wifi_twt_operation_t; typedef struct { UINT wake_time; UINT wake_interval; UINT min_wake_duration; UINT channel; } wifi_twt_individual_params_t; typedef struct { UINT traget_beacon; UINT listen_interval; } wifi_twt_broadcast_params_t; typedef struct { wifi_twt_agreement_type_t agreement; wifi_twt_operation_t operation; union { wifi_twt_individual_params_t individual; wifi_twt_broadcast_params_t broadcast; } patams; } wifi_twt_params_t; typedef struct { wifi_twt_params_t twt_params; } wifi_80211ax_params_t; typedef enum { wifi_guard_interval_400, wifi_guard_interval_800, wifi_guard_interval_1600, wifi_guard_interval_3200, wifi_guard_interval_auto, } wifi_guard_interval_t; typedef enum { wifi_dl_data_ack_immediate, wifi_dl_data_block_ack_immediate, wifi_dl_data_block_ack_deferred, } wifi_dl_data_ack_type_t; typedef enum { WIFI_DL_MU_TYPE_NONE, WIFI_DL_MU_TYPE_HE, WIFI_DL_MU_TYPE_MIMO, WIFI_DL_MU_TYPE_HE_MIMO } wifi_dl_mu_type_t; typedef enum { WIFI_UL_MU_TYPE_NONE, WIFI_UL_MU_TYPE_HE, } wifi_ul_mu_type_t; typedef enum { WIFI_RU_TYPE_26, WIFI_RU_TYPE_52, WIFI_RU_TYPE_106, WIFI_RU_TYPE_242, WIFI_RU_TYPE_484, WIFI_RU_TYPE_996, WIFI_RU_TYPE_1024, } wifi_ru_type_t; typedef enum { wifi_access_category_background, wifi_access_category_best_effort, wifi_access_category_video, wifi_access_category_voice, } wifi_access_category_t; typedef struct { wifi_access_category_t access_category; UINT queue_size; } wifi_bsr_t; typedef struct { UCHAR subchannels; wifi_ru_type_t type; } wifi_ru_allocation_t; typedef struct { wifi_dl_mu_type_t cli_DownlinkMuType; wifi_bsr_t cli_BufferStatus[MAX_BSR]; UCHAR cli_AllocatedDownlinkRuNum; wifi_ru_allocation_t cli_DownlinkRuAllocations[MAX_RU_ALLOCATIONS]; } wifi_dl_mu_stats_t; typedef struct { wifi_ul_mu_type_t cli_UpinkMuType; UCHAR cli_ChannelStateInformation; wifi_bsr_t cli_BufferStatus[MAX_BSR]; UCHAR cli_AllocatedUplinkRuNum; wifi_ru_allocation_t cli_UplinkRuAllocations[MAX_RU_ALLOCATIONS]; } wifi_ul_mu_stats_t; #define MAX_NR 8 #define MAX_NC 4 #define MAX_SUB_CARRIERS 256 #define MAX_PILOTS 26 /* RSSI in each of received streams of the received frame */ typedef INT wifi_streams_rssi_t [MAX_NR]; /* CSI data for each subcarrier over Nc and Nr */ typedef UINT wifi_carrier_data_t [MAX_NR][MAX_NC]; /* CSI data over 80MHz BW */ typedef wifi_carrier_data_t wifi_csi_matrix_t [MAX_SUB_CARRIERS]; typedef UCHAR wifi_evm_data_t [MAX_NC][MAX_NR]; typedef wifi_evm_data_t wifi_evm_matrix_t[MAX_PILOTS]; /** * @brief This structure hold the information about the wifi interface. */ typedef struct _wifi_frame_info { UCHAR bw_mode; /* Bit 0-3: 0:20MHz; 1:40MHz; 2:80MHz; 3:160MHz */ /* Bit 4: 80+80MHz */ /* Bit 4-7: 0:11n; 1:11ac */ UCHAR mcs; /* Encoded as 11ac numbering */ UCHAR Nr; /* Number of antennas used to receive the frame */ UCHAR Nc; /* Number of streams used to transmit the frame */ wifi_streams_rssi_t nr_rssi; /* RSSI on each of Nr */ USHORT valid_mask; /* Bit mask that determines which regions of CSI capture (tones) are valid. One bit represents 20MHz chunk. */ USHORT phy_bw; /* VAP BW at the time of capture, indicated as 20, 40, 80, 160 */ USHORT cap_bw; /* Frame BW at the time of capture */ UINT num_sc; /* Number of subcarriers in the payload so that information can be used in conjunction with the number of streams to fully decode valid regions */ UCHAR decimation; /* Value to indicate degree to which CSI matrix is decimated in terms of number of subcarriers present.*/ UINT channel; /* Primary Channel of received frame */ ULLONG time_stamp; /* PHY timestamp of CSI capture with at minimum millisecond */ /* resolution. Ideally this can be resolved to a standard epoch */ /* format with millisecond resolution. */ } wifi_frame_info_t; /** * @brief This structure hold the information about the wifi interface. */ typedef struct _wifi_csi_data { wifi_frame_info_t frame_info; /* as defined above */ wifi_csi_matrix_t csi_matrix; /* The NC value representing the number of non-zero columns in the H matrix is equal to the number of spatial streams in the packet. The NR value representing the number of rows in the H matrix is equal to the number of antennas at the receiver. Irrespective of the NC and NR values, the output H matrix is always of size 4x4. For example, if the frame uses 2 spatial streams and the receiver has 3 antennas, NC=2, NR=3. However, the H matrix will be of size 4x4 with a 3x2 sub-matrix with non-zero values. Rest of the values of the matrix will be zero. */ wifi_evm_matrix_t evm_matrix; /* Similar scheme to the CSI matrix, Nc represents the number of non-zero columns and Nr represents the number of nonzero rows. There are 16 elements to accommodate the full number of pilots in a 160 MHz capture. Each element is an EVM value for a pilot expressed in dB. */ } wifi_csi_data_t; /** * @brief This structure hold the information about the wifi interface. */ typedef struct _wifi_associated_dev3 { mac_address_t cli_MACAddress; /**< The MAC address of an associated device. */ CHAR cli_IPAddress[64]; /**< IP of the associated device (deprecated, keep it empty) */ BOOL cli_AuthenticationState; /**< Whether an associated device has authenticated (true) or not (false). */ UINT cli_LastDataDownlinkRate; /**< The median PHY rate in Mbps of the most recent 16 unicast data frame transmissions from the access point to the associated device. */ UINT cli_LastDataUplinkRate; /**< The median PHY rate in Mbps of the most recent 16 unicast data frame transmissions from the associated device to the access point. */ INT cli_SignalStrength; /**< An indicator of radio signal strength of the uplink from the associated device to the access point, measured in dBm, as an average of the last 100 packets received from the device. */ UINT cli_Retransmissions; /**< The number of packets that had to be re-transmitted, from the last 100 packets sent to the associated device. Multiple re-transmissions of the same packet count as one. */ BOOL cli_Active; /**< boolean - Whether or not this node is currently present in the WiFi AccessPoint network. */ CHAR cli_OperatingStandard[64]; /**< Radio standard the associated Wi-Fi client device is operating under. Enumeration of: */ CHAR cli_OperatingChannelBandwidth[64]; /**< The operating channel bandwidth of the associated device. The channel bandwidth (applicable to 802.11n and 802.11ac specifications only). Enumeration of: */ INT cli_SNR; /**< A signal-to-noise ratio (SNR) compares the level of the Wi-Fi signal to the level of background noise. Sources of noise can include microwave ovens, cordless phone, bluetooth devices, wireless video cameras, wireless game controllers, fluorescent lights and more. It is measured in decibels (dB). */ CHAR cli_InterferenceSources[64]; /**< Wi-Fi operates in two frequency ranges (2.4 Ghz and 5 Ghz) which may become crowded other radio products which operate in the same ranges. This parameter reports the probable interference sources that this Wi-Fi access point may be observing. The value of this parameter is a comma seperated list of the following possible sources: eg: MicrowaveOven,CordlessPhone,BluetoothDevices,FluorescentLights,ContinuousWaves,Others */ ULONG cli_DataFramesSentAck; /**< The DataFramesSentAck parameter indicates the total number of MSDU frames marked as duplicates and non duplicates acknowledged. The value of this counter may be reset to zero when the CPE is rebooted. Refer section A.2.3.14 of CableLabs Wi-Fi MGMT Specification. */ ULONG cli_DataFramesSentNoAck; /**< The DataFramesSentNoAck parameter indicates the total number of MSDU frames retransmitted out of the interface (i.e., marked as duplicate and non-duplicate) and not acknowledged, but does not exclude those defined in the DataFramesLost parameter. The value of this counter may be reset to zero when the CPE is rebooted. Refer section A.2.3.14 of CableLabs Wi-Fi MGMT Specification. */ ULONG cli_BytesSent; /**< The total number of bytes transmitted to the client device, including framing characters. */ ULONG cli_BytesReceived; /**< The total number of bytes received from the client device, including framing characters. */ INT cli_RSSI; /**< The Received Signal Strength Indicator, RSSI, parameter is the energy observed at the antenna receiver for transmissions from the device averaged over past 100 packets recevied from the device. */ INT cli_MinRSSI; /**< The Minimum Received Signal Strength Indicator, RSSI, parameter is the minimum energy observed at the antenna receiver for past transmissions (100 packets). */ INT cli_MaxRSSI; /**< The Maximum Received Signal Strength Indicator, RSSI, parameter is the energy observed at the antenna receiver for past transmissions (100 packets). */ UINT cli_Disassociations; /**< This parameter represents the total number of client disassociations. Reset the parameter evey 24hrs or reboot */ UINT cli_AuthenticationFailures; /**< This parameter indicates the total number of authentication failures. Reset the parameter evey 24hrs or reboot */ ULLONG cli_Associations; /**< Stats handle used to determine reconnects; increases for every association (stat delta calcualtion) */ ULONG cli_PacketsSent; /**< The total number of packets transmitted to the Associated Device. */ ULONG cli_PacketsReceived; /**< The total number of packets received from the Associated Device. */ ULONG cli_ErrorsSent; /**< The total number of outbound packets that could not be transmitted because of errors. These might be due to the number of retransmissions exceeding the retry limit, or from other causes. */ ULONG cli_RetransCount; /**< The total number of transmitted packets which were retransmissions for each client on the vAP. Two retransmissions of the same packet results in this counter incrementing by two. Three retransmissions of the same packet results in this counter incrementing by three.... */ ULONG cli_FailedRetransCount; /**< The number of packets that were not transmitted successfully due to the number of retransmission attempts exceeding an 802.11 retry limit. */ ULONG cli_RetryCount; /**< The number of packets that were successfully transmitted after one or more retransmissions */ ULONG cli_MultipleRetryCount; /**< The number of packets that were successfully transmitted after more than one retransmission. */ UINT cli_MaxDownlinkRate; /**< The Max data transmit rate in Mbps for the access point to the associated device. */ UINT cli_MaxUplinkRate; /**< The Max data transmit rate in Mbps for the associated device to the access point. */ wifi_ul_mu_stats_t cli_DownlinkMuStats; wifi_dl_mu_stats_t cli_UplinkMuStats; wifi_twt_params_t cli_TwtParams; /* To facilitate retrieval of CSI data for specific associated client, an existing RDK-B Wi-Fi HAL function is being extended. In current implementation wifi_getApAssociatedDeviceDiagnosticResult3 retrieves variety of statistics and state specific information for associated clients. The wifi_associated_dev3_t data structure is filled by native WLAN drivers for each associated client as and when the function is called by RDK-B application/process. A new component structure wifi_csi_data_t is being defined that is part of wifi_associated_dev3_t structure and needs to be allocated and filled for specific client or list of clients when wifi_getApAssociatedDeviceDiagnosticResult3 API is called by RDK-B application/process. In cases when application needs CSI data, the RDK-B application will call INT wifi_getApAssociatedDeviceDiagnosticResult3(INT apIndex, wifi_associated_dev3_t **associated_dev_array, UINT *output_array_size) by allocating the associated_dev_array memory for output_array_size number of client devices. In other words output_array_size will specify the number of client devices in the array for which CSI data needs to filled by driver. The cli_MACAddress will specify the client devices in each of wifi_associated_dev3_t. Wi-Fi HAL implementation in such case MUST allocate memory for cli_CSIData fill in required fields. The called in such cases is reposnsible for deallocation of memory. The wifi_csi_data_t is defined above */ wifi_csi_data_t *cli_CsiData; } wifi_associated_dev3_t; /** * @brief RADIUS Server information. * * Structure which holds the the RADIUS server settings. */ typedef struct _wifi_radius_setting_t { INT RadiusServerRetries; /**< Number of retries for Radius requests. */ INT RadiusServerRequestTimeout; /**< Radius request timeout in seconds after which the request must be retransmitted for the # of retries available. */ INT PMKLifetime; /**< Default time in seconds after which a Wi-Fi client is forced to ReAuthenticate (def 8 hrs). */ BOOL PMKCaching; /**< Enable or disable caching of PMK. */ INT PMKCacheInterval; /**< Time interval in seconds after which the PMKSA (Pairwise Master Key Security Association) cache is purged (def 5 minutes). */ INT MaxAuthenticationAttempts; /**< Indicates the # of time, a client can attempt to login with incorrect credentials. When this limit is reached, the client is blacklisted and not allowed to attempt loging into the network. Settings this parameter to 0 (zero) disables the blacklisting feature. */ INT BlacklistTableTimeout; /**< Time interval in seconds for which a client will continue to be blacklisted once it is marked so. */ INT IdentityRequestRetryInterval; /**< Time Interval in seconds between identity requests retries. A value of 0 (zero) disables it. */ INT QuietPeriodAfterFailedAuthentication; /**< The enforced quiet period (time interval) in seconds following failed authentication. A value of 0 (zero) disables it. */ //UCHAR RadiusSecret[64]; //> Deprecated: used for old RDKB code. /** Deprecated: used for old RDKB code. */ INT wifi_getSSIDTrafficStats(INT ssidIndex, wifi_ssidTrafficStats_t *output_struct); //Tr181 /** Deprecated: used for old RDKB code. */ INT wifi_getBasicTrafficStats(INT apIndex, wifi_basicTrafficStats_t *output_struct); //!< Outputs basic traffic stats per AP /** Deprecated: used for old RDKB code. */ INT wifi_getWifiTrafficStats(INT apIndex, wifi_trafficStats_t *output_struct); //!< Outputs more detailed traffic stats per AP /** Deprecated: used for old RDKB code. */ INT wifi_getNeighboringWiFiDiagnosticResult(wifi_neighbor_ap_t **neighbor_ap_array, UINT *output_array_size); //Tr181 /** Deprecated: used for old RDKB code. */ INT wifi_getAllAssociatedDeviceDetail(INT apIndex, ULONG *output_ulong, wifi_device_t **output_struct); //RDKB //<< //>> -------------------- wifi_ap_hal ----------------------------------- //--------------------------------------------------------------------------------------------------- // // Additional Wifi radio level APIs used for RDKB Access Point devices // //--------------------------------------------------------------------------------------------------- /* wifi_getBandSteeringCapability() function */ /** * @brief To get Band Steering Capability. * * Device.WiFi.X_RDKCENTRAL-COM_BandSteering object * Device.WiFi.X_RDKCENTRAL-COM_BandSteering.Capability bool r/o * * @param[out] support Band Steering Capability support, to be returned * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ //Device.WiFi.X_RDKCENTRAL-COM_BandSteering object //Device.WiFi.X_RDKCENTRAL-COM_BandSteering.Capability bool r/o INT wifi_getBandSteeringCapability(BOOL *support); /* wifi_getBandSteeringEnable() function */ /** * @brief To get Band Steering enable status. * * Device.WiFi.X_RDKCENTRAL-COM_BandSteering.Enable bool r/w * * @param[out] enable Band Steering enable status, to be returned * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_getBandSteeringEnable(BOOL *enable); /* wifi_setBandSteeringEnable() function */ /** * @brief To turn on/off Band steering. * * @param[in] enable Band Steering enable status * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_setBandSteeringEnable(BOOL enable); /* wifi_getBandSteeringApGroup() function */ /** * @brief To get Band Steering Access Point group. * * @param[out] output_ApGroup Band Steering Access point group * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_getBandSteeringApGroup(char *output_ApGroup); /* wifi_setBandSteeringApGroup() function */ /** * @brief To set Band Steering Access Point group. * * @param[in] ApGroup - Band Steering Access Point group * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ //To set Band Steering AP group //ApGroup contains AP index(start from 1) pair array, in following format "$index_2.4G,$index_5G;$index_2.4G,$index_5G" //Example "1,2;3,4;7,8" for Private, XH, LnF pairs. //ApGroup have to contain at least one AP pair, such as "1,2" INT wifi_setBandSteeringApGroup(char *ApGroup); /* wifi_getRadioBandUtilization() function */ /** * @brief To read the radio band utilization. * * @param[in] radioIndex Radio Index * @param[out] output_percentage Radio band utilization percentage, to be returned * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_getRadioBandUtilization (INT radioIndex, INT *output_percentage); /* wifi_getApAssociatedDevice() function */ /** * @brief Gets the ApAssociatedDevice list for client MAC addresses * * @param[in] apIndex Access Point index * @param[out] output_buf List for client MAC, to be returned * @param[out] output_buf_size Buffer length * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * */ INT wifi_getApAssociatedDevice(INT ap_index, CHAR *output_buf, INT output_buf_size); /* wifi_getApAssociatedDevice() function */ /** * @brief Gets the RSSI value associated with the access point. * * @param[in] apIndex Access Point index * @param[out] MAC Client MAC in upcase format * @param[out] output_RSSI RSSI is in dbm * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * */ INT wifi_getApDeviceRSSI(INT ap_index, CHAR *MAC, INT *output_RSSI); /* wifi_getApAssociatedDevice() function */ /** * @brief Gets the ApAssociatedDevice Rx Rate * * @param[in] apIndex Access Point index * @param[in] MAC Client MAC in upcase format * @param[ut] output_RxMb Rx Rate in Mb * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * */ INT wifi_getApDeviceRxrate (INT ap_index, CHAR *MAC, INT *output_RxMb); /* wifi_getApAssociatedDevice() function */ /** * @brief Gets the ApAssociatedDevice Tx Rate * * @param[in] apIndex Access Point index * @param[in] MAC Client MAC in upcase format * @param[out] output_TxMb Tx Rate in Mb * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * */ INT wifi_getApDeviceTxrate (INT ap_index, CHAR *MAC, INT *output_TxMb); /* wifi_getBandSteeringBandUtilizationThreshold() function */ /** * @brief To set and read the band steering BandUtilizationThreshold parameters. * * Device.WiFi.X_RDKCENTRAL-COM_BandSteering.BandSetting.{i}.UtilizationThreshold int r/w * * @param[in] radioIndex Radio Index * @param[out] pBuThreshold Steering bane utilization threshold, to be returned * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_getBandSteeringBandUtilizationThreshold (INT radioIndex, INT *pBuThreshold); /* wifi_setBandSteeringBandUtilizationThreshold() function */ /** * @brief To set the band steering BandUtilizationThreshold parameters. * * Device.WiFi.X_RDKCENTRAL-COM_BandSteering.BandSetting.{i}.UtilizationThreshold int r/w * * @param[in] radioIndex Radio Index * @param[in] buThreshold Steering bane utilization threshold * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_setBandSteeringBandUtilizationThreshold (INT radioIndex, INT buThreshold); /* wifi_getBandSteeringRSSIThreshold() function */ /** * @brief To read the band steering RSSIThreshold parameters. * * Device.WiFi.X_RDKCENTRAL-COM_BandSteering.BandSetting.{i}.RSSIThreshold int r/w * * @param[in] radioIndex Radio Index * @param[in] pRssiThreshold Band steering RSSIThreshold value, to be returned * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_getBandSteeringRSSIThreshold (INT radioIndex, INT *pRssiThreshold); /* wifi_setBandSteeringRSSIThreshold() function */ /** * @brief To set the band steering RSSIThreshold parameters. * * For 2.4G, the expectation is if the 2G rssi is below the set value steer to 2G * For 5G, if the set value is greater than the set threshold value then steer to 5 * Device.WiFi.X_RDKCENTRAL-COM_BandSteering.BandSetting.{i}.RSSIThreshold int r/w * * @param[in] radioIndex Radio Index * @param[in] rssiThreshold Band steering RSSIThreshold value * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_setBandSteeringRSSIThreshold (INT radioIndex, INT rssiThreshold); /* wifi_getBandSteeringPhyRateThreshold() function */ /** * @brief To read the band steering physical modulation rate threshold parameters. * * Device.WiFi.X_RDKCENTRAL-COM_BandSteering.BandSetting.{i}.PhyRateThreshold int r/w * * @param[in] radioIndex Radio Index * @param[out] pPrThreshold Physical modulation rate threshold value, to be returned * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_getBandSteeringPhyRateThreshold (INT radioIndex, INT *pPrThreshold); //If chip is not support, return -1 /* wifi_setBandSteeringPhyRateThreshold() function */ /** * @brief To set the band steering physical modulation rate threshold parameters. * * Device.WiFi.X_RDKCENTRAL-COM_BandSteering.BandSetting.{i}.PhyRateThreshold int r/w * * @param[in] radioIndex Radio Index * @param[in] prThreshold Physical modulation rate threshold value * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_setBandSteeringPhyRateThreshold (INT radioIndex, INT prThreshold); //If chip is not support, return -1 /* wifi_getBandSteeringOverloadInactiveTime() function */ /** * @brief To read the inactivity time (in seconds) for steering under overload condition * * Device.WiFi.X_RDKCENTRAL-COM_BandSteering.BandSetting.{i}.OverloadInactiveTime int r/w * * @param[in] radioIndex Radio Index * @param[out] overloadInactiveTime inactivity time (in seconds) for steering under overload condition * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_getBandSteeringOverloadInactiveTime (INT radioIndex, INT *overloadInactiveTime); //If chip is not support, return -1 /* wifi_setBandSteeringOverloadInactiveTime() function */ /** * @brief To set the inactivity time (in seconds) for steering under overload condition. * * Device.WiFi.X_RDKCENTRAL-COM_BandSteering.BandSetting.{i}.OverloadInactiveTime int r/w * * @param[in] radioIndex Radio Index * @param[in] overloadInactiveTime Inactivity time (in seconds) for steering under overload condition * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_setBandSteeringOverloadInactiveTime (INT radioIndex, INT overloadInactiveTime); //If chip is not support, return -1 /* wifi_getBandSteeringIdleInactiveTime() function */ /** * @brief To read the inactivity time (in seconds) for steering under Idle condition. * * Device.WiFi.X_RDKCENTRAL-COM_BandSteering.BandSetting.{i}.IdleInactiveTime int r/w * * @param[in] radioIndex Radio Index * @param[out] idleInactiveTime Inactivity time (in seconds) for steering under Idle condition * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_getBandSteeringIdleInactiveTime (INT radioIndex, INT *idleInactiveTime); //If chip is not support, return -1 /* wifi_getBandSteeringIdleInactiveTime() function */ /** * @brief To set the inactivity time (in seconds) for steering under Idle condition. * * Device.WiFi.X_RDKCENTRAL-COM_BandSteering.BandSetting.{i}.IdleInactiveTime int r/w * * @param[in] radioIndex Radio Index * @param[in] idleInactiveTime Inactivity time (in seconds) for steering under Idle condition * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_setBandSteeringIdleInactiveTime (INT radioIndex, INT idleInactiveTime); //If chip is not support, return -1 /* wifi_getBandSteeringLog() function */ /** * @brief To get the band steering log. * * If no steering or record_index is out of boundary, return -1. * Device.WiFi.X_RDKCENTRAL-COM_BandSteering.History string r/o * * @param[in] record_index Record index * @param[out] pSteeringTime Returns the UTC time in seconds * @param[in] pClientMAC pClientMAC is pre allocated as 64bytes * @param[in] pSourceSSIDIndex Source SSID index * @param[in] pDestSSIDIndex Destination SSID index * @param[out] pSteeringReason Returns the predefined steering trigger reason * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ //Device.WiFi.X_RDKCENTRAL-COM_BandSteering.History string r/o INT wifi_getBandSteeringLog(INT record_index, ULONG *pSteeringTime, CHAR *pClientMAC, INT *pSourceSSIDIndex, INT *pDestSSIDIndex, INT *pSteeringReason); /* wifi_factoryResetAP() function */ /** * @brief Restore Access point paramters to default without change other AP nor Radio parameters (No need to reboot wifi) * * @param[in] apIndex Access Point index * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_factoryResetAP(int apIndex); /* wifi_setRadioCtsProtectionEnable() function */ /** * @brief Enables CTS protection for the radio used by this Access Point. * * @param[in] apIndex Access Point index * @param[in] enable CTS protection enable value * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_setRadioCtsProtectionEnable(INT apIndex, BOOL enable); //P3 /* wifi_setRadioObssCoexistenceEnable() function */ /** * @brief Enables OBSS Coexistence - fall back to 20MHz if necessary for the radio used by this AP. * * @param[in] apIndex Access Point index * @param[in] enable OBSS Coexistence enable value * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_setRadioObssCoexistenceEnable(INT apIndex, BOOL enable); /* wifi_setRadioFragmentationThreshold() function */ /** * @brief Sets the fragmentation threshold in bytes for the radio used by this Access Point. * * @param[in] apIndex Access Point index * @param[in] threshold Fragmentation Threshold value * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_setRadioFragmentationThreshold(INT apIndex, UINT threshold); //P3 /* wifi_setRadioSTBCEnable() function */ /** * @brief Enable STBC mode in the hardware. * 0 == not enabled, 1 == enabled. * * @param[in] radioIndex Radio index * @param[in] STBC_Enable STBC mode enable value * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_setRadioSTBCEnable(INT radioIndex, BOOL STBC_Enable); /* wifi_getRadioAMSDUEnable() function */ /** * @brief Outputs A-MSDU enable status, 0 == not enabled, 1 == enabled. * * @param[in] radioIndex Radio index * @param[out] output_bool A-MSDU enable status, to be returned * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_getRadioAMSDUEnable(INT radioIndex, BOOL *output_bool); /* wifi_setRadioAMSDUEnable() function */ /** * @brief Enables A-MSDU in the hardware, 0 == not enabled, 1 == enabled. * * @param[in] radioIndex Radio index * @param[out] amsduEnable A-MSDU enable status value * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_setRadioAMSDUEnable(INT radioIndex, BOOL amsduEnable); /* wifi_getRadioTxChainMask() function */ /** * @brief Outputs the number of Tx streams. * * @param[in] radioIndex Radio index * @param[out] output_int Number of Tx streams, to be returned * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_getRadioTxChainMask(INT radioIndex, INT *output_int); //P2 /* wifi_setRadioTxChainMask() function */ /** * @brief Sets the number of Tx streams to an environment variable. * * @param[in] radioIndex Radio index * @param[in] numStreams Number of Tx streams * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_setRadioTxChainMask(INT radioIndex, INT numStreams); //P2 /* wifi_getRadioRxChainMask() function */ /** * @brief Outputs the number of Rx streams. * * @param[in] radioIndex Radio index * @param[out] output_int Number of Rx streams, to be returned * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_getRadioRxChainMask(INT radioIndex, INT *output_int); //P2 // outputs the number of Rx streams /* wifi_setRadioRxChainMask() function */ /** * @brief Sets the number of Rx streams to an environment variable. * * @param[in] radioIndex Radio index * @param[in] numStreams Number of Rx streams * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. * */ INT wifi_setRadioRxChainMask(INT radioIndex, INT numStreams); //P2 // sets the number of Rx streams to an environment variable //>> Deprecated: /**. * When essid is blank (apIndex==-1), the configured SSID on that interface is used. * when it's not empty (apIndex==0 to 15), the filter will apply to whatever ssid is provided. * * @param[in] apIndex The index of access point array * @param[in] mode Enum value indicates disabled/enabled * @param[in] essid Extended Service Set Identifier * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. */ INT wifi_setApScanFilter(INT apIndex, INT mode, CHAR *essid); //mode(enum): disabled, enabled, first; essid could be empty to get all matching ESSID /***************************************************************************************/ /** @} */ //END OF GROUP WIFI_HAL_APIS /** * @addtogroup WIFI_HAL_TYPES * @{ */ /** * @brief Configuration per apIndex * * This defines the configuration for each @b apIndex added to a steering * group * * Channel utilization is to be sampled every @b utilCheckIntervalSec seconds, * and after collecting $b utilAvgCount samples, the steering event * @b WIFI_STEERING_EVENT_CHAN_UTILIZATION should be sent with the averaged value. * * Client active/inactive checking is done every @b inactCheckIntervalSec seconds * and if a given client is idle/inactive for @b inactCheckThresholdSec seconds then * it should be marked as inactive. Whenever a client changes states between active * and inactive, the steering event @b WIFI_STEERING_EVENT_CLIENT_ACTIVITY should be * sent. */ typedef struct { INT apIndex; UINT utilCheckIntervalSec; /**< Channel utilization check interval */ UINT utilAvgCount; /**< Number of samples to average */ UINT inactCheckIntervalSec; /**< Client inactive check internval */ UINT inactCheckThresholdSec; /**< Client inactive threshold */ } wifi_steering_apConfig_t; /** * @brief Configuration per Client * * This defines the per-client, per-apIndex configuration settings. The * high water mark + low water mark pairs define RSSI ranges, in which * given packet types (probe or auth) are responded to as long as the RSSI * of the request packet is within the defined range. * * The RSSI crossings define thresholds which result in steering events * being generated when a connected clients RSSI crosses above or below * the given threshold. * * authRejectReason, when non-zero, results in auth requests being * rejected with the given reason code. When set to zero, auth requests * that do not fall in the RSSI hwm+lwm range will be silently ignored. * * @see https://supportforums.cisco.com/document/141136/80211-association-status-80211-deauth-reason-codes */ typedef struct { UINT rssiProbeHWM; /**< Probe response RSSI high water mark */ UINT rssiProbeLWM; /**< Probe response RSSI low water mark */ UINT rssiAuthHWM; /**< Auth response RSSI high water mark */ UINT rssiAuthLWM; /**< Auth response RSSI low water mark */ UINT rssiInactXing; /**< Inactive RSSI crossing threshold */ UINT rssiHighXing; /**< High RSSI crossing threshold */ UINT rssiLowXing; /**< Low RSSI crossing threshold */ UINT authRejectReason; /**< Inactive RSSI crossing threshold */ } wifi_steering_clientConfig_t; /** * @brief Wifi Disconnect Sources * * These are the possible sources of a wifi disconnect. * If the disconnect was initiated by the client, then @b DISCONNECT_SOURCE_REMOTE * should be used. * If initiated by the local AP, then @b DISCONNECT_SOURCE_LOCAL should be used. * If this information is not available, then @b DISCONNECT_SOURCE_UNKNOWN should be used. */ typedef enum { DISCONNECT_SOURCE_UNKNOWN = 0, /**< Unknown source */ DISCONNECT_SOURCE_LOCAL, /**< Initiated locally */ DISCONNECT_SOURCE_REMOTE /**< Initiated remotely */ } wifi_disconnectSource_t; /** * @brief Wifi Disconnect Types * These are the types of wifi disconnects. */ typedef enum { DISCONNECT_TYPE_UNKNOWN = 0, /**< Unknown type */ DISCONNECT_TYPE_DISASSOC, /**< Disassociation */ DISCONNECT_TYPE_DEAUTH /**< Deauthentication */ } wifi_disconnectType_t; /** * @brief Wifi Steering Event Types * These are the different steering event types that are sent by the wifi_hal * steering library. */ typedef enum { WIFI_STEERING_EVENT_PROBE_REQ = 1, /**< Probe Request Event */ WIFI_STEERING_EVENT_CLIENT_CONNECT, /**< Client association completed successfully Event */ WIFI_STEERING_EVENT_CLIENT_DISCONNECT, /**< Client Disconnect Event */ WIFI_STEERING_EVENT_CLIENT_ACTIVITY, /**< Client Active Change Event */ WIFI_STEERING_EVENT_CHAN_UTILIZATION, /**< Channel Utilization Event */ WIFI_STEERING_EVENT_RSSI_XING, /**< Client RSSI Crossing Event */ WIFI_STEERING_EVENT_RSSI, /**< Instant Measurement Event */ WIFI_STEERING_EVENT_AUTH_FAIL /**< Client Auth Failure Event */ } wifi_steering_eventType_t; /** * @brief RSSI Crossing Values * These are the RSSI crossing values provided in RSSI crossing events */ typedef enum { WIFI_STEERING_RSSI_UNCHANGED = 0, /**< RSSI hasn't crossed */ WIFI_STEERING_RSSI_HIGHER, /**< RSSI went higher */ WIFI_STEERING_RSSI_LOWER /**< RSSI went lower */ } wifi_steering_rssiChange_t; /** * @brief STA datarate information * These are STA capabilities values */ typedef struct { UINT maxChwidth; /**< Max bandwidth supported */ UINT maxStreams; /**< Max spatial streams supported */ UINT phyMode; /**< PHY Mode supported */ UINT maxMCS; /**< Max MCS supported */ UINT maxTxpower; /**< Max TX power supported */ UINT isStaticSmps; /**< Operating in Static SM Power Save Mode */ UINT isMUMimoSupported; /**< Supports MU-MIMO */ } wifi_steering_datarateInfo_t; typedef struct { BOOL linkMeas; /**< Supports link measurement */ BOOL neighRpt; /**< Supports neighbor reports */ BOOL bcnRptPassive; /**< Supports Passive 11k scans */ BOOL bcnRptActive; /**< Supports Active 11k scans */ BOOL bcnRptTable; /**< Supports beacon report table */ BOOL lciMeas; /**< Supports LCI measurement */ BOOL ftmRangeRpt; /**< Supports FTM Range report */ } wifi_steering_rrmCaps_t; /** * @brief Probe Request Event Data * This data is provided with @b WIFI_STEERING_EVENT_PROBE_REQ */ typedef struct { mac_address_t client_mac; /**< Client MAC Address */ UINT rssi; /**< RSSI of probe frame */ BOOL broadcast; /**< True if broadcast probe */ BOOL blocked; /**< True if response blocked */ } wifi_steering_evProbeReq_t; /** * @brief Client Connect Event Data * This data is provided with @b WIFI_STEERING_EVENT_CLIENT_CONNECT */ typedef struct { mac_address_t client_mac; /**< Client MAC Address */ UINT isBTMSupported; /**< Client supports BSS TM */ UINT isRRMSupported; /**< Client supports RRM */ BOOL bandCap2G; /**< Client is 2.4GHz capable */ BOOL bandCap5G; /**< Client is 5GHz capable */ wifi_steering_datarateInfo_t datarateInfo; /**< Client supported datarate information */ wifi_steering_rrmCaps_t rrmCaps; /**< Client supported RRM capabilites */ } wifi_steering_evConnect_t; /** * @brief Client Disconnect Event Data * This data is provided with @b WIFI_STEERING_EVENT_CLIENT_DISCONNECT */ typedef struct { mac_address_t client_mac; /**< Client MAC Address */ UINT reason; /**< Reason code of disconnect */ wifi_disconnectSource_t source; /**< Source of disconnect */ wifi_disconnectType_t type; /**< Disconnect Type */ } wifi_steering_evDisconnect_t; /** * @brief Client Activity Change Event Data * This data is provided with @b WIFI_STEERING_EVENT_CLIENT_ACTIVITY */ typedef struct { mac_address_t client_mac; /**< Client MAC Address */ BOOL active; /**< True if client is active */ } wifi_steering_evActivity_t; /** * @brief Channel Utilization Event Data * This data is provided with @b WIFI_STEERING_EVENT_CHAN_UTILIZATION */ typedef struct { UINT utilization; /**< Channel Utilization 0-100 */ } wifi_steering_evChanUtil_t; /** * @brief Client RSSI Crossing Event Data * This data is provided with @b WIFI_STEERING_EVENT_RSSI_XING */ typedef struct { mac_address_t client_mac; /**< Client MAC Address */ UINT rssi; /**< Clients current RSSI */ wifi_steering_rssiChange_t inactveXing; /**< Inactive threshold Value */ wifi_steering_rssiChange_t highXing; /**< High threshold Value */ wifi_steering_rssiChange_t lowXing; /**< Low threshold value */ } wifi_steering_evRssiXing_t; /** * @brief Client RSSI Measurement Event Data * This data is provided with @b WIFI_STEERING_EVENT_RSSI, which is sent in * response to a requset for the client's current RSSI measurement */ typedef struct { mac_address_t client_mac; /**< Client MAC Address */ UINT rssi; /**< Clients current RSSI */ } wifi_steering_evRssi_t; /** * @brief Auth Failure Event Data * This data is provided with @b WIFI_STEERING_EVENT_AUTH_FAIL */ typedef struct { mac_address_t client_mac; /**< Client MAC Address */ UINT rssi; /**< RSSI of auth frame */ UINT reason; /**< Reject Reason */ BOOL bsBlocked; /**< True if purposely blocked */ BOOL bsRejected; /**< True if rejection sent */ } wifi_steering_evAuthFail_t; /** * @brief Wifi Steering Event * This is the data containing a single steering event. */ typedef struct { wifi_steering_eventType_t type; /**< Event Type */ INT apIndex; /**< apIndex event is from */ ULLONG timestamp_ms; /**< Optional: Event Timestamp */ union { wifi_steering_evProbeReq_t probeReq; /**< Probe Request Data */ wifi_steering_evConnect_t connect; /**< Client Connect Data */ wifi_steering_evDisconnect_t disconnect; /**< Client Disconnect Data */ wifi_steering_evActivity_t activity; /**< Client Active Change Data */ wifi_steering_evChanUtil_t chanUtil; /**< Channel Utilization Data */ wifi_steering_evRssiXing_t rssiXing; /**< Client RSSI Crossing Data */ wifi_steering_evRssi_t rssi; /**< Client Measured RSSI Data */ wifi_steering_evAuthFail_t authFail; /**< Auth Failure Data */ } data; } wifi_steering_event_t; /** @} */ //END OF GROUP WIFI_HAL_TYPES /** * @addtogroup WIFI_HAL_APIS * @{ */ /** * @brief Wifi Steering Event Callback Definition * * This is the definition of the event callback provided when upper layer * registers for steering events. * * @warning the @b event passed to the callback is not dynamically * allocated the call back function handler must allocate wifi_steering_event_t * and copy the "event" into that */ typedef void (*wifi_steering_eventCB_t)(UINT steeringgroupIndex, wifi_steering_event_t *event); /** * @brief Steering API Supported. * * This tells the upper layer if the steering API is supported or not. * * @return @b TRUE on platforms that support steering, @b FALSE if not */ extern BOOL wifi_steering_supported(void); /** * @brief Add a Steering Group. * * A steering group defines a group of apIndex's which can have steering done * between them. * * @param[in] steeringgroupIndex Wifi Steering Group index * @param[in] cfg_2 2.4G apConfig * @param[in] cfg_5 5G apConfig * * @return RETURN_OK on success, RETURN_ERR on failure * * @warning All apIndex's provided within a group must have the same SSID, * encryption, and passphrase configured for steering to function properly. * * @note The hal need to allocate (no matter static or dynamic) to store those two config * if cfg_2 and cfg_5 are NULL, this steering group will be removed */ INT wifi_steering_setGroup(UINT steeringgroupIndex, wifi_steering_apConfig_t *cfg_2, wifi_steering_apConfig_t *cfg_5); /** * @brief Register for Steering Event Callbacks. * * This is called by the upper layer to register for steering event * callbacks. * * @param[in] event_cb Event callback function pointer. * * @return RETURN_OK on success, RETURN_ERR on failure. * * @warning the @b event passed to the callback should be a dynamically * allocated event which upper layer will free by calling wifi_steering_eventFree() */ INT wifi_steering_eventRegister(wifi_steering_eventCB_t event_cb); /** * @brief Unregister for Steering Event Callbacks. * * This is called by the upper layer to stop receiving event callbacks. * * @return RETURN_OK on success, RETURN_ERR on failure */ INT wifi_steering_eventUnregister(void); /** * @brief Add Client Config to apIndex. * * The upper layer calls this funciton to @b add/modify per-client configuration @p config * of @p client_mac for @p apIndex * * @param[in] steeringgroupIndex Wifi Steering Group index * @param[in] apIndex Accesspoint index the client config should be added to * @param[in] client_mac The Client's MAC address. * If client_mac is not there, the hal need to add record, * else, the hal need to update the config * @param[in] config The client configuration * * @return RETURN_OK on success, RETURN_ERR on failure */ INT wifi_steering_clientSet( UINT steeringgroupIndex, INT apIndex, mac_address_t client_mac, wifi_steering_clientConfig_t *config); /** * @brief Remove Client Config from apIndex * * The upper layer calls this function to @b remove per-client configuration * of @p client_mac from @p apIndex * * @param[in] steeringgroupIndex Wifi Steering Group index * @param[in] apIndex Access point index, the client config to be removed. * @param[in] client_mac The Client's MAC address * * @return RETURN_OK on success, RETURN_ERR on failure */ INT wifi_steering_clientRemove( UINT steeringgroupIndex, INT apIndex, mac_address_t client_mac); /** * @brief Initiate Instant Client RSSI Measurement. * * This initiates an instant client RSSI measurement. The recommended method of * performing this measurement is to send five NUL wifi frames to the client, and * average the RSSI of the ACK frames returned. This averaged RSSI value should * be sent back using @b WIFI_STEERING_EVENT_RSSI steering event type. * Instant measurement improves user experience by not reacting to false-positive * RSSI crossings. * If for some reason instant measurement is not supported, the function should * return RETURN_ERR and set errno to @b ENOTSUP. * * @param[in] steeringgroupIndex Wifi Steering Group index * @param[in] apIndex Access point index, the client config should be added to * @param[in] client_mac The Client's MAC address * * @return RETURN_OK on success, RETURN_ERR on failure. Set errno to ENOTSUP if * instant measurement is not supported */ INT wifi_steering_clientMeasure( UINT steeringgroupIndex, INT apIndex, mac_address_t client_mac); /** * @brief Initiate a Client Disconnect. * * This is used by the upper layer to kick off a client, for steering purposes. * * @param[in] steeringgroupIndex Wifi Steering Group index * @param[in] apIndex The access point index, the client config should be added to * @param[in] client_mac The Client's MAC address * @param[in] type Disconnect Type * @param[in] reason Reason code to provide in deauth/disassoc frame. * * @return RETURN_OK on success, RETURN_ERR on failure * @see https://supportforums.cisco.com/document/141136/80211-association-status-80211-deauth-reason-codes */ INT wifi_steering_clientDisconnect( UINT steeringgroupIndex, INT apIndex, mac_address_t client_mac, wifi_disconnectType_t type, UINT reason); // Radio Timeout for device disassociation. // Device.WiFi.Radio.i.X_RDKCENTRAL-COM_connectionTimeOut. Integer r/w (default 180 sec, range: 15 to 1200) //INT wifi_getRadioConnectionTimeOut(INT radioIndex, INT *output_timout_sec); //INT wifi_setRadioConnectionTimeOut(INT radioIndex, INT timout_sec); //This call back will be invoked when driver detect the client "authentication fail". //event_type: 0=unknow reason; 1=wrong password; 2=timeout; typedef INT ( * wifi_apAuthEvent_callback)(INT apIndex, char *MAC, INT event_type); //Callback registration function. void wifi_apAuthEvent_callback_register(wifi_apAuthEvent_callback callback_proc); /** @} */ //END OF GROUP WIFI_HAL_APIS /** * @addtogroup WIFI_HAL_TYPES * @{ */ // The pulling function to retrieve the existing authenticated device Mac for specified VAP typedef struct _mac_t { unsigned char byte[6]; } mac_t; /** @} */ //END OF GROUP WIFI_HAL_TYPES /** * @addtogroup WIFI_HAL_APIS * @{ */ INT wifi_getApAuthenticatedDevices(INT apIndex, mac_t **mac_array, UINT *output_array_size); //The call back function to send the notification for new authenticated devices. typedef INT ( * wifi_apAuthenticatedEvent_callback)(INT apIndex, char *MAC); //Callback registration function. void wifi_apAuthenticatedEvent_callback_register(wifi_apAuthEvent_callback callback_proc); /** @} */ //END OF GROUP WIFI_HAL_APIS /** * @addtogroup WIFI_HAL_TYPES * @{ */ //Mode 1: When a client connect or associate message is received by the AP, then the WiFi HAL lay must invoke wifi_apAssociatedDevice_callback with event_type: CONN_NEW. #define CONN_NEW 1 //Mode 2: If the AP status for a client is connected or associated and the AP receives a client connect or associate message from this client, wifi_apAssociatedDevice_callback need to be invoked from hal layer to notify RDKB with event_type: CONN_RENEW #define CONN_RENEW 2 //Mode 3: If the AP changes a client’s status to “disconnected” due to the AP’s client inactivity timeout (RDKB could read this timeout from wifi_getRadioClientInactivityTimout ) and then the client re-connects or associates back to same AP , then the WiFi HAL layer must invoke a wifi_apAssociatedDevice_callback with event_type: CONN_RECONN_AFTER_INACTIVITY #define CONN_RECONN_AFTER_INACTIVITY 3 /** @} */ //END OF GROUP WIFI_HAL_TYPES /** * @addtogroup WIFI_HAL_APIS * @{ */ //Device.WiFi.Radio.i.X_RDKCENTRAL-COM_clientInactivityTimout. Integer ro //This is used to read the ClientInactivityTimout from driver. INT wifi_getRadioClientInactivityTimout(INT radioIndex, INT *output_timout_sec); //This call back will be invoked when driver detect the client connection or association happen. typedef INT ( * wifi_apAssociatedDevice_callback)(INT apIndex, char *MAC, INT event_type); //Callback registration function. void wifi_apAssociatedDevice_callback_register(wifi_apAssociatedDevice_callback callback_proc); //----------------------------------------------------------------------------------------------- //Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_InterworkingServiceCapability //Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_InterworkingServiceEnable //Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_InterworkingElement.AccessNetworkType //Access Network Type value to be included in the Interworking IE in the beaconds. (refer 8.4.2.94 of IEEE Std 802.11-2012). Possible values are: 0 - Private network;1 - Private network with guest access;2 - Chargeable public network;3 - Free public network;4 - Personal device network;5 - Emergency services only network;6-13 - Reserved;14 - Test or experimental;15 - Wildcard INT wifi_setInterworkingAccessNetworkType(INT apIndex, INT accessNetworkType); // P3 INT wifi_getInterworkingAccessNetworkType(INT apIndex, UINT *output_uint); // P3 //Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_InterworkingElement.Internet //Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_InterworkingElement.ASRA //Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_InterworkingElement.ESR //Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_InterworkingElement.UESA //Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_InterworkingElement.VenueOptionPresent //Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_InterworkingElement.VenueGroup //Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_InterworkingElement.VenueType //Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_InterworkingElement.HESSOptionPresent //Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_InterworkingElement.HESSID /** @} */ //END OF GROUP WIFI_HAL_APIS /** * @addtogroup WIFI_HAL_TYPES * @{ */ // Interworking Element structure; see 802.11-2016 section 9.4.2.92 for field definition. typedef struct { BOOL interworkingEnabled; UINT accessNetworkType; BOOL internetAvailable; BOOL asra; BOOL esr; BOOL uesa; BOOL venueOptionPresent; /**< True when venue information has not been provided, e.g. the hostspot is in a residence. */ UCHAR venueGroup; UCHAR venueType; BOOL hessOptionPresent; mac_addr_str_t hessid; /**< Optional; use empty string to indicate no value provided. */ } wifi_InterworkingElement_t; /** @} */ //END OF GROUP WIFI_HAL_TYPES /** * @addtogroup WIFI_HAL_APIS * @{ */ /** * @brief Get the Interworking Service Capability of the AP. * * @param[in] pIndex Index of the Access Point. * @param[in] output_bool Indication as to whether the AP supports the Interworking Service. * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected */ INT wifi_getApInterworkingServiceCapability(INT apIndex, BOOL *output_bool); /** * @brief Get the Interworking Service enable/disable value for the AP. * * @param[in] apIndex Index of the Access Point. * @param[in] output_bool Indication as to whether the AP Interworking Service is enabled (true) or disabled (false). * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected */ INT wifi_getApInterworkingServiceEnable(INT apIndex, BOOL *output_bool); /** * @brief Set the Interworking Service enable/disable value for the AP. * * @param[in] apIndex Index of the Access Point. * @param[in] input_bool Value to set the Interworking Service enable to, true or false. * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected */ INT wifi_setApInterworkingServiceEnable(INT apIndex, BOOL input_bool); /** * @brief Get the Interworking Element that will be sent by the AP. * * @param[in] apIndex Index of the Access Point. * @param[in] output_struct Interworking Element. * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected */ INT wifi_getApInterworkingElement(INT apIndex, wifi_InterworkingElement_t *output_struct); INT wifi_pushApInterworkingElement(INT apIndex, wifi_InterworkingElement_t *infoEelement); /** @} */ //END OF GROUP WIFI_HAL_APIS /** * @addtogroup WIFI_HAL_TYPES * @{ */ // 802.11r Fast Trasition definitions. typedef struct { mac_address_t mac; nas_id_t nasId; r0r1_key_t key; } wifi_r0KH_t; typedef struct { mac_address_t mac; mac_address_t r1khId; r0r1_key_t key; } wifi_r1KH_t; typedef enum { FT_SUPPORT_DISABLED, FT_SUPPORT_FULL, FT_SUPPORT_ADAPTIVE } wifi_fastTrasitionSupport_t; #define MAX_KEY_HOLDERS 8 typedef struct { wifi_fastTrasitionSupport_t support; USHORT mobilityDomain; BOOL overDS; nas_id_t r0KeyHolder; USHORT r0KeyLifeTime; mac_address_t r1KeyHolder; USHORT reassocDeadLine; BOOL pmkR1Push; UCHAR numR0KHs; wifi_r0KH_t r0KH[MAX_KEY_HOLDERS]; UCHAR numR1KHs; wifi_r1KH_t r1KH[MAX_KEY_HOLDERS]; } wifi_FastTransitionConfig_t; /** @} */ //END OF GROUP WIFI_HAL_TYPES /** * @addtogroup WIFI_HAL_APIS * @{ */ /** * @brief Set the Fast Transition capability to disabled, full FT ** * @brief EAP/EAPOL Authenticator information. * * Structure which holds the the EAP/EAPOL Config param values. */ typedef struct _wifi_eap_config_t { unsigned int uiEAPOLKeyTimeout; unsigned int uiEAPOLKeyRetries; unsigned int uiEAPIdentityRequestTimeout; unsigned int uiEAPIdentityRequestRetries; unsigned int uiEAPRequestTimeout; unsigned int uiEAPRequestRetries; } wifi_eap_config_t; /* @description Set the Fast Transition capability to disabled, full FT * support, or adaptive FT support. Adaptive support is the same as full * support except the Mobility Domain Element is not sent in Beacon Frames. * * Receipt of the TR-181 Object for writing * Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_FTTransitionActivated via * TR-069 or WebPA causes this function to be called with the value of the * Object. * * @param apIndex - AP Index the setting applies to. * @param activate - 0 = disabled, 1 = full FT support, 2 = adaptive support. * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_setFastBSSTransitionActivated(INT apIndex, UCHAR activate); /** * @brief Get the Fast Transition capability value. * * Receipt of the TR-181 Object for reading * Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_BSSTransitionActivated via * TR-069 or WebPA causes this function to be called with the value of the * Object. * * @param apIndex - AP Index the setting applies to. * @param activate - 0 = disabled, 1 = full FT support, 2 = adaptive support. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_getBSSTransitionActivated(INT apIndex, BOOL *activate); /** * @description Set the EAP authentication and EAPOL Handshake parameters. * EAPOL Key Timeout and max retries [M1 and M3] * EAP Identity Request and max retries * EAP Request Timeout and max retries * @param [in] apIndex - VAP number * @param [in] value - Either timeout or retry value * @param [in] param - Parameter string name to be configured as follows * eapolkey(timeout or retries), * eapidentityrequest(timeout or retries), * eaprequest(timeout or retries) * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_setEAP_Param(UINT apIndex, UINT value, char *param); /* @description Get the EAP authentication and EAPOL Handshake parameters. * EAPOL Key Timeout and max retries [M1 and M3] * EAP Identity Request and max retries * EAP Request Timeout and max retries * @param [in] apIndex - VAP number * @param [in] output to be filled * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_getEAP_Param(UINT apIndex, wifi_eap_config_t *output); /* @description Get the Fast Transition over DS activated value. * See 802.11-2016 section 13.3. * * Receipt of the TR-181 Object for reading * Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_FTOverDSActivated via * TR-069 or WebPA causes this function to be called with the value of the * Object. * * @param apIndex - AP Index the setting applies to. * @param activate - True for activated (enabled), false for not activated * (disabled). * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_getFTOverDSActivated(INT apIndex, BOOL *activate); /** * @brief Set the Fast Transition over DS activated value. * See 802.11-2016 section 13.3. * * Receipt of the TR-181 Object for writing * Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_FTOverDSActivated via * TR-069 or WebPA causes this function to be called with the value of the * Object. * * @param apIndex - AP Index the setting applies to. * @param activate - True for activated (enabled), false for not activated * (disabled). * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_setFTOverDSActivated(INT apIndex, BOOL *activate); /** * @brief Get the Fast Transition Mobility Domain value. * See 802.11-2016 section 13.3. * * Receipt of the TR-181 Object for reading * Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_FTMobilityDomain via * TR-069 or WebPA causes this function to be called with the value of the * Object. * * @param apIndex - AP Index the setting applies to. * @param mobilityDomain - Value of the FT Mobility Domain for this AP. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_getFTMobilityDomainID(INT apIndex, UCHAR mobilityDomain[2]); /** * @brief Set the Fast Transition Mobility Domain value. * See 802.11-2016 section 13.3. * * Receipt of the TR-181 Object for writing * Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_FTMobilityDomain via * TR-069 or WebPA causes this function to be called with the value of the * Object. * * @param apIndex - AP Index the setting applies to. * @param mobilityDomain - Value of the FT Mobility Domain for this AP. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_setFTMobilityDomainID(INT apIndex, UCHAR mobilityDomain[2]); /** * @brief Get the Fast Transition Resource Request Support value. * See 802.11-2016 section 13.3. * * Receipt of the TR-181 Object for reading * Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_FTResourceRequestSupported via * TR-069 or WebPA causes this function to be called with the value of the * Object. * * @param apIndex - AP Index the setting applies to. * @param supported - True is FT resource request supported, false is not * supported. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_getFTResourceRequestSupported(INT apIndex, BOOL *supported); /** * @brief Set the Fast Transition Resource Request Support value. * See 802.11-2016 section 13.3. * * Receipt of the TR-181 Object for writing * Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_FTResourceRequestSupported via * TR-069 or WebPA causes this function to be called with the value of the * Object. * * @param apIndex - AP Index the setting applies to. * @param suppored - True is FT resource request supported, false is not * supported. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_setFTResourceRequestSupported(INT apIndex, BOOL *supported); /** * @brief Get the Fast Transition R0 Key Lifetime value. * See 802.11-2016 section 13.4.2. * * Receipt of the TR-181 Object for reading * Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_FTR0KeyLifetime via * TR-069 or WebPA causes this function to be called with the value of the * Object. * * @param apIndex - AP Index the setting applies to. * @param lifetime - R0 Key Lifetime. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_getFTR0KeyLifetime(INT apIndex, UINT *lifetime); /** * @brief Set the Fast Transition R0 Key Lifetime value. * See 802.11-2016 section 13.4.2 * * Receipt of the TR-181 Object for writing * Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_FTR0KeyLifetime via * TR-069 or WebPA causes this function to be called with the value of the * Object. * * @param apIndex - AP Index the setting applies to. * @param lifetime - R0 Key Lifetime. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_setFTR0KeyLifetime(INT apIndex, UINT *lifetime); /** * @brief Get the Fast Transition R0 Key Holder ID value. * See 802.11-2016 section 13.3. * * Receipt of the TR-181 Object for reading * Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_FTR0KeyHolderID via * TR-069 or WebPA causes this function to be called with the value of the * Object. * * @param apIndex - AP Index the setting applies to. * @param keyHolderID - R0 Key Holder ID string. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_getFTR0KeyHolderID(INT apIndex, UCHAR *keyHolderID); /** * @brief Set the Fast Transition R0 Key Holder ID value. * See 802.11-2016 section 13.3. * * Receipt of the TR-181 Object for writing * Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_FTR0KeyHolderID via * TR-069 or WebPA causes this function to be called with the value of the * Object. * * @param apIndex - AP Index the setting applies to. * @param keyHolderID - R0 Key Holder ID string. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_setFTR0KeyHolderID(INT apIndex, UCHAR *keyHolderID); /** * @brief Get the Fast Transition R1 Key Holder ID value. * See 802.11-2016 section 13.3. * * Receipt of the TR-181 Object for reading * Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_FTR1KeyHolderID via * TR-069 or WebPA causes this function to be called with the value of the * Object. * * @param apIndex - AP Index the setting applies to. * @param keyHolderID - R0 Key Holder ID string. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_getFTR1KeyHolderID(INT apIndex, UCHAR *keyHolderID); /** * @brief Set the Fast Transition R1 Key Holder ID value. * See 802.11-2016 section 13.3. * * Receipt of the TR-181 Object for writing * Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_FTR1KeyHolderID via * TR-069 or WebPA causes this function to be called with the value of the * Object. * * @param apIndex - AP Index the setting applies to. * @param keyHolderID - R0 Key Holder ID string. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_setFTR1KeyHolderID(INT apIndex, UCHAR *keyHolderID); INT wifi_pushApFastTransitionConfig(INT apIndex, wifi_FastTransitionConfig_t *ftData); /** @} */ //END OF GROUP WIFI_HAL_APIS /** * @addtogroup WIFI_HAL_TYPES * @{ */ // 802.11v BSS Transition Management Definitions #define MAX_BTM_DEVICES 64 #define MAX_URL_LEN 512 #define MAX_CANDIDATES 64 #define MAX_VENDOR_SPECIFIC 32 // BSS Termination Duration subelement, ID = 4, 802.11 section 9.4.2.2. // This is a subelement because it is specific to Neighbor Report, and BTM // Request Frame. typedef struct { ULONG tsf; // 8 octet TSF timer value. USHORT duration; } wifi_BTMTerminationDuration_t; typedef struct { CHAR condensedStr[3]; // 2 char country code from do11CountryString. } wifi_CondensedCountryString_t; typedef struct { USHORT offset; USHORT interval; } wifi_TSFInfo_t; typedef struct { UCHAR preference; } wifi_BSSTransitionCandidatePreference_t; typedef struct { USHORT bearing; UINT dist; USHORT height; } wifi_Bearing_t; // Wide Bandwidth Channel Element, ID = 194. 802.11-2016 section 9.4.2.161. typedef struct { UCHAR bandwidth; UCHAR centerSeg0; UCHAR centerSeg1; } wifi_WideBWChannel_t; typedef struct { UCHAR token; UCHAR mode; UCHAR type; union { UCHAR lci; UCHAR lcr; } u; } wifi_Measurement_t; // HT Capabilities Element, ID = 45. 802.11-2016 section 9.4.2.56. typedef struct { USHORT info; // Bitfield where bit 0 is info[0] bit 0. UCHAR ampduParams; UCHAR mcs[16]; // Bitfield where bit 0 is mcs[0] bit 0. USHORT extended; // Bitfield where bit 0 is ele_HTExtendedCapabilities[0] bit 0. UINT txBeamCaps; // Bitfield where bit 0 is ele_TransmitBeamFormingCapabilities[0] bit 0. UCHAR aselCaps; } wifi_HTCapabilities_t; // VHT Capabilities Element, ID = 191. 802.11-2016 section 9.4.2.158. typedef struct { UINT info; // The Supported VHT-MCS and NSS Set field is 64 bits long, but is broken // into 4 16 bit fields for convenience. USHORT mcs; USHORT rxHighestSupportedRate; USHORT txVHTmcs; USHORT txHighestSupportedRate; } wifi_VHTCapabilities_t; // HT OperationElement, ID = 61, 802.11-2016 section 9.4.2.57. typedef struct { UCHAR primary; UCHAR opInfo[5]; // Bitfield where bit 0 is ele_HTOperationInfo[0] bit 0; UCHAR mcs[16]; } wifi_HTOperation_t; // VHT Operation Element, ID = 192. 802.11-2016 section 9.4.2.159. typedef struct { wifi_WideBWChannel_t opInfo; // channel width, center of seg0, center of seg1 USHORT mcs_nss; // Bit field. } wifi_VHTOperation_t; // Secondary Channel Offset Element, ID = 62, 802.11-2016 section // 9.4.2.20. typedef struct { UCHAR secondaryChOffset; } wifi_SecondaryChannelOffset_t; // RM Enabled Capabilities Element, ID = 70, 802.11-2016 section // 9.4.2.45. typedef struct { // This is a bit field defined by table 9-157. Bit 0 for all of the // capabilities is ele_RMEnabledCapabilities[5] bit 0. UCHAR capabilities[5]; } wifi_RMEnabledCapabilities_t; // Vendor Specific Element, ID = 221. 802.11-2016 section 9.4.2.26. typedef struct { // 3 or 5 octet OUI depending on format; see 802.11-2016 section 9.4.1.32. UCHAR oui[5]; // Vendor specific content. UCHAR buff[MAX_VENDOR_SPECIFIC]; } wifi_VendorSpecific_t; // Measurement Pilot Transmission Element, ID = 66, 802.11-2016 section // 9.4.2.42. typedef struct { UCHAR pilot; // Series of (sub)elements. Table 9-155 only lists vendor specific. wifi_VendorSpecific_t vendorSpecific; } wifi_MeasurementPilotTransmission_t; typedef struct { bssid_t bssid; // 32 bit optional value, bit fileds are // b0, b1 for reachability // b2 security // b3 key scope // b4 to b9 capabilities // b10 mobility domain // b11 high troughput // b12 very high throughput // b13 ftm // b14 to b31 reserved UINT info; UCHAR opClass; UCHAR channel; UCHAR phyTable; BOOL tsfPresent; wifi_TSFInfo_t tsfInfo; BOOL condensedCountrySringPresent; wifi_CondensedCountryString_t condensedCountryStr; BOOL bssTransitionCandidatePreferencePresent; wifi_BSSTransitionCandidatePreference_t bssTransitionCandidatePreference; BOOL btmTerminationDurationPresent; wifi_BTMTerminationDuration_t btmTerminationDuration; BOOL bearingPresent; wifi_Bearing_t bearing; BOOL wideBandWidthChannelPresent; wifi_WideBWChannel_t wideBandwidthChannel; BOOL htCapsPresent; wifi_HTCapabilities_t htCaps; BOOL vhtCapsPresent; wifi_VHTCapabilities_t vbhtCaps; BOOL htOpPresent; wifi_HTOperation_t htOp; BOOL vhtOpPresent; wifi_VHTOperation_t vhtOp; BOOL secondaryChannelOffsetPresent; wifi_SecondaryChannelOffset_t secondaryChannelOffset; BOOL rmEnabledCapsPresent; wifi_RMEnabledCapabilities_t rmEnabledCaps; BOOL msmtPilotTransmissionPresent; wifi_MeasurementPilotTransmission_t msmtPilotTransmission; BOOL vendorSpecificPresent; wifi_VendorSpecific_t vendorSpecific; ssid_t target_ssid; } wifi_NeighborReport_t; // BSS Transition Management Request Frame, 802.11-2016 section 9.6.14.9. typedef struct { UCHAR token; /**< set by STA to relate reports */ UCHAR requestMode; /**< Requested instructions for the STA. */ USHORT timer; UCHAR validityInterval; // The optional fields may include: // 1. BSS Termination Duration Subelement, ID = 4. 802.11-2016 Figure 9-300. // 2. Session Information URL. // 3. BSS Transition Candidate List Entries wifi_BTMTerminationDuration_t termDuration; UCHAR disassociationImminent; USHORT urlLen; CHAR url[MAX_URL_LEN]; UCHAR numCandidates; wifi_NeighborReport_t candidates[MAX_CANDIDATES]; } wifi_BTMRequest_t; // BSS Transition Management Query Frame, 802.11-2016 section 9.6.14.8. // Received from non-AP STA. typedef struct { UCHAR token; /**< set by STA to relate reports */ UCHAR queryReason; UCHAR numCandidates; wifi_NeighborReport_t candidates[MAX_CANDIDATES]; } wifi_BTMQuery_t; // BSS Transition Management Response Frame, 802.11-2016 section 9.6.14.10. // Received from non-AP STA. typedef struct { UCHAR token; /**< set by STA to relate reports */ UCHAR status; UCHAR terminationDelay; bssid_t target; UCHAR numCandidates; wifi_NeighborReport_t candidates[MAX_CANDIDATES]; } wifi_BTMResponse_t; // Structure to return BTM extended capability from devices on the LAN. // The peer and capability arrays are parallel // and have the same number of entries. typedef struct { UINT entries; /**< Number of entries in each of the following arrays. */ mac_address_t peer[MAX_BTM_DEVICES]; /**< Array a peer device MAC addresses. */ BOOL capability[MAX_BTM_DEVICES]; /**< Array of bool indicating peer BSS transition capability. */ } wifi_BTMCapabilities_t; /** @} */ //END OF GROUP WIFI_HAL_TYPES /** * @addtogroup WIFI_HAL_APIS * @{ */ /** * @brief This call back is invoked when a STA sends a BTM query * message to a vAP in the gateway. The driver will use the frame returned * from this function to process the response to the query. * A BTM transaction is started by a STA sending a query or by the AP sending * an autonomous request. This callback is used for the former. * * @param apIndex - Access Point Index. * @param peerMACAddress - MAC address of the peer STA the Query was received from. * @param inQueryFrame - Query frame received from a non-AP STA. * @param inMemSize - Size of the memory allocated by the callback. The caller * should set to max size for the request. Otherwise the callback may * drop elements or return an error. * @param inRequestFrame - Frame to use for the response. The caller * allocates the memory for the response. The caller may free the memory * when the callback returns and the response is sent to the STA. * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. */ typedef INT (* wifi_BTMQueryRequest_callback)(UINT apIndex, CHAR *peerMac, wifi_BTMQuery_t *query, UINT inMemSize, wifi_BTMRequest_t *request); /** * @brief This call back is invoked when a STA responds to a BTM Request * from the gateway. * * @param apIndex - Access Point Index. * @param peerMACAddress - MAC address of the peer the response was received * from. * @param in_struct - Response frame received from a non-AP STA. * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. */ typedef INT (* wifi_BTMResponse_callback)(UINT apIndex, CHAR *peerMac, wifi_BTMResponse_t *response); /** * @brief BTM Query callback registration function. * * @param callback_proc - wifi_newApAssociatedDevice_callback callback function * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. */ INT wifi_BTMQueryRequest_callback_register(UINT apIndex, wifi_BTMQueryRequest_callback btmQueryCallback, wifi_BTMResponse_callback btmResponseCallback); /** * @brief Set a BTM Request to a non-AP STA. The callback register * function should be called first so that the response can be handled by the * application. * * @param apIndex; index of the vAP to send the request from. * @param peerMACAddress; MAC address of the peer device to send the request to. * @param in_struct; BTM Request Frame to send to the non-AP STA. * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. */ INT wifi_setBTMRequest(UINT apIndex, CHAR *peerMac, wifi_BTMRequest_t *request); /** * @brief Get the BTM implemented value. When not implemented the * gateway ignores a BTM query request as defined in 802.11-2016 section * 11.11.10.3. * * @param apIndex - AP Index the setting applies to. * @param activate - True for implemented false for not implemented. * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_getBSSTransitionImplemented(UINT apIndex, BOOL *activate); /** * @brief Set the BTM capability to activated or deactivated, * same as enabled or disabled. The word "activated" is used here because * that's what's used in the 802.11 specification. When deactivate the * gateway ignores a BTM report request as defined in 802.11-2016 section * 11.11.10.3. The AP (apIndex) BSS Transition bit in any Extended Capabilities * element sent out is set corresponding to the activate parameter. * * @param apIndex - AP Index the setting applies to. * @param activate - True for activate false for deactivate. * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_setBSSTransitionActivation(UINT apIndex, BOOL activate); /** * @description Get the BTM capability of activated or deactivated, * same as enabled or disabled. * * @param apIndex - AP Index the setting applies to. * @param activate - True for activate false for deactivate. * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_getBSSTransitionActivation(UINT apIndex, BOOL *activate); /** * @description Get the BTM capability of an external STA. Reports the value * of the BSS Transition bit in the Extended Capabilities element, if detected, * from an external STA. Reports the latest value detected in the element * received by any vAP in any frame type. * * @param apIndex - AP the Extended Capabilities elements were received on. * @param extBTMCapabilities - structure with parallel arrays of peer MAC * addresses and BTM capability indicators. * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_getBTMClientCapabilityList(UINT apIndex, wifi_BTMCapabilities_t *extBTMCapabilities); // 802.11k neighbor report definitions /** @} */ //END OF GROUP WIFI_HAL_APIS /** * @addtogroup WIFI_HAL_TYPES * @{ */ // 802.11-2016 section 9.6.7.6 typedef struct { UCHAR token; /**< set by STA to relate reports */ UCHAR ssidLen; /**< set length to 0 if ssid is not present, otherwise to length of ssid field */ ssid_t ssid; UCHAR measCount; /**< Request for LCI/LCR may come in any order */ wifi_Measurement_t measurements[2]; } wifi_NeighborRequestFrame_t; /** @} */ //END OF GROUP WIFI_HAL_TYPES /** * @addtogroup WIFI_HAL_APIS * @{ */ /* @description Set the neighbor reports to be reported by the AP. Calling * this function over-writes any previously set Neighbor BSSID set. The set * is not persistent. * * @param apIndex - Index of the vAP to send the request from * @param in_NumberNeighborReports - Number of reports in the in_NeighborReports * set. * @param in_NeighborReports - One or more neighbor reports to be reported by * the AP. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_setNeighborReports(UINT apIndex, UINT numNeighborReports, wifi_NeighborReport_t *neighborReports); /* @description Set the neighbor report capability to activated or deactivated, * same as enabled or disabled. The word "activated" is used here because * that's what's used in the 802.11 specification. When deactivate the * gateway ignores a neighbor report request as defined in 802.11-2016 section * 11.11.10.3. * * Reciept of the TR-181 Object * Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_NeighborReportActivated via * TR-069 or WebPA causes this function to be called with the value of the * Object. * * @param apIndex - AP Index the setting applies to. * @param activate - True for activate false for deactivate. * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_setNeighborReportActivation(UINT apIndex, BOOL activate); /* @description Get the neighbor report capability of activated or deactivated, * same as enabled or disabled. * * Reciept of the TR-181 Object * Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_NeighborReportActivated via * TR-069 or WebPA causes this function to be called with the value of the * Object. * * @param apIndex - AP Index the setting applies to. * @param activate - True for activate false for deactivate. * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_getNeighborReportActivation(UINT apIndex, BOOL *activate); /** @} */ //END OF GROUP WIFI_HAL_APIS /** * @addtogroup WIFI_HAL_TYPES * @{ */ // 802.11k Beacon request & report structures and function prototypes #define MAX_REQUESTED_ELEMS 8 #define MAX_CHANNELS 16 typedef struct { UCHAR condition; UCHAR threshold; } wifi_BeaconReporting_t; typedef struct { UCHAR ids[MAX_REQUESTED_ELEMS]; } wifi_RequestedElementIDS_t; typedef wifi_RequestedElementIDS_t wifi_ExtdRequestedElementIDS_t; // AP Channel Report Element, ID = 51, 802.11-2016 section 9.4.2.36. typedef struct { UCHAR opClass; UCHAR channels[MAX_CHANNELS]; } wifi_ChannelReport_t; // 802.11-2016 section 9.4.2.21.7 typedef struct { UCHAR opClass; UCHAR channel; USHORT randomizationInterval; USHORT duration; UCHAR mode; bssid_t bssid; BOOL ssidPresent; ssid_t ssid; BOOL beaconReportingPresent; wifi_BeaconReporting_t beaconReporting; BOOL reportingRetailPresent; UCHAR reportingDetail; BOOL wideBandWidthChannelPresent; wifi_WideBWChannel_t wideBandwidthChannel; BOOL requestedElementIDSPresent; wifi_RequestedElementIDS_t requestedElementIDS; BOOL extdRequestedElementIDSPresent; wifi_ExtdRequestedElementIDS_t extdRequestedElementIDS; BOOL channelReportPresent; wifi_ChannelReport_t channelReport; BOOL vendorSpecificPresent; wifi_VendorSpecific_t vendorSpecific; USHORT numRepetitions; } wifi_BeaconRequest_t; // 802.11-2016 section 9.4.2.22.7 typedef struct { UCHAR opClass; UCHAR channel; ULLONG startTime; USHORT duration; UCHAR frameInfo; UCHAR rcpi; UCHAR rsni; bssid_t bssid; UCHAR antenna; UINT tsf; BOOL wideBandWidthChannelPresent; wifi_WideBWChannel_t wideBandwidthChannel; USHORT numRepetitions; } wifi_BeaconReport_t; /** @} */ //END OF GROUP WIFI_HAL_TYPES /** * @addtogroup WIFI_HAL_APIS * @{ */ /* @description This call back is invoked when a STA responds to a Beacon * Request from the gateway, or as a triggered autonomous report. Noting that * an autonomous report can be configured by a Beacon Request by setting the * enable, request, and report bits in the measurement request; 802.11-2016 * Table 9-81 and section 11.11.8. When a triggered autonomous report * causes the callback to be called the dialog token and measurement token are * both set to 0. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. */ typedef INT (*wifi_RMBeaconReport_callback)(UINT apIndex, wifi_BeaconReport_t *out_struct, UINT *out_array_size, UCHAR *out_DialogToken); /* @description Register a callback for a Beacon Request. Called when a * response to a Beacon Request is received, or a Beacon Report is received * from an autonomous trigger. * * @param apIndex; index of the vAP the Beacon Report was received on. * @param beaconReportCallback; the callback function being registered. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_RMBeaconRequestCallbackRegister(UINT apIndex, wifi_RMBeaconReport_callback beaconReportCallback); /* @description Unegister a callback for a Beacon Request. Returns an error * if the callback hasn't been registered. * * @param apIndex; index of the vAP the Beacon Report was received on. * @param beaconReportCallback; the callback function being unregistered. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_RMBeaconRequestCallbackUnregister(UINT apIndex, wifi_RMBeaconReport_callback beaconReportCallback); /* @description Set a radio measurement (RM) beacon request. Causes the * request to be sent based on the information in the request parameter. * Sent from the AP at apIndex. Returns an error if a callback has not been * registered for the AP. * * @param apIndex; index of the vAP to send the request from. * @param peerMACAddress, MAC address of the peer device to send the request * to. Must be an external device MAC address. * @param in_request; pointer to a Beacon Report request structure. * @param out_DialogToken; the token chosen by the STA for the requested * measurement(s); * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. If the AP can determine that * the target device does not support Radio Measurement, then an error * is returned. */ INT wifi_setRMBeaconRequest(UINT apIndex, CHAR *peer, wifi_BeaconRequest_t *in_request, UCHAR *out_DialogToken); /* @description Cancel all of the currently cached beacon reports and ignore * reports received that match the dialog tokan * // @param apIndex; index of the vAP the beacon request was sent from. * @param dialogToken; token the STA assigned to the beacon request. */ INT wifi_cancelRMBeaconRequest(UINT apIndex, UCHAR dialogToken); /* @description Get the Radio Measurement Capabilities from another peer * device. * * @param peerMACAddress; MAC Address of the external peer device used to * determine if an Radio Measurement Capabiliites Element is available. * @param out_Capabilities; array formatted as defined in 802.11-2016 * Table 9-157. The Beacon Report Capability is indicated by bit 7. The * Beacon Passive, Active, and Table Capabilities are indicated by bits * 4, 5, 6 respectively. * * @return The capabilities returned in a Radio Measurement Element if * received. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. If the AP has not received * a Radio Measurement Element from the peer, then an error is returned. */ INT wifi_getRMCapabilities(CHAR *peer, UCHAR out_Capabilities[5]); /** @} */ //END OF GROUP WIFI_HAL_APIS /** * @addtogroup WIFI_HAL_TYPES * @{ */ // VAP telemetry report structures and function prototypes #define MAX_VAP 16 /** * @brief VAP Telemetry information. * * Structure which holds the VAP Telemetry information. */ typedef struct { UINT txOverflow; // WiFi TX overflow counter. } wifi_VAPTelemetry_t; /** @} */ //END OF GROUP WIFI_HAL_TYPES /** * @addtogroup WIFI_HAL_APIS * @{ */ /* @description Get the VAP Telemetry data. * * @param[in] apIndex - Access Point index. * @param[out] telemetry - structure for vap telemetry data. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_getVAPTelemetry(UINT apIndex, wifi_VAPTelemetry_t *telemetry); /* @description This call back is invoked when a STA responds to a DPP Authentication * Request from the gateway with DPP Authentication Response * * @param apIndex; index of the vAP where the DPP Authentication Response frame is received * @param staMAC, MAC address of the peer device * @param status, one of wifi_dppAuthResponseStatus_t authentication response status * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. */ /** @} */ //END OF GROUP WIFI_HAL_APIS /** * @addtogroup WIFI_HAL_TYPES * @{ */ /************* DPP *************************/ typedef enum { WIFI_DPP_TECH_INFRA } wifi_dpp_technology_t; typedef enum { WIFI_DPP_KEY_MGMT_PSK, WIFI_DPP_KEY_MGMT_DPP, WIFI_DPP_KEY_MGMT_SAE, WIFI_DPP_KEY_MGMT_PSKSAE, WIFI_DPP_KEY_MGMT_DPPPSKSAE } wifi_dpp_key_management_t; typedef struct { wifi_dpp_key_management_t keyManagement; union { unsigned char preSharedKey[128]; char passPhrase[64]; } creds; } wifi_dpp_credential_object_t; typedef ssid_t wifi_dpp_discovery_object_t; // DPP Configuration Object typedef struct { wifi_dpp_technology_t wifiTech; wifi_dpp_discovery_object_t discovery; wifi_dpp_credential_object_t credentials; void *reconfigCtx; void *cSignInstance; } wifi_dpp_configuration_object_t; typedef enum { STATE_DPP_UNPROVISIONED, STATE_DPP_AUTH_RSP_PENDING, STATE_DPP_AUTH_FAILED, STATE_DPP_AUTHENTICATED, STATE_DPP_CFG_RSP_SENT, STATE_DPP_CFG_FAILED, STATE_DPP_CFG_ASSOC_IND_RECEIVED, STATE_DPP_PROVISIONED = STATE_DPP_CFG_ASSOC_IND_RECEIVED, STATE_DPP_RECFG_AUTH_RSP_PENDING, STATE_DPP_RECFG_AUTH_FAILED, } wifi_dpp_state_t; typedef enum { RESPONDER_STATUS_OK, RESPONDER_STATUS_NOT_COMPATIBLE, RESPONDER_STATUS_AUTH_FAILURE, RESPONDER_STATUS_BAD_CODE, RESPONDER_STATUS_BAD_GROUP, RESPONDER_STATUS_CONFIGURATION_FAILURE, RESPONDER_STATUS_RESPONSE_PENDING, RESPONDER_STATUS_INVALID_CONNECTOR, RESPONDER_STATUS_NO_MATCH, RESPONDER_STATUS_CONFIG_REJECTED, RESPONDER_STATUS_NOT_AVAILABLE, } wifi_enrollee_responder_status_t; typedef enum { ActStatus_Idle, ActStatus_Config_Error, ActStatus_In_Progress, ActStatus_No_Response, ActStatus_Failed, ActStatus_OK } wifi_activation_status_t; typedef struct { char iPubKey[512]; char rPubKey[512]; } wifi_dpp_config_data_t; typedef struct { unsigned char tran_id[120]; char iPubKey[512]; unsigned char match_tran_id; } wifi_dpp_reconfig_data_t; typedef enum { wifi_dpp_session_type_config, wifi_dpp_session_type_reconfig, } wifi_dpp_session_type_t; typedef struct { mac_address_t sta_mac; wifi_dpp_session_type_t session; union { wifi_dpp_config_data_t config_data; wifi_dpp_reconfig_data_t reconfig_data; } u; unsigned int channel; // current channel that DPP Authentication request will be sent on void *instance; wifi_dpp_state_t state; } wifi_dpp_session_data_t; typedef enum { dpp_context_type_session_data, dpp_context_type_received_frame_auth_rsp, dpp_context_type_received_frame_cfg_req, dpp_context_type_received_frame_cfg_result, dpp_context_type_received_frame_recfg_announce, dpp_context_type_received_frame_recfg_auth_rsp, } wifi_device_dpp_context_type_t; typedef enum { wifi_dpp_public_action_frame_type_auth_req, wifi_dpp_public_action_frame_type_auth_rsp, wifi_dpp_public_action_frame_type_auth_cnf, wifi_dpp_public_action_frame_type_reserved_1, wifi_dpp_public_action_frame_type_reserved_2, wifi_dpp_public_action_frame_type_peer_disc_req, wifi_dpp_public_action_frame_type_peer_disc_rsp, wifi_dpp_public_action_frame_type_pkex_req, wifi_dpp_public_action_frame_type_pkex_rsp, wifi_dpp_public_action_frame_type_pkex_rev_req, wifi_dpp_public_action_frame_type_pkex_rev_rsp, wifi_dpp_public_action_frame_type_cfg_result, wifi_dpp_public_action_frame_type_conn_status_result, wifi_dpp_public_action_frame_type_presence_announcement, wifi_dpp_public_action_frame_type_recfg_announcement, wifi_dpp_public_action_frame_type_recfg_auth_req, wifi_dpp_public_action_frame_type_recfg_auth_rsp, wifi_dpp_public_action_frame_type_recfg_auth_cnf, } wifi_dpp_public_action_frame_type_t; typedef struct { UCHAR *frame; UINT length; wifi_dpp_public_action_frame_type_t frame_type; } wifi_dpp_received_frame_t; typedef struct { unsigned int ap_index; unsigned char configurator_version; unsigned char enrollee_version; wifi_device_dpp_context_type_t type; wifi_dpp_session_data_t session_data; wifi_dpp_received_frame_t received_frame; unsigned int dpp_init_retries; unsigned int max_retries; unsigned char token; wifi_dpp_configuration_object_t config; wifi_enrollee_responder_status_t enrollee_status; wifi_activation_status_t activation_status; unsigned int check_for_associated; unsigned int check_for_config_requested; unsigned int num_channels; // number of channels that enrollee can listen on unsigned int channels_list[32]; // list of channels that enrollee can listen on unsigned int current_attempts; // number of failed attempts on N different channels off the list } wifi_device_dpp_context_t; /** @} */ //END OF GROUP WIFI_HAL_TYPES /** * @addtogroup WIFI_HAL_APIS * @{ */ /* @description Initiate device provisioning with unprovisioned DPP enabled client. * Causes AP to start transmitting DPP Authentication Request unicast message to client on current operating channel. * Sent from the AP at apIndex. Returns an error if message transmission fails. * * @param apIndex; index of the vAP to send the request from. * @param staMAC, MAC address string of the peer device to send the request * to. Must be an external device MAC address. * @param iBootstrapSubjectPubKeyInfoB64; pointer to initiator's DER encoded ASN.1 base64 subject public key info (RFC 5280). * @param rBootstrapSubjectPubKeyInfoB64; pointer to responder's DER encoded ASN.1 base64 subject public key info (RFC 5280). * @param channel; frequency in Hz of channel on which initiator should send the DPP Authentication Request public action frame * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_dppInitiate(wifi_device_dpp_context_t *ctx); /* @description Cancel device provisioning if DPP Authentication Response is not receieved after number of sent requets * Causes AP to stop transmitting DPP Authentication Request unicast message to client on current operating channel. * If DPP Authentication Response has already been received from client, the provisioning sequence can not be cancelled. * Sent from the AP at apIndex. Returns an error if message transmission fails. * * @param apIndex; index of the vAP to send the request from. * @param staMAC, MAC address string of the peer device to send the request * to. Must be an external device MAC address. * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_dppCancel(wifi_device_dpp_context_t *ctx); /* @description This call back is invoked when a STA responds to a DPP Authentication * Request from the gateway with DPP Authentication Response * * @param apIndex; index of the vAP where the DPP Authentication Response frame is received * @param staMAC, MAC address of the peer device * @param status, one of wifi_dppAuthResponseStatus_t authentication response status * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. */ typedef void (*wifi_dppAuthResponse_callback_t)(UINT apIndex, mac_address_t sta, UCHAR *frame, UINT len); /* @description This call back is invoked when a STA sends DPP Configuration * Request to the gateway * * @param apIndex; index of the vAP where the DPP Configuration Request frame is received * @param staMAC, MAC address string of the peer device * @param configAttributes, address of memory pointing to configuration attributes * @param length, length of memory in bytes * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. */ typedef void (*wifi_dppConfigRequest_callback_t)(UINT apIndex, mac_address_t sta, UCHAR token, UCHAR *attribs, UINT length); /* @description This call back is invoked when a STA sends DPP Configuration * Result to the gateway * * @param apIndex; index of the vAP where the DPP Configuration Request frame is received * @param staMAC, MAC address string of the peer device * @param attributes, address of memory pointing to attributes * @param length, length of memory in bytes * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. */ typedef void (*wifi_dppConfigResult_callback_t)(UINT apIndex, mac_address_t sta, UCHAR *attribs, UINT length); /* @description This call back is invoked when a STA sends DPP Reconfig * Announcement to the gateway * * @param apIndex; index of the vAP where the DPP Configuration Request frame is received * @param staMAC, MAC address string of the peer device * @param attributes, address of memory pointing to attributes * @param length, length of memory in bytes * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. */ typedef void (*wifi_dppReconfigAnnounce_callback_t)(UINT apIndex, mac_address_t sta, UCHAR *attribs, UINT length); /* @description This call back is invoked when a STA responds to a DPP Reconfig Authentication * Request from the gateway with DPP Authentication Response * * @param apIndex; index of the vAP where the DPP Authentication Response frame is received * @param staMAC, MAC address of the peer device * @param status, one of wifi_dppAuthResponseStatus_t authentication response status * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. */ typedef void (*wifi_dppReconfigAuthResponse_callback_t)(UINT apIndex, mac_address_t sta, UCHAR *frame, UINT len); typedef enum { WIFI_MGMT_FRAME_TYPE_INVALID=-1, WIFI_MGMT_FRAME_TYPE_PROBE_REQ=0, WIFI_MGMT_FRAME_TYPE_PROBE_RSP=1, WIFI_MGMT_FRAME_TYPE_ASSOC_REQ=2, WIFI_MGMT_FRAME_TYPE_ASSOC_RSP=3, WIFI_MGMT_FRAME_TYPE_AUTH=4, WIFI_MGMT_FRAME_TYPE_DEAUTH=5, WIFI_MGMT_FRAME_TYPE_REASSOC_REQ=6, WIFI_MGMT_FRAME_TYPE_REASSOC_RSP=7, WIFI_MGMT_FRAME_TYPE_DISASSOC=8, WIFI_MGMT_FRAME_TYPE_ACTION=9, } wifi_mgmtFrameType_t; /** @} */ //END OF GROUP WIFI_HAL_TYPES /** * @addtogroup WIFI_HAL_APIS * @{ */ typedef enum { WIFI_DATA_FRAME_TYPE_INVALID=-1, WIFI_DATA_FRAME_TYPE_8021x, } wifi_dataFrameType_t; typedef INT (* wifi_receivedDataFrame_callback)(INT apIndex, UCHAR *sta_mac, UCHAR *frame, UINT len, wifi_dataFrameType_t type); typedef enum { WIFI_FRAME_TYPE_INVALID=-1, WIFI_FRAME_TYPE_MGMT, WIFI_FRAME_TYPE_CTRL, WIFI_FRAME_TYPE_DATA, } wifi_frameType_t; /* * @description DPP callbacks registration for AuthResponse & dppConfigRequest functions. * * @param wifi_dppAuthResponse_callback - DPP Authentication Response callback function * @param wifi_dppConfigRequest_callback - DPP Config Request callback function * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. * * @execution Synchronous * @sideeffect None * * @note This function must not suspend and must not invoke any blocking system * calls. */ INT wifi_dpp_frame_received_callbacks_register(wifi_dppAuthResponse_callback_t dppAuthCallback, wifi_dppConfigRequest_callback_t dppCpnfigCallback, wifi_dppConfigResult_callback_t dppConfigResultCallback, wifi_dppReconfigAnnounce_callback_t dppReconfigAnnounceCallback, wifi_dppReconfigAuthResponse_callback_t dppReconfigAuthRspCallback); /* @description send athentication confiration as per DPP specifications * Causes AP to transmit DPP Authentication Conf message frame to STA that will cause STA * to request configuration process in case confirmation status is set to success * Sent from the AP at apIndex. Returns an error if message transmission fails. * * @param apIndex; index of the vAP to send the request from. * @param staMAC, MAC address string of the peer device to send the request * to. Must be an external device MAC address. * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_dppSendAuthCnf(wifi_device_dpp_context_t *ctx); /* @description send device specific configuration as per DPP specifications * Causes AP to transmit DPP Configuration Response frame to STA with device specific * configuration * Sent from the AP at apIndex. Returns an error if message transmission fails. * * @param apIndex; index of the vAP to send the request from. * @param staMAC, MAC address string of the peer device to send the request * to. Must be an external device MAC address. * @param config, start address of memory pointing to configuration * @param length, length in bytes of memory pointing to configuration * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_dppSendConfigResponse(wifi_device_dpp_context_t *ctx); /* @description set STA specific password key * Configures STA specific password in AP * * @param apIndex; index of the vAP to send the request from. * @param staMAC, MAC address string of the peer device to send the request * to. Must be an external device MAC address. * @param key * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_dppSetSTAPassphrase(UINT apIndex, CHAR *sta, CHAR *key); /* @description remove STA specific password key * Removes STA specific password in AP * * @param apIndex; index of the vAP to send the request from. * @param staMAC, MAC address string of the peer device to send the request * to. Must be an external device MAC address. * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_dppRemoveSTAPassphrase(UINT apIndex, CHAR *sta); /* @description transmit an action frame * Transmits an action frame to STA from a specific VAP * * @param apIndex; index of the vAP to send the frame from. * @param staMAC; MAC address string of the peer device to send the frame to * @param channel; channel on which this action frame should be sent on (for public action frames that * can be sent tp a device on off channel * @param frame; pointer to the frame buffer * @param len; length of the buffer * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ INT wifi_sendActionFrame(INT apIndex, mac_address_t sta, UINT frequency, UCHAR *frame, UINT len); /* @description call back for a received management frame (probe requests and action frames) on a VAP * This callback is a manadatory static callback that MUST be implemented when management frames * are received. If a hander for probe requests or some specific public action frames are registered, * then the registered callbacks should be invoked * Callback for a received management frame on a VAP * * @param apIndex; index of the vAP * @param frame; pointer to the frame buffer, the buffer points to the data * @param len; length of the buffer * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected. */ /** @} */ //END OF GROUP WIFI_HAL_APIS /** * @addtogroup WIFI_HAL_TYPES * @{ */ typedef enum { pre_assoc_probe_block, pre_assoc_assoc_block, post_assoc_idle_80211v, post_assoc_idle_kick_mac, post_assoc_active_80211v, post_assoc_active_kickmac, } wifi_steer_type_t; typedef unsigned int wifi_steer_matching_condition_t; typedef struct { CHAR *module; mac_address_t sta_mac; mac_address_t src_bss; mac_address_t dst_bss; wifi_steer_type_t type; wifi_steer_matching_condition_t cond; } wifi_steer_trigger_data_t; /** @} */ //END OF GROUP WIFI_HAL_TYPES typedef INT (* wifi_steerTriggered_callback)(INT apIndex, wifi_steer_trigger_data_t *data); void wifi_steerTriggered_callback_register(wifi_steerTriggered_callback callback_proc, CHAR *module); /* 802.11ax HAL API prototypes */ INT wifi_setDownlinkMuType (INT radio_index, wifi_dl_mu_type_t mu_type); INT wifi_getDownlinkMuType (INT radio_index, wifi_dl_mu_type_t *mu_type); INT wifi_setUplinkMuType (INT radio_index, wifi_ul_mu_type_t mu_type); INT wifi_getUplinkMuType (INT radio_index, wifi_ul_mu_type_t *mu_type); INT wifi_setGuardInterval (INT radio_index, wifi_guard_interval_t guard_interval); INT wifi_getGuardInterval (INT radio_index, wifi_guard_interval_t *guard_interval); INT wifi_setBSSColorEnabled (INT apIndex, BOOL enabled); INT wifi_getBSSColorEnabled (INT apindex, BOOL *enabled); INT wifi_getBSSColor (INT apIndex, UCHAR *color); INT wifi_setDownlinkDataAckType (INT radio_index, wifi_dl_data_ack_type_t ack_type); INT wifi_getTWTParams (CHAR *sta, wifi_twt_params_t *twt_params); INT wifi_get80211axDefaultParameters (INT apIndex, wifi_80211ax_params_t *params); typedef enum { wifi_anqp_element_name_reserved_0, wifi_anqp_element_name_query_list = 256, wifi_anqp_element_name_capability_list, wifi_anqp_element_name_venue_name, wifi_anqp_element_name_emergency_call_number, wifi_anqp_element_name_network_auth_type, wifi_anqp_element_name_roaming_consortium, wifi_anqp_element_name_ip_address_availabality, wifi_anqp_element_name_nai_realm, wifi_anqp_element_name_3gpp_cellular_network, wifi_anqp_element_name_geo_location, wifi_anqp_element_name_civic_location, wifi_anqp_element_name_loc_public_id, wifi_anqp_element_name_domain_name, wifi_anqp_element_name_emergency_alert_id, wifi_anqp_element_name_tdls_capability, wifi_anqp_element_name_emergency_nai, wifi_anqp_element_name_neighbor_report, wifi_anqp_element_name_venue_url, wifi_anqp_element_name_advice_of_charge, wifi_anqp_element_name_local_content, wifi_anqp_element_name_network_auth_type_with_timestamp, wifi_anqp_element_name_reserved_1 = 273, wifi_anqp_element_name_vendor_specific = 56797, wifi_anqp_element_name_reserved_2 } wifi_anqp_element_name_t; typedef enum { wifi_anqp_element_hs_subtype_reserved_0, wifi_anqp_element_hs_subtype_hs_query_list, wifi_anqp_element_hs_subtype_hs_capability_list, wifi_anqp_element_hs_subtype_operator_friendly_name, wifi_anqp_element_hs_subtype_wan_metrics, wifi_anqp_element_hs_subtype_conn_capability, wifi_anqp_element_hs_subtype_nai_home_realm_query, wifi_anqp_element_hs_subtype_op_class_ind, wifi_anqp_element_hs_subtype_osu_providers_list, wifi_anqp_element_hs_subtype_reserved_1, wifi_anqp_element_hs_subtype_icon_request, wifi_anqp_element_hs_subtype_icon_bin_file, wifi_anqp_element_hs_subtype_op_icon_metadata, wifi_anqp_element_hs_subtype_op_providers_nai_list, wifi_anqp_element_hs_subtype_reserved_2 } wifi_anqp_element_hs_subtype_t; typedef enum { wifi_anqp_id_type_anqp, wifi_anqp_id_type_hs } wifi_anqp_id_type_t; typedef struct { wifi_anqp_id_type_t type; union { wifi_anqp_element_name_t anqp_elem_id; wifi_anqp_element_hs_subtype_t anqp_hs_id; } u; UINT len; UCHAR *data; } wifi_anqp_elem_t; typedef struct wifi_anqp_node { struct wifi_anqp_node *next; wifi_anqp_elem_t *value; } wifi_anqp_node_t; typedef enum { wifi_ipv4_field_values_not_available, wifi_ipv4_field_values_available, wifi_ipv4_field_values_post_restricted, wifi_ipv4_field_values_single_nated_private, wifi_ipv4_field_values_double_nated_private, wifi_ipv4_field_values_port_restricted_single_nated, wifi_ipv4_field_values_port_restricted_double_nated, wifi_ipv4_field_values_not_known } wifi_ipv4_field_values_t; typedef enum { wifi_ipv6_field_values_not_available, wifi_ipv6_field_values_available, wifi_ipv6_field_values_not_known } wifi_ipv6_field_values_t; typedef struct { UCHAR field_format; }__attribute__((packed)) wifi_ipAddressAvailabality_t; typedef enum { wifi_auth_id_reserved, wifi_auth_id_expanded_eap, wifi_auth_id_inner_auth_eap, wifi_auth_id_expanded_inner_auth_eap, wifi_auth_id_credential_type, wifi_auth_id_tunneled_eap, }wifi_auth_id_t; typedef struct { UCHAR id; UCHAR length; UCHAR val[16]; }__attribute__((packed)) wifi_authMethod_t; typedef struct { UCHAR length; UCHAR method; UCHAR auth_param_count; wifi_authMethod_t auth_method[16]; }__attribute__((packed)) wifi_eapMethod_t; typedef struct { USHORT data_field_length; UCHAR encoding; UCHAR realm_length; UCHAR realm[256]; UCHAR eap_method_count; wifi_eapMethod_t eap_method[16]; } __attribute__((packed))wifi_naiRealm_t; typedef struct { USHORT nai_realm_count; wifi_naiRealm_t nai_realm_tuples[20]; }__attribute__((packed)) wifi_naiRealmElement_t; typedef struct { UCHAR length; UCHAR language[3]; UCHAR name[256]; }__attribute__((packed)) wifi_venueName_t; typedef struct { UCHAR venueGroup; UCHAR venueType; wifi_venueName_t venueNameTuples[16]; }__attribute__((packed)) wifi_venueNameElement_t; typedef struct { UCHAR PLMN[3]; }__attribute__((packed)) wifi_plmn_t; typedef struct { UCHAR iei;//copy zero for now. UCHAR plmn_length; UCHAR number_of_plmns; wifi_plmn_t plmn[16]; }__attribute__((packed))wifi_3gpp_plmn_list_information_element_t; typedef struct { UCHAR gud; UCHAR uhdLength;//Length of remaining fields wifi_3gpp_plmn_list_information_element_t plmn_information; }__attribute__((packed)) wifi_3gppCellularNetwork_t; typedef struct { UCHAR length; UCHAR domainName[255]; //max domain name allowed based on the spec. }__attribute__((packed)) wifi_domainNameTuple_t; typedef struct { wifi_domainNameTuple_t domainNameTuple[4]; }__attribute__((packed)) wifi_domainName_t; typedef struct { UCHAR length; UCHAR oui[15]; }__attribute__((packed)) wifi_ouiDuple_t; typedef struct { wifi_ouiDuple_t ouiDuple[32]; }__attribute__((packed)) wifi_roamingConsortium_t; typedef struct { USHORT capabilityList[64]; }__attribute__((packed)) wifi_capabilityListANQP_t; typedef struct { UCHAR wifiRoamingConsortiumCount; UCHAR wifiRoamingConsortiumOui[3][15+1];//only 3 OIS is allowed in beacon and probe responses OIS length is variable between 3-15 UCHAR wifiRoamingConsortiumLen[3]; }__attribute__((packed)) wifi_roamingConsortiumElement_t; INT wifi_pushApRoamingConsortiumElement(INT apIndex, wifi_roamingConsortiumElement_t *infoEelement); //HS2 Related ANQP Elements start //=========================================Start-HS-Operator Friendly Name========================================================================= //HS2.0 Operator Name Duple #1 HS2.0 Operator Name Duple #2 ...... HS2.0 Operator Name Duple #n // variable variable variable //HS2.0 Operator name Duple //Length Language Code Operator Name // 1 (3+ operator name) 3 variable typedef struct _wifi_HS2_OperatorNameDuple_t // figure 9-595 { UCHAR length; //length is 3(language code)+number of octects in operator name field eg. operatorName= aaaa length is 4+3 = 7 UCHAR languageCode[3]; UCHAR operatorName[252]; //based on spec the maximum length of operator name is 252 } __attribute__((packed)) wifi_HS2_OperatorNameDuple_t; typedef struct { wifi_HS2_OperatorNameDuple_t operatorNameDuple[16]; //putting 16 duples supported for now story RDKB-1317 does not tell how many duples we are supporting nor the spec (spec mentions n duples) } __attribute__((packed)) wifi_HS2_OperatorFriendlyName_t; //=========================================End-HS2-Operator Friendly Name========================================================================= //=========================================Start-HS2-Wan Metrics Element========================================================================= //WAN Info Downlink Speed Uplink Speed Downlink Load Uplink Load LMD // 1 4 4 1 1 2 typedef struct // figure 9-595 { UCHAR wanInfo; UINT downLinkSpeed; UINT upLinkSpeed; UCHAR downLinkLoad; UCHAR upLinkLoad; USHORT lmd; } __attribute__((packed)) wifi_HS2_WANMetrics_t; //WAN Info Bit fields // B0 B1 B2 B3 B4 B7 // Link Status Symetric Link At Capacity Reserved //Bits: 2 1 1 4 typedef enum { wifi_hs2_wan_info_reserved, wifi_hs2_wan_info_linkup, wifi_hs2_wan_info_linkdown, wifi_hs2_wan_info_link_in_test_state } wifi_HS2_Wan_Info_Link_Status_t; //=========================================End-HS2-Wan Metrics Element========================================================================= //=========================================Start-HS2-Connection Capability Element========================================================================= //Proto Port Tuple #1 Proto Port Tuple #2 ............. Proto Port Tuple #n // 4 4(optional) 4(optional) //Proto Port Tuple Format //IP Protocol Port Number Status // 1 2 1 typedef struct // figure 9-595 { UCHAR ipProtocol; USHORT portNumber; UCHAR status; } __attribute__((packed)) wifi_HS2_Proto_Port_Tuple_t; typedef struct // figure 9-595 { wifi_HS2_Proto_Port_Tuple_t protoPortTuple[16];//putting 16 duples supported for now. story RDKB-1317 does not tell how many duples we are supporting nor the spec (spec mentions n duples) } __attribute__((packed)) wifi_HS2_ConnectionCapability_t; typedef enum { wifi_hs2_connection_capability_closed, wifi_hs2_connection_capability_open, wifi_hs2_connection_capability_unknown, wifi_hs2_connection_capability_reserved } wifi_HS2_ConnectionCapability_Status_t; //=========================================End-HS2-Connection Capability Element========================================================================= //=========================================Start-HS2-NAI Realm Query Element========================================================================= //NAI Realm Count NAI Home Realm NAI Home Realm .... NAI Home Realm // Name Data #1 Name Data #2 Name Data #n // 1 variable (variable optional) (variable optional) //NAI Realm Encoding NAI Home Realm Name Length NAI Home Realm // 1 1 variable typedef struct// figure 9-595 { UCHAR encoding; UCHAR length; UCHAR name[255];//per spec maximum length is 255 } __attribute__((packed)) wifi_HS2_NAI_Home_Realm_Data_t; typedef struct// figure 9-595 { UCHAR realmCount; wifi_HS2_NAI_Home_Realm_Data_t homeRealmData[20];//as realm count is unsigned char we can put 255 realms here spec says n story does not define how many we support } __attribute__((packed)) wifi_HS2_NAI_Home_Realm_Query_t; //=========================================End-HS2-NAI Realm Query Element========================================================================= //=========================================Start-HS-Capability List========================================================================= //HS2.0 Capability #1 HS2.0 Capability #2 ...... HS2.0 Capability #n // 1 0 or 1 (optional) 0 or 1 (optional) //=========================================End-HS-Capability List========================================================================= typedef struct { UCHAR capabilityList[64]; } __attribute__((packed)) wifi_HS2_CapabilityList_t; typedef void (* wifi_anqp_request_callback_t) (UINT apIndex, mac_address_t sta, unsigned char token, wifi_anqp_node_t *list); INT wifi_anqp_request_callback_register(wifi_anqp_request_callback_t *callback); INT wifi_anqpSendResponse(UINT apIndex, mac_address_t sta, unsigned char token, wifi_anqp_node_t *list); //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_InterworkingService.DGAFEnable //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_InterworkingService.ANQPDomainID //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_InterworkingService.VenueNamesNumberOfEntries //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_InterworkingService.OperatorNamesNumberOfEntries //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_InterworkingService.ConsortiumOIsNumberOfEntries //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_InterworkingService.DomainNamesNumberOfEntries //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_InterworkingService.3GPPNetworksNumberOfEntries //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_InterworkingService.NAIRealmsNumberOfEntries //----------------------------------------------------------------------------------------------- //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.VenueNames.{i}. //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.VenueNames.{i}.LanguageCode //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.VenueNames.{i}.VanueName //----------------------------------------------------------------------------------------------- //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OperatorNames.{i}. //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OperatorNames.{i}.LanguageCode //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OperatorNames.{i}.OperatorName //----------------------------------------------------------------------------------------------- //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.ConsortiumOIs.{i}. //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.ConsortiumOIs.{i}.OI //----------------------------------------------------------------------------------------------- //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.DomainNames.{i}. //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.DomainNames.{i}.DomainName //----------------------------------------------------------------------------------------------- //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.3GPPNetworks.{i}. //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.3GPPNetworks.{i}.MCC //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.3GPPNetworks.{i}.MNC //----------------------------------------------------------------------------------------------- //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.NAIRealms.{i}. //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.NAIRealms.{i}.NAIRealmEncodingType //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.NAIRealms.{i}.NAIRealm //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.NAIRealms.{i}.EAPMethodsNumberOfEntries //----------------------------------------------------------------------------------------------- //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.NAIRealms.{i}.EAPMethods.{i}. //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.NAIRealms.{i}.EAPMethods.{i}.EAPMethod //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.NAIRealms.{i}.EAPMethods.{i}.AuthenticationParametersNumberOfEntries //----------------------------------------------------------------------------------------------- //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.NAIRealms.{i}.EAPMethods.{i}.AuthenticationParameters.{i}. //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.NAIRealms.{i}.EAPMethods.{i}.AuthenticationParameters.{i}.ID //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.NAIRealms.{i}.EAPMethods.{i}.AuthenticationParameters.{i}.Value //----------------------------------------------------------------------------------------------- //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.WANMetrics. //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.WANMetrics.LinkStatus //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.WANMetrics.AtCapacity //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.WANMetrics.DownlinkSpeed //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.WANMetrics.UplinkSpeed //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.WANMetrics.DownlinkLoad //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.WANMetrics.UplinkLoad //----------------------------------------------------------------------------------------------- //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU. //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProvidersNumberOfEntries //----------------------------------------------------------------------------------------------- //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}. //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}.OSUServerURI //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}.OSUMethodsList //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}.OSUNAI //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}.NamesNumberOfEntries //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}.IconsNumberOfEntries //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}ServiceDescriptionsNumberOfEntries //----------------------------------------------------------------------------------------------- //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}.Names.{i}. //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}.Names.{i}.LanguageCode //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}.Names.{i}.OSUProviderFriendlyName //----------------------------------------------------------------------------------------------- //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}.Icons.{i}. //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}.Icons.{i}.IconWidth //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}.Icons.{i}.IconHeight //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}.Icons.{i}.LanguageCode //----------------------------------------------------------------------------------------------- //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}.ServiceDescriptions.{i}. //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}.ServiceDescriptions.{i}.LanguageCode //Device.WiFi.AccessPoint.{i}.X_COMCAST-COM_Passpoint.OSU.OSUProviders.{i}.ServiceDescriptions.{i}.ServiceDescription //----------------------------------------------------------------------------------------------- //Device.IP.Diagnostics. //Device.IP.Diagnostics.IPPing. //Device.IP.Diagnostics.IPPing.DiagnosticsState //Device.IP.Diagnostics.IPPing.Interface //Device.IP.Diagnostics.IPPing.Host //Device.IP.Diagnostics.IPPing.NumberOfRepetitions //Device.IP.Diagnostics.IPPing.Timeout //Device.IP.Diagnostics.IPPing.DataBlockSize //Device.IP.Diagnostics.IPPing.DSCP //Device.IP.Diagnostics.IPPing.SuccessCount //Device.IP.Diagnostics.IPPing.FailureCount //Device.IP.Diagnostics.IPPing.AverageResponseTime //Device.IP.Diagnostics.IPPing.MinimumResponseTime //Device.IP.Diagnostics.IPPing.MaximumResponseTime //Start the ping test and get the result //INT wifi_getIPDiagnosticsIPPingResult(wifi_diag_ipping_setting_t *input, wifi_diag_ipping_result_t *result); //Tr181 //-------------------------------------------------------------------------------------------------- // Wifi Airtime Management and QOS APIs to control contention based access to airtime //INT wifi_clearDownLinkQos(INT apIndex); // clears the QOS parameters to the WMM default values for the downlink direction (from the access point to the stations. This set must take affect when the api wifi_applySSIDSettings() is called. //INT wifi_setDownLinkQos(INT apIndex, wifi_qos_t qosStruct); // sets the QOS variables used in the downlink direction (from the access point to the stations). Values must be allowable values per IEEE 802.11-2012 section 8.4.2.31. Note: Some implementations may requrie that all downlink APs on the same radio are set to the same QOS values. Default values are per the WMM spec. This set must take affect when the api wifi_applySSIDSettings() is called. //INT wifi_clearUpLinkQos(INT apIndex); // clears the QOS parameters to the WMM default values for the uplink direction (from the Wifi stations to the ap. This must take affect when the api wifi_applySSIDSettings() is called. //INT wifi_setUpLinkQos (INT apIndex, wifi_qos_t qosStruct); // sets the QOS variables used in the uplink direction (from the Wifi stations to the AP). Values must be allowable values per IEEE 802.11-2012 section 8.4.2.31. The default values must be per the WMM spec. This set must take affect when the api wifi_applySSIDSettings() is called. //-------------------------------------------------------------------------------------------------- // Wifi Airtime Management and QOS APIs to control downlink queue prioritization //INT wifi_getDownLinkQueuePrioritySupport (INT apIndex, INT *supportedPriorityLevels); //This api is used to get the the number of supported downlink queuing priority levels for each AP/SSID. If priority queuing levels for AP/SSIDs are not supported, the output should be set to 1. A value of 1 indicates that only the same priority level is supported for all AP/SSIDs. //INT wifi_setDownLinkQueuePriority(INT apIndex, INT priorityLevel); // this sets the queue priority level for each AP/SSID in the downlink direction. It is used with the downlink QOS api to manage priority access to airtime in the downlink direction. This set must take affect when the api wifi_applySSIDSettings() is called. //<< ------------------------------ wifi_ap_hal ----------------------- #ifdef __cplusplus } #endif typedef enum { WIFI_EVENT_CHANNELS_CHANGED, WIFI_EVENT_DFS_RADAR_DETECTED } wifi_chan_eventType_t; typedef void (*wifi_chan_eventCB_t)(UINT radioIndex, wifi_chan_eventType_t event, UCHAR channel); typedef enum { CHAN_STATE_AVAILABLE = 1, CHAN_STATE_DFS_NOP_FINISHED, CHAN_STATE_DFS_NOP_START, CHAN_STATE_DFS_CAC_START, CHAN_STATE_DFS_CAC_COMPLETED } wifi_channelState_t; typedef struct _wifi_channelMap_t { INT ch_number; wifi_channelState_t ch_state; } wifi_channelMap_t; /* wifi_getRadioChannels() function */ /* * Description: This function returns a map of current states of each possible channel for given radio. * The implementation must fill the map for each channel reported by wifi_getRadioPossibleChannels(). * * Parameters : * radioIndex - The index of the radio. First radio is index 0. 2nd radio is index 1 - type INT * output_map - a pointer to an array of wifi_channelMap_t structures, preallocated by the caller. * This is where the output is written. If the item in the array is not used, * the "ch_number" should be set to 0. * output_map_size - The size of the output_map array in array items. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected * * @execution Synchronous. * @sideeffect None. * * @note This function must not suspend and must not invoke any blocking system * calls. It should probably just send a message to a driver event handler task. */ INT wifi_getRadioChannels(INT radioIndex, wifi_channelMap_t *output_map, INT output_map_size); INT wifi_chan_eventRegister(wifi_chan_eventCB_t event_cb); /* GAS Configuration */ #define GAS_CFG_TYPE_SUPPORTED 1 typedef struct _wifi_GASConfiguration_t{ // Values correspond to the dot11GASAdvertisementEntry field definitions; see 802.11-2016 Annex C.3. UINT AdvertisementID; BOOL PauseForServerResponse; UINT ResponseTimeout; UINT ComeBackDelay; UINT ResponseBufferingTime; UINT QueryResponseLengthLimit; } wifi_GASConfiguration_t; INT wifi_applyGASConfiguration(wifi_GASConfiguration_t *input_struct); /* Passpoint R1 related APIs */ /*********************************************************************************** * Description : Set Country code information element in Beacon and Probe Response * Parameters: AP Index, Enabled Status * Return: The status of the operation **********************************************************************************/ INT wifi_setCountryIe(INT apIndex, BOOL enabled); /*********************************************************************************** * Description : Get status of country code information element in Beacon and Probe Response * Parameters: AP Index, pointer to Enabled Status variable * Return: The status of the operation **********************************************************************************/ INT wifi_getCountryIe(INT apIndex, BOOL *enabled); /*********************************************************************************** * Description : Enable Traffic Inspection and Filtering * Parameters: AP Index, Enabled Status * Return: The status of the operation **********************************************************************************/ INT wifi_setLayer2TrafficInspectionFiltering(INT apIndex, BOOL enabled); /*********************************************************************************** * Description : Get Traffic Inspection and Filtering status * Parameters: AP Index, pointer to Enabled Status variable * Return: The status of the operation **********************************************************************************/ INT wifi_getLayer2TrafficInspectionFiltering(INT apIndex, BOOL *enabled); /*********************************************************************************** * Description : Disable DGAF. When set to true, DGAF disabled bit should be set in HS2.0 Indication Information Element in Beacon and Probe * Parameters: AP Index, Disabled Status * Return: The status of the operation **********************************************************************************/ INT wifi_setDownStreamGroupAddress(INT apIndex, BOOL disabled); /*********************************************************************************** * Description : Status of Disable DGAF * Parameters: AP Index, pointer to Disabled Status variable * Return: The status of the operation **********************************************************************************/ INT wifi_getDownStreamGroupAddress(INT apIndex, BOOL *disabled); /*********************************************************************************** * Description : Enable BSS Load Information Element in Beacon/Probe Response * Parameters: AP Index, Enabled Status * Return: The status of the operation **********************************************************************************/ INT wifi_setBssLoad(INT apIndex, BOOL enabled); /*********************************************************************************** * Description : Get Status of BSS Load Information Element in Beacon/Probe Response * Parameters: AP Index, pointer to Enabled Status variable * Return: The status of the operation **********************************************************************************/ INT wifi_getBssLoad(INT apIndex, BOOL *enabled); /*********************************************************************************** * Description : Enable Proxy Arp function on device Driver * Parameters: AP Index, Enabled Status * Return: The status of the operation **********************************************************************************/ INT wifi_setProxyArp(INT apIndex, BOOL enabled); /*********************************************************************************** * Description : Get Status of Proxy Arp from Driver * Parameters: AP Index, pointer to Enabled Status variable * Return: The status of the operation **********************************************************************************/ INT wifi_getProxyArp(INT apIndex, BOOL *enable); /*********************************************************************************** * Description : Set Hotspot 2.0 Status for the Access Point * Parameters: AP Index, HS20 Enabled status * Return: The status of the operation **********************************************************************************/ INT wifi_pushApHotspotElement(INT apIndex, BOOL enabled); /*********************************************************************************** * Description : Enable Traffic Inspection and Filtering * Parameters: AP Index, pointer to Enabled Status variable * Return: The status of the operation **********************************************************************************/ INT wifi_getApHotspotElement(INT apIndex, BOOL *enabled); /*********************************************************************************** * Description : Push Roaming Consortium Information Element Contents to HAL * Parameters: AP Index, pointer to wifi_roamingConsortiumElement_t the structure contains OI count, length of first 3 OIs, and first 3 OI as a hex string. When count > 0 and interworking is enabled, Roaming Consortium Information Element should be present in Beacon and Probe Response with this information. * Return: The status of the operation **********************************************************************************/ INT wifi_pushApRoamingConsortiumElement(INT apIndex, wifi_roamingConsortiumElement_t *infoElement); /*********************************************************************************** * Description : Get Roaming Consortium Information Element Contents * Parameters: AP Index, pointer to wifi_roamingConsortiumElement_t If Roaming Consortium is not present, return count as 0, and length and OI fileds can be ignored * Return: The status of the operation **********************************************************************************/ INT wifi_getApRoamingConsortiumElement(INT apIndex, wifi_roamingConsortiumElement_t *infoElement); /*********************************************************************************** * Description : Disable P2P Cross Connect When Set to True, Include P2P Information element in Beacon and Probe Response Include P2P Manageability attribute with the Cross Connection Permitted field value 0 * Parameters: AP Index, Disabled Status * Return: The status of the operation **********************************************************************************/ INT wifi_setP2PCrossConnect(INT apIndex, BOOL disabled); /*********************************************************************************** * Description : Get Disable P2P Cross Connect status * Parameters: AP Index, pointer to Disabled Status variable * Return: The status of the operation **********************************************************************************/ INT wifi_getP2PCrossConnect(INT apIndex, BOOL *disabled); /* End Passpoint related APIs */ /** * @brief Check if Zero DFS is supported * * Zero DFS (also known as Background CAC) allows Wi-Fi stack to continue * operation on main channel and at the same time run background CAC. * * @param[in] radioIndex Index of Wi-Fi radio * @param[out] supported True if ZeroDFS is supported, false otherwise. * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * */ INT wifi_isZeroDFSSupported(UINT radioIndex, BOOL *supported); /** * @brief Set Zero DFS State * * The Zero DFS feature can be enabled or disabled. For EU countries * the "Pre-CAC" can be also set. If the "Pre-CAC" is set, then * after passing background CAC driver can start background CAC * on the next channel. * * @param[in] radioIndex Index of Wi-Fi radio * @param[in] enabled True if ZeroDFS must be enabled, false otherwise. * @param[in] precac Valid only for EU regulatory domain. If set, * after passing requested backgronund CAN, driver * can start background CAC on the next channel. * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * */ INT wifi_setZeroDFSState(UINT radioIndex, BOOL enable, BOOL precac); /** * @brief Get Zero DFS State * * The Zero DFS feature can be enabled or disabled. For EU countries * the "Pre-CAC" can be also set. If the "Pre-CAC" is set, then * after passing background CAC driver can start background CAC * on next channel. * * @param[in] radioIndex Index of Wi-Fi radio * @param[out] enabled True if ZeroDFS is enabled, false otherwise. * @param[out] precac Valid only for EU regulatory domain. If true, * then driver can start background CAC on * the next channel. * * @return The status of the operation * @retval RETURN_OK if successful * @retval RETURN_ERR if any error is detected * * @execution Synchronous * @sideeffect None * */ INT wifi_getZeroDFSState(UINT radioIndex, BOOL *enable, BOOL *precac); #define KI1_VER_MASK 0xf8 #define KI1_PW_KEY 0x08 #define KI1_INSTALL 0x40 #define KI1_ACK 0x80 #define KI1_MSG1_BITS (KI1_PW_KEY | KI1_ACK) #define KI1_MSG3_BITS (KI1_PW_KEY | KI1_INSTALL|KI1_ACK) #define KI0_MIC 0x01 #define KI0_SECURE 0x02 #define KI0_ENCR 0x10 #define KI0_MSG3_BITS (KI0_MIC | KI0_SECURE | KI0_ENCR) #define KI0_MSG4_BITS (KI0_MIC | KI0_SECURE) #define KEY_MSG_1_OF_4(msg) \ ((((msg)->key_info[1] & KI1_VER_MASK) == KI1_MSG1_BITS) && ((msg)->key_info[0] == 0)) #define KEY_MSG_2_OF_4(msg) \ ((((msg)->key_info[1] & KI1_VER_MASK) == KI1_PW_KEY) && ((msg)->key_info[0] == KI0_MIC)) #define KEY_MSG_3_OF_4(msg) \ ((((msg)->key_info[1] & KI1_VER_MASK) == KI1_MSG3_BITS) && ((msg)->key_info[0] == KI0_MSG3_BITS)) #define KEY_MSG_4_OF_4(msg) \ ((((msg)->key_info[1] & KI1_VER_MASK) == KI1_PW_KEY) && ((msg)->key_info[0] == KI0_MSG4_BITS)) typedef struct { unsigned char descriptor; unsigned char key_info[2]; unsigned short key_len; unsigned char replay[8]; unsigned char nonce[32]; unsigned char init_vector[16]; unsigned char rsc[8]; unsigned char key_id[8]; unsigned char mic[16]; unsigned short len; unsigned char data[0]; } wifi_eapol_key_frame_t; typedef enum { wifi_eap_code_request = 1, wifi_eap_code_response, wifi_eap_code_success, wifi_eap_code_failure, } wifi_eap_code_t; typedef struct { unsigned char code; unsigned char id; unsigned short len; unsigned char data[0]; } __attribute__((__packed__)) wifi_eap_frame_t; typedef enum { wifi_eapol_type_eap_packet, wifi_eapol_type_eapol_start, wifi_eapol_type_eapol_logoff, wifi_eapol_type_eapol_key, } wifi_eapol_type_t; typedef struct { unsigned char version; unsigned char type; unsigned short len; unsigned char data[0]; } __attribute__((__packed__)) wifi_8021x_frame_t; typedef enum { wifi_direction_unknown, wifi_direction_uplink, wifi_direction_downlink } wifi_direction_t; typedef void (* wifi_received8021xFrame_callback)(unsigned int ap_index, mac_address_t sta, wifi_eapol_type_t type, void *data, unsigned int len); typedef void (* wifi_sent8021xFrame_callback)(unsigned int ap_index, mac_address_t sta, wifi_eapol_type_t type, void *data, unsigned int len); typedef void (* wifi_receivedAuthFrame_callback)(unsigned int ap_index, mac_address_t sta, void *data, unsigned int len); typedef void (* wifi_sentAuthFrame_callback)(unsigned int ap_index, mac_address_t sta, void *data, unsigned int len); typedef void (* wifi_receivedAssocReqFrame_callback)(unsigned int ap_index, mac_address_t sta, void *data, unsigned int len); typedef void (* wifi_sentAssocRspFrame_callback)(unsigned int ap_index, mac_address_t sta, void *data, unsigned int len); typedef INT (* wifi_receivedMgmtFrame_callback)(INT apIndex, UCHAR *sta_mac, UCHAR *frame, UINT len, wifi_mgmtFrameType_t type, wifi_direction_t dir); int mgmt_frame_received_callback(INT ap_index, mac_address_t sta_mac, UCHAR *frame, UINT len, wifi_mgmtFrameType_t type, wifi_direction_t dir); INT wifi_mgmt_frame_callbacks_register(wifi_receivedMgmtFrame_callback dppRecvRxCallback); /* wifi_enableCSIEngine() function */ /* * Description: This function enables or disables CSI engine data for a specific STA on a VAP * If the MAC address is NULL mac address, enable argument MUST be false, otherwise function MUST return failure. * If the MAC address is NULL mac address, data engine for all STA(s) need to be disabled on this VAP * * Parameters : * apIndex - Index of VAP * sta - MAC address of the station associated in this VAP for which engine is being enabled/disabled * enable - Enable or diable * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected * * @execution Synchronous. * @sideeffect None. * */ INT wifi_enableCSIEngine(INT apIndex, mac_address_t sta, BOOL enable); /* wifi_sendDataFrame() function */ /* * Description: This function sends data frame to a client associated in the specified VAP index * If the MAC address is NULL mac address, the data should be broadcast on the VAP * * Parameters : * apIndex - Index of VAP * sta - MAC address of the station associated in this VAP * data - Pointer to the data buffer. The data does not have any layer 2 information but has starts with layer 3. * len - length of data * insert_llc - whether LLC header should be inserted. If set to TRUE, HAL implementation MUST insert the following bytes before type field. DSAP = 0xaa, SSAP = 0xaa, Control = 0x03, followed by 3 bytes each = 0x00 * eth_proto - ethernet protocol, the definitions are listed below.a * prio - priority of the frame with which scheduler should transmit the frame, please see the enumeration below. * * @return The status of the operation. * @retval RETURN_OK if successful. * @retval RETURN_ERR if any error is detected * * @execution Synchronous. * @sideeffect None. * */ #define WIFI_ETH_TYPE_IP 0x0800 #define WIFI_ETH_TYPE_ARP 0x0806 #define WIFI_ETH_TYPE_REVARP 0x8035 #define WIFI_ETH_TYPE_VLAN 0x8100 #define WIFI_ETH_TYPE_LOOPBACK 0x9000 #define WIFI_ETH_TYPE_IP6 0x86DD #define WIFI_ETH_TYPE_EAPOL 0x888e typedef enum { wifi_data_priority_be, wifi_data_priority_bk, wifi_data_priority_ee, wifi_data_priority_ca, wifi_data_priority_vi, wifi_data_priority_vo, wifi_data_prioirty_ic, wifi_data_priority_nc } wifi_data_priority_t; INT wifi_sendDataFrame(INT apIndex, mac_address_t sta, UCHAR *data, UINT len, BOOL insert_llc, UINT eth_proto, wifi_data_priority_t prio); #endif