qcacld-3.0: Remove kernel includes from datapath
To abstract kernel header inclusion, create new QDF APIs for all IPA APIs and redirect all IPA API calls through QDF interfaces. Change-Id: I7bff975ad7cb32fc128320c124633594471e0a1f CRs-Fixed: 2098903
This commit is contained in:
@@ -61,7 +61,6 @@
|
|||||||
#include <ol_ctrl_txrx_api.h>
|
#include <ol_ctrl_txrx_api.h>
|
||||||
#include <ol_txrx_peer_find.h>
|
#include <ol_txrx_peer_find.h>
|
||||||
#include <qdf_nbuf.h>
|
#include <qdf_nbuf.h>
|
||||||
#include <linux/ieee80211.h>
|
|
||||||
#include <qdf_util.h>
|
#include <qdf_util.h>
|
||||||
#include <athdefs.h>
|
#include <athdefs.h>
|
||||||
#include <qdf_mem.h>
|
#include <qdf_mem.h>
|
||||||
|
@@ -30,8 +30,6 @@
|
|||||||
#include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
|
#include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
|
||||||
#include <qdf_mem.h> /* qdf_mem_malloc */
|
#include <qdf_mem.h> /* qdf_mem_malloc */
|
||||||
|
|
||||||
#include <linux/ieee80211.h> /* IEEE80211_SEQ_MAX */
|
|
||||||
|
|
||||||
/* external interfaces */
|
/* external interfaces */
|
||||||
#include <ol_txrx_api.h> /* ol_txrx_pdev_handle */
|
#include <ol_txrx_api.h> /* ol_txrx_pdev_handle */
|
||||||
#include <ol_txrx_htt_api.h> /* ol_rx_addba_handler, etc. */
|
#include <ol_txrx_htt_api.h> /* ol_rx_addba_handler, etc. */
|
||||||
|
@@ -33,7 +33,6 @@
|
|||||||
|
|
||||||
#include <cds_queue.h> /* TAILQ */
|
#include <cds_queue.h> /* TAILQ */
|
||||||
#ifdef QCA_COMPUTE_TX_DELAY
|
#ifdef QCA_COMPUTE_TX_DELAY
|
||||||
#include <linux/ieee80211.h> /* ieee80211_frame, etc. */
|
|
||||||
#include <enet.h> /* ethernet_hdr_t, etc. */
|
#include <enet.h> /* ethernet_hdr_t, etc. */
|
||||||
#include <ipv6_defs.h> /* ipv6_traffic_class */
|
#include <ipv6_defs.h> /* ipv6_traffic_class */
|
||||||
#endif
|
#endif
|
||||||
|
@@ -37,7 +37,6 @@
|
|||||||
|
|
||||||
#include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
|
#include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
|
||||||
#include <cds_ieee80211_common.h> /* ieee80211_frame */
|
#include <cds_ieee80211_common.h> /* ieee80211_frame */
|
||||||
#include <linux/net.h> /* struct llc, struct ether_header, etc. */
|
|
||||||
#include <ol_txrx_internal.h> /* TXRX_ASSERT1 */
|
#include <ol_txrx_internal.h> /* TXRX_ASSERT1 */
|
||||||
#include <ol_txrx_encap.h> /* struct ol_rx_decap_info_t */
|
#include <ol_txrx_encap.h> /* struct ol_rx_decap_info_t */
|
||||||
|
|
||||||
|
@@ -39,7 +39,6 @@
|
|||||||
#include <ol_txrx_dbg.h>
|
#include <ol_txrx_dbg.h>
|
||||||
#include <enet.h> /* ETHERNET_HDR_LEN, etc. */
|
#include <enet.h> /* ETHERNET_HDR_LEN, etc. */
|
||||||
#include <ipv4.h> /* IPV4_HDR_LEN, etc. */
|
#include <ipv4.h> /* IPV4_HDR_LEN, etc. */
|
||||||
#include <linux/ipv6.h> /* IPV6_HDR_LEN, etc. */
|
|
||||||
#include <ip_prot.h> /* IP_PROTOCOL_TCP, etc. */
|
#include <ip_prot.h> /* IP_PROTOCOL_TCP, etc. */
|
||||||
|
|
||||||
#ifdef ATH_11AC_TXCOMPACT
|
#ifdef ATH_11AC_TXCOMPACT
|
||||||
|
@@ -303,39 +303,45 @@ QDF_STATUS ol_txrx_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb,
|
|||||||
{
|
{
|
||||||
ol_txrx_pdev_handle pdev = (ol_txrx_pdev_handle)ppdev;
|
ol_txrx_pdev_handle pdev = (ol_txrx_pdev_handle)ppdev;
|
||||||
struct ol_txrx_ipa_resources *ipa_res = &pdev->ipa_resource;
|
struct ol_txrx_ipa_resources *ipa_res = &pdev->ipa_resource;
|
||||||
struct ipa_wdi_in_params pipe_in;
|
qdf_ipa_wdi_in_params_t pipe_in;
|
||||||
struct ipa_wdi_out_params pipe_out;
|
qdf_ipa_wdi_out_params_t pipe_out;
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
qdf_mem_zero(&pipe_in, sizeof(struct ipa_wdi_in_params));
|
qdf_mem_zero(&pipe_in, sizeof(pipe_in));
|
||||||
qdf_mem_zero(&pipe_out, sizeof(struct ipa_wdi_out_params));
|
qdf_mem_zero(&pipe_out, sizeof(pipe_out));
|
||||||
|
|
||||||
|
|
||||||
/* TX PIPE */
|
/* TX PIPE */
|
||||||
pipe_in.sys.ipa_ep_cfg.nat.nat_en = IPA_BYPASS_NAT;
|
QDF_IPA_PIPE_IN_NAT_EN(&pipe_in) = IPA_BYPASS_NAT;
|
||||||
pipe_in.sys.ipa_ep_cfg.hdr.hdr_len = OL_TXRX_IPA_UC_WLAN_TX_HDR_LEN;
|
QDF_IPA_PIPE_IN_HDR_LEN(&pipe_in) = OL_TXRX_IPA_UC_WLAN_TX_HDR_LEN;
|
||||||
pipe_in.sys.ipa_ep_cfg.hdr.hdr_ofst_pkt_size_valid = 1;
|
QDF_IPA_PIPE_IN_HDR_OFST_PKT_SIZE_VALID(&pipe_in) = 1;
|
||||||
pipe_in.sys.ipa_ep_cfg.hdr.hdr_ofst_pkt_size = 0;
|
QDF_IPA_PIPE_IN_HDR_OFST_PKT_SIZE(&pipe_in) = 0;
|
||||||
pipe_in.sys.ipa_ep_cfg.hdr.hdr_additional_const_len =
|
QDF_IPA_PIPE_IN_HDR_ADDITIONAL_CONST_LEN(&pipe_in) =
|
||||||
OL_TXRX_IPA_UC_WLAN_8023_HDR_SIZE;
|
OL_TXRX_IPA_UC_WLAN_8023_HDR_SIZE;
|
||||||
pipe_in.sys.ipa_ep_cfg.mode.mode = IPA_BASIC;
|
QDF_IPA_PIPE_IN_MODE(&pipe_in) = IPA_BASIC;
|
||||||
pipe_in.sys.client = IPA_CLIENT_WLAN1_CONS;
|
QDF_IPA_PIPE_IN_CLIENT(&pipe_in) = IPA_CLIENT_WLAN1_CONS;
|
||||||
pipe_in.sys.desc_fifo_sz = ipa_desc_size;
|
QDF_IPA_PIPE_IN_DESC_FIFO_SZ(&pipe_in) = ipa_desc_size;
|
||||||
pipe_in.sys.priv = ipa_priv;
|
QDF_IPA_PIPE_IN_PRIV(&pipe_in) = ipa_priv;
|
||||||
pipe_in.sys.ipa_ep_cfg.hdr_ext.hdr_little_endian = true;
|
QDF_IPA_PIPE_IN_HDR_LITTLE_ENDIAN(&pipe_in) = true;
|
||||||
pipe_in.sys.notify = ipa_i2w_cb;
|
QDF_IPA_PIPE_IN_NOTIFY(&pipe_in) = ipa_i2w_cb;
|
||||||
|
|
||||||
if (!is_rm_enabled) {
|
if (!is_rm_enabled) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
||||||
"%s: IPA RM DISABLED, IPA AWAKE", __func__);
|
"%s: IPA RM DISABLED, IPA AWAKE", __func__);
|
||||||
pipe_in.sys.keep_ipa_awake = true;
|
QDF_IPA_PIPE_IN_KEEP_IPA_AWAKE(&pipe_in) = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
pipe_in.u.dl.comp_ring_base_pa = ipa_res->tx_comp_ring_base_paddr;
|
QDF_IPA_PIPE_IN_DL_COMP_RING_BASE_PA(&pipe_in) =
|
||||||
pipe_in.u.dl.comp_ring_size = ipa_res->tx_comp_ring_size *
|
ipa_res->tx_comp_ring_base_paddr;
|
||||||
sizeof(qdf_dma_addr_t);
|
QDF_IPA_PIPE_IN_DL_COMP_RING_SIZE(&pipe_in) =
|
||||||
pipe_in.u.dl.ce_ring_base_pa = ipa_res->ce_sr_base_paddr;
|
ipa_res->tx_comp_ring_size * sizeof(qdf_dma_addr_t);
|
||||||
pipe_in.u.dl.ce_door_bell_pa = ipa_res->ce_reg_paddr;
|
QDF_IPA_PIPE_IN_DL_CE_RING_BASE_PA(&pipe_in) =
|
||||||
pipe_in.u.dl.ce_ring_size = ipa_res->ce_sr_ring_size;
|
ipa_res->ce_sr_base_paddr;
|
||||||
pipe_in.u.dl.num_tx_buffers = ipa_res->tx_num_alloc_buffer;
|
QDF_IPA_PIPE_IN_DL_CE_DOOR_BELL_PA(&pipe_in) = ipa_res->ce_reg_paddr;
|
||||||
|
QDF_IPA_PIPE_IN_DL_CE_RING_SIZE(&pipe_in) = ipa_res->ce_sr_ring_size;
|
||||||
|
QDF_IPA_PIPE_IN_DL_NUM_TX_BUFFERS(&pipe_in) =
|
||||||
|
ipa_res->tx_num_alloc_buffer;
|
||||||
|
|
||||||
/* Connect WDI IPA PIPE */
|
/* Connect WDI IPA PIPE */
|
||||||
ret = ipa_connect_wdi_pipe(&pipe_in, &pipe_out);
|
ret = ipa_connect_wdi_pipe(&pipe_in, &pipe_out);
|
||||||
@@ -347,52 +353,56 @@ QDF_STATUS ol_txrx_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb,
|
|||||||
|
|
||||||
/* Micro Controller Doorbell register */
|
/* Micro Controller Doorbell register */
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
||||||
"%s CONS DB pipe out 0x%x TX PIPE Handle 0x%x",
|
"%s CONS DB pipe out 0x%x TX PIPE Handle 0x%x", __func__,
|
||||||
__func__, (unsigned int)pipe_out.uc_door_bell_pa,
|
(unsigned int)QDF_IPA_PIPE_OUT_UC_DOOR_BELL_PA(&pipe_out),
|
||||||
pipe_out.clnt_hdl);
|
pipe_out.clnt_hdl);
|
||||||
ipa_res->tx_comp_doorbell_paddr = pipe_out.uc_door_bell_pa;
|
ipa_res->tx_comp_doorbell_paddr =
|
||||||
|
QDF_IPA_PIPE_OUT_UC_DOOR_BELL_PA(&pipe_out);
|
||||||
/* WLAN TX PIPE Handle */
|
/* WLAN TX PIPE Handle */
|
||||||
ipa_res->tx_pipe_handle = pipe_out.clnt_hdl;
|
ipa_res->tx_pipe_handle = QDF_IPA_PIPE_OUT_CLNT_HDL(&pipe_out);
|
||||||
*p_tx_pipe_handle = pipe_out.clnt_hdl;
|
*p_tx_pipe_handle = QDF_IPA_PIPE_OUT_CLNT_HDL(&pipe_out);
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
||||||
"TX: %s 0x%x, %s %d, %s 0x%x, %s 0x%x, %s %d, %sNB %d, %s 0x%x",
|
"TX: %s 0x%x, %s %d, %s 0x%x, %s 0x%x, %s %d, %sNB %d, %s 0x%x",
|
||||||
"comp_ring_base_pa",
|
"comp_ring_base_pa",
|
||||||
(unsigned int)pipe_in.u.dl.comp_ring_base_pa,
|
(unsigned int)QDF_IPA_PIPE_IN_DL_COMP_RING_BASE_PA(&pipe_in),
|
||||||
"comp_ring_size",
|
"comp_ring_size",
|
||||||
pipe_in.u.dl.comp_ring_size,
|
QDF_IPA_PIPE_IN_DL_COMP_RING_SIZE(&pipe_in),
|
||||||
"ce_ring_base_pa",
|
"ce_ring_base_pa",
|
||||||
(unsigned int)pipe_in.u.dl.ce_ring_base_pa,
|
(unsigned int)QDF_IPA_PIPE_IN_DL_CE_RING_BASE_PA(&pipe_in),
|
||||||
"ce_door_bell_pa",
|
"ce_door_bell_pa",
|
||||||
(unsigned int)pipe_in.u.dl.ce_door_bell_pa,
|
(unsigned int)QDF_IPA_PIPE_IN_DL_CE_DOOR_BELL_PA(&pipe_in),
|
||||||
"ce_ring_size",
|
"ce_ring_size",
|
||||||
pipe_in.u.dl.ce_ring_size,
|
QDF_IPA_PIPE_IN_DL_CE_RING_SIZE(&pipe_in),
|
||||||
"num_tx_buffers",
|
"num_tx_buffers",
|
||||||
pipe_in.u.dl.num_tx_buffers,
|
QDF_IPA_PIPE_IN_DL_NUM_TX_BUFFERS(&pipe_in),
|
||||||
"tx_comp_doorbell_paddr",
|
"tx_comp_doorbell_paddr",
|
||||||
(unsigned int)ipa_res->tx_comp_doorbell_paddr);
|
(unsigned int)ipa_res->tx_comp_doorbell_paddr);
|
||||||
|
|
||||||
/* RX PIPE */
|
/* RX PIPE */
|
||||||
pipe_in.sys.ipa_ep_cfg.nat.nat_en = IPA_BYPASS_NAT;
|
QDF_IPA_PIPE_IN_NAT_EN(&pipe_in) = IPA_BYPASS_NAT;
|
||||||
pipe_in.sys.ipa_ep_cfg.hdr.hdr_len = OL_TXRX_IPA_UC_WLAN_RX_HDR_LEN;
|
QDF_IPA_PIPE_IN_HDR_LEN(&pipe_in) = OL_TXRX_IPA_UC_WLAN_RX_HDR_LEN;
|
||||||
pipe_in.sys.ipa_ep_cfg.hdr.hdr_ofst_metadata_valid = 0;
|
QDF_IPA_PIPE_IN_HDR_OFST_METADATA_VALID(&pipe_in) = 0;
|
||||||
pipe_in.sys.ipa_ep_cfg.hdr.hdr_metadata_reg_valid = 1;
|
QDF_IPA_PIPE_IN_HDR_METADATA_REG_VALID(&pipe_in) = 1;
|
||||||
pipe_in.sys.ipa_ep_cfg.mode.mode = IPA_BASIC;
|
QDF_IPA_PIPE_IN_MODE(&pipe_in) = IPA_BASIC;
|
||||||
pipe_in.sys.client = IPA_CLIENT_WLAN1_PROD;
|
QDF_IPA_PIPE_IN_CLIENT(&pipe_in) = IPA_CLIENT_WLAN1_PROD;
|
||||||
pipe_in.sys.desc_fifo_sz = ipa_desc_size + sizeof(struct sps_iovec);
|
QDF_IPA_PIPE_IN_DESC_FIFO_SZ(&pipe_in) =
|
||||||
pipe_in.sys.notify = ipa_w2i_cb;
|
ipa_desc_size + sizeof(struct sps_iovec);
|
||||||
|
QDF_IPA_PIPE_IN_NOTIFY(&pipe_in) = ipa_w2i_cb;
|
||||||
if (!is_rm_enabled) {
|
if (!is_rm_enabled) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
||||||
"%s: IPA RM DISABLED, IPA AWAKE", __func__);
|
"%s: IPA RM DISABLED, IPA AWAKE", __func__);
|
||||||
pipe_in.sys.keep_ipa_awake = true;
|
QDF_IPA_PIPE_IN_KEEP_IPA_AWAKE(&pipe_in) = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
pipe_in.u.ul.rdy_ring_base_pa = ipa_res->rx_rdy_ring_base_paddr;
|
QDF_IPA_PIPE_IN_UL_RDY_RING_BASE_PA(&pipe_in) =
|
||||||
pipe_in.u.ul.rdy_ring_size = ipa_res->rx_rdy_ring_size;
|
ipa_res->rx_rdy_ring_base_paddr;
|
||||||
pipe_in.u.ul.rdy_ring_rp_pa = ipa_res->rx_proc_done_idx_paddr;
|
QDF_IPA_PIPE_IN_UL_RDY_RING_SIZE(&pipe_in) = ipa_res->rx_rdy_ring_size;
|
||||||
|
QDF_IPA_PIPE_IN_UL_RDY_RING_RP_PA(&pipe_in) =
|
||||||
|
ipa_res->rx_proc_done_idx_paddr;
|
||||||
OL_TXRX_IPA_WDI2_SET(pipe_in, ipa_res);
|
OL_TXRX_IPA_WDI2_SET(pipe_in, ipa_res);
|
||||||
|
|
||||||
#ifdef FEATURE_METERING
|
#ifdef FEATURE_METERING
|
||||||
pipe_in.wdi_notify = ipa_wdi_meter_notifier_cb;
|
QDF_IPA_PIPE_IN_WDI_NOTIFY(&pipe_in) = ipa_wdi_meter_notifier_cb;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ret = ipa_connect_wdi_pipe(&pipe_in, &pipe_out);
|
ret = ipa_connect_wdi_pipe(&pipe_in, &pipe_out);
|
||||||
@@ -401,17 +411,18 @@ QDF_STATUS ol_txrx_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb,
|
|||||||
"ipa_connect_wdi_pipe: Rx pipe setup failed: ret=%d", ret);
|
"ipa_connect_wdi_pipe: Rx pipe setup failed: ret=%d", ret);
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
ipa_res->rx_ready_doorbell_paddr = pipe_out.uc_door_bell_pa;
|
ipa_res->rx_ready_doorbell_paddr =
|
||||||
ipa_res->rx_pipe_handle = pipe_out.clnt_hdl;
|
QDF_IPA_PIPE_OUT_UC_DOOR_BELL_PA(&pipe_out);
|
||||||
*p_rx_pipe_handle = pipe_out.clnt_hdl;
|
ipa_res->rx_pipe_handle = QDF_IPA_PIPE_OUT_CLNT_HDL(&pipe_out);
|
||||||
|
*p_rx_pipe_handle = QDF_IPA_PIPE_OUT_CLNT_HDL(&pipe_out);
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
||||||
"RX: %s 0x%x, %s %d, %s 0x%x, %s 0x%x",
|
"RX: %s 0x%x, %s %d, %s 0x%x, %s 0x%x",
|
||||||
"rdy_ring_base_pa",
|
"rdy_ring_base_pa",
|
||||||
(unsigned int)pipe_in.u.ul.rdy_ring_base_pa,
|
(unsigned int)QDF_IPA_PIPE_IN_UL_RDY_RING_BASE_PA(&pipe_in),
|
||||||
"rdy_ring_size",
|
"rdy_ring_size",
|
||||||
pipe_in.u.ul.rdy_ring_size,
|
QDF_IPA_PIPE_IN_UL_RDY_RING_SIZE(&pipe_in),
|
||||||
"rdy_ring_rp_pa",
|
"rdy_ring_rp_pa",
|
||||||
(unsigned int)pipe_in.u.ul.rdy_ring_rp_pa,
|
(unsigned int)QDF_IPA_PIPE_IN_UL_RDY_RING_RP_PA(&pipe_in),
|
||||||
"rx_ready_doorbell_paddr",
|
"rx_ready_doorbell_paddr",
|
||||||
(unsigned int)ipa_res->rx_ready_doorbell_paddr);
|
(unsigned int)ipa_res->rx_ready_doorbell_paddr);
|
||||||
|
|
||||||
@@ -462,13 +473,13 @@ QDF_STATUS ol_txrx_ipa_cleanup(uint32_t tx_pipe_handle, uint32_t rx_pipe_handle)
|
|||||||
*/
|
*/
|
||||||
static QDF_STATUS ol_txrx_ipa_remove_header(char *name)
|
static QDF_STATUS ol_txrx_ipa_remove_header(char *name)
|
||||||
{
|
{
|
||||||
struct ipa_ioc_get_hdr hdrlookup;
|
qdf_ipa_ioc_get_hdr_t hdrlookup;
|
||||||
int ret = 0, len;
|
int ret = 0, len;
|
||||||
struct ipa_ioc_del_hdr *ipa_hdr;
|
qdf_ipa_ioc_del_hdr_t *ipa_hdr;
|
||||||
|
|
||||||
qdf_mem_zero(&hdrlookup, sizeof(hdrlookup));
|
qdf_mem_zero(&hdrlookup, sizeof(hdrlookup));
|
||||||
strlcpy(hdrlookup.name, name, sizeof(hdrlookup.name));
|
strlcpy(hdrlookup.name, name, sizeof(hdrlookup.name));
|
||||||
ret = ipa_get_hdr(&hdrlookup);
|
ret = qdf_ipa_get_hdr(&hdrlookup);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
||||||
"Hdr deleted already %s, %d", name, ret);
|
"Hdr deleted already %s, %d", name, ret);
|
||||||
@@ -477,18 +488,18 @@ static QDF_STATUS ol_txrx_ipa_remove_header(char *name)
|
|||||||
|
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG, "hdl: 0x%x",
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG, "hdl: 0x%x",
|
||||||
hdrlookup.hdl);
|
hdrlookup.hdl);
|
||||||
len = sizeof(struct ipa_ioc_del_hdr) + sizeof(struct ipa_hdr_del) * 1;
|
len = sizeof(qdf_ipa_ioc_del_hdr_t) + sizeof(qdf_ipa_hdr_del_t) * 1;
|
||||||
ipa_hdr = (struct ipa_ioc_del_hdr *)qdf_mem_malloc(len);
|
ipa_hdr = (qdf_ipa_ioc_del_hdr_t *)qdf_mem_malloc(len);
|
||||||
if (ipa_hdr == NULL) {
|
if (ipa_hdr == NULL) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
||||||
"ipa_hdr allocation failed");
|
"ipa_hdr allocation failed");
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
ipa_hdr->num_hdls = 1;
|
QDF_IPA_IOC_DEL_HDR_NUM_HDRS(ipa_hdr) = 1;
|
||||||
ipa_hdr->commit = 0;
|
QDF_IPA_IOC_DEL_HDR_COMMIT(ipa_hdr) = 0;
|
||||||
ipa_hdr->hdl[0].hdl = hdrlookup.hdl;
|
QDF_IPA_IOC_DEL_HDR_HDL(ipa_hdr) = QDF_IPA_IOC_GET_HDR_HDL(&hdrlookup);
|
||||||
ipa_hdr->hdl[0].status = -1;
|
QDF_IPA_IOC_DEL_HDR_STATUS(ipa_hdr) = -1;
|
||||||
ret = ipa_del_hdr(ipa_hdr);
|
ret = qdf_ipa_del_hdr(ipa_hdr);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
||||||
"Delete header failed: %d", ret);
|
"Delete header failed: %d", ret);
|
||||||
@@ -511,7 +522,7 @@ static QDF_STATUS ol_txrx_ipa_remove_header(char *name)
|
|||||||
static int ol_txrx_ipa_add_header_info(char *ifname, uint8_t *mac_addr,
|
static int ol_txrx_ipa_add_header_info(char *ifname, uint8_t *mac_addr,
|
||||||
uint8_t session_id, bool is_ipv6_enabled)
|
uint8_t session_id, bool is_ipv6_enabled)
|
||||||
{
|
{
|
||||||
struct ipa_ioc_add_hdr *ipa_hdr = NULL;
|
qdf_ipa_ioc_add_hdr_t *ipa_hdr = NULL;
|
||||||
int ret = -EINVAL;
|
int ret = -EINVAL;
|
||||||
struct ol_txrx_ipa_uc_tx_hdr *uc_tx_hdr = NULL;
|
struct ol_txrx_ipa_uc_tx_hdr *uc_tx_hdr = NULL;
|
||||||
|
|
||||||
@@ -519,8 +530,8 @@ static int ol_txrx_ipa_add_header_info(char *ifname, uint8_t *mac_addr,
|
|||||||
"Add Partial hdr: %s, %pM", ifname, mac_addr);
|
"Add Partial hdr: %s, %pM", ifname, mac_addr);
|
||||||
|
|
||||||
/* dynamically allocate the memory to add the hdrs */
|
/* dynamically allocate the memory to add the hdrs */
|
||||||
ipa_hdr = qdf_mem_malloc(sizeof(struct ipa_ioc_add_hdr)
|
ipa_hdr = qdf_mem_malloc(sizeof(qdf_ipa_ioc_add_hdr_t)
|
||||||
+ sizeof(struct ipa_hdr_add));
|
+ sizeof(qdf_ipa_hdr_add_t));
|
||||||
if (!ipa_hdr) {
|
if (!ipa_hdr) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
||||||
"%s: ipa_hdr allocation failed", ifname);
|
"%s: ipa_hdr allocation failed", ifname);
|
||||||
@@ -528,26 +539,28 @@ static int ol_txrx_ipa_add_header_info(char *ifname, uint8_t *mac_addr,
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
ipa_hdr->commit = 0;
|
QDF_IPA_IOC_ADD_HDR_COMMIT(ipa_hdr) = 0;
|
||||||
ipa_hdr->num_hdrs = 1;
|
QDF_IPA_IOC_ADD_HDR_NUM_HDRS(ipa_hdr) = 1;
|
||||||
|
|
||||||
uc_tx_hdr = (struct ol_txrx_ipa_uc_tx_hdr *)ipa_hdr->hdr[0].hdr;
|
uc_tx_hdr = (struct ol_txrx_ipa_uc_tx_hdr *)
|
||||||
|
QDF_IPA_IOC_ADD_HDR_HDR(ipa_hdr);
|
||||||
memcpy(uc_tx_hdr, &ipa_uc_tx_hdr, OL_TXRX_IPA_UC_WLAN_TX_HDR_LEN);
|
memcpy(uc_tx_hdr, &ipa_uc_tx_hdr, OL_TXRX_IPA_UC_WLAN_TX_HDR_LEN);
|
||||||
memcpy(uc_tx_hdr->eth.h_source, mac_addr, ETH_ALEN);
|
memcpy(uc_tx_hdr->eth.h_source, mac_addr, ETH_ALEN);
|
||||||
uc_tx_hdr->ipa_hd.vdev_id = session_id;
|
uc_tx_hdr->ipa_hd.vdev_id = session_id;
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
||||||
"ifname=%s, vdev_id=%d",
|
"ifname=%s, vdev_id=%d",
|
||||||
ifname, uc_tx_hdr->ipa_hd.vdev_id);
|
ifname, uc_tx_hdr->ipa_hd.vdev_id);
|
||||||
snprintf(ipa_hdr->hdr[0].name, IPA_RESOURCE_NAME_MAX, "%s%s",
|
snprintf(QDF_IPA_IOC_ADD_HDR_NAME(ipa_hdr), IPA_RESOURCE_NAME_MAX,
|
||||||
ifname, OL_TXRX_IPA_IPV4_NAME_EXT);
|
"%s%s", ifname, OL_TXRX_IPA_IPV4_NAME_EXT);
|
||||||
ipa_hdr->hdr[0].hdr_len = OL_TXRX_IPA_UC_WLAN_TX_HDR_LEN;
|
QDF_IPA_IOC_ADD_HDR_HDR_LEN(ipa_hdr) = OL_TXRX_IPA_UC_WLAN_TX_HDR_LEN;
|
||||||
ipa_hdr->hdr[0].type = IPA_HDR_L2_ETHERNET_II;
|
QDF_IPA_IOC_ADD_HDR_TYPE(ipa_hdr) = IPA_HDR_L2_ETHERNET_II;
|
||||||
ipa_hdr->hdr[0].is_partial = 1;
|
QDF_IPA_IOC_ADD_HDR_IS_PARTIAL(ipa_hdr) = 1;
|
||||||
ipa_hdr->hdr[0].hdr_hdl = 0;
|
QDF_IPA_IOC_ADD_HDR_HDR_HDL(ipa_hdr) = 0;
|
||||||
ipa_hdr->hdr[0].is_eth2_ofst_valid = 1;
|
QDF_IPA_IOC_ADD_HDR_IS_ETH2_OFST_VALID(ipa_hdr) = 1;
|
||||||
ipa_hdr->hdr[0].eth2_ofst = OL_TXRX_IPA_UC_WLAN_HDR_DES_MAC_OFFSET;
|
QDF_IPA_IOC_ADD_HDR_ETH2_OFST(ipa_hdr) =
|
||||||
|
OL_TXRX_IPA_UC_WLAN_HDR_DES_MAC_OFFSET;
|
||||||
|
|
||||||
ret = ipa_add_hdr(ipa_hdr);
|
ret = qdf_ipa_add_hdr(ipa_hdr);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
||||||
"%s IPv4 add hdr failed: %d", ifname, ret);
|
"%s IPv4 add hdr failed: %d", ifname, ret);
|
||||||
@@ -555,17 +568,20 @@ static int ol_txrx_ipa_add_header_info(char *ifname, uint8_t *mac_addr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
||||||
"%s: IPv4 hdr_hdl: 0x%x",
|
"%s: IPv4 hdr_hdl: 0x%x",
|
||||||
ipa_hdr->hdr[0].name, ipa_hdr->hdr[0].hdr_hdl);
|
QDF_IPA_IOC_ADD_HDR_NAME(ipa_hdr),
|
||||||
|
QDF_IPA_IOC_ADD_HDR_HDR_HDL(ipa_hdr));
|
||||||
|
|
||||||
if (is_ipv6_enabled) {
|
if (is_ipv6_enabled) {
|
||||||
snprintf(ipa_hdr->hdr[0].name, IPA_RESOURCE_NAME_MAX, "%s%s",
|
snprintf(QDF_IPA_IOC_ADD_HDR_NAME(ipa_hdr),
|
||||||
|
IPA_RESOURCE_NAME_MAX, "%s%s",
|
||||||
ifname, OL_TXRX_IPA_IPV6_NAME_EXT);
|
ifname, OL_TXRX_IPA_IPV6_NAME_EXT);
|
||||||
|
|
||||||
uc_tx_hdr = (struct ol_txrx_ipa_uc_tx_hdr *)ipa_hdr->hdr[0].hdr;
|
uc_tx_hdr = (struct ol_txrx_ipa_uc_tx_hdr *)
|
||||||
|
QDF_IPA_IOC_ADD_HDR_HDR(ipa_hdr);
|
||||||
uc_tx_hdr->eth.h_proto = cpu_to_be16(ETH_P_IPV6);
|
uc_tx_hdr->eth.h_proto = cpu_to_be16(ETH_P_IPV6);
|
||||||
|
|
||||||
ret = ipa_add_hdr(ipa_hdr);
|
ret = qdf_ipa_add_hdr(ipa_hdr);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
||||||
"%s: IPv6 add hdr failed: %d", ifname, ret);
|
"%s: IPv6 add hdr failed: %d", ifname, ret);
|
||||||
@@ -573,8 +589,9 @@ static int ol_txrx_ipa_add_header_info(char *ifname, uint8_t *mac_addr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
||||||
"%s: IPv6 hdr_hdl: 0x%x",
|
"%s: IPv6 hdr_hdl: 0x%x",
|
||||||
ipa_hdr->hdr[0].name, ipa_hdr->hdr[0].hdr_hdl);
|
QDF_IPA_IOC_ADD_HDR_NAME(ipa_hdr),
|
||||||
|
QDF_IPA_IOC_ADD_HDR_HDR_HDL(ipa_hdr));
|
||||||
}
|
}
|
||||||
|
|
||||||
qdf_mem_free(ipa_hdr);
|
qdf_mem_free(ipa_hdr);
|
||||||
@@ -603,15 +620,15 @@ end:
|
|||||||
* Return: 0 on success, negative errno on error
|
* Return: 0 on success, negative errno on error
|
||||||
*/
|
*/
|
||||||
static int ol_txrx_ipa_register_interface(char *ifname,
|
static int ol_txrx_ipa_register_interface(char *ifname,
|
||||||
enum ipa_client_type prod_client,
|
qdf_ipa_client_type_t prod_client,
|
||||||
enum ipa_client_type cons_client,
|
qdf_ipa_client_type_t cons_client,
|
||||||
uint8_t session_id,
|
uint8_t session_id,
|
||||||
bool is_ipv6_enabled)
|
bool is_ipv6_enabled)
|
||||||
{
|
{
|
||||||
struct ipa_tx_intf tx_intf;
|
qdf_ipa_tx_intf_t tx_intf;
|
||||||
struct ipa_rx_intf rx_intf;
|
qdf_ipa_rx_intf_t rx_intf;
|
||||||
struct ipa_ioc_tx_intf_prop *tx_prop = NULL;
|
qdf_ipa_ioc_tx_intf_prop_t *tx_prop = NULL;
|
||||||
struct ipa_ioc_rx_intf_prop *rx_prop = NULL;
|
qdf_ipa_ioc_rx_intf_prop_t *rx_prop = NULL;
|
||||||
|
|
||||||
char ipv4_hdr_name[IPA_RESOURCE_NAME_MAX];
|
char ipv4_hdr_name[IPA_RESOURCE_NAME_MAX];
|
||||||
char ipv6_hdr_name[IPA_RESOURCE_NAME_MAX];
|
char ipv6_hdr_name[IPA_RESOURCE_NAME_MAX];
|
||||||
@@ -624,7 +641,7 @@ static int ol_txrx_ipa_register_interface(char *ifname,
|
|||||||
|
|
||||||
/* Allocate TX properties for TOS categories, 1 each for IPv4 & IPv6 */
|
/* Allocate TX properties for TOS categories, 1 each for IPv4 & IPv6 */
|
||||||
tx_prop =
|
tx_prop =
|
||||||
qdf_mem_malloc(sizeof(struct ipa_ioc_tx_intf_prop) * num_prop);
|
qdf_mem_malloc(sizeof(qdf_ipa_ioc_tx_intf_prop_t) * num_prop);
|
||||||
if (!tx_prop) {
|
if (!tx_prop) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
||||||
"tx_prop allocation failed");
|
"tx_prop allocation failed");
|
||||||
@@ -633,7 +650,7 @@ static int ol_txrx_ipa_register_interface(char *ifname,
|
|||||||
|
|
||||||
/* Allocate RX properties, 1 each for IPv4 & IPv6 */
|
/* Allocate RX properties, 1 each for IPv4 & IPv6 */
|
||||||
rx_prop =
|
rx_prop =
|
||||||
qdf_mem_malloc(sizeof(struct ipa_ioc_rx_intf_prop) * num_prop);
|
qdf_mem_malloc(sizeof(qdf_ipa_ioc_rx_intf_prop_t) * num_prop);
|
||||||
if (!rx_prop) {
|
if (!rx_prop) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
||||||
"rx_prop allocation failed");
|
"rx_prop allocation failed");
|
||||||
@@ -648,52 +665,65 @@ static int ol_txrx_ipa_register_interface(char *ifname,
|
|||||||
snprintf(ipv6_hdr_name, IPA_RESOURCE_NAME_MAX, "%s%s",
|
snprintf(ipv6_hdr_name, IPA_RESOURCE_NAME_MAX, "%s%s",
|
||||||
ifname, OL_TXRX_IPA_IPV6_NAME_EXT);
|
ifname, OL_TXRX_IPA_IPV6_NAME_EXT);
|
||||||
|
|
||||||
rx_prop[IPA_IP_v4].ip = IPA_IP_v4;
|
QDF_IPA_IOC_RX_INTF_PROP_IP(&rx_prop[IPA_IP_v4]) = IPA_IP_v4;
|
||||||
rx_prop[IPA_IP_v4].src_pipe = prod_client;
|
QDF_IPA_IOC_RX_INTF_PROP_SRC_PIPE(&rx_prop[IPA_IP_v4]) = prod_client;
|
||||||
rx_prop[IPA_IP_v4].hdr_l2_type = IPA_HDR_L2_ETHERNET_II;
|
QDF_IPA_IOC_RX_INTF_PROP_HDR_L2_TYPE(&rx_prop[IPA_IP_v4]) =
|
||||||
rx_prop[IPA_IP_v4].attrib.attrib_mask = IPA_FLT_META_DATA;
|
IPA_HDR_L2_ETHERNET_II;
|
||||||
|
QDF_IPA_IOC_RX_INTF_PROP_ATTRIB_MASK(&rx_prop[IPA_IP_v4]) =
|
||||||
|
IPA_FLT_META_DATA;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Interface ID is 3rd byte in the CLD header. Add the meta data and
|
* Interface ID is 3rd byte in the CLD header. Add the meta data and
|
||||||
* mask to identify the interface in IPA hardware
|
* mask to identify the interface in IPA hardware
|
||||||
*/
|
*/
|
||||||
rx_prop[IPA_IP_v4].attrib.meta_data =
|
QDF_IPA_IOC_RX_INTF_PROP_META_DATA(&rx_prop[IPA_IP_v4]) =
|
||||||
htonl(session_id << 16);
|
htonl(session_id << 16);
|
||||||
rx_prop[IPA_IP_v4].attrib.meta_data_mask = htonl(0x00FF0000);
|
QDF_IPA_IOC_RX_INTF_PROP_META_DATA_MASK(&rx_prop[IPA_IP_v4]) =
|
||||||
|
htonl(0x00FF0000);
|
||||||
|
|
||||||
rx_intf.num_props++;
|
rx_intf.num_props++;
|
||||||
if (is_ipv6_enabled) {
|
if (is_ipv6_enabled) {
|
||||||
rx_prop[IPA_IP_v6].ip = IPA_IP_v6;
|
QDF_IPA_IOC_RX_INTF_PROP_IP(&rx_prop[IPA_IP_v6]) = IPA_IP_v6;
|
||||||
rx_prop[IPA_IP_v6].src_pipe = prod_client;
|
QDF_IPA_IOC_RX_INTF_PROP_SRC_PIPE(&rx_prop[IPA_IP_v6]) =
|
||||||
rx_prop[IPA_IP_v6].hdr_l2_type = IPA_HDR_L2_ETHERNET_II;
|
prod_client;
|
||||||
rx_prop[IPA_IP_v6].attrib.attrib_mask = IPA_FLT_META_DATA;
|
QDF_IPA_IOC_RX_INTF_PROP_HDR_L2_TYPE(&rx_prop[IPA_IP_v6]) =
|
||||||
rx_prop[IPA_IP_v6].attrib.meta_data =
|
IPA_HDR_L2_ETHERNET_II;
|
||||||
|
QDF_IPA_IOC_RX_INTF_PROP_ATTRIB_MASK(&rx_prop[IPA_IP_v6]) =
|
||||||
|
IPA_FLT_META_DATA;
|
||||||
|
QDF_IPA_IOC_RX_INTF_PROP_META_DATA(&rx_prop[IPA_IP_v6]) =
|
||||||
htonl(session_id << 16);
|
htonl(session_id << 16);
|
||||||
rx_prop[IPA_IP_v4].attrib.meta_data_mask = htonl(0x00FF0000);
|
QDF_IPA_IOC_RX_INTF_PROP_META_DATA_MASK(&rx_prop[IPA_IP_v6]) =
|
||||||
|
htonl(0x00FF0000);
|
||||||
|
|
||||||
rx_intf.num_props++;
|
rx_intf.num_props++;
|
||||||
}
|
}
|
||||||
|
|
||||||
tx_prop[IPA_IP_v4].ip = IPA_IP_v4;
|
QDF_IPA_IOC_TX_INTF_PROP_IP(&tx_prop[IPA_IP_v4]) = IPA_IP_v4;
|
||||||
tx_prop[IPA_IP_v4].hdr_l2_type = IPA_HDR_L2_ETHERNET_II;
|
QDF_IPA_IOC_TX_INTF_PROP_HDR_L2_TYPE(&tx_prop[IPA_IP_v4]) =
|
||||||
tx_prop[IPA_IP_v4].dst_pipe = IPA_CLIENT_WLAN1_CONS;
|
IPA_HDR_L2_ETHERNET_II;
|
||||||
tx_prop[IPA_IP_v4].alt_dst_pipe = cons_client;
|
QDF_IPA_IOC_TX_INTF_PROP_DST_PIPE(&tx_prop[IPA_IP_v4]) =
|
||||||
strlcpy(tx_prop[IPA_IP_v4].hdr_name, ipv4_hdr_name,
|
IPA_CLIENT_WLAN1_CONS;
|
||||||
IPA_RESOURCE_NAME_MAX);
|
QDF_IPA_IOC_TX_INTF_PROP_ALT_DST_PIPE(&tx_prop[IPA_IP_v4]) =
|
||||||
|
cons_client;
|
||||||
|
strlcpy(QDF_IPA_IOC_TX_INTF_PROP_HDR_NAME(&tx_prop[IPA_IP_v4]),
|
||||||
|
ipv4_hdr_name, IPA_RESOURCE_NAME_MAX);
|
||||||
tx_intf.num_props++;
|
tx_intf.num_props++;
|
||||||
|
|
||||||
if (is_ipv6_enabled) {
|
if (is_ipv6_enabled) {
|
||||||
tx_prop[IPA_IP_v6].ip = IPA_IP_v6;
|
QDF_IPA_IOC_TX_INTF_PROP_IP(&tx_prop[IPA_IP_v6]) = IPA_IP_v6;
|
||||||
tx_prop[IPA_IP_v6].hdr_l2_type = IPA_HDR_L2_ETHERNET_II;
|
QDF_IPA_IOC_TX_INTF_PROP_HDR_L2_TYPE(&tx_prop[IPA_IP_v6]) =
|
||||||
tx_prop[IPA_IP_v6].dst_pipe = IPA_CLIENT_WLAN1_CONS;
|
IPA_HDR_L2_ETHERNET_II;
|
||||||
tx_prop[IPA_IP_v6].alt_dst_pipe = cons_client;
|
QDF_IPA_IOC_TX_INTF_PROP_DST_PIPE(&tx_prop[IPA_IP_v6]) =
|
||||||
strlcpy(tx_prop[IPA_IP_v6].hdr_name, ipv6_hdr_name,
|
IPA_CLIENT_WLAN1_CONS;
|
||||||
IPA_RESOURCE_NAME_MAX);
|
QDF_IPA_IOC_TX_INTF_PROP_ALT_DST_PIPE(&tx_prop[IPA_IP_v6]) =
|
||||||
|
cons_client;
|
||||||
|
strlcpy(QDF_IPA_IOC_TX_INTF_PROP_HDR_NAME(&tx_prop[IPA_IP_v6]),
|
||||||
|
ipv6_hdr_name, IPA_RESOURCE_NAME_MAX);
|
||||||
tx_intf.num_props++;
|
tx_intf.num_props++;
|
||||||
}
|
}
|
||||||
|
|
||||||
tx_intf.prop = tx_prop;
|
QDF_IPA_TX_INTF_PROP(&tx_intf) = tx_prop;
|
||||||
rx_intf.prop = rx_prop;
|
QDF_IPA_RX_INTF_PROP(&rx_intf) = rx_prop;
|
||||||
|
|
||||||
/* Call the ipa api to register interface */
|
/* Call the ipa api to register interface */
|
||||||
ret = ipa_register_intf(ifname, &tx_intf, &rx_intf);
|
ret = ipa_register_intf(ifname, &tx_intf, &rx_intf);
|
||||||
@@ -716,8 +746,8 @@ register_interface_fail:
|
|||||||
* Return: QDF_STATUS
|
* Return: QDF_STATUS
|
||||||
*/
|
*/
|
||||||
QDF_STATUS ol_txrx_ipa_setup_iface(char *ifname, uint8_t *mac_addr,
|
QDF_STATUS ol_txrx_ipa_setup_iface(char *ifname, uint8_t *mac_addr,
|
||||||
enum ipa_client_type prod_client,
|
qdf_ipa_client_type_t prod_client,
|
||||||
enum ipa_client_type cons_client,
|
qdf_ipa_client_type_t cons_client,
|
||||||
uint8_t session_id, bool is_ipv6_enabled)
|
uint8_t session_id, bool is_ipv6_enabled)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
@@ -728,7 +758,9 @@ QDF_STATUS ol_txrx_ipa_setup_iface(char *ifname, uint8_t *mac_addr,
|
|||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
|
||||||
/* Configure the TX and RX pipes filter rules */
|
/* Configure the TX and RX pipes filter rules */
|
||||||
ret = ol_txrx_ipa_register_interface(ifname, prod_client, cons_client,
|
ret = ol_txrx_ipa_register_interface(ifname,
|
||||||
|
prod_client,
|
||||||
|
cons_client,
|
||||||
session_id, is_ipv6_enabled);
|
session_id, is_ipv6_enabled);
|
||||||
if (ret)
|
if (ret)
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
@@ -759,7 +791,7 @@ QDF_STATUS ol_txrx_ipa_cleanup_iface(char *ifname, bool is_ipv6_enabled)
|
|||||||
ol_txrx_ipa_remove_header(name_ipa);
|
ol_txrx_ipa_remove_header(name_ipa);
|
||||||
}
|
}
|
||||||
/* unregister the interface with IPA */
|
/* unregister the interface with IPA */
|
||||||
ret = ipa_deregister_intf(ifname);
|
ret = qdf_ipa_deregister_intf(ifname);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
|
||||||
"%s: ipa_deregister_intf fail: %d",
|
"%s: ipa_deregister_intf fail: %d",
|
||||||
@@ -885,11 +917,12 @@ QDF_STATUS ol_txrx_ipa_disable_pipes(struct cdp_pdev *ppdev)
|
|||||||
QDF_STATUS ol_txrx_ipa_set_perf_level(int client,
|
QDF_STATUS ol_txrx_ipa_set_perf_level(int client,
|
||||||
uint32_t max_supported_bw_mbps)
|
uint32_t max_supported_bw_mbps)
|
||||||
{
|
{
|
||||||
struct ipa_rm_perf_profile profile;
|
qdf_ipa_rm_perf_profile_t profile;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
profile.max_supported_bandwidth_mbps = max_supported_bw_mbps;
|
QDF_IPA_RM_PERF_PROFILE_MAX_SUPPORTED_BANDWIDTH_MBPS(&profile) =
|
||||||
result = ipa_rm_set_perf_profile(client, &profile);
|
max_supported_bw_mbps;
|
||||||
|
result = qdf_ipa_rm_set_perf_profile(client, &profile);
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
||||||
|
@@ -117,8 +117,8 @@ QDF_STATUS ol_txrx_ipa_setup(struct cdp_pdev *pdev, void *ipa_i2w_cb,
|
|||||||
QDF_STATUS ol_txrx_ipa_cleanup(uint32_t tx_pipe_handle,
|
QDF_STATUS ol_txrx_ipa_cleanup(uint32_t tx_pipe_handle,
|
||||||
uint32_t rx_pipe_handle);
|
uint32_t rx_pipe_handle);
|
||||||
QDF_STATUS ol_txrx_ipa_setup_iface(char *ifname, uint8_t *mac_addr,
|
QDF_STATUS ol_txrx_ipa_setup_iface(char *ifname, uint8_t *mac_addr,
|
||||||
enum ipa_client_type prod_client,
|
qdf_ipa_client_type_t prod_client,
|
||||||
enum ipa_client_type cons_client,
|
qdf_ipa_client_type_t cons_client,
|
||||||
uint8_t session_id, bool is_ipv6_enabled);
|
uint8_t session_id, bool is_ipv6_enabled);
|
||||||
QDF_STATUS ol_txrx_ipa_cleanup_iface(char *ifname, bool is_ipv6_enabled);
|
QDF_STATUS ol_txrx_ipa_cleanup_iface(char *ifname, bool is_ipv6_enabled);
|
||||||
QDF_STATUS ol_txrx_ipa_enable_pipes(struct cdp_pdev *pdev);
|
QDF_STATUS ol_txrx_ipa_enable_pipes(struct cdp_pdev *pdev);
|
||||||
|
@@ -35,18 +35,11 @@
|
|||||||
#ifdef IPA_OFFLOAD
|
#ifdef IPA_OFFLOAD
|
||||||
|
|
||||||
/* Include Files */
|
/* Include Files */
|
||||||
#include <linux/ipa.h>
|
#include <qdf_ipa.h>
|
||||||
#include <wlan_hdd_includes.h>
|
#include <wlan_hdd_includes.h>
|
||||||
#include <wlan_hdd_ipa.h>
|
#include <wlan_hdd_ipa.h>
|
||||||
|
|
||||||
#include <linux/etherdevice.h>
|
|
||||||
#include <linux/atomic.h>
|
|
||||||
#include <linux/netdevice.h>
|
|
||||||
#include <linux/skbuff.h>
|
|
||||||
#include <linux/list.h>
|
|
||||||
#include <linux/debugfs.h>
|
|
||||||
#include <linux/inetdevice.h>
|
#include <linux/inetdevice.h>
|
||||||
#include <linux/ip.h>
|
|
||||||
#include <wlan_hdd_softap_tx_rx.h>
|
#include <wlan_hdd_softap_tx_rx.h>
|
||||||
#include <ol_txrx.h>
|
#include <ol_txrx.h>
|
||||||
#include <cdp_txrx_peer_ops.h>
|
#include <cdp_txrx_peer_ops.h>
|
||||||
@@ -213,13 +206,13 @@ struct hdd_ipa_pm_tx_cb {
|
|||||||
bool exception;
|
bool exception;
|
||||||
struct hdd_adapter *adapter;
|
struct hdd_adapter *adapter;
|
||||||
struct hdd_ipa_iface_context *iface_context;
|
struct hdd_ipa_iface_context *iface_context;
|
||||||
struct ipa_rx_data *ipa_tx_desc;
|
qdf_ipa_rx_data_t *ipa_tx_desc;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hdd_ipa_sys_pipe {
|
struct hdd_ipa_sys_pipe {
|
||||||
uint32_t conn_hdl;
|
uint32_t conn_hdl;
|
||||||
uint8_t conn_hdl_valid;
|
uint8_t conn_hdl_valid;
|
||||||
struct ipa_sys_connect_params ipa_sys_params;
|
qdf_ipa_sys_connect_params_t ipa_sys_params;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hdd_ipa_iface_stats {
|
struct hdd_ipa_iface_stats {
|
||||||
@@ -237,8 +230,8 @@ struct hdd_ipa_iface_context {
|
|||||||
struct hdd_adapter *adapter;
|
struct hdd_adapter *adapter;
|
||||||
void *tl_context;
|
void *tl_context;
|
||||||
|
|
||||||
enum ipa_client_type cons_client;
|
qdf_ipa_client_type_t cons_client;
|
||||||
enum ipa_client_type prod_client;
|
qdf_ipa_client_type_t prod_client;
|
||||||
|
|
||||||
uint8_t iface_id; /* This iface ID */
|
uint8_t iface_id; /* This iface ID */
|
||||||
uint8_t sta_id; /* This iface station ID */
|
uint8_t sta_id; /* This iface station ID */
|
||||||
@@ -313,7 +306,7 @@ struct ipa_uc_fw_stats {
|
|||||||
struct ipa_uc_pending_event {
|
struct ipa_uc_pending_event {
|
||||||
qdf_list_node_t node;
|
qdf_list_node_t node;
|
||||||
struct hdd_adapter *adapter;
|
struct hdd_adapter *adapter;
|
||||||
enum ipa_wlan_event type;
|
qdf_ipa_wlan_event_t type;
|
||||||
uint8_t sta_id;
|
uint8_t sta_id;
|
||||||
uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
|
uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
|
||||||
};
|
};
|
||||||
@@ -325,7 +318,7 @@ struct ipa_uc_pending_event {
|
|||||||
*/
|
*/
|
||||||
struct uc_rm_work_struct {
|
struct uc_rm_work_struct {
|
||||||
struct work_struct work;
|
struct work_struct work;
|
||||||
enum ipa_rm_event event;
|
qdf_ipa_rm_event_t event;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -395,7 +388,7 @@ struct hdd_ipa_tx_desc {
|
|||||||
struct list_head link;
|
struct list_head link;
|
||||||
void *priv;
|
void *priv;
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
struct ipa_rx_data *ipa_tx_desc_ptr;
|
qdf_ipa_rx_data_t *ipa_tx_desc_ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hdd_ipa_priv {
|
struct hdd_ipa_priv {
|
||||||
@@ -459,8 +452,8 @@ struct hdd_ipa_priv {
|
|||||||
qdf_mc_timer_t rt_debug_timer;
|
qdf_mc_timer_t rt_debug_timer;
|
||||||
struct uc_rt_debug_info rt_bug_buffer[HDD_IPA_UC_RT_DEBUG_BUF_COUNT];
|
struct uc_rt_debug_info rt_bug_buffer[HDD_IPA_UC_RT_DEBUG_BUF_COUNT];
|
||||||
unsigned int rt_buf_fill_index;
|
unsigned int rt_buf_fill_index;
|
||||||
struct ipa_wdi_in_params cons_pipe_in;
|
qdf_ipa_wdi_in_params_t cons_pipe_in;
|
||||||
struct ipa_wdi_in_params prod_pipe_in;
|
qdf_ipa_wdi_in_params_t prod_pipe_in;
|
||||||
bool uc_loaded;
|
bool uc_loaded;
|
||||||
bool wdi_enabled;
|
bool wdi_enabled;
|
||||||
qdf_mc_timer_t rt_debug_fill_timer;
|
qdf_mc_timer_t rt_debug_fill_timer;
|
||||||
@@ -522,8 +515,8 @@ struct hdd_ipa_priv {
|
|||||||
#define HDD_IPA_DBG_DUMP_TX_LEN 48
|
#define HDD_IPA_DBG_DUMP_TX_LEN 48
|
||||||
|
|
||||||
static struct hdd_ipa_adapter_2_client {
|
static struct hdd_ipa_adapter_2_client {
|
||||||
enum ipa_client_type cons_client;
|
qdf_ipa_client_type_t cons_client;
|
||||||
enum ipa_client_type prod_client;
|
qdf_ipa_client_type_t prod_client;
|
||||||
} hdd_ipa_adapter_2_client[HDD_IPA_MAX_IFACE] = {
|
} hdd_ipa_adapter_2_client[HDD_IPA_MAX_IFACE] = {
|
||||||
{
|
{
|
||||||
IPA_CLIENT_WLAN2_CONS, IPA_CLIENT_WLAN1_PROD
|
IPA_CLIENT_WLAN2_CONS, IPA_CLIENT_WLAN1_PROD
|
||||||
@@ -544,12 +537,12 @@ static struct hdd_ipa_adapter_2_client {
|
|||||||
static struct hdd_ipa_priv *ghdd_ipa;
|
static struct hdd_ipa_priv *ghdd_ipa;
|
||||||
|
|
||||||
/* Local Function Prototypes */
|
/* Local Function Prototypes */
|
||||||
static void hdd_ipa_i2w_cb(void *priv, enum ipa_dp_evt_type evt,
|
static void hdd_ipa_i2w_cb(void *priv, qdf_ipa_dp_evt_type_t evt,
|
||||||
unsigned long data);
|
unsigned long data);
|
||||||
static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt,
|
static void hdd_ipa_w2i_cb(void *priv, qdf_ipa_dp_evt_type_t evt,
|
||||||
unsigned long data);
|
unsigned long data);
|
||||||
#ifdef FEATURE_METERING
|
#ifdef FEATURE_METERING
|
||||||
static void hdd_ipa_wdi_meter_notifier_cb(enum ipa_wdi_meter_evt_type evt,
|
static void hdd_ipa_wdi_meter_notifier_cb(qdf_ipa_wdi_meter_evt_type_t evt,
|
||||||
void *data);
|
void *data);
|
||||||
#else
|
#else
|
||||||
static void hdd_ipa_wdi_meter_notifier_cb(void);
|
static void hdd_ipa_wdi_meter_notifier_cb(void);
|
||||||
@@ -616,13 +609,13 @@ done:
|
|||||||
*/
|
*/
|
||||||
static int hdd_ipa_uc_send_wdi_control_msg(bool ctrl)
|
static int hdd_ipa_uc_send_wdi_control_msg(bool ctrl)
|
||||||
{
|
{
|
||||||
struct ipa_msg_meta meta;
|
qdf_ipa_msg_meta_t meta;
|
||||||
struct ipa_wlan_msg *ipa_msg;
|
qdf_ipa_wlan_msg_t *ipa_msg;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
/* WDI enable message to IPA */
|
/* WDI enable message to IPA */
|
||||||
meta.msg_len = sizeof(*ipa_msg);
|
QDF_IPA_MSG_META_MSG_LEN(&meta) = sizeof(*ipa_msg);
|
||||||
ipa_msg = qdf_mem_malloc(meta.msg_len);
|
ipa_msg = qdf_mem_malloc(QDF_IPA_MSG_META_MSG_LEN(&meta));
|
||||||
if (ipa_msg == NULL) {
|
if (ipa_msg == NULL) {
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
||||||
"msg allocation failed");
|
"msg allocation failed");
|
||||||
@@ -630,17 +623,17 @@ static int hdd_ipa_uc_send_wdi_control_msg(bool ctrl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ctrl == true)
|
if (ctrl == true)
|
||||||
meta.msg_type = WLAN_WDI_ENABLE;
|
QDF_IPA_MSG_META_MSG_TYPE(&meta) = WLAN_WDI_ENABLE;
|
||||||
else
|
else
|
||||||
meta.msg_type = WLAN_WDI_DISABLE;
|
QDF_IPA_MSG_META_MSG_TYPE(&meta) = WLAN_WDI_DISABLE;
|
||||||
|
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG,
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG,
|
||||||
"ipa_send_msg(Evt:%d)", meta.msg_type);
|
"ipa_send_msg(Evt:%d)", QDF_IPA_MSG_META_MSG_TYPE(&meta));
|
||||||
ret = ipa_send_msg(&meta, ipa_msg, hdd_ipa_msg_free_fn);
|
ret = qdf_ipa_send_msg(&meta, ipa_msg, hdd_ipa_msg_free_fn);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
||||||
"ipa_send_msg(Evt:%d)-fail=%d",
|
"ipa_send_msg(Evt:%d)-fail=%d",
|
||||||
meta.msg_type, ret);
|
QDF_IPA_MSG_META_MSG_TYPE(&meta), ret);
|
||||||
qdf_mem_free(ipa_msg);
|
qdf_mem_free(ipa_msg);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@@ -659,18 +652,19 @@ static int hdd_ipa_uc_send_wdi_control_msg(bool ctrl)
|
|||||||
*/
|
*/
|
||||||
static int hdd_ipa_uc_register_uc_ready(struct hdd_ipa_priv *hdd_ipa)
|
static int hdd_ipa_uc_register_uc_ready(struct hdd_ipa_priv *hdd_ipa)
|
||||||
{
|
{
|
||||||
struct ipa_wdi_uc_ready_params uc_ready_param;
|
qdf_ipa_wdi_uc_ready_params_t uc_ready_param;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
hdd_ipa->uc_loaded = false;
|
hdd_ipa->uc_loaded = false;
|
||||||
uc_ready_param.priv = (void *)hdd_ipa;
|
QDF_IPA_UC_READY_PARAMS_PRIV(&uc_ready_param) = (void *)hdd_ipa;
|
||||||
uc_ready_param.notify = hdd_ipa_uc_loaded_uc_cb;
|
QDF_IPA_UC_READY_PARAMS_NOTIFY(&uc_ready_param) =
|
||||||
|
hdd_ipa_uc_loaded_uc_cb;
|
||||||
if (ipa_uc_reg_rdyCB(&uc_ready_param)) {
|
if (ipa_uc_reg_rdyCB(&uc_ready_param)) {
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
||||||
"UC Ready CB register fail");
|
"UC Ready CB register fail");
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
}
|
}
|
||||||
if (true == uc_ready_param.is_uC_ready) {
|
if (false != QDF_IPA_UC_READY_PARAMS_IS_UC_READY(&uc_ready_param)) {
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "UC Ready");
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "UC Ready");
|
||||||
hdd_ipa->uc_loaded = true;
|
hdd_ipa->uc_loaded = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -1241,7 +1235,7 @@ static void hdd_ipa_dump_sys_pipe(struct hdd_ipa_priv *hdd_ipa)
|
|||||||
|
|
||||||
for (i = 0; i < HDD_IPA_MAX_SYSBAM_PIPE; i++) {
|
for (i = 0; i < HDD_IPA_MAX_SYSBAM_PIPE; i++) {
|
||||||
struct hdd_ipa_sys_pipe *sys_pipe;
|
struct hdd_ipa_sys_pipe *sys_pipe;
|
||||||
struct ipa_sys_connect_params *ipa_sys_params;
|
qdf_ipa_sys_connect_params_t *ipa_sys_params;
|
||||||
|
|
||||||
sys_pipe = &hdd_ipa->sys_pipe[i];
|
sys_pipe = &hdd_ipa->sys_pipe[i];
|
||||||
ipa_sys_params = &sys_pipe->ipa_sys_params;
|
ipa_sys_params = &sys_pipe->ipa_sys_params;
|
||||||
@@ -1266,19 +1260,21 @@ static void hdd_ipa_dump_sys_pipe(struct hdd_ipa_priv *hdd_ipa)
|
|||||||
i,
|
i,
|
||||||
sys_pipe->conn_hdl,
|
sys_pipe->conn_hdl,
|
||||||
sys_pipe->conn_hdl_valid,
|
sys_pipe->conn_hdl_valid,
|
||||||
ipa_sys_params->ipa_ep_cfg.nat.nat_en,
|
QDF_IPA_SYS_PARAMS_NAT_EN(ipa_sys_params),
|
||||||
ipa_sys_params->ipa_ep_cfg.hdr.hdr_len,
|
QDF_IPA_SYS_PARAMS_HDR_LEN(ipa_sys_params),
|
||||||
ipa_sys_params->ipa_ep_cfg.hdr.hdr_additional_const_len,
|
QDF_IPA_SYS_PARAMS_HDR_ADDITIONAL_CONST_LEN(
|
||||||
ipa_sys_params->ipa_ep_cfg.hdr.hdr_ofst_pkt_size_valid,
|
ipa_sys_params),
|
||||||
ipa_sys_params->ipa_ep_cfg.hdr.hdr_ofst_pkt_size,
|
QDF_IPA_SYS_PARAMS_HDR_OFST_PKT_SIZE_VALID(
|
||||||
ipa_sys_params->ipa_ep_cfg.hdr_ext.hdr_little_endian,
|
ipa_sys_params),
|
||||||
ipa_sys_params->ipa_ep_cfg.mode.mode,
|
QDF_IPA_SYS_PARAMS_HDR_OFST_PKT_SIZE(ipa_sys_params),
|
||||||
ipa_sys_params->client,
|
QDF_IPA_SYS_PARAMS_HDR_LITTLE_ENDIAN(ipa_sys_params),
|
||||||
ipa_sys_params->desc_fifo_sz,
|
QDF_IPA_SYS_PARAMS_MODE(ipa_sys_params),
|
||||||
ipa_sys_params->priv,
|
QDF_IPA_SYS_PARAMS_CLIENT(ipa_sys_params),
|
||||||
ipa_sys_params->notify,
|
QDF_IPA_SYS_PARAMS_DESC_FIFO_SZ(ipa_sys_params),
|
||||||
ipa_sys_params->skip_ep_cfg,
|
QDF_IPA_SYS_PARAMS_PRIV(ipa_sys_params),
|
||||||
ipa_sys_params->keep_ipa_awake);
|
QDF_IPA_SYS_PARAMS_NOTIFY(ipa_sys_params),
|
||||||
|
QDF_IPA_SYS_PARAMS_SKIP_EP_CFG(ipa_sys_params),
|
||||||
|
QDF_IPA_SYS_PARAMS_KEEP_IPA_AWAKE(ipa_sys_params));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2055,7 +2051,7 @@ static void hdd_ipa_uc_handle_last_discon(struct hdd_ipa_priv *hdd_ipa)
|
|||||||
* Return: None
|
* Return: None
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
hdd_ipa_uc_rm_notify_handler(void *context, enum ipa_rm_event event)
|
hdd_ipa_uc_rm_notify_handler(void *context, qdf_ipa_rm_event_t event)
|
||||||
{
|
{
|
||||||
struct hdd_ipa_priv *hdd_ipa = context;
|
struct hdd_ipa_priv *hdd_ipa = context;
|
||||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||||
@@ -2110,7 +2106,7 @@ hdd_ipa_uc_rm_notify_handler(void *context, enum ipa_rm_event event)
|
|||||||
*/
|
*/
|
||||||
static void hdd_ipa_uc_rm_notify_defer(struct work_struct *work)
|
static void hdd_ipa_uc_rm_notify_defer(struct work_struct *work)
|
||||||
{
|
{
|
||||||
enum ipa_rm_event event;
|
qdf_ipa_rm_event_t event;
|
||||||
struct uc_rm_work_struct *uc_rm_work = container_of(work,
|
struct uc_rm_work_struct *uc_rm_work = container_of(work,
|
||||||
struct uc_rm_work_struct, work);
|
struct uc_rm_work_struct, work);
|
||||||
struct hdd_ipa_priv *hdd_ipa = container_of(uc_rm_work,
|
struct hdd_ipa_priv *hdd_ipa = container_of(uc_rm_work,
|
||||||
@@ -2276,7 +2272,7 @@ static QDF_STATUS hdd_ipa_uc_op_metering(struct hdd_context *hdd_ctx,
|
|||||||
*
|
*
|
||||||
* Return: ASCII string representing the IPA WLAN event
|
* Return: ASCII string representing the IPA WLAN event
|
||||||
*/
|
*/
|
||||||
static inline char *hdd_ipa_wlan_event_to_str(enum ipa_wlan_event event)
|
static inline char *hdd_ipa_wlan_event_to_str(qdf_ipa_wlan_event_t event)
|
||||||
{
|
{
|
||||||
switch (event) {
|
switch (event) {
|
||||||
CASE_RETURN_STRING(WLAN_CLIENT_CONNECT);
|
CASE_RETURN_STRING(WLAN_CLIENT_CONNECT);
|
||||||
@@ -2940,13 +2936,13 @@ static void hdd_ipa_init_uc_op_work(struct work_struct *work,
|
|||||||
*
|
*
|
||||||
* Return: None
|
* Return: None
|
||||||
*/
|
*/
|
||||||
static void __hdd_ipa_wdi_meter_notifier_cb(enum ipa_wdi_meter_evt_type evt,
|
static void __hdd_ipa_wdi_meter_notifier_cb(qdf_ipa_wdi_meter_evt_type_t evt,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
|
struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
|
||||||
struct hdd_adapter *adapter = NULL;
|
struct hdd_adapter *adapter = NULL;
|
||||||
struct ipa_get_wdi_sap_stats *wdi_sap_stats;
|
qdf_ipa_get_wdi_sap_stats_t *wdi_sap_stats;
|
||||||
struct ipa_set_wifi_quota *ipa_set_quota;
|
qdf_ipa_set_wifi_quota_t *ipa_set_quota;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (wlan_hdd_validate_context(hdd_ipa->hdd_ctx))
|
if (wlan_hdd_validate_context(hdd_ipa->hdd_ctx))
|
||||||
@@ -2966,51 +2962,63 @@ static void __hdd_ipa_wdi_meter_notifier_cb(enum ipa_wdi_meter_evt_type evt,
|
|||||||
if (!adapter) {
|
if (!adapter) {
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
||||||
"IPA uC share stats failed - no adapter");
|
"IPA uC share stats failed - no adapter");
|
||||||
wdi_sap_stats->stats_valid = 0;
|
QDF_IPA_GET_WDI_SAP_STATS_STATS_VALID(wdi_sap_stats) =
|
||||||
|
0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
INIT_COMPLETION(hdd_ipa->ipa_uc_sharing_stats_comp);
|
INIT_COMPLETION(hdd_ipa->ipa_uc_sharing_stats_comp);
|
||||||
hdd_ipa_uc_sharing_stats_request(adapter,
|
hdd_ipa_uc_sharing_stats_request(adapter,
|
||||||
wdi_sap_stats->reset_stats);
|
QDF_IPA_GET_WDI_SAP_STATS_RESET_STATS(wdi_sap_stats));
|
||||||
ret = wait_for_completion_timeout(
|
ret = wait_for_completion_timeout(
|
||||||
&hdd_ipa->ipa_uc_sharing_stats_comp,
|
&hdd_ipa->ipa_uc_sharing_stats_comp,
|
||||||
msecs_to_jiffies(IPA_UC_SHARING_STATES_WAIT_TIME));
|
msecs_to_jiffies(IPA_UC_SHARING_STATES_WAIT_TIME));
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
||||||
"IPA uC share stats request timed out");
|
"IPA uC share stats request timed out");
|
||||||
wdi_sap_stats->stats_valid = 0;
|
QDF_IPA_GET_WDI_SAP_STATS_STATS_VALID(wdi_sap_stats)
|
||||||
|
= 0;
|
||||||
} else {
|
} else {
|
||||||
wdi_sap_stats->stats_valid = 1;
|
QDF_IPA_GET_WDI_SAP_STATS_STATS_VALID(wdi_sap_stats)
|
||||||
|
= 1;
|
||||||
|
|
||||||
wdi_sap_stats->ipv4_rx_packets =
|
QDF_IPA_GET_WDI_SAP_STATS_IPV4_RX_PACKETS(wdi_sap_stats)
|
||||||
hdd_ipa->ipa_sharing_stats.ipv4_rx_packets;
|
= hdd_ipa->ipa_sharing_stats.ipv4_rx_packets;
|
||||||
wdi_sap_stats->ipv4_rx_bytes =
|
QDF_IPA_GET_WDI_SAP_STATS_IPV4_RX_BYTES(wdi_sap_stats)
|
||||||
hdd_ipa->ipa_sharing_stats.ipv4_rx_bytes;
|
= hdd_ipa->ipa_sharing_stats.ipv4_rx_bytes;
|
||||||
wdi_sap_stats->ipv6_rx_packets =
|
QDF_IPA_GET_WDI_SAP_STATS_IPV6_RX_PACKETS(wdi_sap_stats)
|
||||||
hdd_ipa->ipa_sharing_stats.ipv6_rx_packets;
|
= hdd_ipa->ipa_sharing_stats.ipv6_rx_packets;
|
||||||
wdi_sap_stats->ipv6_rx_bytes =
|
QDF_IPA_GET_WDI_SAP_STATS_IPV6_RX_BYTES(wdi_sap_stats)
|
||||||
hdd_ipa->ipa_sharing_stats.ipv6_rx_bytes;
|
= hdd_ipa->ipa_sharing_stats.ipv6_rx_bytes;
|
||||||
wdi_sap_stats->ipv4_tx_packets =
|
QDF_IPA_GET_WDI_SAP_STATS_IPV4_TX_PACKETS(wdi_sap_stats)
|
||||||
hdd_ipa->ipa_sharing_stats.ipv4_tx_packets;
|
= hdd_ipa->ipa_sharing_stats.ipv4_tx_packets;
|
||||||
wdi_sap_stats->ipv4_tx_bytes =
|
QDF_IPA_GET_WDI_SAP_STATS_IPV4_TX_BYTES(wdi_sap_stats)
|
||||||
hdd_ipa->ipa_sharing_stats.ipv4_tx_bytes;
|
= hdd_ipa->ipa_sharing_stats.ipv4_tx_bytes;
|
||||||
wdi_sap_stats->ipv6_tx_packets =
|
QDF_IPA_GET_WDI_SAP_STATS_IPV6_TX_PACKETS(wdi_sap_stats)
|
||||||
hdd_ipa->ipa_sharing_stats.ipv6_tx_packets;
|
= hdd_ipa->ipa_sharing_stats.ipv6_tx_packets;
|
||||||
wdi_sap_stats->ipv6_tx_bytes =
|
QDF_IPA_GET_WDI_SAP_STATS_IPV6_TX_BYTES(wdi_sap_stats)
|
||||||
hdd_ipa->ipa_sharing_stats.ipv6_tx_bytes;
|
= hdd_ipa->ipa_sharing_stats.ipv6_tx_bytes;
|
||||||
HDD_IPA_DP_LOG(QDF_TRACE_LEVEL_DEBUG,
|
HDD_IPA_DP_LOG(QDF_TRACE_LEVEL_DEBUG,
|
||||||
"%s:%d,%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu",
|
"%s:%d,%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu",
|
||||||
"IPA_GET_WDI_SAP_STATS",
|
"IPA_GET_WDI_SAP_STATS",
|
||||||
wdi_sap_stats->stats_valid,
|
QDF_IPA_GET_WDI_SAP_STATS_STATS_VALID(
|
||||||
wdi_sap_stats->ipv4_rx_packets,
|
wdi_sap_stats),
|
||||||
wdi_sap_stats->ipv4_rx_bytes,
|
QDF_IPA_GET_WDI_SAP_STATS_IPV4_RX_PACKETS(
|
||||||
wdi_sap_stats->ipv6_rx_packets,
|
wdi_sap_stats),
|
||||||
wdi_sap_stats->ipv6_rx_bytes,
|
QDF_IPA_GET_WDI_SAP_STATS_IPV4_RX_BYTES(
|
||||||
wdi_sap_stats->ipv4_tx_packets,
|
wdi_sap_stats),
|
||||||
wdi_sap_stats->ipv4_tx_bytes,
|
QDF_IPA_GET_WDI_SAP_STATS_IPV6_RX_PACKETS(
|
||||||
wdi_sap_stats->ipv6_tx_packets,
|
wdi_sap_stats),
|
||||||
wdi_sap_stats->ipv6_tx_bytes);
|
QDF_IPA_GET_WDI_SAP_STATS_IPV6_RX_BYTES(
|
||||||
|
wdi_sap_stats),
|
||||||
|
QDF_IPA_GET_WDI_SAP_STATS_IPV4_TX_PACKETS(
|
||||||
|
wdi_sap_stats),
|
||||||
|
QDF_IPA_GET_WDI_SAP_STATS_IPV4_TX_BYTES(
|
||||||
|
wdi_sap_stats),
|
||||||
|
QDF_IPA_GET_WDI_SAP_STATS_IPV6_TX_PACKETS(
|
||||||
|
wdi_sap_stats),
|
||||||
|
QDF_IPA_GET_WDI_SAP_STATS_IPV6_TX_BYTES(
|
||||||
|
wdi_sap_stats));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IPA_SET_WIFI_QUOTA:
|
case IPA_SET_WIFI_QUOTA:
|
||||||
@@ -3036,12 +3044,12 @@ static void __hdd_ipa_wdi_meter_notifier_cb(enum ipa_wdi_meter_evt_type evt,
|
|||||||
if (!ret) {
|
if (!ret) {
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
||||||
"IPA uC set quota request timed out");
|
"IPA uC set quota request timed out");
|
||||||
ipa_set_quota->set_valid = 0;
|
QDF_IPA_SET_WIFI_QUOTA_SET_VALID(ipa_set_quota) = 0;
|
||||||
} else {
|
} else {
|
||||||
ipa_set_quota->quota_bytes =
|
QDF_IPA_SET_WIFI_QUOTA_BYTES(ipa_set_quota) =
|
||||||
((uint64_t)(hdd_ipa->ipa_quota_rsp.quota_hi)
|
((uint64_t)(hdd_ipa->ipa_quota_rsp.quota_hi)
|
||||||
<<32)|hdd_ipa->ipa_quota_rsp.quota_lo;
|
<<32)|hdd_ipa->ipa_quota_rsp.quota_lo;
|
||||||
ipa_set_quota->set_valid =
|
QDF_IPA_SET_WIFI_QUOTA_SET_VALID(ipa_set_quota) =
|
||||||
hdd_ipa->ipa_quota_rsp.success;
|
hdd_ipa->ipa_quota_rsp.success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3062,7 +3070,7 @@ static void __hdd_ipa_wdi_meter_notifier_cb(enum ipa_wdi_meter_evt_type evt,
|
|||||||
*
|
*
|
||||||
* Return: None
|
* Return: None
|
||||||
*/
|
*/
|
||||||
static void hdd_ipa_wdi_meter_notifier_cb(enum ipa_wdi_meter_evt_type evt,
|
static void hdd_ipa_wdi_meter_notifier_cb(qdf_ipa_wdi_meter_evt_type_t evt,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
cds_ssr_protect(__func__);
|
cds_ssr_protect(__func__);
|
||||||
@@ -3289,32 +3297,33 @@ static void hdd_ipa_msg_free_fn(void *buff, uint32_t len, uint32_t type)
|
|||||||
* Return: 0 - Success
|
* Return: 0 - Success
|
||||||
*/
|
*/
|
||||||
static int hdd_ipa_uc_send_evt(struct hdd_adapter *adapter,
|
static int hdd_ipa_uc_send_evt(struct hdd_adapter *adapter,
|
||||||
enum ipa_wlan_event type, uint8_t *mac_addr)
|
qdf_ipa_wlan_event_t type, uint8_t *mac_addr)
|
||||||
{
|
{
|
||||||
struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
|
struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
|
||||||
struct ipa_msg_meta meta;
|
qdf_ipa_msg_meta_t meta;
|
||||||
struct ipa_wlan_msg *msg;
|
qdf_ipa_wlan_msg_t *msg;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
meta.msg_len = sizeof(struct ipa_wlan_msg);
|
QDF_IPA_MSG_META_MSG_LEN(&meta) = sizeof(qdf_ipa_wlan_msg_t);
|
||||||
msg = qdf_mem_malloc(meta.msg_len);
|
msg = qdf_mem_malloc(QDF_IPA_MSG_META_MSG_LEN(&meta));
|
||||||
if (msg == NULL) {
|
if (msg == NULL) {
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
||||||
"msg allocation failed");
|
"msg allocation failed");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
meta.msg_type = type;
|
QDF_IPA_MSG_META_MSG_TYPE(&meta) = type;
|
||||||
strlcpy(msg->name, adapter->dev->name,
|
strlcpy(QDF_IPA_WLAN_MSG_NAME(msg), adapter->dev->name,
|
||||||
IPA_RESOURCE_NAME_MAX);
|
IPA_RESOURCE_NAME_MAX);
|
||||||
memcpy(msg->mac_addr, mac_addr, ETH_ALEN);
|
memcpy(QDF_IPA_WLAN_MSG_MAC_ADDR(msg), mac_addr, ETH_ALEN);
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "%s: Evt: %d",
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "%s: Evt: %d",
|
||||||
msg->name, meta.msg_type);
|
QDF_IPA_WLAN_MSG_NAME(msg), QDF_IPA_MSG_META_MSG_TYPE(&meta));
|
||||||
ret = ipa_send_msg(&meta, msg, hdd_ipa_msg_free_fn);
|
ret = qdf_ipa_send_msg(&meta, msg, hdd_ipa_msg_free_fn);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
||||||
"%s: Evt: %d fail:%d",
|
"%s: Evt: %d fail:%d",
|
||||||
msg->name, meta.msg_type, ret);
|
QDF_IPA_WLAN_MSG_NAME(msg),
|
||||||
|
QDF_IPA_MSG_META_MSG_TYPE(&meta), ret);
|
||||||
qdf_mem_free(msg);
|
qdf_mem_free(msg);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -3646,7 +3655,7 @@ static int hdd_ipa_rm_request(struct hdd_ipa_priv *hdd_ipa)
|
|||||||
|
|
||||||
qdf_spin_unlock_bh(&hdd_ipa->rm_lock);
|
qdf_spin_unlock_bh(&hdd_ipa->rm_lock);
|
||||||
|
|
||||||
ret = ipa_rm_inactivity_timer_request_resource(
|
ret = qdf_ipa_rm_inactivity_timer_request_resource(
|
||||||
IPA_RM_RESOURCE_WLAN_PROD);
|
IPA_RM_RESOURCE_WLAN_PROD);
|
||||||
|
|
||||||
qdf_spin_lock_bh(&hdd_ipa->rm_lock);
|
qdf_spin_lock_bh(&hdd_ipa->rm_lock);
|
||||||
@@ -3709,7 +3718,7 @@ static int hdd_ipa_rm_try_release(struct hdd_ipa_priv *hdd_ipa)
|
|||||||
hdd_ipa->stats.num_rm_release++;
|
hdd_ipa->stats.num_rm_release++;
|
||||||
qdf_spin_unlock_bh(&hdd_ipa->rm_lock);
|
qdf_spin_unlock_bh(&hdd_ipa->rm_lock);
|
||||||
|
|
||||||
ret = ipa_rm_inactivity_timer_release_resource(
|
ret = qdf_ipa_rm_inactivity_timer_release_resource(
|
||||||
IPA_RM_RESOURCE_WLAN_PROD);
|
IPA_RM_RESOURCE_WLAN_PROD);
|
||||||
|
|
||||||
qdf_spin_lock_bh(&hdd_ipa->rm_lock);
|
qdf_spin_lock_bh(&hdd_ipa->rm_lock);
|
||||||
@@ -3743,7 +3752,7 @@ static int hdd_ipa_rm_try_release(struct hdd_ipa_priv *hdd_ipa)
|
|||||||
*
|
*
|
||||||
* Return: None
|
* Return: None
|
||||||
*/
|
*/
|
||||||
static void hdd_ipa_rm_notify(void *user_data, enum ipa_rm_event event,
|
static void hdd_ipa_rm_notify(void *user_data, qdf_ipa_rm_event_t event,
|
||||||
unsigned long data)
|
unsigned long data)
|
||||||
{
|
{
|
||||||
struct hdd_ipa_priv *hdd_ipa = user_data;
|
struct hdd_ipa_priv *hdd_ipa = user_data;
|
||||||
@@ -3838,7 +3847,7 @@ static int __hdd_ipa_set_perf_level(struct hdd_context *hdd_ctx,
|
|||||||
{
|
{
|
||||||
uint32_t next_cons_bw, next_prod_bw;
|
uint32_t next_cons_bw, next_prod_bw;
|
||||||
struct hdd_ipa_priv *hdd_ipa;
|
struct hdd_ipa_priv *hdd_ipa;
|
||||||
struct ipa_rm_perf_profile profile;
|
qdf_ipa_rm_perf_profile_t profile;
|
||||||
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
|
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -3947,7 +3956,7 @@ static void hdd_ipa_init_uc_rm_work(struct work_struct *work,
|
|||||||
*/
|
*/
|
||||||
static int hdd_ipa_setup_rm(struct hdd_ipa_priv *hdd_ipa)
|
static int hdd_ipa_setup_rm(struct hdd_ipa_priv *hdd_ipa)
|
||||||
{
|
{
|
||||||
struct ipa_rm_create_params create_params = { 0 };
|
qdf_ipa_rm_create_params_t create_params = { 0 };
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!hdd_ipa_is_rm_enabled(hdd_ipa->hdd_ctx))
|
if (!hdd_ipa_is_rm_enabled(hdd_ipa->hdd_ctx))
|
||||||
@@ -3956,12 +3965,16 @@ static int hdd_ipa_setup_rm(struct hdd_ipa_priv *hdd_ipa)
|
|||||||
hdd_ipa_init_uc_rm_work(&hdd_ipa->uc_rm_work.work,
|
hdd_ipa_init_uc_rm_work(&hdd_ipa->uc_rm_work.work,
|
||||||
hdd_ipa_uc_rm_notify_defer);
|
hdd_ipa_uc_rm_notify_defer);
|
||||||
memset(&create_params, 0, sizeof(create_params));
|
memset(&create_params, 0, sizeof(create_params));
|
||||||
create_params.name = IPA_RM_RESOURCE_WLAN_PROD;
|
QDF_IPA_RM_CREATE_PARAMS_NAME(&create_params) =
|
||||||
create_params.reg_params.user_data = hdd_ipa;
|
IPA_RM_RESOURCE_WLAN_PROD;
|
||||||
create_params.reg_params.notify_cb = hdd_ipa_rm_notify;
|
QDF_IPA_RM_CREATE_PARAMS_USER_DATA(&create_params) =
|
||||||
create_params.floor_voltage = IPA_VOLTAGE_SVS;
|
hdd_ipa;
|
||||||
|
QDF_IPA_RM_CREATE_PARAMS_NOTIFY_CB(&create_params) =
|
||||||
|
hdd_ipa_rm_notify;
|
||||||
|
QDF_IPA_RM_CREATE_PARAMS_FLOOR_VOLTAGE(&create_params) =
|
||||||
|
IPA_VOLTAGE_SVS;
|
||||||
|
|
||||||
ret = ipa_rm_create_resource(&create_params);
|
ret = qdf_ipa_rm_create_resource(&create_params);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
||||||
"Create RM resource failed: %d", ret);
|
"Create RM resource failed: %d", ret);
|
||||||
@@ -3969,12 +3982,16 @@ static int hdd_ipa_setup_rm(struct hdd_ipa_priv *hdd_ipa)
|
|||||||
}
|
}
|
||||||
|
|
||||||
memset(&create_params, 0, sizeof(create_params));
|
memset(&create_params, 0, sizeof(create_params));
|
||||||
create_params.name = IPA_RM_RESOURCE_WLAN_CONS;
|
QDF_IPA_RM_CREATE_PARAMS_NAME(&create_params) =
|
||||||
create_params.request_resource = hdd_ipa_rm_cons_request;
|
IPA_RM_RESOURCE_WLAN_CONS;
|
||||||
create_params.release_resource = hdd_ipa_rm_cons_release;
|
QDF_IPA_RM_CREATE_PARAMS_REQUEST_RESOURCE(&create_params) =
|
||||||
create_params.floor_voltage = IPA_VOLTAGE_SVS;
|
hdd_ipa_rm_cons_request;
|
||||||
|
QDF_IPA_RM_CREATE_PARAMS_RELEASE_RESOURCE(&create_params) =
|
||||||
|
hdd_ipa_rm_cons_release;
|
||||||
|
QDF_IPA_RM_CREATE_PARAMS_FLOOR_VOLTAGE(&create_params) =
|
||||||
|
IPA_VOLTAGE_SVS;
|
||||||
|
|
||||||
ret = ipa_rm_create_resource(&create_params);
|
ret = qdf_ipa_rm_create_resource(&create_params);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
||||||
"Create RM CONS resource failed: %d", ret);
|
"Create RM CONS resource failed: %d", ret);
|
||||||
@@ -3984,8 +4001,8 @@ static int hdd_ipa_setup_rm(struct hdd_ipa_priv *hdd_ipa)
|
|||||||
ipa_rm_add_dependency(IPA_RM_RESOURCE_WLAN_PROD,
|
ipa_rm_add_dependency(IPA_RM_RESOURCE_WLAN_PROD,
|
||||||
IPA_RM_RESOURCE_APPS_CONS);
|
IPA_RM_RESOURCE_APPS_CONS);
|
||||||
|
|
||||||
ret = ipa_rm_inactivity_timer_init(IPA_RM_RESOURCE_WLAN_PROD,
|
ret = qdf_ipa_rm_inactivity_timer_init(IPA_RM_RESOURCE_WLAN_PROD,
|
||||||
HDD_IPA_RX_INACTIVITY_MSEC_DELAY);
|
HDD_IPA_RX_INACTIVITY_MSEC_DELAY);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "Timer init failed: %d",
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "Timer init failed: %d",
|
||||||
ret);
|
ret);
|
||||||
@@ -4047,12 +4064,12 @@ static void hdd_ipa_destroy_rm_resource(struct hdd_ipa_priv *hdd_ipa)
|
|||||||
|
|
||||||
ipa_rm_inactivity_timer_destroy(IPA_RM_RESOURCE_WLAN_PROD);
|
ipa_rm_inactivity_timer_destroy(IPA_RM_RESOURCE_WLAN_PROD);
|
||||||
|
|
||||||
ret = ipa_rm_delete_resource(IPA_RM_RESOURCE_WLAN_PROD);
|
ret = qdf_ipa_rm_delete_resource(IPA_RM_RESOURCE_WLAN_PROD);
|
||||||
if (ret)
|
if (ret)
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
||||||
"RM PROD resource delete failed %d", ret);
|
"RM PROD resource delete failed %d", ret);
|
||||||
|
|
||||||
ret = ipa_rm_delete_resource(IPA_RM_RESOURCE_WLAN_CONS);
|
ret = qdf_ipa_rm_delete_resource(IPA_RM_RESOURCE_WLAN_CONS);
|
||||||
if (ret)
|
if (ret)
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
||||||
"RM CONS resource delete failed %d", ret);
|
"RM CONS resource delete failed %d", ret);
|
||||||
@@ -4256,8 +4273,8 @@ static enum hdd_ipa_forward_type hdd_ipa_intrabss_forward(
|
|||||||
*
|
*
|
||||||
* Return: None
|
* Return: None
|
||||||
*/
|
*/
|
||||||
static void __hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt,
|
static void __hdd_ipa_w2i_cb(void *priv, qdf_ipa_dp_evt_type_t evt,
|
||||||
unsigned long data)
|
unsigned long data)
|
||||||
{
|
{
|
||||||
struct hdd_ipa_priv *hdd_ipa = NULL;
|
struct hdd_ipa_priv *hdd_ipa = NULL;
|
||||||
struct hdd_adapter *adapter = NULL;
|
struct hdd_adapter *adapter = NULL;
|
||||||
@@ -4377,7 +4394,7 @@ static void __hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt,
|
|||||||
*
|
*
|
||||||
* Return: None
|
* Return: None
|
||||||
*/
|
*/
|
||||||
static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt,
|
static void hdd_ipa_w2i_cb(void *priv, qdf_ipa_dp_evt_type_t evt,
|
||||||
unsigned long data)
|
unsigned long data)
|
||||||
{
|
{
|
||||||
cds_ssr_protect(__func__);
|
cds_ssr_protect(__func__);
|
||||||
@@ -4394,7 +4411,7 @@ static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt,
|
|||||||
void hdd_ipa_nbuf_cb(qdf_nbuf_t skb)
|
void hdd_ipa_nbuf_cb(qdf_nbuf_t skb)
|
||||||
{
|
{
|
||||||
struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
|
struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
|
||||||
struct ipa_rx_data *ipa_tx_desc;
|
qdf_ipa_rx_data_t *ipa_tx_desc;
|
||||||
struct hdd_ipa_tx_desc *tx_desc;
|
struct hdd_ipa_tx_desc *tx_desc;
|
||||||
uint16_t id;
|
uint16_t id;
|
||||||
|
|
||||||
@@ -4434,7 +4451,7 @@ void hdd_ipa_nbuf_cb(qdf_nbuf_t skb)
|
|||||||
*/
|
*/
|
||||||
static void hdd_ipa_send_pkt_to_tl(
|
static void hdd_ipa_send_pkt_to_tl(
|
||||||
struct hdd_ipa_iface_context *iface_context,
|
struct hdd_ipa_iface_context *iface_context,
|
||||||
struct ipa_rx_data *ipa_tx_desc)
|
qdf_ipa_rx_data_t *ipa_tx_desc)
|
||||||
{
|
{
|
||||||
struct hdd_ipa_priv *hdd_ipa = iface_context->hdd_ipa;
|
struct hdd_ipa_priv *hdd_ipa = iface_context->hdd_ipa;
|
||||||
struct hdd_adapter *adapter = NULL;
|
struct hdd_adapter *adapter = NULL;
|
||||||
@@ -4471,7 +4488,7 @@ static void hdd_ipa_send_pkt_to_tl(
|
|||||||
|
|
||||||
qdf_spin_unlock_bh(&iface_context->interface_lock);
|
qdf_spin_unlock_bh(&iface_context->interface_lock);
|
||||||
|
|
||||||
skb = ipa_tx_desc->skb;
|
skb = QDF_IPA_RX_DATA_SKB(ipa_tx_desc);
|
||||||
|
|
||||||
qdf_mem_set(skb->cb, sizeof(skb->cb), 0);
|
qdf_mem_set(skb->cb, sizeof(skb->cb), 0);
|
||||||
|
|
||||||
@@ -4479,10 +4496,10 @@ static void hdd_ipa_send_pkt_to_tl(
|
|||||||
qdf_nbuf_ipa_owned_set(skb);
|
qdf_nbuf_ipa_owned_set(skb);
|
||||||
if (hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx)) {
|
if (hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx)) {
|
||||||
qdf_nbuf_mapped_paddr_set(skb,
|
qdf_nbuf_mapped_paddr_set(skb,
|
||||||
ipa_tx_desc->dma_addr
|
QDF_IPA_RX_DATA_DMA_ADDR(ipa_tx_desc)
|
||||||
+ HDD_IPA_WLAN_FRAG_HEADER
|
+ HDD_IPA_WLAN_FRAG_HEADER
|
||||||
+ HDD_IPA_WLAN_IPA_HEADER);
|
+ HDD_IPA_WLAN_IPA_HEADER);
|
||||||
ipa_tx_desc->skb->len -=
|
QDF_IPA_RX_DATA_SKB_LEN(ipa_tx_desc) -=
|
||||||
HDD_IPA_WLAN_FRAG_HEADER + HDD_IPA_WLAN_IPA_HEADER;
|
HDD_IPA_WLAN_FRAG_HEADER + HDD_IPA_WLAN_IPA_HEADER;
|
||||||
} else
|
} else
|
||||||
qdf_nbuf_mapped_paddr_set(skb, ipa_tx_desc->dma_addr);
|
qdf_nbuf_mapped_paddr_set(skb, ipa_tx_desc->dma_addr);
|
||||||
@@ -4506,11 +4523,11 @@ static void hdd_ipa_send_pkt_to_tl(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter->stats.tx_bytes += ipa_tx_desc->skb->len;
|
adapter->stats.tx_bytes += QDF_IPA_RX_DATA_SKB_LEN(ipa_tx_desc);
|
||||||
|
|
||||||
skb = cdp_ipa_tx_send_data_frame(cds_get_context(QDF_MODULE_ID_SOC),
|
skb = cdp_ipa_tx_send_data_frame(cds_get_context(QDF_MODULE_ID_SOC),
|
||||||
(struct cdp_vdev *)iface_context->tl_context,
|
(struct cdp_vdev *)iface_context->tl_context,
|
||||||
ipa_tx_desc->skb);
|
QDF_IPA_RX_DATA_SKB(ipa_tx_desc));
|
||||||
if (skb) {
|
if (skb) {
|
||||||
qdf_nbuf_free(skb);
|
qdf_nbuf_free(skb);
|
||||||
iface_context->stats.num_tx_err++;
|
iface_context->stats.num_tx_err++;
|
||||||
@@ -4601,18 +4618,18 @@ static void hdd_ipa_pm_flush(struct work_struct *work)
|
|||||||
*
|
*
|
||||||
* Return: None
|
* Return: None
|
||||||
*/
|
*/
|
||||||
static void __hdd_ipa_i2w_cb(void *priv, enum ipa_dp_evt_type evt,
|
static void __hdd_ipa_i2w_cb(void *priv, qdf_ipa_dp_evt_type_t evt,
|
||||||
unsigned long data)
|
unsigned long data)
|
||||||
{
|
{
|
||||||
struct hdd_ipa_priv *hdd_ipa = NULL;
|
struct hdd_ipa_priv *hdd_ipa = NULL;
|
||||||
struct ipa_rx_data *ipa_tx_desc;
|
qdf_ipa_rx_data_t *ipa_tx_desc;
|
||||||
struct hdd_ipa_iface_context *iface_context;
|
struct hdd_ipa_iface_context *iface_context;
|
||||||
qdf_nbuf_t skb;
|
qdf_nbuf_t skb;
|
||||||
struct hdd_ipa_pm_tx_cb *pm_tx_cb = NULL;
|
struct hdd_ipa_pm_tx_cb *pm_tx_cb = NULL;
|
||||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||||
|
|
||||||
iface_context = (struct hdd_ipa_iface_context *)priv;
|
iface_context = (struct hdd_ipa_iface_context *)priv;
|
||||||
ipa_tx_desc = (struct ipa_rx_data *)data;
|
ipa_tx_desc = (qdf_ipa_rx_data_t *)data;
|
||||||
hdd_ipa = iface_context->hdd_ipa;
|
hdd_ipa = iface_context->hdd_ipa;
|
||||||
|
|
||||||
if (evt != IPA_RECEIVE) {
|
if (evt != IPA_RECEIVE) {
|
||||||
@@ -4634,7 +4651,7 @@ static void __hdd_ipa_i2w_cb(void *priv, enum ipa_dp_evt_type evt,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skb = ipa_tx_desc->skb;
|
skb = QDF_IPA_RX_DATA_SKB(ipa_tx_desc);
|
||||||
|
|
||||||
HDD_IPA_DBG_DUMP(QDF_TRACE_LEVEL_DEBUG,
|
HDD_IPA_DBG_DUMP(QDF_TRACE_LEVEL_DEBUG,
|
||||||
"i2w", skb->data, HDD_IPA_DBG_DUMP_TX_LEN);
|
"i2w", skb->data, HDD_IPA_DBG_DUMP_TX_LEN);
|
||||||
@@ -4687,7 +4704,7 @@ static void __hdd_ipa_i2w_cb(void *priv, enum ipa_dp_evt_type evt,
|
|||||||
*
|
*
|
||||||
* Return: None
|
* Return: None
|
||||||
*/
|
*/
|
||||||
static void hdd_ipa_i2w_cb(void *priv, enum ipa_dp_evt_type evt,
|
static void hdd_ipa_i2w_cb(void *priv, qdf_ipa_dp_evt_type_t evt,
|
||||||
unsigned long data)
|
unsigned long data)
|
||||||
{
|
{
|
||||||
cds_ssr_protect(__func__);
|
cds_ssr_protect(__func__);
|
||||||
@@ -4851,7 +4868,7 @@ static int hdd_ipa_alloc_tx_desc_list(struct hdd_ipa_priv *hdd_ipa)
|
|||||||
static int hdd_ipa_setup_sys_pipe(struct hdd_ipa_priv *hdd_ipa)
|
static int hdd_ipa_setup_sys_pipe(struct hdd_ipa_priv *hdd_ipa)
|
||||||
{
|
{
|
||||||
int i, ret = 0;
|
int i, ret = 0;
|
||||||
struct ipa_sys_connect_params *ipa;
|
qdf_ipa_sys_connect_params_t *ipa;
|
||||||
uint32_t desc_fifo_sz;
|
uint32_t desc_fifo_sz;
|
||||||
|
|
||||||
/* The maximum number of descriptors that can be provided to a BAM at
|
/* The maximum number of descriptors that can be provided to a BAM at
|
||||||
@@ -4892,7 +4909,8 @@ static int hdd_ipa_setup_sys_pipe(struct hdd_ipa_priv *hdd_ipa)
|
|||||||
if (!hdd_ipa_is_rm_enabled(hdd_ipa->hdd_ctx))
|
if (!hdd_ipa_is_rm_enabled(hdd_ipa->hdd_ctx))
|
||||||
ipa->keep_ipa_awake = 1;
|
ipa->keep_ipa_awake = 1;
|
||||||
|
|
||||||
ret = ipa_setup_sys_pipe(ipa, &(hdd_ipa->sys_pipe[i].conn_hdl));
|
ret = qdf_ipa_setup_sys_pipe(ipa,
|
||||||
|
&hdd_ipa->sys_pipe[i].conn_hdl);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
||||||
"Failed for pipe %d ret: %d", i, ret);
|
"Failed for pipe %d ret: %d", i, ret);
|
||||||
@@ -4923,7 +4941,8 @@ static int hdd_ipa_setup_sys_pipe(struct hdd_ipa_priv *hdd_ipa)
|
|||||||
if (!hdd_ipa_is_rm_enabled(hdd_ipa->hdd_ctx))
|
if (!hdd_ipa_is_rm_enabled(hdd_ipa->hdd_ctx))
|
||||||
ipa->keep_ipa_awake = 1;
|
ipa->keep_ipa_awake = 1;
|
||||||
|
|
||||||
ret = ipa_setup_sys_pipe(ipa, &(hdd_ipa->sys_pipe[i].conn_hdl));
|
ret = qdf_ipa_setup_sys_pipe(ipa,
|
||||||
|
&hdd_ipa->sys_pipe[i].conn_hdl);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
||||||
"Failed for RX pipe: %d", ret);
|
"Failed for RX pipe: %d", ret);
|
||||||
@@ -4961,7 +4980,7 @@ static void hdd_ipa_teardown_sys_pipe(struct hdd_ipa_priv *hdd_ipa)
|
|||||||
int ret = 0, i;
|
int ret = 0, i;
|
||||||
uint32_t max_desc_cnt;
|
uint32_t max_desc_cnt;
|
||||||
struct hdd_ipa_tx_desc *tmp_desc;
|
struct hdd_ipa_tx_desc *tmp_desc;
|
||||||
struct ipa_rx_data *ipa_tx_desc;
|
qdf_ipa_rx_data_t *ipa_tx_desc;
|
||||||
|
|
||||||
for (i = 0; i < HDD_IPA_MAX_SYSBAM_PIPE; i++) {
|
for (i = 0; i < HDD_IPA_MAX_SYSBAM_PIPE; i++) {
|
||||||
if (hdd_ipa->sys_pipe[i].conn_hdl_valid) {
|
if (hdd_ipa->sys_pipe[i].conn_hdl_valid) {
|
||||||
@@ -5124,8 +5143,9 @@ static int __hdd_ipa_send_mcc_scc_msg(struct hdd_context *hdd_ctx,
|
|||||||
hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL;
|
hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL;
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
struct hdd_adapter *adapter;
|
struct hdd_adapter *adapter;
|
||||||
struct ipa_msg_meta meta;
|
qdf_ipa_msg_meta_t meta;
|
||||||
struct ipa_wlan_msg *msg;
|
qdf_ipa_wlan_msg_t *msg;
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (wlan_hdd_validate_context(hdd_ctx))
|
if (wlan_hdd_validate_context(hdd_ctx))
|
||||||
@@ -5152,22 +5172,22 @@ static int __hdd_ipa_send_mcc_scc_msg(struct hdd_context *hdd_ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Send SCC/MCC Switching event to IPA */
|
/* Send SCC/MCC Switching event to IPA */
|
||||||
meta.msg_len = sizeof(*msg);
|
QDF_IPA_MSG_META_MSG_LEN(&meta) = sizeof(*msg);
|
||||||
msg = qdf_mem_malloc(meta.msg_len);
|
msg = qdf_mem_malloc(QDF_IPA_MSG_META_MSG_LEN(&meta));
|
||||||
if (msg == NULL) {
|
if (msg == NULL) {
|
||||||
hdd_err("msg allocation failed");
|
hdd_err("msg allocation failed");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
meta.msg_type = mcc_mode ?
|
QDF_IPA_MSG_META_MSG_TYPE(&meta) = mcc_mode ?
|
||||||
WLAN_SWITCH_TO_MCC : WLAN_SWITCH_TO_SCC;
|
WLAN_SWITCH_TO_MCC : WLAN_SWITCH_TO_SCC;
|
||||||
hdd_debug("ipa_send_msg(Evt:%d)", meta.msg_type);
|
hdd_debug("ipa_send_msg(Evt:%d)", QDF_IPA_MSG_META_MSG_TYPE(&meta));
|
||||||
|
|
||||||
ret = ipa_send_msg(&meta, msg, hdd_ipa_msg_free_fn);
|
ret = qdf_ipa_send_msg(&meta, msg, hdd_ipa_msg_free_fn);
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
hdd_err("ipa_send_msg(Evt:%d) - fail=%d",
|
hdd_err("ipa_send_msg(Evt:%d) - fail=%d",
|
||||||
meta.msg_type, ret);
|
QDF_IPA_MSG_META_MSG_TYPE(&meta), ret);
|
||||||
qdf_mem_free(msg);
|
qdf_mem_free(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5196,12 +5216,12 @@ int hdd_ipa_send_mcc_scc_msg(struct hdd_context *hdd_ctx, bool mcc_mode)
|
|||||||
* hdd_to_ipa_wlan_event() - convert hdd_ipa_wlan_event to ipa_wlan_event
|
* hdd_to_ipa_wlan_event() - convert hdd_ipa_wlan_event to ipa_wlan_event
|
||||||
* @hdd_ipa_event_type: HDD IPA WLAN event to be converted to an ipa_wlan_event
|
* @hdd_ipa_event_type: HDD IPA WLAN event to be converted to an ipa_wlan_event
|
||||||
*
|
*
|
||||||
* Return: ipa_wlan_event representing the hdd_ipa_wlan_event
|
* Return: qdf_ipa_wlan_event representing the hdd_ipa_wlan_event
|
||||||
*/
|
*/
|
||||||
static enum ipa_wlan_event
|
static qdf_ipa_wlan_event_t
|
||||||
hdd_to_ipa_wlan_event(enum hdd_ipa_wlan_event hdd_ipa_event_type)
|
hdd_to_ipa_wlan_event(enum hdd_ipa_wlan_event hdd_ipa_event_type)
|
||||||
{
|
{
|
||||||
enum ipa_wlan_event ipa_event;
|
qdf_ipa_wlan_event_t ipa_event;
|
||||||
|
|
||||||
switch (hdd_ipa_event_type) {
|
switch (hdd_ipa_event_type) {
|
||||||
case HDD_IPA_CLIENT_CONNECT:
|
case HDD_IPA_CLIENT_CONNECT:
|
||||||
@@ -5246,12 +5266,12 @@ hdd_to_ipa_wlan_event(enum hdd_ipa_wlan_event hdd_ipa_event_type)
|
|||||||
* Return: 0 on success, negative errno value on error
|
* Return: 0 on success, negative errno value on error
|
||||||
*/
|
*/
|
||||||
static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id,
|
static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id,
|
||||||
enum ipa_wlan_event type, uint8_t *mac_addr)
|
qdf_ipa_wlan_event_t type, uint8_t *mac_addr)
|
||||||
{
|
{
|
||||||
struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
|
struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
|
||||||
struct ipa_msg_meta meta;
|
qdf_ipa_msg_meta_t meta;
|
||||||
struct ipa_wlan_msg *msg;
|
qdf_ipa_wlan_msg_t *msg;
|
||||||
struct ipa_wlan_msg_ex *msg_ex = NULL;
|
qdf_ipa_wlan_msg_ex_t *msg_ex = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "%s: EVT: %s, MAC: %pM, sta_id: %d",
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "%s: EVT: %s, MAC: %pM, sta_id: %d",
|
||||||
@@ -5348,7 +5368,7 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id,
|
|||||||
|
|
||||||
hdd_ipa->stats.event[type]++;
|
hdd_ipa->stats.event[type]++;
|
||||||
|
|
||||||
meta.msg_type = type;
|
QDF_IPA_MSG_META_MSG_TYPE(&meta) = type;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case WLAN_STA_CONNECT:
|
case WLAN_STA_CONNECT:
|
||||||
qdf_mutex_acquire(&hdd_ipa->event_lock);
|
qdf_mutex_acquire(&hdd_ipa->event_lock);
|
||||||
@@ -5404,7 +5424,7 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id,
|
|||||||
if (ret) {
|
if (ret) {
|
||||||
qdf_mutex_release(&hdd_ipa->event_lock);
|
qdf_mutex_release(&hdd_ipa->event_lock);
|
||||||
hdd_err("%s: Evt: %d, Interface setup failed",
|
hdd_err("%s: Evt: %d, Interface setup failed",
|
||||||
msg_ex->name, meta.msg_type);
|
msg_ex->name, QDF_IPA_MSG_META_MSG_TYPE(&meta));
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5428,7 +5448,7 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id,
|
|||||||
if (!hdd_ipa->sta_connected) {
|
if (!hdd_ipa->sta_connected) {
|
||||||
qdf_mutex_release(&hdd_ipa->event_lock);
|
qdf_mutex_release(&hdd_ipa->event_lock);
|
||||||
hdd_err("%s: Evt: %d, STA already disconnected",
|
hdd_err("%s: Evt: %d, STA already disconnected",
|
||||||
msg_ex->name, meta.msg_type);
|
msg_ex->name, QDF_IPA_MSG_META_MSG_TYPE(&meta));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5470,7 +5490,7 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id,
|
|||||||
if (!adapter->ipa_context) {
|
if (!adapter->ipa_context) {
|
||||||
qdf_mutex_release(&hdd_ipa->event_lock);
|
qdf_mutex_release(&hdd_ipa->event_lock);
|
||||||
hdd_err("%s: Evt: %d, SAP already disconnected",
|
hdd_err("%s: Evt: %d, SAP already disconnected",
|
||||||
msg_ex->name, meta.msg_type);
|
msg_ex->name, QDF_IPA_MSG_META_MSG_TYPE(&meta));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5570,10 +5590,11 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id,
|
|||||||
|
|
||||||
qdf_mutex_release(&hdd_ipa->event_lock);
|
qdf_mutex_release(&hdd_ipa->event_lock);
|
||||||
|
|
||||||
meta.msg_type = type;
|
QDF_IPA_MSG_META_MSG_TYPE(&meta) = type;
|
||||||
meta.msg_len = (sizeof(struct ipa_wlan_msg_ex) +
|
QDF_IPA_MSG_META_MSG_LEN(&meta) =
|
||||||
sizeof(struct ipa_wlan_hdr_attrib_val));
|
(sizeof(qdf_ipa_wlan_msg_ex_t) +
|
||||||
msg_ex = qdf_mem_malloc(meta.msg_len);
|
sizeof(qdf_ipa_wlan_hdr_attrib_val_t));
|
||||||
|
msg_ex = qdf_mem_malloc(QDF_IPA_MSG_META_MSG_LEN(&meta));
|
||||||
|
|
||||||
if (msg_ex == NULL) {
|
if (msg_ex == NULL) {
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
||||||
@@ -5620,7 +5641,7 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id,
|
|||||||
if (!hdd_ipa->sap_num_connected_sta) {
|
if (!hdd_ipa->sap_num_connected_sta) {
|
||||||
qdf_mutex_release(&hdd_ipa->event_lock);
|
qdf_mutex_release(&hdd_ipa->event_lock);
|
||||||
hdd_err("%s: Evt: %d, Client already disconnected",
|
hdd_err("%s: Evt: %d, Client already disconnected",
|
||||||
msg_ex->name, meta.msg_type);
|
msg_ex->name, QDF_IPA_MSG_META_MSG_TYPE(&meta));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!hdd_ipa_uc_find_add_assoc_sta(hdd_ipa, false, sta_id)) {
|
if (!hdd_ipa_uc_find_add_assoc_sta(hdd_ipa, false, sta_id)) {
|
||||||
@@ -5664,25 +5685,28 @@ static int __hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
meta.msg_len = sizeof(struct ipa_wlan_msg);
|
QDF_IPA_MSG_META_MSG_LEN(&meta) = sizeof(qdf_ipa_wlan_msg_t);
|
||||||
msg = qdf_mem_malloc(meta.msg_len);
|
msg = qdf_mem_malloc(QDF_IPA_MSG_META_MSG_LEN(&meta));
|
||||||
if (msg == NULL) {
|
if (msg == NULL) {
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "msg allocation failed");
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "msg allocation failed");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
meta.msg_type = type;
|
QDF_IPA_MSG_META_MSG_TYPE(&meta) = type;
|
||||||
strlcpy(msg->name, adapter->dev->name, IPA_RESOURCE_NAME_MAX);
|
strlcpy(QDF_IPA_WLAN_MSG_NAME(msg), adapter->dev->name,
|
||||||
memcpy(msg->mac_addr, mac_addr, ETH_ALEN);
|
IPA_RESOURCE_NAME_MAX);
|
||||||
|
memcpy(QDF_IPA_WLAN_MSG_MAC_ADDR(msg), mac_addr, ETH_ALEN);
|
||||||
|
|
||||||
HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "%s: Evt: %d",
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "%s: Evt: %d",
|
||||||
msg->name, meta.msg_type);
|
QDF_IPA_WLAN_MSG_NAME(msg),
|
||||||
|
QDF_IPA_MSG_META_MSG_TYPE(&meta));
|
||||||
|
|
||||||
ret = ipa_send_msg(&meta, msg, hdd_ipa_msg_free_fn);
|
ret = ipa_send_msg(&meta, msg, hdd_ipa_msg_free_fn);
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
hdd_err("%s: Evt: %d fail:%d",
|
hdd_err("%s: Evt: %d fail:%d",
|
||||||
msg->name, meta.msg_type, ret);
|
QDF_IPA_WLAN_MSG_NAME(msg),
|
||||||
|
QDF_IPA_MSG_META_MSG_TYPE(&meta), ret);
|
||||||
qdf_mem_free(msg);
|
qdf_mem_free(msg);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -5707,7 +5731,7 @@ end:
|
|||||||
int hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id,
|
int hdd_ipa_wlan_evt(struct hdd_adapter *adapter, uint8_t sta_id,
|
||||||
enum hdd_ipa_wlan_event hdd_event_type, uint8_t *mac_addr)
|
enum hdd_ipa_wlan_event hdd_event_type, uint8_t *mac_addr)
|
||||||
{
|
{
|
||||||
enum ipa_wlan_event type = hdd_to_ipa_wlan_event(hdd_event_type);
|
qdf_ipa_wlan_event_t type = hdd_to_ipa_wlan_event(hdd_event_type);
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
cds_ssr_protect(__func__);
|
cds_ssr_protect(__func__);
|
||||||
@@ -5792,7 +5816,7 @@ static QDF_STATUS __hdd_ipa_init(struct hdd_context *hdd_ctx)
|
|||||||
int ret, i;
|
int ret, i;
|
||||||
struct hdd_ipa_iface_context *iface_context = NULL;
|
struct hdd_ipa_iface_context *iface_context = NULL;
|
||||||
struct ol_txrx_pdev_t *pdev = NULL;
|
struct ol_txrx_pdev_t *pdev = NULL;
|
||||||
struct ipa_rm_perf_profile profile;
|
qdf_ipa_rm_perf_profile_t profile;
|
||||||
|
|
||||||
if (!hdd_ipa_is_enabled(hdd_ctx))
|
if (!hdd_ipa_is_enabled(hdd_ctx))
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
|
Reference in New Issue
Block a user