qcacmn: Do not remove id when tx action frame

Don't remove id tx action frame, since it will be removed when cleanup
related ROC. Limit the ROC duration if the original ROC duration is
very long.

Change-Id: I78e34710530a32f88e955471c974f7078df2e0a9
CRs-Fixed: 2302008
This commit is contained in:
Wu Gao 2018-09-06 19:01:13 +08:00 • committed by nshrivas
commit 2f608c555a
4 changed files with 23 additions and 18 deletions

View file

@ -966,6 +966,7 @@ static QDF_STATUS p2p_roc_req_for_tx_action(
roc_ctx->roc_state = ROC_STATE_IDLE;
roc_ctx->roc_type = OFF_CHANNEL_TX;
roc_ctx->tx_ctx = tx_ctx;
roc_ctx->id = tx_ctx->id;
tx_ctx->roc_cookie = (uintptr_t)roc_ctx;
p2p_debug("create roc request for off channel tx, tx ctx:%pK, roc ctx:%pK",
@ -1244,7 +1245,8 @@ static QDF_STATUS p2p_remove_tx_context(
}
end:
qdf_idr_remove(&p2p_soc_obj->p2p_idr, tx_ctx->id);
if (!tx_ctx->roc_cookie)
qdf_idr_remove(&p2p_soc_obj->p2p_idr, tx_ctx->id);
qdf_mem_free(tx_ctx->buf);
qdf_mem_free(tx_ctx);
@ -1885,6 +1887,7 @@ QDF_STATUS p2p_process_mgmt_tx(struct tx_action_context *tx_ctx)
fail:
p2p_send_tx_conf(tx_ctx, false);
qdf_idr_remove(&p2p_soc_obj->p2p_idr, tx_ctx->id);
qdf_mem_free(tx_ctx->buf);
qdf_mem_free(tx_ctx);

View file

@ -365,14 +365,20 @@ static QDF_STATUS p2p_execute_roc_req(struct p2p_roc_context *roc_ctx)
}
roc_ctx->roc_state = ROC_STATE_REQUESTED;
go_num = policy_mgr_mode_specific_connection_count(
p2p_soc_obj->soc, PM_P2P_GO_MODE, NULL);
p2p_debug("present go number:%d", go_num);
if (go_num)
roc_ctx->duration *= P2P_ROC_DURATION_MULTI_GO_PRESENT;
else
roc_ctx->duration *= P2P_ROC_DURATION_MULTI_GO_ABSENT;
if (roc_ctx->duration < P2P_MAX_ROC_DURATION) {
go_num = policy_mgr_mode_specific_connection_count(
p2p_soc_obj->soc, PM_P2P_GO_MODE, NULL);
p2p_debug("present go number:%d", go_num);
if (go_num)
roc_ctx->duration *= P2P_ROC_DURATION_MULTI_GO_PRESENT;
else
roc_ctx->duration *= P2P_ROC_DURATION_MULTI_GO_ABSENT;
/* this is to protect too huge value if some customers
* give a higher value from supplicant
*/
if (roc_ctx->duration > P2P_MAX_ROC_DURATION)
roc_ctx->duration = P2P_MAX_ROC_DURATION;
}
status = p2p_scan_start(roc_ctx);
if (status != QDF_STATUS_SUCCESS) {
qdf_mc_timer_destroy(&roc_ctx->roc_timer);

View file

@ -30,16 +30,11 @@
#define P2P_EVENT_PROPAGATE_TIME 10
#define P2P_WAIT_CANCEL_ROC 1000
#define P2P_WAIT_CLEANUP_ROC 2000
#define P2P_MAX_ROC_DURATION 1500
#ifdef QCA_WIFI_3_0_EMU
#define P2P_ROC_DURATION_MULTI_GO_PRESENT 2
#define P2P_ROC_DURATION_MULTI_GO_ABSENT 3
#define P2P_ACTION_FRAME_DEFAULT_WAIT 500
#else
#define P2P_ROC_DURATION_MULTI_GO_PRESENT 2
#define P2P_ROC_DURATION_MULTI_GO_ABSENT 5
#define P2P_ROC_DURATION_MULTI_GO_PRESENT 6
#define P2P_ROC_DURATION_MULTI_GO_ABSENT 10
#define P2P_ACTION_FRAME_DEFAULT_WAIT 200
#endif
struct wlan_objmgr_vdev;
struct scan_event;

View file

@ -392,10 +392,11 @@ QDF_STATUS ucfg_p2p_mgmt_tx_cancel(struct wlan_objmgr_psoc *soc,
}
if (QDF_STATUS_SUCCESS != qdf_idr_find(&p2p_soc_obj->p2p_idr,
cookie, &tx_ctx)) {
(int32_t)cookie, &tx_ctx)) {
p2p_debug("invalid id");
return QDF_STATUS_E_INVAL;
}
qdf_idr_remove(&p2p_soc_obj->p2p_idr, (int32_t)cookie);
cancel_tx = qdf_mem_malloc(sizeof(*cancel_tx));
if (!cancel_tx) {