qcacmn: Initialize dp peer map memory after WMI service ready

Initialize the peer map and peer hash memory based on the config
received from target in service ready event

Change-Id: I8e1b62cd9586f5b2be7acb863a106d2486be1b35
CRs-Fixed: 2223428
このコミットが含まれているのは:
Chaithanya Garrepalli
2018-04-11 17:49:28 +05:30
committed by nshrivas
コミット 2f5727960b
6個のファイルの変更44行の追加10行の削除

ファイルの表示

@@ -1558,4 +1558,12 @@ void cdp_if_mgmt_drain(ol_txrx_soc_handle soc,
if (soc->ops->cmn_drv_ops->txrx_if_mgmt_drain) if (soc->ops->cmn_drv_ops->txrx_if_mgmt_drain)
soc->ops->cmn_drv_ops->txrx_if_mgmt_drain(ni, force); soc->ops->cmn_drv_ops->txrx_if_mgmt_drain(ni, force);
} }
static inline void
cdp_peer_map_attach(ol_txrx_soc_handle soc, uint32_t max_peers)
{
if (soc && soc->ops && soc->ops->cmn_drv_ops &&
soc->ops->cmn_drv_ops->txrx_peer_map_attach)
soc->ops->cmn_drv_ops->txrx_peer_map_attach(soc, max_peers);
}
#endif /* _CDP_TXRX_CMN_H_ */ #endif /* _CDP_TXRX_CMN_H_ */

ファイルの表示

@@ -303,6 +303,9 @@ struct cdp_cmn_ops {
void (*txrx_peer_flush_ast_table)(ol_txrx_soc_handle soc); void (*txrx_peer_flush_ast_table)(ol_txrx_soc_handle soc);
QDF_STATUS (*txrx_peer_map_attach)(ol_txrx_soc_handle soc,
uint32_t num_peers);
ol_txrx_tx_fp tx_send; ol_txrx_tx_fp tx_send;
}; };

ファイルの表示

@@ -2060,9 +2060,6 @@ static int dp_soc_cmn_setup(struct dp_soc *soc)
if (qdf_atomic_read(&soc->cmn_init_done)) if (qdf_atomic_read(&soc->cmn_init_done))
return 0; return 0;
if (dp_peer_find_attach(soc))
goto fail0;
if (dp_hw_link_desc_pool_setup(soc)) if (dp_hw_link_desc_pool_setup(soc))
goto fail1; goto fail1;
@@ -2269,7 +2266,6 @@ fail1:
* Cleanup will be done as part of soc_detach, which will * Cleanup will be done as part of soc_detach, which will
* be called on pdev attach failure * be called on pdev attach failure
*/ */
fail0:
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
@@ -6832,6 +6828,21 @@ static QDF_STATUS dp_config_for_nac_rssi(struct cdp_vdev *vdev_handle,
} }
#endif #endif
static QDF_STATUS dp_peer_map_attach_wifi3(struct cdp_soc_t *soc_hdl,
uint32_t max_peers)
{
struct dp_soc *soc = (struct dp_soc *)soc_hdl;
soc->max_peers = max_peers;
qdf_print ("%s max_peers %u\n", __func__, max_peers);
if (dp_peer_find_attach(soc))
return QDF_STATUS_E_FAILURE;
return QDF_STATUS_SUCCESS;
}
static struct cdp_cmn_ops dp_ops_cmn = { static struct cdp_cmn_ops dp_ops_cmn = {
.txrx_soc_attach_target = dp_soc_attach_target_wifi3, .txrx_soc_attach_target = dp_soc_attach_target_wifi3,
.txrx_vdev_attach = dp_vdev_attach_wifi3, .txrx_vdev_attach = dp_vdev_attach_wifi3,
@@ -6896,6 +6907,7 @@ static struct cdp_cmn_ops dp_ops_cmn = {
.txrx_peer_reset_ast = dp_wds_reset_ast_wifi3, .txrx_peer_reset_ast = dp_wds_reset_ast_wifi3,
.txrx_peer_reset_ast_table = dp_wds_reset_ast_table_wifi3, .txrx_peer_reset_ast_table = dp_wds_reset_ast_table_wifi3,
.txrx_peer_flush_ast_table = dp_wds_flush_ast_table_wifi3, .txrx_peer_flush_ast_table = dp_wds_flush_ast_table_wifi3,
.txrx_peer_map_attach = dp_peer_map_attach_wifi3,
}; };
static struct cdp_ctrl_ops dp_ops_ctrl = { static struct cdp_ctrl_ops dp_ops_ctrl = {

ファイルの表示

@@ -69,9 +69,8 @@ static int dp_peer_find_map_attach(struct dp_soc *soc)
{ {
uint32_t max_peers, peer_map_size; uint32_t max_peers, peer_map_size;
max_peers = soc->max_peers;
/* allocate the peer ID -> peer object map */ /* allocate the peer ID -> peer object map */
max_peers = wlan_cfg_max_peer_id(soc->wlan_cfg_ctx) + 1;
soc->max_peers = max_peers;
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO, QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO,
"\n<=== cfg max peer id %d ====>\n", max_peers); "\n<=== cfg max peer id %d ====>\n", max_peers);
peer_map_size = max_peers * sizeof(soc->peer_id_to_obj_map[0]); peer_map_size = max_peers * sizeof(soc->peer_id_to_obj_map[0]);
@@ -133,7 +132,7 @@ static int dp_peer_find_hash_attach(struct dp_soc *soc)
int i, hash_elems, log2; int i, hash_elems, log2;
/* allocate the peer MAC address -> peer object hash table */ /* allocate the peer MAC address -> peer object hash table */
hash_elems = wlan_cfg_max_peer_id(soc->wlan_cfg_ctx) + 1; hash_elems = soc->max_peers;
hash_elems *= DP_PEER_HASH_LOAD_MULT; hash_elems *= DP_PEER_HASH_LOAD_MULT;
hash_elems >>= DP_PEER_HASH_LOAD_SHIFT; hash_elems >>= DP_PEER_HASH_LOAD_SHIFT;
log2 = dp_log2_ceil(hash_elems); log2 = dp_log2_ceil(hash_elems);
@@ -201,7 +200,7 @@ static int dp_peer_ast_hash_attach(struct dp_soc *soc)
{ {
int i, hash_elems, log2; int i, hash_elems, log2;
hash_elems = ((WLAN_UMAC_PSOC_MAX_PEERS * DP_AST_HASH_LOAD_MULT) >> hash_elems = ((soc->max_peers * DP_AST_HASH_LOAD_MULT) >>
DP_AST_HASH_LOAD_SHIFT); DP_AST_HASH_LOAD_SHIFT);
log2 = dp_log2_ceil(hash_elems); log2 = dp_log2_ceil(hash_elems);
@@ -902,7 +901,7 @@ static inline struct dp_peer *dp_peer_find_add_id(struct dp_soc *soc,
{ {
struct dp_peer *peer; struct dp_peer *peer;
QDF_ASSERT(peer_id <= wlan_cfg_max_peer_id(soc->wlan_cfg_ctx) + 1); QDF_ASSERT(peer_id <= soc->max_peers);
/* check if there's already a peer object with this MAC address */ /* check if there's already a peer object with this MAC address */
peer = dp_peer_find_hash_find(soc, peer_mac_addr, peer = dp_peer_find_hash_find(soc, peer_mac_addr,
0 /* is aligned */, vdev_id); 0 /* is aligned */, vdev_id);

ファイルの表示

@@ -789,7 +789,7 @@ struct dp_soc {
DP_MUTEX_TYPE peer_ref_mutex; DP_MUTEX_TYPE peer_ref_mutex;
/* maximum value for peer_id */ /* maximum value for peer_id */
int max_peers; uint32_t max_peers;
/* SoC level data path statistics */ /* SoC level data path statistics */
struct dp_soc_stats stats; struct dp_soc_stats stats;

ファイルの表示

@@ -31,6 +31,7 @@
#include <service_ready_util.h> #include <service_ready_util.h>
#include <service_ready_param.h> #include <service_ready_param.h>
#include <init_cmd_api.h> #include <init_cmd_api.h>
#include <cdp_txrx_cmn.h>
static int init_deinit_service_ready_event_handler(ol_scn_t scn_handle, static int init_deinit_service_ready_event_handler(ol_scn_t scn_handle,
uint8_t *event, uint8_t *event,
@@ -309,6 +310,7 @@ static int init_deinit_ready_event_handler(ol_scn_t scn_handle,
struct wmi_host_ready_ev_param ready_ev; struct wmi_host_ready_ev_param ready_ev;
wmi_legacy_service_ready_callback legacy_callback; wmi_legacy_service_ready_callback legacy_callback;
uint8_t num_radios, i; uint8_t num_radios, i;
uint32_t max_peers;
if (!scn_handle) { if (!scn_handle) {
target_if_err("scn handle NULL"); target_if_err("scn handle NULL");
@@ -359,6 +361,16 @@ static int init_deinit_ready_event_handler(ol_scn_t scn_handle,
info->wlan_res_cfg.num_peers = ready_ev.num_total_peer; info->wlan_res_cfg.num_peers = ready_ev.num_total_peer;
} }
/* for non legacy num_total_peer will be non zero
* allocate peer memory in this case
*/
if (ready_ev.num_total_peer != 0) {
max_peers = info->wlan_res_cfg.num_peers +
ready_ev.num_extra_peer + 1;
cdp_peer_map_attach(wlan_psoc_get_dp_handle(psoc), max_peers);
}
/* Indicate to the waiting thread that the ready /* Indicate to the waiting thread that the ready
* event was received * event was received
*/ */