ソースを参照

qcacld-3.0: Replace typedef ptSapContext

The Linux Coding Style enumerates a few special cases where typedefs
are useful, but stresses "NEVER EVER use a typedef unless you can
clearly match one of those rules." The ptSapContext typedef does not
meet any of those criteria, so replace it.

Change-Id: Ia08bea35b7c0d3b3dfad4641c1c79a7c0990cd8d
CRs-Fixed: 2109993
Jeff Johnson 7 年 前
コミット
f1cd3c7d40

+ 2 - 2
core/hdd/src/wlan_hdd_hostapd.c

@@ -9054,7 +9054,7 @@ void hdd_sap_indicate_disconnect_for_sta(struct hdd_adapter *adapter)
 {
 	tSap_Event sap_event;
 	int sta_id;
-	ptSapContext sap_ctx;
+	struct sap_context *sap_ctx;
 
 	ENTER();
 
@@ -9102,7 +9102,7 @@ void hdd_sap_indicate_disconnect_for_sta(struct hdd_adapter *adapter)
  */
 void hdd_sap_destroy_events(struct hdd_adapter *adapter)
 {
-	ptSapContext sap_ctx;
+	struct sap_context *sap_ctx;
 
 	ENTER();
 	sap_ctx = WLAN_HDD_GET_SAP_CTX_PTR(adapter);

+ 16 - 16
core/sap/src/sap_api_link_cntl.c

@@ -105,7 +105,7 @@ QDF_STATUS wlansap_scan_callback(tHalHandle hal_handle,
 				 uint32_t scan_id, eCsrScanStatus scan_status) {
 	tScanResultHandle result = NULL;
 	QDF_STATUS get_result_status = QDF_STATUS_E_FAILURE;
-	ptSapContext sap_ctx = (ptSapContext) ctx;
+	struct sap_context *sap_ctx = ctx;
 	tWLAN_SAPEvent sapEvent;        /* State machine event */
 	uint8_t operChannel = 0;
 	QDF_STATUS sap_sm_status;
@@ -244,7 +244,7 @@ QDF_STATUS wlansap_scan_callback(tHalHandle hal_handle,
  * Return: None
  */
 
-void sap_config_acs_result(tHalHandle hal, ptSapContext sap_ctx,
+void sap_config_acs_result(tHalHandle hal, struct sap_context *sap_ctx,
 							uint32_t sec_ch)
 {
 	uint32_t channel = sap_ctx->acs_cfg->pri_ch;
@@ -287,7 +287,7 @@ void sap_config_acs_result(tHalHandle hal, ptSapContext sap_ctx,
  */
 static QDF_STATUS sap_hdd_signal_event_handler(void *ctx)
 {
-	ptSapContext sap_ctx = ctx;
+	struct sap_context *sap_ctx = ctx;
 	QDF_STATUS status;
 	if (NULL == sap_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -322,7 +322,7 @@ wlansap_pre_start_bss_acs_scan_callback(tHalHandle hal_handle, void *pcontext,
 {
 	tScanResultHandle presult = NULL;
 	QDF_STATUS scan_get_result_status = QDF_STATUS_E_FAILURE;
-	ptSapContext sap_ctx = (ptSapContext)pcontext;
+	struct sap_context *sap_ctx = pcontext;
 	uint8_t oper_channel = 0;
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 
@@ -442,7 +442,7 @@ close_session:
  */
 static void
 wlansap_roam_process_ch_change_success(tpAniSirGlobal mac_ctx,
-				      ptSapContext sap_ctx,
+				      struct sap_context *sap_ctx,
 				      tCsrRoamInfo *csr_roam_info,
 				      QDF_STATUS *ret_status)
 {
@@ -550,7 +550,7 @@ wlansap_roam_process_ch_change_success(tpAniSirGlobal mac_ctx,
  */
 static void
 wlansap_roam_process_dfs_chansw_update(tHalHandle hHal,
-					    ptSapContext sap_ctx,
+					    struct sap_context *sap_ctx,
 					    QDF_STATUS *ret_status)
 {
 	tWLAN_SAPEvent sap_event;
@@ -653,7 +653,7 @@ wlansap_roam_process_dfs_chansw_update(tHalHandle hHal,
 
 	/* Issue channel change req for each sapctx */
 	for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++) {
-		ptSapContext pSapContext;
+		struct sap_context *pSapContext;
 		if (!((QDF_SAP_MODE == mac_ctx->sap.sapCtxList[intf].sapPersona)
 		    && (mac_ctx->sap.sapCtxList[intf].pSapContext != NULL)))
 			continue;
@@ -693,7 +693,7 @@ wlansap_roam_process_dfs_chansw_update(tHalHandle hHal,
  */
 static void
 wlansap_roam_process_dfs_radar_found(tpAniSirGlobal mac_ctx,
-				     ptSapContext sap_ctx,
+				     struct sap_context *sap_ctx,
 				     QDF_STATUS *ret_status)
 {
 	QDF_STATUS qdf_status;
@@ -790,7 +790,7 @@ wlansap_roam_process_dfs_radar_found(tpAniSirGlobal mac_ctx,
  * Return: result of operation
  */
 static void
-wlansap_roam_process_infra_assoc_ind(ptSapContext sap_ctx,
+wlansap_roam_process_infra_assoc_ind(struct sap_context *sap_ctx,
 				     eCsrRoamResult roam_result,
 				     tCsrRoamInfo *csr_roam_info,
 				     QDF_STATUS *ret_status)
@@ -840,7 +840,7 @@ wlansap_roam_process_infra_assoc_ind(ptSapContext sap_ctx,
 }
 
 static void wlansap_update_vendor_acs_chan(tpAniSirGlobal mac_ctx,
-				ptSapContext sap_ctx)
+				struct sap_context *sap_ctx)
 {
 	int intf;
 	tHalHandle hal;
@@ -869,7 +869,7 @@ static void wlansap_update_vendor_acs_chan(tpAniSirGlobal mac_ctx,
 
 	/* Issue stopbss for each sapctx */
 	for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++) {
-		ptSapContext pSapContext;
+		struct sap_context *pSapContext;
 
 		if (((QDF_SAP_MODE ==
 		    mac_ctx->sap.sapCtxList[intf].sapPersona) ||
@@ -907,7 +907,7 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId,
 		      eRoamCmdStatus roam_status, eCsrRoamResult roam_result)
 {
 	/* sap_ctx value */
-	ptSapContext sap_ctx;
+	struct sap_context *sap_ctx;
 	/* State machine event */
 	tWLAN_SAPEvent sap_event;
 	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
@@ -916,10 +916,10 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId,
 	tpAniSirGlobal mac_ctx = NULL;
 	uint8_t intf;
 
-	if (QDF_IS_STATUS_ERROR(wlansap_context_get((ptSapContext)ctx)))
+	if (QDF_IS_STATUS_ERROR(wlansap_context_get(ctx)))
 		return QDF_STATUS_E_FAILURE;
 
-	sap_ctx = (ptSapContext) ctx;
+	sap_ctx = ctx;
 	hal = CDS_GET_HAL_CB();
 	if (!hal) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -1073,7 +1073,7 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId,
 		}
 		/* Issue stopbss for each sapctx */
 		for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++) {
-			ptSapContext pSapContext;
+			struct sap_context *pSapContext;
 			if (((QDF_SAP_MODE ==
 			    mac_ctx->sap.sapCtxList[intf].sapPersona) ||
 			    (QDF_P2P_GO_MODE ==
@@ -1344,7 +1344,7 @@ void sap_scan_event_callback(struct wlan_objmgr_vdev *vdev,
 	uint8_t session_id;
 	eCsrScanStatus scan_status = eCSR_SCAN_FAILURE;
 	tHalHandle hal_handle;
-	ptSapContext sap_ctx = (ptSapContext) arg;
+	struct sap_context *sap_ctx = arg;
 
 	session_id = wlan_vdev_get_id(vdev);
 	scan_id = event->scan_id;

+ 23 - 22
core/sap/src/sap_ch_select.c

@@ -234,7 +234,7 @@ sapAcsChannelInfo acs_ht40_channels24_g[] = {
  *   else false: if channel list was already full.
  */
 static bool
-sap_check_n_add_channel(ptSapContext sap_ctx,
+sap_check_n_add_channel(struct sap_context *sap_ctx,
 			uint8_t new_channel)
 {
 	uint8_t i = 0;
@@ -269,7 +269,8 @@ sap_check_n_add_channel(ptSapContext sap_ctx,
  *   else false: if channel list was already full.
  */
 static bool
-sap_check_n_add_overlapped_chnls(ptSapContext sap_ctx, uint8_t primary_channel)
+sap_check_n_add_overlapped_chnls(struct sap_context *sap_ctx,
+				 uint8_t primary_channel)
 {
 	uint8_t i = 0, j = 0, upper_chnl = 0, lower_chnl = 0;
 	struct sap_avoid_channels_info *ie_info =
@@ -331,7 +332,7 @@ sap_check_n_add_overlapped_chnls(ptSapContext sap_ctx, uint8_t primary_channel)
  * Return: void
  */
 static void sap_process_avoid_ie(tHalHandle hal,
-			  ptSapContext sap_ctx,
+			  struct sap_context *sap_ctx,
 			  tScanResultHandle scan_result,
 			  tSapChSelSpectInfo *spect_info)
 {
@@ -415,7 +416,7 @@ static void sap_process_avoid_ie(tHalHandle hal,
    RETURN VALUE
     NULL
    ============================================================================*/
-void sap_update_unsafe_channel_list(tHalHandle hal, ptSapContext pSapCtx)
+void sap_update_unsafe_channel_list(tHalHandle hal, struct sap_context *pSapCtx)
 {
 	uint16_t i, j;
 	uint16_t unsafe_channel_list[NUM_CHANNELS];
@@ -503,7 +504,7 @@ void sap_update_unsafe_channel_list(tHalHandle hal, ptSapContext pSapCtx)
 
 void sap_cleanup_channel_list(void *p_cds_gctx)
 {
-	ptSapContext pSapCtx;
+	struct sap_context *pSapCtx;
 
 	QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG,
 		  "Cleaning up the channel list structure");
@@ -547,7 +548,7 @@ void sap_cleanup_channel_list(void *p_cds_gctx)
  */
 static
 uint8_t sap_channel_in_acs_channel_list(uint8_t channel_num,
-					ptSapContext sap_ctx,
+					struct sap_context *sap_ctx,
 					tSapChSelSpectInfo *spect_info_params)
 {
 	uint8_t i = 0;
@@ -581,7 +582,7 @@ uint8_t sap_channel_in_acs_channel_list(uint8_t channel_num,
  */
 static
 uint8_t sap_select_preferred_channel_from_channel_list(uint8_t best_chnl,
-				ptSapContext sap_ctx,
+				struct sap_context *sap_ctx,
 				tSapChSelSpectInfo *spectinfo_param)
 {
 	uint8_t i = 0;
@@ -645,7 +646,7 @@ uint8_t sap_select_preferred_channel_from_channel_list(uint8_t best_chnl,
    ============================================================================*/
 static bool sap_chan_sel_init(tHalHandle halHandle,
 			      tSapChSelSpectInfo *pSpectInfoParams,
-			      ptSapContext pSapCtx)
+			      struct sap_context *pSapCtx)
 {
 	tSapSpectChInfo *pSpectCh = NULL;
 	uint8_t *pChans = NULL;
@@ -761,7 +762,7 @@ static bool sap_chan_sel_init(tHalHandle halHandle,
  * Return: uint32_t Calculated channel weight based on above two
  */
 static
-uint32_t sapweight_rssi_count(ptSapContext sap_ctx, int8_t rssi,
+uint32_t sapweight_rssi_count(struct sap_context *sap_ctx, int8_t rssi,
 			      uint16_t count)
 {
 	int32_t rssiWeight = 0;
@@ -845,7 +846,7 @@ static void sap_clear_channel_status(tpAniSirGlobal p_mac)
  *
  * Return: channel noise floor weight
  */
-static uint32_t sap_weight_channel_noise_floor(ptSapContext sap_ctx,
+static uint32_t sap_weight_channel_noise_floor(struct sap_context *sap_ctx,
 					       struct lim_channel_status
 						*channel_stat)
 {
@@ -897,7 +898,7 @@ static uint32_t sap_weight_channel_noise_floor(ptSapContext sap_ctx,
  *
  * Return: channel free weight
  */
-static uint32_t sap_weight_channel_free(ptSapContext sap_ctx,
+static uint32_t sap_weight_channel_free(struct sap_context *sap_ctx,
 					struct lim_channel_status
 					*channel_stat)
 {
@@ -960,7 +961,7 @@ static uint32_t sap_weight_channel_free(ptSapContext sap_ctx,
  *
  * Return: tx power range weight
  */
-static uint32_t sap_weight_channel_txpwr_range(ptSapContext sap_ctx,
+static uint32_t sap_weight_channel_txpwr_range(struct sap_context *sap_ctx,
 					       struct lim_channel_status
 					       *channel_stat)
 {
@@ -1012,7 +1013,7 @@ static uint32_t sap_weight_channel_txpwr_range(ptSapContext sap_ctx,
  *
  * Return: tx power throughput weight
  */
-static uint32_t sap_weight_channel_txpwr_tput(ptSapContext sap_ctx,
+static uint32_t sap_weight_channel_txpwr_tput(struct sap_context *sap_ctx,
 					      struct lim_channel_status
 					      *channel_stat)
 {
@@ -1064,7 +1065,7 @@ static uint32_t sap_weight_channel_txpwr_tput(ptSapContext sap_ctx,
  * Return: chan status weight
  */
 static
-uint32_t sap_weight_channel_status(ptSapContext sap_ctx,
+uint32_t sap_weight_channel_status(struct sap_context *sap_ctx,
 				   struct lim_channel_status *channel_stat)
 {
 	return sap_weight_channel_noise_floor(sap_ctx, channel_stat) +
@@ -1515,7 +1516,7 @@ static void sap_interference_rssi_count(tSapSpectChInfo *spect_ch,
  *   true:    channel is in PCL,
  *   false:   channel is not in PCL
  */
-static bool ch_in_pcl(ptSapContext sap_ctx, uint8_t channel)
+static bool ch_in_pcl(struct sap_context *sap_ctx, uint8_t channel)
 {
 	uint32_t i;
 
@@ -1541,7 +1542,7 @@ static bool ch_in_pcl(ptSapContext sap_ctx, uint8_t channel)
 static void sap_compute_spect_weight(tSapChSelSpectInfo *pSpectInfoParams,
 				     tHalHandle halHandle,
 				     tScanResultHandle pResult,
-				     ptSapContext sap_ctx)
+				     struct sap_context *sap_ctx)
 {
 	int8_t rssi = 0;
 	uint8_t chn_num = 0;
@@ -2342,7 +2343,7 @@ static void sap_sort_chl_weight_ht40_5_g(tSapChSelSpectInfo *pSpectInfoParams)
    PARAMETERS
 
     IN
-    ptSapContext           : Pointer to the ptSapContext structure
+    pSapCtx                : Pointer to the struct sap_context *structure
     pSpectInfoParams       : Pointer to the tSapChSelSpectInfo structure
 
    RETURN VALUE
@@ -2350,7 +2351,7 @@ static void sap_sort_chl_weight_ht40_5_g(tSapChSelSpectInfo *pSpectInfoParams)
 
    SIDE EFFECTS
    ============================================================================*/
-static void sap_sort_chl_weight_all(ptSapContext pSapCtx,
+static void sap_sort_chl_weight_all(struct sap_context *pSapCtx,
 				    tSapChSelSpectInfo *pSpectInfoParams,
 				    uint32_t operatingBand,
 				    v_REGDOMAIN_t domain)
@@ -2429,7 +2430,7 @@ static void sap_sort_chl_weight_all(ptSapContext pSapCtx,
  *
  * Returns: true if non-overlapping (1, 6, 11) channel, false otherwise
  */
-static bool sap_is_ch_non_overlap(ptSapContext sap_ctx, uint16_t ch)
+static bool sap_is_ch_non_overlap(struct sap_context *sap_ctx, uint16_t ch)
 {
 	if (sap_ctx->enableOverLapCh)
 		return true;
@@ -2449,7 +2450,7 @@ static bool sap_is_ch_non_overlap(ptSapContext sap_ctx, uint16_t ch)
  * Returns: channel number if success, 0 otherwise
  */
 static uint8_t sap_select_channel_no_scan_result(tHalHandle hal,
-						 ptSapContext sap_ctx)
+						 struct sap_context *sap_ctx)
 {
 	enum channel_state ch_type;
 	uint8_t i, first_safe_ch_in_range = SAP_CHANNEL_NOT_SELECTED;
@@ -2522,7 +2523,7 @@ static uint8_t sap_select_channel_no_scan_result(tHalHandle hal,
 }
 #else
 static uint8_t sap_select_channel_no_scan_result(tHalHandle hal,
-						 ptSapContext sap_ctx)
+						 struct sap_context *sap_ctx)
 {
 	uint32_t start_ch_num = sap_ctx->acs_cfg->start_ch;
 
@@ -2550,7 +2551,7 @@ static uint8_t sap_select_channel_no_scan_result(tHalHandle hal,
  *
  * Returns: channel number if success, 0 otherwise
  */
-uint8_t sap_select_channel(tHalHandle hal, ptSapContext sap_ctx,
+uint8_t sap_select_channel(tHalHandle hal, struct sap_context *sap_ctx,
 			   tScanResultHandle scan_result)
 {
 	/* DFS param object holding all the data req by the algo */

+ 55 - 54
core/sap/src/sap_fsm.c

@@ -785,7 +785,7 @@ tSapChanMatrixInfo ht20_chan[] = {
  * Static Function Declarations and Definitions
  * -------------------------------------------------------------------------*/
 #ifdef SOFTAP_CHANNEL_RANGE
-static QDF_STATUS sap_get_channel_list(ptSapContext sapContext,
+static QDF_STATUS sap_get_channel_list(struct sap_context *sapContext,
 				    uint8_t **channelList,
 				    uint8_t *numberOfChannels);
 #endif
@@ -807,7 +807,7 @@ static QDF_STATUS sap_get_channel_list(ptSapContext sapContext,
    SIDE EFFECTS
    ============================================================================*/
 
-static int sap_stop_dfs_cac_timer(ptSapContext sapContext);
+static int sap_stop_dfs_cac_timer(struct sap_context *sapContext);
 
 /*==========================================================================
    FUNCTION    sapStartDfsCacTimer
@@ -826,7 +826,7 @@ static int sap_stop_dfs_cac_timer(ptSapContext sapContext);
    SIDE EFFECTS
    ============================================================================*/
 
-int sap_start_dfs_cac_timer(ptSapContext sapContext);
+static int sap_start_dfs_cac_timer(struct sap_context *sapContext);
 
 /** sap_hdd_event_to_string() - convert hdd event to string
  * @event: eSapHddEvent event type
@@ -920,7 +920,7 @@ static inline void sap_event_init(ptWLAN_SAPEvent sapEvent)
  *
  * Return: channel number picked
  **/
-static uint8_t sap_random_channel_sel(ptSapContext sap_ctx)
+static uint8_t sap_random_channel_sel(struct sap_context *sap_ctx)
 {
 	int ch;
 	uint8_t ch_wd;
@@ -992,7 +992,7 @@ static uint8_t sap_random_channel_sel(ptSapContext sap_ctx)
  * Return: TRUE or FALSE
  */
 static bool
-sap_find_target_channel_in_channel_matrix(ptSapContext sapContext,
+sap_find_target_channel_in_channel_matrix(struct sap_context *sapContext,
 					  enum phy_ch_width ch_width,
 					  uint8_t NOL_channel,
 					  tSapTxLeakInfo **pTarget_chnl_mtrx)
@@ -1057,7 +1057,7 @@ sap_find_target_channel_in_channel_matrix(ptSapContext sapContext,
  */
 
 QDF_STATUS
-sap_mark_leaking_ch(ptSapContext sap_ctx,
+sap_mark_leaking_ch(struct sap_context *sap_ctx,
 		enum phy_ch_width ch_width,
 		tSapDfsNolInfo *nol,
 		uint8_t temp_ch_lst_sz,
@@ -1152,7 +1152,8 @@ sap_mark_leaking_ch(ptSapContext sap_ctx,
  *
  * Return: True if bonded to weather channel in ETSI
  */
-static bool sap_is_channel_bonding_etsi_weather_channel(ptSapContext sap_ctx)
+static bool
+sap_is_channel_bonding_etsi_weather_channel(struct sap_context *sap_ctx)
 {
 	if (IS_CH_BONDING_WITH_WEATHER_CH(sap_ctx->channel) &&
 	    (sap_ctx->ch_params.ch_width != CH_WIDTH_20MHZ))
@@ -1232,7 +1233,7 @@ static uint8_t sap_ch_params_to_bonding_channels(
  *
  * Return: None
  */
-static void sap_get_cac_dur_dfs_region(ptSapContext sap_ctx,
+static void sap_get_cac_dur_dfs_region(struct sap_context *sap_ctx,
 		uint32_t *cac_duration_ms,
 		uint32_t *dfs_region)
 {
@@ -1289,7 +1290,7 @@ static void sap_get_cac_dur_dfs_region(ptSapContext sap_ctx,
 
 void sap_dfs_set_current_channel(void *ctx)
 {
-	ptSapContext sap_ctx = (ptSapContext) ctx;
+	struct sap_context *sap_ctx = ctx;
 	uint32_t ic_flags = 0;
 	uint16_t ic_flagext = 0;
 	uint8_t ic_ieee = sap_ctx->channel;
@@ -1445,7 +1446,7 @@ bool sap_dfs_is_channel_in_preferred_location(tHalHandle hHal, uint8_t channelID
  *
  * Return: true, if channel was present, false othersie.
  */
-bool sap_check_in_avoid_ch_list(ptSapContext sap_ctx, uint8_t channel)
+bool sap_check_in_avoid_ch_list(struct sap_context *sap_ctx, uint8_t channel)
 {
 	uint8_t i = 0;
 	struct sap_avoid_channels_info *ie_info =
@@ -1469,7 +1470,7 @@ bool sap_check_in_avoid_ch_list(ptSapContext sap_ctx, uint8_t channel)
  * Return: false if channel is available, true if channel is in NOL.
  */
 bool
-sap_dfs_is_channel_in_nol_list(ptSapContext sap_context,
+sap_dfs_is_channel_in_nol_list(struct sap_context *sap_context,
 			       uint8_t channel_number,
 			       ePhyChanBondState chan_bondState)
 {
@@ -1561,7 +1562,7 @@ uint8_t sap_select_default_oper_chan(tHalHandle hal, uint32_t acs_hwmode)
  *
  * Return: The QDF_STATUS code associated with performing the operation.
  */
-QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context,
+QDF_STATUS sap_goto_channel_sel(struct sap_context *sap_context,
 	ptWLAN_SAPEvent sap_event,
 	bool sap_do_acs_pre_start_bss,
 	bool check_for_connection_update)
@@ -1862,11 +1863,11 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context,
  *
  * Return: pointer to sap context of valid concurrent session
  */
-static ptSapContext sap_find_valid_concurrent_session(tHalHandle hal)
+static struct sap_context *sap_find_valid_concurrent_session(tHalHandle hal)
 {
 	tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
 	uint8_t intf = 0;
-	ptSapContext sap_ctx;
+	struct sap_context *sap_ctx;
 
 	for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++) {
 		if (((QDF_SAP_MODE ==
@@ -1911,7 +1912,7 @@ static QDF_STATUS sap_clear_global_dfs_param(tHalHandle hal)
 	return QDF_STATUS_SUCCESS;
 }
 
-QDF_STATUS sap_set_session_param(tHalHandle hal, ptSapContext sapctx,
+QDF_STATUS sap_set_session_param(tHalHandle hal, struct sap_context *sapctx,
 				uint32_t session_id)
 {
 	tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
@@ -1932,7 +1933,7 @@ QDF_STATUS sap_set_session_param(tHalHandle hal, ptSapContext sapctx,
 	return QDF_STATUS_SUCCESS;
 }
 
-QDF_STATUS sap_clear_session_param(tHalHandle hal, ptSapContext sapctx,
+QDF_STATUS sap_clear_session_param(tHalHandle hal, struct sap_context *sapctx,
 				uint32_t session_id)
 {
 	tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
@@ -1962,7 +1963,7 @@ QDF_STATUS sap_clear_session_param(tHalHandle hal, ptSapContext sapctx,
  *
  * Return: QDF_STATUS
  */
-QDF_STATUS sap_open_session(tHalHandle hHal, ptSapContext sapContext,
+QDF_STATUS sap_open_session(tHalHandle hHal, struct sap_context *sapContext,
 			    uint32_t session_id)
 {
 	uint32_t type, subType;
@@ -2032,7 +2033,7 @@ QDF_STATUS sap_open_session(tHalHandle hHal, ptSapContext sapContext,
 
    SIDE EFFECTS
    ============================================================================*/
-static QDF_STATUS sap_goto_starting(ptSapContext sapContext,
+static QDF_STATUS sap_goto_starting(struct sap_context *sapContext,
 				    ptWLAN_SAPEvent sapEvent,
 				    eCsrRoamBssType bssType)
 {
@@ -2091,7 +2092,7 @@ static QDF_STATUS sap_goto_starting(ptSapContext sapContext,
 
    SIDE EFFECTS
    ============================================================================*/
-static QDF_STATUS sap_goto_disconnecting(ptSapContext sapContext)
+static QDF_STATUS sap_goto_disconnecting(struct sap_context *sapContext)
 {
 	QDF_STATUS qdf_ret_status;
 	tHalHandle hHal;
@@ -2139,7 +2140,7 @@ static QDF_STATUS sap_goto_disconnecting(ptSapContext sapContext)
 
    SIDE EFFECTS
    ============================================================================*/
-static QDF_STATUS sap_goto_disconnected(ptSapContext sapContext)
+static QDF_STATUS sap_goto_disconnected(struct sap_context *sapContext)
 {
 	QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
 	tWLAN_SAPEvent sapEvent;
@@ -2166,7 +2167,7 @@ static QDF_STATUS sap_goto_disconnected(ptSapContext sapContext)
  *
  * Return: void
  */
-static void sap_handle_acs_scan_event(ptSapContext sap_context,
+static void sap_handle_acs_scan_event(struct sap_context *sap_context,
 		tSap_Event *sap_event, eSapStatus status)
 {
 	sap_event->sapHddEventCode = eSAP_ACS_SCAN_SUCCESS_EVENT;
@@ -2177,7 +2178,7 @@ static void sap_handle_acs_scan_event(ptSapContext sap_context,
 			sap_context->channelList;
 }
 #else
-static void sap_handle_acs_scan_event(ptSapContext sap_context,
+static void sap_handle_acs_scan_event(struct sap_context *sap_context,
 		tSap_Event *sap_event, eSapStatus status)
 {
 }
@@ -2194,7 +2195,7 @@ static void sap_handle_acs_scan_event(ptSapContext sap_context,
  *
  * Return: QDF_STATUS
  */
-QDF_STATUS sap_signal_hdd_event(ptSapContext sap_ctx,
+QDF_STATUS sap_signal_hdd_event(struct sap_context *sap_ctx,
 		tCsrRoamInfo *csr_roaminfo, eSapHddEvent sap_hddevent,
 		void *context)
 {
@@ -2598,17 +2599,17 @@ QDF_STATUS sap_signal_hdd_event(ptSapContext sap_ctx,
  *
  * Return: Valid SAP context on success, else NULL
  */
-static ptSapContext sap_find_cac_wait_session(tHalHandle handle)
+static struct sap_context *sap_find_cac_wait_session(tHalHandle handle)
 {
 	tpAniSirGlobal mac = PMAC_STRUCT(handle);
 	uint8_t i = 0;
-	ptSapContext sapContext;
+	struct sap_context *sapContext;
 
 	QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_MED,
 			"%s", __func__);
 
 	for (i = 0; i < SAP_MAX_NUM_SESSION; i++) {
-		sapContext = (ptSapContext) mac->sap.sapCtxList[i].pSapContext;
+		sapContext = mac->sap.sapCtxList[i].pSapContext;
 		if (((QDF_SAP_MODE == mac->sap.sapCtxList[i].sapPersona)
 		    ||
 		    (QDF_P2P_GO_MODE == mac->sap.sapCtxList[i].sapPersona)) &&
@@ -2640,7 +2641,7 @@ static ptSapContext sap_find_cac_wait_session(tHalHandle handle)
  *
  * Return: QDF_STATUS
  */
-QDF_STATUS sap_close_session(tHalHandle hal, ptSapContext sapctx,
+QDF_STATUS sap_close_session(tHalHandle hal, struct sap_context *sapctx,
 			     csr_roamSessionCloseCallback callback, bool valid)
 {
 	if (false == valid)
@@ -2670,8 +2671,8 @@ void sap_cac_reset_notify(tHalHandle hHal)
 	tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
 
 	for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++) {
-		ptSapContext pSapContext =
-			(ptSapContext) pMac->sap.sapCtxList[intf].pSapContext;
+		struct sap_context *pSapContext =
+			pMac->sap.sapCtxList[intf].pSapContext;
 		if (((QDF_SAP_MODE == pMac->sap.sapCtxList[intf].sapPersona)
 		    ||
 		    (QDF_P2P_GO_MODE == pMac->sap.sapCtxList[intf].sapPersona))
@@ -2702,8 +2703,8 @@ static QDF_STATUS sap_cac_start_notify(tHalHandle hHal)
 	QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
 
 	for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++) {
-		ptSapContext pSapContext =
-			(ptSapContext) pMac->sap.sapCtxList[intf].pSapContext;
+		struct sap_context *pSapContext =
+			pMac->sap.sapCtxList[intf].pSapContext;
 		if (((QDF_SAP_MODE == pMac->sap.sapCtxList[intf].sapPersona)
 		    ||
 		    (QDF_P2P_GO_MODE == pMac->sap.sapCtxList[intf].sapPersona))
@@ -2740,7 +2741,7 @@ static QDF_STATUS sap_cac_start_notify(tHalHandle hHal)
  *
  * Return: QDF_STATUS
  */
-static QDF_STATUS wlansap_update_pre_cac_end(ptSapContext sap_context,
+static QDF_STATUS wlansap_update_pre_cac_end(struct sap_context *sap_context,
 		tpAniSirGlobal mac, uint8_t intf)
 {
 	QDF_STATUS qdf_status;
@@ -2794,8 +2795,8 @@ static QDF_STATUS sap_cac_end_notify(tHalHandle hHal, tCsrRoamInfo *roamInfo)
 	 * sap_radar_found_status is set to 0
 	 */
 	for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++) {
-		ptSapContext pSapContext =
-			(ptSapContext) pMac->sap.sapCtxList[intf].pSapContext;
+		struct sap_context *pSapContext =
+			pMac->sap.sapCtxList[intf].pSapContext;
 		if (((QDF_SAP_MODE == pMac->sap.sapCtxList[intf].sapPersona)
 		    ||
 		    (QDF_P2P_GO_MODE == pMac->sap.sapCtxList[intf].sapPersona))
@@ -2895,7 +2896,7 @@ static QDF_STATUS sap_cac_end_notify(tHalHandle hHal, tCsrRoamInfo *roamInfo)
  *
  * Return: QDF_STATUS
  */
-static QDF_STATUS sap_fsm_state_disconnected(ptSapContext sap_ctx,
+static QDF_STATUS sap_fsm_state_disconnected(struct sap_context *sap_ctx,
 			ptWLAN_SAPEvent sap_event, tpAniSirGlobal mac_ctx,
 			tHalHandle hal)
 {
@@ -2971,7 +2972,7 @@ static QDF_STATUS sap_fsm_state_disconnected(ptSapContext sap_ctx,
  *
  * Return: QDF_STATUS
  */
-static QDF_STATUS sap_fsm_state_ch_select(ptSapContext sap_ctx,
+static QDF_STATUS sap_fsm_state_ch_select(struct sap_context *sap_ctx,
 			ptWLAN_SAPEvent sap_event, tpAniSirGlobal mac_ctx,
 			tHalHandle hal)
 {
@@ -3126,7 +3127,7 @@ static QDF_STATUS sap_fsm_state_ch_select(ptSapContext sap_ctx,
  *
  * Return: QDF_STATUS
  */
-static QDF_STATUS sap_fsm_state_dfs_cac_wait(ptSapContext sap_ctx,
+static QDF_STATUS sap_fsm_state_dfs_cac_wait(struct sap_context *sap_ctx,
 			ptWLAN_SAPEvent sap_event, tpAniSirGlobal mac_ctx,
 			tHalHandle hal)
 {
@@ -3156,7 +3157,7 @@ static QDF_STATUS sap_fsm_state_dfs_cac_wait(ptSapContext sap_ctx,
 		}
 
 		for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++) {
-			ptSapContext t_sap_ctx;
+			struct sap_context *t_sap_ctx;
 			t_sap_ctx = mac_ctx->sap.sapCtxList[intf].pSapContext;
 			if (((QDF_SAP_MODE ==
 				 mac_ctx->sap.sapCtxList[intf].sapPersona) ||
@@ -3226,7 +3227,7 @@ static QDF_STATUS sap_fsm_state_dfs_cac_wait(ptSapContext sap_ctx,
  *
  * Return: QDF_STATUS
  */
-static QDF_STATUS sap_fsm_state_starting(ptSapContext sap_ctx,
+static QDF_STATUS sap_fsm_state_starting(struct sap_context *sap_ctx,
 			ptWLAN_SAPEvent sap_event, tpAniSirGlobal mac_ctx,
 			tHalHandle hal)
 {
@@ -3350,7 +3351,7 @@ static QDF_STATUS sap_fsm_state_starting(ptSapContext sap_ctx,
  *
  * Return: QDF_STATUS
  */
-static QDF_STATUS sap_fsm_state_started(ptSapContext sap_ctx,
+static QDF_STATUS sap_fsm_state_started(struct sap_context *sap_ctx,
 			ptWLAN_SAPEvent sap_event, tpAniSirGlobal mac_ctx)
 {
 	uint32_t msg = sap_event->event;
@@ -3374,7 +3375,7 @@ static QDF_STATUS sap_fsm_state_started(ptSapContext sap_ctx,
 		 * Request for CSA IE transmission
 		 */
 		for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++) {
-			ptSapContext temp_sap_ctx;
+			struct sap_context *temp_sap_ctx;
 			if (((QDF_SAP_MODE ==
 				mac_ctx->sap.sapCtxList[intf].sapPersona) ||
 			    (QDF_P2P_GO_MODE ==
@@ -3429,7 +3430,7 @@ static QDF_STATUS sap_fsm_state_started(ptSapContext sap_ctx,
  *
  * Return: QDF_STATUS
  */
-static QDF_STATUS sap_fsm_state_disconnecting(ptSapContext sap_ctx,
+static QDF_STATUS sap_fsm_state_disconnecting(struct sap_context *sap_ctx,
 			ptWLAN_SAPEvent sap_event, tpAniSirGlobal mac_ctx,
 			tHalHandle hal)
 {
@@ -3491,7 +3492,7 @@ static QDF_STATUS sap_fsm_state_disconnecting(ptSapContext sap_ctx,
  *
  * Return: QDF_STATUS
  */
-QDF_STATUS sap_fsm(ptSapContext sap_ctx, ptWLAN_SAPEvent sap_event)
+QDF_STATUS sap_fsm(struct sap_context *sap_ctx, ptWLAN_SAPEvent sap_event)
 {
 	/*
 	 * Retrieve the phy link state machine structure
@@ -3901,7 +3902,8 @@ void sap_print_acl(struct qdf_mac_addr *macList, uint8_t size)
 	return;
 }
 
-QDF_STATUS sap_is_peer_mac_allowed(ptSapContext sapContext, uint8_t *peerMac)
+QDF_STATUS sap_is_peer_mac_allowed(struct sap_context *sapContext,
+				   uint8_t *peerMac)
 {
 	if (eSAP_ALLOW_ALL == sapContext->eSapMacAddrAclMode)
 		return QDF_STATUS_SUCCESS;
@@ -3956,7 +3958,7 @@ QDF_STATUS sap_is_peer_mac_allowed(ptSapContext sapContext, uint8_t *peerMac)
  *
  * Return: QDF_STATUS
  */
-static QDF_STATUS sap_get_channel_list(ptSapContext sap_ctx,
+static QDF_STATUS sap_get_channel_list(struct sap_context *sap_ctx,
 				       uint8_t **ch_list,
 				       uint8_t *num_ch)
 {
@@ -4116,7 +4118,7 @@ static QDF_STATUS sap_get_channel_list(ptSapContext sap_ctx,
 }
 #endif
 
-uint8_t sap_indicate_radar(ptSapContext sap_ctx)
+uint8_t sap_indicate_radar(struct sap_context *sap_ctx)
 {
 	uint8_t target_channel = 0;
 	tHalHandle hal;
@@ -4180,7 +4182,7 @@ uint8_t sap_indicate_radar(ptSapContext sap_ctx)
  */
 void sap_dfs_cac_timer_callback(void *data)
 {
-	ptSapContext sapContext;
+	struct sap_context *sapContext;
 	tWLAN_SAPEvent sapEvent;
 	tHalHandle hHal = (tHalHandle) data;
 	tpAniSirGlobal pMac;
@@ -4228,7 +4230,7 @@ void sap_dfs_cac_timer_callback(void *data)
 /*
  * Function to stop the DFS CAC Timer
  */
-static int sap_stop_dfs_cac_timer(ptSapContext sapContext)
+static int sap_stop_dfs_cac_timer(struct sap_context *sapContext)
 {
 	tHalHandle hHal;
 	tpAniSirGlobal pMac;
@@ -4266,7 +4268,7 @@ static int sap_stop_dfs_cac_timer(ptSapContext sapContext)
  * Function to start the DFS CAC Timer
  * when SAP is started on a DFS channel
  */
-int sap_start_dfs_cac_timer(ptSapContext sap_ctx)
+static int sap_start_dfs_cac_timer(struct sap_context *sap_ctx)
 {
 	QDF_STATUS status;
 	uint32_t cac_dur;
@@ -4330,7 +4332,7 @@ int sap_start_dfs_cac_timer(ptSapContext sap_ctx)
  * parameters required to track the radar
  * found DFS channels in the current Reg. Domain .
  */
-QDF_STATUS sap_init_dfs_channel_nol_list(ptSapContext sapContext)
+QDF_STATUS sap_init_dfs_channel_nol_list(struct sap_context *sapContext)
 {
 	uint8_t count = 0;
 	int i;
@@ -4422,10 +4424,10 @@ uint8_t sap_get_total_number_sap_intf(tHalHandle hHal)
  * passed sap context and return its channel change ready status
  */
 bool is_concurrent_sap_ready_for_channel_change(tHalHandle hHal,
-						ptSapContext sapContext)
+						struct sap_context *sapContext)
 {
 	tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
-	ptSapContext pSapContext;
+	struct sap_context *pSapContext;
 	uint8_t intf = 0;
 
 	for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++) {
@@ -4434,8 +4436,7 @@ bool is_concurrent_sap_ready_for_channel_change(tHalHandle hHal,
 		    (QDF_P2P_GO_MODE == pMac->sap.sapCtxList[intf].sapPersona))
 		    && pMac->sap.sapCtxList[intf].pSapContext != NULL) {
 			pSapContext =
-				(ptSapContext) pMac->sap.sapCtxList[intf].
-				pSapContext;
+				pMac->sap.sapCtxList[intf].pSapContext;
 			if (pSapContext == sapContext) {
 				QDF_TRACE(QDF_MODULE_ID_SAP,
 					  QDF_TRACE_LEVEL_ERROR,

+ 25 - 26
core/sap/src/sap_internal.h

@@ -62,7 +62,7 @@ extern "C" {
 #define WLANSAP_SECURITY_ENABLED_STATE true
 
 /* When MBSSID feature is enabled, SAP context is directly passed to SAP APIs */
-#define CDS_GET_SAP_CB(ctx) (ptSapContext)(ctx)
+#define CDS_GET_SAP_CB(ctx) (ctx)
 
 #define CDS_GET_HAL_CB() cds_get_context(QDF_MODULE_ID_PE)
 /* MAC Address length */
@@ -274,7 +274,6 @@ struct sap_context {
 	uint8_t sap_sta_id;
 	bool dfs_cac_offload;
 };
-typedef struct sap_context *ptSapContext;
 
 /*----------------------------------------------------------------------------
  *  External declarations for global context
@@ -298,8 +297,8 @@ typedef struct sWLAN_SAPEvent {
 /*----------------------------------------------------------------------------
  * Function Declarations and Documentation
  * -------------------------------------------------------------------------*/
-QDF_STATUS wlansap_context_get(ptSapContext ctx);
-void wlansap_context_put(ptSapContext ctx);
+QDF_STATUS wlansap_context_get(struct sap_context *ctx);
+void wlansap_context_put(struct sap_context *ctx);
 
 QDF_STATUS
 wlansap_scan_callback
@@ -323,18 +322,18 @@ wlansap_roam_callback
 	uint32_t roamId,
 	eRoamCmdStatus roamStatus, eCsrRoamResult roamResult);
 
-QDF_STATUS SapFsm(ptSapContext sapContext, ptWLAN_SAPEvent sapEvent,
+QDF_STATUS SapFsm(struct sap_context *sapContext, ptWLAN_SAPEvent sapEvent,
 			 uint8_t *status);
 
-uint8_t sap_select_channel(tHalHandle halHandle, ptSapContext pSapCtx,
+uint8_t sap_select_channel(tHalHandle halHandle, struct sap_context *pSapCtx,
 			   tScanResultHandle pScanResult);
 
 QDF_STATUS
-sap_signal_hdd_event(ptSapContext sapContext,
+sap_signal_hdd_event(struct sap_context *sapContext,
 		  tCsrRoamInfo *pCsrRoamInfo,
 		  eSapHddEvent sapHddevent, void *);
 
-QDF_STATUS sap_fsm(ptSapContext sapContext, ptWLAN_SAPEvent sapEvent);
+QDF_STATUS sap_fsm(struct sap_context *sapContext, ptWLAN_SAPEvent sapEvent);
 
 eSapStatus
 sapconvert_to_csr_profile(tsap_Config_t *pconfig_params,
@@ -344,7 +343,7 @@ sapconvert_to_csr_profile(tsap_Config_t *pconfig_params,
 void sap_free_roam_profile(tCsrRoamProfile *profile);
 
 QDF_STATUS
-sap_is_peer_mac_allowed(ptSapContext sapContext, uint8_t *peerMac);
+sap_is_peer_mac_allowed(struct sap_context *sapContext, uint8_t *peerMac);
 
 void
 sap_sort_mac_list(struct qdf_mac_addr *macList, uint8_t size);
@@ -364,17 +363,18 @@ bool
 sap_search_mac_list(struct qdf_mac_addr *macList, uint8_t num_mac,
 		 uint8_t *peerMac, uint8_t *index);
 
-QDF_STATUS sap_acquire_global_lock(ptSapContext pSapCtx);
+QDF_STATUS sap_acquire_global_lock(struct sap_context *pSapCtx);
 
-QDF_STATUS sap_release_global_lock(ptSapContext pSapCtx);
+QDF_STATUS sap_release_global_lock(struct sap_context *pSapCtx);
 
 #ifdef FEATURE_WLAN_CH_AVOID
-void sap_update_unsafe_channel_list(tHalHandle hal, ptSapContext pSapCtx);
+void sap_update_unsafe_channel_list(tHalHandle hal,
+				    struct sap_context *pSapCtx);
 #endif /* FEATURE_WLAN_CH_AVOID */
 
-QDF_STATUS sap_init_dfs_channel_nol_list(ptSapContext sapContext);
+QDF_STATUS sap_init_dfs_channel_nol_list(struct sap_context *sapContext);
 
-bool sap_dfs_is_channel_in_nol_list(ptSapContext sapContext,
+bool sap_dfs_is_channel_in_nol_list(struct sap_context *sapContext,
 				    uint8_t channelNumber,
 				    ePhyChanBondState chanBondState);
 void sap_dfs_cac_timer_callback(void *data);
@@ -382,13 +382,12 @@ void sap_dfs_cac_timer_callback(void *data);
 void sap_cac_reset_notify(tHalHandle hHal);
 
 bool
-sap_channel_matrix_check(ptSapContext sapContext,
+sap_channel_matrix_check(struct sap_context *sapContext,
 			 ePhyChanBondState cbMode,
 			 uint8_t target_channel);
 
 bool is_concurrent_sap_ready_for_channel_change(tHalHandle hHal,
-						ptSapContext
-						sapContext);
+						struct sap_context *sapContext);
 
 uint8_t sap_get_total_number_sap_intf(tHalHandle hHal);
 
@@ -398,12 +397,12 @@ bool sap_dfs_is_channel_in_preferred_location(tHalHandle hHal,
 					      uint8_t channelID);
 
 QDF_STATUS sap_goto_channel_sel(
-	ptSapContext sapContext,
+	struct sap_context *sapContext,
 	ptWLAN_SAPEvent sapEvent,
 	bool sap_do_acs_pre_start_bss,
 	bool check_for_connection_update);
 
-void sap_config_acs_result(tHalHandle hal, ptSapContext sap_ctx,
+void sap_config_acs_result(tHalHandle hal, struct sap_context *sap_ctx,
 							uint32_t sec_ch);
 /**
  * sap_check_in_avoid_ch_list() - checks if given channel present is channel
@@ -419,11 +418,11 @@ void sap_config_acs_result(tHalHandle hal, ptSapContext sap_ctx,
  * Return: true, if channel was present, false othersie.
  */
 bool
-sap_check_in_avoid_ch_list(ptSapContext sap_ctx, uint8_t channel);
-QDF_STATUS sap_open_session(tHalHandle hHal, ptSapContext sapContext,
+sap_check_in_avoid_ch_list(struct sap_context *sap_ctx, uint8_t channel);
+QDF_STATUS sap_open_session(tHalHandle hHal, struct sap_context *sapContext,
 				uint32_t session_id);
 QDF_STATUS sap_close_session(tHalHandle hHal,
-			     ptSapContext sapContext,
+			     struct sap_context *sapContext,
 			     csr_roamSessionCloseCallback callback, bool valid);
 /**
  * sap_set_session_param() - set sap related param to sap context and global var
@@ -435,7 +434,7 @@ QDF_STATUS sap_close_session(tHalHandle hHal,
  *
  * Return: QDF_STATUS
  */
-QDF_STATUS sap_set_session_param(tHalHandle hal, ptSapContext sapctx,
+QDF_STATUS sap_set_session_param(tHalHandle hal, struct sap_context *sapctx,
 				uint32_t session_id);
 /**
  * sap_clear_session_param() - clear sap related param from sap context
@@ -447,7 +446,7 @@ QDF_STATUS sap_set_session_param(tHalHandle hal, ptSapContext sapctx,
  *
  * Return: QDF_STATUS
  */
-QDF_STATUS sap_clear_session_param(tHalHandle hal, ptSapContext sapctx,
+QDF_STATUS sap_clear_session_param(tHalHandle hal, struct sap_context *sapctx,
 				uint32_t session_id);
 /**
  * sap_mark_leaking_ch() - to mark channel leaking in to nol
@@ -464,7 +463,7 @@ QDF_STATUS sap_clear_session_param(tHalHandle hal, ptSapContext sapctx,
  * Return: QDF_STATUS
  */
 QDF_STATUS
-sap_mark_leaking_ch(ptSapContext sap_ctx,
+sap_mark_leaking_ch(struct sap_context *sap_ctx,
 		enum phy_ch_width ch_width,
 		tSapDfsNolInfo *nol,
 		uint8_t temp_ch_lst_sz,
@@ -481,7 +480,7 @@ void sap_scan_event_callback(struct wlan_objmgr_vdev *vdev,
  *
  * Return: channel to which sap wishes to switch.
  */
-uint8_t sap_indicate_radar(ptSapContext sap_ctx);
+uint8_t sap_indicate_radar(struct sap_context *sap_ctx);
 
 #ifdef __cplusplus
 }

+ 68 - 67
core/sap/src/sap_module.c

@@ -78,7 +78,7 @@
  * -------------------------------------------------------------------------*/
 /*  No!  Get this from CDS. */
 /*  The main per-Physical Link (per WLAN association) context. */
-static ptSapContext gp_sap_ctx[SAP_MAX_NUM_SESSION];
+static struct sap_context *gp_sap_ctx[SAP_MAX_NUM_SESSION];
 static qdf_atomic_t sap_ctx_ref_count[SAP_MAX_NUM_SESSION];
 
 /*----------------------------------------------------------------------------
@@ -166,7 +166,7 @@ QDF_STATUS wlansap_global_deinit(void)
  *
  * Return: QDF_STATUS
  */
-static QDF_STATUS wlansap_save_context(ptSapContext ctx)
+static QDF_STATUS wlansap_save_context(struct sap_context *ctx)
 {
 	uint32_t i;
 
@@ -199,7 +199,7 @@ static QDF_STATUS wlansap_save_context(ptSapContext ctx)
  *
  * Return: QDF_STATUS
  */
-QDF_STATUS wlansap_context_get(ptSapContext ctx)
+QDF_STATUS wlansap_context_get(struct sap_context *ctx)
 {
 	uint32_t i;
 
@@ -226,7 +226,7 @@ QDF_STATUS wlansap_context_get(ptSapContext ctx)
  *
  * Return: None
  */
-void wlansap_context_put(ptSapContext ctx)
+void wlansap_context_put(struct sap_context *ctx)
 {
 	uint32_t i;
 
@@ -262,7 +262,7 @@ void wlansap_context_put(ptSapContext ctx)
  */
 void *wlansap_open(void)
 {
-	ptSapContext pSapCtx;
+	struct sap_context *pSapCtx;
 	QDF_STATUS status;
 
 	/* dynamically allocate the sapContext */
@@ -311,7 +311,7 @@ void *wlansap_open(void)
 QDF_STATUS wlansap_start(void *pCtx, enum tQDF_ADAPTER_MODE mode,
 			 uint8_t *addr, uint32_t session_id)
 {
-	ptSapContext pSapCtx = NULL;
+	struct sap_context *pSapCtx = NULL;
 	QDF_STATUS qdf_ret_status;
 	tHalHandle hal;
 	tpAniSirGlobal pmac;
@@ -412,7 +412,7 @@ QDF_STATUS wlansap_start(void *pCtx, enum tQDF_ADAPTER_MODE mode,
  */
 QDF_STATUS wlansap_stop(void *pCtx)
 {
-	ptSapContext pSapCtx = NULL;
+	struct sap_context *pSapCtx = NULL;
 	tHalHandle hal;
 	tpAniSirGlobal pmac;
 
@@ -468,7 +468,7 @@ QDF_STATUS wlansap_stop(void *pCtx)
  */
 QDF_STATUS wlansap_close(void *pCtx)
 {
-	ptSapContext pSapCtx = NULL;
+	struct sap_context *pSapCtx = NULL;
 	tHalHandle hal;
 
 	/* Sanity check - Extract SAP control block */
@@ -505,7 +505,7 @@ bool wlansap_is_channel_in_nol_list(void *p_cds_gctx,
 				    uint8_t channelNumber,
 				    ePhyChanBondState chanBondState)
 {
-	ptSapContext pSapCtx = NULL;
+	struct sap_context *pSapCtx = NULL;
 
 	pSapCtx = CDS_GET_SAP_CB(p_cds_gctx);
 
@@ -520,7 +520,7 @@ bool wlansap_is_channel_in_nol_list(void *p_cds_gctx,
 }
 
 #ifdef WLAN_ENABLE_CHNL_MATRIX_RESTRICTION
-static QDF_STATUS wlansap_mark_leaking_channel(ptSapContext sap_ctx,
+static QDF_STATUS wlansap_mark_leaking_channel(struct sap_context *sap_ctx,
 		tSapDfsNolInfo *nol,
 		uint8_t *leakage_adjusted_lst,
 		uint8_t chan_bw)
@@ -530,7 +530,7 @@ static QDF_STATUS wlansap_mark_leaking_channel(ptSapContext sap_ctx,
 			leakage_adjusted_lst);
 }
 #else
-static QDF_STATUS wlansap_mark_leaking_channel(ptSapContext sap_ctx,
+static QDF_STATUS wlansap_mark_leaking_channel(struct sap_context *sap_ctx,
 		tSapDfsNolInfo *nol,
 		uint8_t *leakage_adjusted_lst,
 		uint8_t chan_bw)
@@ -542,7 +542,7 @@ static QDF_STATUS wlansap_mark_leaking_channel(ptSapContext sap_ctx,
 bool wlansap_is_channel_leaking_in_nol(void *ctx, uint8_t channel,
 		uint8_t chan_bw)
 {
-	ptSapContext sap_ctx = CDS_GET_SAP_CB(ctx);
+	struct sap_context *sap_ctx = CDS_GET_SAP_CB(ctx);
 	tpAniSirGlobal mac_ctx;
 	uint8_t leakage_adjusted_lst[1];
 	void *handle = NULL;
@@ -588,7 +588,7 @@ uint16_t wlansap_check_cc_intf(void *Ctx)
 {
 	tHalHandle hHal;
 	uint16_t intf_ch;
-	ptSapContext pSapCtx = CDS_GET_SAP_CB(Ctx);
+	struct sap_context *pSapCtx = CDS_GET_SAP_CB(Ctx);
 
 	hHal = (tHalHandle) CDS_GET_HAL_CB();
 	if (NULL == hHal) {
@@ -617,7 +617,7 @@ uint16_t wlansap_check_cc_intf(void *Ctx)
   */
 static QDF_STATUS
 wlansap_set_scan_acs_channel_params(tsap_Config_t *pconfig,
-				ptSapContext psap_ctx,
+				struct sap_context *psap_ctx,
 				void *pusr_context)
 {
 	tHalHandle h_hal = NULL;
@@ -691,7 +691,7 @@ wlansap_set_scan_acs_channel_params(tsap_Config_t *pconfig,
 
 eCsrPhyMode wlan_sap_get_phymode(void *ctx)
 {
-	ptSapContext sap_ctx = CDS_GET_SAP_CB(ctx);
+	struct sap_context *sap_ctx = CDS_GET_SAP_CB(ctx);
 
 	if (!sap_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -711,7 +711,7 @@ eCsrPhyMode wlan_sap_get_phymode(void *ctx)
  */
 uint32_t wlan_sap_get_vht_ch_width(void *ctx)
 {
-	ptSapContext sap_ctx = CDS_GET_SAP_CB(ctx);
+	struct sap_context *sap_ctx = CDS_GET_SAP_CB(ctx);
 
 	if (!sap_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -733,7 +733,7 @@ uint32_t wlan_sap_get_vht_ch_width(void *ctx)
  */
 void wlan_sap_set_vht_ch_width(void *ctx, uint32_t vht_channel_width)
 {
-	ptSapContext sap_ctx = CDS_GET_SAP_CB(ctx);
+	struct sap_context *sap_ctx = CDS_GET_SAP_CB(ctx);
 
 	if (!sap_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -755,7 +755,7 @@ void wlan_sap_set_vht_ch_width(void *ctx, uint32_t vht_channel_width)
  */
 #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
 static bool wlan_sap_validate_channel_switch(tHalHandle hal, uint16_t sap_ch,
-		ptSapContext sap_context)
+		struct sap_context *sap_context)
 {
 	return sme_validate_sap_channel_switch(
 			hal,
@@ -766,7 +766,7 @@ static bool wlan_sap_validate_channel_switch(tHalHandle hal, uint16_t sap_ch,
 }
 #else
 static inline bool wlan_sap_validate_channel_switch(tHalHandle hal,
-		uint16_t sap_ch, ptSapContext sap_context)
+		uint16_t sap_ch, struct sap_context *sap_context)
 {
 	return true;
 }
@@ -796,7 +796,7 @@ QDF_STATUS wlansap_start_bss(void *pCtx,     /* pwextCtx */
 			     tsap_Config_t *pConfig, void *pUsrContext) {
 	tWLAN_SAPEvent sapEvent;        /* State machine event */
 	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
-	ptSapContext pSapCtx = NULL;
+	struct sap_context *pSapCtx = NULL;
 	tHalHandle hHal;
 	tpAniSirGlobal pmac = NULL;
 
@@ -946,7 +946,7 @@ fail:
 QDF_STATUS wlansap_set_mac_acl(void *pCtx,    /* pwextCtx */
 			       tsap_Config_t *pConfig) {
 	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
-	ptSapContext pSapCtx = NULL;
+	struct sap_context *pSapCtx = NULL;
 
 	QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
 		  "wlansap_set_mac_acl");
@@ -997,7 +997,7 @@ QDF_STATUS wlansap_stop_bss(void *pCtx)
 {
 	tWLAN_SAPEvent sapEvent;        /* State machine event */
 	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
-	ptSapContext pSapCtx = NULL;
+	struct sap_context *pSapCtx = NULL;
 	/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
 
 	/*------------------------------------------------------------------------
@@ -1031,7 +1031,7 @@ QDF_STATUS wlansap_stop_bss(void *pCtx)
 /* This routine will set the mode of operation for ACL dynamically*/
 QDF_STATUS wlansap_set_mode(void *pCtx, uint32_t mode)
 {
-	ptSapContext pSapCtx = CDS_GET_SAP_CB(pCtx);
+	struct sap_context *pSapCtx = CDS_GET_SAP_CB(pCtx);
 
 	if (NULL == pSapCtx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -1046,7 +1046,7 @@ QDF_STATUS wlansap_set_mode(void *pCtx, uint32_t mode)
 /* Get ACL Mode */
 QDF_STATUS wlansap_get_acl_mode(void *pCtx, eSapMacAddrACL *mode)
 {
-	ptSapContext pSapCtx = CDS_GET_SAP_CB(pCtx);
+	struct sap_context *pSapCtx = CDS_GET_SAP_CB(pCtx);
 
 	if (NULL == pSapCtx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -1063,7 +1063,7 @@ QDF_STATUS
 wlansap_get_acl_accept_list(void *pCtx, struct qdf_mac_addr *pAcceptList,
 				uint8_t *nAcceptList)
 {
-	ptSapContext pSapCtx = CDS_GET_SAP_CB(pCtx);
+	struct sap_context *pSapCtx = CDS_GET_SAP_CB(pCtx);
 	if (NULL == pSapCtx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
 			  "%s: Invalid SAP pointer from p_cds_gctx", __func__);
@@ -1081,7 +1081,7 @@ QDF_STATUS
 wlansap_get_acl_deny_list(void *pCtx, struct qdf_mac_addr *pDenyList,
 			  uint8_t *nDenyList)
 {
-	ptSapContext pSapCtx = CDS_GET_SAP_CB(pCtx);
+	struct sap_context *pSapCtx = CDS_GET_SAP_CB(pCtx);
 	if (NULL == pSapCtx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
 			  "%s: Invalid SAP pointer from p_cds_gctx", __func__);
@@ -1098,7 +1098,7 @@ wlansap_get_acl_deny_list(void *pCtx, struct qdf_mac_addr *pDenyList,
 
 QDF_STATUS wlansap_clear_acl(void *pCtx)
 {
-	ptSapContext pSapCtx = CDS_GET_SAP_CB(pCtx);
+	struct sap_context *pSapCtx = CDS_GET_SAP_CB(pCtx);
 	uint8_t i;
 
 	if (NULL == pSapCtx) {
@@ -1144,7 +1144,7 @@ wlansap_modify_acl
 	uint8_t *peer_sta_mac, eSapACLType list_type, eSapACLCmdType cmd) {
 	bool sta_white_list = false, sta_black_list = false;
 	uint8_t staWLIndex, staBLIndex;
-	ptSapContext sap_ctx = CDS_GET_SAP_CB(ctx);
+	struct sap_context *sap_ctx = CDS_GET_SAP_CB(ctx);
 
 	if (NULL == sap_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -1375,7 +1375,7 @@ wlansap_modify_acl
 QDF_STATUS wlansap_disassoc_sta(void *pCtx,
 				struct tagCsrDelStaParams *p_del_sta_params)
 {
-	ptSapContext pSapCtx = CDS_GET_SAP_CB(pCtx);
+	struct sap_context *pSapCtx = CDS_GET_SAP_CB(pCtx);
 
 	/*------------------------------------------------------------------------
 	   Sanity check
@@ -1411,7 +1411,7 @@ QDF_STATUS wlansap_deauth_sta(void *pCtx,
 {
 	QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE;
 	QDF_STATUS qdf_status = QDF_STATUS_E_FAULT;
-	ptSapContext pSapCtx = CDS_GET_SAP_CB(pCtx);
+	struct sap_context *pSapCtx = CDS_GET_SAP_CB(pCtx);
 
 	/*------------------------------------------------------------------------
 	   Sanity check
@@ -1441,8 +1441,9 @@ QDF_STATUS wlansap_deauth_sta(void *pCtx,
  *
  * Return: The QDF_STATUS code associated with performing the operation
  */
-static QDF_STATUS wlansap_update_csa_channel_params(ptSapContext sap_context,
-	uint32_t channel)
+static QDF_STATUS
+wlansap_update_csa_channel_params(struct sap_context *sap_context,
+				  uint32_t channel)
 {
 	void *hal;
 	tpAniSirGlobal mac_ctx;
@@ -1522,7 +1523,7 @@ wlansap_set_channel_change_with_csa(void *p_cds_gctx, uint32_t targetChannel,
 					enum phy_ch_width target_bw, bool strict)
 {
 
-	ptSapContext sapContext = NULL;
+	struct sap_context *sapContext = NULL;
 	tWLAN_SAPEvent sapEvent;
 	tpAniSirGlobal pMac = NULL;
 	void *hHal = NULL;
@@ -1706,7 +1707,7 @@ wlansap_set_channel_change_with_csa(void *p_cds_gctx, uint32_t targetChannel,
  */
 QDF_STATUS wlansap_set_counter_measure(void *pCtx, bool bEnable)
 {
-	ptSapContext pSapCtx = CDS_GET_SAP_CB(pCtx);
+	struct sap_context *pSapCtx = CDS_GET_SAP_CB(pCtx);
 
 	/*------------------------------------------------------------------------
 	   Sanity check
@@ -1739,7 +1740,7 @@ QDF_STATUS wlansap_set_counter_measure(void *pCtx, bool bEnable)
 QDF_STATUS wlansap_set_key_sta(void *pCtx, tCsrRoamSetKey *pSetKeyInfo)
 {
 	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
-	ptSapContext pSapCtx = NULL;
+	struct sap_context *pSapCtx = NULL;
 	void *hHal = NULL;
 	QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE;
 	uint32_t roamId = 0xFF;
@@ -1786,7 +1787,7 @@ QDF_STATUS
 wlan_sap_getstation_ie_information
 	(void *ctx, uint32_t *len, uint8_t *buf) {
 	QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
-	ptSapContext sap_ctx = NULL;
+	struct sap_context *sap_ctx = NULL;
 	uint32_t ie_len = 0;
 
 	sap_ctx = CDS_GET_SAP_CB(ctx);
@@ -1830,7 +1831,7 @@ wlan_sap_getstation_ie_information
  */
 QDF_STATUS wlansap_get_wps_state(void *pCtx, bool *bWPSState)
 {
-	ptSapContext pSapCtx = NULL;
+	struct sap_context *pSapCtx = NULL;
 	void *hHal = NULL;
 
 	pSapCtx = CDS_GET_SAP_CB(pCtx);
@@ -1865,7 +1866,7 @@ QDF_STATUS wlansap_get_wps_state(void *pCtx, bool *bWPSState)
 
 }
 
-QDF_STATUS sap_acquire_global_lock(ptSapContext pSapCtx)
+QDF_STATUS sap_acquire_global_lock(struct sap_context *pSapCtx)
 {
 	QDF_STATUS qdf_status = QDF_STATUS_E_FAULT;
 
@@ -1876,7 +1877,7 @@ QDF_STATUS sap_acquire_global_lock(ptSapContext pSapCtx)
 	return qdf_status;
 }
 
-QDF_STATUS sap_release_global_lock(ptSapContext pSapCtx)
+QDF_STATUS sap_release_global_lock(struct sap_context *pSapCtx)
 {
 	QDF_STATUS qdf_status = QDF_STATUS_E_FAULT;
 
@@ -1903,7 +1904,7 @@ QDF_STATUS sap_release_global_lock(ptSapContext pSapCtx)
  */
 QDF_STATUS wlansap_set_wparsn_ies
 	(void *pCtx, uint8_t *pWPARSNIEs, uint32_t WPARSNIEsLen) {
-	ptSapContext pSapCtx = NULL;
+	struct sap_context *pSapCtx = NULL;
 	QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE;
 	void *hHal = NULL;
 
@@ -1955,7 +1956,7 @@ QDF_STATUS wlansap_set_wparsn_ies
 QDF_STATUS wlansap_send_action(void *pCtx, const uint8_t *pBuf,
 	uint32_t len, uint16_t wait, uint16_t channel_freq)
 {
-	ptSapContext pSapCtx = NULL;
+	struct sap_context *pSapCtx = NULL;
 	void *hHal = NULL;
 	QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE;
 
@@ -2008,7 +2009,7 @@ QDF_STATUS wlansap_remain_on_channel(void *pCtx,
 	uint8_t channel, uint32_t duration, remainOnChanCallback callback,
 	void *pContext, uint32_t *scan_id)
 {
-	ptSapContext pSapCtx = NULL;
+	struct sap_context *pSapCtx = NULL;
 	void *hHal = NULL;
 	QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE;
 
@@ -2054,7 +2055,7 @@ QDF_STATUS wlansap_remain_on_channel(void *pCtx,
 QDF_STATUS wlansap_cancel_remain_on_channel(void *pCtx,
 	uint32_t scan_id)
 {
-	ptSapContext pSapCtx = NULL;
+	struct sap_context *pSapCtx = NULL;
 	void *hHal = NULL;
 	QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE;
 
@@ -2089,7 +2090,7 @@ QDF_STATUS wlansap_cancel_remain_on_channel(void *pCtx,
 QDF_STATUS wlan_sap_update_next_channel(void *ctx, uint8_t channel,
 				       enum phy_ch_width chan_bw)
 {
-	ptSapContext sap_ctx = CDS_GET_SAP_CB(ctx);
+	struct sap_context *sap_ctx = CDS_GET_SAP_CB(ctx);
 
 	if (!sap_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -2116,7 +2117,7 @@ QDF_STATUS wlan_sap_update_next_channel(void *ctx, uint8_t channel,
 QDF_STATUS wlan_sap_set_pre_cac_status(void *ctx, bool status,
 					tHalHandle handle)
 {
-	ptSapContext sap_ctx = CDS_GET_SAP_CB(ctx);
+	struct sap_context *sap_ctx = CDS_GET_SAP_CB(ctx);
 	tpAniSirGlobal mac_ctx = PMAC_STRUCT(handle);
 
 	if (!mac_ctx) {
@@ -2150,7 +2151,7 @@ QDF_STATUS wlan_sap_set_pre_cac_status(void *ctx, bool status,
 QDF_STATUS wlan_sap_set_chan_before_pre_cac(void *ctx,
 					uint8_t chan_before_pre_cac)
 {
-	ptSapContext sap_ctx = CDS_GET_SAP_CB(ctx);
+	struct sap_context *sap_ctx = CDS_GET_SAP_CB(ctx);
 
 	if (!sap_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -2173,7 +2174,7 @@ QDF_STATUS wlan_sap_set_chan_before_pre_cac(void *ctx,
  */
 QDF_STATUS wlan_sap_set_pre_cac_complete_status(void *ctx, bool status)
 {
-	ptSapContext sap_ctx = CDS_GET_SAP_CB(ctx);
+	struct sap_context *sap_ctx = CDS_GET_SAP_CB(ctx);
 
 	if (!sap_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -2211,8 +2212,8 @@ bool wlan_sap_is_pre_cac_active(tHalHandle handle)
 	}
 
 	for (i = 0; i < SAP_MAX_NUM_SESSION; i++) {
-		ptSapContext context =
-			(ptSapContext) mac->sap.sapCtxList[i].pSapContext;
+		struct sap_context *context =
+			mac->sap.sapCtxList[i].pSapContext;
 		if (context && context->is_pre_cac_on)
 			return true;
 	}
@@ -2241,8 +2242,8 @@ QDF_STATUS wlan_sap_get_pre_cac_vdev_id(tHalHandle handle, uint8_t *vdev_id)
 	}
 
 	for (i = 0; i < SAP_MAX_NUM_SESSION; i++) {
-		ptSapContext context =
-			(ptSapContext) mac->sap.sapCtxList[i].pSapContext;
+		struct sap_context *context =
+			mac->sap.sapCtxList[i].pSapContext;
 		if (context && context->is_pre_cac_on) {
 			*vdev_id = i;
 			return QDF_STATUS_SUCCESS;
@@ -2269,7 +2270,7 @@ QDF_STATUS wlan_sap_get_pre_cac_vdev_id(tHalHandle handle, uint8_t *vdev_id)
 QDF_STATUS wlansap_register_mgmt_frame
 	(void *pCtx,
 	uint16_t frameType, uint8_t *matchData, uint16_t matchLen) {
-	ptSapContext pSapCtx = NULL;
+	struct sap_context *pSapCtx = NULL;
 	void *hHal = NULL;
 	QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE;
 
@@ -2318,7 +2319,7 @@ QDF_STATUS wlansap_register_mgmt_frame
 QDF_STATUS wlansap_de_register_mgmt_frame
 	(void *pCtx,
 	uint16_t frameType, uint8_t *matchData, uint16_t matchLen) {
-	ptSapContext pSapCtx = NULL;
+	struct sap_context *pSapCtx = NULL;
 	void *hHal = NULL;
 	QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE;
 
@@ -2380,13 +2381,13 @@ QDF_STATUS wlansap_de_register_mgmt_frame
 QDF_STATUS
 wlansap_channel_change_request(void *pSapCtx, uint8_t target_channel)
 {
-	ptSapContext sapContext = NULL;
+	struct sap_context *sapContext = NULL;
 	QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE;
 	void *hHal = NULL;
 	tpAniSirGlobal mac_ctx = NULL;
 	eCsrPhyMode phy_mode;
 	struct ch_params *ch_params;
-	sapContext = (ptSapContext) pSapCtx;
+	sapContext = pSapCtx;
 
 	if (NULL == sapContext) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -2482,12 +2483,12 @@ wlansap_channel_change_request(void *pSapCtx, uint8_t target_channel)
    ============================================================================*/
 QDF_STATUS wlansap_start_beacon_req(void *pSapCtx)
 {
-	ptSapContext sapContext = NULL;
+	struct sap_context *sapContext = NULL;
 	QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE;
 	void *hHal = NULL;
 	uint8_t dfsCacWaitStatus = 0;
 	tpAniSirGlobal pMac = NULL;
-	sapContext = (ptSapContext) pSapCtx;
+	sapContext = pSapCtx;
 
 	if (NULL == sapContext) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -2541,11 +2542,11 @@ QDF_STATUS wlansap_start_beacon_req(void *pSapCtx)
    ============================================================================*/
 QDF_STATUS wlansap_dfs_send_csa_ie_request(void *pSapCtx)
 {
-	ptSapContext sapContext = NULL;
+	struct sap_context *sapContext = NULL;
 	QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE;
 	void *hHal = NULL;
 	tpAniSirGlobal pMac = NULL;
-	sapContext = (ptSapContext) pSapCtx;
+	sapContext = pSapCtx;
 
 	if (NULL == sapContext) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -2714,7 +2715,7 @@ wlansap_set_dfs_restrict_japan_w53(tHalHandle hHal, uint8_t disable_Dfs_W53)
 
 bool sap_is_auto_channel_select(void *pvos_gctx)
 {
-	ptSapContext sapcontext = CDS_GET_SAP_CB(pvos_gctx);
+	struct sap_context *sapcontext = CDS_GET_SAP_CB(pvos_gctx);
 
 	if (NULL == sapcontext) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -3061,7 +3062,7 @@ void wlansap_extend_to_acs_range(tHalHandle hal, uint8_t *startChannelNum,
 
 QDF_STATUS wlan_sap_set_vendor_acs(void *ctx, bool is_vendor_acs)
 {
-	ptSapContext sap_context = (ptSapContext) ctx;
+	struct sap_context *sap_context = ctx;
 
 	if (!sap_context) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -3085,7 +3086,7 @@ QDF_STATUS wlan_sap_set_vendor_acs(void *ctx, bool is_vendor_acs)
 QDF_STATUS wlansap_get_dfs_nol(void *pSapCtx, uint8_t *nol, uint32_t *nol_len)
 {
 	int i = 0, j = 0;
-	ptSapContext sapContext = (ptSapContext) pSapCtx;
+	struct sap_context *sapContext = pSapCtx;
 	void *hHal = NULL;
 	tpAniSirGlobal pMac = NULL;
 	uint64_t current_time, found_time, elapsed_time;
@@ -3170,7 +3171,7 @@ QDF_STATUS wlansap_get_dfs_nol(void *pSapCtx, uint8_t *nol, uint32_t *nol_len)
 
 QDF_STATUS wlansap_set_dfs_nol(void *psap_ctx, eSapDfsNolType conf)
 {
-	ptSapContext sap_ctx = (ptSapContext) psap_ctx;
+	struct sap_context *sap_ctx = psap_ctx;
 	void *hal = NULL;
 	tpAniSirGlobal mac = NULL;
 
@@ -3286,7 +3287,7 @@ wlansap_acs_chselect(void *pvos_gctx,
 			tsap_Config_t *pconfig,
 			void *pusr_context)
 {
-	ptSapContext sap_context = NULL;
+	struct sap_context *sap_context = NULL;
 	tHalHandle h_hal = NULL;
 	QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
 	tpAniSirGlobal pmac = NULL;
@@ -3398,7 +3399,7 @@ void wlan_sap_enable_phy_error_logs(tHalHandle hal, bool enable_log)
  */
 uint32_t wlansap_get_chan_width(void *cds_ctx)
 {
-	ptSapContext sapcontext;
+	struct sap_context *sapcontext;
 
 	sapcontext = CDS_GET_SAP_CB(cds_ctx);
 	return wlan_sap_get_vht_ch_width(sapcontext);
@@ -3443,7 +3444,7 @@ QDF_STATUS wlansap_set_tx_leakage_threshold(tHalHandle hal,
 QDF_STATUS
 wlansap_set_invalid_session(void *cds_ctx)
 {
-	ptSapContext psapctx;
+	struct sap_context *psapctx;
 
 	psapctx = CDS_GET_SAP_CB(cds_ctx);
 	if (NULL == psapctx) {
@@ -3461,7 +3462,7 @@ void wlansap_cleanup_cac_timer(void *sap_ctx)
 {
 	tHalHandle hal;
 	tpAniSirGlobal pmac;
-	ptSapContext psap_ctx = CDS_GET_SAP_CB(sap_ctx);
+	struct sap_context *psap_ctx = CDS_GET_SAP_CB(sap_ctx);
 
 	if (!psap_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,