Browse Source

qcacld-3.0: Handle the error action frames in mgmt tx

For Action frame which are not handled, the resp is sent back to the
source without change, except that MSB of the Category set to 1.
so driver may get action frame with WEP BIT set and category with
MSB set.

Due to the error category, driver is not able to determine if its
a RMF frame and thus doesn't add the MIC header and data length to
the frame.

Now with WEP bit set and MIC header and MIC data length not
added to the frame, the firmware assert due to invalid frame length.

Thus reset the WEP bit in the frames sent by mgmt tx path and add
WEP only if keys are set and frame is RMF. Also ignore MSB to get
the actual action category of the action frame.

Change-Id: I2a2918dbb15979e4184dbf8489e5c3ade15d0e6f
CRs-Fixed: 2580233
Abhishek Singh 5 years ago
parent
commit
fe26a582f9
1 changed files with 14 additions and 2 deletions
  1. 14 2
      components/p2p/core/src/wlan_p2p_off_chan_tx.c

+ 14 - 2
components/p2p/core/src/wlan_p2p_off_chan_tx.c

@@ -577,6 +577,11 @@ static QDF_STATUS p2p_populate_mac_header(
 	psoc = tx_ctx->p2p_soc_obj->soc;
 
 	wh = (struct wlan_frame_hdr *)tx_ctx->buf;
+	/*
+	 * Remove the WEP bit if already set, p2p_populate_rmf_field will set it
+	 * if required.
+	 */
+	wh->i_fc[1] &= ~IEEE80211_FC1_WEP;
 	mac_addr = wh->i_addr1;
 	pdev_id = wlan_get_pdev_id_from_vdev_id(psoc, tx_ctx->vdev_id,
 						WLAN_P2P_ID);
@@ -1512,6 +1517,7 @@ static QDF_STATUS p2p_populate_rmf_field(struct tx_action_context *tx_ctx,
 	uint8_t *frame;
 	uint32_t frame_len;
 	struct p2p_soc_priv_obj *p2p_soc_obj;
+	uint8_t action_category;
 
 	p2p_soc_obj = tx_ctx->p2p_soc_obj;
 
@@ -1526,8 +1532,14 @@ static QDF_STATUS p2p_populate_rmf_field(struct tx_action_context *tx_ctx,
 	wh = (struct wlan_frame_hdr *)(*ppbuf);
 	action_hdr = (struct action_frm_hdr *)(*ppbuf + sizeof(*wh));
 
-	if (!is_rmf_mgmt_action_frame(action_hdr->action_category)) {
-		p2p_debug("non rmf act frame 0x%x cat %x",
+	/*
+	 * For Action frame which are not handled, the resp is sent back to the
+	 * source without change, except that MSB of the Category set to 1, so
+	 * to get the actual action category we need to ignore the MSB.
+	 */
+	action_category = action_hdr->action_category & 0x7f;
+	if (!is_rmf_mgmt_action_frame(action_category)) {
+		p2p_debug("non rmf act frame 0x%x category %x",
 			  tx_ctx->frame_info.sub_type,
 			  action_hdr->action_category);
 		return QDF_STATUS_SUCCESS;