Browse Source

qcacld-3.0: Add support for VSA frames in OCB mode

Propagation from qcacld-2.0 to qcacld-3.0

When VSA frames are received with the device in OCB mode and a broadcast
destination MAC address, the frame will be propagated up to the kernel
instead of being dropped.

Change-Id: Iace313633792192803619bfdd94c83e8d9544983
CRs-Fixed: 945269
Samuel Ahn 8 years ago
parent
commit
065e649878
2 changed files with 43 additions and 8 deletions
  1. 28 7
      core/hdd/src/wlan_hdd_p2p.c
  2. 15 1
      core/mac/src/pe/lim/lim_process_action_frame.c

+ 28 - 7
core/hdd/src/wlan_hdd_p2p.c

@@ -2300,9 +2300,10 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter,
 	QDF_STATUS status;
 	hdd_remain_on_chan_ctx_t *pRemainChanCtx = NULL;
 	hdd_context_t *pHddCtx;
+	uint8_t broadcast = 0;
 
 	hdd_info("Frame Type = %d Frame Length = %d",
-		 frameType, nFrameLength);
+		frameType, nFrameLength);
 
 	if (NULL == pAdapter) {
 		hdd_err("pAdapter is NULL");
@@ -2326,7 +2327,7 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter,
 	/* Get pAdapter from Destination mac address of the frame */
 	if ((type == SIR_MAC_MGMT_FRAME) && (subType != SIR_MAC_MGMT_PROBE_REQ)) {
 		pAdapter =
-			hdd_get_adapter_by_macaddr(WLAN_HDD_GET_CTX(pAdapter),
+			hdd_get_adapter_by_macaddr(pHddCtx,
 						   &pbFrames
 						   [WLAN_HDD_80211_FRM_DA_OFFSET]);
 		if (NULL == pAdapter) {
@@ -2341,7 +2342,23 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter,
 						 [WLAN_HDD_80211_FRM_DA_OFFSET]));
 			hdd_alert("Frame Type = %d Frame Length = %d subType = %d",
 				frameType, nFrameLength, subType);
+			/* We will receive broadcast management frames
+			* in OCB mode */
+			pAdapter = hdd_get_adapter(pHddCtx, QDF_OCB_MODE);
+			if (NULL == pAdapter || !qdf_is_macaddr_broadcast(
+				(struct qdf_mac_addr *)&pbFrames
+				[WLAN_HDD_80211_FRM_DA_OFFSET])) {
+				/*
+				* Under assumtion that we don't
+				*receive any action
+				* frame with BCST as destination,
+				* we are dropping action frame
+				*/
 			return;
+			}
+
+		 broadcast = 1;
+
 		}
 	}
 
@@ -2366,7 +2383,8 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter,
 
 	cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
 
-	if ((type == SIR_MAC_MGMT_FRAME) && (subType == SIR_MAC_MGMT_ACTION)) {
+	if ((type == SIR_MAC_MGMT_FRAME) &&
+		(subType == SIR_MAC_MGMT_ACTION) && !broadcast) {
 		if (pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] ==
 		    WLAN_HDD_PUBLIC_ACTION_FRAME) {
 			/* Public action frame */
@@ -2533,15 +2551,18 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter,
 		   pAdapter->sessionId, pAdapter->dev->ifindex);
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
-	cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, freq, 0, pbFrames,
+	cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr,
+		 freq, rxRssi * 100, pbFrames,
 			 nFrameLength, NL80211_RXMGMT_FLAG_ANSWERED);
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
-	cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, freq, 0, pbFrames,
+	cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr,
+			freq, rxRssi * 100, pbFrames,
 			 nFrameLength, NL80211_RXMGMT_FLAG_ANSWERED,
 			 GFP_ATOMIC);
 #else
-	cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, freq, 0,
-			 pbFrames, nFrameLength, GFP_ATOMIC);
+	cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, freq,
+			rxRssi * 100,
+			pbFrames, nFrameLength, GFP_ATOMIC);
 #endif /* LINUX_VERSION_CODE */
 }
 

+ 15 - 1
core/mac/src/pe/lim/lim_process_action_frame.c

@@ -2019,7 +2019,7 @@ void lim_process_action_frame(tpAniSirGlobal mac_ctx,
 						sizeof(tSirMacMgmtHdr),
 						session->smeSessionId,
 						WMA_GET_RX_CH(rx_pkt_info),
-						session, 0);
+				session, WMA_GET_RX_RSSI_RAW(rx_pkt_info));
 			} else {
 				lim_log(mac_ctx, LOG1,
 					FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"),
@@ -2027,6 +2027,20 @@ void lim_process_action_frame(tpAniSirGlobal mac_ctx,
 					pub_action->Oui[2], pub_action->Oui[3]);
 			}
 		break;
+		/* Handle vendor specific action */
+		case SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY:
+		{
+			tpSirMacMgmtHdr     header;
+			uint32_t            frame_len;
+
+		header = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
+		frame_len = WMA_GET_RX_PAYLOAD_LEN(rx_pkt_info);
+		lim_send_sme_mgmt_frame_ind(mac_ctx, header->fc.subType,
+		(uint8_t *)header, frame_len + sizeof(tSirMacMgmtHdr), 0,
+		WMA_GET_RX_CH(rx_pkt_info), NULL,
+			WMA_GET_RX_RSSI_RAW(rx_pkt_info));
+			break;
+		}
 
 		case SIR_MAC_ACTION_2040_BSS_COEXISTENCE:
 			mac_hdr = NULL;