Переглянути джерело

qcacmn: support presence request

Support presence request frame in P2P component.

Change-Id: I21c1e63742396f328da1b2c7b2446abc4c35ef52
CRs-Fixed: 2039628
Wu Gao 8 роки тому
батько
коміт
af44d14a13

+ 9 - 0
core/src/wlan_p2p_off_chan_tx.c

@@ -535,6 +535,8 @@ static char *p2p_get_frame_type_str(struct p2p_frame_info *frame_info)
 		return "Invalid P2P command";
 	}
 
+	if (frame_info->action_type == P2P_ACTION_PRESENCE_REQ)
+		return "P2P action presence request";
 	if (frame_info->action_type == P2P_ACTION_PRESENCE_RSP)
 		return "P2P action presence response";
 
@@ -651,6 +653,9 @@ static QDF_STATUS p2p_get_frame_info(uint8_t *data_buf, uint32_t length,
 		buf = data_buf +
 			P2P_ACTION_FRAME_TYPE_OFFSET;
 		action_type = buf[0];
+		if (action_type == P2P_ACTION_PRESENCE_REQ)
+			frame_info->action_type =
+				P2P_ACTION_PRESENCE_REQ;
 		if (action_type == P2P_ACTION_PRESENCE_RSP)
 			frame_info->action_type =
 				P2P_ACTION_PRESENCE_RSP;
@@ -1631,6 +1636,10 @@ QDF_STATUS p2p_process_rx_mgmt(
 		}
 	}
 
+	if (rx_mgmt->frm_type == MGMT_ACTION_CATEGORY_VENDOR_SPECIFIC)
+		p2p_get_frame_info(rx_mgmt->buf, rx_mgmt->frame_len,
+				&frame_info);
+
 	start_param = p2p_soc_obj->start_param;
 	if (start_param->rx_cb)
 		start_param->rx_cb(start_param->rx_cb_data, rx_mgmt);

+ 2 - 0
core/src/wlan_p2p_off_chan_tx.h

@@ -121,10 +121,12 @@ enum p2p_public_action_type {
 
 /**
  * enum p2p_action_type - p2p action frame type
+ * @P2P_ACTION_PRESENCE_REQ:    presence request frame
  * @P2P_ACTION_PRESENCE_RSP:    presence response frame
  * @P2P_ACTION_NOT_SUPPORT:     not support action frame type
  */
 enum p2p_action_type {
+	P2P_ACTION_PRESENCE_REQ = 1,
 	P2P_ACTION_PRESENCE_RSP = 2,
 	P2P_ACTION_NOT_SUPPORT,
 };

+ 7 - 5
core/src/wlan_p2p_roc.c

@@ -545,20 +545,22 @@ static QDF_STATUS p2p_process_scan_complete_evt(
 QDF_STATUS p2p_mgmt_rx_action_ops(struct wlan_objmgr_psoc *psoc,
 	bool isregister)
 {
-	struct mgmt_txrx_mgmt_frame_cb_info frm_cb_info;
+	struct mgmt_txrx_mgmt_frame_cb_info frm_cb_info[2];
 	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;
+	frm_cb_info[0].frm_type = MGMT_ACTION_VENDOR_SPECIFIC;
+	frm_cb_info[0].mgmt_rx_cb = tgt_p2p_mgmt_frame_rx_cb;
+	frm_cb_info[1].frm_type = MGMT_ACTION_CATEGORY_VENDOR_SPECIFIC;
+	frm_cb_info[1].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);
+				WLAN_UMAC_COMP_P2P, frm_cb_info, 2);
 	else
 		status = wlan_mgmt_txrx_deregister_rx_cb(psoc,
-				WLAN_UMAC_COMP_P2P, &frm_cb_info, 1);
+				WLAN_UMAC_COMP_P2P, frm_cb_info, 2);
 
 	return status;
 }