diff options
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg80211.h | 317 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 1587 | ||||
| -rw-r--r-- | CORE/MAC/inc/qwlan_version.h | 4 | ||||
| -rw-r--r-- | CORE/MAC/inc/sirApi.h | 252 | ||||
| -rw-r--r-- | CORE/MAC/inc/wniApi.h | 1 | ||||
| -rw-r--r-- | CORE/MAC/src/include/sirParams.h | 4 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limProcessMessageQueue.c | 241 | ||||
| -rw-r--r-- | CORE/SERVICES/COMMON/dbglog_id.h | 5 | ||||
| -rw-r--r-- | CORE/SERVICES/COMMON/wmi_tlv_defs.h | 51 | ||||
| -rw-r--r-- | CORE/SERVICES/COMMON/wmi_unified.h | 243 | ||||
| -rw-r--r-- | CORE/SERVICES/COMMON/wmi_version.h | 2 | ||||
| -rw-r--r-- | CORE/SERVICES/HIF/common/hif_sdio_common.h | 9 | ||||
| -rw-r--r-- | CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c | 50 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 430 | ||||
| -rw-r--r-- | CORE/SERVICES/WMI/wmi_unified.c | 2 | ||||
| -rw-r--r-- | CORE/SME/inc/sme_Api.h | 9 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 193 | ||||
| -rw-r--r-- | CORE/VOSS/inc/i_vos_packet.h | 2 | ||||
| -rw-r--r-- | CORE/WDA/inc/wlan_qct_wda.h | 8 |
19 files changed, 2692 insertions, 718 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h index 36ec82d96272..8d56aa85f50f 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg80211.h +++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h @@ -172,6 +172,8 @@ enum qca_nl80211_vendor_subcmds { /* Set nodfs_flag */ QCA_NL80211_VENDOR_SUBCMD_NO_DFS_FLAG = 40, + QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_LOST = 41, + /* Get Concurrency Matrix */ QCA_NL80211_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX = 42, @@ -197,6 +199,24 @@ enum qca_nl80211_vendor_subcmds { QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_ABORTED = 58, QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_NOP_FINISHED = 59, QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_RADAR_DETECTED = 60, + + QCA_NL80211_VENDOR_SUBCMD_GET_FIRMWARE_VERSION = 61, + QCA_NL80211_VENDOR_SUBCMD_GET_DRIVER_VERSION = 62, + QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET = 63, + QCA_NL80211_VENDOR_SUBCMD_ROAM = 64, + QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SSID_HOTLIST = 65, + QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SSID_HOTLIST = 66, + QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_FOUND = 67, + QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_LOST = 68, + QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_LIST = 69, + QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_PASSPOINT_LIST = 70, + QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_RESET_PASSPOINT_LIST = 71, + QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_NETWORK_FOUND = 72, + QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_PASSPOINT_NETWORK_FOUND = 73, + + /* Wi-Fi Configuration subcommands */ + QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION = 74, + QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_CONFIGURATION = 75, }; enum qca_nl80211_vendor_subcmds_index { @@ -249,6 +269,10 @@ enum qca_nl80211_vendor_subcmds_index { QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_ABORTED_INDEX, QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_NOP_FINISHED_INDEX, QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_RADAR_DETECTED_INDEX, +#ifdef FEATURE_WLAN_EXTSCAN + QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_LOST_INDEX, + QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_NETWORK_FOUND_INDEX, +#endif /* FEATURE_WLAN_EXTSCAN */ }; /* EXT TDLS */ @@ -376,10 +400,10 @@ enum qca_wlan_vendor_attr_extscan_config_params * BSSID/RSSI history buffer (keep the highest RSSI APs). */ QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN, - /* Unsigned 8-bit value; In %, when scan buffer is this much full, wake up + /* Unsigned 8-bit value; in %, when scan buffer is this much full, wake up * APPS. */ - QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT, /* Unsigned 8-bit value; number of scan bucket specs; followed by a nested * array of_EXTSCAN_BUCKET_SPEC_* attributes and values. The size of the * array is determined by NUM_BUCKETS. @@ -426,6 +450,49 @@ enum qca_wlan_vendor_attr_extscan_config_params * AP_THRESHOLD_PARAM attributes. Size of the array is NUM_AP. */ QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_NUM_AP, + /* Unsigned 32bit value; number of samples to confirm AP loss. */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_LOST_AP_SAMPLE_SIZE, + + /* Unsigned 32-bit value. If max_period is non zero or different than + * period, then this bucket is an exponential backoff bucket. + */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_MAX_PERIOD, + /* Unsigned 32-bit value. */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_EXPONENT, + /* Unsigned 32-bit value. For exponential back off bucket, number of scans + * performed at a given period and until the exponent is applied. + */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_STEP_COUNT, + /* Unsigned 8-bit value; in number of scans, wake up AP after these + * many scans. + */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS, + + /* NL attributes for data used by + * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SSID_HOTLIST sub command. + */ + /* Unsigned 32bit value; number of samples to confirm SSID loss. */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_LOST_SSID_SAMPLE_SIZE, + /* Number of hotlist SSIDs as unsigned 32-bit value, followed by a nested + * array of SSID_THRESHOLD_PARAM_* attributes and values. The size of the + * array is determined by NUM_SSID. + */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID, + /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_* attributes. + * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID + */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM, + + /* An array of 33 x Unsigned 8-bit value; NULL terminated SSID */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_SSID, + /* Unsigned 8-bit value */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_BAND, + /* Signed 32-bit value */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_LOW, + /* Signed 32-bit value */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_HIGH, + + /* keep last */ QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_AFTER_LAST, @@ -468,7 +535,7 @@ enum qca_wlan_vendor_attr_extscan_results /* Signed 32bit value */ QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_REPORTING_THRESHOLD, /* Unsigned 32bit value */ - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_HOTLIST_APS, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_HOTLIST_BSSIDS, /* Unsigned 32bit value */ QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SIGNIFICANT_WIFI_CHANGE_APS, /* Unsigned 32bit value */ @@ -479,7 +546,7 @@ enum qca_wlan_vendor_attr_extscan_results */ /* Unsigned 32-bit value */ - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE, /* EXTSCAN attributes used with @@ -521,6 +588,12 @@ enum qca_wlan_vendor_attr_extscan_results */ QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA, + /* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE + * to indicate number of wifi scan results/bssids retrieved by the scan. + * Also, use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST to indicate the list + * of wifi scan results returned for each cached result block. + */ + /* EXTSCAN attributes for * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_EVENT sub-command. */ @@ -532,7 +605,7 @@ enum qca_wlan_vendor_attr_extscan_results /* EXTSCAN attributes for * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND sub-command. */ - /* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE + /* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE * to indicate number of results. */ @@ -551,6 +624,72 @@ enum qca_wlan_vendor_attr_extscan_results */ QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_RSSI_LIST, + /* EXTSCAN attributes used with + * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS sub-command. + */ + /* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE + * to indicate number of gscan cached results returned. + * Also, use QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_LIST to indicate + * the list of gscan cached results. + */ + + /* An array of NUM_RESULTS_AVAILABLE x + * QCA_NL80211_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_* + */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_LIST, + /* Unsigned 32-bit value; a unique identifier for the scan unit. */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_SCAN_ID, + /* Unsigned 32-bit value; a bitmask w/additional information about scan. */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_FLAGS, + /* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE + * to indicate number of wifi scan results/bssids retrieved by the scan. + * Also, use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST to indicate the list + * of wifi scan results returned for each cached result block. + */ + + /* EXTSCAN attributes for + * QCA_NL80211_VENDOR_SUBCMD_PNO_NETWORK_FOUND sub-command. + */ + /* Use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE for number + * of results. + * Use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST to indicate the nested + * list of wifi scan results returned for each wifi_passpoint_match_result block. + * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE. + */ + + /* EXTSCAN attributes for + * QCA_NL80211_VENDOR_SUBCMD_PNO_PASSPOINT_NETWORK_FOUND sub-command. + */ + /* Unsigned 32-bit value */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_NETWORK_FOUND_NUM_MATCHES, + /* A nested array of + * QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_* + * attributes. Array size = + * *_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_NETWORK_FOUND_NUM_MATCHES. + */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_RESULT_LIST, + + /* Unsigned 32-bit value; network block id for the matched network */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ID, + /* Use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST to indicate the nested + * list of wifi scan results returned for each wifi_passpoint_match_result block. + */ + /* Unsigned 32-bit value */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ANQP_LEN, + /* An array size of PASSPOINT_MATCH_ANQP_LEN of unsigned 8-bit values; + * ANQP data in the information_element format. + */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ANQP, + + /* Unsigned 32bit value; a EXTSCAN Capabilities attribute. */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_HOTLIST_SSIDS, + /* Unsigned 32bit value; a EXTSCAN Capabilities attribute. */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_EPNO_NETS, + /* Unsigned 32bit value; a EXTSCAN Capabilities attribute. */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_EPNO_NETS_BY_SSID, + /* Unsigned 32bit value; a EXTSCAN Capabilities attribute. */ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_WHITELISTED_SSID, + /* keep last */ QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_AFTER_LAST, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_MAX = @@ -827,6 +966,18 @@ enum qca_wlan_vendor_attr_ll_stats_results */ QCA_WLAN_VENDOR_ATTR_LL_STATS_RESULTS_MORE_DATA, + /* Unsigned 64bit value */ + QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_AVERAGE_TSF_OFFSET, + + /* Unsigned 32bit value */ + QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_DETECTED, + + /* Unsigned 32bit value */ + QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_AVG_NUM_FRAMES_LEAKED, + + /* Unsigned 32bit value */ + QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_GUARD_TIME, + /* keep last */ QCA_WLAN_VENDOR_ATTR_LL_STATS_AFTER_LAST, QCA_WLAN_VENDOR_ATTR_LL_STATS_MAX = @@ -945,6 +1096,138 @@ enum qca_wlan_vendor_attr_ocb_set_sched QCA_WLAN_VENDOR_ATTR_OCB_SET_SCHED_AFTER_LAST - 1, }; +/* NL attributes for data used by + * QCA_NL80211_VENDOR_SUBCMD_SET|GET_WIFI_CONFIGURATION sub commands. + */ +enum qca_wlan_vendor_attr_wifi_config { + QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_INVALID = 0, + /* Unsigned 32-bit value */ + QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_DYNAMIC_DTIM = 1, + /* Unsigned 32-bit value */ + QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_STATS_AVG_FACTOR = 2, + /* Unsigned 32-bit value */ + QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_GUARD_TIME = 3, + /* keep last */ + QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_MAX = + QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_AFTER_LAST - 1, +}; + +enum qca_wlan_vendor_attr_pno_config_params { + QCA_WLAN_VENDOR_ATTR_PNO_INVALID = 0, + /* NL attributes for data used by + * QCA_NL80211_VENDOR_SUBCMD_PNO_SET_PASSPOINT_LIST sub command. + */ + /* Unsigned 32-bit value */ + QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM = 1, + /* Array of nested QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_* + * attributes. Array size = + * QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM. + */ + QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NETWORK_ARRAY = 2, + + /* Unsigned 32-bit value */ + QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ID = 3, + /* An array of 256 x Unsigned 8-bit value; NULL terminated UTF8 encoded + * realm, 0 if unspecified. + */ + QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_REALM = 4, + /* An array of 16 x Unsigned 32-bit value; roaming consortium ids + * to match, 0 if unspecified. + */ + QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_CNSRTM_ID = 5, + /* An array of 6 x Unsigned 8-bit value; mcc/mnc combination, 0s if + * unspecified. + */ + QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_PLMN = 6, + + /* NL attributes for data used by + * QCA_NL80211_VENDOR_SUBCMD_PNO_SET_LIST sub command. + */ + /* Unsigned 32-bit value */ + QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS = 7, + /* Array of nested + * QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_* + * attributes. Array size = + * QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS. + */ + QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORKS_LIST = 8, + /* An array of 33 x Unsigned 8-bit value; NULL terminated SSID */ + QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID = 9, + /* Signed 8-bit value; threshold for considering this SSID as found, + * required granularity for this threshold is 4dBm to 8dBm + */ + QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_RSSI_THRESHOLD = 10, + /* Unsigned 8-bit value; WIFI_PNO_FLAG_XXX */ + QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS = 11, + /* Unsigned 8-bit value; auth bit field for matching WPA IE */ + QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT = 12, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_PNO_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_PNO_MAX = + QCA_WLAN_VENDOR_ATTR_PNO_AFTER_LAST - 1, +}; + +enum qca_wlan_vendor_attr_roaming_config_params { + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_INVALID = 0, + + QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD = 1, + QCA_WLAN_VENDOR_ATTR_ROAMING_REQ_ID = 2, + + /* Attributes for wifi_set_ssid_white_list */ + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID_NUM_NETWORKS = 3, + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID_LIST = 4, + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID = 5, + + /* Attributes for set_roam_params */ + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_THRESHOLD = 6, + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_THRESHOLD = 7, + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_FACTOR = 8, + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_FACTOR = 9, + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_MAX_BOOST = 10, + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_LAZY_ROAM_HISTERESYS = 11, + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_ALERT_ROAM_RSSI_TRIGGER = 12, + + /* Attribute for set_lazy_roam */ + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_ENABLE = 13, + + /* Attribute for set_lazy_roam with preferences */ + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PREFS = 14, + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_NUM_BSSID = 15, + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_BSSID = 16, + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_RSSI_MODIFIER = 17, + + /* Attribute for set_ blacklist bssid params */ + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS = 18, + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_NUM_BSSID = 19, + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_BSSID = 20, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX = + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_AFTER_LAST - 1, +}; + +/* + * QCA_NL80211_VENDOR_SUBCMD_ROAM sub commands. + */ +enum qca_wlan_vendor_attr_roam_subcmd +{ + QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SSID_WHITE_LIST = 1, + QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_EXTSCAN_ROAM_PARAMS = 2, + QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_LAZY_ROAM = 3, + QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BSSID_PREFS = 4, + QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BSSID_PARAMS = 5, + QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BLACKLIST_BSSID = 6, + + /* KEEP LAST */ + QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_MAX = + QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_AFTER_LAST - 1, +}; + /** * enum qca_wlan_vendor_features - vendor device/driver features * @QCA_WLAN_VENDOR_FEATURE_KEY_MGMT_OFFLOAD: Device supports key @@ -980,6 +1263,9 @@ enum qca_wlan_vendor_features { #define WIFI_FEATURE_AP_STA 0x8000 /* Support for AP STA Concurrency */ #define WIFI_FEATURE_LINK_LAYER_STATS 0x10000 /* Link layer stats */ +#define WIFI_FEATURE_LOGGER 0x20000 /* WiFi Logger */ +#define WIFI_FEATURE_HAL_EPNO 0x40000 /* WiFi PNO enhanced */ + /* Add more features here */ @@ -1018,6 +1304,27 @@ enum qca_wlan_vendor_acs_hw_mode { QCA_ACS_MODE_IEEE80211AD, }; +/** + * enum qca_wlan_vendor_config: wifi config attr + * + * @QCA_WLAN_VENDOR_ATTR_CONFIG_INVALID: invalid config + * @QCA_WLAN_VENDOR_ATTR_CONFIG_DYNAMIC_DTIM: dynamic dtim + * @QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR: stats avg. factor + * @QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME: guard time + * @QCA_WLAN_VENDOR_ATTR_CONFIG_LAST: last config + * @QCA_WLAN_VENDOR_ATTR_CONFIG_MAX: max config + */ +enum qca_wlan_vendor_config { + QCA_WLAN_VENDOR_ATTR_CONFIG_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_CONFIG_DYNAMIC_DTIM, + QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR, + QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME, + /* keep last */ + QCA_WLAN_VENDOR_ATTR_CONFIG_LAST, + QCA_WLAN_VENDOR_ATTR_CONFIG_MAX = + QCA_WLAN_VENDOR_ATTR_CONFIG_LAST - 1 +}; + struct cfg80211_bss* wlan_hdd_cfg80211_update_bss_db( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo ); diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index b14a650e8703..078aa5d94ca2 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -829,7 +829,8 @@ wlan_hdd_extscan_config_policy[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_ [QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS] = { .type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD] = { .type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN] = { .type = NLA_U32 }, - [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD] = { .type = NLA_U8 }, + [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT] = { .type = NLA_U8 }, + [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS] = { .type = NLA_U8 }, [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS] = { .type = NLA_U8 }, [QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_FLUSH] = { .type = NLA_U8 }, @@ -843,6 +844,12 @@ wlan_hdd_extscan_config_policy[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_ [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_LOST_AP_SAMPLE_SIZE] = { .type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_MIN_BREACHING] = { .type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_NUM_AP] = { .type = NLA_U32 }, + [QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS] = { .type = NLA_U32 }, + [QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID] = { .type = NLA_BINARY, + .len = IEEE80211_MAX_SSID_LEN }, + [QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_RSSI_THRESHOLD] = { .type = NLA_S8 }, + [QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS] = { .type = NLA_U8 }, + [QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT] = { .type = NLA_U8 }, }; static const struct nla_policy @@ -1171,6 +1178,12 @@ static const struct nl80211_vendor_cmd_info wlan_hdd_cfg80211_vendor_events[] = .vendor_id = QCA_NL80211_VENDOR_ID, .subcmd = QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_RADAR_DETECTED }, +#ifdef FEATURE_WLAN_EXTSCAN + [QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_NETWORK_FOUND_INDEX] = { + .vendor_id = QCA_NL80211_VENDOR_ID, + .subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_NETWORK_FOUND + }, +#endif /* FEATURE_WLAN_EXTSCAN */ }; static int is_driver_dfs_capable(struct wiphy *wiphy, @@ -1247,7 +1260,7 @@ wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy, #ifdef FEATURE_WLAN_EXTSCAN if (sme_IsFeatureSupportedByFW(EXTENDED_SCAN)) { hddLog(LOG1, FL("EXTScan is supported by firmware")); - fset |= WIFI_FEATURE_EXTSCAN; + fset |= WIFI_FEATURE_EXTSCAN | WIFI_FEATURE_HAL_EPNO; } #endif @@ -1786,10 +1799,6 @@ static int wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy, hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr channel failed")); goto fail; } - pReqMsg->ap[i].channel = nla_get_u32( - tb2[QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_CHANNEL]); - hddLog(VOS_TRACE_LEVEL_INFO, FL("Channel (%u)"), - pReqMsg->ap[i].channel); i++; } @@ -1941,10 +1950,6 @@ static int wlan_hdd_cfg80211_extscan_set_significant_change( hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr channel failed")); goto fail; } - pReqMsg->ap[i].channel = nla_get_u32( - tb2[QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_CHANNEL]); - hddLog(VOS_TRACE_LEVEL_INFO, - FL("Channel (%u)"), pReqMsg->ap[i].channel); i++; } @@ -2050,270 +2055,314 @@ static int wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy, return -EINVAL; } -static int wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, - struct wireless_dev *wdev, - const void *data, - int data_len) +static int hdd_extscan_start_fill_bucket_channel_spec( + hdd_context_t *pHddCtx, + tpSirWifiScanCmdReqParams pReqMsg, + struct nlattr **tb) { - tpSirWifiScanCmdReqParams pReqMsg = NULL; - struct net_device *dev = wdev->netdev; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - hdd_context_t *pHddCtx = wiphy_priv(wiphy); - struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; - struct nlattr *bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; - struct nlattr *channel[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; - struct nlattr *buckets; - struct nlattr *channels; - int rem1, rem2; - eHalStatus status; - tANI_U8 bktIndex, j, numChannels; - tANI_U32 chanList[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0}; - - ENTER(); - - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, - data, data_len, - wlan_hdd_extscan_config_policy)) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("Invalid ATTR")); - return -EINVAL; - } - - pReqMsg = vos_mem_malloc(sizeof(*pReqMsg)); - if (!pReqMsg) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("vos_mem_malloc failed")); - return -ENOMEM; - } - - /* Parse and fetch request Id */ - if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr request id failed")); - goto fail; - } + struct nlattr *bucket[ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; + struct nlattr *channel[ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; + struct nlattr *buckets; + struct nlattr *channels; + int rem1, rem2; + eHalStatus status; + uint8_t bktIndex, j, numChannels; + uint32_t chanList[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0}; + + bktIndex = 0; + nla_for_each_nested(buckets, + tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC], rem1) { + if (nla_parse(bucket, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, + nla_data(buckets), nla_len(buckets), NULL)) { + hddLog(LOGE, FL("nla_parse failed")); + return -EINVAL; + } - pReqMsg->requestId = nla_get_u32( - tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]); - hddLog(VOS_TRACE_LEVEL_INFO, FL("Req Id (%d)"), pReqMsg->requestId); + /* Parse and fetch bucket spec */ + if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_INDEX]) { + hddLog(LOGE, FL("attr bucket index failed")); + return -EINVAL; + } + pReqMsg->buckets[bktIndex].bucket = nla_get_u8( + bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_INDEX]); + hddLog(LOG1, FL("Bucket spec Index (%d)"), + pReqMsg->buckets[bktIndex].bucket); + + /* Parse and fetch wifi band */ + if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BAND]) { + hddLog(LOGE, FL("attr wifi band failed")); + return -EINVAL; + } + pReqMsg->buckets[bktIndex].band = nla_get_u8( + bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BAND]); + hddLog(LOG1, FL("Wifi band (%d)"), + pReqMsg->buckets[bktIndex].band); + + /* Parse and fetch period */ + if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_PERIOD]) { + hddLog(LOGE, FL("attr period failed")); + return -EINVAL; + } + pReqMsg->buckets[bktIndex].period = nla_get_u32( + bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_PERIOD]); + hddLog(LOG1, FL("period (%d)"), + pReqMsg->buckets[bktIndex].period); + + /* Parse and fetch report events */ + if (!bucket[ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_REPORT_EVENTS]) { + hddLog(LOGE, FL("attr report events failed")); + return -EINVAL; + } + pReqMsg->buckets[bktIndex].reportEvents = nla_get_u8( + bucket[ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_REPORT_EVENTS]); + hddLog(LOG1, FL("report events (%d)"), + pReqMsg->buckets[bktIndex].reportEvents); + + /* Framework shall pass the channel list if the input WiFi band is + * WIFI_BAND_UNSPECIFIED. + * If the input WiFi band is specified (any value other than + * WIFI_BAND_UNSPECIFIED) then driver populates the channel list */ + if (pReqMsg->buckets[bktIndex].band != WIFI_BAND_UNSPECIFIED) { + numChannels = 0; + hddLog(LOG1, "WiFi band is specified, driver to fill channel list"); + status = sme_GetValidChannelsByBand(pHddCtx->hHal, + pReqMsg->buckets[bktIndex].band, + chanList, &numChannels); + if (!HAL_STATUS_SUCCESS(status)) { + hddLog(LOGE, + FL("sme_GetValidChannelsByBand failed (err=%d)"), + status); + return -EINVAL; + } - pReqMsg->sessionId = pAdapter->sessionId; - hddLog(VOS_TRACE_LEVEL_INFO, FL("Session Id (%d)"), pReqMsg->sessionId); + pReqMsg->buckets[bktIndex].numChannels = + VOS_MIN(numChannels, WLAN_EXTSCAN_MAX_CHANNELS); + hddLog(LOG1, FL("Num channels (%d)"), + pReqMsg->buckets[bktIndex].numChannels); + + for (j = 0; j < pReqMsg->buckets[bktIndex].numChannels; + j++) { + pReqMsg->buckets[bktIndex].channels[j].channel = + chanList[j]; + pReqMsg->buckets[bktIndex].channels[j]. + chnlClass = 0; + if (CSR_IS_CHANNEL_DFS( + vos_freq_to_chan(chanList[j]))) { + pReqMsg->buckets[bktIndex].channels[j]. + passive = 1; + pReqMsg->buckets[bktIndex].channels[j]. + dwellTimeMs = + CFG_PASSIVE_MAX_CHANNEL_TIME_DEFAULT; + } else { + pReqMsg->buckets[bktIndex].channels[j]. + passive = 0; + pReqMsg->buckets[bktIndex].channels[j]. + dwellTimeMs = + CFG_ACTIVE_MAX_CHANNEL_TIME_DEFAULT; + } - /* Parse and fetch base period */ - if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD]) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr base period failed")); - goto fail; - } - pReqMsg->basePeriod = nla_get_u32( - tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD]); - hddLog(VOS_TRACE_LEVEL_INFO, FL("Base Period (%d)"), - pReqMsg->basePeriod); + hddLog(LOG1, + "Channel(%u) Passive(%u) Dwell time(%u ms) Class(%u)", + pReqMsg->buckets[bktIndex].channels[j].channel, + pReqMsg->buckets[bktIndex].channels[j].passive, + pReqMsg->buckets[bktIndex].channels[j].dwellTimeMs, + pReqMsg->buckets[bktIndex].channels[j].chnlClass); + } + continue; + } - /* Parse and fetch max AP per scan */ - if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN]) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr max_ap_per_scan failed")); - goto fail; - } - pReqMsg->maxAPperScan = nla_get_u32( - tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN]); - hddLog(VOS_TRACE_LEVEL_INFO, FL("Max AP per Scan (%d)"), - pReqMsg->maxAPperScan); + /* Parse and fetch number of channels */ + if (!bucket[ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS]) { + hddLog(LOGE, FL("attr num channels failed")); + return -EINVAL; + } + pReqMsg->buckets[bktIndex].numChannels = + nla_get_u32(bucket[ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS]); + hddLog(LOG1, FL("num channels (%d)"), + pReqMsg->buckets[bktIndex].numChannels); + + if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC]) { + hddLog(LOGE, FL("attr channel spec failed")); + return -EINVAL; + } - /* Parse and fetch report threshold */ - if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD]) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr report_threshold failed")); - goto fail; - } - pReqMsg->reportThreshold = nla_get_u8( - tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD]); - hddLog(VOS_TRACE_LEVEL_INFO, FL("Report Threshold (%d)"), - pReqMsg->reportThreshold); + j = 0; + nla_for_each_nested(channels, + bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC], rem2) { + if (nla_parse(channel, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, + nla_data(channels), nla_len(channels), + wlan_hdd_extscan_config_policy)) { + hddLog(LOGE, FL("nla_parse failed")); + return -EINVAL; + } - /* Parse and fetch number of buckets */ - if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS]) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr number of buckets failed")); - goto fail; - } - pReqMsg->numBuckets = nla_get_u8( - tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS]); - if (pReqMsg->numBuckets > WLAN_EXTSCAN_MAX_BUCKETS) { - hddLog(VOS_TRACE_LEVEL_WARN, FL("Exceeded MAX number of buckets " - "Setting numBuckets to %u"), WLAN_EXTSCAN_MAX_BUCKETS); - pReqMsg->numBuckets = WLAN_EXTSCAN_MAX_BUCKETS; - } - hddLog(VOS_TRACE_LEVEL_INFO, FL("Number of Buckets (%d)"), - pReqMsg->numBuckets); - if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC]) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr bucket spec failed")); - goto fail; - } + /* Parse and fetch channel */ + if (!channel[ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CHANNEL]) { + hddLog(LOGE, FL("attr channel failed")); + return -EINVAL; + } + pReqMsg->buckets[bktIndex].channels[j].channel = + nla_get_u32(channel[ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CHANNEL]); + hddLog(LOG1, FL("channel (%u)"), + pReqMsg->buckets[bktIndex].channels[j].channel); + + /* Parse and fetch dwell time */ + if (!channel[ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_DWELL_TIME]) { + hddLog(LOGE, FL("attr dwelltime failed")); + return -EINVAL; + } + pReqMsg->buckets[bktIndex].channels[j].dwellTimeMs = + nla_get_u32(channel[ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_DWELL_TIME]); + hddLog(LOG1, FL("Dwell time (%u ms)"), + pReqMsg->buckets[bktIndex].channels[j].dwellTimeMs); + + /* Parse and fetch channel spec passive */ + if (!channel[ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_PASSIVE]) { + hddLog(LOGE, + FL("attr channel spec passive failed")); + return -EINVAL; + } + pReqMsg->buckets[bktIndex].channels[j].passive = + nla_get_u8(channel[ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_PASSIVE]); + hddLog(LOG1, FL("Chnl spec passive (%u)"), + pReqMsg->buckets[bktIndex].channels[j].passive); + j++; + } + bktIndex++; + } + return 0; +} - bktIndex = 0; - nla_for_each_nested(buckets, - tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC], rem1) { - if (nla_parse(bucket, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, - nla_data(buckets), nla_len(buckets), NULL)) { //policy - hddLog(VOS_TRACE_LEVEL_ERROR, FL("nla_parse failed")); - goto fail; - } +static int wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + tpSirWifiScanCmdReqParams pReqMsg = NULL; + struct net_device *dev = wdev->netdev; + hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_context_t *pHddCtx = wiphy_priv(wiphy); + struct nlattr *tb[ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; + eHalStatus status; - /* Parse and fetch bucket spec */ - if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_INDEX]) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr bucket index failed")); - goto fail; - } - pReqMsg->buckets[bktIndex].bucket = nla_get_u8( - bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_INDEX]); - hddLog(VOS_TRACE_LEVEL_INFO, FL("Bucket spec Index (%d)"), - pReqMsg->buckets[bktIndex].bucket); - - /* Parse and fetch wifi band */ - if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BAND]) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr wifi band failed")); - goto fail; - } - pReqMsg->buckets[bktIndex].band = nla_get_u8( - bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BAND]); - hddLog(VOS_TRACE_LEVEL_INFO, FL("Wifi band (%d)"), - pReqMsg->buckets[bktIndex].band); - - /* Parse and fetch period */ - if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_PERIOD]) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr period failed")); - goto fail; - } - pReqMsg->buckets[bktIndex].period = nla_get_u32( - bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_PERIOD]); - hddLog(VOS_TRACE_LEVEL_INFO, FL("period (%d)"), - pReqMsg->buckets[bktIndex].period); - - /* Parse and fetch report events */ - if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_REPORT_EVENTS]) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr report events failed")); - goto fail; - } - pReqMsg->buckets[bktIndex].reportEvents = nla_get_u8( - bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_REPORT_EVENTS]); - hddLog(VOS_TRACE_LEVEL_INFO, FL("report events (%d)"), - pReqMsg->buckets[bktIndex].reportEvents); - - /* Framework shall pass the channel list if the input WiFi band is - * WIFI_BAND_UNSPECIFIED. - * If the input WiFi band is specified (any value other than - * WIFI_BAND_UNSPECIFIED) then driver populates the channel list */ - if (pReqMsg->buckets[bktIndex].band != WIFI_BAND_UNSPECIFIED) { - numChannels = 0; - hddLog(LOG1, "WiFi band is specified, driver to fill channel list"); - status = sme_GetValidChannelsByBand(pHddCtx->hHal, - pReqMsg->buckets[bktIndex].band, - chanList, &numChannels); - if (!HAL_STATUS_SUCCESS(status)) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("sme_GetValidChannelsByBand failed (err=%d)"), status); - goto fail; - } + ENTER(); - pReqMsg->buckets[bktIndex].numChannels = - VOS_MIN(numChannels, WLAN_EXTSCAN_MAX_CHANNELS); - hddLog(LOG1, FL("Num channels (%d)"), - pReqMsg->buckets[bktIndex].numChannels); - - for (j = 0; j < pReqMsg->buckets[bktIndex].numChannels; j++) { - pReqMsg->buckets[bktIndex].channels[j].channel = chanList[j]; - pReqMsg->buckets[bktIndex].channels[j].chnlClass = 0; - if (CSR_IS_CHANNEL_DFS(vos_freq_to_chan(chanList[j]))) { - pReqMsg->buckets[bktIndex].channels[j].passive = 1; - pReqMsg->buckets[bktIndex].channels[j].dwellTimeMs = - CFG_PASSIVE_MAX_CHANNEL_TIME_DEFAULT; - } else { - pReqMsg->buckets[bktIndex].channels[j].passive = 0; - pReqMsg->buckets[bktIndex].channels[j].dwellTimeMs = - CFG_ACTIVE_MAX_CHANNEL_TIME_DEFAULT; - } + if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, + data, data_len, + wlan_hdd_extscan_config_policy)) { + hddLog(LOGE, FL("Invalid ATTR")); + return -EINVAL; + } - hddLog(LOG1, - "Channel(%u) Passive(%u) Dwell time(%u ms) Class(%u)", - pReqMsg->buckets[bktIndex].channels[j].channel, - pReqMsg->buckets[bktIndex].channels[j].passive, - pReqMsg->buckets[bktIndex].channels[j].dwellTimeMs, - pReqMsg->buckets[bktIndex].channels[j].chnlClass); - } - continue; - } + pReqMsg = vos_mem_malloc(sizeof(*pReqMsg)); + if (!pReqMsg) { + hddLog(LOGE, FL("vos_mem_malloc failed")); + return -ENOMEM; + } - /* Parse and fetch number of channels */ - if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS]) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr num channels failed")); - goto fail; - } - pReqMsg->buckets[bktIndex].numChannels = nla_get_u32( - bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS]); - hddLog(VOS_TRACE_LEVEL_INFO, FL("num channels (%d)"), - pReqMsg->buckets[bktIndex].numChannels); + /* Parse and fetch request Id */ + if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) { + hddLog(LOGE, FL("attr request id failed")); + goto fail; + } - if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC]) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr channel spec failed")); - goto fail; - } + pReqMsg->requestId = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]); + hddLog(LOG1, FL("Req Id (%d)"), pReqMsg->requestId); - j = 0; - nla_for_each_nested(channels, - bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC], rem2) { - if (nla_parse(channel, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, - nla_data(channels), nla_len(channels), - wlan_hdd_extscan_config_policy)) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("nla_parse failed")); - goto fail; - } + pReqMsg->sessionId = pAdapter->sessionId; + hddLog(LOG1, FL("Session Id (%d)"), pReqMsg->sessionId); - /* Parse and fetch channel */ - if (!channel[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CHANNEL]) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr channel failed")); - goto fail; - } - pReqMsg->buckets[bktIndex].channels[j].channel = nla_get_u32( - channel[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CHANNEL]); - hddLog(VOS_TRACE_LEVEL_INFO, FL("channel (%u)"), - pReqMsg->buckets[bktIndex].channels[j].channel); - - /* Parse and fetch dwell time */ - if (!channel[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_DWELL_TIME]) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr dwelltime failed")); - goto fail; - } - pReqMsg->buckets[bktIndex].channels[j].dwellTimeMs = nla_get_u32( - channel[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_DWELL_TIME]); - hddLog(VOS_TRACE_LEVEL_INFO, FL("Dwell time (%u ms)"), - pReqMsg->buckets[bktIndex].channels[j].dwellTimeMs); + /* Parse and fetch base period */ + if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD]) { + hddLog(LOGE, FL("attr base period failed")); + goto fail; + } + pReqMsg->basePeriod = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD]); + hddLog(LOG1, FL("Base Period (%d)"), + pReqMsg->basePeriod); + + /* Parse and fetch max AP per scan */ + if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN]) { + hddLog(LOGE, FL("attr max_ap_per_scan failed")); + goto fail; + } + pReqMsg->maxAPperScan = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN]); + hddLog(LOG1, FL("Max AP per Scan (%d)"), + pReqMsg->maxAPperScan); + + /* Parse and fetch report threshold percent */ + if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT]) { + hddLog(LOGE, FL("attr report_threshold percent failed")); + goto fail; + } + pReqMsg->report_threshold_percent = nla_get_u8( + tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT]); + hddLog(LOG1, FL("Report Threshold percent(%d)"), + pReqMsg->report_threshold_percent); + + /* Parse and fetch report threshold num scans */ + if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS]) { + hddLog(LOGE, FL("attr report_threshold num scans failed")); + goto fail; + } + pReqMsg->report_threshold_num_scans = nla_get_u8( + tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS]); + hddLog(LOG1, FL("Report Threshold num scans(%d)"), + pReqMsg->report_threshold_num_scans); + + /* Parse and fetch number of buckets */ + if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS]) { + hddLog(LOGE, FL("attr number of buckets failed")); + goto fail; + } + pReqMsg->numBuckets = nla_get_u8( + tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS]); + if (pReqMsg->numBuckets > WLAN_EXTSCAN_MAX_BUCKETS) { + hddLog(LOGW, FL("Exceeded MAX number of buckets " + "Setting numBuckets to %u"), WLAN_EXTSCAN_MAX_BUCKETS); + pReqMsg->numBuckets = WLAN_EXTSCAN_MAX_BUCKETS; + } + hddLog(LOG1, FL("Number of Buckets (%d)"), + pReqMsg->numBuckets); + if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC]) { + hddLog(LOGE, FL("attr bucket spec failed")); + goto fail; + } - /* Parse and fetch channel spec passive */ - if (!channel[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_PASSIVE]) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("attr channel spec passive failed")); - goto fail; - } - pReqMsg->buckets[bktIndex].channels[j].passive = nla_get_u8( - channel[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_PASSIVE]); - hddLog(VOS_TRACE_LEVEL_INFO, FL("Chnl spec passive (%u)"), - pReqMsg->buckets[bktIndex].channels[j].passive); - j++; - } - bktIndex++; - } + if (hdd_extscan_start_fill_bucket_channel_spec(pHddCtx, pReqMsg, tb)) + goto fail; - status = sme_ExtScanStart(pHddCtx->hHal, pReqMsg); - if (!HAL_STATUS_SUCCESS(status)) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("sme_ExtScanStart failed(err=%d)"), status); - vos_mem_free(pReqMsg); - return -EINVAL; - } + status = sme_ExtScanStart(pHddCtx->hHal, pReqMsg); + if (!HAL_STATUS_SUCCESS(status)) { + hddLog(LOGE, + FL("sme_ExtScanStart failed(err=%d)"), status); + vos_mem_free(pReqMsg); + return -EINVAL; + } - return 0; + return 0; fail: - vos_mem_free(pReqMsg); - return -EINVAL; + vos_mem_free(pReqMsg); + return -EINVAL; } static int wlan_hdd_cfg80211_extscan_stop(struct wiphy *wiphy, @@ -2482,6 +2531,177 @@ fail: return -EINVAL; } +/** + * hdd_extscan_epno_fill_network_list() - epno fill network list + * @hddctx: HDD context + * @req_msg: request message + * @tb: vendor attribute table + * + * This function reads the network block NL vendor attributes from %tb and + * fill in the epno request message. + * + * Return: 0 on success, error number otherwise + */ +static int hdd_extscan_epno_fill_network_list( + hdd_context_t *hddctx, + struct wifi_epno_params *req_msg, + struct nlattr **tb) +{ + struct nlattr *network[ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; + struct nlattr *networks; + int rem1, ssid_len; + uint8_t index, *ssid; + + index = 0; + nla_for_each_nested(networks, + tb[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORKS_LIST], + rem1) { + if (nla_parse(network, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, + nla_data(networks), nla_len(networks), NULL)) { + hddLog(LOGE, FL("nla_parse failed")); + return -EINVAL; + } + + /* Parse and fetch ssid */ + if (!network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID]) { + hddLog(LOGE, FL("attr network ssid failed")); + return -EINVAL; + } + ssid_len = nla_len( + network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID]); + + /* Decrement by 1, don't count null character */ + ssid_len--; + + req_msg->networks[index].ssid.length = ssid_len; + hddLog(LOG1, FL("network ssid length (%d)"), ssid_len); + ssid = nla_data(network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID]); + vos_mem_copy(req_msg->networks[index].ssid.ssId, ssid, ssid_len); + hddLog(LOG1, FL("Ssid (%.*s)"), + req_msg->networks[index].ssid.length, + req_msg->networks[index].ssid.ssId); + + /* Parse and fetch rssi threshold */ + if (!network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_RSSI_THRESHOLD]) { + hddLog(LOGE, FL("attr rssi threshold failed")); + return -EINVAL; + } + req_msg->networks[index].rssi_threshold = nla_get_s8( + network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_RSSI_THRESHOLD]); + hddLog(LOG1, FL("rssi threshold (%d)"), + req_msg->networks[index].rssi_threshold); + + /* Parse and fetch epno flags */ + if (!network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS]) { + hddLog(LOGE, FL("attr epno flags failed")); + return -EINVAL; + } + req_msg->networks[index].flags = nla_get_u8( + network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS]); + hddLog(LOG1, FL("flags (%u)"), req_msg->networks[index].flags); + + /* Parse and fetch auth bit */ + if (!network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT]) { + hddLog(LOGE, FL("attr auth bit failed")); + return -EINVAL; + } + req_msg->networks[index].auth_bit_field = nla_get_u8( + network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT]); + hddLog(LOG1, FL("auth bit (%u)"), + req_msg->networks[index].auth_bit_field); + + index++; + } + return 0; +} + +/** + * wlan_hdd_cfg80211_set_epno_list() - epno set network list + * @wiphy: wiphy + * @wdev: pointer to wireless dev + * @data: data pointer + * @data_len: data length + * + * This function reads the NL vendor attributes from %tb and + * fill in the epno request message. + * + * Return: 0 on success, error number otherwise + */ +static int wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + struct wifi_epno_params *req_msg = NULL; + struct net_device *dev = wdev->netdev; + hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_context_t *hdd_ctx = wiphy_priv(wiphy); + struct nlattr *tb[ + QCA_WLAN_VENDOR_ATTR_PNO_MAX + 1]; + eHalStatus status; + uint32_t num_networks, len; + + ENTER(); + + if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_PNO_MAX, + data, data_len, + wlan_hdd_extscan_config_policy)) { + hddLog(LOGE, FL("Invalid ATTR")); + return -EINVAL; + } + + /* Parse and fetch number of networks */ + if (!tb[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS]) { + hddLog(LOGE, FL("attr num networks failed")); + return -EINVAL; + } + num_networks = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS]); + hddLog(LOG1, FL("num networks (%u)"), num_networks); + + len = sizeof(*req_msg) + + (num_networks * sizeof(struct wifi_epno_network)); + req_msg = vos_mem_malloc(len); + if (!req_msg) { + hddLog(LOGE, FL("vos_mem_malloc failed")); + return -ENOMEM; + } + vos_mem_zero(req_msg, len); + req_msg->num_networks = num_networks; + + /* Parse and fetch request Id */ + if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) { + hddLog(LOGE, FL("attr request id failed")); + goto fail; + } + req_msg->request_id = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]); + hddLog(LOG1, FL("Req Id (%u)"), req_msg->request_id); + + req_msg->session_id = adapter->sessionId; + hddLog(LOG1, FL("Session Id (%d)"), req_msg->session_id); + + if (hdd_extscan_epno_fill_network_list(hdd_ctx, req_msg, tb)) + goto fail; + + status = sme_set_epno_list(hdd_ctx->hHal, req_msg); + if (!HAL_STATUS_SUCCESS(status)) { + hddLog(LOGE, FL("sme_set_epno_list failed(err=%d)"), status); + goto fail; + } + + EXIT(); + vos_mem_free(req_msg); + return 0; + +fail: + vos_mem_free(req_msg); + return -EINVAL; +} + + #endif /* FEATURE_WLAN_EXTSCAN */ /** @@ -2755,6 +2975,7 @@ static bool put_wifi_iface_stats(tpSirWifiIfaceStat pWifiIfaceStat, int i = 0; struct nlattr *wmmInfo; struct nlattr *wmmStats; + u64 average_tsf_offset; if (FALSE == put_wifi_interface_info( &pWifiIfaceStat->info, @@ -2766,6 +2987,12 @@ static bool put_wifi_iface_stats(tpSirWifiIfaceStat pWifiIfaceStat, } + average_tsf_offset = pWifiIfaceStat->avg_bcn_spread_offset_high; + average_tsf_offset = (average_tsf_offset << 32) | + pWifiIfaceStat->avg_bcn_spread_offset_low ; + + printk("putting interface values\n"); + if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_NUM_PEERS, num_peers) || @@ -2789,7 +3016,19 @@ static bool put_wifi_iface_stats(tpSirWifiIfaceStat pWifiIfaceStat, pWifiIfaceStat->rssiData) || nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_RSSI_ACK, - pWifiIfaceStat->rssiAck)) + pWifiIfaceStat->rssiAck) || + nla_put_u32(vendor_event, + QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_DETECTED, + pWifiIfaceStat->is_leaky_ap) || + nla_put_u32(vendor_event, + QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_AVG_NUM_FRAMES_LEAKED, + pWifiIfaceStat->avg_rx_frms_leaked) || + nla_put_u32(vendor_event, + QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_GUARD_TIME, + pWifiIfaceStat->rx_leak_window) || + nla_put_u64(vendor_event, + QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_AVERAGE_TSF_OFFSET, + average_tsf_offset)) { hddLog(VOS_TRACE_LEVEL_ERROR, FL("QCA_WLAN_VENDOR_ATTR put fail")); @@ -3173,14 +3412,24 @@ static void hdd_link_layer_process_iface_stats(hdd_adapter_t *pAdapter, " mgmtActionTx %u " " rssiMgmt %u " " rssiData %u " - " rssiAck %u", + " rssiAck %u " + " avg_bcn_spread_offset_high %u" + " avg_bcn_spread_offset_low %u" + " is leaky_ap %u" + " avg_rx_frms_leaked %u" + " rx_leak_window %u", pWifiIfaceStat->beaconRx, pWifiIfaceStat->mgmtRx, pWifiIfaceStat->mgmtActionRx, pWifiIfaceStat->mgmtActionTx, pWifiIfaceStat->rssiMgmt, pWifiIfaceStat->rssiData, - pWifiIfaceStat->rssiAck ); + pWifiIfaceStat->rssiAck, + pWifiIfaceStat->avg_bcn_spread_offset_high, + pWifiIfaceStat->avg_bcn_spread_offset_low, + pWifiIfaceStat->is_leaky_ap, + pWifiIfaceStat->avg_rx_frms_leaked, + pWifiIfaceStat->rx_leak_window); for (i = 0; i < WIFI_AC_MAX; i++) { @@ -5342,6 +5591,89 @@ fail: return rc; } +static const struct nla_policy +wlan_hdd_wifi_config_policy[QCA_WLAN_VENDOR_ATTR_CONFIG_MAX + +1] = +{ + [QCA_WLAN_VENDOR_ATTR_CONFIG_DYNAMIC_DTIM] = {.type = NLA_U32 }, + [QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR] = {.type = NLA_U16 }, + [QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME] = {.type = NLA_U32 }, +}; + + +/** + * wlan_hdd_cfg80211_wifi_configuration_set() - Wifi configuration + * vendor command + * + * @wiphy: wiphy device pointer + * @wdev: wireless device pointer + * @data: Vendor command data buffer + * @data_len: Buffer length + * + * Handles QCA_WLAN_VENDOR_ATTR_CONFIG_MAX. + * + * Return: EOK or other error codes. + */ +static int wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, + int data_len) +{ + struct net_device *dev = wdev->netdev; + hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_context_t *pHddCtx = wiphy_priv(wiphy); + struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_CONFIG_MAX + 1]; + int ret_val1 = 0; + int ret_val2 = 0; + u32 dynamic_dtim; + u16 stats_avg_factor; + u32 guard_time; + eHalStatus status; + + if ((ret_val1 = wlan_hdd_validate_context(pHddCtx))) { + hddLog(LOGE, FL("HDD context is not valid")); + return ret_val1; + } + + if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_CONFIG_MAX, + data, data_len, + wlan_hdd_wifi_config_policy)) { + hddLog(LOGE, FL("invalid attr")); + return -EINVAL; + } + + if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_DYNAMIC_DTIM]) { + dynamic_dtim = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_CONFIG_DYNAMIC_DTIM]); + pHddCtx->cfg_ini->enableDynamicDTIM = dynamic_dtim; + } + + if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR]) { + stats_avg_factor = nla_get_u16( + tb[QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR]); + status = sme_configure_stats_avg_factor(pHddCtx->hHal, + pAdapter->sessionId, + stats_avg_factor); + + if (eHAL_STATUS_SUCCESS != status) + ret_val1 = -EPERM; + } + + + if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME]) { + guard_time = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME]); + status = sme_configure_guard_time(pHddCtx->hHal, + pAdapter->sessionId, + guard_time); + + if (eHAL_STATUS_SUCCESS != status) + ret_val2 = -EPERM; + } + + return (ret_val1 | ret_val2); +} + const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { { @@ -5446,6 +5778,14 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = WIPHY_VENDOR_CMD_NEED_RUNNING, .doit = wlan_hdd_cfg80211_extscan_reset_significant_change }, + { + .info.vendor_id = QCA_NL80211_VENDOR_ID, + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_LIST, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | + WIPHY_VENDOR_CMD_NEED_NETDEV | + WIPHY_VENDOR_CMD_NEED_RUNNING, + .doit = wlan_hdd_cfg80211_set_epno_list + }, #endif /* FEATURE_WLAN_EXTSCAN */ #ifdef WLAN_FEATURE_LINK_LAYER_STATS @@ -5575,6 +5915,14 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = .doit = wlan_hdd_cfg80211_keymgmt_set_key }, #endif + { + .info.vendor_id = QCA_NL80211_VENDOR_ID, + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | + WIPHY_VENDOR_CMD_NEED_NETDEV | + WIPHY_VENDOR_CMD_NEED_RUNNING, + .doit = (void *)wlan_hdd_cfg80211_wifi_configuration_set + }, }; @@ -16170,47 +16518,47 @@ wlan_hdd_cfg80211_extscan_get_capabilities_ind(void *ctx, return; } - hddLog(VOS_TRACE_LEVEL_INFO, "Req Id (%u)", pData->requestId); - hddLog(VOS_TRACE_LEVEL_INFO, "Scan cache size (%u)", pData->scanCacheSize); - hddLog(VOS_TRACE_LEVEL_INFO, "Scan buckets (%u)", pData->scanBuckets); - hddLog(VOS_TRACE_LEVEL_INFO, "Max AP per scan (%u)", pData->maxApPerScan); - hddLog(VOS_TRACE_LEVEL_INFO, "maxRssiSampleSize (%u)", - pData->maxRssiSampleSize); - hddLog(VOS_TRACE_LEVEL_INFO, "maxScanReportingThreshold (%u)", - pData->maxScanReportingThreshold); - hddLog(VOS_TRACE_LEVEL_INFO, "maxHotlistAPs (%u)", pData->maxHotlistAPs); - hddLog(VOS_TRACE_LEVEL_INFO, "maxSignificantWifiChangeAPs (%u)", - pData->maxSignificantWifiChangeAPs); - hddLog(VOS_TRACE_LEVEL_INFO, "maxBsidHistoryEntries (%u)", - pData->maxBsidHistoryEntries); + hddLog(LOG1, "Req Id (%u)", pData->requestId); + hddLog(LOG1, "Scan cache size (%u)", pData->max_scan_cache_size); + hddLog(LOG1, "Scan buckets (%u)", pData->max_scan_buckets); + hddLog(LOG1, "Max AP per scan (%u)", pData->max_ap_cache_per_scan); + hddLog(LOG1, "max_rssi_sample_size (%u)", + pData->max_rssi_sample_size); + hddLog(LOG1, "max_scan_reporting_threshold (%u)", + pData->max_scan_reporting_threshold); + hddLog(LOG1, "max_hotlist_aps (%u)", pData->max_hotlist_aps); + hddLog(LOG1, "max_significant_wifi_change_aps (%u)", + pData->max_significant_wifi_change_aps); + hddLog(LOG1, "max_bssid_history_entries (%u)", + pData->max_bssid_history_entries); if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID, pData->requestId) || nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_STATUS, pData->status) || nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_CACHE_SIZE, - pData->scanCacheSize) || + pData->max_scan_cache_size) || nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_BUCKETS, - pData->scanBuckets) || + pData->max_scan_buckets) || nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_AP_CACHE_PER_SCAN, - pData->maxApPerScan) || + pData->max_ap_cache_per_scan) || nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_RSSI_SAMPLE_SIZE, - pData->maxRssiSampleSize) || + pData->max_rssi_sample_size) || nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_REPORTING_THRESHOLD, - pData->maxScanReportingThreshold) || + pData->max_scan_reporting_threshold) || nla_put_u32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_HOTLIST_APS, - pData->maxHotlistAPs) || + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_HOTLIST_BSSIDS, + pData->max_hotlist_aps) || nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SIGNIFICANT_WIFI_CHANGE_APS, - pData->maxSignificantWifiChangeAPs) || + pData->max_significant_wifi_change_aps) || nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_BSSID_HISTORY_ENTRIES, - pData->maxBsidHistoryEntries)) { + pData->max_bssid_history_entries)) { hddLog(VOS_TRACE_LEVEL_ERROR, FL("nla put fail")); goto nla_put_failure; } @@ -16484,150 +16832,208 @@ nla_put_failure: return; } +/** wlan_hdd_cfg80211_extscan_cached_results_ind() - get cached results + * @ctx: hdd global context + * @data: cached results + * + * This function reads the cached results %data and populated the NL + * attributes and send the NL event to the upper layer. + * + * Return: none + */ static void wlan_hdd_cfg80211_extscan_cached_results_ind(void *ctx, - tpSirWifiScanResultEvent pData) + struct extscan_cached_scan_results *data) { - hdd_context_t *pHddCtx = (hdd_context_t *)ctx; - struct sk_buff *skb = NULL; - tANI_U32 i; + hdd_context_t *pHddCtx = (hdd_context_t *)ctx; + struct sk_buff *skb = NULL; + uint32_t i, j; + struct extscan_cached_scan_result *result; + tSirWifiScanResult *ap; - ENTER(); - - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); - return; - } - - skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, - NULL, - EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, - QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS_INDEX, - GFP_KERNEL); - - if (!skb) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("cfg80211_vendor_event_alloc failed")); - return; - } - hddLog(LOG1, "Req Id (%u) Num results (%u) More Data (%u)", - pData->requestId, pData->numOfAps, pData->moreData); - - for (i = 0; i < pData->numOfAps; i++) { - /* - * Firmware returns timestamp from WiFi turn ON till BSSID was cached - * (in seconds). Add this with time gap between system boot up to - * WiFi turn ON to derive the time since boot when the BSSID was cached. - */ - pData->ap[i].ts += pHddCtx->wifi_turn_on_time_since_boot; - hddLog(VOS_TRACE_LEVEL_INFO, "[index=%d] Timestamp(0x%llX) " - "Ssid (%s) " - "Bssid (" MAC_ADDRESS_STR ") " - "Channel (%u) " - "Rssi (%d) " - "RTT (%u) " - "RTT_SD (%u) " - "Beacon Period (%u) " - "Capability (0x%x) " - "Ie length (%d)", - i, - pData->ap[i].ts, - pData->ap[i].ssid, - MAC_ADDR_ARRAY(pData->ap[i].bssid), - pData->ap[i].channel, - pData->ap[i].rssi, - pData->ap[i].rtt, - pData->ap[i].rtt_sd, - pData->ap[i].beaconPeriod, - pData->ap[i].capability, - pData->ap[i].ieLength); - } - - if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID, - pData->requestId) || - nla_put_u32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE, - pData->numOfAps)) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("put fail")); - goto fail; - } - - if (pData->numOfAps) { - struct nlattr *aps; + ENTER(); - aps = nla_nest_start(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST); - if (!aps) - goto fail; + if (wlan_hdd_validate_context(pHddCtx) || !data) { + hddLog(LOGE, + FL("HDD context is invalid or data(%p) is null"), data); + return; + } - for (i = 0; i < pData->numOfAps; i++) { - struct nlattr *ap; + skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, + NULL, + EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, + QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS_INDEX, + GFP_KERNEL); - ap = nla_nest_start(skb, i); - if (!ap) - goto fail; + if (!skb) { + hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed")); + return; + } + hddLog(LOG1, "Req Id (%u) Num_scan_ids (%u) More Data (%u)", + data->request_id, data->num_scan_ids, data->more_data); + + result = &data->result[0]; + for (i = 0; i < data->num_scan_ids; i++) { + hddLog(LOG1, "[i=%d] scan_id(%u) flags(%u) num_results(%u)", + i, result->scan_id, result->flags, result->num_results); + + ap = &result->ap[0]; + for (j = 0; j < result->num_results; j++) { + /* + * Firmware returns timestamp from WiFi turn ON till + * BSSID was cached (in seconds). Add this with + * time gap between system boot up to WiFi turn ON + * to derive the time since boot when the + * BSSID was cached. + */ + ap->ts += pHddCtx->wifi_turn_on_time_since_boot; + hddLog(LOG1, "Timestamp(0x%llX) " + "Ssid (%s) " + "Bssid (" MAC_ADDRESS_STR ") " + "Channel (%u) " + "Rssi (%d) " + "RTT (%u) " + "RTT_SD (%u) " + "Beacon Period (%u) " + "Capability (0x%x) " + "Ie length (%d)", + ap->ts, + ap->ssid, + MAC_ADDR_ARRAY(ap->bssid), + ap->channel, + ap->rssi, + ap->rtt, + ap->rtt_sd, + ap->beaconPeriod, + ap->capability, + ap->ieLength); + ap++; + } + result++; + } - if (nla_put_u64(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP, - pData->ap[i].ts) || - nla_put(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_SSID, - sizeof(pData->ap[i].ssid), - pData->ap[i].ssid) || - nla_put(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BSSID, - sizeof(pData->ap[i].bssid), - pData->ap[i].bssid) || - nla_put_u32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CHANNEL, - pData->ap[i].channel) || - nla_put_s32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RSSI, - pData->ap[i].rssi) || - nla_put_u32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT, - pData->ap[i].rtt) || - nla_put_u32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT_SD, - pData->ap[i].rtt_sd) || - nla_put_u16(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BEACON_PERIOD, - pData->ap[i].beaconPeriod) || - nla_put_u16(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CAPABILITY, - pData->ap[i].capability) || - nla_put_u16(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_LENGTH, - pData->ap[i].ieLength)) - goto fail; + if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID, + data->request_id) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE, + data->num_scan_ids) || + nla_put_u8(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA, + data->more_data)) { + hddLog(LOGE, FL("put fail")); + goto fail; + } - if (pData->ap[i].ieLength) - if (nla_put(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_DATA, - pData->ap[i].ieLength, pData->ap[i].ieData)) - goto fail; + if (data->num_scan_ids) { + struct nlattr *nla_results; + result = &data->result[0]; - nla_nest_end(skb, ap); - } - nla_nest_end(skb, aps); + if (nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_SCAN_ID, + result->scan_id)) { + hddLog(LOGE, FL("put fail")); + goto fail; + } + nla_results = nla_nest_start(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_LIST); + if (!nla_results) + goto fail; + + for (i = 0; i < data->num_scan_ids; i++) { + struct nlattr *nla_result; + struct nlattr *nla_aps; + + nla_result = nla_nest_start(skb, i); + if(!nla_result) + goto fail; + + if (nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_SCAN_ID, + result->scan_id) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_FLAGS, + result->flags) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE, + result->num_results)) { + hddLog(LOGE, FL("put fail")); + goto fail; + } - if (nla_put_u8(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA, - pData->moreData)) - goto fail; - } + nla_aps = nla_nest_start(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST); + if (!nla_aps) + goto fail; + + ap = &result->ap[0]; + for (j = 0; j < result->num_results; j++) { + struct nlattr *nla_ap; + + nla_ap = nla_nest_start(skb, j); + if (!nla_ap) + goto fail; + + if (nla_put_u64(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP, + ap->ts) || + nla_put(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_SSID, + sizeof(ap->ssid), + ap->ssid) || + nla_put(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BSSID, + sizeof(ap->bssid), + ap->bssid) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CHANNEL, + ap->channel) || + nla_put_s32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RSSI, + ap->rssi) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT, + ap->rtt) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT_SD, + ap->rtt_sd) || + nla_put_u16(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BEACON_PERIOD, + ap->beaconPeriod) || + nla_put_u16(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CAPABILITY, + ap->capability) || + nla_put_u16(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_LENGTH, + ap->ieLength)) + goto fail; + + if (ap->ieLength) + if (nla_put(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_DATA, + ap->ieLength, ap->ieData)) + goto fail; + + nla_nest_end(skb, nla_ap); + ap++; + } + nla_nest_end(skb, nla_aps); + nla_nest_end(skb, nla_result); + result++; + } + nla_nest_end(skb, nla_results); + } - cfg80211_vendor_event(skb, GFP_KERNEL); - return; + cfg80211_vendor_event(skb, GFP_KERNEL); + return; fail: - kfree_skb(skb); - return; - + kfree_skb(skb); + return; } + static void wlan_hdd_cfg80211_extscan_hotlist_match_ind(void *ctx, - tpSirWifiScanResultEvent pData) + struct extscan_hotlist_match *pData) { hdd_context_t *pHddCtx = (hdd_context_t *)ctx; struct sk_buff *skb = NULL; @@ -16677,7 +17083,7 @@ wlan_hdd_cfg80211_extscan_hotlist_match_ind(void *ctx, if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID, pData->requestId) || nla_put_u32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE, pData->numOfAps)) { hddLog(VOS_TRACE_LEVEL_ERROR, FL("put fail")); goto fail; @@ -16795,7 +17201,7 @@ wlan_hdd_cfg80211_extscan_signif_wifi_change_results_ind( if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID, pData->requestId) || nla_put_u32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE, pData->numResults)) { hddLog(VOS_TRACE_LEVEL_ERROR, FL("put fail")); goto fail; @@ -16853,113 +17259,273 @@ fail: static void wlan_hdd_cfg80211_extscan_full_scan_result_event(void *ctx, - tpSirWifiFullScanResultEvent pData) + tpSirWifiFullScanResultEvent pData) { - hdd_context_t *pHddCtx = (hdd_context_t *)ctx; - struct sk_buff *skb = NULL; + hdd_context_t *pHddCtx = (hdd_context_t *)ctx; + struct sk_buff *skb = NULL; - ENTER(); + ENTER(); - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); - return; - } + if (wlan_hdd_validate_context(pHddCtx) || !pData) { + hddLog(LOGE, FL("HDD context is invalid or pData(%p) is null"), + pData); + return; + } - /* - * If the full scan result including IE data exceeds NL 4K size limitation, - * drop that beacon/probe rsp frame. - */ - if ((sizeof(*pData) + pData->ap.ieLength) >= EXTSCAN_EVENT_BUF_SIZE) { - hddLog(LOGE, FL("Frame exceeded NL size limilation, drop it!!")); - return; - } - skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, - NULL, - EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, - QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_FULL_SCAN_RESULT_INDEX, - GFP_KERNEL); + /* + * If the full scan result including IE data exceeds NL 4K size + * limitation, drop that beacon/probe rsp frame. + */ + if ((sizeof(*pData) + pData->ap.ieLength) >= EXTSCAN_EVENT_BUF_SIZE) { + hddLog(LOGE, FL("Frame exceeded NL size limilation, drop it!")); + return; + } - if (!skb) { - hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed")); - return; - } + skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, + NULL, + EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, + QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_FULL_SCAN_RESULT_INDEX, + GFP_KERNEL); - pData->ap.channel = vos_chan_to_freq(pData->ap.channel); - hddLog(LOG1, "Req Id (%u) More Data (%u)", pData->requestId, - pData->moreData); - hddLog(LOG1, "AP Info: Timestamp(0x%llX) Ssid (%s) " - "Bssid (" MAC_ADDRESS_STR ") " - "Channel (%u) " - "Rssi (%d) " - "RTT (%u) " - "RTT_SD (%u) " - "Bcn Period (%d) " - "Capability (0x%X) " - "IE Length (%d)", - pData->ap.ts, - pData->ap.ssid, - MAC_ADDR_ARRAY(pData->ap.bssid), - pData->ap.channel, - pData->ap.rssi, - pData->ap.rtt, - pData->ap.rtt_sd, - pData->ap.beaconPeriod, - pData->ap.capability, - pData->ap.ieLength); - VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - pData->ap.ieData, pData->ap.ieLength); + if (!skb) { + hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed")); + return; + } - if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID, - pData->requestId) || - nla_put_u64(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP, - pData->ap.ts) || - nla_put(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_SSID, - sizeof(pData->ap.ssid), - pData->ap.ssid) || - nla_put(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BSSID, - sizeof(pData->ap.bssid), - pData->ap.bssid) || - nla_put_u32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CHANNEL, - pData->ap.channel) || - nla_put_s32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RSSI, - pData->ap.rssi) || - nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT, - pData->ap.rtt) || - nla_put_u32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT_SD, - pData->ap.rtt_sd) || - nla_put_u16(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BEACON_PERIOD, - pData->ap.beaconPeriod) || - nla_put_u16(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CAPABILITY, - pData->ap.capability) || - nla_put_u32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_LENGTH, - pData->ap.ieLength) || - nla_put_u8(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA, - pData->moreData)) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("nla put fail")); - goto nla_put_failure; - } + pData->ap.channel = vos_chan_to_freq(pData->ap.channel); + hddLog(LOG1, "Req Id (%u) More Data (%u)", + pData->requestId, pData->moreData); + hddLog(LOG1, "AP Info: Timestamp(0x%llX) Ssid (%s) " + "Bssid (" MAC_ADDRESS_STR ") " + "Channel (%u) " + "Rssi (%d) " + "RTT (%u) " + "RTT_SD (%u) " + "Bcn Period (%d) " + "Capability (0x%X) " + "IE Length (%d)", + pData->ap.ts, + pData->ap.ssid, + MAC_ADDR_ARRAY(pData->ap.bssid), + pData->ap.channel, + pData->ap.rssi, + pData->ap.rtt, + pData->ap.rtt_sd, + pData->ap.beaconPeriod, + pData->ap.capability, + pData->ap.ieLength); + VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + pData->ap.ieData, pData->ap.ieLength); + + if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID, + pData->requestId) || + nla_put_u64(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP, + pData->ap.ts) || + nla_put(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_SSID, + sizeof(pData->ap.ssid), + pData->ap.ssid) || + nla_put(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BSSID, + sizeof(pData->ap.bssid), + pData->ap.bssid) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CHANNEL, + pData->ap.channel) || + nla_put_s32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RSSI, + pData->ap.rssi) || + nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT, + pData->ap.rtt) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT_SD, + pData->ap.rtt_sd) || + nla_put_u16(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BEACON_PERIOD, + pData->ap.beaconPeriod) || + nla_put_u16(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CAPABILITY, + pData->ap.capability) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_LENGTH, + pData->ap.ieLength) || + nla_put_u8(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA, + pData->moreData)) { + hddLog(LOGE, FL("nla put fail")); + goto nla_put_failure; + } - if (pData->ap.ieLength) { - if (nla_put(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_DATA, - pData->ap.ieLength, pData->ap.ieData)) - goto nla_put_failure; - } + if (pData->ap.ieLength) { + if (nla_put(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_DATA, + pData->ap.ieLength, pData->ap.ieData)) + goto nla_put_failure; + } - cfg80211_vendor_event(skb, GFP_KERNEL); - return; + cfg80211_vendor_event(skb, GFP_KERNEL); + return; nla_put_failure: - kfree_skb(skb); - return; + kfree_skb(skb); + return; +} + +/** + * wlan_hdd_cfg80211_extscan_epno_match_found() - pno match found + * @hddctx: HDD context + * @data: matched network data + * + * This function reads the matched network data and fills NL vendor attributes + * and send it to upper layer. + * + * Return: 0 on success, error number otherwise + */ +static void +wlan_hdd_cfg80211_extscan_epno_match_found(void *ctx, + struct pno_match_found *data) +{ + hdd_context_t *pHddCtx = (hdd_context_t *)ctx; + struct sk_buff *skb = NULL; + uint32_t len, i; + + ENTER(); + + if (wlan_hdd_validate_context(pHddCtx) || !data) { + hddLog(LOGE, FL("HDD context is invalid or data(%p) is null"), + data); + return; + } + + /* + * If the number of match found APs including IE data exceeds NL 4K size + * limitation, drop that beacon/probe rsp frame. + */ + len = sizeof(*data) + + (data->num_results + sizeof(tSirWifiScanResult)); + for (i = 0; i < data->num_results; i++) { + len += data->ap[i].ieLength; + } + if (len >= EXTSCAN_EVENT_BUF_SIZE) { + hddLog(LOGE, FL("Frame exceeded NL size limilation, drop it!")); + return; +} + + skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, + NULL, + EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, + QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_NETWORK_FOUND_INDEX, + GFP_KERNEL); + + if (!skb) { + hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed")); + return; + } + + hddLog(LOG1, "Req Id (%u) More Data (%u) num_results(%d)", + data->request_id, data->more_data, data->num_results); + for (i = 0; i < data->num_results; i++) { + data->ap[i].channel = vos_chan_to_freq(data->ap[i].channel); + hddLog(LOG1, "AP Info: Timestamp(0x%llX) Ssid (%s) " + "Bssid (" MAC_ADDRESS_STR ") " + "Channel (%u) " + "Rssi (%d) " + "RTT (%u) " + "RTT_SD (%u) " + "Bcn Period (%d) " + "Capability (0x%X) " + "IE Length (%d)", + data->ap[i].ts, + data->ap[i].ssid, + MAC_ADDR_ARRAY(data->ap[i].bssid), + data->ap[i].channel, + data->ap[i].rssi, + data->ap[i].rtt, + data->ap[i].rtt_sd, + data->ap[i].beaconPeriod, + data->ap[i].capability, + data->ap[i].ieLength); + VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + data->ap[i].ieData, + data->ap[i].ieLength); + } + + if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID, + data->request_id) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE, + data->num_results) || + nla_put_u8(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA, + data->more_data)) { + hddLog(LOGE, FL("nla put fail")); + goto fail; + } + + if (data->num_results) { + struct nlattr *nla_aps; + nla_aps = nla_nest_start(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST); + if (!nla_aps) + goto fail; + + for (i = 0; i < data->num_results; i++) { + struct nlattr *nla_ap; + + nla_ap = nla_nest_start(skb, i); + if (!nla_ap) + goto fail; + + if (nla_put_u64(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP, + data->ap[i].ts) || + nla_put(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_SSID, + sizeof(data->ap[i].ssid), + data->ap[i].ssid) || + nla_put(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BSSID, + sizeof(data->ap[i].bssid), + data->ap[i].bssid) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CHANNEL, + data->ap[i].channel) || + nla_put_s32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RSSI, + data->ap[i].rssi) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT, + data->ap[i].rtt) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT_SD, + data->ap[i].rtt_sd) || + nla_put_u16(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BEACON_PERIOD, + data->ap[i].beaconPeriod) || + nla_put_u16(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CAPABILITY, + data->ap[i].capability) || + nla_put_u32(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_LENGTH, + data->ap[i].ieLength)) + goto fail; + + if (data->ap[i].ieLength) { + if (nla_put(skb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_DATA, + data->ap[i].ieLength, + data->ap[i].ieData)) + goto fail; + } + nla_nest_end(skb, nla_ap); + } + nla_nest_end(skb, nla_aps); + } + + cfg80211_vendor_event(skb, GFP_KERNEL); + return; + +fail: + kfree_skb(skb); + return; } static void @@ -16995,7 +17561,7 @@ wlan_hdd_cfg80211_extscan_scan_res_available_event(void *ctx, if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID, pData->requestId) || nla_put_u32(skb, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE, pData->numResultsAvailable)) { hddLog(VOS_TRACE_LEVEL_ERROR, FL("nla put fail")); goto nla_put_failure; @@ -17116,8 +17682,7 @@ void wlan_hdd_cfg80211_extscan_callback(void *ctx, const tANI_U16 evType, break; case eSIR_EXTSCAN_HOTLIST_MATCH_IND: - wlan_hdd_cfg80211_extscan_hotlist_match_ind(ctx, - (tpSirWifiScanResultEvent)pMsg); + wlan_hdd_cfg80211_extscan_hotlist_match_ind(ctx, pMsg); break; case eSIR_EXTSCAN_SIGNIFICANT_WIFI_CHANGE_RESULTS_IND: @@ -17127,8 +17692,7 @@ void wlan_hdd_cfg80211_extscan_callback(void *ctx, const tANI_U16 evType, break; case eSIR_EXTSCAN_CACHED_RESULTS_IND: - wlan_hdd_cfg80211_extscan_cached_results_ind(ctx, - (tpSirWifiScanResultEvent)pMsg); + wlan_hdd_cfg80211_extscan_cached_results_ind(ctx, pMsg); break; case eSIR_EXTSCAN_SCAN_RES_AVAILABLE_IND: @@ -17141,6 +17705,11 @@ void wlan_hdd_cfg80211_extscan_callback(void *ctx, const tANI_U16 evType, (tpSirWifiFullScanResultEvent)pMsg); break; + case eSIR_EPNO_NETWORK_FOUND_IND: + wlan_hdd_cfg80211_extscan_epno_match_found(ctx, + (struct pno_match_found *)pMsg); + break; + case eSIR_EXTSCAN_SCAN_PROGRESS_EVENT_IND: wlan_hdd_cfg80211_extscan_scan_progress_event(ctx, (tpSirExtScanOnScanEventIndParams)pMsg); diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h index 944abe58e934..1d60a6cb29be 100644 --- a/CORE/MAC/inc/qwlan_version.h +++ b/CORE/MAC/inc/qwlan_version.h @@ -42,9 +42,9 @@ BRIEF DESCRIPTION: #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 10 #define QWLAN_VERSION_EXTRA "" -#define QWLAN_VERSION_BUILD 60 +#define QWLAN_VERSION_BUILD 61 -#define QWLAN_VERSIONSTR "4.0.10.60" +#define QWLAN_VERSIONSTR "4.0.10.61" #define AR6320_REV1_VERSION 0x5000000 diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index 353c9d932657..4d8cd7c9ceb2 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -121,6 +121,7 @@ typedef enum eSIR_EXTSCAN_SCAN_RES_AVAILABLE_IND, eSIR_EXTSCAN_SCAN_PROGRESS_EVENT_IND, eSIR_EXTSCAN_FULL_SCAN_RESULT_IND, + eSIR_EPNO_NETWORK_FOUND_IND, /* Keep this last */ eSIR_EXTSCAN_CALLBACK_TYPE_MAX, @@ -4789,6 +4790,15 @@ typedef struct sSirRoamOffloadSynchFail #ifdef FEATURE_WLAN_EXTSCAN +/** + * typedef enum wifi_scan_flags - wifi scan flags + * @WIFI_SCAN_FLAG_INTERRUPTED: Indicates that scan results are not complete + * because probes were not sent on some channels + */ +typedef enum { + WIFI_SCAN_FLAG_INTERRUPTED = 1, +} wifi_scan_flags; + typedef enum { WIFI_BAND_UNSPECIFIED, @@ -4821,8 +4831,6 @@ typedef struct /* High threshold */ tANI_S32 high; - /* Frequency in MHz*/ - tANI_U32 channel; } tSirAPThresholdParam, *tpSirAPThresholdParam; typedef struct @@ -4831,21 +4839,35 @@ typedef struct tANI_U8 sessionId; } tSirGetExtScanCapabilitiesReqParams, *tpSirGetExtScanCapabilitiesReqParams; +/** + * struct tSirExtScanCapabilitiesEvent - extscan capabilities event + * @requestId: request identifier + * @status: status + * @max_scan_cache_size: total space allocated for scan (in bytes) + * @max_scan_buckets: maximum number of channel buckets + * @max_ap_cache_per_scan: maximum number of APs that can be stored per scan + * @max_rssi_sample_size: number of RSSI samples used for averaging RSSI + * @ax_scan_reporting_threshold: max possible report_threshold + * @max_hotlist_aps: maximum number of entries for hotlist APs + * @max_significant_wifi_change_aps: maximum number of entries for + * significant wifi change APs + * @max_bssid_history_entries: number of BSSID/RSSI entries that device can hold + */ typedef struct { - tANI_U32 requestId; - tANI_U32 status; + uint32_t requestId; + uint32_t status; - tANI_U32 scanCacheSize; - tANI_U32 scanBuckets; - tANI_U32 maxApPerScan; - tANI_U32 maxRssiSampleSize; - tANI_U32 maxScanReportingThreshold; + uint32_t max_scan_cache_size; + uint32_t max_scan_buckets; + uint32_t max_ap_cache_per_scan; + uint32_t max_rssi_sample_size; + uint32_t max_scan_reporting_threshold; - tANI_U32 maxHotlistAPs; - tANI_U32 maxSignificantWifiChangeAPs; + uint32_t max_hotlist_aps; + uint32_t max_significant_wifi_change_aps; - tANI_U32 maxBsidHistoryEntries; + uint32_t max_bssid_history_entries; } tSirExtScanCapabilitiesEvent, *tpSirExtScanCapabilitiesEvent; @@ -4900,35 +4922,90 @@ typedef struct tANI_U8 ieData[]; } tSirWifiScanResult, *tpSirWifiScanResult; -typedef struct +/** + * struct extscan_hotlist_match - extscan hotlist match + * @requestId: request identifier + * @numOfAps: number of bssids retrieved by the scan + * @moreData: 0 - for last fragment + * 1 - still more fragment(s) coming + * @ap: wifi scan result + */ +struct extscan_hotlist_match { - tANI_U32 requestId; + uint32_t requestId; + uint32_t numOfAps; + bool moreData; + tSirWifiScanResult ap[]; +}; - tANI_U32 numOfAps; +/** + * struct extscan_cached_scan_result - extscan cached scan result + * @scan_id: a unique identifier for the scan unit + * @flags: a bitmask with additional information about scan + * @num_results: number of bssids retrieved by the scan + * @ap: wifi scan bssid results info + */ +struct extscan_cached_scan_result +{ + uint32_t scan_id; + uint32_t flags; + uint32_t num_results; + tSirWifiScanResult ap[]; +}; - /* - * 0 - for last fragment - * 1 - still more fragment(s) coming - */ - tANI_BOOLEAN moreData; - tSirWifiScanResult ap[]; -} tSirWifiScanResultEvent, *tpSirWifiScanResultEvent; +/** + * struct extscan_cached_scan_results - extscan cached scan results + * @request_id: request identifier + * @more_data: 0 - for last fragment + * 1 - still more fragment(s) coming + * @num_scan_ids: number of scan ids + * @result: wifi scan result + */ +struct extscan_cached_scan_results +{ + uint32_t request_id; + bool more_data; + uint32_t num_scan_ids; + struct extscan_cached_scan_result result[]; +}; -/* + +/** + * struct tSirWifiFullScanResultEvent - extscan full scan event + * @request_id: request identifier + * @moreData: 0 - for last fragment + * 1 - still more fragment(s) coming + * @ap: bssid info + * * Reported when each probe response is received, if reportEvents * enabled in tSirWifiScanCmdReqParams */ typedef struct { - tANI_U32 requestId; + uint32_t requestId; + bool moreData; + tSirWifiScanResult ap; +} tSirWifiFullScanResultEvent, *tpSirWifiFullScanResultEvent; - /* - * 0 - for last fragment +/** + * struct pno_match_found - epno match found + * @request_id: request identifier + * @moreData: 0 - for last fragment * 1 - still more fragment(s) coming + * @num_results: number of bssids, driver sends this event to upper layer + * for every beacon, hence %num_results is always set to 1. + * @ap: bssid info + * + * Reported when each beacon probe response is received with + * epno match found tag. */ - tANI_BOOLEAN moreData; - tSirWifiScanResult ap; -} tSirWifiFullScanResultEvent, *tpSirWifiFullScanResultEvent; +struct pno_match_found +{ + uint32_t request_id; + bool more_data; + uint32_t num_results; + tSirWifiScanResult ap[]; +}; typedef struct @@ -4985,7 +5062,11 @@ typedef struct tANI_U32 maxAPperScan; /* in %, when buffer is this much full, wake up host */ - tANI_U32 reportThreshold; + uint32_t report_threshold_percent; + + /* in number of scans, wake up host after these many scans */ + uint32_t report_threshold_num_scans; + tANI_U32 requestId; tANI_U8 sessionId; @@ -5011,14 +5092,21 @@ typedef struct tANI_U32 status; } tSirExtScanStopRspParams, *tpSirExtScanStopRspParams; +/** + * struct tSirExtScanSetBssidHotListReqParams - set hotlist request + * @requestId: request identifier + * @sessionId: session identifier + * @lost_ap_sample_size: number of samples to confirm AP loss + * @numAp: Number of hotlist APs + * @ap: hotlist APs + */ typedef struct { - tANI_U32 requestId; - tANI_U8 sessionId; - - /* Number of hotlist APs */ - tANI_U32 numAp; - tSirAPThresholdParam ap[WLAN_EXTSCAN_MAX_HOTLIST_APS]; + uint32_t requestId; + uint8_t sessionId; + uint32_t lost_ap_sample_size; + uint32_t numAp; + tSirAPThresholdParam ap[WLAN_EXTSCAN_MAX_HOTLIST_APS]; } tSirExtScanSetBssidHotListReqParams, *tpSirExtScanSetBssidHotListReqParams; typedef struct @@ -5109,6 +5197,45 @@ typedef struct } tSirExtScanResultsAvailableIndParams, *tpSirExtScanResultsAvailableIndParams; +typedef struct +{ + tANI_U32 requestId; + tANI_U32 status; + tANI_U8 scanEventType; +} tSirExtScanOnScanEventIndParams, + *tpSirExtScanOnScanEventIndParams; + +/** + * struct wifi_epno_network - enhanced pno network block + * @ssid: ssid + * @rssi_threshold: threshold for considering this SSID as found, required + * granularity for this threshold is 4dBm to 8dBm + * @flags: WIFI_PNO_FLAG_XXX + * @auth_bit_field: auth bit field for matching WPA IE + */ +struct wifi_epno_network +{ + tSirMacSSid ssid; + int8_t rssi_threshold; + uint8_t flags; + uint8_t auth_bit_field; +}; + +/** + * struct wifi_epno_params - enhanced pno network params + * @num_networks: number of ssids + * @networks: PNO networks + */ +struct wifi_epno_params +{ + uint32_t request_id; + uint32_t session_id; + uint32_t num_networks; + struct wifi_epno_network networks[]; +}; + +#endif /* FEATURE_WLAN_EXTSCAN */ + #ifdef FEATURE_WLAN_AUTO_SHUTDOWN typedef struct { @@ -5121,16 +5248,6 @@ typedef struct } tSirAutoShutdownEvtParams; #endif -typedef struct -{ - tANI_U32 requestId; - tANI_U32 status; - tANI_U8 scanEventType; -} tSirExtScanOnScanEventIndParams, - *tpSirExtScanOnScanEventIndParams; - -#endif /* FEATURE_WLAN_EXTSCAN */ - #ifdef WLAN_FEATURE_LINK_LAYER_STATS typedef struct @@ -5464,6 +5581,27 @@ typedef struct tANI_U32 rssiData; /* access Point ACK RSSI (averaged) from connected AP */ tANI_U32 rssiAck; + /** number of peers */ + tANI_U32 num_peers; + /** Indicates how many peer_stats events will be sent depending on the num_peers. */ + tANI_U32 num_peer_events; + /** number of ac */ + tANI_U32 num_ac; + /** Roaming Stat */ + tANI_U32 roam_state; + /** Average Beacon spread offset is the averaged time delay between TBTT and beacon TSF */ + /** Upper 32 bits of averaged 64 bit beacon spread offset */ + tANI_U32 avg_bcn_spread_offset_high; + /** Lower 32 bits of averaged 64 bit beacon spread offset */ + tANI_U32 avg_bcn_spread_offset_low; + /** Takes value of 1 if AP leaks packets after sending an ACK for PM=1 otherwise 0 */ + tANI_U32 is_leaky_ap; + /** Average number of frames received from AP after receiving the ACK for a frame with PM=1 */ + tANI_U32 avg_rx_frms_leaked; + /** Rx leak watch window currently in force to minimize data loss because of leaky AP. Rx leak window is the + time driver waits before shutting down the radio or switching the channel and after receiving an ACK for + a data frame with PM bit set) */ + tANI_U32 rx_leak_window; /* per ac data packet statistics */ tSirWifiWmmAcStat AccessclassStats[WIFI_AC_MAX]; } tSirWifiIfaceStat, *tpSirWifiIfaceStat; @@ -5658,6 +5796,28 @@ typedef struct sir_ocb_set_sched_request ocb_callback_t callback; } sir_ocb_set_sched_request_t; +/** + * struct sir_stats_avg_factor + * @vdev_id: session id + * @stats_avg_factor: average factor + */ +struct sir_stats_avg_factor +{ + uint8_t vdev_id; + uint16_t stats_avg_factor; +}; + +/** + * struct sir_guard_time_request + * @vdev_id: session id + * @guard_time: guard time + */ +struct sir_guard_time_request +{ + uint8_t vdev_id; + uint32_t guard_time; +}; + /* Max number of rates allowed in Supported Rates IE */ #define MAX_NUM_SUPPORTED_RATES (8) diff --git a/CORE/MAC/inc/wniApi.h b/CORE/MAC/inc/wniApi.h index eae8c749743b..31aee012898a 100644 --- a/CORE/MAC/inc/wniApi.h +++ b/CORE/MAC/inc/wniApi.h @@ -381,6 +381,7 @@ enum eWniMsgTypes eWNI_SME_SNR_IND, #ifdef FEATURE_WLAN_EXTSCAN eWNI_SME_EXTSCAN_FULL_SCAN_RESULT_IND, + eWNI_SME_EPNO_NETWORK_FOUND_IND, #endif eWNI_SME_FW_STATUS_IND, eWNI_SME_MSG_TYPES_END diff --git a/CORE/MAC/src/include/sirParams.h b/CORE/MAC/src/include/sirParams.h index c514f19e6262..078131ba3772 100644 --- a/CORE/MAC/src/include/sirParams.h +++ b/CORE/MAC/src/include/sirParams.h @@ -702,6 +702,10 @@ typedef struct sSirMbMsgP2p #define SIR_HAL_SET_MAS (SIR_HAL_ITC_MSG_TYPES_BEGIN + 311) #define SIR_HAL_SET_MIRACAST (SIR_HAL_ITC_MSG_TYPES_BEGIN + 312) +#define SIR_HAL_SET_EPNO_LIST_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 313) +#define SIR_HAL_CONFIG_STATS_FACTOR (SIR_HAL_ITC_MSG_TYPES_BEGIN + 314) +#define SIR_HAL_CONFIG_GUARD_TIME (SIR_HAL_ITC_MSG_TYPES_BEGIN + 315) + #define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF) // CFG message types diff --git a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c index c6e4bc934d73..98c28df7569c 100644 --- a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c +++ b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c @@ -161,95 +161,163 @@ defMsgDecision(tpAniSirGlobal pMac, tpSirMsgQ limMsg) #ifdef FEATURE_WLAN_EXTSCAN static void -__limExtScanForwardBcnProbeRsp(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, - tSirProbeRespBeacon *pFrame, tANI_U32 ieLen) +__lim_pno_match_fwd_bcn_probepsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info, + tSirProbeRespBeacon *frame, uint32_t ie_len, + uint32_t msg_type) { - tpSirWifiFullScanResultEvent fScanResult; - tANI_U8 *pBody; - tSirMsgQ mmhMsg; - tpSirMacMgmtHdr pHdr; - - fScanResult = vos_mem_malloc(sizeof(*fScanResult) + ieLen); - if (NULL == fScanResult) { - limLog(pMac, LOGE, FL("Memory allocation failed")); - return; - } - pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); - pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); - vos_mem_zero(fScanResult, sizeof(*fScanResult) + ieLen); - - /* Received frame does not have request id, hence set 0 */ - fScanResult->requestId = 0; - - fScanResult->moreData = 0; - fScanResult->ap.ts = vos_timer_get_system_time(); - fScanResult->ap.beaconPeriod = pFrame->beaconInterval; - fScanResult->ap.capability = limGetU16((tANI_U8 *)&pFrame->capabilityInfo); - fScanResult->ap.channel = WDA_GET_RX_CH(pRxPacketInfo); - fScanResult->ap.rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo); - fScanResult->ap.rtt = 0; - fScanResult->ap.rtt_sd = 0; - fScanResult->ap.ieLength = ieLen; - - vos_mem_copy((tANI_U8 *) &fScanResult->ap.ssid[0], - (tANI_U8 *) pFrame->ssId.ssId, pFrame->ssId.length); - fScanResult->ap.ssid[pFrame->ssId.length] = '\0'; - vos_mem_copy((tANI_U8 *) &fScanResult->ap.bssid, (tANI_U8 *) pHdr->bssId, - sizeof(tSirMacAddr)); - /* Copy IE fields */ - vos_mem_copy((tANI_U8 *) &fScanResult->ap.ieData, - pBody + SIR_MAC_B_PR_SSID_OFFSET, ieLen); - - mmhMsg.type = eWNI_SME_EXTSCAN_FULL_SCAN_RESULT_IND; - mmhMsg.bodyptr = fScanResult; - mmhMsg.bodyval = 0; - limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); + struct pno_match_found *result; + uint8_t *body; + tSirMsgQ mmh_msg; + tpSirMacMgmtHdr hdr; + uint32_t num_results = 1, len, i; + + /* Upon receiving every matched beacon, bss info is forwarded to the + * the upper layer, hence num_results is set to 1 */ + len = sizeof(*result) + (num_results * sizeof(tSirWifiScanResult)) + + ie_len; + + result = vos_mem_malloc(len); + if (NULL == result) { + limLog(pmac, LOGE, FL("Memory allocation failed")); + return; + } + hdr = WDA_GET_RX_MAC_HEADER(rx_pkt_info); + body = WDA_GET_RX_MPDU_DATA(rx_pkt_info); + vos_mem_zero(result, sizeof(*result) + ie_len); + + /* Received frame does not have request id, hence set 0 */ + result->request_id = 0; + result->more_data = 0; + result->num_results = num_results; + + for (i = 0; i < result->num_results; i++) { + result->ap[i].ts = vos_timer_get_system_time(); + result->ap[i].beaconPeriod = frame->beaconInterval; + result->ap[i].capability = + limGetU16((uint8_t *)&frame->capabilityInfo); + result->ap[i].channel = WDA_GET_RX_CH(rx_pkt_info); + result->ap[i].rssi = WDA_GET_RX_RSSI_DB(rx_pkt_info); + result->ap[i].rtt = 0; + result->ap[i].rtt_sd = 0; + result->ap[i].ieLength = ie_len; + vos_mem_copy((uint8_t *) &result->ap[i].ssid[0], + (uint8_t *) frame->ssId.ssId, frame->ssId.length); + result->ap[i].ssid[frame->ssId.length] = '\0'; + vos_mem_copy((uint8_t *) &result->ap[i].bssid, + (uint8_t *) hdr->bssId, + sizeof(tSirMacAddr)); + /* Copy IE fields */ + vos_mem_copy((uint8_t *) &result->ap[i].ieData, + body + SIR_MAC_B_PR_SSID_OFFSET, ie_len); + } + + mmh_msg.type = msg_type; + mmh_msg.bodyptr = result; + mmh_msg.bodyval = 0; + limSysProcessMmhMsgApi(pmac, &mmh_msg, ePROT); } static void -__limProcessExtScanBeaconProbeRsp(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, - tANI_U8 subType) +__limExtScanForwardBcnProbeRsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info, + tSirProbeRespBeacon *frame, uint32_t ie_len, + uint32_t msg_type) { - tSirProbeRespBeacon *pFrame; - tANI_U8 *pBody; - tANI_U32 frameLen; - tSirRetStatus status; - - frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); - if (frameLen <= SIR_MAC_B_PR_SSID_OFFSET) { - limLog(pMac, LOGP, - FL("RX packet has invalid length %d"), frameLen); - return; - } - - pFrame = vos_mem_malloc(sizeof(*pFrame)); - if (NULL == pFrame) { - limLog(pMac, LOGE, FL("Memory allocation failed")); - return; - } - - if (subType == SIR_MAC_MGMT_BEACON) { - limLog(pMac, LOG2, FL("Beacon due to ExtScan")); - status = sirConvertBeaconFrame2Struct(pMac, (tANI_U8 *)pRxPacketInfo, - pFrame); - } else if (subType == SIR_MAC_MGMT_PROBE_RSP) { - limLog(pMac, LOG2, FL("Probe Rsp due to ExtScan")); - pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); - status = sirConvertProbeFrame2Struct(pMac, pBody, frameLen, pFrame); - } else { - vos_mem_free(pFrame); - return; - } - - if (status != eSIR_SUCCESS) { - limLog(pMac, LOGE, FL("Frame parsing failed")); - vos_mem_free(pFrame); - return; - } + tpSirWifiFullScanResultEvent result; + uint8_t *body; + tSirMsgQ mmh_msg; + tpSirMacMgmtHdr hdr; + + result = vos_mem_malloc(sizeof(*result) + ie_len); + if (NULL == result) { + limLog(pmac, LOGE, FL("Memory allocation failed")); + return; + } + hdr = WDA_GET_RX_MAC_HEADER(rx_pkt_info); + body = WDA_GET_RX_MPDU_DATA(rx_pkt_info); + vos_mem_zero(result, sizeof(*result) + ie_len); + + /* Received frame does not have request id, hence set 0 */ + result->requestId = 0; + + result->moreData = 0; + result->ap.ts = vos_timer_get_system_time(); + result->ap.beaconPeriod = frame->beaconInterval; + result->ap.capability = limGetU16((uint8_t *)&frame->capabilityInfo); + result->ap.channel = WDA_GET_RX_CH(rx_pkt_info); + result->ap.rssi = WDA_GET_RX_RSSI_DB(rx_pkt_info); + result->ap.rtt = 0; + result->ap.rtt_sd = 0; + result->ap.ieLength = ie_len; + + vos_mem_copy((uint8_t *) &result->ap.ssid[0], + (uint8_t *) frame->ssId.ssId, frame->ssId.length); + result->ap.ssid[frame->ssId.length] = '\0'; + vos_mem_copy((uint8_t *) &result->ap.bssid, (uint8_t *) hdr->bssId, + sizeof(tSirMacAddr)); + /* Copy IE fields */ + vos_mem_copy((uint8_t *) &result->ap.ieData, + body + SIR_MAC_B_PR_SSID_OFFSET, ie_len); + + mmh_msg.type = msg_type; + mmh_msg.bodyptr = result; + mmh_msg.bodyval = 0; + limSysProcessMmhMsgApi(pmac, &mmh_msg, ePROT); +} - __limExtScanForwardBcnProbeRsp(pMac, pRxPacketInfo, pFrame, - (frameLen - SIR_MAC_B_PR_SSID_OFFSET)); - vos_mem_free(pFrame); +static void +__limProcessExtScanBeaconProbeRsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info, + uint8_t sub_type) +{ + tSirProbeRespBeacon *frame; + uint8_t *body; + uint32_t frm_len; + tSirRetStatus status; + + frm_len = WDA_GET_RX_PAYLOAD_LEN(rx_pkt_info); + if (frm_len <= SIR_MAC_B_PR_SSID_OFFSET) { + limLog(pmac, LOGP, + FL("RX packet has invalid length %d"), frm_len); + return; + } + + frame = vos_mem_malloc(sizeof(*frame)); + if (NULL == frame) { + limLog(pmac, LOGE, FL("Memory allocation failed")); + return; + } + + if (sub_type == SIR_MAC_MGMT_BEACON) { + limLog(pmac, LOG2, FL("Beacon due to ExtScan/epno")); + status = sirConvertBeaconFrame2Struct(pmac, + (uint8_t *)rx_pkt_info, + frame); + } else if (sub_type == SIR_MAC_MGMT_PROBE_RSP) { + limLog(pmac, LOG2, FL("Probe Rsp due to ExtScan/epno")); + body = WDA_GET_RX_MPDU_DATA(rx_pkt_info); + status = sirConvertProbeFrame2Struct(pmac, body, + frm_len, frame); + } else { + vos_mem_free(frame); + return; + } + + if (status != eSIR_SUCCESS) { + limLog(pmac, LOGE, FL("Frame parsing failed")); + vos_mem_free(frame); + return; + } + + if (WMA_IS_EXTSCAN_SCAN_SRC(rx_pkt_info)) + __limExtScanForwardBcnProbeRsp(pmac, rx_pkt_info, frame, + (frm_len - SIR_MAC_B_PR_SSID_OFFSET), + eWNI_SME_EXTSCAN_FULL_SCAN_RESULT_IND); + + if (WMA_IS_EPNO_SCAN_SRC(rx_pkt_info)) + __lim_pno_match_fwd_bcn_probepsp(pmac, rx_pkt_info, frame, + (frm_len - SIR_MAC_B_PR_SSID_OFFSET), + eWNI_SME_EPNO_NETWORK_FOUND_IND); + + vos_mem_free(frame); } #endif @@ -650,13 +718,14 @@ limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg) } } #ifdef FEATURE_WLAN_EXTSCAN - if (WMA_IS_EXTSCAN_SCAN_SRC(pRxPacketInfo)) { + if (WMA_IS_EXTSCAN_SCAN_SRC(pRxPacketInfo) || + WMA_IS_EPNO_SCAN_SRC(pRxPacketInfo)) { if (fc.subType == SIR_MAC_MGMT_BEACON || fc.subType == SIR_MAC_MGMT_PROBE_RSP) { __limProcessExtScanBeaconProbeRsp(pMac, pRxPacketInfo, fc.subType); } else { - limLog(pMac, LOGE, FL("Wrong frameType %d, Subtype %d for EXTSCAN"), - fc.type, fc.subType); + limLog(pMac, LOGE, FL("Wrong frameType %d, Subtype %d for %d"), + fc.type, fc.subType, WMA_GET_SCAN_SRC(pRxPacketInfo)); } goto end; } diff --git a/CORE/SERVICES/COMMON/dbglog_id.h b/CORE/SERVICES/COMMON/dbglog_id.h index 3fddc6f2e1e5..65c76f498567 100644 --- a/CORE/SERVICES/COMMON/dbglog_id.h +++ b/CORE/SERVICES/COMMON/dbglog_id.h @@ -934,7 +934,10 @@ extern "C" { #define ROAM_INVOKE_START_SUCCESS 68 #define ROAM_INVOKE_START_FAILURE 69 #define ROAM_INVOKE_BSSID_CHECK 70 -#define ROAM_DBGID_DEFINITION_END 71 +#define ROAM_CANDIDATE_INFO 71 +#define ROAM_CANDIDATE_FILTER_MATCH 72 +#define ROAM_CANDIDATE_RSSI_ADJUST 73 +#define ROAM_DBGID_DEFINITION_END 74 /* DATA_TXRX module DBGIDs*/ #define DATA_TXRX_DBGID_DEFINITION_START 0 diff --git a/CORE/SERVICES/COMMON/wmi_tlv_defs.h b/CORE/SERVICES/COMMON/wmi_tlv_defs.h index 386b115f82ff..0ad0d817e24a 100644 --- a/CORE/SERVICES/COMMON/wmi_tlv_defs.h +++ b/CORE/SERVICES/COMMON/wmi_tlv_defs.h @@ -551,6 +551,10 @@ typedef enum { WMITLV_TAG_STRUC_wmi_dcc_ndl_active_state_config, WMITLV_TAG_STRUC_wmi_roam_scan_extended_threshold_param, WMITLV_TAG_STRUC_wmi_roam_filter_fixed_param, + WMITLV_TAG_STRUC_wmi_passpoint_config_cmd_fixed_param, + WMITLV_TAG_STRUC_wmi_passpoint_event_hdr, + WMITLV_TAG_STRUC_wmi_extscan_configure_hotlist_ssid_monitor_cmd_fixed_param, + WMITLV_TAG_STRUC_wmi_extscan_hotlist_ssid_match_event_fixed_param, } WMITLV_TAG_ID; /* @@ -730,6 +734,7 @@ typedef enum { OP(WMI_EXTSCAN_GET_WLAN_CHANGE_RESULTS_CMDID) \ OP(WMI_EXTSCAN_SET_CAPABILITIES_CMDID) \ OP(WMI_EXTSCAN_GET_CAPABILITIES_CMDID) \ + OP(WMI_EXTSCAN_CONFIGURE_HOTLIST_SSID_MONITOR_CMDID) \ OP(WMI_D0_WOW_ENABLE_DISABLE_CMDID) \ OP(WMI_UNIT_TEST_CMDID) \ OP(WMI_ROAM_SYNCH_COMPLETE) \ @@ -759,8 +764,9 @@ typedef enum { OP(WMI_OCB_GET_TSF_TIMER_CMDID) \ OP(WMI_DCC_GET_STATS_CMDID) \ OP(WMI_DCC_CLEAR_STATS_CMDID) \ - OP(WMI_DCC_UPDATE_NDL_CMDID) - + OP(WMI_DCC_UPDATE_NDL_CMDID) \ + OP(WMI_ROAM_FILTER_CMDID) \ + OP(WMI_PASSPOINT_LIST_CONFIG_CMDID) /* * IMPORTANT: Please add _ALL_ WMI Events Here. @@ -844,6 +850,7 @@ typedef enum { OP(WMI_EXTSCAN_WLAN_CHANGE_RESULTS_EVENTID) \ OP(WMI_EXTSCAN_HOTLIST_MATCH_EVENTID) \ OP(WMI_EXTSCAN_CAPABILITIES_EVENTID) \ + OP(WMI_EXTSCAN_HOTLIST_SSID_MATCH_EVENTID) \ OP(WMI_D0_WOW_DISABLE_ACK_EVENTID) \ OP(WMI_ROAM_SYNCH_EVENTID) \ OP(WMI_LPI_STATUS_EVENTID) \ @@ -860,7 +867,8 @@ typedef enum { OP(WMI_OCB_GET_TSF_TIMER_RESP_EVENTID) \ OP(WMI_DCC_GET_STATS_RESP_EVENTID) \ OP(WMI_DCC_UPDATE_NDL_RESP_EVENTID) \ - OP(WMI_DCC_STATS_EVENTID) + OP(WMI_DCC_STATS_EVENTID) \ + OP(WMI_PASSPOINT_MATCH_EVENTID) /* TLV definitions of WMI commands */ @@ -1087,6 +1095,13 @@ WMITLV_CREATE_PARAM_STRUC(WMI_EXTSCAN_SET_CAPABILITIES_CMDID); WMITLV_CREATE_PARAM_STRUC(WMI_EXTSCAN_GET_CAPABILITIES_CMDID); +/* Start SSID Hot List Monitoring Cmd */ +#define WMITLV_TABLE_WMI_EXTSCAN_CONFIGURE_HOTLIST_SSID_MONITOR_CMDID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_extscan_configure_hotlist_ssid_monitor_cmd_fixed_param, wmi_extscan_configure_hotlist_ssid_monitor_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_extscan_hotlist_ssid_entry, hotlist_ssid, WMITLV_SIZE_VAR) + +WMITLV_CREATE_PARAM_STRUC(WMI_EXTSCAN_CONFIGURE_HOTLIST_SSID_MONITOR_CMDID); + /* P2P set vendor ID data Cmd */ #define WMITLV_TABLE_WMI_P2P_SET_VENDOR_IE_DATA_CMDID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_p2p_set_vendor_ie_data_cmd_fixed_param, wmi_p2p_set_vendor_ie_data_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) @@ -1311,7 +1326,7 @@ WMITLV_CREATE_PARAM_STRUC(WMI_CLEAR_LINK_STATS_CMDID); WMITLV_CREATE_PARAM_STRUC(WMI_REQUEST_LINK_STATS_CMDID); -/* Netwrok list offload config Cmd */ +/* Network list offload config Cmd */ #define WMITLV_TABLE_WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_nlo_config_cmd_fixed_param, wmi_nlo_config_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, nlo_configured_parameters, nlo_list, WMITLV_SIZE_VAR) \ @@ -1319,6 +1334,12 @@ WMITLV_CREATE_PARAM_STRUC(WMI_REQUEST_LINK_STATS_CMDID); WMITLV_CREATE_PARAM_STRUC(WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID); +/* Passpoint list offload config Cmd */ +#define WMITLV_TABLE_WMI_PASSPOINT_LIST_CONFIG_CMDID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_passpoint_config_cmd_fixed_param, wmi_passpoint_config_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) + +WMITLV_CREATE_PARAM_STRUC(WMI_PASSPOINT_LIST_CONFIG_CMDID); + /* CSA offload enable Cmd */ #define WMITLV_TABLE_WMI_CSA_OFFLOAD_ENABLE_CMDID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_csa_offload_enable_cmd_fixed_param, wmi_csa_offload_enable_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) @@ -2200,6 +2221,13 @@ WMITLV_CREATE_PARAM_STRUC(WMI_EXTSCAN_HOTLIST_MATCH_EVENTID); WMITLV_CREATE_PARAM_STRUC(WMI_EXTSCAN_CAPABILITIES_EVENTID); +/* ExtScan Hot List Match Event */ +#define WMITLV_TABLE_WMI_EXTSCAN_HOTLIST_SSID_MATCH_EVENTID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_extscan_hotlist_ssid_match_event_fixed_param, wmi_extscan_hotlist_ssid_match_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_extscan_wlan_descriptor, hotlist_ssid_match, WMITLV_SIZE_VAR) + +WMITLV_CREATE_PARAM_STRUC(WMI_EXTSCAN_HOTLIST_SSID_MATCH_EVENTID); + /* Update_whal_mib_stats Event */ #define WMITLV_TABLE_WMI_UPDATE_WHAL_MIB_STATS_EVENTID(id,op,buf,len) \ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_update_whal_mib_stats_event_fixed_param, wmi_update_whal_mib_stats_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) @@ -2476,23 +2504,30 @@ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_apfind_event_hdr, wmi_apfind_eve WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, data, WMITLV_SIZE_VAR) WMITLV_CREATE_PARAM_STRUC(WMI_APFIND_EVENTID); +/* WMI_PASSPOINT_MATCH_EVENTID */ +#define WMITLV_TABLE_WMI_PASSPOINT_MATCH_EVENTID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_passpoint_event_hdr, wmi_passpoint_event_hdr, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, bufp, WMITLV_SIZE_VAR) + WMITLV_CREATE_PARAM_STRUC(WMI_PASSPOINT_MATCH_EVENTID); + /* Chatter query reply event */ -#define WMITLV_TABLE_WMI_CHATTER_PC_QUERY_EVENTID(id,op,buf,len) \ +#define WMITLV_TABLE_WMI_CHATTER_PC_QUERY_EVENTID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_chatter_query_reply_event_fixed_param, wmi_chatter_query_reply_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_CHATTER_PC_QUERY_EVENTID); /* Upload H_CV info event */ -#define WMITLV_TABLE_WMI_UPLOADH_EVENTID(id,op,buf,len) \ +#define WMITLV_TABLE_WMI_UPLOADH_EVENTID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_upload_h_hdr, wmi_upload_h_hdr, hdr, WMITLV_SIZE_FIX) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, bufp, WMITLV_SIZE_VAR) WMITLV_CREATE_PARAM_STRUC(WMI_UPLOADH_EVENTID); /* Capture H info event */ -#define WMITLV_TABLE_WMI_CAPTUREH_EVENTID(id,op,buf,len) \ +#define WMITLV_TABLE_WMI_CAPTUREH_EVENTID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_capture_h_event_hdr, wmi_capture_h_event_hdr, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_CAPTUREH_EVENTID); + /* TDLS Peer Update event */ -#define WMITLV_TABLE_WMI_TDLS_PEER_EVENTID(id,op,buf,len) \ +#define WMITLV_TABLE_WMI_TDLS_PEER_EVENTID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_tdls_peer_event_fixed_param, wmi_tdls_peer_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_TDLS_PEER_EVENTID); diff --git a/CORE/SERVICES/COMMON/wmi_unified.h b/CORE/SERVICES/COMMON/wmi_unified.h index cbc584f58af9..5772c7fc26c3 100644 --- a/CORE/SERVICES/COMMON/wmi_unified.h +++ b/CORE/SERVICES/COMMON/wmi_unified.h @@ -562,6 +562,9 @@ typedef enum { /** APFIND Config */ WMI_APFIND_CMDID, + /** Passpoint list config */ + WMI_PASSPOINT_LIST_CONFIG_CMDID, + /* GTK offload Specific WMI commands*/ WMI_GTK_OFFLOAD_CMDID=WMI_CMD_GRP_START_ID(WMI_GRP_GTK_OFL), @@ -745,6 +748,7 @@ typedef enum { WMI_EXTSCAN_GET_WLAN_CHANGE_RESULTS_CMDID, WMI_EXTSCAN_SET_CAPABILITIES_CMDID, WMI_EXTSCAN_GET_CAPABILITIES_CMDID, + WMI_EXTSCAN_CONFIGURE_HOTLIST_SSID_MONITOR_CMDID, /** DHCP server offload commands */ WMI_SET_DHCP_SERVER_OFFLOAD_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_DHCP_OFL), @@ -920,6 +924,9 @@ typedef enum { /** APFIND specific events */ WMI_APFIND_EVENTID, + /** passpoint network match event */ + WMI_PASSPOINT_MATCH_EVENTID, + /** GTK offload stautus event requested by host */ WMI_GTK_OFFLOAD_STATUS_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GTK_OFL), @@ -1027,6 +1034,7 @@ typedef enum { WMI_EXTSCAN_WLAN_CHANGE_RESULTS_EVENTID, WMI_EXTSCAN_HOTLIST_MATCH_EVENTID, WMI_EXTSCAN_CAPABILITIES_EVENTID, + WMI_EXTSCAN_HOTLIST_SSID_MATCH_EVENTID, /* mDNS offload events */ WMI_MDNS_STATS_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MDNS_OFL), @@ -2033,6 +2041,9 @@ typedef struct { /** flag indicating that the the mgmt frame (probe req/beacon) is received in the context of extscan performed by FW */ #define WMI_MGMT_RX_HDR_EXTSCAN 0x01 +/** flag indicating that the the mgmt frame (probe req/beacon) is received in the context of matched network by FW ENLO */ +#define WMI_MGMT_RX_HDR_ENLO 0x02 + typedef struct { A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_mgmt_rx_hdr */ /** channel on which this frame is received. */ @@ -3178,6 +3189,19 @@ typedef struct { A_UINT32 num_ac; /** Roaming Stat */ A_UINT32 roam_state; + /** Average Beacon spread offset is the averaged time delay between TBTT and beacon TSF */ + /** Upper 32 bits of averaged 64 bit beacon spread offset */ + A_UINT32 avg_bcn_spread_offset_high; + /** Lower 32 bits of averaged 64 bit beacon spread offset */ + A_UINT32 avg_bcn_spread_offset_low; + /** Takes value of 1 if AP leaks packets after sending an ACK for PM=1 otherwise 0 */ + A_UINT32 is_leaky_ap; + /** Average number of frames received from AP after receiving the ACK for a frame with PM=1 */ + A_UINT32 avg_rx_frms_leaked; + /** Rx leak watch window currently in force to minimize data loss because of leaky AP. Rx leak window is the + time driver waits before shutting down the radio or switching the channel and after receiving an ACK for + a data frame with PM bit set) */ + A_UINT32 rx_leak_window; } wmi_iface_link_stats; /** Interface statistics (once started) reset and start afresh after each connection */ @@ -3780,6 +3804,16 @@ typedef enum { /* Enable/Disable 1 RX chain usage during the ATIM window */ WMI_VDEV_PARAM_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_ENABLE, + /* RX Leak window is the time driver waits before shutting down + * the radio or switching the channel and after receiving an ACK + * for a data frame with PM bit set) */ + WMI_VDEV_PARAM_RX_LEAK_WINDOW, + + /** Averaging factor(16 bit value) is used in the calculations to + * perform averaging of different link level statistics like average + * beacon spread or average number of frames leaked */ + WMI_VDEV_PARAM_STATS_AVG_FACTOR, + } WMI_VDEV_PARAM; /* Length of ATIM Window in TU */ @@ -4659,6 +4693,9 @@ typedef struct { /* Set peer advertised IBSS atim window length */ #define WMI_PEER_IBSS_ATIM_WINDOW_LENGTH 0xC +/** peer phy mode */ +#define WMI_PEER_PHYMODE 0xD + /** mimo ps values for the parameter WMI_PEER_MIMO_PS_STATE */ #define WMI_PEER_MIMO_PS_NONE 0x0 #define WMI_PEER_MIMO_PS_STATIC 0x1 @@ -6318,6 +6355,25 @@ typedef enum _WMI_NLO_SSID_BcastNwType #define WMI_NLO_CONFIG_SLOW_SCAN (0x1 << 4) #define WMI_NLO_CONFIG_FAST_SCAN (0x1 << 5) #define WMI_NLO_CONFIG_SSID_HIDE_EN (0x1 << 6) +/* This bit is used to indicate if EPNO or supplicant PNO is enabled. Only one of them can be enabled at a given time */ +#define WMI_NLO_CONFIG_ENLO (0x1 << 7) + +/* Whether directed scan needs to be performed (for hidden SSIDs) */ +#define WMI_ENLO_FLAG_DIRECTED_SCAN 1 +/* Whether PNO event shall be triggered if the network is found on A band */ +#define WMI_ENLO_FLAG_A_BAND 2 +/* Whether PNO event shall be triggered if the network is found on G band */ +#define WMI_ENLO_FLAG_G_BAND 4 +/* Whether strict matching is required (i.e. firmware shall not match on the entire SSID) */ +#define WMI_ENLO_FLAG_STRICT_MATCH 8 + +/* Code for matching the beacon AUTH IE - additional codes TBD */ +/* open */ +#define WMI_ENLO_AUTH_CODE_OPEN 1 +/* WPA_PSK or WPA2PSK */ +#define WMI_ENLO_AUTH_CODE_PSK 2 +/* any EAPOL */ +#define WMI_ENLO_AUTH_CODE_EAPOL 4 /* NOTE: wmi_nlo_ssid_param structure can't be changed without breaking the compatibility */ typedef struct wmi_nlo_ssid_param @@ -6344,6 +6400,8 @@ typedef struct wmi_nlo_auth_param typedef struct wmi_nlo_bcast_nw_param { A_UINT32 valid; + /* If WMI_NLO_CONFIG_EPNO is not set. Supplicant PNO is enabled. The value should be true/false + Otherwise EPNO is enabled. bcast_nw_type would be used as a bit flag contains WMI_ENLO_FLAG_XXX */ A_UINT32 bcast_nw_type; } wmi_nlo_bcast_nw_param; @@ -6392,6 +6450,89 @@ typedef struct wmi_nlo_event A_UINT32 vdev_id; }wmi_nlo_event; + +/* WMI_PASSPOINT_CONFIG_SET + * Sets a list for passpoint networks for PNO purposes; + * it should be matched against any passpoint networks found + * during regular PNO scan. + */ +#define WMI_PASSPOINT_CONFIG_SET (0x1 << 0) +/* WMI_PASSPOINT_CONFIG_RESET + * Reset passpoint network list - + * no Passpoint networks should be matched after this. + */ +#define WMI_PASSPOINT_CONFIG_RESET (0x1 << 1) + +#define PASSPOINT_REALM_LEN 256 +#define PASSPOINT_ROAMING_CONSORTIUM_ID_LEN 5 +#define PASSPOINT_ROAMING_CONSORTIUM_ID_NUM 16 +#define PASSPOINT_PLMN_ID_LEN 3 +#define PASSPOINT_PLMN_ID_ALLOC_LEN /* round up to A_UINT32 boundary */ \ + (((PASSPOINT_PLMN_ID_LEN + 3) >> 2) << 2) + +/* + * Confirm PASSPOINT_REALM_LEN is a multiple of 4, so the + * A_UINT8 realm[PASSPOINT_REALM_LEN] + * array will end on a 4-byte boundary. + * (This 4-byte alignment simplifies endianness-correction byte swapping.) + */ +A_COMPILE_TIME_ASSERT( + check_passpoint_realm_size, + (PASSPOINT_REALM_LEN % sizeof(A_UINT32)) == 0); + +/* + * Confirm the product of PASSPOINT_ROAMING_CONSORTIUM_ID_NUM and + * PASSPOINT_ROAMING_CONSORTIUM_ID_LEN is a multiple of 4, so the + * roaming_consortium_ids array below will end on a 4-byte boundary. + * (This 4-byte alignment simplifies endianness-correction byte swapping.) + */ +A_COMPILE_TIME_ASSERT( + check_passpoint_roaming_consortium_ids_size, + ((PASSPOINT_ROAMING_CONSORTIUM_ID_NUM*PASSPOINT_ROAMING_CONSORTIUM_ID_LEN) % sizeof(A_UINT32)) == 0); + +/* wildcard ID to allow an action (reset) to apply to all networks */ +#define WMI_PASSPOINT_NETWORK_ID_WILDCARD 0xFFFFFFFF +typedef struct wmi_passpoint_config { + A_UINT32 tlv_header; /* TLV tag and len; tag equals wmi_passpoint_config_cmd_fixed_param */ + /* (network) id + * identifier of the matched network, report this in event + * This id can be a wildcard (WMI_PASSPOINT_NETWORK_ID_WILDCARD) + * that indicates the action should be applied to all networks. + * Currently, the only action that is applied to all networks is "reset". + * If a non-wildcard ID is specified, that particular network is configured. + * If a wildcard ID is specified, all networks are reset. + */ + A_UINT32 id; + A_UINT32 req_id; + A_UINT8 realm[PASSPOINT_REALM_LEN]; /*null terminated UTF8 encoded realm, 0 if unspecified*/ + A_UINT8 roaming_consortium_ids[PASSPOINT_ROAMING_CONSORTIUM_ID_NUM][PASSPOINT_ROAMING_CONSORTIUM_ID_LEN]; /*roaming consortium ids to match, 0s if unspecified*/ + /*This would be bytes-stream as same as defition of realm id in 802.11 standard*/ + A_UINT8 plmn[PASSPOINT_PLMN_ID_ALLOC_LEN]; /*PLMN id mcc/mnc combination as per rules, 0s if unspecified */ +} wmi_passpoint_config_cmd_fixed_param; + +typedef struct { + A_UINT32 tlv_header; /* TLV tag and len; tag equals wmi_passpoint_event_hdr */ + A_UINT32 id; /* identifier of the matched network */ + A_UINT32 vdev_id; + A_UINT32 timestamp; /* time since boot (in microsecond) when the result was retrieved*/ + wmi_ssid ssid; + wmi_mac_addr bssid; /* bssid of the network */ + A_UINT32 channel_mhz; /* channel frequency in MHz */ + A_UINT32 rssi; /* rssi value */ + A_UINT32 rtt; /* timestamp in nanoseconds*/ + A_UINT32 rtt_sd; /* standard deviation in rtt */ + A_UINT32 beacon_period; /* beacon advertised in the beacon */ + A_UINT32 capability; /* capabilities advertised in the beacon */ + A_UINT32 ie_length; /* size of the ie_data blob */ + A_UINT32 anqp_length; /* length of ANQP blob */ +/* Following this structure is the byte stream of ie data of length ie_buf_len: + * A_UINT8 ie_data[]; // length in byte given by field ie_length, blob of ie data in beacon + * A_UINT8 anqp_ie[]; // length in byte given by field anqp_len, blob of anqp data of IE + * Implicitly, combing ie_data and anqp_ie into a single bufp, and the bytes stream of each ie should be same as BEACON/Action-frm by 802.11 spec. + */ +} wmi_passpoint_event_hdr; + + #define GTK_OFFLOAD_OPCODE_MASK 0xFF000000 /** Enable GTK offload, and provided parameters KEK,KCK and replay counter values */ #define GTK_OFFLOAD_ENABLE_OPCODE 0x01000000 @@ -8508,7 +8649,7 @@ typedef struct { A_UINT32 forwarding_flags; /** ExtScan configuration flags - wmi_extscan_configuration_flags */ A_UINT32 configuration_flags; - /** multiplier to be applied to the periodic scan's base period */ + /** DEPRECATED member: multiplier to be applied to the periodic scan's base period */ A_UINT32 base_period_multiplier; /** dwell time in msec on active channels - use defaults if 0 */ A_UINT32 min_dwell_time_active; @@ -8520,6 +8661,18 @@ typedef struct { A_UINT32 channel_band; /** number of channels (if channel_band is WMI_CHANNEL_UNSPECIFIED) */ A_UINT32 num_channels; + /** scan period upon start or restart of the bucket - periodicity of the bucket to begin with */ + A_UINT32 min_period; + /** period above which exponent is not applied anymore */ + A_UINT32 max_period; + /** back off value to be applied to bucket's periodicity after exp_max_step_count scan cycles + * new_bucket_period = last_bucket_period + last_exponent_period * exp_backoff + */ + A_UINT32 exp_backoff; + /** number of scans performed at a given periodicity after which exponential back off value is + * applied to current periodicity to obtain a newer one + */ + A_UINT32 exp_max_step_count; /** Followed by the variable length TLV chan_list: * wmi_extscan_bucket_channel chan_list[] */ } wmi_extscan_bucket; @@ -8597,6 +8750,8 @@ typedef struct { A_UINT32 ie_len; /** number of buckets in the TLV bucket_list[] */ A_UINT32 num_buckets; + /** in number of scans, send notifications to host after these many scans */ + A_UINT32 report_threshold_num_scans; /** number of channels in channel_list[] determined by the sum of wmi_extscan_bucket.num_channels in array */ @@ -8703,10 +8858,12 @@ typedef struct { A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_ARRAY_STRUC */ /**bssid */ wmi_mac_addr bssid; - /**RSSI threshold for reporting */ + /**RSSI min threshold for reporting */ A_UINT32 min_rssi; - /**channel number */ + /**Deprecated entry - channel number */ A_UINT32 channel; + /** RSSI max threshold for reporting */ + A_UINT32 max_rssi; } wmi_extscan_hotlist_entry; typedef struct { @@ -8727,12 +8884,51 @@ typedef struct { A_UINT32 first_entry_index; /**number of bssids in this page */ A_UINT32 num_entries_in_page; + /** number of consecutive scans to confirm loss of contact with AP */ + A_UINT32 lost_ap_scan_count; /* Following this structure is the TLV: * wmi_extscan_hotlist_entry hotlist[]; // number of elements given by field num_page_entries. */ } wmi_extscan_configure_hotlist_monitor_cmd_fixed_param; typedef struct { + A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_ARRAY_STRUC */ + /**ssid */ + wmi_ssid ssid; + /**band */ + A_UINT32 band; + /**RSSI threshold for reporting */ + A_UINT32 min_rssi; + A_UINT32 max_rssi; +} wmi_extscan_hotlist_ssid_entry; + +typedef struct { + A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_extscan_configure_hotlist_ssid_monitor_cmd_fixed_param */ + /** Request ID - to identify command. Cannot be 0 */ + A_UINT32 request_id; + /** Requestor ID - client requesting hotlist ssid monitoring */ + A_UINT32 requestor_id; + /** VDEV id(interface) that is requesting scan */ + A_UINT32 vdev_id; + /** table ID - to allow support for multiple simultaneous tables */ + A_UINT32 table_id; + /** operation mode: start/stop */ + A_UINT32 mode; // wmi_extscan_operation_mode + /**total number of ssids (in all pages) */ + A_UINT32 total_entries; + /**index of the first ssid entry found in the TLV wmi_extscan_hotlist_ssid_entry*/ + A_UINT32 first_entry_index; + /**number of ssids in this page */ + A_UINT32 num_entries_in_page; + /** number of consecutive scans to confirm loss of an ssid **/ + A_UINT32 lost_ap_scan_count; + /* Following this structure is the TLV: + * wmi_extscan_hotlist_ssid_entry hotlist_ssid[]; // number of elements given by field num_page_entries. + */ +} wmi_extscan_configure_hotlist_ssid_monitor_cmd_fixed_param; + + +typedef struct { A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_ARRAY_STRUC */ /** table ID - to allow support for multiple simultaneous tables */ A_UINT32 table_id; @@ -8873,12 +9069,21 @@ typedef struct { A_UINT32 maximum_entries; } wmi_extscan_table_usage_event_fixed_param; +typedef enum { + WMI_SCAN_STATUS_INTERRUPTED = 1 /* Indicates scan got interrupted i.e. aborted or pre-empted for a long time (> 1sec) + this can be used to discard scan results */ +} wmi_scan_status_flags; + typedef struct { A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_ARRAY_STRUC */ /**RSSI */ A_UINT32 rssi; /**time stamp in seconds */ A_UINT32 tstamp; + /** Extscan cycle during which this entry was scanned */ + A_UINT32 scan_cycle_id; + /** flag to indicate if the given result was obtained as part of interrupted (aborted/large time gap preempted) scan */ + A_UINT32 flags; } wmi_extscan_rssi_info; typedef struct { @@ -9023,6 +9228,27 @@ typedef struct { } wmi_extscan_hotlist_match_event_fixed_param; typedef struct { + A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_extscan_hotlist_match_event_fixed_param */ + /** Request ID of the WMI_EXTSCAN_CONFIGURE_HOTLIST_SSID_MONITOR_CMDID that configured the table */ + A_UINT32 config_request_id; + /** Requestor ID of the WMI_EXTSCAN_CONFIGURE_HOTLIST_SSID_MONITOR_CMDID that configured the table */ + A_UINT32 config_requestor_id; + /** VDEV id(interface) of the WMI_EXTSCAN_CONFIGURE_HOTLIST_SSID_MONITOR_CMDID that configured the table */ + A_UINT32 config_vdev_id; + /** table ID - to allow support for multiple simultaneous tables */ + A_UINT32 table_id; + /**total number of ssids (in all pages) */ + A_UINT32 total_entries; + /**index of the first ssid entry found in the TLV wmi_extscan_wlan_descriptor*/ + A_UINT32 first_entry_index; + /**number of ssids in this page */ + A_UINT32 num_entries_in_page; + /* Following this structure is the TLV: + * wmi_extscan_wlan_descriptor hotlist_match[]; // number of descriptors given by field num_entries_in_page. + */ +} wmi_extscan_hotlist_ssid_match_event_fixed_param; + +typedef struct { A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_extscan_capabilities_event_fixed_param */ /** Request ID of the WMI_EXTSCAN_GET_CAPABILITIES_CMDID */ A_UINT32 request_id; @@ -9048,6 +9274,17 @@ typedef struct { A_UINT32 num_extscan_wlan_change_capabilities; /** number of extscan hotlist capabilities (one per table) */ A_UINT32 num_extscan_hotlist_capabilities; + /* max number of roaming ssid whitelist firmware can support */ + A_UINT32 num_roam_ssid_whitelist; + /* max number of blacklist bssid firmware can support */ + A_UINT32 num_roam_bssid_blacklist; + /* max number of preferred list firmware can support */ + A_UINT32 num_roam_bssid_preferred_list; + /* max number of hotlist ssids firmware can support */ + A_UINT32 num_extscan_hotlist_ssid; + /* max number of epno networks firmware can support */ + A_UINT32 num_epno_networks; + /* Following this structure are the TLVs describing the capabilities of of the various types of lists. The FW theoretically * supports multiple lists of each type. * diff --git a/CORE/SERVICES/COMMON/wmi_version.h b/CORE/SERVICES/COMMON/wmi_version.h index cf155c65a3d1..ef28dbd495da 100644 --- a/CORE/SERVICES/COMMON/wmi_version.h +++ b/CORE/SERVICES/COMMON/wmi_version.h @@ -36,7 +36,7 @@ #define __WMI_VER_MINOR_ 0 /** WMI revision number has to be incremented when there is a * change that may or may not break compatibility. */ -#define __WMI_REVISION_ 94 +#define __WMI_REVISION_ 100 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work diff --git a/CORE/SERVICES/HIF/common/hif_sdio_common.h b/CORE/SERVICES/HIF/common/hif_sdio_common.h index a5796497c40a..6e2e78b619c0 100644 --- a/CORE/SERVICES/HIF/common/hif_sdio_common.h +++ b/CORE/SERVICES/HIF/common/hif_sdio_common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -199,4 +199,11 @@ static INLINE void SetExtendedMboxWindowInfo(A_UINT16 Manfid, HIF_DEVICE_MBOX_IN #define CCCR_SDIO_ASYNC_INT_DELAY_LSB 0x06 #define CCCR_SDIO_ASYNC_INT_DELAY_MASK 0xC0 +/* Vendor Specific Driver Strength Settings */ +#define CCCR_SDIO_DRIVER_STRENGTH_ENABLE_ADDR 0xf2 +#define CCCR_SDIO_DRIVER_STRENGTH_ENABLE_MASK 0x0e +#define CCCR_SDIO_DRIVER_STRENGTH_ENABLE_A 0x02 +#define CCCR_SDIO_DRIVER_STRENGTH_ENABLE_C 0x04 +#define CCCR_SDIO_DRIVER_STRENGTH_ENABLE_D 0x08 + #endif /*HIF_SDIO_COMMON_H_*/ diff --git a/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c b/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c index 85c5e03449e1..810bae0930ce 100644 --- a/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c +++ b/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -148,6 +148,7 @@ module_param(reset_sdio_on_unload, int, 0644); A_UINT32 nohifscattersupport = 1; +A_UINT32 forcedriverstrength = 1; /* force driver strength to type D */ /* ------ Static Variables ------ */ static const struct sdio_device_id ar6k_id_table[] = { @@ -1300,6 +1301,53 @@ TODO: MMC SDIO3.0 Setting should also be modified in ReInit() function when Powe unsigned char speed = 0; #endif sdio_claim_host(func); + + /* force driver strength to type D */ + if (((id->device & MANUFACTURER_ID_AR6K_BASE_MASK) == + MANUFACTURER_ID_QCA9377_BASE && forcedriverstrength == 1)) { + unsigned int addr = SDIO_CCCR_DRIVE_STRENGTH; + unsigned char value = 0; + A_UINT32 err = Func0_CMD52ReadByte(func->card, addr, &value); + if (err) { + printk("Read CCCR 0x%02X failed: %d\n", + (unsigned int) addr, + (unsigned int) err); + } else { + value = (value & + (~(SDIO_DRIVE_DTSx_MASK << SDIO_DRIVE_DTSx_SHIFT))) | + SDIO_DTSx_SET_TYPE_D; + err = Func0_CMD52WriteByte(func->card, addr, value); + if (err) { + printk("Write CCCR 0x%02X to 0x%02X failed: %d\n", + (unsigned int) addr, + (unsigned int) value, + (unsigned int) err); + } else { + addr = CCCR_SDIO_DRIVER_STRENGTH_ENABLE_ADDR; + value = 0; + err = Func0_CMD52ReadByte(func->card, addr, &value); + if (err) { + printk("Read CCCR 0x%02X failed: %d\n", + (unsigned int) addr, + (unsigned int) err); + } else { + value = (value & + (~CCCR_SDIO_DRIVER_STRENGTH_ENABLE_MASK)) | + CCCR_SDIO_DRIVER_STRENGTH_ENABLE_A | + CCCR_SDIO_DRIVER_STRENGTH_ENABLE_C | + CCCR_SDIO_DRIVER_STRENGTH_ENABLE_D; + err = Func0_CMD52WriteByte(func->card, addr, value); + if (err) { + printk("Write CCCR 0x%02X to 0x%02X failed: %d\n", + (unsigned int) addr, + (unsigned int) value, + (unsigned int) err); + } + } + } + } + } + if (writecccr1) { A_UINT32 err = Func0_CMD52WriteByte(func->card, writecccr1, diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 8508dc409917..a1bafd877439 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -2826,26 +2826,26 @@ static int wma_extscan_capabilities_event_handler (void *handle, return -EINVAL; } dest_capab->requestId = event->request_id; - dest_capab->scanBuckets = src_cache->max_buckets; - dest_capab->scanCacheSize = src_cache->scan_cache_entry_size; - dest_capab->maxApPerScan = src_cache->max_bssid_per_scan; - dest_capab->maxScanReportingThreshold = + dest_capab->max_scan_buckets = src_cache->max_buckets; + dest_capab->max_scan_cache_size = src_cache->scan_cache_entry_size; + dest_capab->max_ap_cache_per_scan = src_cache->max_bssid_per_scan; + dest_capab->max_scan_reporting_threshold = src_cache->max_table_usage_threshold; - dest_capab->maxHotlistAPs = src_hotlist->max_hotlist_entries; - dest_capab->maxRssiSampleSize = + dest_capab->max_hotlist_aps = src_hotlist->max_hotlist_entries; + dest_capab->max_rssi_sample_size = src_change->max_rssi_averaging_samples; - dest_capab->maxBsidHistoryEntries = + dest_capab->max_bssid_history_entries = src_change->max_rssi_history_entries; - dest_capab->maxSignificantWifiChangeAPs = + dest_capab->max_significant_wifi_change_aps = src_change->max_wlan_change_entries; dest_capab->status = 0; - WMA_LOGD("%s: Capabilities: scanBuckets: %d," - "maxHotlistAPs: %d,scanCacheSize: %d", - __func__, dest_capab->scanBuckets, - dest_capab->maxHotlistAPs, - dest_capab->scanCacheSize); + WMA_LOGD("%s: Capabilities: max_scan_buckets: %d," + "max_hotlist_aps: %d,max_scan_cache_size: %d", + __func__, dest_capab->max_scan_buckets, + dest_capab->max_hotlist_aps, + dest_capab->max_scan_cache_size); pMac->sme.pExtScanIndCb(pMac->hHdd, eSIR_EXTSCAN_GET_CAPABILITIES_IND, @@ -2861,7 +2861,7 @@ static int wma_extscan_hotlist_match_event_handler(void *handle, tp_wma_handle wma = (tp_wma_handle) handle; WMI_EXTSCAN_HOTLIST_MATCH_EVENTID_param_tlvs *param_buf; wmi_extscan_hotlist_match_event_fixed_param *event; - tSirWifiScanResultEvent *dest_hotlist; + struct extscan_hotlist_match *dest_hotlist; tSirWifiScanResult *dest_ap; wmi_extscan_wlan_descriptor *src_hotlist; int numap; @@ -2934,13 +2934,18 @@ static int wma_extscan_cached_results_event_handler(void *handle, tp_wma_handle wma = (tp_wma_handle) handle; WMI_EXTSCAN_CACHED_RESULTS_EVENTID_param_tlvs *param_buf; wmi_extscan_cached_results_event_fixed_param *event; - tSirWifiScanResultEvent *dest_cachelist; + struct extscan_cached_scan_results *dest_cachelist; + struct extscan_cached_scan_result *dest_result; + struct extscan_cached_scan_results empty_cachelist; tSirWifiScanResult *dest_ap; wmi_extscan_wlan_descriptor *src_hotlist; wmi_extscan_rssi_info *src_rssi; - int numap; - int j; - int moredata; + int numap, i, j, moredata, scan_ids_cnt; + int prev_scan_id, buf_len; + wmi_extscan_wlan_descriptor *src_hotlist1; + wmi_extscan_rssi_info *src_rssi1; + char bssid1[6]; + char ssid1[33]; tpAniSirGlobal pMac = (tpAniSirGlobal )vos_get_context( VOS_MODULE_ID_PE, wma->vos_context); @@ -2958,61 +2963,174 @@ static int wma_extscan_cached_results_event_handler(void *handle, WMA_LOGE("%s: Invalid cached results event", __func__); return -EINVAL; } + event = param_buf->fixed_param; src_hotlist = param_buf->bssid_list; src_rssi = param_buf->rssi_list; - if (!src_hotlist || !src_rssi) { - WMA_LOGE("%s: Cached_results AP's list invalid", - __func__); - return -EINVAL; + numap = event->num_entries_in_page; + WMA_LOGD("nummap (%d)\n", numap); + if (!src_hotlist || !src_rssi || !numap) { + WMA_LOGE("%s: Cached results empty, send 0 results", __func__); + goto noresults; } + if (event->first_entry_index + - event->num_entries_in_page < event->total_entries) { + event->num_entries_in_page < event->total_entries) moredata = 1; - } else { + else moredata = 0; + + src_hotlist1 = src_hotlist; + src_rssi1 = src_rssi; + /* Just print fw data */ + WMA_LOGD("request id (%d)\n", event->request_id); + WMA_LOGD("more data (%d)\n", moredata); + WMA_LOGD("requestor_id (%u)\n", event->requestor_id); + WMA_LOGD("vdev_id (%u)\n", event->vdev_id); + WMA_LOGD("extscan_request_id (%u)\n", event->extscan_request_id); + WMA_LOGD("extscan_requestor_id (%u)\n", event->extscan_requestor_id); + WMA_LOGD("extscan_vdev_id (%u)\n", event->extscan_vdev_id); + WMA_LOGD("table id(%u)\n", event->table_id); + WMA_LOGD("current_tstamp(%u)\n", event->current_tstamp); + WMA_LOGD("total_entries(%u)\n", event->total_entries); + WMA_LOGD("first_entry_index (%u)\n", event->first_entry_index); + WMA_LOGD("num_entries_in_page(%u)\n", event->num_entries_in_page); + + WMA_LOGE("bssid list \n"); + for (i = 0; i < numap; i++) { + WMI_MAC_ADDR_TO_CHAR_ARRAY(&src_hotlist1->bssid, bssid1); + vos_mem_set (ssid1, 33, '\0'); + vos_mem_copy(ssid1, src_hotlist1->ssid.ssid, src_hotlist1->ssid.ssid_len); + WMA_LOGD("bssid %02x:%02x:%02x:%02x:%02x:%02x\n", bssid1[0], bssid1[1], bssid1[2], bssid1[3], bssid1[4], bssid1[5]); + WMA_LOGD("ssid (%s)\n", ssid1); + WMA_LOGD("channel (%u)\n", src_hotlist1->channel); + WMA_LOGD("capability (%u)\n", src_hotlist1->capabilities); + WMA_LOGD("beacon interval (%u)\n", src_hotlist1->beacon_interval); + WMA_LOGD("tstamp (%u)\n", src_hotlist1->tstamp); + WMA_LOGD("flags (%d)\n", src_hotlist1->flags); + WMA_LOGD("rtt (%u)\n", src_hotlist1->rtt); + WMA_LOGD("rtt_sd (%u)\n", src_hotlist1->rtt_sd); + WMA_LOGD("number_rssi_samples (%u)\n", src_hotlist1->number_rssi_samples); + WMA_LOGD("ie length (%u)\n", src_hotlist1->ie_length); + src_hotlist1++; + } + + WMA_LOGE("rssi list \n"); + for (i = 0; i < numap; i++) { + WMA_LOGD("rssi (%d)\n", src_rssi1->rssi); + WMA_LOGD("tstamp (%u)\n", src_rssi1->tstamp); + WMA_LOGD("scan id (%d)\n", src_rssi1->scan_cycle_id); + WMA_LOGD("flags (%d)\n", src_rssi1->flags); + src_rssi1++; } - numap = event->num_entries_in_page; - if (!src_hotlist || !numap) { - WMA_LOGE("%s: cached results AP's list invalid", __func__); - return -EINVAL; + + + /* Find the unique number of scan_id's for grouping */ + prev_scan_id = src_rssi->scan_cycle_id; + WMA_LOGD("%s: numap(%d) prev_scan_id(%d) scan_cycle_id(%d)", + __func__, numap, prev_scan_id, src_rssi->scan_cycle_id); + + scan_ids_cnt = 1; + for (j = 1; j < numap; j++) { + src_rssi++; + + if (prev_scan_id != src_rssi->scan_cycle_id) { + scan_ids_cnt++; + prev_scan_id = src_rssi->scan_cycle_id; + WMA_LOGD("%s: prev_scan_id(%d) scan_cycle_id(%d)", + __func__, prev_scan_id, src_rssi->scan_cycle_id); + } } - dest_cachelist = vos_mem_malloc(sizeof(*dest_cachelist) + - sizeof(*dest_ap) * numap); + WMA_LOGD("%s: scan_ids_cnt %d", __func__, scan_ids_cnt); + buf_len = sizeof(*dest_cachelist) + + (sizeof(*dest_result) * scan_ids_cnt) + + (sizeof(*dest_ap) * numap); + dest_cachelist = vos_mem_malloc(buf_len); if (!dest_cachelist) { WMA_LOGE("%s: Allocation failed for cached" "results event", __func__); - return -EINVAL; + return -ENOMEM; } - dest_ap = &dest_cachelist->ap[0]; - dest_cachelist->requestId = event->request_id; - dest_cachelist->numOfAps = event->num_entries_in_page; - dest_cachelist->moreData = moredata; + vos_mem_zero(dest_cachelist, buf_len); + dest_cachelist->request_id = event->request_id; + dest_cachelist->more_data = moredata; + dest_cachelist->num_scan_ids = scan_ids_cnt; + dest_result = &dest_cachelist->result[0]; + dest_ap = &dest_result->ap[0]; + src_rssi = param_buf->rssi_list; + prev_scan_id = dest_result->scan_id = src_rssi->scan_cycle_id; + dest_result->flags = src_rssi->flags; + dest_result->num_results = 0; for (j = 0; j < numap; j++) { + if (prev_scan_id == src_rssi->scan_cycle_id) { + dest_result->num_results++; + } else { + dest_result++; + prev_scan_id = dest_result->scan_id = + src_rssi->scan_cycle_id; + dest_result->flags = src_rssi->flags; + dest_result->num_results = 0; + dest_ap = &dest_result->ap[0]; + } dest_ap->channel = src_hotlist->channel; - dest_ap->ts = src_hotlist->tstamp * WMA_SEC_TO_USEC; + dest_ap->ts = src_rssi->tstamp * WMA_SEC_TO_USEC; dest_ap->rtt = src_hotlist->rtt; dest_ap->rtt_sd = src_hotlist->rtt_sd; dest_ap->beaconPeriod = src_hotlist->beacon_interval; dest_ap->capability = src_hotlist->capabilities; - dest_ap->ieLength = src_hotlist-> ie_length; + dest_ap->ieLength = src_hotlist->ie_length; dest_ap->rssi = src_rssi->rssi; - WMI_MAC_ADDR_TO_CHAR_ARRAY(&src_hotlist->bssid, dest_ap->bssid); + WMI_MAC_ADDR_TO_CHAR_ARRAY(&src_hotlist->bssid, + dest_ap->bssid); vos_mem_copy(dest_ap->ssid, src_hotlist->ssid.ssid, - src_hotlist->ssid.ssid_len); + src_hotlist->ssid.ssid_len); dest_ap->ssid[src_hotlist->ssid.ssid_len] = '\0'; + dest_ap++; src_hotlist++; src_rssi++; } + + /* Print the data */ + WMA_LOGI("request id (%d)", dest_cachelist->request_id); + WMA_LOGI("more data (%d)", dest_cachelist->more_data); + WMA_LOGI("num_scan_ids (%d)", dest_cachelist->num_scan_ids); + dest_result = &dest_cachelist->result[0]; + for (i = 0; i < dest_cachelist->num_scan_ids; i++) { + WMA_LOGI("scan id (%d)", dest_result->scan_id); + WMA_LOGI("flags (%d)", dest_result->flags); + WMA_LOGI("num results (%d)", dest_result->num_results); + dest_ap = &dest_result->ap[0]; + for (j = 0; j < dest_result->num_results; j++) { + WMA_LOGI("ts (%llu)", dest_ap->ts); + WMA_LOGI("ssid (%s)", dest_ap->ssid); + WMA_LOGI("rtt (%u)", dest_ap->rtt); + WMA_LOGI("channel (%u)", dest_ap->channel); + WMA_LOGI("beacon period (%u)", dest_ap->beaconPeriod); + dest_ap++; + } + dest_result++; + } + pMac->sme.pExtScanIndCb(pMac->hHdd, eSIR_EXTSCAN_CACHED_RESULTS_IND, dest_cachelist); WMA_LOGD("%s: sending cached results event", __func__); vos_mem_free(dest_cachelist); return 0; + +noresults: + empty_cachelist.request_id = event->request_id; + empty_cachelist.more_data = 0; + empty_cachelist.num_scan_ids = 0; + + pMac->sme.pExtScanIndCb(pMac->hHdd, + eSIR_EXTSCAN_CACHED_RESULTS_IND, + &empty_cachelist); + WMA_LOGD("%s: sending cached results event", __func__); + return 0; } static int wma_extscan_change_results_event_handler(void *handle, @@ -3174,14 +3292,24 @@ static int wma_unified_link_iface_stats_event_handler(void *handle, WMA_LOGD("Iface Stats:"); WMA_LOGD("beacon_rx %u mgmt_rx %u mgmt_action_rx %u mgmt_action_tx %u " - "rssi_mgmt %u rssi_data %u rssi_ack %u num_peers %u " - "num_peer_events %u num_ac %u roam_state %u", - link_stats->beacon_rx, link_stats->mgmt_rx, - link_stats->mgmt_action_rx, link_stats->mgmt_action_tx, - link_stats->rssi_mgmt, link_stats->rssi_data, - link_stats->rssi_ack, link_stats->num_peers, - link_stats->num_peer_events, link_stats->num_ac, - link_stats->roam_state); + "rssi_mgmt %u rssi_data %u rssi_ack %u num_peers %u " + "num_peer_events %u num_ac %u roam_state %u" + " avg_bcn_spread_offset_high %u" + " avg_bcn_spread_offset_high %u" + " is leaky_ap %u" + " avg_rx_frames_leaked %u" + " rx_leak_window %u", + link_stats->beacon_rx, link_stats->mgmt_rx, + link_stats->mgmt_action_rx, link_stats->mgmt_action_tx, + link_stats->rssi_mgmt, link_stats->rssi_data, + link_stats->rssi_ack, link_stats->num_peers, + link_stats->num_peer_events, link_stats->num_ac, + link_stats->roam_state, + link_stats->avg_bcn_spread_offset_high, + link_stats->avg_bcn_spread_offset_low, + link_stats->is_leaky_ap, + link_stats->avg_rx_frms_leaked, + link_stats->rx_leak_window); vos_mem_zero(link_stats_results, link_stats_results_size); @@ -21803,7 +21931,8 @@ static VOS_STATUS wma_process_ll_stats_getReq cmd->min_dwell_time_passive = dwelltime; cmd->max_dwell_time_passive = dwelltime; cmd->max_bssids_per_scan_cycle = pstart->maxAPperScan; - cmd->max_table_usage = pstart->reportThreshold; + cmd->max_table_usage = pstart->report_threshold_percent; + cmd->report_threshold_num_scans = pstart->report_threshold_num_scans; cmd->repeat_probe_time = WMA_EXTSCAN_REPEAT_PROBE; cmd->max_scan_time = WMA_EXTSCAN_MAX_SCAN_TIME; @@ -21857,6 +21986,9 @@ static VOS_STATUS wma_process_ll_stats_getReq dest_blist->bucket_id = src_bucket->bucket; dest_blist->base_period_multiplier = src_bucket->period / base_period; + dest_blist->max_period = 0; + dest_blist->exp_backoff = 0; + dest_blist->exp_max_step_count = 0; dest_blist->channel_band = src_bucket->band; dest_blist->num_channels = src_bucket->numChannels; dest_blist->notify_extscan_events = @@ -22102,7 +22234,6 @@ VOS_STATUS wma_get_buf_extscan_hotlist_cmd(tp_wma_handle wma_handle, wmi_extscan_hotlist_entry)); dest_hotlist->min_rssi = src_ap->low; - dest_hotlist->channel = src_ap->channel; WMI_CHAR_ARRAY_TO_MAC_ADDR(src_ap->bssid, &dest_hotlist->bssid); @@ -22278,12 +22409,10 @@ VOS_STATUS wma_get_buf_extscan_change_monitor_cmd(tp_wma_handle wma_handle, dest_chglist->lower_rssi_limit = src_ap->low; dest_chglist->upper_rssi_limit = src_ap->high; - dest_chglist->channel = src_ap->channel; WMI_CHAR_ARRAY_TO_MAC_ADDR(src_ap->bssid, &dest_chglist->bssid); - WMA_LOGD("%s:channel:%x min_rssi %d", - __func__, dest_chglist->channel, + WMA_LOGD("%s:min_rssi %d", __func__, dest_chglist->lower_rssi_limit); dest_chglist++; src_ap++; @@ -22478,6 +22607,118 @@ VOS_STATUS wma_extscan_get_capabilities(tp_wma_handle wma, } return VOS_STATUS_SUCCESS; } + +/** wma_set_epno_network_list() - set epno network list + * @wma: WMA handle + * @req: epno config params request structure + * + * This function reads the incoming epno config request structure + * and constructs the WMI message to the firmware. + * + * Returns: 0 on success, error number otherwise + */ +static int wma_set_epno_network_list(tp_wma_handle wma, + struct wifi_epno_params *req) +{ + wmi_nlo_config_cmd_fixed_param *cmd; + nlo_configured_parameters *nlo_list; + u_int8_t i, *buf_ptr; + wmi_buf_t buf; + uint32_t len; + int ret; + + WMA_LOGD("wma_set_epno_network_list"); + + if (!wma || !wma->wmi_handle) { + WMA_LOGE("%s: WMA is closed, can not issue cmd", __func__); + return -EINVAL; + } + if (!WMI_SERVICE_IS_ENABLED(wma->wmi_service_bitmap, + WMI_SERVICE_EXTSCAN)) { + WMA_LOGE("%s: extscan not enabled", __func__); + return -EINVAL; + } + + /* TLV place holder for array of structures + * nlo_configured_parameters(nlo_list) */ + len = sizeof(*cmd) + WMI_TLV_HDR_SIZE; + len += sizeof(nlo_configured_parameters) * + MIN(req->num_networks, WMI_NLO_MAX_SSIDS); + + buf = wmi_buf_alloc(wma->wmi_handle, len); + if (!buf) { + WMA_LOGE("%s: Failed allocate wmi buffer", __func__); + return -ENOMEM; + } + + cmd = (wmi_nlo_config_cmd_fixed_param *) wmi_buf_data(buf); + + buf_ptr = (u_int8_t *) cmd; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_nlo_config_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_nlo_config_cmd_fixed_param)); + cmd->vdev_id = req->session_id; + cmd->flags = WMI_NLO_CONFIG_ENLO; + + buf_ptr += sizeof(wmi_nlo_config_cmd_fixed_param); + + cmd->no_of_ssids = MIN(req->num_networks, WMI_NLO_MAX_SSIDS); + WMA_LOGD("SSID count: %d", cmd->no_of_ssids); + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, + cmd->no_of_ssids * sizeof(nlo_configured_parameters)); + buf_ptr += WMI_TLV_HDR_SIZE; + + nlo_list = (nlo_configured_parameters *) buf_ptr; + for (i = 0; i < cmd->no_of_ssids; i++) { + WMITLV_SET_HDR(&nlo_list[i].tlv_header, + WMITLV_TAG_ARRAY_BYTE, + WMITLV_GET_STRUCT_TLVLEN(nlo_configured_parameters)); + /* Copy ssid and it's length */ + nlo_list[i].ssid.valid = TRUE; + nlo_list[i].ssid.ssid.ssid_len = req->networks[i].ssid.length; + vos_mem_copy(nlo_list[i].ssid.ssid.ssid, + req->networks[i].ssid.ssId, + nlo_list[i].ssid.ssid.ssid_len); + WMA_LOGD("index: %d ssid: %.*s len: %d", i, + nlo_list[i].ssid.ssid.ssid_len, + (char *) nlo_list[i].ssid.ssid.ssid, + nlo_list[i].ssid.ssid.ssid_len); + + /* Copy rssi threshold */ + nlo_list[i].rssi_cond.valid = TRUE; + nlo_list[i].rssi_cond.rssi = + req->networks[i].rssi_threshold; + WMA_LOGD("RSSI threshold : %d dBm", + nlo_list[i].rssi_cond.rssi); + + /* Copy pno flags */ + nlo_list[i].bcast_nw_type.valid = TRUE; + nlo_list[i].bcast_nw_type.bcast_nw_type = + req->networks[i].flags; + WMA_LOGD("PNO flags (%u)", + nlo_list[i].bcast_nw_type.bcast_nw_type); + + /* Copy auth bit field */ + nlo_list[i].auth_type.valid = TRUE; + nlo_list[i].auth_type.auth_type = + req->networks[i].auth_bit_field; + WMA_LOGD("Auth bit field (%u)", + nlo_list[i].auth_type.auth_type); + } + ret = wmi_unified_cmd_send(wma->wmi_handle, buf, len, + WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send nlo wmi cmd", __func__); + wmi_buf_free(buf); + return -EINVAL; + } + + WMA_LOGD("set ePNO list request sent successfully for vdev %d", + req->session_id); + + return 0; +} #endif VOS_STATUS wma_ipa_offload_enable_disable(tp_wma_handle wma, @@ -23311,6 +23552,76 @@ VOS_STATUS wma_process_set_miracast(tp_wma_handle wma, u_int32_t *miracast_val) return VOS_STATUS_SUCCESS; } +/** + * wma_config_stats_factor() - Function to configure stats avg. factor + * @wma: pointer to WMA handle + * @avg_factor: stats. avg. factor passed down by userspace + * + * This function configures the avg. stats value in firmware + * + * Return: VOS_STATUS_SUCCESS for success otherwise failure + * + */ +VOS_STATUS wma_config_stats_factor(tp_wma_handle wma, + struct sir_stats_avg_factor *avg_factor) +{ + int ret; + + if (NULL == wma || NULL == avg_factor) { + WMA_LOGE("%s: Invalid input of stats avg factor", __func__); + return VOS_STATUS_E_FAILURE; + } + + ret = wmi_unified_vdev_set_param_send(wma->wmi_handle, + avg_factor->vdev_id, + WMI_VDEV_PARAM_STATS_AVG_FACTOR, + avg_factor->stats_avg_factor); + if (ret) { + WMA_LOGE(" failed to set avg_factor for vdev_id %d", + avg_factor->vdev_id); + } + + WMA_LOGD("%s: Set stats_avg_factor %d for vdev_id %d", __func__, + avg_factor->stats_avg_factor, avg_factor->vdev_id); + + return ret; +} + +/** + * wma_config_guard_time() - Function to set guard time in firmware + * @wma: pointer to WMA handle + * @guard_time: guard time passed down by userspace + * + * This function configures the guard time in firmware + * + * Return: VOS_STATUS_SUCCESS for success otherwise failure + * + */ +VOS_STATUS wma_config_guard_time(tp_wma_handle wma, + struct sir_guard_time_request *guard_time) +{ + int ret; + + if (NULL == wma || NULL == guard_time) { + WMA_LOGE("%s: Invalid input of guard time", __func__); + return VOS_STATUS_E_FAILURE; + } + + ret = wmi_unified_vdev_set_param_send(wma->wmi_handle, + guard_time->vdev_id, + WMI_VDEV_PARAM_RX_LEAK_WINDOW, + guard_time->guard_time); + if (ret) { + WMA_LOGE(" failed to set guard time for vdev_id %d", + guard_time->vdev_id); + } + + WMA_LOGD("Set guard time %d for vdev_id %d", + guard_time->guard_time, guard_time->vdev_id); + + return ret; +} + /* * function : wma_mc_process_msg * Description : @@ -23861,6 +24172,11 @@ VOS_STATUS wma_mc_process_msg(v_VOID_t *vos_context, vos_msg_t *msg) (tSirGetExtScanCapabilitiesReqParams *)msg->bodyptr); vos_mem_free(msg->bodyptr); break; + case WDA_SET_EPNO_LIST_REQ: + wma_set_epno_network_list(wma_handle, + (struct wifi_epno_params *)msg->bodyptr); + vos_mem_free(msg->bodyptr); + break; #endif case WDA_SET_SCAN_MAC_OUI_REQ: wma_scan_probe_setoui(wma_handle, msg->bodyptr); @@ -24013,6 +24329,16 @@ VOS_STATUS wma_mc_process_msg(v_VOID_t *vos_context, vos_msg_t *msg) case WDA_GET_FW_STATUS_REQ: wma_send_echo_request(wma_handle); break; + case SIR_HAL_CONFIG_STATS_FACTOR: + wma_config_stats_factor(wma_handle, + (struct sir_stats_avg_factor *)msg->bodyptr); + vos_mem_free(msg->bodyptr); + break; + case SIR_HAL_CONFIG_GUARD_TIME: + wma_config_guard_time(wma_handle, + (struct sir_guard_time_request *)msg->bodyptr); + vos_mem_free(msg->bodyptr); + break; default: WMA_LOGD("unknow msg type %x", msg->type); /* Do Nothing? MSG Body should be freed at here */ diff --git a/CORE/SERVICES/WMI/wmi_unified.c b/CORE/SERVICES/WMI/wmi_unified.c index 2ab75d523f93..51e996914268 100644 --- a/CORE/SERVICES/WMI/wmi_unified.c +++ b/CORE/SERVICES/WMI/wmi_unified.c @@ -582,6 +582,7 @@ static u_int8_t* get_wmi_cmd_string(WMI_CMD_ID wmi_command) CASE_RETURN_STRING(WMI_EXTSCAN_GET_WLAN_CHANGE_RESULTS_CMDID); CASE_RETURN_STRING(WMI_EXTSCAN_SET_CAPABILITIES_CMDID); CASE_RETURN_STRING(WMI_EXTSCAN_GET_CAPABILITIES_CMDID); + CASE_RETURN_STRING(WMI_EXTSCAN_CONFIGURE_HOTLIST_SSID_MONITOR_CMDID); CASE_RETURN_STRING(WMI_ROAM_SYNCH_COMPLETE); CASE_RETURN_STRING(WMI_D0_WOW_ENABLE_DISABLE_CMDID); CASE_RETURN_STRING(WMI_EXTWOW_ENABLE_CMDID); @@ -604,6 +605,7 @@ static u_int8_t* get_wmi_cmd_string(WMI_CMD_ID wmi_command) CASE_RETURN_STRING(WMI_SET_ANTENNA_DIVERSITY_CMDID); CASE_RETURN_STRING(WMI_SAP_OFL_ENABLE_CMDID); CASE_RETURN_STRING(WMI_APFIND_CMDID); + CASE_RETURN_STRING(WMI_PASSPOINT_LIST_CONFIG_CMDID); CASE_RETURN_STRING(WMI_OCB_SET_SCHED_CMDID); CASE_RETURN_STRING(WMI_OCB_SET_CONFIG_CMDID); CASE_RETURN_STRING(WMI_OCB_SET_UTC_TIME_CMDID); diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index d2c84bfdd26f..6dba4a5c1120 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -3977,6 +3977,9 @@ eHalStatus sme_ResetSignificantChange (tHalHandle hHal, eHalStatus sme_getCachedResults (tHalHandle hHal, tSirExtScanGetCachedResultsReqParams *pCachedResultsReq); +eHalStatus sme_set_epno_list(tHalHandle hal, + struct wifi_epno_params *req_msg); + /* --------------------------------------------------------------------------- \fn sme_ExtScanRegisterCallback \brief SME API to register extscan notification callback @@ -4276,4 +4279,10 @@ bool sme_validate_sap_channel_switch(tHalHandle hal, eCsrPhyMode sap_phy_mode, uint8_t cc_switch_mode, uint32_t session_id); + +eHalStatus sme_configure_stats_avg_factor(tHalHandle hHal, tANI_U8 session_id, + tANI_U16 stats_avg_factor); + +eHalStatus sme_configure_guard_time(tHalHandle hHal, tANI_U8 session_id, + tANI_U32 guard_time); #endif //#if !defined( __SME_API_H ) diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index bca7afa9dd8f..895434f9a1dd 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -2843,6 +2843,14 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) vos_mem_free(pMsg->bodyptr); break; } + case eWNI_SME_EPNO_NETWORK_FOUND_IND: + { + pMac->sme.pExtScanIndCb(pMac->hHdd, + eSIR_EPNO_NETWORK_FOUND_IND, + pMsg->bodyptr); + vos_mem_free(pMsg->bodyptr); + break; + } #endif case eWNI_SME_FW_STATUS_IND: if (pMac->sme.fw_state_callback) @@ -14320,6 +14328,77 @@ eHalStatus sme_getCachedResults (tHalHandle hHal, return status; } +/** + * sme_set_epno_list() - set epno network list + * @hHal: global hal handle + * @input: request message + * + * This function constructs the vos message and fill in message type, + * bodyptr with %input and posts it to WDA queue. + * + * Return: eHalStatus enumeration + */ +eHalStatus sme_set_epno_list(tHalHandle hal, + struct wifi_epno_params *input) +{ + eHalStatus status = eHAL_STATUS_SUCCESS; + VOS_STATUS vos_status = VOS_STATUS_SUCCESS; + tpAniSirGlobal mac = PMAC_STRUCT(hal); + vos_msg_t vos_message; + struct wifi_epno_params *req_msg; + int len, i; + + smsLog(mac, LOG1, FL("enter")); + len = sizeof(*req_msg) + + (input->num_networks * sizeof(struct wifi_epno_network)); + req_msg = vos_mem_malloc(len); + if (!req_msg) { + smsLog(mac, LOGE, FL("vos_mem_malloc failed")); + return eHAL_STATUS_FAILED_ALLOC; + } + + vos_mem_zero(req_msg, len); + req_msg->num_networks = input->num_networks; + req_msg->request_id = input->request_id; + req_msg->session_id = input->session_id; + for (i = 0; i < req_msg->num_networks; i++) { + req_msg->networks[i].rssi_threshold = + input->networks[i].rssi_threshold; + req_msg->networks[i].flags = input->networks[i].flags; + req_msg->networks[i].auth_bit_field = + input->networks[i].auth_bit_field; + req_msg->networks[i].ssid.length = + input->networks[i].ssid.length; + vos_mem_copy(req_msg->networks[i].ssid.ssId, + input->networks[i].ssid.ssId, + req_msg->networks[i].ssid.length); + } + + status = sme_AcquireGlobalLock(&mac->sme); + if (status != eHAL_STATUS_SUCCESS) { + smsLog(mac, LOGE, + FL("sme_AcquireGlobalLock failed!(status=%d)"), + status); + vos_mem_free(req_msg); + return status; + } + + /* Serialize the req through MC thread */ + vos_message.bodyptr = req_msg; + vos_message.type = WDA_SET_EPNO_LIST_REQ; + vos_status = vos_mq_post_message(VOS_MQ_ID_WDA, &vos_message); + if (!VOS_IS_STATUS_SUCCESS(vos_status)) { + smsLog(mac, LOGE, + FL("vos_mq_post_message failed!(err=%d)"), + vos_status); + vos_mem_free(req_msg); + status = eHAL_STATUS_FAILURE; + } + sme_ReleaseGlobalLock(&mac->sme); + return status; +} + + eHalStatus sme_ExtScanRegisterCallback (tHalHandle hHal, void (*pExtScanIndCb)(void *, const tANI_U16, void *)) { @@ -15130,3 +15209,117 @@ bool sme_validate_sap_channel_switch(tHalHandle hal, return (intf_channel == 0)? true : false; } #endif + +/** + * sme_configure_stats_avg_factor() - function to config avg. stats factor + * @hHal: hHal + * @session_id: session ID + * @stats_avg_factor: average stats factor + * + * This function configures the guard time in firmware + * + * Return: eHalStatus + */ +eHalStatus sme_configure_stats_avg_factor(tHalHandle hHal, tANI_U8 session_id, + tANI_U16 stats_avg_factor) +{ + vos_msg_t msg; + eHalStatus status = eHAL_STATUS_SUCCESS; + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + struct sir_stats_avg_factor *stats_factor; + + stats_factor = vos_mem_malloc(sizeof(*stats_factor)); + + if (!stats_factor) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: Not able to allocate memory for WDA_SET_MDNS_RESPONSE_CMD", + __func__); + return eHAL_STATUS_E_MALLOC_FAILED; + } + + status = sme_AcquireGlobalLock(&pMac->sme); + + if (eHAL_STATUS_SUCCESS == status) { + + stats_factor->vdev_id = session_id; + stats_factor->stats_avg_factor = stats_avg_factor; + + /* serialize the req through MC thread */ + msg.type = SIR_HAL_CONFIG_STATS_FACTOR; + msg.bodyptr = stats_factor; + + if (!VOS_IS_STATUS_SUCCESS( + vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) { + VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: Not able to post SIR_HAL_CONFIG_STATS_FACTOR to WMA!", + __func__); + vos_mem_free(stats_factor); + status = eHAL_STATUS_FAILURE; + } + sme_ReleaseGlobalLock(&pMac->sme); + } else { + VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: sme_AcquireGlobalLock error!", + __func__); + vos_mem_free(stats_factor); + } + + return status; +} + +/** + * sme_configure_guard_time() - function to configure guard time + * @hHal: SME API to enable/disable DFS channel scan + * @session_id: session ID + * @guard_time: Guard time + * + * This function configures the guard time in firmware + * + * Return: eHalStatus + */ +eHalStatus sme_configure_guard_time(tHalHandle hHal, tANI_U8 session_id, + tANI_U32 guard_time) +{ + vos_msg_t msg; + eHalStatus status = eHAL_STATUS_SUCCESS; + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + struct sir_guard_time_request *g_time; + + g_time = vos_mem_malloc(sizeof(g_time)); + + if (!g_time) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: Not able to allocate memory for WDA_SET_MDNS_RESPONSE_CMD", + __func__); + return eHAL_STATUS_E_MALLOC_FAILED; + } + + status = sme_AcquireGlobalLock(&pMac->sme); + + if (eHAL_STATUS_SUCCESS == status) { + + g_time->vdev_id = session_id; + g_time->guard_time = guard_time; + + /* serialize the req through MC thread */ + msg.type = SIR_HAL_CONFIG_GUARD_TIME; + msg.bodyptr = g_time; + + if (!VOS_IS_STATUS_SUCCESS( + vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) { + VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: Not able to post SIR_HAL_CONFIG_GUARD_TIME to WDA!", + __func__); + vos_mem_free(g_time); + status = eHAL_STATUS_FAILURE; + } + sme_ReleaseGlobalLock(&pMac->sme); + } else { + VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: sme_AcquireGlobalLock error!", + __func__); + vos_mem_free(g_time); + } + + return status; +} diff --git a/CORE/VOSS/inc/i_vos_packet.h b/CORE/VOSS/inc/i_vos_packet.h index 72504c3d43f2..37178380420e 100644 --- a/CORE/VOSS/inc/i_vos_packet.h +++ b/CORE/VOSS/inc/i_vos_packet.h @@ -63,7 +63,7 @@ typedef struct u_int8_t scan:1; u_int8_t dpuFeedback; u_int8_t sessionId; - u_int8_t scan_src:1; + u_int8_t scan_src; }t_packetmeta, *tp_packetmeta; /* implementation specific vos packet type */ diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h index d09cee1a9af2..67460f98b700 100644 --- a/CORE/WDA/inc/wlan_qct_wda.h +++ b/CORE/WDA/inc/wlan_qct_wda.h @@ -513,12 +513,15 @@ VOS_STATUS WDA_open(v_PVOID_t pVosContext, v_PVOID_t pOSContext, (((t_packetmeta *)pRxMeta)->roamCandidateInd) #define WDA_GET_SESSIONID(pRxMeta) \ (((t_packetmeta *)pRxMeta)->sessionId) - +#define WMA_GET_SCAN_SRC(pRxMeta) \ + (((t_packetmeta *)pRxMeta)->scan_src) #endif #ifdef FEATURE_WLAN_EXTSCAN #define WMA_IS_EXTSCAN_SCAN_SRC(pRxMeta) \ - ((((t_packetmeta *)pRxMeta)->scan_src) == WMI_MGMT_RX_HDR_EXTSCAN) + ((((t_packetmeta *)pRxMeta)->scan_src) & WMI_MGMT_RX_HDR_EXTSCAN) +#define WMA_IS_EPNO_SCAN_SRC(pRxMeta) \ + ((((t_packetmeta *)pRxMeta)->scan_src) & WMI_MGMT_RX_HDR_ENLO) #endif /* FEATURE_WLAN_EXTSCAN */ #define WDA_GET_RX_SNR(pRxMeta) \ @@ -970,6 +973,7 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); #define WDA_EXTSCAN_SET_SIGNF_CHANGE_REQ SIR_HAL_EXTSCAN_SET_SIGNF_CHANGE_REQ #define WDA_EXTSCAN_RESET_SIGNF_CHANGE_REQ SIR_HAL_EXTSCAN_RESET_SIGNF_CHANGE_REQ #define WDA_EXTSCAN_GET_CACHED_RESULTS_REQ SIR_HAL_EXTSCAN_GET_CACHED_RESULTS_REQ +#define WDA_SET_EPNO_LIST_REQ SIR_HAL_SET_EPNO_LIST_REQ #endif /* FEATURE_WLAN_EXTSCAN */ |
