qcacld-3.0: Move cds_get_bin.c to concurrency management files

cds_get_bin.h and cds_get_bin.c were derived from qcacld-2.0
vos_get_bin.h and vos_get_bin.c.  These files got their names
since at one time they housed the wrappers used to retrieve
binary files nv.bin, cfg.dat, and firmware.  But over time the
functionality to actually retrieve binary files (get_bin) has
been removed, and almost all that is left is concurrency
management functions.  So, moving the .[ch] functionality to
the right files.

CRs-Fixed: 932777
Change-Id: I4a26c304cc6b6224d0839c365e4006fd32270961
This commit is contained in:
Chandrasekaran, Manishekar 2015-11-05 10:42:48 +05:30 • committed by Prakash Dhavali
commit 681d137dab
26 changed files with 186 additions and 253 deletions

1
Kbuild
View file

@ -604,7 +604,6 @@ CDS_INC := -I$(WLAN_ROOT)/$(CDS_INC_DIR) \
-I$(WLAN_ROOT)/$(CDS_SRC_DIR)
CDS_OBJS := $(CDS_SRC_DIR)/cds_api.o \
$(CDS_SRC_DIR)/cds_get_bin.o \
$(CDS_SRC_DIR)/cds_reg_service.o \
$(CDS_SRC_DIR)/cds_mq.o \
$(CDS_SRC_DIR)/cds_packet.o \

View file

@ -42,6 +42,7 @@
#include "i_bmi.h"
#include "qwlan_version.h"
#include "cds_concurrency.h"
#ifdef FEATURE_SECURE_FIRMWARE
static struct hash_fw fw_hash;

View file

@ -38,7 +38,6 @@
#include <cdf_status.h>
#include <cdf_memory.h>
#include <cdf_list.h>
#include <cds_get_bin.h>
#include <cdf_trace.h>
#include <cdf_event.h>
#include <cdf_lock.h>

View file

@ -770,4 +770,20 @@ bool cds_map_concurrency_mode(hdd_context_t *hdd_ctx,
tCDF_CON_MODE *old_mode, enum cds_con_mode *new_mode);
CDF_STATUS cds_get_channel_from_scan_result(hdd_adapter_t *adapter,
tCsrRoamProfile *roam_profile, uint8_t *channel);
tCDF_CON_MODE cds_get_conparam(void);
bool cds_concurrent_open_sessions_running(void);
bool cds_max_concurrent_connections_reached(void);
void cds_clear_concurrent_session_count(void);
bool cds_is_multiple_active_sta_sessions(void);
bool cds_is_sta_active_connection_exists(void);
#ifdef WLAN_FEATURE_MBSSID
bool cds_concurrent_beaconing_sessions_running(void);
#else
static inline bool cds_concurrent_beaconing_sessions_running(void)
{
return true;
}
#endif
#endif /* __CDS_CONCURRENCY_H */

View file

@ -38,7 +38,6 @@
#include <cdf_status.h>
#include <cdf_memory.h>
#include <cdf_list.h>
#include <cds_get_bin.h>
#include <cdf_trace.h>
#include <cdf_event.h>
#include <cdf_lock.h>

View file

@ -1,75 +0,0 @@
/*
* Copyright (c) 2014 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
*
* 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.
*/
/*
* This file was originally distributed by Qualcomm Atheros, Inc.
* under proprietary terms before Copyright ownership was assigned
* to the Linux Foundation.
*/
#if !defined( __CDS_GETBIN_H )
#define __CDS_GETBIN_H
/**=========================================================================
\file cds_getBin.h
\brief Connectivity driver services (CDS) binary APIs
Binary retrieval definitions and APIs.
These APIs allow components to retrieve binary contents (firmware,
configuration data, etc.) from a storage medium on the platform.
========================================================================*/
/*--------------------------------------------------------------------------
Include Files
------------------------------------------------------------------------*/
#include <cdf_types.h>
#include <cdf_status.h>
/*--------------------------------------------------------------------------
Preprocessor definitions and constants
------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------
Type declarations
------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
Function declarations and documenation
------------------------------------------------------------------------*/
/**----------------------------------------------------------------------------
\brief cds_get_conparam()- function to read the insmod parameters
-----------------------------------------------------------------------------*/
tCDF_CON_MODE cds_get_conparam(void);
bool cds_concurrent_open_sessions_running(void);
bool cds_max_concurrent_connections_reached(void);
void cds_clear_concurrent_session_count(void);
bool cds_is_multiple_active_sta_sessions(void);
bool cds_is_sta_active_connection_exists(void);
#ifdef WLAN_FEATURE_MBSSID
bool cds_concurrent_beaconing_sessions_running(void);
#endif
#endif /* !defined __CDS_GETBIN_H */

View file

@ -7234,3 +7234,155 @@ enum cds_con_mode cds_convert_device_mode_to_hdd_type(
}
return mode;
}
/**
* cds_get_conparam() - Get the connection mode parameters
*
* Return the connection mode parameter set by insmod or set during statically
* linked driver
*
* Return: tCDF_CON_MODE
*/
tCDF_CON_MODE cds_get_conparam(void)
{
tCDF_CON_MODE con_mode;
con_mode = hdd_get_conparam();
return con_mode;
}
/**
* cds_concurrent_open_sessions_running() - Checks for concurrent open session
*
* Checks if more than one open session is running for all the allowed modes
* in the driver
*
* Return: True if more than one open session exists, False otherwise
*/
bool cds_concurrent_open_sessions_running(void)
{
uint8_t i = 0;
uint8_t j = 0;
hdd_context_t *pHddCtx;
pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
if (NULL != pHddCtx) {
for (i = 0; i < CDF_MAX_NO_OF_MODE; i++)
j += pHddCtx->no_of_open_sessions[i];
}
return j > 1;
}
#ifdef WLAN_FEATURE_MBSSID
/**
* cds_concurrent_beaconing_sessions_running() - Checks for concurrent beaconing
* entities
*
* Checks if multiple beaconing sessions are running i.e., if SAP or GO or IBSS
* are beaconing together
*
* Return: True if multiple entities are beaconing together, False otherwise
*/
bool cds_concurrent_beaconing_sessions_running(void)
{
uint8_t i = 0;
hdd_context_t *pHddCtx;
pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
if (NULL != pHddCtx) {
i = pHddCtx->no_of_open_sessions[CDF_SAP_MODE] +
pHddCtx->no_of_open_sessions[CDF_P2P_GO_MODE] +
pHddCtx->no_of_open_sessions[CDF_IBSS_MODE];
}
return i > 1;
}
#endif
/**
* cds_max_concurrent_connections_reached() - Check if max conccurrency is
* reached
*
* Checks for presence of concurrency where more than one connection exists
*
* Return: True if the max concurrency is reached, False otherwise
*
* Example:
* STA + STA (wlan0 and wlan1 are connected) - returns true
* STA + STA (wlan0 connected and wlan1 disconnected) - returns false
* DUT with P2P-GO + P2P-CLIENT connection) - returns true
*
*/
bool cds_max_concurrent_connections_reached(void)
{
uint8_t i = 0, j = 0;
hdd_context_t *pHddCtx;
pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
if (NULL != pHddCtx) {
for (i = 0; i < CDF_MAX_NO_OF_MODE; i++)
j += pHddCtx->no_of_active_sessions[i];
return j >
(pHddCtx->config->
gMaxConcurrentActiveSessions - 1);
}
return false;
}
/**
* cds_clear_concurrent_session_count() - Clear active session count
*
* Clears the active session count for all modes
*
* Return: None
*/
void cds_clear_concurrent_session_count(void)
{
uint8_t i = 0;
hdd_context_t *pHddCtx;
pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
if (NULL != pHddCtx) {
for (i = 0; i < CDF_MAX_NO_OF_MODE; i++)
pHddCtx->no_of_active_sessions[i] = 0;
}
}
/**
* cds_is_multiple_active_sta_sessions() - Check for multiple STA connections
*
* Checks if multiple active STA connection are in the driver
*
* Return: True if multiple STA sessions are present, False otherwise
*
*/
bool cds_is_multiple_active_sta_sessions(void)
{
hdd_context_t *pHddCtx;
uint8_t j = 0;
pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
if (NULL != pHddCtx)
j = pHddCtx->no_of_active_sessions[CDF_STA_MODE];
return j > 1;
}
/**
* cds_is_sta_active_connection_exists() - Check if a STA connection is active
*
* Checks if there is atleast one active STA connection in the driver
*
* Return: True if an active STA session is present, False otherwise
*/
bool cds_is_sta_active_connection_exists(void)
{
hdd_context_t *pHddCtx;
uint8_t j = 0;
pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
if (NULL != pHddCtx)
j = pHddCtx->no_of_active_sessions[CDF_STA_MODE];
return j ? true : false;
}

View file

@ -1,166 +0,0 @@
/*
* Copyright (c) 2014-2015 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
*
* 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.
*/
/*
* This file was originally distributed by Qualcomm Atheros, Inc.
* under proprietary terms before Copyright ownership was assigned
* to the Linux Foundation.
*/
#include <cds_get_bin.h>
#include <cds_api.h>
#include <cds_sched.h>
#include <wlan_hdd_misc.h>
#include <wlan_hdd_main.h>
tCDF_CON_MODE cds_get_conparam(void)
{
tCDF_CON_MODE con_mode;
con_mode = hdd_get_conparam();
return con_mode;
}
bool cds_concurrent_open_sessions_running(void)
{
uint8_t i = 0;
uint8_t j = 0;
hdd_context_t *pHddCtx;
pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
if (NULL != pHddCtx) {
for (i = 0; i < CDF_MAX_NO_OF_MODE; i++) {
j += pHddCtx->no_of_open_sessions[i];
}
}
return j > 1;
}
#ifdef WLAN_FEATURE_MBSSID
bool cds_concurrent_beaconing_sessions_running(void)
{
uint8_t i = 0;
hdd_context_t *pHddCtx;
pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
if (NULL != pHddCtx) {
i = pHddCtx->no_of_open_sessions[CDF_SAP_MODE] +
pHddCtx->no_of_open_sessions[CDF_P2P_GO_MODE] +
pHddCtx->no_of_open_sessions[CDF_IBSS_MODE];
}
return i > 1;
}
#endif
/**---------------------------------------------------------------------------
*
* \brief cds_max_concurrent_connections_reached()
*
* This function checks for presence of concurrency where more than
* one connection exists and it returns true if the max concurrency is
* reached.
*
* Example:
* STA + STA (wlan0 and wlan1 are connected) - returns true
* STA + STA (wlan0 connected and wlan1 disconnected) - returns false
* DUT with P2P-GO + P2P-CLIENT connection) - returns true
*
* \param - None
*
* \return - true or false
*
* --------------------------------------------------------------------------*/
bool cds_max_concurrent_connections_reached(void)
{
uint8_t i = 0, j = 0;
hdd_context_t *pHddCtx;
pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
if (NULL != pHddCtx) {
for (i = 0; i < CDF_MAX_NO_OF_MODE; i++)
j += pHddCtx->no_of_active_sessions[i];
return j >
(pHddCtx->config->
gMaxConcurrentActiveSessions - 1);
}
return false;
}
void cds_clear_concurrent_session_count(void)
{
uint8_t i = 0;
hdd_context_t *pHddCtx;
pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
if (NULL != pHddCtx) {
for (i = 0; i < CDF_MAX_NO_OF_MODE; i++)
pHddCtx->no_of_active_sessions[i] = 0;
}
}
/**---------------------------------------------------------------------------
*
* \brief cds_is_multiple_active_sta_sessions()
*
* This function checks for presence of multiple active sta connections
* and it returns true if the more than 1 active sta connection exists.
*
* \param - None
*
* \return - true or false
*
* --------------------------------------------------------------------------*/
bool cds_is_multiple_active_sta_sessions(void)
{
hdd_context_t *pHddCtx;
uint8_t j = 0;
pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
if (NULL != pHddCtx)
j = pHddCtx->no_of_active_sessions[CDF_STA_MODE];
return j > 1;
}
/**---------------------------------------------------------------------------
*
* \brief cds_is_sta_active_connection_exists()
*
* This function checks for the presence of active sta connection
* and it returns true if exists.
*
* \param - None
*
* \return - true or false
*
* --------------------------------------------------------------------------*/
bool cds_is_sta_active_connection_exists(void)
{
hdd_context_t *pHddCtx;
uint8_t j = 0;
pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
if (NULL != pHddCtx)
j = pHddCtx->no_of_active_sessions[CDF_STA_MODE];
return j ? true : false;
}

View file

@ -46,6 +46,7 @@
#include "wlan_logging_sock_svc.h"
#include "wma_api.h"
#include "wlan_hdd_napi.h"
#include "cds_concurrency.h"
#ifdef MODULE
#define WLAN_MODULE_NAME module_name(THIS_MODULE)

View file

@ -68,6 +68,7 @@
#include <wma_types.h>
#include "hif.h"
#include "sme_power_save_api.h"
#include "cds_concurrency.h"
/* Preprocessor definitions and constants */
#define HDD_SSR_BRING_UP_TIME 30000

View file

@ -49,7 +49,6 @@
#else
#include "cnss_stub.h"
#endif
#include <cds_get_bin.h>
#include "epping_main.h"
#include "hif_debug.h"

View file

@ -47,9 +47,9 @@
#ifdef CONFIG_CNSS
#include <net/cnss.h>
#endif
#include <cds_get_bin.h>
#include "hif_debug.h"
#include "epping_main.h"
#include "cds_concurrency.h"
void hif_dump_target_memory(struct ol_softc *scn, void *ramdump_base,
uint32_t address, uint32_t size)

View file

@ -49,7 +49,6 @@
#ifdef CONFIG_CNSS
#include <net/cnss.h>
#endif
#include <cds_get_bin.h>
#include "epping_main.h"
#include "hif_debug.h"
#include "ce_internal.h"
@ -62,6 +61,7 @@
#include <soc/qcom/icnss.h>
#endif
#include "qwlan_version.h"
#include "cds_concurrency.h"
#define CE_POLL_TIMEOUT 10 /* ms */

View file

@ -37,10 +37,10 @@
#include "ce_reg.h"
#include "cdf_lock.h"
#include "regtable.h"
#include <cds_get_bin.h>
#include "epping_main.h"
#include "hif_main.h"
#include "hif_debug.h"
#include "cds_concurrency.h"
#ifdef IPA_OFFLOAD
#ifdef QCA_WIFI_3_0

View file

@ -51,7 +51,6 @@
#ifdef CONFIG_CNSS
#include <net/cnss.h>
#endif
#include <cds_get_bin.h>
#include "epping_main.h"
#include "hif_debug.h"
#include "mp_dev.h"
@ -65,6 +64,8 @@
#include "pktlog_ac.h"
#endif
#include "cds_concurrency.h"
#define AGC_DUMP 1
#define CHANINFO_DUMP 2
#define BB_WATCHDOG_DUMP 3

View file

@ -68,6 +68,7 @@
#include "if_pci_internal.h"
#include "icnss_stub.h"
#include "ce_tasklet.h"
#include "cds_concurrency.h"
/* Maximum ms timeout for host to wake up target */
#define PCIE_WAKE_TIMEOUT 1000

View file

@ -31,9 +31,9 @@
#include <cdf_nbuf.h> /* cdf_nbuf_t */
#include <cdf_types.h> /* cdf_print */
#include <hif.h>
#include <cds_get_bin.h>
#include "epping_main.h"
#include "hif_io32.h"
#include "cds_concurrency.h"
#ifdef DEBUG
static ATH_DEBUG_MASK_DESCRIPTION g_htc_debug_description[] = {

View file

@ -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.
*
@ -29,7 +29,6 @@
#include "htc_internal.h"
#include "cds_api.h"
#include <cdf_nbuf.h> /* cdf_nbuf_t */
#include <cds_get_bin.h>
#include "epping_main.h"
#ifdef DEBUG

View file

@ -29,7 +29,6 @@
#include "htc_internal.h"
#include <cdf_nbuf.h> /* cdf_nbuf_t */
#include <cdf_memory.h> /* cdf_mem_malloc */
#include <cds_get_bin.h>
#include "epping_main.h"
/* #define USB_HIF_SINGLE_PIPE_DATA_SCHED */

View file

@ -72,6 +72,7 @@
#include "cds_packet.h"
#include "cds_utils.h"
#include "sys_startup.h"
#include "cds_concurrency.h"
static void __lim_init_scan_vars(tpAniSirGlobal pMac)
{

View file

@ -53,6 +53,7 @@
#include "sme_inside.h"
#include "cds_ieee80211_common_i.h"
#include "cds_regdomain_common.h"
#include "cds_concurrency.h"
/*----------------------------------------------------------------------------
* Preprocessor Definitions and Constants

View file

@ -47,6 +47,7 @@
#include "sme_api.h"
#include "csr_neighbor_roam.h"
#include "mac_trace.h"
#include "cds_concurrency.h"
#define WLAN_FEATURE_NEIGHBOR_ROAMING_DEBUG 1
#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING_DEBUG

View file

@ -53,6 +53,7 @@
#include "hif.h"
#include "epping_main.h"
#include "epping_internal.h"
#include "cds_concurrency.h"
#ifdef TIMER_MANAGER
#define TIMER_MANAGER_STR " +TIMER_MANAGER"

View file

@ -76,6 +76,7 @@
#include "wma_internal.h"
#include "wma_ocb.h"
#include "cds_concurrency.h"
#define WMA_LOG_COMPLETION_TIMER 10000 /* 10 seconds */
#define WMA_SERVICE_READY_EXT_TIMEOUT 2000 /* 2 seconds */

View file

@ -68,6 +68,7 @@
#include "ol_fw.h"
#include "dfs.h"
#include "wma_internal.h"
#include "cds_concurrency.h"
/**
* wma_send_bcn_buf_ll() - prepare and send beacon buffer to fw for LL

View file

@ -68,6 +68,7 @@
#include "dfs.h"
#include "wma_internal.h"
#include "cds_concurrency.h"
/* MCS Based rate table */
/* HT MCS parameters with Nss = 1 */