From 152c87421e5608dbc5131f6f717062efba008511 Mon Sep 17 00:00:00 2001 From: Wu Gao Date: Mon, 24 Apr 2017 19:17:12 +0800 Subject: [PATCH] qcacmn: register vendor specific action frame after P2P started It only register vendor specific action frame when requested remain on channel. When DUT as GO and invite third P2P peer, there isn't remain on channel request and doesn't register this action frame from mgmt txrx component, then P2P component can't receive provision discover request frame and invitation failed. Change-Id: Ia04e1af97aedf91fd75047b12994011b054177fc CRs-Fixed: 2037600 --- core/src/wlan_p2p_main.c | 6 ++++++ core/src/wlan_p2p_roc.c | 33 ++++++++++++++++++++++++++------- core/src/wlan_p2p_roc.h | 13 +++++++++++++ 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/core/src/wlan_p2p_main.c b/core/src/wlan_p2p_main.c index 3c91293707ef..bc613c69b657 100644 --- a/core/src/wlan_p2p_main.c +++ b/core/src/wlan_p2p_main.c @@ -564,6 +564,9 @@ QDF_STATUS p2p_psoc_start(struct wlan_objmgr_psoc *soc, soc, P2P_MODULE_NAME, tgt_p2p_scan_event_cb, p2p_soc_obj); + /* register rx action frame */ + p2p_mgmt_rx_action_ops(soc, true); + p2p_debug("p2p psoc start successful, scan request id:%d", p2p_soc_obj->scan_req_id); @@ -594,6 +597,9 @@ QDF_STATUS p2p_psoc_stop(struct wlan_objmgr_psoc *soc) return QDF_STATUS_E_FAILURE; } + /* unregister rx action frame */ + p2p_mgmt_rx_action_ops(soc, false); + /* clean up queue of p2p psoc private object */ p2p_cleanup_tx_queue(p2p_soc_obj); p2p_cleanup_roc_queue(p2p_soc_obj); diff --git a/core/src/wlan_p2p_roc.c b/core/src/wlan_p2p_roc.c index facf285a7e09..0f7dc7871100 100644 --- a/core/src/wlan_p2p_roc.c +++ b/core/src/wlan_p2p_roc.c @@ -49,22 +49,20 @@ static QDF_STATUS p2p_mgmt_rx_ops(struct wlan_objmgr_psoc *psoc, bool isregister) { - struct mgmt_txrx_mgmt_frame_cb_info frm_cb_info[2]; + struct mgmt_txrx_mgmt_frame_cb_info frm_cb_info; QDF_STATUS status; p2p_debug("psoc:%p, is register rx:%d", psoc, isregister); - frm_cb_info[0].frm_type = MGMT_PROBE_REQ; - frm_cb_info[0].mgmt_rx_cb = tgt_p2p_mgmt_frame_rx_cb; - frm_cb_info[1].frm_type = MGMT_ACTION_VENDOR_SPECIFIC; - frm_cb_info[1].mgmt_rx_cb = tgt_p2p_mgmt_frame_rx_cb; + frm_cb_info.frm_type = MGMT_PROBE_REQ; + frm_cb_info.mgmt_rx_cb = tgt_p2p_mgmt_frame_rx_cb; if (isregister) status = wlan_mgmt_txrx_register_rx_cb(psoc, - WLAN_UMAC_COMP_P2P, frm_cb_info, 2); + WLAN_UMAC_COMP_P2P, &frm_cb_info, 1); else status = wlan_mgmt_txrx_deregister_rx_cb(psoc, - WLAN_UMAC_COMP_P2P, frm_cb_info, 2); + WLAN_UMAC_COMP_P2P, &frm_cb_info, 1); return status; } @@ -544,6 +542,27 @@ static QDF_STATUS p2p_process_scan_complete_evt( return status; } +QDF_STATUS p2p_mgmt_rx_action_ops(struct wlan_objmgr_psoc *psoc, + bool isregister) +{ + struct mgmt_txrx_mgmt_frame_cb_info frm_cb_info; + QDF_STATUS status; + + p2p_debug("psoc:%p, is register rx:%d", psoc, isregister); + + frm_cb_info.frm_type = MGMT_ACTION_VENDOR_SPECIFIC; + frm_cb_info.mgmt_rx_cb = tgt_p2p_mgmt_frame_rx_cb; + + if (isregister) + status = wlan_mgmt_txrx_register_rx_cb(psoc, + WLAN_UMAC_COMP_P2P, &frm_cb_info, 1); + else + status = wlan_mgmt_txrx_deregister_rx_cb(psoc, + WLAN_UMAC_COMP_P2P, &frm_cb_info, 1); + + return status; +} + struct p2p_roc_context *p2p_find_current_roc_ctx( struct p2p_soc_priv_obj *p2p_soc_obj) { diff --git a/core/src/wlan_p2p_roc.h b/core/src/wlan_p2p_roc.h index 354d13382afb..3eb8b5114fc3 100644 --- a/core/src/wlan_p2p_roc.h +++ b/core/src/wlan_p2p_roc.h @@ -109,6 +109,19 @@ struct cancel_roc_context { uint64_t cookie; }; +/** + * p2p_mgmt_rx_action_ops() - register or unregister rx action callback + * @psoc: psoc object + * @isregister: register if true, unregister if false + * + * This function registers or unregisters rx action frame callback to + * mgmt txrx component. + * + * Return: QDF_STATUS_SUCCESS - in case of success + */ +QDF_STATUS p2p_mgmt_rx_action_ops(struct wlan_objmgr_psoc *psoc, + bool isregister); + /** * p2p_find_current_roc_ctx() - Find out roc context in progressing * @p2p_soc_obj: p2p psoc private object