Browse Source

qcacld-3.0: Cleanup the SIR definitions of action frame

Cleanup the SIR_* definitions of action frame and replace them
with common enums.

Change-Id: Ib72f9c452ca59e328d0f15a8643f6a803e517433
CRs-Fixed: 3479554
Abhishek Singh 1 year ago
parent
commit
96442f45d0

+ 1 - 1
core/hdd/src/wlan_hdd_ioctl.c

@@ -766,7 +766,7 @@ hdd_sendactionframe(struct hdd_adapter *adapter, const uint8_t *bssid,
 	chan.center_freq = freq;
 	/* Check if it is specific action frame */
 	if (vendor->category ==
-	    SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY) {
+	    ACTION_CATEGORY_VENDOR_SPECIFIC) {
 		static const uint8_t oui[] = { 0x00, 0x00, 0xf0 };
 
 		if (!qdf_mem_cmp(vendor->Oui, oui, 3)) {

+ 1 - 31
core/mac/inc/sir_mac_prot_def.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -96,7 +96,6 @@
 #define SIR_MAC_MGMT_RESERVED15   0xF
 
 #define SIR_MAC_ACTION_TX             1
-#define SIR_MAC_ACTION_RX             2
 
 #define SIR_MAC_BA_POLICY_IMMEDIATE     1
 #define SIR_MAC_BA_DEFAULT_BUFF_SIZE    64
@@ -112,7 +111,6 @@
 
 /* RRM related. */
 /* Refer IEEE Std 802.11k-2008, Section 7.3.2.21, table 7.29 */
-
 #define SIR_MAC_RRM_CHANNEL_LOAD_TYPE          3
 #define SIR_MAC_RRM_NOISE_HISTOGRAM_BEACON     4
 #define SIR_MAC_RRM_BEACON_TYPE                5
@@ -123,37 +121,9 @@
 #define SIR_MAC_RRM_LOCATION_CIVIC_TYPE        11
 #define SIR_MAC_RRM_FINE_TIME_MEAS_TYPE        16
 
-/* VHT Action Field */
-#define SIR_MAC_VHT_GID_NOTIFICATION           1
-#define SIR_MAC_VHT_OPMODE_NOTIFICATION        2
-
 #define SIR_MAC_VHT_OPMODE_SIZE                3
 
 #define NUM_OF_SOUNDING_DIMENSIONS	1 /*Nss - 1, (Nss = 2 for 2x2)*/
-/* HT Action Field Codes */
-#define SIR_MAC_SM_POWER_SAVE       1
-
-/* block acknowledgment action frame types */
-#define SIR_MAC_ACTION_VENDOR_SPECIFIC 9
-#define SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY     0x7F
-#define SIR_MAC_PROT_ACTION_VENDOR_SPECIFIC_CATEGORY 0x7E
-#define SIR_MAC_ACTION_P2P_SUBTYPE_PRESENCE_RSP     2
-
-/* Public Action for 20/40 BSS Coexistence */
-#define SIR_MAC_ACTION_2040_BSS_COEXISTENCE     0
-#define SIR_MAC_ACTION_EXT_CHANNEL_SWITCH_ID    4
-
-/* Public Action frames for GAS */
-#define SIR_MAC_ACTION_GAS_INITIAL_REQUEST      0x0A
-#define SIR_MAC_ACTION_GAS_INITIAL_RESPONSE     0x0B
-#define SIR_MAC_ACTION_GAS_COMEBACK_REQUEST     0x0C
-#define SIR_MAC_ACTION_GAS_COMEBACK_RESPONSE    0x0D
-
-/* Protected Dual of Public Action(PDPA) frames Action field */
-#define SIR_MAC_PDPA_GAS_INIT_REQ      10
-#define SIR_MAC_PDPA_GAS_INIT_RSP      11
-#define SIR_MAC_PDPA_GAS_COMEBACK_REQ  12
-#define SIR_MAC_PDPA_GAS_COMEBACK_RSP  13
 
 /* ----------------------------------------------------------------------------- */
 /* EID (Element ID) definitions */

+ 24 - 24
core/mac/src/pe/lim/lim_process_action_frame.c

@@ -1817,7 +1817,7 @@ void lim_process_action_frame(struct mac_context *mac_ctx,
 	case ACTION_CATEGORY_HT:
 		/** Type of HT Action to be performed*/
 		switch (action_hdr->actionID) {
-		case SIR_MAC_SM_POWER_SAVE:
+		case HT_ACTION_SMPS:
 			if (LIM_IS_AP_ROLE(session))
 				__lim_process_sm_power_save_update(mac_ctx,
 						(uint8_t *)rx_pkt_info,
@@ -1941,8 +1941,8 @@ void lim_process_action_frame(struct mac_context *mac_ctx,
 		}
 		break;
 
-	case SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY:
-	case SIR_MAC_PROT_ACTION_VENDOR_SPECIFIC_CATEGORY:
+	case ACTION_CATEGORY_VENDOR_SPECIFIC:
+	case ACTION_CATEGORY_VENDOR_SPECIFIC_PROTECTED:
 		vendor_specific = (tpSirMacVendorSpecificFrameHdr) action_hdr;
 		mac_hdr = NULL;
 
@@ -1981,7 +1981,7 @@ void lim_process_action_frame(struct mac_context *mac_ctx,
 		mac_hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
 
 		switch (action_hdr->actionID) {
-		case SIR_MAC_ACTION_EXT_CHANNEL_SWITCH_ID:
+		case PUB_ACTION_EXT_CHANNEL_SWITCH_ID:
 			lim_process_ext_channel_switch_action_frame(mac_ctx,
 							rx_pkt_info, session);
 			break;
@@ -1993,7 +1993,7 @@ void lim_process_action_frame(struct mac_context *mac_ctx,
 			 * tdls_process_rx_frame
 			 */
 			break;
-		case SIR_MAC_ACTION_VENDOR_SPECIFIC:
+		case PUB_ACTION_VENDOR_SPECIFIC:
 			pub_action =
 				(tpSirMacVendorSpecificPublicActionFrameHdr)
 				action_hdr;
@@ -2014,12 +2014,12 @@ void lim_process_action_frame(struct mac_context *mac_ctx,
 			}
 			/* send the frame to supplicant */
 			fallthrough;
-		case SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY:
-		case SIR_MAC_PROT_ACTION_VENDOR_SPECIFIC_CATEGORY:
-		case SIR_MAC_ACTION_2040_BSS_COEXISTENCE:
-		case SIR_MAC_ACTION_GAS_INITIAL_REQUEST:
+		case ACTION_CATEGORY_VENDOR_SPECIFIC:
+		case ACTION_CATEGORY_VENDOR_SPECIFIC_PROTECTED:
+		case PUB_ACTION_2040_BSS_COEXISTENCE:
+		case PUB_ACTION_GAS_INITIAL_REQUEST:
 			if (action_hdr->actionID ==
-				SIR_MAC_ACTION_GAS_INITIAL_REQUEST) {
+				PUB_ACTION_GAS_INITIAL_REQUEST) {
 				wlan_son_anqp_frame(session->vdev,
 						    mac_hdr->fc.subType,
 						    (uint8_t *)mac_hdr,
@@ -2029,9 +2029,9 @@ void lim_process_action_frame(struct mac_context *mac_ctx,
 						    &mac_hdr->sa[0]);
 			}
 			fallthrough;
-		case SIR_MAC_ACTION_GAS_INITIAL_RESPONSE:
-		case SIR_MAC_ACTION_GAS_COMEBACK_REQUEST:
-		case SIR_MAC_ACTION_GAS_COMEBACK_RESPONSE:
+		case PUB_ACTION_GAS_INITIAL_RESPONSE:
+		case PUB_ACTION_GAS_COMEBACK_REQUEST:
+		case PUB_ACTION_GAS_COMEBACK_RESPONSE:
 		default:
 			pe_debug("Public action frame: %d",
 				 action_hdr->actionID);
@@ -2077,11 +2077,11 @@ void lim_process_action_frame(struct mac_context *mac_ctx,
 		if (!session->vhtCapability)
 			break;
 		switch (action_hdr->actionID) {
-		case SIR_MAC_VHT_OPMODE_NOTIFICATION:
+		case VHT_ACTION_OPMODE_NOTIF:
 			__lim_process_operating_mode_action_frame(mac_ctx,
 					rx_pkt_info, session);
 			break;
-		case SIR_MAC_VHT_GID_NOTIFICATION:
+		case VHT_ACTION_GID_NOTIF:
 			/* Only if ini supports it */
 			if (session->enableVhtGid)
 				__lim_process_gid_management_action_frame(
@@ -2115,10 +2115,10 @@ void lim_process_action_frame(struct mac_context *mac_ctx,
 		pe_debug("Rcvd Protected Dual of Public Action: %d",
 			action_hdr->actionID);
 		switch (action_hdr->actionID) {
-		case SIR_MAC_PDPA_GAS_INIT_REQ:
-		case SIR_MAC_PDPA_GAS_INIT_RSP:
-		case SIR_MAC_PDPA_GAS_COMEBACK_REQ:
-		case SIR_MAC_PDPA_GAS_COMEBACK_RSP:
+		case PDPA_GAS_INIT_REQ:
+		case PDPA_GAS_INIT_RSP:
+		case PDPA_GAS_COMEBACK_REQ:
+		case PDPA_GAS_COMEBACK_RSP:
 			mac_hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
 			rssi = WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info);
 			lim_send_sme_mgmt_frame_ind(mac_ctx,
@@ -2248,7 +2248,7 @@ void lim_process_action_frame_no_session(struct mac_context *mac, uint8_t *pBd)
 	switch (action_hdr->category) {
 	case ACTION_CATEGORY_PUBLIC:
 		switch (action_hdr->actionID) {
-		case SIR_MAC_ACTION_VENDOR_SPECIFIC:
+		case PUB_ACTION_VENDOR_SPECIFIC:
 			vendor_specific =
 				(tpSirMacVendorSpecificPublicActionFrameHdr)
 				action_hdr;
@@ -2271,10 +2271,10 @@ void lim_process_action_frame_no_session(struct mac_context *mac, uint8_t *pBd)
 				break;
 			}
 			fallthrough;
-		case SIR_MAC_ACTION_GAS_INITIAL_REQUEST:
-		case SIR_MAC_ACTION_GAS_INITIAL_RESPONSE:
-		case SIR_MAC_ACTION_GAS_COMEBACK_REQUEST:
-		case SIR_MAC_ACTION_GAS_COMEBACK_RESPONSE:
+		case PUB_ACTION_GAS_INITIAL_REQUEST:
+		case PUB_ACTION_GAS_INITIAL_RESPONSE:
+		case PUB_ACTION_GAS_COMEBACK_REQUEST:
+		case PUB_ACTION_GAS_COMEBACK_RESPONSE:
 			/*
 			 * Forward the GAS frames to  wpa_supplicant
 			 * type is ACTION

+ 2 - 2
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -4938,7 +4938,7 @@ lim_send_extended_chan_switch_action_frame(struct mac_context *mac_ctx,
 	qdf_mem_zero(&frm, sizeof(frm));
 
 	frm.Category.category     = ACTION_CATEGORY_PUBLIC;
-	frm.Action.action         = SIR_MAC_ACTION_EXT_CHANNEL_SWITCH_ID;
+	frm.Action.action         = PUB_ACTION_EXT_CHANNEL_SWITCH_ID;
 
 	frm.ext_chan_switch_ann_action.switch_mode = mode;
 	frm.ext_chan_switch_ann_action.op_class = new_op_class;
@@ -5102,7 +5102,7 @@ lim_p2p_oper_chan_change_confirm_action_frame(struct mac_context *mac_ctx,
 
 	qdf_mem_zero(&frm, sizeof(frm));
 
-	frm.Category.category     = SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY;
+	frm.Category.category     = ACTION_CATEGORY_VENDOR_SPECIFIC;
 
 	qdf_mem_copy(frm.p2p_action_oui.oui_data,
 		SIR_MAC_P2P_OUI, SIR_MAC_P2P_OUI_SIZE);

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

@@ -6433,7 +6433,7 @@ QDF_STATUS lim_send_action_frm_tb_ppdu_cfg(struct mac_context *mac_ctx,
 
 	frm = (tDot11fvendor_action_frame *)(data_buf + sizeof(*cfg_msg));
 
-	frm->Category.category = SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY;
+	frm->Category.category = ACTION_CATEGORY_VENDOR_SPECIFIC;
 
 	frm->vendor_oui.oui_data[0] = 0x00;
 	frm->vendor_oui.oui_data[1] = 0xA0;