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
This commit is contained in:
Chaithanya Garrepalli 2018-04-11 17:49:28 +05:30 • committed by nshrivas
commit 2f5727960b
6 changed files with 44 additions and 10 deletions

View file

@ -1558,4 +1558,12 @@ void cdp_if_mgmt_drain(ol_txrx_soc_handle soc,
if (soc->ops->cmn_drv_ops->txrx_if_mgmt_drain)
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_ */

View file

@ -303,6 +303,9 @@ struct cdp_cmn_ops {
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;
};

View file

@ -2060,9 +2060,6 @@ static int dp_soc_cmn_setup(struct dp_soc *soc)
if (qdf_atomic_read(&soc->cmn_init_done))
return 0;
if (dp_peer_find_attach(soc))
goto fail0;
if (dp_hw_link_desc_pool_setup(soc))
goto fail1;
@ -2269,7 +2266,6 @@ fail1:
* Cleanup will be done as part of soc_detach, which will
* be called on pdev attach failure
*/
fail0:
return QDF_STATUS_E_FAILURE;
}
@ -6832,6 +6828,21 @@ static QDF_STATUS dp_config_for_nac_rssi(struct cdp_vdev *vdev_handle,
}
#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 = {
.txrx_soc_attach_target = dp_soc_attach_target_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_table = dp_wds_reset_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 = {

View file

@ -69,9 +69,8 @@ static int dp_peer_find_map_attach(struct dp_soc *soc)
{
uint32_t max_peers, peer_map_size;
max_peers = soc->max_peers;
/* 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,
"\n<=== cfg max peer id %d ====>\n", max_peers);
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;
/* 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_SHIFT;
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;
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);
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;
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 */
peer = dp_peer_find_hash_find(soc, peer_mac_addr,
0 /* is aligned */, vdev_id);

View file

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