From 6b0d2a800c6160dd8f4af3f7d0ec85d1bf6b563a Mon Sep 17 00:00:00 2001 From: "Pamidipati, Vijay" Date: Fri, 9 Jun 2017 04:46:32 +0530 Subject: [PATCH] qcacmn: Add a configure interface to get max_peers from OL_IF to DP Currently max_peer value is hardcoded with DP wlan_cfg. This change adds a generic interface to obtain a configuration parameter from OL_IF and store in DP Change-Id: Id437ab3bcd02fb1cbcbe8b56d55d19780af87066 CRs-Fixed: 2004658 --- dp/inc/cdp_txrx_cfg.h | 5 +++++ dp/inc/cdp_txrx_cmn_struct.h | 9 +++++++++ dp/inc/cdp_txrx_ops.h | 1 + dp/wifi3.0/dp_main.c | 10 ++++++++++ wlan_cfg/wlan_cfg.c | 10 ++++++++-- wlan_cfg/wlan_cfg.h | 3 +++ 6 files changed, 36 insertions(+), 2 deletions(-) diff --git a/dp/inc/cdp_txrx_cfg.h b/dp/inc/cdp_txrx_cfg.h index b9715a56c1..d5ef3eb7f9 100644 --- a/dp/inc/cdp_txrx_cfg.h +++ b/dp/inc/cdp_txrx_cfg.h @@ -254,4 +254,9 @@ static inline void cdp_cfg_set_flow_steering(ol_txrx_soc_handle soc, return; } + +static inline void cdp_cfg_get_max_peer_id(ol_txrx_soc_handle soc, + struct cdp_cfg *cfg_pdev) +{ +} #endif /* _CDP_TXRX_CFG_H_ */ diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index 2a7d2c3f7b..dba86835a4 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -89,6 +89,15 @@ WME_AC_VO) #define CDP_MAX_RX_RINGS 4 + +/* + * DP configuration parameters + */ +enum cdp_cfg_param_type { + CDP_CFG_MAX_PEER_ID, + CDP_CFG_NUM_PARAMS +}; + /* * htt_dbg_stats_type - * bit positions for each stats type within a stats type bitmask diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 2d7ef00cb9..c35002d86a 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -615,6 +615,7 @@ struct ol_if_ops { uint8_t vdev_id, uint8_t *peer_mac_addr); int (*peer_unmap_event)(void *ol_soc_handle, uint16_t peer_id); + int (*get_dp_cfg_param)(void *ol_soc_handle, enum cdp_cfg_param_type param_num); /* TODO: Add any other control path calls required to OL_IF/WMA layer */ }; diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 117634a0e8..6efeee3164 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -4037,6 +4037,16 @@ void *dp_soc_attach_wifi3(void *osif_soc, void *hif_handle, FL("wlan_cfg_soc_attach failed")); goto fail2; } + + if (soc->cdp_soc.ol_ops->get_dp_cfg_param) { + int ret = soc->cdp_soc.ol_ops->get_dp_cfg_param(soc, + CDP_CFG_MAX_PEER_ID); + + if (ret != -EINVAL) { + wlan_cfg_set_max_peer_id(soc->wlan_cfg_ctx, ret); + } + } + qdf_spinlock_create(&soc->peer_ref_mutex); qdf_spinlock_create(&soc->reo_desc_freelist_lock); diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index f1a9c959c7..72a6a341af 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -182,9 +182,10 @@ struct wlan_cfg_dp_pdev_ctxt { * * Return: wlan_cfg_ctx - Handle to Configuration context */ -struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void) +struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach() { int i = 0; + struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx = qdf_mem_malloc(sizeof(struct wlan_cfg_dp_soc_ctxt)); @@ -202,8 +203,8 @@ struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void) wlan_cfg_ctx->num_tx_ext_desc_pool = WLAN_CFG_NUM_TXEXT_DESC_POOL; wlan_cfg_ctx->num_tx_desc = WLAN_CFG_NUM_TX_DESC; wlan_cfg_ctx->num_tx_ext_desc = WLAN_CFG_NUM_TX_EXT_DESC; - wlan_cfg_ctx->max_peer_id = WLAN_CFG_MAX_PEER_ID; wlan_cfg_ctx->htt_packet_type = WLAN_CFG_HTT_PKT_TYPE; + wlan_cfg_ctx->max_peer_id = WLAN_CFG_MAX_PEER_ID; for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) { wlan_cfg_ctx->int_tx_ring_mask[i] = tx_ring_mask[i]; @@ -249,6 +250,11 @@ void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num) cfg->num_int_ctxts = num; } +void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val) +{ + cfg->max_peer_id = val;; +} + void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context, int mask) { diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index a497843753..e6fa45c9a4 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -106,6 +106,9 @@ void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context, int mask); void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context, int mask); + +void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val); + /** * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered * @wlan_cfg_ctx - Configuration Handle