Merge "qcacmn: prevent double free on buffer"

This commit is contained in:
Linux Build Service Account 2020-08-06 03:36:41 -07:00 • committed by Gerrit - the friendly Code Review server
commit ced27281e4
21 changed files with 936 additions and 19 deletions

View file

@ -4192,11 +4192,11 @@ dp_ppdu_stats_ind_handler(struct htt_soc *soc,
target_pdev_id = HTT_T2H_PPDU_STATS_PDEV_ID_GET(*msg_word);
pdev_id = dp_get_host_pdev_id_for_target_pdev_id(soc->dp_soc,
target_pdev_id);
dp_wdi_event_handler(WDI_EVENT_LITE_T2H, soc->dp_soc,
htt_t2h_msg, HTT_INVALID_PEER, WDI_NO_VAL,
pdev_id);
free_buf = dp_txrx_ppdu_stats_handler(soc->dp_soc, pdev_id,
htt_t2h_msg);
dp_wdi_event_handler(WDI_EVENT_LITE_T2H, soc->dp_soc,
htt_t2h_msg, HTT_INVALID_PEER, WDI_NO_VAL,
pdev_id);
return free_buf;
}
#else

View file

@ -0,0 +1,57 @@
/*
* Copyright (c) 2012-2015, 2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wlan_cfg80211_cm_req.h
*
* This header file maintains declarations of connect, disconnect, roam
* request apis.
*/
#ifndef __WLAN_CFG80211_CM_REQ_H
#define __WLAN_CFG80211_CM_REQ_H
#ifdef FEATURE_CM_ENABLE
#include "qdf_status.h"
#include "wlan_cm_public_struct.h"
#include <net/cfg80211.h>
#include "wlan_objmgr_vdev_obj.h"
/**
* wlan_osif_cfg80211_connect() - Connect start request
* @dev: net dev
* @vdev: vdev pointer
* @req: connect req
*
* Return: int
*/
int wlan_osif_cfg80211_connect(struct net_device *dev,
struct wlan_objmgr_vdev *vdev,
struct cfg80211_connect_params *req);
/**
* wlan_osif_cfg80211_disconnect() - Disconnect start request
* @dev: net dev
* @vdev: vdev pointer
* @reason: disconnect reason
*
* Return: int
*/
int wlan_osif_cfg80211_disconnect(struct net_device *dev,
struct wlan_objmgr_vdev *vdev,
uint16_t reason);
#endif
#endif /* __WLAN_CFG80211_CM_REQ_H */

View file

@ -0,0 +1,27 @@
/*
* Copyright (c) 2012-2015, 2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wlan_cfg80211_cm_rsp.h
*
* This header file maintains declarations of connect, disconnect, roam
* response apis.
*/
#ifndef __WLAN_CFG80211_CM_RSP_H
#define __WLAN_CFG80211_CM_RSP_H
#endif /* __WLAN_CFG80211_CM_RSP_H */

View file

@ -0,0 +1,27 @@
/*
* Copyright (c) 2012-2015, 2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wlan_cfg80211_cm_util.h
*
* This header file maintains declarations of connect, disconnect, roam
* common apis.
*/
#ifndef __WLAN_CFG80211_CM_UTIL_H
#define __WLAN_CFG80211_CM_UTIL_H
#endif /* __WLAN_CFG80211_CM_UTIL_H */

View file

@ -0,0 +1,21 @@
/*
* Copyright (c) 2012-2015, 2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wlan_cfg80211_cm_connect_rsp.c
*
* This file maintains definitaions of connect response apis.
*/

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2012-2015, 2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wlan_cfg80211_cm_disconnect_rsp.c
*
* This file maintains definitaions of disconnect response
* fucntions.
*/

View file

@ -0,0 +1,431 @@
/*
* Copyright (c) 2012-2015, 2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wlan_cfg80211_cm_req.c
*
* This file maintains definitaions of connect, disconnect, roam
* request apis.
*/
#include "wlan_cfg80211_cm_req.h"
#include "wlan_cm_ucfg_api.h"
#include "wlan_nl_to_crypto_params.h"
#include <wlan_cfg80211.h>
static void wlan_osif_free_wep_key_params(
struct wlan_cm_connect_req *connect_req)
{
if (connect_req->crypto.wep_keys.key) {
qdf_mem_free(connect_req->crypto.wep_keys.key);
connect_req->crypto.wep_keys.key = NULL;
}
if (connect_req->crypto.wep_keys.seq) {
qdf_mem_free(connect_req->crypto.wep_keys.seq);
connect_req->crypto.wep_keys.seq = NULL;
}
}
static QDF_STATUS wlan_osif_set_wep_key_params(
struct wlan_cm_connect_req *connect_req,
struct cfg80211_connect_params *req)
{
if (!req->key_len)
return QDF_STATUS_SUCCESS;
connect_req->crypto.wep_keys.key_len = req->key_len;
connect_req->crypto.wep_keys.key_idx = req->key_idx;
connect_req->crypto.wep_keys.key =
qdf_mem_malloc(connect_req->crypto.wep_keys.key_len);
if (!connect_req->crypto.wep_keys.key)
return QDF_STATUS_E_NOMEM;
qdf_mem_copy(connect_req->crypto.wep_keys.key, req->key,
connect_req->crypto.wep_keys.key_len);
if (req->crypto.wep_keys->seq_len) {
connect_req->crypto.wep_keys.seq_len =
req->crypto.wep_keys->seq_len;
connect_req->crypto.wep_keys.seq =
qdf_mem_malloc(connect_req->crypto.wep_keys.seq_len);
if (!connect_req->crypto.wep_keys.seq) {
qdf_mem_free(connect_req->crypto.wep_keys.key);
connect_req->crypto.wep_keys.key = NULL;
return QDF_STATUS_E_NOMEM;
}
qdf_mem_copy(connect_req->crypto.wep_keys.seq,
req->crypto.wep_keys->seq,
connect_req->crypto.wep_keys.seq_len);
}
return QDF_STATUS_SUCCESS;
}
static void wlan_osif_set_auth_type(struct wlan_cm_connect_req *connect_req,
struct cfg80211_connect_params *req)
{
wlan_crypto_auth_mode crypto_auth_type =
osif_nl_to_crypto_auth_type(req->auth_type);
/* For auto check wpa version to decide WPA or RSNA */
if (crypto_auth_type == WLAN_CRYPTO_AUTH_AUTO &&
req->crypto.wpa_versions) {
if (req->crypto.wpa_versions & NL80211_WPA_VERSION_1)
crypto_auth_type = WLAN_CRYPTO_AUTH_WPA;
else
crypto_auth_type = WLAN_CRYPTO_AUTH_RSNA;
} else if (!req->crypto.wpa_versions) {
crypto_auth_type = WLAN_CRYPTO_AUTH_OPEN;
}
QDF_SET_PARAM(connect_req->crypto.auth_type, crypto_auth_type);
}
static
QDF_STATUS wlan_osif_set_crypto_params(struct wlan_cm_connect_req *connect_req,
struct cfg80211_connect_params *req)
{
uint32_t i = 0;
QDF_STATUS status;
wlan_crypto_cipher_type cipher;
wlan_crypto_key_mgmt akm;
connect_req->crypto.wpa_versions = req->crypto.wpa_versions;
wlan_osif_set_auth_type(connect_req, req);
if (req->crypto.cipher_group)
cipher = osif_nl_to_crypto_cipher_type(cipher);
else
cipher = WLAN_CRYPTO_CIPHER_NONE;
QDF_SET_PARAM(connect_req->crypto.group_cipher, cipher);
/* Fill Pairwise ciphers */
if (req->crypto.n_ciphers_pairwise > NL80211_MAX_NR_CIPHER_SUITES)
connect_req->crypto.n_ciphers_pairwise =
NL80211_MAX_NR_CIPHER_SUITES;
else
connect_req->crypto.n_ciphers_pairwise =
req->crypto.n_ciphers_pairwise;
if (connect_req->crypto.n_ciphers_pairwise) {
for (i = 0; i < connect_req->crypto.n_ciphers_pairwise ; i++) {
cipher = osif_nl_to_crypto_cipher_type(
req->crypto.ciphers_pairwise[i]);
QDF_SET_PARAM(connect_req->crypto.ciphers_pairwise,
cipher);
}
} else {
connect_req->crypto.n_ciphers_pairwise = 1;
QDF_SET_PARAM(connect_req->crypto.ciphers_pairwise,
WLAN_CRYPTO_CIPHER_NONE);
}
/* Fill AKM suites */
if (req->crypto.n_akm_suites > NL80211_MAX_NR_AKM_SUITES)
connect_req->crypto.n_akm_suites = NL80211_MAX_NR_AKM_SUITES;
else
connect_req->crypto.n_akm_suites = req->crypto.n_akm_suites;
if (connect_req->crypto.n_akm_suites) {
for (i = 0; i < connect_req->crypto.n_akm_suites; i++) {
akm = osif_nl_to_crypto_akm_type(
req->crypto.akm_suites[i]);
QDF_SET_PARAM(connect_req->crypto.akm_suites, akm);
}
} else {
connect_req->crypto.n_akm_suites = 1;
QDF_SET_PARAM(connect_req->crypto.akm_suites,
WLAN_CRYPTO_KEY_MGMT_NONE);
}
/* Fill WEP Key information */
status = wlan_osif_set_wep_key_params(connect_req, req);
if (QDF_IS_STATUS_ERROR(status))
osif_err("set wep key params failed");
return status;
}
#ifdef WLAN_FEATURE_FILS_SK
static bool wlan_osif_is_fils_auth_type(enum nl80211_auth_type auth_type)
{
switch (auth_type) {
case NL80211_AUTHTYPE_FILS_SK:
case NL80211_AUTHTYPE_FILS_SK_PFS:
case NL80211_AUTHTYPE_FILS_PK:
return true;
default:
return false;
}
}
static bool wlan_osif_is_akm_suite_fils(uint32_t key_mgmt)
{
switch (key_mgmt) {
case WLAN_AKM_SUITE_FILS_SHA256:
case WLAN_AKM_SUITE_FILS_SHA384:
case WLAN_AKM_SUITE_FT_FILS_SHA256:
case WLAN_AKM_SUITE_FT_FILS_SHA384:
return true;
default:
return false;
}
}
static bool wlan_osif_is_conn_type_fils(struct cfg80211_connect_params *req)
{
int num_akm_suites = req->crypto.n_akm_suites;
uint32_t key_mgmt = req->crypto.akm_suites[0];
bool is_fils_auth_type =
wlan_osif_is_fils_auth_type(req->auth_type);
if (num_akm_suites <= 0)
return false;
/*
* Auth type will be either be OPEN or FILS type for a FILS connection
*/
if (!is_fils_auth_type &&
req->auth_type != NL80211_AUTHTYPE_OPEN_SYSTEM)
return false;
if (!wlan_osif_is_akm_suite_fils(key_mgmt))
return false;
osif_debug("Fils Auth %d AKM %d", req->auth_type, key_mgmt);
return true;
}
static QDF_STATUS wlan_osif_set_fils_info(
struct wlan_cm_connect_req *connect_req,
struct cfg80211_connect_params *req)
{
connect_req->fils_info.is_fils_connection =
wlan_osif_is_conn_type_fils(req);
connect_req->fils_info.username_len = req->fils_erp_username_len;
if (connect_req->fils_info.username_len >
WLAN_CM_FILS_MAX_KEYNAME_NAI_LENGTH) {
osif_err("Invalid fils username len");
return QDF_STATUS_E_INVAL;
}
qdf_mem_zero(connect_req->fils_info.username,
WLAN_CM_FILS_MAX_KEYNAME_NAI_LENGTH);
qdf_mem_copy(connect_req->fils_info.username, req->fils_erp_username,
connect_req->fils_info.username_len);
connect_req->fils_info.realm_len = req->fils_erp_username_len;
if (connect_req->fils_info.realm_len > WLAN_CM_FILS_MAX_REALM_LEN) {
osif_err("Invalid fils realm len");
return QDF_STATUS_E_INVAL;
}
qdf_mem_zero(connect_req->fils_info.realm, WLAN_CM_FILS_MAX_REALM_LEN);
qdf_mem_copy(connect_req->fils_info.realm, req->fils_erp_realm,
connect_req->fils_info.realm_len);
connect_req->fils_info.next_seq_num = req->fils_erp_next_seq_num;
connect_req->fils_info.rrk_len = req->fils_erp_rrk_len;
if (connect_req->fils_info.rrk_len > WLAN_CM_FILS_MAX_RRK_LENGTH) {
osif_err("Invalid fils rrk len");
return QDF_STATUS_E_INVAL;
}
qdf_mem_zero(connect_req->fils_info.rrk, WLAN_CM_FILS_MAX_RRK_LENGTH);
qdf_mem_copy(connect_req->fils_info.rrk, req->fils_erp_rrk,
connect_req->fils_info.rrk_len);
return QDF_STATUS_SUCCESS;
}
#else
static inline QDF_STATUS wlan_osif_set_fils_info(
struct wlan_cm_connect_req *connect_req,
struct cfg80211_connect_params *req)
{
return QDF_STATUS_SUCCESS;
}
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
static inline void wlan_osif_set_prev_bssid(
struct wlan_cm_connect_req *connect_req,
struct cfg80211_connect_params *req)
{
qdf_mem_copy(connect_req->prev_bssid.bytes, req->prev_bssid,
QDF_MAC_ADDR_SIZE);
}
static inline void osif_dump_prev_bssid(struct cfg80211_connect_params *req)
{
if (req->prev_bssid)
osif_nofl_debug("prev BSSID %pM", req->prev_bssid);
}
#else
static inline void wlan_osif_set_prev_bssid(
struct wlan_cm_connect_req *connect_req,
struct cfg80211_connect_params *req);
static inline void osif_dump_prev_bssid(struct cfg80211_connect_params *req)
{
}
#endif
static inline void osif_dump_connect_req(struct net_device *dev,
uint8_t vdev_id,
struct cfg80211_connect_params *req)
{
uint32_t i;
osif_nofl_debug("connect req for %s(vdevid-%d) freq %d SSID %.*s auth type %d WPA ver %d n_akm %d n_cipher %d grp_cipher %x mfp %d freq hint %d",
dev->name, vdev_id,
req->channel ? req->channel->center_freq : 0,
(int)req->ssid_len, req->ssid, req->auth_type,
req->crypto.wpa_versions,
req->crypto.n_akm_suites,
req->crypto.n_ciphers_pairwise,
req->crypto.cipher_group, req->mfp,
req->channel_hint ? req->channel_hint->center_freq : 0);
if (req->bssid)
osif_nofl_debug("BSSID %pM", req->bssid);
if (req->bssid_hint)
osif_nofl_debug("BSSID hint %pM", req->bssid_hint);
osif_dump_prev_bssid(req);
for (i = 0; i < req->crypto.n_akm_suites; i++)
osif_nofl_debug("akm[%d] = %x", i, req->crypto.akm_suites[i]);
for (i = 0; i < req->crypto.n_ciphers_pairwise; i++)
osif_nofl_debug("cipher_pairwise[%d] = %x", i,
req->crypto.ciphers_pairwise[i]);
}
int wlan_osif_cfg80211_connect(struct net_device *dev,
struct wlan_objmgr_vdev *vdev,
struct cfg80211_connect_params *req)
{
struct wlan_cm_connect_req *connect_req;
const u8 *bssid_hint = req->bssid_hint;
uint8_t vdev_id = vdev->vdev_objmgr.vdev_id;
QDF_STATUS status;
osif_dump_connect_req(dev, vdev_id, req);
connect_req = qdf_mem_malloc(sizeof(*connect_req));
if (!connect_req)
return -ENOMEM;
connect_req->vdev_id = vdev_id;
connect_req->source = CM_OSIF_CONENCT_REQ;
if (req->bssid)
qdf_mem_copy(connect_req->bssid.bytes, req->bssid,
QDF_MAC_ADDR_SIZE);
else if (bssid_hint)
qdf_mem_copy(connect_req->bssid.bytes, req->bssid_hint,
QDF_MAC_ADDR_SIZE);
wlan_osif_set_prev_bssid(connect_req, req);
connect_req->ssid.length = req->ssid_len;
if (connect_req->ssid.length > WLAN_SSID_MAX_LEN) {
osif_err("Invalid ssid len %d", req->ssid_len);
return -EINVAL;
}
qdf_mem_copy(connect_req->ssid.ssid, req->ssid,
connect_req->ssid.length);
qdf_mem_copy(connect_req->bssid_hint.bytes, bssid_hint,
QDF_MAC_ADDR_SIZE);
if (req->channel)
connect_req->chan_freq = req->channel->center_freq;
else
connect_req->chan_freq = 0;
status = wlan_osif_set_crypto_params(connect_req, req);
if (QDF_IS_STATUS_ERROR(status))
goto connect_start_fail;
connect_req->ht_caps = req->ht_capa.cap_info;
connect_req->ht_caps_mask = req->ht_capa_mask.cap_info;
connect_req->vht_caps = req->vht_capa.vht_cap_info;
connect_req->vht_caps_mask = req->vht_capa_mask.vht_cap_info;
/* Copy complete ie */
connect_req->assoc_ie.len = req->ie_len;
connect_req->assoc_ie.ptr = qdf_mem_malloc(req->ie_len);
if (!connect_req->assoc_ie.ptr) {
connect_req->assoc_ie.len = 0;
status = QDF_STATUS_E_NOMEM;
goto connect_start_fail;
}
qdf_mem_copy(connect_req->assoc_ie.ptr, req->ie,
connect_req->assoc_ie.len);
status = wlan_osif_set_fils_info(connect_req, req);
if (QDF_IS_STATUS_ERROR(status))
goto connect_start_fail;
status = ucfg_wlan_cm_start_connect(vdev, connect_req);
if (QDF_IS_STATUS_ERROR(status))
goto connect_start_fail;
return qdf_status_to_os_return(status);
connect_start_fail:
if (connect_req->assoc_ie.ptr) {
qdf_mem_free(connect_req->assoc_ie.ptr);
connect_req->assoc_ie.ptr = NULL;
}
wlan_osif_free_wep_key_params(connect_req);
qdf_mem_free(connect_req);
return qdf_status_to_os_return(status);
}
int wlan_osif_cfg80211_disconnect(struct net_device *dev,
struct wlan_objmgr_vdev *vdev,
uint16_t reason)
{
struct wlan_cm_disconnect_req *req;
uint8_t vdev_id = vdev->vdev_objmgr.vdev_id;
QDF_STATUS status;
req = qdf_mem_malloc(sizeof(*req));
if (!req)
return -ENOMEM;
/* TODO print reason in string */
osif_info("%s(vdevid-%d): Received Disconnect reason:%d",
dev->name, vdev_id, reason);
req->vdev_id = vdev_id;
req->source = CM_OSIF_DISCONNECT;
req->reason_code = reason;
status = ucfg_wlan_cm_start_disconnect(vdev, req);
if (QDF_IS_STATUS_ERROR(status))
qdf_mem_free(req);
return qdf_status_to_os_return(status);
}

View file

@ -0,0 +1,21 @@
/*
* Copyright (c) 2012-2015, 2020, The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wlan_cfg80211_cm_roam_rsp.c
*
* This file maintains definitaions of roam response apis.
*/

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2012-2015, 2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wlan_cfg80211_cm_util.c
*
* This file maintains definitaions of connect, disconnect, roam
* common apis.
*/

View file

@ -1620,6 +1620,12 @@ static QDF_STATUS target_if_get_dbr_data(struct wlan_objmgr_pdev *pdev,
*cookie = WMI_HOST_DBR_DATA_ADDR_HI_HOST_DATA_GET(
dbr_rsp->dbr_entries[idx].paddr_hi);
dbr_data->vaddr = target_if_dbr_vaddr_lookup(mod_param, paddr, *cookie);
if (!dbr_data->vaddr) {
direct_buf_rx_err("dbr vaddr lookup failed, vaddr NULL");
return QDF_STATUS_E_FAILURE;
}
dbr_data->cookie = *cookie;
dbr_data->paddr = paddr;
direct_buf_rx_debug("Cookie = %d Vaddr look up = %pK",

View file

@ -15,5 +15,5 @@
*/
/**
* DOC: Implements general apis of connection manager
* DOC: Implements general util apis of connection manager
*/

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2012-2015, 2020, The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: This file contains connection manager related CFG/INI Items.
*/
#ifndef __CFG_MLME_CM_H
#define __CFG_MLME_CM_H
#endif /* __CFG_MLME_CM_H */

View file

@ -0,0 +1,51 @@
/*
* Copyright (c) 2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wlan_cm_api.h
*
* This file maintains declarations of public apis
*/
#ifndef __WLAN_CM_API_H
#define __WLAN_CM_API_H
#ifdef FEATURE_CM_ENABLE
#include "wlan_cm_public_struct.h"
/**
* wlan_cm_start_connect() - connect start request
* @vdev: vdev pointer
* @req: connect req
*
* Return: QDF_STATUS
*/
QDF_STATUS wlan_cm_start_connect(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_connect_req *req);
/**
* wlan_cm_start_disconnect() - disconnect start request
* @vdev: vdev pointer
* @req: disconnect req
*
* Return: QDF_STATUS
*/
QDF_STATUS wlan_cm_start_disconnect(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_disconnect_req *req);
#endif
#endif /* __WLAN_CM_UCFG_API_H */

View file

@ -25,6 +25,7 @@
#ifdef FEATURE_CM_ENABLE
#include <wlan_scan_public_structs.h>
#include "wlan_crypto_global_def.h"
typedef uint32_t wlan_cm_id;
@ -44,35 +45,32 @@ struct wlan_cm_wep_key_params {
uint8_t key_idx;
};
#define WLAN_CM_MAX_NR_CIPHER_SUITES 5
#define WLAN_CM_MAX_NR_AKM_SUITES 2
/**
* struct wlan_cm_connect_crypto_info - Crypto settings
* @wpa_versions: indicates which, if any, WPA versions are enabled
* (from enum nl80211_wpa_versions)
* @auth_type: Auth mode type
* @group_cipher: group key cipher suite (or 0 if unset)
* @auth_type: Auth mode type bitmask
* @group_cipher: group key cipher suite bitmask
* @n_ciphers_pairwise: number of AP supported unicast ciphers
* @ciphers_pairwise: unicast key cipher suites
* @ciphers_pairwise: unicast key cipher suites bitmask
* @n_akm_suites: number of AKM suites
* @akm_suites: AKM suites
* @akm_suites: AKM suites bitmask
* @wep_keys: static WEP keys, if not NULL points to an array of
* MAX_WEP_KEYS WEP keys
* @pmf_cap: Pmf capability
* @mgmt_ciphers: mgmt cipher
* @mgmt_ciphers: mgmt cipher bitmask
*/
struct wlan_cm_connect_crypto_info {
uint32_t wpa_versions;
wlan_crypto_auth_mode auth_type;
wlan_crypto_cipher_type group_cipher;
uint32_t auth_type;
uint32_t group_cipher;
uint32_t n_ciphers_pairwise;
wlan_crypto_cipher_type ciphers_pairwise[WLAN_CM_MAX_NR_CIPHER_SUITES];
uint32_t ciphers_pairwise;
uint32_t n_akm_suites;
wlan_crypto_key_mgmt akm_suites[WLAN_CM_MAX_NR_AKM_SUITES];
uint32_t akm_suites;
struct wlan_cm_wep_key_params wep_keys;
enum wlan_pmf_cap pmf_cap;
wlan_crypto_cipher_type mgmt_ciphers;
uint32_t mgmt_ciphers;
};
#ifdef WLAN_FEATURE_FILS_SK

View file

@ -0,0 +1,61 @@
/*
* Copyright (c) 2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wlan_cm_ucfg_api.h
*
* This file maintains declarations of public ucfg apis
*/
#ifndef __WLAN_CM_UCFG_API_H
#define __WLAN_CM_UCFG_API_H
#ifdef FEATURE_CM_ENABLE
#include <wlan_cm_api.h>
/**
* ucfg_wlan_cm_start_connect() - connect start request
* @vdev: vdev pointer
* @req: connect req
*
* Return: QDF_STATUS
*/
static inline
QDF_STATUS ucfg_wlan_cm_start_connect(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_connect_req *req)
{
return wlan_cm_start_connect(vdev, req);
}
/**
* ucfg_wlan_cm_start_disconnect() - disconnect start request
* @vdev: vdev pointer
* @req: disconnect req
*
* Return: QDF_STATUS
*/
static inline
QDF_STATUS ucfg_wlan_cm_start_disconnect(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_disconnect_req *req)
{
return wlan_cm_start_disconnect(vdev, req);
}
#endif
#endif /* __WLAN_CM_UCFG_API_H */

View file

@ -0,0 +1,36 @@
/*
* Copyright (c) 2012-2015, 2020, The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wlan_cm_api.c
*
* This file maintains definitaions public apis.
*/
#include <wlan_cm_api.h>
QDF_STATUS wlan_cm_start_connect(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_connect_req *req)
{
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_cm_start_disconnect(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_disconnect_req *req)
{
return QDF_STATUS_SUCCESS;
}

View file

@ -0,0 +1,21 @@
/*
* Copyright (c) 2012-2015, 2020, The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wlan_cm_ucfg_api.c
*
* This file maintains definitaions public ucfg apis.
*/

View file

@ -107,6 +107,14 @@
#define WLAN_CFG_INT_TIMER_THRESHOLD_OTHER 8
#endif
#define WLAN_CFG_RX_PENDING_HL_THRESHOLD 0x60000
#define WLAN_CFG_RX_PENDING_HL_THRESHOLD_MIN 0
#define WLAN_CFG_RX_PENDING_HL_THRESHOLD_MAX 0x80000
#define WLAN_CFG_RX_PENDING_LO_THRESHOLD 0x60000
#define WLAN_CFG_RX_PENDING_LO_THRESHOLD_MIN 100
#define WLAN_CFG_RX_PENDING_LO_THRESHOLD_MAX 0x80000
#define WLAN_CFG_INT_TIMER_THRESHOLD_WBM_RELEASE_RING 256
#define WLAN_CFG_INT_TIMER_THRESHOLD_REO_RING 512
@ -523,6 +531,49 @@
WLAN_CFG_PER_PDEV_LMAC_RING_MAX, \
WLAN_CFG_PER_PDEV_LMAC_RING, \
CFG_VALUE_OR_DEFAULT, "DP pdev LMAC ring")
/*
* <ini>
* dp_rx_pending_hl_threshold - High threshold of frame number to start
* frame dropping scheme
* @Min: 0
* @Max: 524288
* @Default: 393216
*
* This ini entry is used to set a high limit threshold to start frame
* dropping scheme
*
* Usage: External
*
* </ini>
*/
#define CFG_DP_RX_PENDING_HL_THRESHOLD \
CFG_INI_UINT("dp_rx_pending_hl_threshold", \
WLAN_CFG_RX_PENDING_HL_THRESHOLD_MIN, \
WLAN_CFG_RX_PENDING_HL_THRESHOLD_MAX, \
WLAN_CFG_RX_PENDING_HL_THRESHOLD, \
CFG_VALUE_OR_DEFAULT, "DP rx pending hl threshold")
/*
* <ini>
* dp_rx_pending_lo_threshold - Low threshold of frame number to stop
* frame dropping scheme
* @Min: 100
* @Max: 524288
* @Default: 393216
*
* This ini entry is used to set a low limit threshold to stop frame
* dropping scheme
*
* Usage: External
*
* </ini>
*/
#define CFG_DP_RX_PENDING_LO_THRESHOLD \
CFG_INI_UINT("dp_rx_pending_lo_threshold", \
WLAN_CFG_RX_PENDING_LO_THRESHOLD_MIN, \
WLAN_CFG_RX_PENDING_LO_THRESHOLD_MAX, \
WLAN_CFG_RX_PENDING_LO_THRESHOLD, \
CFG_VALUE_OR_DEFAULT, "DP rx pending lo threshold")
#define CFG_DP_BASE_HW_MAC_ID \
CFG_INI_UINT("dp_base_hw_macid", \
@ -973,6 +1024,8 @@
CFG(CFG_DP_FULL_MON_MODE) \
CFG(CFG_DP_REO_RINGS_MAP) \
CFG(CFG_DP_PEER_EXT_STATS) \
CFG(CFG_DP_RX_BUFF_POOL_ENABLE)
CFG(CFG_DP_RX_BUFF_POOL_ENABLE) \
CFG(CFG_DP_RX_PENDING_HL_THRESHOLD) \
CFG(CFG_DP_RX_PENDING_LO_THRESHOLD)
#endif /* _CFG_DP_H_ */

View file

@ -612,6 +612,11 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
wlan_cfg_ctx->pext_stats_enabled = cfg_get(psoc, CFG_DP_PEER_EXT_STATS);
wlan_cfg_ctx->is_rx_buff_pool_enabled =
cfg_get(psoc, CFG_DP_RX_BUFF_POOL_ENABLE);
wlan_cfg_ctx->rx_pending_high_threshold =
cfg_get(psoc, CFG_DP_RX_PENDING_HL_THRESHOLD);
wlan_cfg_ctx->rx_pending_low_threshold =
cfg_get(psoc, CFG_DP_RX_PENDING_LO_THRESHOLD);
return wlan_cfg_ctx;
}
@ -882,6 +887,18 @@ int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
return cfg->per_pdev_tx_ring;
}
uint32_t
wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
{
return cfg->rx_pending_high_threshold;
}
uint32_t
wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
{
return cfg->rx_pending_low_threshold;
}
int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
{
return cfg->per_pdev_lmac_ring;

View file

@ -187,6 +187,8 @@ struct wlan_srng_cfg {
* @pext_stats_enabled: Flag to enable and disabled peer extended stats
* @is_rx_buff_pool_enabled: flag to enable/disable emergency RX buffer
* pool support
* @rx_pending_high_threshold: threshold of starting pkt drop
* @rx_pending_low_threshold: threshold of stopping pkt drop
*/
struct wlan_cfg_dp_soc_ctxt {
int num_int_ctxts;
@ -292,6 +294,8 @@ struct wlan_cfg_dp_soc_ctxt {
uint32_t reo_rings_mapping;
bool pext_stats_enabled;
bool is_rx_buff_pool_enabled;
uint32_t rx_pending_high_threshold;
uint32_t rx_pending_low_threshold;
};
/**
@ -867,6 +871,24 @@ wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
int wlan_cfg_get_rx_dma_buf_ring_size(
struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
/*
* wlan_cfg_rx_pending_hl_threshold() - Return high threshold of rx pending
* @wlan_cfg_pdev_ctx
*
* Return: rx_pending_high_threshold
*/
uint32_t
wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg);
/*
* wlan_cfg_rx_pending_lo_threshold() - Return low threshold of rx pending
* @wlan_cfg_pdev_ctx
*
* Return: rx_pending_low_threshold
*/
uint32_t
wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg);
/*
* wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
* per pdev

View file

@ -2312,7 +2312,7 @@ QDF_STATUS wmi_unified_cmd_send_over_qmi(struct wmi_unified *wmi_handle,
qdf_mem_zero(qdf_nbuf_data(buf), sizeof(WMI_CMD_HDR));
WMI_SET_FIELD(qdf_nbuf_data(buf), WMI_CMD_HDR, COMMANDID, cmd_id);
wmi_debug("Sending WMI_CMD_ID: %d over qmi", cmd_id);
wmi_debug("Sending WMI_CMD_ID: 0x%x over qmi", cmd_id);
status = qdf_wmi_send_recv_qmi(qdf_nbuf_data(buf),
buflen + sizeof(WMI_CMD_HDR),
wmi_handle,