Browse Source

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
Wu Gao 8 years ago
parent
commit
a21c3d1797

+ 6 - 0
umac/p2p/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);

+ 26 - 7
umac/p2p/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)
 {

+ 13 - 0
umac/p2p/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