Procházet zdrojové kódy

qcacld-3.0: Consolidate the SCH global context

Currently the SCH global context contains a single field which is
itself a struct. That struct, in turn, contains multiple fields with
naming that does not conform to the Linux coding style. Having a
single struct within a struct is pointless, so consolidate the two
structs into one, and update the field names to conform to the coding
standard.

Change-Id: Ibabb32440a833357a50933d399406113cf6f271b
CRs-Fixed: 2380113
Jeff Johnson před 6 roky
rodič
revize
ac05741cf7

+ 1 - 1
core/mac/inc/ani_global.h

@@ -769,7 +769,7 @@ struct mac_context {
 	tAniSirCfg cfg;
 	struct wlan_mlme_cfg *mlme_cfg;
 	tAniSirLim lim;
-	tAniSirSch sch;
+	struct sch_context sch;
 	tAniSirSys sys;
 
 	/* PAL/HDD handle */

+ 3 - 2
core/mac/src/pe/include/sch_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2015, 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2015, 2017-2019 The Linux Foundation. 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
@@ -81,7 +81,8 @@ QDF_STATUS sch_beacon_edca_process(struct mac_context *mac,
 
 void sch_generate_tim(struct mac_context *, uint8_t **, uint16_t *, uint8_t);
 
-void sch_set_beacon_interval(struct mac_context *mac, struct pe_session *pe_session);
+void sch_set_beacon_interval(struct mac_context *mac,
+			     struct pe_session *pe_session);
 
 /**
  * sch_send_beacon_req() - send beacon update req to wma

+ 13 - 24
core/mac/src/pe/include/sch_global.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2014, 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2014, 2017-2019 The Linux Foundation. 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
@@ -43,31 +43,20 @@
 #define tSchBeaconStruct tSirProbeRespBeacon
 #define tpSchBeaconStruct struct sSirProbeRespBeacon *
 
-/* ------------------------------------------------------------------- */
-
-/* ****************** MISC defs ********************************* */
-
-struct schMisc {
-	uint16_t gSchBeaconInterval;
-
-	/* --------- STA ONLY state ----------- */
-
-	/* / flag to indicate that beacon template has been updated */
-	uint8_t fBeaconChanged;
-
-	uint16_t p2pIeOffset;
-
-	/* CSA and ECSA Switch Count Offsets to be sent to FW */
+/**
+ * struct sch_context - SCH global context
+ * @beacon_interval: global beacon interval
+ * @beacon_changed: flag to indicate that beacon template has been updated
+ * @p2p_ie_offset: P2P IE offset
+ * @csa_count_offset: CSA Switch Count Offset to be sent to FW
+ * @ecsa_count_offset: ECSA Switch Count Offset to be sent to FW
+ */
+struct sch_context {
+	uint16_t beacon_interval;
+	uint8_t beacon_changed;
+	uint16_t p2p_ie_offset;
 	uint32_t csa_count_offset;
 	uint32_t ecsa_count_offset;
 };
 
-/* ****************** MISC defs ********************************* */
-
-/* / Global SCH structure */
-typedef struct sAniSirSch {
-	/* / The scheduler object */
-	struct schMisc schObject;
-} tAniSirSch, *tpAniSirSch;
-
 #endif

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

@@ -4046,9 +4046,9 @@ static void __lim_process_sme_change_bi(struct mac_context *mac, uint32_t *pMsgB
 	}
 
 	/*Update sch beaconInterval */
-	if (mac->sch.schObject.gSchBeaconInterval !=
+	if (mac->sch.beacon_interval !=
 	    pChangeBIParams->beaconInterval) {
-		mac->sch.schObject.gSchBeaconInterval =
+		mac->sch.beacon_interval =
 			pChangeBIParams->beaconInterval;
 
 		pe_debug("LIM send update BeaconInterval Indication: %d",

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

@@ -563,7 +563,7 @@ lim_send_probe_rsp_mgmt_frame(struct mac_context *mac_ctx,
 	 */
 	if (LIM_IS_AP_ROLE(pe_session)) {
 		frm->BeaconInterval.interval =
-			mac_ctx->sch.schObject.gSchBeaconInterval;
+			mac_ctx->sch.beacon_interval;
 	} else {
 		cfg = mac_ctx->mlme_cfg->sap_cfg.beacon_interval;
 		frm->BeaconInterval.interval = (uint16_t) cfg;

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

@@ -3259,7 +3259,7 @@ lim_enable_ht_protection_from11g(struct mac_context *mac, uint8_t enable,
 			   protectionEnabled) {
 			/* As operating mode changed after G station assoc some way to update beacon */
 			/* This addresses the issue of mode not changing to - 11 in beacon when OBSS overlap is enabled */
-			/* mac->sch.schObject.fBeaconChanged = 1; */
+			/* mac->sch.beacon_changed = 1; */
 			pBeaconParams->paramChangeBitmap |=
 				PARAM_llGCOEXIST_CHANGED;
 		}

+ 7 - 7
core/mac/src/pe/sch/sch_api.c

@@ -88,7 +88,7 @@ QDF_STATUS sch_send_beacon_req(struct mac_context *mac, uint8_t *beaconPayload,
 		size, reason);
 
 	if (LIM_IS_AP_ROLE(pe_session) &&
-	   (mac->sch.schObject.fBeaconChanged)) {
+	   (mac->sch.beacon_changed)) {
 		retCode = lim_send_probe_rsp_template_to_hal(mac,
 				pe_session,
 				&pe_session->DefProbeRspIeBitmap[0]);
@@ -116,9 +116,9 @@ QDF_STATUS sch_send_beacon_req(struct mac_context *mac, uint8_t *beaconPayload,
 		beaconParams->timIeOffset = pe_session->schBeaconOffsetBegin;
 		if (pe_session->dfsIncludeChanSwIe) {
 			beaconParams->csa_count_offset =
-				mac->sch.schObject.csa_count_offset;
+				mac->sch.csa_count_offset;
 			beaconParams->ecsa_count_offset =
-				mac->sch.schObject.ecsa_count_offset;
+				mac->sch.ecsa_count_offset;
 			pe_debug("csa_count_offset %d ecsa_count_offset %d",
 				 beaconParams->csa_count_offset,
 				 beaconParams->ecsa_count_offset);
@@ -129,16 +129,16 @@ QDF_STATUS sch_send_beacon_req(struct mac_context *mac, uint8_t *beaconPayload,
 	beaconParams->reason = reason;
 
 	/* p2pIeOffset should be atleast greater than timIeOffset */
-	if ((mac->sch.schObject.p2pIeOffset != 0) &&
-	    (mac->sch.schObject.p2pIeOffset <
+	if ((mac->sch.p2p_ie_offset != 0) &&
+	    (mac->sch.p2p_ie_offset <
 	     pe_session->schBeaconOffsetBegin)) {
 		pe_err("Invalid p2pIeOffset:[%d]",
-			mac->sch.schObject.p2pIeOffset);
+			mac->sch.p2p_ie_offset);
 		QDF_ASSERT(0);
 		qdf_mem_free(beaconParams);
 		return QDF_STATUS_E_FAILURE;
 	}
-	beaconParams->p2pIeOffset = mac->sch.schObject.p2pIeOffset;
+	beaconParams->p2pIeOffset = mac->sch.p2p_ie_offset;
 #ifdef WLAN_SOFTAP_FW_BEACON_TX_PRNT_LOG
 	pe_err("TimIeOffset:[%d]", beaconParams->TimIeOffset);
 #endif

+ 9 - 9
core/mac/src/pe/sch/sch_beacon_gen.c

@@ -606,17 +606,17 @@ sch_set_fixed_beacon_fields(struct mac_context *mac_ctx, struct pe_session *sess
 					      &ecsa_count_offset);
 
 	if (csa_count_offset)
-		mac_ctx->sch.schObject.csa_count_offset =
+		mac_ctx->sch.csa_count_offset =
 				session->schBeaconOffsetBegin + TIM_IE_SIZE +
 				csa_count_offset;
 	if (ecsa_count_offset)
-		mac_ctx->sch.schObject.ecsa_count_offset =
+		mac_ctx->sch.ecsa_count_offset =
 				session->schBeaconOffsetBegin + TIM_IE_SIZE +
 				ecsa_count_offset;
 
 	pe_debug("csa_count_offset %d ecsa_count_offset %d",
-		 mac_ctx->sch.schObject.csa_count_offset,
-		 mac_ctx->sch.schObject.ecsa_count_offset);
+		 mac_ctx->sch.csa_count_offset,
+		 mac_ctx->sch.ecsa_count_offset);
 
 	extra_ie = session->pSchBeaconFrameEnd + n_bytes;
 	extra_ie_offset = n_bytes;
@@ -634,15 +634,15 @@ sch_set_fixed_beacon_fields(struct mac_context *mac_ctx, struct pe_session *sess
 	status = sch_get_p2p_ie_offset(extra_ie, extra_ie_len, &p2p_ie_offset);
 	if (QDF_STATUS_SUCCESS == status)
 		/* Update the P2P Ie Offset */
-		mac_ctx->sch.schObject.p2pIeOffset =
+		mac_ctx->sch.p2p_ie_offset =
 			session->schBeaconOffsetBegin + TIM_IE_SIZE +
 			extra_ie_offset + p2p_ie_offset;
 	else
-		mac_ctx->sch.schObject.p2pIeOffset = 0;
+		mac_ctx->sch.p2p_ie_offset = 0;
 
 	pe_debug("Initialized beacon end, offset %d",
 		session->schBeaconOffsetEnd);
-	mac_ctx->sch.schObject.fBeaconChanged = 1;
+	mac_ctx->sch.beacon_changed = 1;
 	qdf_mem_free(bcn_1);
 	qdf_mem_free(bcn_2);
 	qdf_mem_free(wsc_prb_res);
@@ -927,7 +927,7 @@ static QDF_STATUS write_beacon_to_memory(struct mac_context *mac, uint16_t size,
 	} else
 		pBeacon->beaconLength = (uint32_t) size - sizeof(uint32_t);
 
-	if (!mac->sch.schObject.fBeaconChanged)
+	if (!mac->sch.beacon_changed)
 		return QDF_STATUS_E_FAILURE;
 
 	/*
@@ -941,7 +941,7 @@ static QDF_STATUS write_beacon_to_memory(struct mac_context *mac, uint16_t size,
 	if (QDF_IS_STATUS_ERROR(status))
 		pe_err("sch_send_beacon_req() returned an error %d, size %d",
 		       status, size);
-	mac->sch.schObject.fBeaconChanged = 0;
+	mac->sch.beacon_changed = 0;
 
 	return status;
 }

+ 3 - 2
core/mac/src/pe/sch/sch_message.c

@@ -62,7 +62,8 @@ set_sch_edca_params(struct mac_context *mac,
  * @return None
  */
 
-void sch_set_beacon_interval(struct mac_context *mac, struct pe_session *pe_session)
+void sch_set_beacon_interval(struct mac_context *mac,
+			     struct pe_session *pe_session)
 {
 	uint32_t bi;
 
@@ -74,7 +75,7 @@ void sch_set_beacon_interval(struct mac_context *mac, struct pe_session *pe_sess
 		return;
 	}
 
-	mac->sch.schObject.gSchBeaconInterval = (uint16_t) bi;
+	mac->sch.beacon_interval = (uint16_t) bi;
 }
 
 static void sch_edca_profile_update_all(struct mac_context *pmac)