qcacld-3.0: Cleanup WMA LPHB code and Add PMO lphb calls

Cleanup WMA LPHB code and Add PMO calls.

Change-Id: I8dd338b9653c123ef315aa955915547486603ae8
CRs-Fixed: 2021994
Dieser Commit ist enthalten in:
Mukul Sharma
2017-03-20 18:18:59 +05:30
committet von Sandeep Puligilla
Ursprung fa28a85850
Commit fcd57f5724
13 geänderte Dateien mit 21 neuen und 607 gelöschten Zeilen

Datei anzeigen

@@ -16125,7 +16125,7 @@ wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy,
* Return: none
*/
static void wlan_hdd_cfg80211_lphb_ind_handler(void *pHddCtx,
tSirLPHBInd *lphbInd)
struct pmo_lphb_rsp *lphb_ind)
{
struct sk_buff *skb;
@@ -16134,14 +16134,13 @@ static void wlan_hdd_cfg80211_lphb_ind_handler(void *pHddCtx,
if (0 != wlan_hdd_validate_context((hdd_context_t *) pHddCtx))
return;
if (NULL == lphbInd) {
if (!lphb_ind) {
hdd_err("invalid argument lphbInd");
return;
}
skb = cfg80211_testmode_alloc_event_skb(((hdd_context_t *) pHddCtx)->
wiphy, sizeof(tSirLPHBInd),
GFP_ATOMIC);
wiphy, sizeof(*lphb_ind), GFP_ATOMIC);
if (!skb) {
hdd_err("LPHB timeout, NL buffer alloc fail");
return;
@@ -16151,11 +16150,12 @@ static void wlan_hdd_cfg80211_lphb_ind_handler(void *pHddCtx,
hdd_err("WLAN_HDD_TM_ATTR_CMD put fail");
goto nla_put_failure;
}
if (nla_put_u32(skb, WLAN_HDD_TM_ATTR_TYPE, lphbInd->protocolType)) {
if (nla_put_u32(skb, WLAN_HDD_TM_ATTR_TYPE, lphb_ind->protocol_type)) {
hdd_err("WLAN_HDD_TM_ATTR_TYPE put fail");
goto nla_put_failure;
}
if (nla_put(skb, WLAN_HDD_TM_ATTR_DATA, sizeof(tSirLPHBInd), lphbInd)) {
if (nla_put(skb, WLAN_HDD_TM_ATTR_DATA, sizeof(*lphb_ind),
lphb_ind)) {
hdd_err("WLAN_HDD_TM_ATTR_DATA put fail");
goto nla_put_failure;
}
@@ -16213,9 +16213,9 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy,
{
int buf_len;
void *buf;
tSirLPHBReq *hb_params = NULL;
tSirLPHBReq *hb_params_temp = NULL;
QDF_STATUS smeStatus;
struct pmo_lphb_req *hb_params = NULL;
struct pmo_lphb_req *hb_params_temp = NULL;
QDF_STATUS status;
if (!tb[WLAN_HDD_TM_ATTR_DATA]) {
hdd_err("Testmode INV DATA");
@@ -16225,28 +16225,27 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy,
buf = nla_data(tb[WLAN_HDD_TM_ATTR_DATA]);
buf_len = nla_len(tb[WLAN_HDD_TM_ATTR_DATA]);
hb_params_temp = (tSirLPHBReq *) buf;
if ((hb_params_temp->cmd == LPHB_SET_TCP_PARAMS_INDID)
&& (hb_params_temp->params.lphbTcpParamReq.
timePeriodSec == 0))
hb_params_temp = (struct pmo_lphb_req *) buf;
if ((hb_params_temp->cmd == pmo_lphb_set_tcp_pararm_indid)
&& (hb_params_temp->params.lphb_tcp_params.
time_period_sec == 0))
return -EINVAL;
hb_params =
(tSirLPHBReq *) qdf_mem_malloc(sizeof(tSirLPHBReq));
hb_params = (struct pmo_lphb_req *)qdf_mem_malloc(
sizeof(*hb_params));
if (NULL == hb_params) {
hdd_err("Request Buffer Alloc Fail");
return -ENOMEM;
}
qdf_mem_copy(hb_params, buf, buf_len);
smeStatus =
sme_lphb_config_req((tHalHandle) (pHddCtx->hHal),
hb_params,
status = pmo_ucfg_lphb_config_req(pHddCtx->hdd_psoc,
hb_params, (void *)pHddCtx,
wlan_hdd_cfg80211_lphb_ind_handler);
if (QDF_STATUS_SUCCESS != smeStatus) {
if (status != QDF_STATUS_SUCCESS)
hdd_err("LPHB Config Fail, disable");
qdf_mem_free(hb_params);
}
qdf_mem_free(hb_params);
return 0;
}
#endif /* FEATURE_WLAN_LPHB */

Datei anzeigen

@@ -3714,80 +3714,6 @@ typedef enum eSirAddonPsReq {
eSIR_ADDON_DISABLE_UAPSD
} tSirAddonPsReq;
#ifdef FEATURE_WLAN_LPHB
#define SIR_LPHB_FILTER_LEN 64
typedef enum {
LPHB_SET_EN_PARAMS_INDID,
LPHB_SET_TCP_PARAMS_INDID,
LPHB_SET_TCP_PKT_FILTER_INDID,
LPHB_SET_UDP_PARAMS_INDID,
LPHB_SET_UDP_PKT_FILTER_INDID,
LPHB_SET_NETWORK_INFO_INDID,
} LPHBIndType;
typedef struct sSirLPHBEnableStruct {
uint8_t enable;
uint8_t item;
uint8_t session;
} tSirLPHBEnableStruct;
typedef struct sSirLPHBTcpParamStruct {
uint32_t srv_ip;
uint32_t dev_ip;
uint16_t src_port;
uint16_t dst_port;
uint16_t timeout;
uint8_t session;
struct qdf_mac_addr gateway_mac;
uint16_t timePeriodSec; /* in seconds */
uint32_t tcpSn;
} tSirLPHBTcpParamStruct;
typedef struct sSirLPHBTcpFilterStruct {
uint16_t length;
uint8_t offset;
uint8_t session;
uint8_t filter[SIR_LPHB_FILTER_LEN];
} tSirLPHBTcpFilterStruct;
typedef struct sSirLPHBUdpParamStruct {
uint32_t srv_ip;
uint32_t dev_ip;
uint16_t src_port;
uint16_t dst_port;
uint16_t interval;
uint16_t timeout;
uint8_t session;
struct qdf_mac_addr gateway_mac;
} tSirLPHBUdpParamStruct;
typedef struct sSirLPHBUdpFilterStruct {
uint16_t length;
uint8_t offset;
uint8_t session;
uint8_t filter[SIR_LPHB_FILTER_LEN];
} tSirLPHBUdpFilterStruct;
typedef struct sSirLPHBReq {
uint16_t cmd;
uint16_t dummy;
union {
tSirLPHBEnableStruct lphbEnableReq;
tSirLPHBTcpParamStruct lphbTcpParamReq;
tSirLPHBTcpFilterStruct lphbTcpFilterReq;
tSirLPHBUdpParamStruct lphbUdpParamReq;
tSirLPHBUdpFilterStruct lphbUdpFilterReq;
} params;
} tSirLPHBReq;
typedef struct sSirLPHBInd {
uint8_t sessionIdx;
uint8_t protocolType; /*TCP or UDP */
uint8_t eventReason;
} tSirLPHBInd;
#endif /* FEATURE_WLAN_LPHB */
#ifdef FEATURE_WLAN_CH_AVOID
typedef struct sSirChAvoidUpdateReq {
uint32_t reserved_param;

Datei anzeigen

@@ -171,10 +171,6 @@ enum eWniMsgTypes {
eWNI_SME_CANDIDATE_FOUND_IND, /*ROAM candidate indication from FW */
eWNI_SME_HANDOFF_REQ, /*upper layer requested handoff to driver in STA mode */
eWNI_SME_ROAM_SCAN_OFFLOAD_RSP, /*Fwd the LFR scan offload rsp from FW to SME */
#ifdef FEATURE_WLAN_LPHB
eWNI_SME_LPHB_IND,
#endif /* FEATURE_WLAN_LPHB */
eWNI_SME_IBSS_PEER_INFO_RSP,
eWNI_SME_GET_TSM_STATS_REQ,
eWNI_SME_GET_TSM_STATS_RSP,

Datei anzeigen

@@ -313,9 +313,6 @@ uint8_t *mac_trace_get_sme_msg_string(uint16_t sme_msg)
CASE_RETURN_STRING(eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP);
#endif /* WLAN_FEATURE_GTK_OFFLOAD */
CASE_RETURN_STRING(eWNI_SME_ROAM_SCAN_OFFLOAD_RSP);
#ifdef FEATURE_WLAN_LPHB
CASE_RETURN_STRING(eWNI_SME_LPHB_IND);
#endif /* FEATURE_WLAN_LPHB */
CASE_RETURN_STRING(eWNI_SME_IBSS_PEER_INFO_RSP);
#ifdef FEATURE_WLAN_CH_AVOID
CASE_RETURN_STRING(eWNI_SME_CH_AVOID_IND);
@@ -576,9 +573,6 @@ uint8_t *mac_trace_get_wma_msg_string(uint16_t wma_msg)
#endif
CASE_RETURN_STRING(WMA_ADD_PERIODIC_TX_PTRN_IND);
CASE_RETURN_STRING(WMA_TX_POWER_LIMIT);
#ifdef FEATURE_WLAN_LPHB
CASE_RETURN_STRING(WMA_LPHB_CONF_REQ);
#endif
CASE_RETURN_STRING(WMA_DHCP_START_IND);
CASE_RETURN_STRING(WMA_DHCP_STOP_IND);
#ifdef FEATURE_WLAN_CH_AVOID

Datei anzeigen

@@ -713,12 +713,6 @@ eCsrPhyMode sme_get_phy_mode(tHalHandle hHal);
QDF_STATUS sme_handoff_request(tHalHandle hHal, uint8_t sessionId,
tCsrHandoffRequest *pHandoffInfo);
QDF_STATUS sme_is_sta_p2p_client_connected(tHalHandle hHal);
#ifdef FEATURE_WLAN_LPHB
QDF_STATUS sme_lphb_config_req(tHalHandle hHal,
tSirLPHBReq * lphdReq,
void (*pCallbackfn)(void *pHddCtx,
tSirLPHBInd * indParam));
#endif /* FEATURE_WLAN_LPHB */
QDF_STATUS sme_add_periodic_tx_ptrn(tHalHandle hHal, tSirAddPeriodicTxPtrn
*addPeriodicTxPtrnParams);
QDF_STATUS sme_del_periodic_tx_ptrn(tHalHandle hHal, tSirDelPeriodicTxPtrn

Datei anzeigen

@@ -176,9 +176,6 @@ typedef struct tagSmeStruct {
void **pSmeCmdBufAddr;
tDblLinkList smeCmdFreeList; /* preallocated roam cmd list */
enum tQDF_ADAPTER_MODE currDeviceMode;
#ifdef FEATURE_WLAN_LPHB
void (*pLphbIndCb)(void *pHddCtx, tSirLPHBInd *indParam);
#endif /* FEATURE_WLAN_LPHB */
tSmePeerInfoHddCbkInfo peerInfoParams;
#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
host_event_wlan_status_payload_type eventPayload;

Datei anzeigen

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -140,9 +140,6 @@ enum {
TRACE_CODE_SME_RX_HDD_TDLS_DEL_PEER_STA,
#endif
TRACE_CODE_SME_RX_HDD_PREF_NET_LIST,
#ifdef FEATURE_WLAN_LPHB
TRACE_CODE_SME_RX_HDD_LPHB_CONFIG_REQ,
#endif /* FEATURE_WLAN_LPHB */
TRACE_CODE_SME_RX_HDD_ROAM_DEL_PMKIDCACHE,
/*
* New trace commands to be added before this comment not at the end

Datei anzeigen

@@ -2397,16 +2397,6 @@ QDF_STATUS sme_process_msg(tHalHandle hHal, struct scheduler_msg *pMsg)
pMsg->bodyptr);
qdf_mem_free(pMsg->bodyptr);
break;
#ifdef FEATURE_WLAN_LPHB
/* LPHB timeout indication arrived, send IND to client */
case eWNI_SME_LPHB_IND:
MTRACE(qdf_trace(QDF_MODULE_ID_SME, TRACE_CODE_SME_RX_WMA_MSG,
NO_SESSION, pMsg->type));
if (pMac->sme.pLphbIndCb)
pMac->sme.pLphbIndCb(pMac->hHdd, pMsg->bodyptr);
qdf_mem_free(pMsg->bodyptr);
break;
#endif /* FEATURE_WLAN_LPHB */
case eWNI_SME_IBSS_PEER_INFO_RSP:
if (pMsg->bodyptr) {
sme_ibss_peer_info_response_handler(pMac,
@@ -10300,59 +10290,6 @@ QDF_STATUS sme_is_sta_p2p_client_connected(tHalHandle hHal)
return QDF_STATUS_E_FAILURE;
}
#ifdef FEATURE_WLAN_LPHB
/* ---------------------------------------------------------------------------
\fn sme_lphb_config_req
\API to make configuration LPHB within FW.
\param hHal - The handle returned by mac_open
\param lphdReq - LPHB request argument by client
\param pCallbackfn - LPHB timeout notification callback function pointer
\- return Configuration message posting status, SUCCESS or Fail
-------------------------------------------------------------------------*/
QDF_STATUS sme_lphb_config_req
(tHalHandle hHal,
tSirLPHBReq *lphdReq,
void (*pCallbackfn)(void *pHddCtx, tSirLPHBInd * indParam)
) {
QDF_STATUS status = QDF_STATUS_SUCCESS;
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
struct scheduler_msg message;
MTRACE(qdf_trace(QDF_MODULE_ID_SME,
TRACE_CODE_SME_RX_HDD_LPHB_CONFIG_REQ,
NO_SESSION, lphdReq->cmd));
status = sme_acquire_global_lock(&pMac->sme);
if (QDF_STATUS_SUCCESS == status) {
if ((LPHB_SET_EN_PARAMS_INDID == lphdReq->cmd) &&
(NULL == pCallbackfn) && (NULL == pMac->sme.pLphbIndCb)) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
"%s: Indication Call back did not registered",
__func__);
sme_release_global_lock(&pMac->sme);
return QDF_STATUS_E_FAILURE;
} else if (NULL != pCallbackfn) {
pMac->sme.pLphbIndCb = pCallbackfn;
}
/* serialize the req through MC thread */
message.bodyptr = lphdReq;
message.type = WMA_LPHB_CONF_REQ;
MTRACE(qdf_trace(QDF_MODULE_ID_SME, TRACE_CODE_SME_TX_WMA_MSG,
NO_SESSION, message.type));
qdf_status = scheduler_post_msg(QDF_MODULE_ID_WMA,
&message);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
"%s: Post Config LPHB MSG fail", __func__);
status = QDF_STATUS_E_FAILURE;
}
sme_release_global_lock(&pMac->sme);
}
return status;
}
#endif /* FEATURE_WLAN_LPHB */
/*--------------------------------------------------------------------------
\brief sme_enable_disable_split_scan() - a wrapper function to set the split
scan parameter.

Datei anzeigen

@@ -162,10 +162,6 @@ static uint8_t *sme_trace_get_rx_msg_string(uint32_t code)
CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_TDLS_DEL_PEER_STA);
#endif
CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_PREF_NET_LIST);
#ifdef FEATURE_WLAN_LPHB
CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_LPHB_CONFIG_REQ);
#endif /* FEATURE_WLAN_LPHB */
default:
return "UNKNOWN";
break;

Datei anzeigen

@@ -898,12 +898,6 @@ struct wma_wow {
bool disassoc_enable;
bool bmiss_enable;
bool gtk_err_enable[WMA_MAX_SUPPORTED_BSS];
#ifdef FEATURE_WLAN_LPHB
/* currently supports only vdev 0.
* cache has two entries: one for TCP and one for UDP.
*/
tSirLPHBReq lphb_cache[2];
#endif
};
#ifdef WLAN_FEATURE_11W

Datei anzeigen

@@ -926,12 +926,6 @@ wma_process_ftm_command(tp_wma_handle wma_handle,
void wma_process_link_status_req(tp_wma_handle wma,
tAniGetLinkStatus *pGetLinkStatus);
#ifdef FEATURE_WLAN_LPHB
QDF_STATUS wma_process_lphb_conf_req(tp_wma_handle wma_handle,
tSirLPHBReq *lphb_conf_req);
#endif
QDF_STATUS wma_process_dhcp_ind(tp_wma_handle wma_handle,
tAniDHCPInd *ta_dhcp_ind);

Datei anzeigen

@@ -484,353 +484,6 @@ error:
return status;
}
#ifdef FEATURE_WLAN_LPHB
/**
* wma_lphb_conf_hbenable() - enable command of LPHB configuration requests
* @wma_handle: WMA handle
* @lphb_conf_req: configuration info
* @by_user: whether this call is from user or cached resent
*
* Return: QDF status
*/
static QDF_STATUS wma_lphb_conf_hbenable(tp_wma_handle wma_handle,
tSirLPHBReq *lphb_conf_req,
bool by_user)
{
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
int status = 0;
tSirLPHBEnableStruct *ts_lphb_enable;
wmi_hb_set_enable_cmd_fixed_param hb_enable_fp;
int i;
if (lphb_conf_req == NULL) {
WMA_LOGE("%s : LPHB configuration is NULL", __func__);
return QDF_STATUS_E_FAILURE;
}
ts_lphb_enable = &(lphb_conf_req->params.lphbEnableReq);
WMA_LOGI("%s: WMA --> WMI_HB_SET_ENABLE enable=%d, item=%d, session=%d",
__func__,
ts_lphb_enable->enable,
ts_lphb_enable->item, ts_lphb_enable->session);
if ((ts_lphb_enable->item != 1) && (ts_lphb_enable->item != 2)) {
WMA_LOGE("%s : LPHB configuration wrong item %d",
__func__, ts_lphb_enable->item);
return QDF_STATUS_E_FAILURE;
}
/* fill in values */
hb_enable_fp.vdev_id = ts_lphb_enable->session;
hb_enable_fp.enable = ts_lphb_enable->enable;
hb_enable_fp.item = ts_lphb_enable->item;
hb_enable_fp.session = ts_lphb_enable->session;
status = wmi_unified_lphb_config_hbenable_cmd(wma_handle->wmi_handle,
&hb_enable_fp);
if (status != EOK) {
qdf_status = QDF_STATUS_E_FAILURE;
goto error;
}
if (by_user) {
/* target already configured, now cache command status */
if (ts_lphb_enable->enable) {
i = ts_lphb_enable->item - 1;
wma_handle->wow.lphb_cache[i].cmd
= LPHB_SET_EN_PARAMS_INDID;
wma_handle->wow.lphb_cache[i].params.lphbEnableReq.
enable = ts_lphb_enable->enable;
wma_handle->wow.lphb_cache[i].params.lphbEnableReq.
item = ts_lphb_enable->item;
wma_handle->wow.lphb_cache[i].params.lphbEnableReq.
session = ts_lphb_enable->session;
WMA_LOGI("%s: cached LPHB status in WMA context for item %d",
__func__, i);
} else {
qdf_mem_zero((void *)&wma_handle->wow.lphb_cache,
sizeof(wma_handle->wow.lphb_cache));
WMA_LOGI("%s: cleared all cached LPHB status in WMA context",
__func__);
}
}
return QDF_STATUS_SUCCESS;
error:
return qdf_status;
}
/**
* wma_lphb_conf_tcp_params() - set tcp params of LPHB configuration requests
* @wma_handle: wma handle
* @lphb_conf_req: lphb config request
*
* Return: QDF status
*/
static QDF_STATUS wma_lphb_conf_tcp_params(tp_wma_handle wma_handle,
tSirLPHBReq *lphb_conf_req)
{
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
int status = 0;
tSirLPHBTcpParamStruct *ts_lphb_tcp_param;
wmi_hb_set_tcp_params_cmd_fixed_param hb_tcp_params_fp = {0};
if (lphb_conf_req == NULL) {
WMA_LOGE("%s : LPHB configuration is NULL", __func__);
return QDF_STATUS_E_FAILURE;
}
ts_lphb_tcp_param = &(lphb_conf_req->params.lphbTcpParamReq);
WMA_LOGI("%s: WMA --> WMI_HB_SET_TCP_PARAMS srv_ip=%08x, "
"dev_ip=%08x, src_port=%d, dst_port=%d, timeout=%d, "
"session=%d, gateway_mac="MAC_ADDRESS_STR", timePeriodSec=%d, "
"tcpSn=%d", __func__, ts_lphb_tcp_param->srv_ip,
ts_lphb_tcp_param->dev_ip, ts_lphb_tcp_param->src_port,
ts_lphb_tcp_param->dst_port, ts_lphb_tcp_param->timeout,
ts_lphb_tcp_param->session,
MAC_ADDR_ARRAY(ts_lphb_tcp_param->gateway_mac.bytes),
ts_lphb_tcp_param->timePeriodSec, ts_lphb_tcp_param->tcpSn);
/* fill in values */
hb_tcp_params_fp.vdev_id = ts_lphb_tcp_param->session;
hb_tcp_params_fp.srv_ip = ts_lphb_tcp_param->srv_ip;
hb_tcp_params_fp.dev_ip = ts_lphb_tcp_param->dev_ip;
hb_tcp_params_fp.seq = ts_lphb_tcp_param->tcpSn;
hb_tcp_params_fp.src_port = ts_lphb_tcp_param->src_port;
hb_tcp_params_fp.dst_port = ts_lphb_tcp_param->dst_port;
hb_tcp_params_fp.interval = ts_lphb_tcp_param->timePeriodSec;
hb_tcp_params_fp.timeout = ts_lphb_tcp_param->timeout;
hb_tcp_params_fp.session = ts_lphb_tcp_param->session;
WMI_CHAR_ARRAY_TO_MAC_ADDR(ts_lphb_tcp_param->gateway_mac.bytes,
&hb_tcp_params_fp.gateway_mac);
status = wmi_unified_lphb_config_tcp_params_cmd(wma_handle->wmi_handle,
&hb_tcp_params_fp);
if (status != EOK) {
qdf_status = QDF_STATUS_E_FAILURE;
goto error;
}
return QDF_STATUS_SUCCESS;
error:
return qdf_status;
}
/**
* wma_lphb_conf_tcp_pkt_filter() - configure tcp packet filter command of LPHB
* @wma_handle: wma handle
* @lphb_conf_req: lphb config request
*
* Return: QDF status
*/
static QDF_STATUS wma_lphb_conf_tcp_pkt_filter(tp_wma_handle wma_handle,
tSirLPHBReq *lphb_conf_req)
{
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
int status = 0;
tSirLPHBTcpFilterStruct *ts_lphb_tcp_filter;
wmi_hb_set_tcp_pkt_filter_cmd_fixed_param hb_tcp_filter_fp = {0};
if (lphb_conf_req == NULL) {
WMA_LOGE("%s : LPHB configuration is NULL", __func__);
return QDF_STATUS_E_FAILURE;
}
ts_lphb_tcp_filter = &(lphb_conf_req->params.lphbTcpFilterReq);
WMA_LOGI("%s: WMA --> WMI_HB_SET_TCP_PKT_FILTER length=%d, offset=%d, session=%d, "
"filter=%2x:%2x:%2x:%2x:%2x:%2x ...", __func__,
ts_lphb_tcp_filter->length, ts_lphb_tcp_filter->offset,
ts_lphb_tcp_filter->session, ts_lphb_tcp_filter->filter[0],
ts_lphb_tcp_filter->filter[1], ts_lphb_tcp_filter->filter[2],
ts_lphb_tcp_filter->filter[3], ts_lphb_tcp_filter->filter[4],
ts_lphb_tcp_filter->filter[5]);
/* fill in values */
hb_tcp_filter_fp.vdev_id = ts_lphb_tcp_filter->session;
hb_tcp_filter_fp.length = ts_lphb_tcp_filter->length;
hb_tcp_filter_fp.offset = ts_lphb_tcp_filter->offset;
hb_tcp_filter_fp.session = ts_lphb_tcp_filter->session;
memcpy((void *)&hb_tcp_filter_fp.filter,
(void *)&ts_lphb_tcp_filter->filter,
WMI_WLAN_HB_MAX_FILTER_SIZE);
status = wmi_unified_lphb_config_tcp_pkt_filter_cmd(wma_handle->wmi_handle,
&hb_tcp_filter_fp);
if (status != EOK) {
qdf_status = QDF_STATUS_E_FAILURE;
goto error;
}
return QDF_STATUS_SUCCESS;
error:
return qdf_status;
}
/**
* wma_lphb_conf_udp_params() - configure udp param command of LPHB
* @wma_handle: wma handle
* @lphb_conf_req: lphb config request
*
* Return: QDF status
*/
static QDF_STATUS wma_lphb_conf_udp_params(tp_wma_handle wma_handle,
tSirLPHBReq *lphb_conf_req)
{
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
int status = 0;
tSirLPHBUdpParamStruct *ts_lphb_udp_param;
wmi_hb_set_udp_params_cmd_fixed_param hb_udp_params_fp = {0};
if (lphb_conf_req == NULL) {
WMA_LOGE("%s : LPHB configuration is NULL", __func__);
return QDF_STATUS_E_FAILURE;
}
ts_lphb_udp_param = &(lphb_conf_req->params.lphbUdpParamReq);
WMA_LOGI("%s: WMA --> WMI_HB_SET_UDP_PARAMS srv_ip=%d, dev_ip=%d, src_port=%d, "
"dst_port=%d, interval=%d, timeout=%d, session=%d, "
"gateway_mac="MAC_ADDRESS_STR, __func__,
ts_lphb_udp_param->srv_ip, ts_lphb_udp_param->dev_ip,
ts_lphb_udp_param->src_port, ts_lphb_udp_param->dst_port,
ts_lphb_udp_param->interval, ts_lphb_udp_param->timeout,
ts_lphb_udp_param->session,
MAC_ADDR_ARRAY(ts_lphb_udp_param->gateway_mac.bytes));
/* fill in values */
hb_udp_params_fp.vdev_id = ts_lphb_udp_param->session;
hb_udp_params_fp.srv_ip = ts_lphb_udp_param->srv_ip;
hb_udp_params_fp.dev_ip = ts_lphb_udp_param->dev_ip;
hb_udp_params_fp.src_port = ts_lphb_udp_param->src_port;
hb_udp_params_fp.dst_port = ts_lphb_udp_param->dst_port;
hb_udp_params_fp.interval = ts_lphb_udp_param->interval;
hb_udp_params_fp.timeout = ts_lphb_udp_param->timeout;
hb_udp_params_fp.session = ts_lphb_udp_param->session;
WMI_CHAR_ARRAY_TO_MAC_ADDR(ts_lphb_udp_param->gateway_mac.bytes,
&hb_udp_params_fp.gateway_mac);
status = wmi_unified_lphb_config_udp_params_cmd(wma_handle->wmi_handle,
&hb_udp_params_fp);
if (status != EOK) {
qdf_status = QDF_STATUS_E_FAILURE;
goto error;
}
return QDF_STATUS_SUCCESS;
error:
return qdf_status;
}
/**
* wma_lphb_conf_udp_pkt_filter() - configure udp pkt filter command of LPHB
* @wma_handle: wma handle
* @lphb_conf_req: lphb config request
*
* Return: QDF status
*/
static QDF_STATUS wma_lphb_conf_udp_pkt_filter(tp_wma_handle wma_handle,
tSirLPHBReq *lphb_conf_req)
{
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
int status = 0;
tSirLPHBUdpFilterStruct *ts_lphb_udp_filter;
wmi_hb_set_udp_pkt_filter_cmd_fixed_param hb_udp_filter_fp = {0};
if (lphb_conf_req == NULL) {
WMA_LOGE("%s : LPHB configuration is NULL", __func__);
return QDF_STATUS_E_FAILURE;
}
ts_lphb_udp_filter = &(lphb_conf_req->params.lphbUdpFilterReq);
WMA_LOGI("%s: WMA --> WMI_HB_SET_UDP_PKT_FILTER length=%d, offset=%d, session=%d, "
"filter=%2x:%2x:%2x:%2x:%2x:%2x ...", __func__,
ts_lphb_udp_filter->length, ts_lphb_udp_filter->offset,
ts_lphb_udp_filter->session, ts_lphb_udp_filter->filter[0],
ts_lphb_udp_filter->filter[1], ts_lphb_udp_filter->filter[2],
ts_lphb_udp_filter->filter[3], ts_lphb_udp_filter->filter[4],
ts_lphb_udp_filter->filter[5]);
/* fill in values */
hb_udp_filter_fp.vdev_id = ts_lphb_udp_filter->session;
hb_udp_filter_fp.length = ts_lphb_udp_filter->length;
hb_udp_filter_fp.offset = ts_lphb_udp_filter->offset;
hb_udp_filter_fp.session = ts_lphb_udp_filter->session;
memcpy((void *)&hb_udp_filter_fp.filter,
(void *)&ts_lphb_udp_filter->filter,
WMI_WLAN_HB_MAX_FILTER_SIZE);
status = wmi_unified_lphb_config_udp_pkt_filter_cmd(wma_handle->wmi_handle,
&hb_udp_filter_fp);
if (status != EOK) {
qdf_status = QDF_STATUS_E_FAILURE;
goto error;
}
return QDF_STATUS_SUCCESS;
error:
return qdf_status;
}
/**
* wma_process_lphb_conf_req() - handle LPHB configuration requests
* @wma_handle: wma handle
* @lphb_conf_req: lphb config request
*
* Return: QDF status
*/
QDF_STATUS wma_process_lphb_conf_req(tp_wma_handle wma_handle,
tSirLPHBReq *lphb_conf_req)
{
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
if (lphb_conf_req == NULL) {
WMA_LOGE("%s : LPHB configuration is NULL", __func__);
return QDF_STATUS_E_FAILURE;
}
WMA_LOGI("%s : LPHB configuration cmd id is %d", __func__,
lphb_conf_req->cmd);
switch (lphb_conf_req->cmd) {
case LPHB_SET_EN_PARAMS_INDID:
qdf_status = wma_lphb_conf_hbenable(wma_handle,
lphb_conf_req, true);
break;
case LPHB_SET_TCP_PARAMS_INDID:
qdf_status = wma_lphb_conf_tcp_params(wma_handle,
lphb_conf_req);
break;
case LPHB_SET_TCP_PKT_FILTER_INDID:
qdf_status = wma_lphb_conf_tcp_pkt_filter(wma_handle,
lphb_conf_req);
break;
case LPHB_SET_UDP_PARAMS_INDID:
qdf_status = wma_lphb_conf_udp_params(wma_handle,
lphb_conf_req);
break;
case LPHB_SET_UDP_PKT_FILTER_INDID:
qdf_status = wma_lphb_conf_udp_pkt_filter(wma_handle,
lphb_conf_req);
break;
case LPHB_SET_NETWORK_INFO_INDID:
default:
break;
}
qdf_mem_free(lphb_conf_req);
return qdf_status;
}
#endif /* FEATURE_WLAN_LPHB */
/**
* wma_process_dhcp_ind() - process dhcp indication from SME
* @wma_handle: wma handle
@@ -1337,56 +990,6 @@ QDF_STATUS wma_unified_fw_profiling_cmd(wmi_unified_t wmi_handle,
return QDF_STATUS_SUCCESS;
}
#ifdef FEATURE_WLAN_LPHB
/**
* wma_lphb_handler() - send LPHB indication to SME
* @wma: wma handle
* @event: event handler
*
* Return: 0 for success or error code
*/
static int wma_lphb_handler(tp_wma_handle wma, uint8_t *event)
{
wmi_hb_ind_event_fixed_param *hb_fp;
tSirLPHBInd *slphb_indication;
QDF_STATUS qdf_status;
struct scheduler_msg sme_msg = { 0 };
hb_fp = (wmi_hb_ind_event_fixed_param *) event;
if (!hb_fp) {
WMA_LOGE("Invalid wmi_hb_ind_event_fixed_param buffer");
return -EINVAL;
}
WMA_LOGD("lphb indication received with vdev_id=%d, session=%d, reason=%d",
hb_fp->vdev_id, hb_fp->session, hb_fp->reason);
slphb_indication = (tSirLPHBInd *) qdf_mem_malloc(sizeof(tSirLPHBInd));
if (!slphb_indication) {
WMA_LOGE("Invalid LPHB indication buffer");
return -ENOMEM;
}
slphb_indication->sessionIdx = hb_fp->session;
slphb_indication->protocolType = hb_fp->reason;
slphb_indication->eventReason = hb_fp->reason;
sme_msg.type = eWNI_SME_LPHB_IND;
sme_msg.bodyptr = slphb_indication;
sme_msg.bodyval = 0;
qdf_status = scheduler_post_msg(QDF_MODULE_ID_SME, &sme_msg);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
WMA_LOGE("Fail to post eWNI_SME_LPHB_IND msg to SME");
qdf_mem_free(slphb_indication);
return -EINVAL;
}
return 0;
}
#endif /* FEATURE_WLAN_LPHB */
/**
* wmi_unified_nat_keepalive_enable() - enable NAT keepalive filter
* @wma: wma handle
@@ -3253,12 +2856,6 @@ int wma_wow_wakeup_host_event(void *handle, uint8_t *event,
wow_buf_pkt_len);
break;
#ifdef FEATURE_WLAN_LPHB
case WOW_REASON_WLAN_HB:
wma_lphb_handler(wma, (uint8_t *) param_buf->hb_indevt);
break;
#endif /* FEATURE_WLAN_LPHB */
case WOW_REASON_HTT_EVENT:
break;

Datei anzeigen

@@ -6658,13 +6658,6 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, struct scheduler_msg *msg)
(tSirTxPowerLimit *) msg->bodyptr);
qdf_mem_free(msg->bodyptr);
break;
#ifdef FEATURE_WLAN_LPHB
case WMA_LPHB_CONF_REQ:
wma_process_lphb_conf_req(wma_handle,
(tSirLPHBReq *) msg->bodyptr);
break;
#endif /* FEATURE_WLAN_LPHB */
#ifdef FEATURE_WLAN_CH_AVOID
case WMA_CH_AVOID_UPDATE_REQ:
wma_process_ch_avoid_update_req(wma_handle,