Browse Source

qcacld-3.0: Replace typedef tsap_config_t

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 tsap_config_t typedef does not
meet any of those criteria, so replace it with the underlying struct.

Change-Id: I95d9ad30d9af35dc4572d70c555b24b0285f8b2d
CRs-Fixed: 2422212
Jeff Johnson 6 years ago
parent
commit
8f8ceb9ac8

+ 1 - 1
core/hdd/inc/wlan_hdd_main.h

@@ -974,7 +974,7 @@ struct hdd_ap_ctx {
 	tCsrRoamSetKey wep_key[CSR_MAX_NUM_KEY];
 	uint8_t wep_def_key_idx;
 	struct sap_context *sap_context;
-	tsap_config_t sap_config;
+	struct sap_config sap_config;
 	uint8_t operating_channel;
 	struct hdd_beacon_data *beacon;
 	qdf_mc_timer_t vendor_acs_timer;

+ 16 - 15
core/hdd/src/wlan_hdd_cfg80211.c

@@ -1606,7 +1606,7 @@ static int is_driver_dfs_capable(struct wiphy *wiphy,
 int wlan_hdd_sap_cfg_dfs_override(struct hdd_adapter *adapter)
 {
 	struct hdd_adapter *con_sap_adapter;
-	tsap_config_t *sap_config, *con_sap_config;
+	struct sap_config *sap_config, *con_sap_config;
 	int con_ch;
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 
@@ -1691,7 +1691,7 @@ int wlan_hdd_sap_cfg_dfs_override(struct hdd_adapter *adapter)
  * Return: 0 if success; -EINVAL if ACS channel list is NULL
  */
 static int wlan_hdd_set_acs_ch_range(
-	tsap_config_t *sap_cfg, enum qca_wlan_vendor_acs_hw_mode hw_mode,
+	struct sap_config *sap_cfg, enum qca_wlan_vendor_acs_hw_mode hw_mode,
 	bool ht_enabled, bool vht_enabled)
 {
 	int i;
@@ -1743,7 +1743,7 @@ static int wlan_hdd_set_acs_ch_range(
 static void wlan_hdd_cfg80211_start_pending_acs(struct work_struct *work);
 
 
-static void hdd_update_acs_channel_list(tsap_config_t *sap_config,
+static void hdd_update_acs_channel_list(struct sap_config *sap_config,
 					enum band_info band)
 {
 	int i, temp_count = 0;
@@ -1783,7 +1783,7 @@ int wlan_hdd_cfg80211_start_acs(struct hdd_adapter *adapter)
 {
 
 	struct hdd_context *hdd_ctx;
-	tsap_config_t *sap_config;
+	struct sap_config *sap_config;
 	sap_event_cb acs_event_callback;
 	uint8_t mcc_to_scc_switch = 0;
 	int status;
@@ -1892,7 +1892,7 @@ int wlan_hdd_cfg80211_start_acs(struct hdd_adapter *adapter)
  */
 static void hdd_update_vendor_pcl_list(struct hdd_context *hdd_ctx,
 		struct hdd_vendor_acs_chan_params *acs_chan_params,
-		tsap_config_t *sap_config)
+		struct sap_config *sap_config)
 {
 	int i, j;
 	/*
@@ -1935,7 +1935,7 @@ static int hdd_update_reg_chan_info(struct hdd_adapter *adapter,
 	struct ch_params ch_params = {0};
 	uint8_t bw_offset = 0, chan = 0;
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	tsap_config_t *sap_config = &adapter->session.ap.sap_config;
+	struct sap_config *sap_config = &adapter->session.ap.sap_config;
 	mac_handle_t mac_handle;
 	uint8_t sub_20_chan_width = 0;
 	QDF_STATUS status;
@@ -2030,7 +2030,7 @@ static int hdd_update_reg_chan_info(struct hdd_adapter *adapter,
  */
 static int32_t
 hdd_cfg80211_update_channel_info(struct sk_buff *skb,
-			   tsap_config_t *sap_config, int idx)
+			   struct sap_config *sap_config, int idx)
 {
 	struct nlattr *nla_attr, *channel;
 	struct hdd_channel_info *icv;
@@ -2137,7 +2137,7 @@ fail:
 }
 
 static void hdd_get_scan_band(struct hdd_context *hdd_ctx,
-			      tsap_config_t *sap_config,
+			      struct sap_config *sap_config,
 			      enum band_info *band)
 {
 	/* Get scan band */
@@ -2186,7 +2186,7 @@ static int wlan_hdd_sap_get_valid_channellist(struct hdd_adapter *adapter,
 					      uint8_t *channel_list,
 					      enum band_info band)
 {
-	tsap_config_t *sap_config;
+	struct sap_config *sap_config;
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	uint8_t tmp_chan_list[QDF_MAX_NUM_CHAN] = {0};
 	uint32_t chan_count;
@@ -2237,7 +2237,7 @@ int hdd_cfg80211_update_acs_config(struct hdd_adapter *adapter,
 				   uint8_t reason)
 {
 	struct sk_buff *skb;
-	tsap_config_t *sap_config;
+	struct sap_config *sap_config;
 	uint32_t channel_count = 0, status = -EINVAL;
 	uint8_t channel_list[QDF_MAX_NUM_CHAN] = {0};
 	uint32_t freq_list[QDF_MAX_NUM_CHAN] = {0};
@@ -2521,7 +2521,7 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
 	struct net_device *ndev = wdev->netdev;
 	struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(ndev);
 	struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
-	tsap_config_t *sap_config;
+	struct sap_config *sap_config;
 	struct sk_buff *temp_skbuff;
 	int ret, i, ch_cnt = 0;
 	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_ACS_MAX + 1];
@@ -2997,7 +2997,8 @@ static void wlan_hdd_cfg80211_start_pending_acs(struct work_struct *work)
 void wlan_hdd_cfg80211_acs_ch_select_evt(struct hdd_adapter *adapter)
 {
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	tsap_config_t *sap_cfg = &(WLAN_HDD_GET_AP_CTX_PTR(adapter))->sap_config;
+	struct sap_config *sap_cfg =
+				&(WLAN_HDD_GET_AP_CTX_PTR(adapter))->sap_config;
 	struct sk_buff *vendor_event;
 	int ret_val;
 	struct hdd_adapter *con_sap_adapter;
@@ -9848,7 +9849,7 @@ static QDF_STATUS wlan_hdd_validate_acs_channel(struct hdd_adapter *adapter,
 }
 
 static void hdd_update_acs_sap_config(struct hdd_context *hdd_ctx,
-				     tsap_config_t *sap_config,
+				     struct sap_config *sap_config,
 				     struct hdd_vendor_chan_info *channel_list)
 {
 	uint8_t ch_width;
@@ -9890,7 +9891,7 @@ static int hdd_update_acs_channel(struct hdd_adapter *adapter, uint8_t reason,
 				  uint8_t channel_cnt,
 				  struct hdd_vendor_chan_info *channel_list)
 {
-	tsap_config_t *sap_config;
+	struct sap_config *sap_config;
 	struct hdd_ap_ctx *hdd_ap_ctx;
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
@@ -20443,7 +20444,7 @@ static int __wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy,
 	int i;
 	struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
 	struct hdd_hostapd_state *hostapd_state;
-	tsap_config_t *config;
+	struct sap_config *config;
 	struct hdd_context *hdd_ctx;
 	int status;
 	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;

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

@@ -49,7 +49,7 @@ void hdd_update_tgt_he_cap(struct hdd_context *hdd_ctx,
 }
 
 void wlan_hdd_check_11ax_support(struct hdd_beacon_data *beacon,
-				 tsap_config_t *config)
+				 struct sap_config *config)
 {
 	const uint8_t *ie;
 

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

@@ -1742,7 +1742,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 	tSap_StationDisassocCompleteEvent *disassoc_comp;
 	struct hdd_station_info *stainfo, *cache_stainfo;
 	mac_handle_t mac_handle;
-	tsap_config_t *sap_config;
+	struct sap_config *sap_config;
 
 	dev = context;
 	if (!dev) {
@@ -2044,7 +2044,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 	case eSAP_DFS_RADAR_DETECT:
 	{
 		int i;
-		tsap_config_t *sap_config =
+		struct sap_config *sap_config =
 				&adapter->session.ap.sap_config;
 
 		hdd_dfs_indicate_radar(hdd_ctx);
@@ -3545,7 +3545,7 @@ int wlan_hdd_set_channel(struct wiphy *wiphy,
 	int status;
 	mac_handle_t mac_handle;
 	struct sme_config_params *sme_config;
-	tsap_config_t *sap_config;
+	struct sap_config *sap_config;
 
 	hdd_enter();
 
@@ -4070,7 +4070,7 @@ int wlan_hdd_cfg80211_update_apies(struct hdd_adapter *adapter)
 	uint8_t *genie;
 	uint16_t total_ielen = 0;
 	int ret = 0;
-	tsap_config_t *config;
+	struct sap_config *config;
 	tSirUpdateIE update_ie;
 	struct hdd_beacon_data *beacon = NULL;
 	uint16_t proberesp_ies_len;
@@ -4218,7 +4218,7 @@ done:
  */
 static void wlan_hdd_set_sap_hwmode(struct hdd_adapter *adapter)
 {
-	tsap_config_t *config = &adapter->session.ap.sap_config;
+	struct sap_config *config = &adapter->session.ap.sap_config;
 	struct hdd_beacon_data *beacon = adapter->session.ap.beacon;
 	struct ieee80211_mgmt *mgmt_frame =
 		(struct ieee80211_mgmt *)beacon->head;
@@ -4282,7 +4282,7 @@ static void wlan_hdd_set_sap_hwmode(struct hdd_adapter *adapter)
 QDF_STATUS wlan_hdd_config_acs(struct hdd_context *hdd_ctx,
 			       struct hdd_adapter *adapter)
 {
-	tsap_config_t *sap_config;
+	struct sap_config *sap_config;
 	struct hdd_config *ini_config;
 	mac_handle_t mac_handle;
 	uint8_t is_overlap_enable = 0;
@@ -4302,7 +4302,7 @@ QDF_STATUS wlan_hdd_config_acs(struct hdd_context *hdd_ctx,
 	hdd_debug("HDD_ACS_SKIP_STATUS = %d", hdd_ctx->skip_acs_scan_status);
 	if (hdd_ctx->skip_acs_scan_status == eSAP_SKIP_ACS_SCAN) {
 		struct hdd_adapter *con_sap_adapter;
-		tsap_config_t *con_sap_config = NULL;
+		struct sap_config *con_sap_config = NULL;
 
 		con_sap_adapter = hdd_get_con_sap_adapter(adapter, false);
 
@@ -4418,7 +4418,7 @@ QDF_STATUS wlan_hdd_config_acs(struct hdd_context *hdd_ctx,
  */
 static int wlan_hdd_sap_p2p_11ac_overrides(struct hdd_adapter *ap_adapter)
 {
-	tsap_config_t *sap_cfg = &ap_adapter->session.ap.sap_config;
+	struct sap_config *sap_cfg = &ap_adapter->session.ap.sap_config;
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter);
 	uint8_t ch_width;
 	uint8_t sub_20_chan_width;
@@ -4892,7 +4892,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 				       enum nl80211_hidden_ssid hidden_ssid,
 				       bool check_for_concurrency)
 {
-	tsap_config_t *config;
+	struct sap_config *config;
 	struct hdd_beacon_data *beacon = NULL;
 	struct ieee80211_mgmt *mgmt_frame;
 	struct ieee80211_mgmt mgmt;
@@ -6136,7 +6136,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 	if (cds_is_sub_20_mhz_enabled()) {
 		enum channel_state ch_state;
 		enum phy_ch_width sub_20_ch_width = CH_WIDTH_INVALID;
-		tsap_config_t *sap_cfg = &adapter->session.ap.sap_config;
+		struct sap_config *sap_cfg = &adapter->session.ap.sap_config;
 
 		if (CHANNEL_STATE_DFS == wlan_reg_get_channel_state(
 					hdd_ctx->pdev, channel)) {
@@ -6237,7 +6237,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 	    ) {
 		struct hdd_beacon_data *old, *new;
 		enum nl80211_channel_type channel_type;
-		tsap_config_t *sap_config =
+		struct sap_config *sap_config =
 			&((WLAN_HDD_GET_AP_CTX_PTR(adapter))->sap_config);
 
 		old = adapter->session.ap.beacon;

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

@@ -674,7 +674,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCASAP_SET_11N_RATE:
 	{
 		uint8_t preamble = 0, nss = 0, rix = 0;
-		tsap_config_t *config =
+		struct sap_config *config =
 			&adapter->session.ap.sap_config;
 
 		hdd_debug("SET_HT_RATE val %d", set_value);
@@ -737,7 +737,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCASAP_SET_VHT_RATE:
 	{
 		uint8_t preamble = 0, nss = 0, rix = 0;
-		tsap_config_t *config =
+		struct sap_config *config =
 			&adapter->session.ap.sap_config;
 
 		if (config->SapHw_mode != eCSR_DOT11_MODE_11ac &&

+ 3 - 3
core/hdd/src/wlan_hdd_main.c

@@ -5362,7 +5362,7 @@ QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx,
 	union iwreq_data wrqu;
 	tSirUpdateIE update_ie;
 	unsigned long rc;
-	tsap_config_t *sap_config;
+	struct sap_config *sap_config;
 	mac_handle_t mac_handle;
 	struct wlan_objmgr_vdev *vdev;
 
@@ -12710,7 +12710,7 @@ void wlan_hdd_start_sap(struct hdd_adapter *ap_adapter, bool reinit)
 	struct hdd_hostapd_state *hostapd_state;
 	QDF_STATUS qdf_status;
 	struct hdd_context *hdd_ctx;
-	tsap_config_t *sap_config;
+	struct sap_config *sap_config;
 
 	if (!ap_adapter) {
 		hdd_err("ap_adapter is NULL here");
@@ -14696,7 +14696,7 @@ void hdd_restart_sap(struct hdd_adapter *ap_adapter)
 	struct hdd_hostapd_state *hostapd_state;
 	QDF_STATUS qdf_status;
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter);
-	tsap_config_t *sap_config;
+	struct sap_config *sap_config;
 	void *sap_ctx;
 
 	hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(ap_adapter);

+ 13 - 13
core/sap/inc/sap_api.h

@@ -465,7 +465,7 @@ enum  sap_acs_dfs_mode {
 	ACS_DFS_MODE_DEPRIORITIZE
 };
 
-typedef struct sap_config {
+struct sap_config {
 	tSap_SSIDInfo_t SSIDinfo;
 	eCsrPhyMode SapHw_mode;         /* Wireless Mode */
 	eSapMacAddrACL SapMacaddr_acl;
@@ -537,7 +537,7 @@ typedef struct sap_config {
 	uint8_t sap_chanswitch_mode;
 	bool chan_switch_hostapd_rate_enabled;
 	uint16_t reduced_beacon_interval;
-} tsap_config_t;
+};
 
 #ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
 typedef enum {
@@ -798,7 +798,7 @@ bool wlansap_is_channel_leaking_in_nol(struct sap_context *sap_ctx,
  */
 QDF_STATUS wlansap_start_bss(struct sap_context *sap_ctx,
 			     sap_event_cb sap_event_cb,
-			     tsap_config_t *config, void *user_context);
+			     struct sap_config *config, void *user_context);
 
 /**
  * wlansap_stop_bss() - stop BSS.
@@ -899,7 +899,7 @@ uint16_t wlansap_check_cc_intf(struct sap_context *sap_ctx);
  *         QDF_STATUS_SUCCESS: Success
  */
 QDF_STATUS wlansap_set_mac_acl(struct sap_context *sap_ctx,
-			       tsap_config_t *config);
+			       struct sap_config *config);
 
 /**
  * wlansap_disassoc_sta() - initiate disassociation of station.
@@ -1209,19 +1209,19 @@ void wlan_sap_set_vht_ch_width(struct sap_context *sap_ctx,
  * Return: None
  */
 void wlan_sap_set_sap_ctx_acs_cfg(struct sap_context *sap_ctx,
-				  tsap_config_t *sap_config);
+				  struct sap_config *sap_config);
 
 void sap_config_acs_result(mac_handle_t mac_handle,
 			   struct sap_context *sap_ctx,
 			   uint32_t sec_ch);
 
-QDF_STATUS wlansap_update_sap_config_add_ie(tsap_config_t *config,
-		const uint8_t *
-		pAdditionIEBuffer,
-		uint16_t additionIELength,
-		eUpdateIEsType updateType);
-QDF_STATUS wlansap_reset_sap_config_add_ie(tsap_config_t *config,
-			eUpdateIEsType updateType);
+QDF_STATUS wlansap_update_sap_config_add_ie(struct sap_config *config,
+					    const uint8_t *pAdditionIEBuffer,
+					    uint16_t additionIELength,
+					    eUpdateIEsType updateType);
+
+QDF_STATUS wlansap_reset_sap_config_add_ie(struct sap_config *config,
+					   eUpdateIEsType updateType);
 
 void wlansap_extend_to_acs_range(mac_handle_t mac_handle,
 				 uint8_t *startChannelNum,
@@ -1290,7 +1290,7 @@ void wlansap_populate_del_sta_params(const uint8_t *mac,
  */
 QDF_STATUS wlansap_acs_chselect(struct sap_context *sap_context,
 				sap_event_cb acs_event_callback,
-				tsap_config_t *pconfig,
+				struct sap_config *pconfig,
 				void *pusr_context);
 
 /**

+ 1 - 1
core/sap/src/sap_fsm.c

@@ -2936,7 +2936,7 @@ QDF_STATUS sap_fsm(struct sap_context *sap_ctx, ptWLAN_SAPEvent sap_event)
 }
 
 eSapStatus
-sapconvert_to_csr_profile(tsap_config_t *config, eCsrRoamBssType bssType,
+sapconvert_to_csr_profile(struct sap_config *config, eCsrRoamBssType bssType,
 			  struct csr_roam_profile *profile)
 {
 	/* Create Roam profile for SoftAP to connect */

+ 3 - 3
core/sap/src/sap_internal.h

@@ -296,9 +296,9 @@ sap_signal_hdd_event(struct sap_context *sap_ctx,
 QDF_STATUS sap_fsm(struct sap_context *sap_ctx, ptWLAN_SAPEvent sap_event);
 
 eSapStatus
-sapconvert_to_csr_profile(tsap_config_t *config,
-		       eCsrRoamBssType bssType,
-		       struct csr_roam_profile *profile);
+sapconvert_to_csr_profile(struct sap_config *config,
+			  eCsrRoamBssType bssType,
+			  struct csr_roam_profile *profile);
 
 void sap_free_roam_profile(struct csr_roam_profile *profile);
 

+ 8 - 7
core/sap/src/sap_module.c

@@ -512,7 +512,7 @@ uint16_t wlansap_check_cc_intf(struct sap_context *sap_ctx)
   *                                         performing the operation
   */
 static QDF_STATUS
-wlansap_set_scan_acs_channel_params(tsap_config_t *pconfig,
+wlansap_set_scan_acs_channel_params(struct sap_config *pconfig,
 				    struct sap_context *psap_ctx,
 				    void *pusr_context)
 {
@@ -649,7 +649,7 @@ static bool wlan_sap_validate_channel_switch(mac_handle_t mac_handle,
 #endif
 
 void wlan_sap_set_sap_ctx_acs_cfg(struct sap_context *sap_ctx,
-				  tsap_config_t *sap_config)
+				  struct sap_config *sap_config)
 {
 	if (!sap_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
@@ -663,7 +663,7 @@ void wlan_sap_set_sap_ctx_acs_cfg(struct sap_context *sap_ctx,
 
 QDF_STATUS wlansap_start_bss(struct sap_context *sap_ctx,
 			     sap_event_cb sap_event_cb,
-			     tsap_config_t *config, void *user_context)
+			     struct sap_config *config, void *user_context)
 {
 	tWLAN_SAPEvent sap_event;        /* State machine event */
 	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
@@ -770,7 +770,7 @@ fail:
 } /* wlansap_start_bss */
 
 QDF_STATUS wlansap_set_mac_acl(struct sap_context *sap_ctx,
-			       tsap_config_t *config)
+			       struct sap_config *config)
 {
 	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
 
@@ -2021,7 +2021,7 @@ QDF_STATUS wlansap_set_dfs_target_chnl(mac_handle_t mac_handle,
 }
 
 QDF_STATUS
-wlansap_update_sap_config_add_ie(tsap_config_t *config,
+wlansap_update_sap_config_add_ie(struct sap_config *config,
 				 const uint8_t *pAdditionIEBuffer,
 				 uint16_t additionIELength,
 				 eUpdateIEsType updateType)
@@ -2104,7 +2104,8 @@ wlansap_update_sap_config_add_ie(tsap_config_t *config,
 }
 
 QDF_STATUS
-wlansap_reset_sap_config_add_ie(tsap_config_t *config, eUpdateIEsType updateType)
+wlansap_reset_sap_config_add_ie(struct sap_config *config,
+				eUpdateIEsType updateType)
 {
 	if (!config) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@@ -2324,7 +2325,7 @@ void wlansap_populate_del_sta_params(const uint8_t *mac,
 
 QDF_STATUS wlansap_acs_chselect(struct sap_context *sap_context,
 				sap_event_cb acs_event_callback,
-				tsap_config_t *pconfig,
+				struct sap_config *pconfig,
 				void *pusr_context)
 {
 	QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;