From 4fe2308438d17af7edef04c0522fffbc05d22582 Mon Sep 17 00:00:00 2001 From: Wu Gao Date: Mon, 25 Feb 2019 14:37:30 +0800 Subject: [PATCH] qcacld-3.0: Avoid to start ROC with invalid duration Up layer tx probe response frame with wait/duration 0, which may be start ROC with duration 0 and then tx mgmt frame fail since of very short ROC and no enough time to wait for tx ack. Change-Id: I5243ff10726b642d8cf18992a230d741f9d2655f CRs-Fixed: 2397719 --- components/p2p/core/src/wlan_p2p_off_chan_tx.c | 5 +++++ components/p2p/core/src/wlan_p2p_roc.c | 6 ++++++ components/p2p/core/src/wlan_p2p_roc.h | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/components/p2p/core/src/wlan_p2p_off_chan_tx.c b/components/p2p/core/src/wlan_p2p_off_chan_tx.c index a74fcb6c9ef6..3eb625152743 100644 --- a/components/p2p/core/src/wlan_p2p_off_chan_tx.c +++ b/components/p2p/core/src/wlan_p2p_off_chan_tx.c @@ -2804,6 +2804,11 @@ QDF_STATUS p2p_process_mgmt_tx(struct tx_action_context *tx_ctx) } } + if (!tx_ctx->duration) { + tx_ctx->duration = P2P_ACTION_FRAME_DEFAULT_WAIT; + p2p_debug("use default wait %d", + P2P_ACTION_FRAME_DEFAULT_WAIT); + } status = p2p_roc_req_for_tx_action(tx_ctx); if (status != QDF_STATUS_SUCCESS) { p2p_err("Failed to request roc before off chan tx"); diff --git a/components/p2p/core/src/wlan_p2p_roc.c b/components/p2p/core/src/wlan_p2p_roc.c index 3755bc5f0d7b..7f87c7e8fecb 100644 --- a/components/p2p/core/src/wlan_p2p_roc.c +++ b/components/p2p/core/src/wlan_p2p_roc.c @@ -100,6 +100,12 @@ static QDF_STATUS p2p_scan_start(struct p2p_roc_context *roc_ctx) ucfg_scan_init_default_params(vdev, req); + if (!roc_ctx->duration) { + roc_ctx->duration = P2P_ROC_DEFAULT_DURATION; + p2p_debug("use default duration %d", + P2P_ROC_DEFAULT_DURATION); + } + roc_ctx->scan_id = ucfg_scan_get_scan_id(p2p_soc_obj->soc); req->vdev = vdev; req->scan_req.scan_id = roc_ctx->scan_id; diff --git a/components/p2p/core/src/wlan_p2p_roc.h b/components/p2p/core/src/wlan_p2p_roc.h index 5e49b1497647..e82d8caee189 100644 --- a/components/p2p/core/src/wlan_p2p_roc.h +++ b/components/p2p/core/src/wlan_p2p_roc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -35,6 +35,7 @@ #define P2P_ROC_DURATION_MULTI_GO_PRESENT 6 #define P2P_ROC_DURATION_MULTI_GO_ABSENT 10 #define P2P_ACTION_FRAME_DEFAULT_WAIT 200 +#define P2P_ROC_DEFAULT_DURATION 200 struct wlan_objmgr_vdev; struct scan_event;