From 3fb150464237e8ed773316da3af69f197438c1eb Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Tue, 15 Aug 2017 15:54:49 -0700 Subject: [PATCH] qcacld-3.0: Add wrapper for nla_parse() The Linux kernel version 4.12 introduced an API change to nla_parse(). Add conditional complilation to call nla_parse with the correct parameters based on the version of the linux kernel being compiled against. Change-Id: Ibacd71f65760f9de4d2d87c77392a1c20bae5fa1 CRs-Fixed: 2093345 --- core/hdd/inc/wlan_hdd_main.h | 17 +++ core/hdd/src/wlan_hdd_cfg80211.c | 190 +++++++++++++------------- core/hdd/src/wlan_hdd_disa.c | 2 +- core/hdd/src/wlan_hdd_ext_scan.c | 116 ++++++++-------- core/hdd/src/wlan_hdd_nan_datapath.c | 5 +- core/hdd/src/wlan_hdd_ocb.c | 42 +++--- core/hdd/src/wlan_hdd_oemdata.c | 2 +- core/hdd/src/wlan_hdd_scan.c | 7 +- core/hdd/src/wlan_hdd_stats.c | 24 ++-- core/hdd/src/wlan_hdd_subnet_detect.c | 4 +- core/hdd/src/wlan_hdd_tdls.c | 17 ++- core/hdd/src/wlan_hdd_tsf.c | 4 +- 12 files changed, 218 insertions(+), 212 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 9540d776ff35..9939e89afc4b 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -2725,4 +2725,21 @@ void hdd_clear_fils_connection_info(hdd_adapter_t *adapter); static inline void hdd_clear_fils_connection_info(hdd_adapter_t *adapter) { } #endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) +static inline int +hdd_nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head, + int len, const struct nla_policy *policy) +{ + return nla_parse(tb, maxtype, head, len, policy); +} +#else +static inline int +hdd_nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head, + int len, const struct nla_policy *policy) +{ + return nla_parse(tb, maxtype, head, len, policy, NULL); +} +#endif + #endif /* end #if !defined(WLAN_HDD_MAIN_H) */ diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 7dd5476ec491..5a774704a71c 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -2226,8 +2226,8 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, sap_config = &adapter->sessionCtx.ap.sapConfig; qdf_mem_zero(&sap_config->acs_cfg, sizeof(struct sap_acs_cfg)); - status = nla_parse(tb, QCA_WLAN_VENDOR_ATTR_ACS_MAX, data, data_len, - wlan_hdd_cfg80211_do_acs_policy); + status = hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_ACS_MAX, data, data_len, + wlan_hdd_cfg80211_do_acs_policy); if (status) { hdd_err("Invalid ATTR"); goto out; @@ -2826,8 +2826,8 @@ __wlan_hdd_cfg80211_set_scanning_mac_oui(struct wiphy *wiphy, * audit note: it is ok to pass a NULL policy here since only * one attribute is parsed and it is explicitly validated */ - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_MAX, - data, data_len, NULL)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_MAX, + data, data_len, NULL)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -2944,8 +2944,8 @@ static int __wlan_hdd_cfg80211_get_concurrency_matrix(struct wiphy *wiphy, if (ret) return ret; - if (nla_parse(tb, MAX_CONCURRENT_MATRIX, data, data_len, - wlan_hdd_get_concurrency_matrix_policy)) { + if (hdd_nla_parse(tb, MAX_CONCURRENT_MATRIX, data, data_len, + wlan_hdd_get_concurrency_matrix_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -3274,12 +3274,12 @@ static int hdd_set_white_list(hdd_context_t *hddctx, if (count && tb[PARAM_SSID_LIST]) { nla_for_each_nested(curr_attr, tb[PARAM_SSID_LIST], rem) { - if (nla_parse(tb2, - QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_MAX, - nla_data(curr_attr), - nla_len(curr_attr), - wlan_hdd_set_roam_param_policy)) { - hdd_err("nla_parse failed"); + if (hdd_nla_parse(tb2, + QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_MAX, + nla_data(curr_attr), + nla_len(curr_attr), + wlan_hdd_set_roam_param_policy)) { + hdd_err("hdd_nla_parse failed"); goto fail; } /* Parse and Fetch allowed SSID list*/ @@ -3371,11 +3371,11 @@ static int hdd_set_bssid_prefs(hdd_context_t *hddctx, break; } - if (nla_parse(tb2, - QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX, - nla_data(curr_attr), nla_len(curr_attr), - wlan_hdd_set_roam_param_policy)) { - hdd_err("nla_parse failed"); + if (hdd_nla_parse(tb2, + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX, + nla_data(curr_attr), nla_len(curr_attr), + wlan_hdd_set_roam_param_policy)) { + hdd_err("hdd_nla_parse failed"); goto fail; } /* Parse and fetch MAC address */ @@ -3455,12 +3455,12 @@ static int hdd_set_blacklist_bssid(hdd_context_t *hddctx, break; } - if (nla_parse(tb2, - QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX, - nla_data(curr_attr), - nla_len(curr_attr), - wlan_hdd_set_roam_param_policy)) { - hdd_err("nla_parse failed"); + if (hdd_nla_parse(tb2, + QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX, + nla_data(curr_attr), + nla_len(curr_attr), + wlan_hdd_set_roam_param_policy)) { + hdd_err("hdd_nla_parse failed"); goto fail; } /* Parse and fetch MAC address */ @@ -3507,8 +3507,8 @@ static int hdd_set_ext_roam_params(hdd_context_t *hddctx, struct nlattr *tb[MAX_ROAMING_PARAM + 1]; int ret; - if (nla_parse(tb, MAX_ROAMING_PARAM, data, data_len, - wlan_hdd_set_roam_param_policy)) { + if (hdd_nla_parse(tb, MAX_ROAMING_PARAM, data, data_len, + wlan_hdd_set_roam_param_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -3947,9 +3947,9 @@ static int __wlan_hdd_cfg80211_disable_dfs_chan_scan(struct wiphy *wiphy, if (ret_val) return ret_val; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_MAX, - data, data_len, - wlan_hdd_set_no_dfs_flag_config_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_MAX, + data, data_len, + wlan_hdd_set_no_dfs_flag_config_policy)) { hdd_err("invalid attr"); return -EINVAL; } @@ -4043,8 +4043,8 @@ static int __wlan_hdd_cfg80211_handle_wisa_cmd(struct wiphy *wiphy, return -EPERM; } - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_WISA_MAX, data, data_len, - wlan_hdd_wisa_cmd_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_WISA_MAX, data, data_len, + wlan_hdd_wisa_cmd_policy)) { hdd_err("Invalid WISA cmd attributes"); ret_val = -EINVAL; goto err; @@ -4799,8 +4799,8 @@ __hdd_cfg80211_get_station_cmd(struct wiphy *wiphy, goto out; - status = nla_parse(tb, QCA_WLAN_VENDOR_ATTR_GET_STATION_MAX, - data, data_len, hdd_get_station_policy); + status = hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_GET_STATION_MAX, + data, data_len, hdd_get_station_policy); if (status) { hdd_err("Invalid ATTR"); goto out; @@ -5033,8 +5033,8 @@ __wlan_hdd_cfg80211_get_wifi_info(struct wiphy *wiphy, if (status) return status; - if (nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_WIFI_INFO_GET_MAX, data, - data_len, qca_wlan_vendor_get_wifi_info_policy)) { + if (hdd_nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_WIFI_INFO_GET_MAX, data, + data_len, qca_wlan_vendor_get_wifi_info_policy)) { hdd_err("WIFI_INFO_GET NL CMD parsing failed"); return -EINVAL; } @@ -5748,9 +5748,8 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, if (ret_val) return ret_val; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_CONFIG_MAX, - data, data_len, - wlan_hdd_wifi_config_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_CONFIG_MAX, + data, data_len, wlan_hdd_wifi_config_policy)) { hdd_err("invalid attr"); return -EINVAL; } @@ -6273,9 +6272,9 @@ static int __wlan_hdd_cfg80211_wifi_logger_start(struct wiphy *wiphy, return -EINVAL; } - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_START_MAX, - data, data_len, - qca_wlan_vendor_wifi_logger_start_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_START_MAX, + data, data_len, + qca_wlan_vendor_wifi_logger_start_policy)) { hdd_err("Invalid attribute"); return -EINVAL; } @@ -6401,9 +6400,9 @@ static int __wlan_hdd_cfg80211_wifi_logger_get_ring_data(struct wiphy *wiphy, if (status) return status; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_MAX, - data, data_len, - qca_wlan_vendor_wifi_logger_get_ring_data_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_MAX, + data, data_len, + qca_wlan_vendor_wifi_logger_get_ring_data_policy)) { hdd_err("Invalid attribute"); return -EINVAL; } @@ -6805,7 +6804,7 @@ __wlan_hdd_cfg80211_offloaded_packets(struct wiphy *wiphy, return -ENOTSUPP; } - if (nla_parse(tb, PARAM_MAX, data, data_len, policy)) { + if (hdd_nla_parse(tb, PARAM_MAX, data, data_len, policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -6919,7 +6918,7 @@ __wlan_hdd_cfg80211_monitor_rssi(struct wiphy *wiphy, return -ENOTSUPP; } - if (nla_parse(tb, PARAM_MAX, data, data_len, policy)) { + if (hdd_nla_parse(tb, PARAM_MAX, data, data_len, policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -7104,10 +7103,10 @@ __wlan_hdd_cfg80211_set_ns_offload(struct wiphy *wiphy, return -EINVAL; } - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_ND_OFFLOAD_MAX, - (struct nlattr *)data, - data_len, ns_offload_set_policy)) { - hdd_err("nla_parse failed"); + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_ND_OFFLOAD_MAX, + (struct nlattr *)data, + data_len, ns_offload_set_policy)) { + hdd_err("hdd_nla_parse failed"); return -EINVAL; } @@ -7193,8 +7192,8 @@ static int __wlan_hdd_cfg80211_get_preferred_freq_list(struct wiphy *wiphy, if (ret) return -EINVAL; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_MAX, - data, data_len, get_preferred_freq_list_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_MAX, + data, data_len, get_preferred_freq_list_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -7322,8 +7321,8 @@ static int __wlan_hdd_cfg80211_set_probable_oper_channel(struct wiphy *wiphy, if (ret) return ret; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_MAX, - data, data_len, set_probable_oper_channel_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_MAX, + data, data_len, set_probable_oper_channel_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -7461,8 +7460,8 @@ static int __wlan_hdd_cfg80211_get_link_properties(struct wiphy *wiphy, if (0 != wlan_hdd_validate_context(hdd_ctx)) return -EINVAL; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_MAX, data, data_len, - qca_wlan_vendor_attr_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_MAX, data, data_len, + qca_wlan_vendor_attr_policy)) { hdd_err("Invalid attribute"); return -EINVAL; } @@ -7652,9 +7651,8 @@ static int __wlan_hdd_cfg80211_set_ota_test(struct wiphy *wiphy, if (0 != wlan_hdd_validate_context(hdd_ctx)) return -EINVAL; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_OTA_TEST_MAX, - data, data_len, - qca_wlan_vendor_ota_test_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_OTA_TEST_MAX, + data, data_len, qca_wlan_vendor_ota_test_policy)) { hdd_err("invalid attr"); return -EINVAL; } @@ -7764,8 +7762,8 @@ static int __wlan_hdd_cfg80211_txpower_scale(struct wiphy *wiphy, adapter = WLAN_HDD_GET_PRIV_PTR(dev); - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_MAX, - data, data_len, txpower_scale_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_MAX, + data, data_len, txpower_scale_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -7852,8 +7850,8 @@ static int __wlan_hdd_cfg80211_txpower_scale_decr_db(struct wiphy *wiphy, adapter = WLAN_HDD_GET_PRIV_PTR(dev); - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB_MAX, - data, data_len, txpower_scale_decr_db_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB_MAX, + data, data_len, txpower_scale_decr_db_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -7955,8 +7953,9 @@ static int __wlan_hdd_cfg80211_conditional_chan_switch(struct wiphy *wiphy, * one attribute is parsed which is array of frequencies and * it is explicitly validated for both under read and over read */ - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SAP_CONDITIONAL_CHAN_SWITCH_MAX, - data, data_len, NULL)) { + if (hdd_nla_parse(tb, + QCA_WLAN_VENDOR_ATTR_SAP_CONDITIONAL_CHAN_SWITCH_MAX, + data, data_len, NULL)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -8078,8 +8077,8 @@ static int __wlan_hdd_cfg80211_p2p_lo_start(struct wiphy *wiphy, return -EINVAL; } - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_MAX, - data, data_len, p2p_listen_offload_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_P2P_LISTEN_OFFLOAD_MAX, + data, data_len, p2p_listen_offload_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -8609,8 +8608,8 @@ __wlan_hdd_cfg80211_bpf_offload(struct wiphy *wiphy, return -ENOTSUPP; } - if (nla_parse(tb, BPF_MAX, data, data_len, - wlan_hdd_bpf_offload_policy)) { + if (hdd_nla_parse(tb, BPF_MAX, data, data_len, + wlan_hdd_bpf_offload_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -9189,9 +9188,8 @@ __wlan_hdd_cfg80211_acs_dfs_mode(struct wiphy *wiphy, if (0 != ret) return ret; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_ACS_DFS_MAX, - data, data_len, - wlan_hdd_set_acs_dfs_config_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_ACS_DFS_MAX, + data, data_len, wlan_hdd_set_acs_dfs_config_policy)) { hdd_err("invalid attr"); return -EINVAL; } @@ -9363,9 +9361,9 @@ __wlan_hdd_cfg80211_sta_roam_policy(struct wiphy *wiphy, ret = wlan_hdd_validate_context(hdd_ctx); if (0 != ret) return ret; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_STA_CONNECT_ROAM_POLICY_MAX, - data, data_len, - wlan_hdd_set_sta_roam_config_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_STA_CONNECT_ROAM_POLICY_MAX, + data, data_len, + wlan_hdd_set_sta_roam_config_policy)) { hdd_err("invalid attr"); return -EINVAL; } @@ -9548,9 +9546,8 @@ __wlan_hdd_cfg80211_sap_configuration_set(struct wiphy *wiphy, if (0 != ret) return -EINVAL; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_MAX, - data, data_len, - wlan_hdd_sap_config_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_MAX, + data, data_len, wlan_hdd_sap_config_policy)) { hdd_err("invalid attr"); return -EINVAL; } @@ -10024,7 +10021,8 @@ static int __wlan_hdd_cfg80211_setband(struct wiphy *wiphy, if (ret) return ret; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_MAX, data, data_len, policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_MAX, + data, data_len, policy)) { hdd_err(FL("Invalid ATTR")); return -EINVAL; } @@ -10203,7 +10201,7 @@ static int hdd_parse_vendor_acs_chan_config(struct hdd_vendor_chan_info struct nlattr *curr_attr; struct hdd_vendor_chan_info *channel_list; - if (nla_parse(tb, SET_CHAN_MAX, data, data_len, NULL)) { + if (hdd_nla_parse(tb, SET_CHAN_MAX, data, data_len, NULL)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -10228,11 +10226,9 @@ static int hdd_parse_vendor_acs_chan_config(struct hdd_vendor_chan_info i = 0; nla_for_each_nested(curr_attr, tb[SET_CHAN_CHAN_LIST], rem) { - if (nla_parse(tb2, - SET_CHAN_MAX, - nla_data(curr_attr), nla_len(curr_attr), - NULL)) { - hdd_err("nla_parse failed"); + if (hdd_nla_parse(tb2, SET_CHAN_MAX, nla_data(curr_attr), + nla_len(curr_attr), NULL)) { + hdd_err("hdd_nla_parse failed"); return -EINVAL; } if (tb2[SET_EXT_ACS_BAND]) { @@ -10542,8 +10538,8 @@ static int __wlan_hdd_set_sar_power_limits(struct wiphy *wiphy, if (wlan_hdd_validate_context(hdd_ctx)) return -EINVAL; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_MAX, - data, data_len, sar_limits_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_MAX, + data, data_len, sar_limits_policy)) { hdd_err("Invalid SAR attributes"); return -EINVAL; } @@ -10592,10 +10588,10 @@ static int __wlan_hdd_set_sar_power_limits(struct wiphy *wiphy, break; } - if (nla_parse(sar_spec, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_MAX, - nla_data(sar_spec_list), nla_len(sar_spec_list), - sar_limits_policy)) { - hdd_err("nla_parse failed for SAR Spec list"); + if (hdd_nla_parse(sar_spec, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_MAX, + nla_data(sar_spec_list), + nla_len(sar_spec_list), sar_limits_policy)) { + hdd_err("hdd_nla_parse failed for SAR Spec list"); goto fail; } sar_limit_cmd.sar_limit_row_list[i].validity_bitmap = 0; @@ -10745,8 +10741,8 @@ static int __wlan_hdd_cfg80211_set_fast_roaming(struct wiphy *wiphy, return -EINVAL; } - ret = nla_parse(tb, QCA_WLAN_VENDOR_ATTR_MAX, data, data_len, - qca_wlan_vendor_attr); + ret = hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_MAX, data, data_len, + qca_wlan_vendor_attr); if (ret) { hdd_err("Invalid ATTR"); return -EINVAL; @@ -10901,8 +10897,8 @@ __wlan_hdd_cfg80211_set_trace_level(struct wiphy *wiphy, return -EINVAL; } - if (nla_parse(tb1, QCA_WLAN_VENDOR_ATTR_SET_TRACE_LEVEL_MAX, data, - data_len, qca_wlan_vendor_set_trace_level_policy)) { + if (hdd_nla_parse(tb1, QCA_WLAN_VENDOR_ATTR_SET_TRACE_LEVEL_MAX, data, + data_len, qca_wlan_vendor_set_trace_level_policy)) { hdd_err("Invalid attr"); return -EINVAL; } @@ -10914,8 +10910,8 @@ __wlan_hdd_cfg80211_set_trace_level(struct wiphy *wiphy, nla_for_each_nested(apth, tb1[QCA_WLAN_VENDOR_ATTR_SET_TRACE_LEVEL_PARAM], rem) { - if (nla_parse(tb2, QCA_WLAN_VENDOR_ATTR_SET_TRACE_LEVEL_MAX, - nla_data(apth), nla_len(apth), NULL)) { + if (hdd_nla_parse(tb2, QCA_WLAN_VENDOR_ATTR_SET_TRACE_LEVEL_MAX, + nla_data(apth), nla_len(apth), NULL)) { hdd_err("Invalid attr"); return -EINVAL; } @@ -18612,7 +18608,7 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy, if (err) return err; - err = nla_parse(tb, WLAN_HDD_TM_ATTR_MAX, data, + err = hdd_nla_parse(tb, WLAN_HDD_TM_ATTR_MAX, data, len, wlan_hdd_tm_policy); if (err) { hdd_err("Testmode INV ATTR"); diff --git a/core/hdd/src/wlan_hdd_disa.c b/core/hdd/src/wlan_hdd_disa.c index a3141ff2894f..f233ffdd4940 100644 --- a/core/hdd/src/wlan_hdd_disa.c +++ b/core/hdd/src/wlan_hdd_disa.c @@ -177,7 +177,7 @@ static int hdd_fill_encrypt_decrypt_params(struct encrypt_decrypt_req_params uint8_t *tmp; uint8_t fc[2]; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_MAX, + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_MAX, data, data_len, encrypt_decrypt_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; diff --git a/core/hdd/src/wlan_hdd_ext_scan.c b/core/hdd/src/wlan_hdd_ext_scan.c index 350b70db28dc..7bd31a401b5e 100644 --- a/core/hdd/src/wlan_hdd_ext_scan.c +++ b/core/hdd/src/wlan_hdd_ext_scan.c @@ -1655,8 +1655,9 @@ static int __wlan_hdd_cfg80211_extscan_get_capabilities(struct wiphy *wiphy, hdd_err("extscan not supported"); return -ENOTSUPP; } - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, - data, data_len, wlan_hdd_extscan_config_policy)) { + if (hdd_nla_parse(tb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, + data, data_len, wlan_hdd_extscan_config_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -1793,8 +1794,8 @@ static int __wlan_hdd_cfg80211_extscan_get_cached_results(struct wiphy *wiphy, hdd_err("extscan not supported"); return -ENOTSUPP; } - if (nla_parse(tb, PARAM_MAX, data, data_len, - wlan_hdd_extscan_config_policy)) { + if (hdd_nla_parse(tb, PARAM_MAX, data, data_len, + wlan_hdd_extscan_config_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -1942,8 +1943,9 @@ __wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy, hdd_err("extscan not supported"); return -ENOTSUPP; } - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, - data, data_len, wlan_hdd_extscan_config_policy)) { + if (hdd_nla_parse(tb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, + data, data_len, wlan_hdd_extscan_config_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -2006,11 +2008,11 @@ __wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy, break; } - if (nla_parse - (tb2, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, - nla_data(apTh), nla_len(apTh), - wlan_hdd_extscan_config_policy)) { - hdd_err("nla_parse failed"); + if (hdd_nla_parse(tb2, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, + nla_data(apTh), nla_len(apTh), + wlan_hdd_extscan_config_policy)) { + hdd_err("hdd_nla_parse failed"); goto fail; } @@ -2159,8 +2161,9 @@ __wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy, if (0 != retval) return -EINVAL; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, - data, data_len, wlan_hdd_extscan_config_policy)) { + if (hdd_nla_parse(tb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, + data, data_len, wlan_hdd_extscan_config_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -2248,11 +2251,11 @@ __wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy, break; } - if (nla_parse - (tb2, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, - nla_data(apTh), nla_len(apTh), - wlan_hdd_extscan_config_policy)) { - hdd_err("nla_parse failed"); + if (hdd_nla_parse(tb2, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, + nla_data(apTh), nla_len(apTh), + wlan_hdd_extscan_config_policy)) { + hdd_err("hdd_nla_parse failed"); goto fail; } @@ -2460,8 +2463,9 @@ __wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy, hdd_err("extscan not supported"); return -ENOTSUPP; } - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, - data, data_len, wlan_hdd_extscan_config_policy)) { + if (hdd_nla_parse(tb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, + data, data_len, wlan_hdd_extscan_config_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -2706,11 +2710,11 @@ static int hdd_extscan_start_fill_bucket_channel_spec( break; } - if (nla_parse(bucket, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, - nla_data(buckets), nla_len(buckets), - wlan_hdd_extscan_config_policy)) { - hdd_err("nla_parse failed"); + if (hdd_nla_parse(bucket, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, + nla_data(buckets), nla_len(buckets), + wlan_hdd_extscan_config_policy)) { + hdd_err("hdd_nla_parse failed"); return -EINVAL; } @@ -2930,11 +2934,11 @@ static int hdd_extscan_start_fill_bucket_channel_spec( total_channels)) break; - if (nla_parse(channel, - QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, - nla_data(channels), nla_len(channels), - wlan_hdd_extscan_config_policy)) { - hdd_err("nla_parse failed"); + if (hdd_nla_parse(channel, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, + nla_data(channels), nla_len(channels), + wlan_hdd_extscan_config_policy)) { + hdd_err("hdd_nla_parse failed"); return -EINVAL; } @@ -3145,8 +3149,8 @@ __wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, hdd_err("extscan not supported"); return -ENOTSUPP; } - if (nla_parse(tb, PARAM_MAX, data, data_len, - wlan_hdd_extscan_config_policy)) { + if (hdd_nla_parse(tb, PARAM_MAX, data, data_len, + wlan_hdd_extscan_config_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -3359,8 +3363,8 @@ __wlan_hdd_cfg80211_extscan_stop(struct wiphy *wiphy, hdd_err("extscan not supported"); return -ENOTSUPP; } - if (nla_parse(tb, PARAM_MAX, data, data_len, - wlan_hdd_extscan_config_policy)) { + if (hdd_nla_parse(tb, PARAM_MAX, data, data_len, + wlan_hdd_extscan_config_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -3489,8 +3493,9 @@ __wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy, hdd_err("extscan not supported"); return -ENOTSUPP; } - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, - data, data_len, wlan_hdd_extscan_config_policy)) { + if (hdd_nla_parse(tb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, + data, data_len, wlan_hdd_extscan_config_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -3617,8 +3622,10 @@ __wlan_hdd_cfg80211_extscan_reset_significant_change(struct wiphy hdd_err("extscan not supported"); return -ENOTSUPP; } - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, - data, data_len, wlan_hdd_extscan_config_policy)) { + + if (hdd_nla_parse(tb, + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, + data, data_len, wlan_hdd_extscan_config_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -3742,10 +3749,10 @@ static int hdd_extscan_epno_fill_network_list( break; } - if (nla_parse(network, QCA_WLAN_VENDOR_ATTR_PNO_MAX, - nla_data(networks), nla_len(networks), - wlan_hdd_pno_config_policy)) { - hdd_err("nla_parse failed"); + if (hdd_nla_parse(network, QCA_WLAN_VENDOR_ATTR_PNO_MAX, + nla_data(networks), nla_len(networks), + wlan_hdd_pno_config_policy)) { + hdd_err("hdd_nla_parse failed"); return -EINVAL; } @@ -3757,7 +3764,7 @@ static int hdd_extscan_epno_fill_network_list( ssid_len = nla_len( network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID]); - /* nla_parse will detect overflow but not underflow */ + /* hdd_nla_parse will detect overflow but not underflow */ if (0 == ssid_len) { hdd_err("zero ssid length"); return -EINVAL; @@ -3837,14 +3844,14 @@ static int __wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy, hdd_err("extscan not supported"); return -ENOTSUPP; } + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { hdd_err("Command not allowed in FTM mode"); return -EPERM; } - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_PNO_MAX, - data, data_len, - wlan_hdd_pno_config_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_PNO_MAX, + data, data_len, wlan_hdd_pno_config_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -4046,11 +4053,10 @@ static int hdd_extscan_passpoint_fill_network_list( break; } - if (nla_parse(network, - QCA_WLAN_VENDOR_ATTR_PNO_MAX, - nla_data(networks), nla_len(networks), - wlan_hdd_pno_config_policy)) { - hdd_err("nla_parse failed"); + if (hdd_nla_parse(network, QCA_WLAN_VENDOR_ATTR_PNO_MAX, + nla_data(networks), nla_len(networks), + wlan_hdd_pno_config_policy)) { + hdd_err("hdd_nla_parse failed"); return -EINVAL; } @@ -4146,8 +4152,8 @@ static int __wlan_hdd_cfg80211_set_passpoint_list(struct wiphy *wiphy, return -EPERM; } - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_PNO_MAX, data, data_len, - wlan_hdd_pno_config_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_PNO_MAX, data, data_len, + wlan_hdd_pno_config_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -4267,8 +4273,8 @@ static int __wlan_hdd_cfg80211_reset_passpoint_list(struct wiphy *wiphy, return -EPERM; } - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_PNO_MAX, data, data_len, - wlan_hdd_extscan_config_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_PNO_MAX, data, data_len, + wlan_hdd_extscan_config_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c index b799625f0b55..87c5753b959f 100644 --- a/core/hdd/src/wlan_hdd_nan_datapath.c +++ b/core/hdd/src/wlan_hdd_nan_datapath.c @@ -2003,9 +2003,8 @@ static int __wlan_hdd_cfg80211_process_ndp_cmd(struct wiphy *wiphy, hdd_err("NAN datapath is not enabled"); return -EPERM; } - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX, - data, data_len, - qca_wlan_vendor_ndp_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX, + data, data_len, qca_wlan_vendor_ndp_policy)) { hdd_err("Invalid NDP vendor command attributes"); return -EINVAL; } diff --git a/core/hdd/src/wlan_hdd_ocb.c b/core/hdd/src/wlan_hdd_ocb.c index 39d903c62b22..e049cb960c73 100644 --- a/core/hdd/src/wlan_hdd_ocb.c +++ b/core/hdd/src/wlan_hdd_ocb.c @@ -800,9 +800,8 @@ static int __wlan_hdd_cfg80211_ocb_set_config(struct wiphy *wiphy, } /* Parse the netlink message */ - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_MAX, - data, - data_len, qca_wlan_vendor_ocb_set_config_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_MAX, data, + data_len, qca_wlan_vendor_ocb_set_config_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -1010,9 +1009,8 @@ static int __wlan_hdd_cfg80211_ocb_set_utc_time(struct wiphy *wiphy, } /* Parse the netlink message */ - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_MAX, - data, - data_len, qca_wlan_vendor_ocb_set_utc_time_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_MAX, data, + data_len, qca_wlan_vendor_ocb_set_utc_time_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -1128,10 +1126,9 @@ __wlan_hdd_cfg80211_ocb_start_timing_advert(struct wiphy *wiphy, timing_advert->vdev_id = adapter->sessionId; /* Parse the netlink message */ - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_MAX, - data, - data_len, - qca_wlan_vendor_ocb_start_timing_advert_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_MAX, + data, data_len, + qca_wlan_vendor_ocb_start_timing_advert_policy)) { hdd_err("Invalid ATTR"); goto fail; } @@ -1245,10 +1242,9 @@ __wlan_hdd_cfg80211_ocb_stop_timing_advert(struct wiphy *wiphy, timing_advert->vdev_id = adapter->sessionId; /* Parse the netlink message */ - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_MAX, - data, - data_len, - qca_wlan_vendor_ocb_stop_timing_advert_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_MAX, + data, data_len, + qca_wlan_vendor_ocb_stop_timing_advert_policy)) { hdd_err("Invalid ATTR"); goto fail; } @@ -1643,10 +1639,8 @@ static int __wlan_hdd_cfg80211_dcc_get_stats(struct wiphy *wiphy, } /* Parse the netlink message */ - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_MAX, - data, - data_len, - qca_wlan_vendor_dcc_get_stats)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_MAX, data, + data_len, qca_wlan_vendor_dcc_get_stats)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -1774,10 +1768,8 @@ static int __wlan_hdd_cfg80211_dcc_clear_stats(struct wiphy *wiphy, } /* Parse the netlink message */ - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_DCC_CLEAR_STATS_MAX, - data, - data_len, - qca_wlan_vendor_dcc_clear_stats)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_DCC_CLEAR_STATS_MAX, data, + data_len, qca_wlan_vendor_dcc_clear_stats)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -1905,10 +1897,8 @@ static int __wlan_hdd_cfg80211_dcc_update_ndl(struct wiphy *wiphy, } /* Parse the netlink message */ - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_MAX, - data, - data_len, - qca_wlan_vendor_dcc_update_ndl)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_MAX, data, + data_len, qca_wlan_vendor_dcc_update_ndl)) { hdd_err("Invalid ATTR"); return -EINVAL; } diff --git a/core/hdd/src/wlan_hdd_oemdata.c b/core/hdd/src/wlan_hdd_oemdata.c index 9d4a86a8725f..70b6f9337e0b 100644 --- a/core/hdd/src/wlan_hdd_oemdata.c +++ b/core/hdd/src/wlan_hdd_oemdata.c @@ -1025,7 +1025,7 @@ static void oem_cmd_handler(const void *data, int data_len, void *ctx, int pid) * audit note: it is ok to pass a NULL policy here since only * one attribute is parsed and it is explicitly validated */ - if (nla_parse(tb, CLD80211_ATTR_MAX, data, data_len, NULL)) { + if (hdd_nla_parse(tb, CLD80211_ATTR_MAX, data, data_len, NULL)) { hdd_err("Invalid ATTR"); return; } diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 20864d8b9844..926d9bc0d927 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -1147,8 +1147,8 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, if (0 != ret) return ret; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SCAN_MAX, data, - data_len, scan_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SCAN_MAX, data, data_len, + scan_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -1381,8 +1381,7 @@ static int __wlan_hdd_vendor_abort_scan( if (0 != ret) return ret; - wlan_vendor_abort_scan(hdd_ctx->hdd_pdev, data, - data_len); + wlan_vendor_abort_scan(hdd_ctx->hdd_pdev, data, data_len); return ret; } diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index e4e34beeef36..b78c2926abe5 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -1214,9 +1214,9 @@ __wlan_hdd_cfg80211_ll_stats_set(struct wiphy *wiphy, if (0 != status) return -EINVAL; - if (nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_MAX, - (struct nlattr *)data, - data_len, qca_wlan_vendor_ll_set_policy)) { + if (hdd_nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_MAX, + (struct nlattr *)data, data_len, + qca_wlan_vendor_ll_set_policy)) { hdd_err("maximum attribute not present"); return -EINVAL; } @@ -1421,9 +1421,9 @@ __wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy, return -EBUSY; } - if (nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_MAX, - (struct nlattr *)data, - data_len, qca_wlan_vendor_ll_get_policy)) { + if (hdd_nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_MAX, + (struct nlattr *)data, data_len, + qca_wlan_vendor_ll_get_policy)) { hdd_err("max attribute not present"); return -EINVAL; } @@ -1537,9 +1537,9 @@ __wlan_hdd_cfg80211_ll_stats_clear(struct wiphy *wiphy, return -EINVAL; } - if (nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_MAX, - (struct nlattr *)data, - data_len, qca_wlan_vendor_ll_clr_policy)) { + if (hdd_nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_MAX, + (struct nlattr *)data, data_len, + qca_wlan_vendor_ll_clr_policy)) { hdd_err("STATS_CLR_MAX is not present"); return -EINVAL; } @@ -2460,9 +2460,9 @@ static int __wlan_hdd_cfg80211_ll_stats_ext_set_param(struct wiphy *wiphy, if (0 != status) return -EPERM; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_MAX, - (struct nlattr *)data, data_len, - qca_wlan_vendor_ll_ext_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_MAX, + (struct nlattr *)data, data_len, + qca_wlan_vendor_ll_ext_policy)) { hdd_err("maximum attribute not present"); return -EPERM; } diff --git a/core/hdd/src/wlan_hdd_subnet_detect.c b/core/hdd/src/wlan_hdd_subnet_detect.c index 29a51dc333c2..4ce4f1dd9f05 100644 --- a/core/hdd/src/wlan_hdd_subnet_detect.c +++ b/core/hdd/src/wlan_hdd_subnet_detect.c @@ -111,8 +111,8 @@ static int __wlan_hdd_cfg80211_set_gateway_params(struct wiphy *wiphy, * ipv4 addr: 4 bytes * ipv6 addr: 16 bytes */ - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_GW_PARAM_CONFIG_MAX, - data, data_len, policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_GW_PARAM_CONFIG_MAX, data, + data_len, policy)) { hdd_err("Invalid ATTR list"); return -EINVAL; } diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 68c3048a2eab..c6a5417a9ae6 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -3359,8 +3359,8 @@ __wlan_hdd_cfg80211_exttdls_get_status(struct wiphy *wiphy, if (pHddCtx->config->fTDLSExternalControl == false) return -ENOTSUPP; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_MAX, - data, data_len, wlan_hdd_tdls_config_get_status_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_MAX, data, + data_len, wlan_hdd_tdls_config_get_status_policy)) { hdd_err("Invalid attribute"); return -EINVAL; } @@ -3449,9 +3449,8 @@ __wlan_hdd_cfg80211_configure_tdls_mode(struct wiphy *wiphy, if (NULL == adapter) return -EINVAL; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_MAX, - data, data_len, - wlan_hdd_tdls_mode_configuration_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_MAX, data, + data_len, wlan_hdd_tdls_mode_configuration_policy)) { hdd_err("Invalid attribute"); return -EINVAL; } @@ -3699,8 +3698,8 @@ __wlan_hdd_cfg80211_exttdls_enable(struct wiphy *wiphy, hdd_err("TDLS External Control is not enabled"); return -ENOTSUPP; } - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MAX, - data, data_len, wlan_hdd_tdls_config_enable_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MAX, data, + data_len, wlan_hdd_tdls_config_enable_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } @@ -3819,8 +3818,8 @@ static int __wlan_hdd_cfg80211_exttdls_disable(struct wiphy *wiphy, if (pHddCtx->config->fTDLSExternalControl == false) return -ENOTSUPP; - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_MAX, - data, data_len, wlan_hdd_tdls_config_disable_policy)) { + if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_MAX, data, + data_len, wlan_hdd_tdls_config_disable_policy)) { hdd_err("Invalid ATTR"); return -EINVAL; } diff --git a/core/hdd/src/wlan_hdd_tsf.c b/core/hdd/src/wlan_hdd_tsf.c index 303ad789436c..e19a0201232a 100644 --- a/core/hdd/src/wlan_hdd_tsf.c +++ b/core/hdd/src/wlan_hdd_tsf.c @@ -1128,8 +1128,8 @@ static int __wlan_hdd_cfg80211_handle_tsf_cmd(struct wiphy *wiphy, if (0 != status) return -EINVAL; - if (nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_TSF_MAX, data, - data_len, tsf_policy)) { + if (hdd_nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_TSF_MAX, data, + data_len, tsf_policy)) { hdd_err("Invalid TSF cmd"); return -EINVAL; }