mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
qcacld-3.0: cds: change legacy data path api to cdp api
Remove legacy apis call from out side of data path. Replace legacy apis to cdp apis. cds module. Change-Id: I3f26b69711f494bad7fbaf07c5b8961125f13e65 CRs-fixed: 1075736
This commit is contained in:
parent
56af9925b5
commit
9b09703f79
4 changed files with 123 additions and 84 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2011,2014-2015 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2011,2014-2016 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||
*
|
||||
|
|
@ -29,6 +29,7 @@
|
|||
#include "osdep.h"
|
||||
#endif /* EXTERNAL_USE_ONLY */
|
||||
#include "cds_ieee80211_common_i.h"
|
||||
#include "cdp_txrx_mob_def.h"
|
||||
|
||||
#ifndef CDS_COMMON_IEEE80211_H_
|
||||
#define CDS_COMMON_IEEE80211_H_
|
||||
|
|
@ -37,9 +38,6 @@
|
|||
* 802.11 protocol definitions.
|
||||
*/
|
||||
|
||||
/* is 802.11 address multicast/broadcast? */
|
||||
#define IEEE80211_IS_MULTICAST(_a) (*(_a) & 0x01)
|
||||
|
||||
#define IEEE80211_IS_IPV4_MULTICAST(_a) (*(_a) == 0x01)
|
||||
|
||||
#define IEEE80211_IS_IPV6_MULTICAST(_a) \
|
||||
|
|
@ -738,51 +736,6 @@ struct ieee80211_dls_response {
|
|||
uint8_t src_addr[IEEE80211_ADDR_LEN];
|
||||
} __packed;
|
||||
|
||||
/* BA actions */
|
||||
#define IEEE80211_ACTION_BA_ADDBA_REQUEST 0 /* ADDBA request */
|
||||
#define IEEE80211_ACTION_BA_ADDBA_RESPONSE 1 /* ADDBA response */
|
||||
#define IEEE80211_ACTION_BA_DELBA 2 /* DELBA */
|
||||
|
||||
struct ieee80211_ba_parameterset {
|
||||
#if _BYTE_ORDER == _BIG_ENDIAN
|
||||
uint16_t buffersize : 10, /* B6-15 buffer size */
|
||||
tid : 4, /* B2-5 TID */
|
||||
bapolicy : 1, /* B1 block ack policy */
|
||||
amsdusupported : 1; /* B0 amsdu supported */
|
||||
#else
|
||||
uint16_t amsdusupported : 1, /* B0 amsdu supported */
|
||||
bapolicy : 1, /* B1 block ack policy */
|
||||
tid : 4, /* B2-5 TID */
|
||||
buffersize : 10; /* B6-15 buffer size */
|
||||
#endif
|
||||
} __packed;
|
||||
|
||||
#define IEEE80211_BA_POLICY_DELAYED 0
|
||||
#define IEEE80211_BA_POLICY_IMMEDIATE 1
|
||||
#define IEEE80211_BA_AMSDU_SUPPORTED 1
|
||||
|
||||
struct ieee80211_ba_seqctrl {
|
||||
#if _BYTE_ORDER == _BIG_ENDIAN
|
||||
uint16_t startseqnum : 12, /* B4-15 starting sequence number */
|
||||
fragnum : 4; /* B0-3 fragment number */
|
||||
#else
|
||||
uint16_t fragnum : 4, /* B0-3 fragment number */
|
||||
startseqnum : 12; /* B4-15 starting sequence number */
|
||||
#endif
|
||||
} __packed;
|
||||
|
||||
struct ieee80211_delba_parameterset {
|
||||
#if _BYTE_ORDER == _BIG_ENDIAN
|
||||
uint16_t tid : 4, /* B12-15 tid */
|
||||
initiator : 1, /* B11 initiator */
|
||||
reserved0 : 11; /* B0-10 reserved */
|
||||
#else
|
||||
uint16_t reserved0 : 11, /* B0-10 reserved */
|
||||
initiator : 1, /* B11 initiator */
|
||||
tid : 4; /* B12-15 tid */
|
||||
#endif
|
||||
} __packed;
|
||||
|
||||
/* BA - ADDBA request */
|
||||
struct ieee80211_action_ba_addbarequest {
|
||||
struct ieee80211_action rq_header;
|
||||
|
|
|
|||
|
|
@ -285,6 +285,7 @@ typedef struct _cds_context_type {
|
|||
qdf_device_t qdf_ctx;
|
||||
|
||||
void *pdev_txrx_ctx;
|
||||
void *dp_soc;
|
||||
|
||||
/* Configuration handle used to get system configuration */
|
||||
void *cfg_ctx;
|
||||
|
|
@ -310,7 +311,7 @@ typedef struct _cds_context_type {
|
|||
void (*sme_get_nss_for_vdev)(void*, enum tQDF_ADAPTER_MODE,
|
||||
uint8_t *, uint8_t *);
|
||||
|
||||
void (*ol_txrx_update_mac_id)(uint8_t , uint8_t);
|
||||
void (*cdp_update_mac_id)(void *soc, uint8_t , uint8_t);
|
||||
|
||||
/* This list is not sessionized. This mandatory channel list would be
|
||||
* as per OEMs preference as per the regulatory/other considerations.
|
||||
|
|
|
|||
|
|
@ -57,9 +57,12 @@
|
|||
#include "cds_utils.h"
|
||||
#include "wlan_logging_sock_svc.h"
|
||||
#include "wma.h"
|
||||
#include "ol_txrx.h"
|
||||
#include "pktlog_ac.h"
|
||||
#include "wlan_hdd_ipa.h"
|
||||
|
||||
#include <cdp_txrx_cmn_reg.h>
|
||||
#include <cdp_txrx_cfg.h>
|
||||
#include <cdp_txrx_misc.h>
|
||||
/* Preprocessor Definitions and Constants */
|
||||
|
||||
/* Maximum number of cds message queue get wrapper failures to cause panic */
|
||||
|
|
@ -75,6 +78,13 @@ static atomic_t cds_wrapper_empty_count;
|
|||
|
||||
static uint8_t cds_multicast_logging;
|
||||
|
||||
static struct ol_if_ops dp_ol_if_ops = {
|
||||
.peer_set_default_routing = wma_peer_set_default_routing,
|
||||
.peer_rx_reorder_queue_setup = wma_peer_rx_reorder_queue_setup,
|
||||
.peer_rx_reorder_queue_remove = wma_peer_rx_reorder_queue_remove,
|
||||
/* TODO: Add any other control path calls required to OL_IF/WMA layer */
|
||||
};
|
||||
|
||||
void cds_sys_probe_thread_cback(void *pUserData);
|
||||
|
||||
/**
|
||||
|
|
@ -158,6 +168,52 @@ void cds_tdls_tx_rx_mgmt_event(uint8_t event_id, uint8_t tx_rx,
|
|||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* cds_cdp_cfg_attach() - attach data path config module
|
||||
* @cds_cfg: generic platform level config instance
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
static void cds_cdp_cfg_attach(struct cds_config_info *cds_cfg)
|
||||
{
|
||||
struct txrx_pdev_cfg_param_t cdp_cfg = {0};
|
||||
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
|
||||
|
||||
gp_cds_context->cfg_ctx = cdp_cfg_attach(soc, gp_cds_context->qdf_ctx,
|
||||
(void *)(&cdp_cfg));
|
||||
if (!gp_cds_context->cfg_ctx) {
|
||||
WMA_LOGP("%s: failed to init cfg handle", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
cdp_cfg.is_uc_offload_enabled = cds_cfg->uc_offload_enabled;
|
||||
cdp_cfg.uc_tx_buffer_count = cds_cfg->uc_txbuf_count;
|
||||
cdp_cfg.uc_tx_buffer_size = cds_cfg->uc_txbuf_size;
|
||||
cdp_cfg.uc_rx_indication_ring_count = cds_cfg->uc_rxind_ringcount;
|
||||
cdp_cfg.uc_tx_partition_base = cds_cfg->uc_tx_partition_base;
|
||||
cdp_cfg.enable_rxthread = cds_cfg->enable_rxthread;
|
||||
cdp_cfg.ip_tcp_udp_checksum_offload =
|
||||
cds_cfg->ip_tcp_udp_checksum_offload;
|
||||
cdp_cfg.ce_classify_enabled = cds_cfg->ce_classify_enabled;
|
||||
|
||||
/* Configure Receive flow steering */
|
||||
cdp_cfg_set_flow_steering(soc, &gp_cds_context->cfg_ctx,
|
||||
cds_cfg->flow_steering_enabled);
|
||||
|
||||
cdp_cfg_set_flow_control_parameters(soc, &gp_cds_context->cfg_ctx,
|
||||
(void *)cds_cfg);
|
||||
|
||||
/* adjust the cfg_ctx default value based on setting */
|
||||
cdp_cfg_set_rx_fwd_disabled(soc, gp_cds_context->cfg_ctx,
|
||||
(uint8_t) cds_cfg->ap_disable_intrabss_fwd);
|
||||
|
||||
/*
|
||||
* adjust the packet log enable default value
|
||||
* based on CFG INI setting
|
||||
*/
|
||||
cdp_cfg_set_packet_log_enabled(soc, gp_cds_context->cfg_ctx,
|
||||
(uint8_t)cds_is_packet_log_enabled());
|
||||
}
|
||||
|
||||
/**
|
||||
* cds_open() - open the CDS Module
|
||||
|
|
@ -346,6 +402,19 @@ QDF_STATUS cds_open(void)
|
|||
bmi_target_ready(scn, gp_cds_context->cfg_ctx);
|
||||
/* Now proceed to open the MAC */
|
||||
|
||||
if (TARGET_TYPE_QCA8074 == pHddCtx->target_type)
|
||||
gp_cds_context->dp_soc = cdp_soc_attach(LITHIUM_DP,
|
||||
gp_cds_context->pHIFContext, scn,
|
||||
gp_cds_context->htc_ctx, gp_cds_context->qdf_ctx,
|
||||
&dp_ol_if_ops);
|
||||
else
|
||||
gp_cds_context->dp_soc = cdp_soc_attach(MOB_DRV_LEGACY_DP,
|
||||
gp_cds_context->pHIFContext, scn,
|
||||
gp_cds_context->htc_ctx, gp_cds_context->qdf_ctx,
|
||||
&dp_ol_if_ops);
|
||||
|
||||
cds_cdp_cfg_attach(cds_cfg);
|
||||
|
||||
/* UMA is supported in hardware for performing the
|
||||
* frame translation 802.11 <-> 802.3
|
||||
*/
|
||||
|
|
@ -372,11 +441,11 @@ QDF_STATUS cds_open(void)
|
|||
QDF_ASSERT(0);
|
||||
goto err_mac_close;
|
||||
}
|
||||
|
||||
gp_cds_context->pdev_txrx_ctx =
|
||||
ol_txrx_pdev_attach(gp_cds_context->cfg_ctx,
|
||||
gp_cds_context->htc_ctx,
|
||||
gp_cds_context->qdf_ctx);
|
||||
cdp_pdev_attach(cds_get_context(QDF_MODULE_ID_SOC),
|
||||
gp_cds_context->cfg_ctx,
|
||||
gp_cds_context->htc_ctx,
|
||||
gp_cds_context->qdf_ctx, 0);
|
||||
if (!gp_cds_context->pdev_txrx_ctx) {
|
||||
/* Critical Error ... Cannot proceed further */
|
||||
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
|
||||
|
|
@ -385,8 +454,7 @@ QDF_STATUS cds_open(void)
|
|||
goto err_sme_close;
|
||||
}
|
||||
|
||||
gp_cds_context->ol_txrx_update_mac_id = ol_txrx_update_mac_id;
|
||||
|
||||
gp_cds_context->cdp_update_mac_id = cdp_update_mac_id;
|
||||
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH,
|
||||
"%s: CDS successfully Opened", __func__);
|
||||
|
||||
|
|
@ -439,8 +507,9 @@ QDF_STATUS cds_pre_enable(v_CONTEXT_t cds_context)
|
|||
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
|
||||
p_cds_contextType p_cds_context = (p_cds_contextType) cds_context;
|
||||
void *scn;
|
||||
QDF_TRACE(QDF_MODULE_ID_SYS, QDF_TRACE_LEVEL_INFO, "cds prestart");
|
||||
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
|
||||
|
||||
QDF_TRACE(QDF_MODULE_ID_SYS, QDF_TRACE_LEVEL_INFO, "cds prestart");
|
||||
if (gp_cds_context != p_cds_context) {
|
||||
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: Context mismatch", __func__);
|
||||
|
|
@ -471,10 +540,9 @@ QDF_STATUS cds_pre_enable(v_CONTEXT_t cds_context)
|
|||
|
||||
/* call Packetlog connect service */
|
||||
if (QDF_GLOBAL_FTM_MODE != cds_get_conparam() &&
|
||||
QDF_GLOBAL_EPPING_MODE != cds_get_conparam()) {
|
||||
htt_pkt_log_init(gp_cds_context->pdev_txrx_ctx, scn);
|
||||
pktlog_htc_attach();
|
||||
}
|
||||
QDF_GLOBAL_EPPING_MODE != cds_get_conparam())
|
||||
cdp_pkt_log_con_service(soc,
|
||||
gp_cds_context->pdev_txrx_ctx, scn);
|
||||
|
||||
/* Reset wma wait event */
|
||||
qdf_event_reset(&gp_cds_context->wmaCompleteEvent);
|
||||
|
|
@ -533,7 +601,7 @@ QDF_STATUS cds_pre_enable(v_CONTEXT_t cds_context)
|
|||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (ol_txrx_pdev_post_attach(gp_cds_context->pdev_txrx_ctx)) {
|
||||
if (cdp_pdev_post_attach(soc, gp_cds_context->pdev_txrx_ctx)) {
|
||||
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
|
||||
"Failed to attach pdev");
|
||||
htc_stop(gp_cds_context->htc_ctx);
|
||||
|
|
@ -618,11 +686,17 @@ QDF_STATUS cds_enable(v_CONTEXT_t cds_context)
|
|||
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO,
|
||||
"%s: SME correctly started", __func__);
|
||||
|
||||
if (ol_txrx_pdev_attach_target
|
||||
(p_cds_context->pdev_txrx_ctx)) {
|
||||
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
|
||||
"%s: Failed attach target", __func__);
|
||||
goto err_sme_stop;
|
||||
if (cdp_soc_attach_target(cds_get_context(QDF_MODULE_ID_SOC))) {
|
||||
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
|
||||
"%s: Failed to attach soc target", __func__);
|
||||
goto err_sme_stop;
|
||||
}
|
||||
|
||||
if (cdp_pdev_attach_target(cds_get_context(QDF_MODULE_ID_SOC),
|
||||
cds_get_context(QDF_MODULE_ID_TXRX))) {
|
||||
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
|
||||
"%s: Failed to attach pdev target", __func__);
|
||||
goto err_soc_target_detach;
|
||||
}
|
||||
|
||||
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO,
|
||||
|
|
@ -632,6 +706,9 @@ QDF_STATUS cds_enable(v_CONTEXT_t cds_context)
|
|||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
err_soc_target_detach:
|
||||
/* NOOP */
|
||||
|
||||
err_sme_stop:
|
||||
sme_stop(p_cds_context->pMACContext, HAL_STOP_TYPE_SYS_RESET);
|
||||
|
||||
|
|
@ -795,7 +872,8 @@ QDF_STATUS cds_close(v_CONTEXT_t cds_context)
|
|||
gp_cds_context->htc_ctx = NULL;
|
||||
}
|
||||
|
||||
ol_txrx_pdev_detach(gp_cds_context->pdev_txrx_ctx, 1);
|
||||
cdp_pdev_detach(cds_get_context(QDF_MODULE_ID_SOC),
|
||||
gp_cds_context->pdev_txrx_ctx, 1);
|
||||
cds_free_context(cds_context, QDF_MODULE_ID_TXRX,
|
||||
gp_cds_context->pdev_txrx_ctx);
|
||||
|
||||
|
|
@ -862,18 +940,17 @@ QDF_STATUS cds_close(v_CONTEXT_t cds_context)
|
|||
void cds_flush_cache_rx_queue(void)
|
||||
{
|
||||
uint8_t sta_id;
|
||||
struct ol_txrx_peer_t *peer;
|
||||
struct ol_txrx_pdev_t *pdev;
|
||||
|
||||
pdev = cds_get_context(QDF_MODULE_ID_TXRX);
|
||||
if (!pdev)
|
||||
return;
|
||||
void *peer;
|
||||
void *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
|
||||
|
||||
for (sta_id = 0; sta_id < WLAN_MAX_STA_COUNT; sta_id++) {
|
||||
peer = ol_txrx_peer_find_by_local_id(pdev, sta_id);
|
||||
peer = cdp_peer_find_by_local_id(
|
||||
cds_get_context(QDF_MODULE_ID_SOC),
|
||||
pdev, sta_id);
|
||||
if (!peer)
|
||||
continue;
|
||||
ol_txrx_flush_rx_frames(peer, 1);
|
||||
cdp_flush_rx_frames(cds_get_context(QDF_MODULE_ID_SOC),
|
||||
peer, 1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -967,6 +1044,12 @@ void *cds_get_context(QDF_MODULE_ID moduleId)
|
|||
break;
|
||||
}
|
||||
|
||||
case QDF_MODULE_ID_SOC:
|
||||
{
|
||||
pModContext = gp_cds_context->dp_soc;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
|
||||
|
|
|
|||
|
|
@ -2153,8 +2153,9 @@ static void cds_update_conc_list(uint32_t conn_index,
|
|||
conc_connection_list[conn_index].in_use = in_use;
|
||||
|
||||
cds_dump_connection_status_info();
|
||||
if (cds_ctx->ol_txrx_update_mac_id)
|
||||
cds_ctx->ol_txrx_update_mac_id(vdev_id, mac);
|
||||
if (cds_ctx->cdp_update_mac_id)
|
||||
cds_ctx->cdp_update_mac_id(cds_get_context(QDF_MODULE_ID_SOC),
|
||||
vdev_id, mac);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -3092,6 +3093,7 @@ void cds_dump_concurrency_info(void)
|
|||
hdd_adapter_t *preAdapterContext = NULL;
|
||||
hdd_adapter_t *adapter2_4 = NULL;
|
||||
hdd_adapter_t *adapter5 = NULL;
|
||||
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
|
||||
#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
|
||||
|
||||
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
||||
|
|
@ -3190,7 +3192,7 @@ void cds_dump_concurrency_info(void)
|
|||
}
|
||||
adapter->tx_flow_high_watermark_offset =
|
||||
hdd_ctx->config->TxFlowHighWaterMarkOffset;
|
||||
ol_txrx_ll_set_tx_pause_q_depth(
|
||||
cdp_fc_ll_set_tx_pause_q_depth(soc,
|
||||
adapter->sessionId,
|
||||
hdd_ctx->config->TxFlowMaxQueueDepth);
|
||||
cds_info("MODE %d,CH %d,LWM %d,HWM %d,TXQDEP %d",
|
||||
|
|
@ -3215,7 +3217,7 @@ void cds_dump_concurrency_info(void)
|
|||
adapter->tx_flow_low_watermark = 0;
|
||||
adapter->
|
||||
tx_flow_high_watermark_offset = 0;
|
||||
ol_txrx_ll_set_tx_pause_q_depth(
|
||||
cdp_fc_ll_set_tx_pause_q_depth(soc,
|
||||
adapter->sessionId,
|
||||
hdd_ctx->config->
|
||||
TxHbwFlowMaxQueueDepth);
|
||||
|
|
@ -3241,7 +3243,7 @@ void cds_dump_concurrency_info(void)
|
|||
tx_flow_low_watermark = 0;
|
||||
preAdapterContext->
|
||||
tx_flow_high_watermark_offset = 0;
|
||||
ol_txrx_ll_set_tx_pause_q_depth(
|
||||
cdp_fc_ll_set_tx_pause_q_depth(soc,
|
||||
preAdapterContext->sessionId,
|
||||
hdd_ctx->config->
|
||||
TxHbwFlowMaxQueueDepth);
|
||||
|
|
@ -3291,7 +3293,7 @@ void cds_dump_concurrency_info(void)
|
|||
tx_flow_high_watermark_offset =
|
||||
hdd_ctx->config->
|
||||
TxHbwFlowHighWaterMarkOffset;
|
||||
ol_txrx_ll_set_tx_pause_q_depth(
|
||||
cdp_fc_ll_set_tx_pause_q_depth(soc,
|
||||
adapter5->sessionId,
|
||||
hdd_ctx->config->
|
||||
TxHbwFlowMaxQueueDepth);
|
||||
|
|
@ -3319,7 +3321,7 @@ void cds_dump_concurrency_info(void)
|
|||
tx_flow_high_watermark_offset =
|
||||
hdd_ctx->config->
|
||||
TxLbwFlowHighWaterMarkOffset;
|
||||
ol_txrx_ll_set_tx_pause_q_depth(
|
||||
cdp_fc_ll_set_tx_pause_q_depth(soc,
|
||||
adapter2_4->sessionId,
|
||||
hdd_ctx->config->
|
||||
TxLbwFlowMaxQueueDepth);
|
||||
|
|
|
|||
Loading…
Reference in a new issue