Browse Source

qcacld-3.0: Replace lim_is_group_addr() with IEEE80211_IS_MULTICAST

Replace lim_is_group_addr() with IEEE80211_IS_MULTICAST.

Change-Id: Ide8c1a9b04c065896724c67123943128e76f8d1a
CRs-Fixed: 2410946
Srinivas Girigowda 6 years ago
parent
commit
b971ba2678

+ 1 - 1
core/mac/src/pe/lim/lim_process_assoc_req_frame.c

@@ -2184,7 +2184,7 @@ void lim_process_assoc_req_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_in
 	/* Get pointer to Re/Association Request frame body */
 	frm_body = WMA_GET_RX_MPDU_DATA(rx_pkt_info);
 
-	if (lim_is_group_addr(hdr->sa)) {
+	if (IEEE80211_IS_MULTICAST(hdr->sa)) {
 		/*
 		 * Rcvd Re/Assoc Req frame from BC/MC address Log error and
 		 * ignore it

+ 1 - 1
core/mac/src/pe/lim/lim_process_auth_frame.c

@@ -1206,7 +1206,7 @@ lim_process_auth_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info,
 		return;
 	}
 
-	if (lim_is_group_addr(mac_hdr->sa)) {
+	if (IEEE80211_IS_MULTICAST(mac_hdr->sa)) {
 		/*
 		 * Received Auth frame from a BC/MC address
 		 * Log error and ignore it

+ 3 - 2
core/mac/src/pe/lim/lim_process_deauth_frame.c

@@ -96,14 +96,15 @@ lim_process_deauth_frame(struct mac_context *mac, uint8_t *pRxPacketInfo,
 		return;
 	}
 
-	if (lim_is_group_addr(pHdr->sa)) {
+	if (IEEE80211_IS_MULTICAST(pHdr->sa)) {
 		/* Received Deauth frame from a BC/MC address */
 		/* Log error and ignore it */
 		pe_debug("received Deauth frame from a BC/MC address");
 		return;
 	}
 
-	if (lim_is_group_addr(pHdr->da) && !QDF_IS_ADDR_BROADCAST(pHdr->da)) {
+	if (IEEE80211_IS_MULTICAST(pHdr->da) &&
+	    !QDF_IS_ADDR_BROADCAST(pHdr->da)) {
 		/* Received Deauth frame for a MC address */
 		/* Log error and ignore it */
 		pe_debug("received Deauth frame for a MC address");

+ 3 - 2
core/mac/src/pe/lim/lim_process_disassoc_frame.c

@@ -77,14 +77,15 @@ lim_process_disassoc_frame(struct mac_context *mac, uint8_t *pRxPacketInfo,
 
 	frame_rssi = (int32_t)WMA_GET_RX_RSSI_NORMALIZED(pRxPacketInfo);
 
-	if (lim_is_group_addr(pHdr->sa)) {
+	if (IEEE80211_IS_MULTICAST(pHdr->sa)) {
 		/* Received Disassoc frame from a BC/MC address */
 		/* Log error and ignore it */
 		pe_err("received Disassoc frame from a BC/MC address");
 		return;
 	}
 
-	if (lim_is_group_addr(pHdr->da) && !QDF_IS_ADDR_BROADCAST(pHdr->da)) {
+	if (IEEE80211_IS_MULTICAST(pHdr->da) &&
+	    !QDF_IS_ADDR_BROADCAST(pHdr->da)) {
 		/* Received Disassoc frame for a MC address */
 		/* Log error and ignore it */
 		pe_err("received Disassoc frame for a MC address");

+ 1 - 1
core/mac/src/pe/lim/lim_process_message_queue.c

@@ -1030,7 +1030,7 @@ static void lim_handle_unknown_a2_index_frames(struct mac_context *mac_ctx,
 #ifdef FEATURE_WLAN_TDLS
 	mac_hdr = WMA_GET_RX_MPDUHEADER3A(rx_pkt_buffer);
 
-	if (lim_is_group_addr(mac_hdr->addr2)) {
+	if (IEEE80211_IS_MULTICAST(mac_hdr->addr2)) {
 		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
 			FL("Ignoring A2 Invalid Packet received for MC/BC:"));
 		lim_print_mac_addr(mac_ctx, mac_hdr->addr2, LOGD);

+ 3 - 2
core/mac/src/pe/lim/lim_process_mlm_req_messages.c

@@ -806,8 +806,9 @@ static bool lim_is_auth_req_expected(struct mac_context *mac_ctx,
 		  (LIM_IS_IBSS_ROLE(session) &&
 		  (session->limMlmState ==
 					eLIM_MLM_BSS_STARTED_STATE))) &&
-		(!lim_is_group_addr(mac_ctx->lim.gpLimMlmAuthReq->peerMacAddr))
-		 && lim_is_auth_algo_supported(mac_ctx,
+		(!IEEE80211_IS_MULTICAST(
+			mac_ctx->lim.gpLimMlmAuthReq->peerMacAddr)) &&
+		 lim_is_auth_algo_supported(mac_ctx,
 			mac_ctx->lim.gpLimMlmAuthReq->authType, session));
 
 	return flag;

+ 1 - 1
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -4230,7 +4230,7 @@ static void __lim_process_send_disassoc_frame(struct mac_context *mac_ctx,
 		return;
 	}
 
-	if ((lim_is_group_addr(req->peer_mac) &&
+	if ((IEEE80211_IS_MULTICAST(req->peer_mac) &&
 	     !QDF_IS_ADDR_BROADCAST(req->peer_mac))) {
 		pe_err("received invalid SME_DISASSOC_REQ message");
 		return;

+ 1 - 32
core/mac/src/pe/lim/lim_utils.c

@@ -623,37 +623,6 @@ void lim_cleanup_mlm(struct mac_context *mac_ctx)
 	}
 } /*** end lim_cleanup_mlm() ***/
 
-/**
- * lim_is_group_addr()
- *
- ***FUNCTION:
- * This function is called in various places within LIM code
- * to determine whether passed MAC address is a group address or not
- *
- ***LOGIC:
- * If least significant bit of first octet of the MAC address is
- * set to 1, it is a Group address.
- *
- ***ASSUMPTIONS:
- * NA
- *
- ***NOTE:
- * NA
- *
- * @param macAddr  Indicates MAC address that need to be determined
- *                 whether it is Group address or not
- *
- * @return true if passed address is Group address else false
- */
-
-uint8_t lim_is_group_addr(tSirMacAddr macAddr)
-{
-	if ((macAddr[0] & 0x01) == 0x01)
-		return true;
-	else
-		return false;
-} /****** end lim_is_group_addr() ******/
-
 /**
  * lim_print_mac_addr()
  *
@@ -5584,7 +5553,7 @@ bool lim_validate_received_frame_a1_addr(struct mac_context *mac_ctx,
 		/* let main routine handle it */
 		return true;
 	}
-	if (lim_is_group_addr(a1) || QDF_IS_ADDR_BROADCAST(a1)) {
+	if (IEEE80211_IS_MULTICAST(a1) || QDF_IS_ADDR_BROADCAST(a1)) {
 		/* just for fail safe, don't handle MC/BC a1 in this routine */
 		return true;
 	}

+ 0 - 1
core/mac/src/pe/lim/lim_utils.h

@@ -142,7 +142,6 @@ extern QDF_STATUS lim_send_set_max_tx_power_req(struct mac_context *mac,
 		struct pe_session *pe_session);
 extern uint8_t lim_get_max_tx_power(int8_t regMax, int8_t apTxPower,
 		uint8_t iniTxPower);
-uint8_t lim_is_group_addr(tSirMacAddr);
 
 /* AID pool management functions */
 void lim_init_peer_idxpool(struct mac_context *, struct pe_session *);