[PATCH 1/4] hal: remove unused v1 structs

Kalle Valo kvalo at qca.qualcomm.com
Tue May 21 12:24:16 EDT 2013


It's unclear with what firmware version we should use these. Just to keep
things simple remove them. Also remove related unneeded unions from few
structs.

No functional changes.

Signed-off-by: Kalle Valo <kvalo at qca.qualcomm.com>
---
 hal.h |  336 -----------------------------------------------------------------
 smd.c |  136 +++++++++++++-------------
 2 files changed, 70 insertions(+), 402 deletions(-)

diff --git a/hal.h b/hal.h
index 27a79b4..47f1880 100644
--- a/hal.h
+++ b/hal.h
@@ -1161,197 +1161,9 @@ struct wcn36xx_hal_config_sta_params {
 	//u8 reserved;
 } __packed;
 
-struct wcn36xx_hal_supported_rates_v1 {
-	/*
-	 * For Self STA Entry: this represents Self Mode.
-	 * For Peer Stations, this represents the mode of the peer.
-	 *
-	 * On Station:
-	 *
-	 * --this mode is updated when PE adds the Self Entry.
-	 *
-	 * -- OR when PE sends 'ADD_BSS' message and station context in BSS
-	 *    is used to indicate the mode of the AP.
-	 *
-	 * ON AP:
-	 *
-	 * -- this mode is updated when PE sends 'ADD_BSS' and Sta entry
-	 *    for that BSS is used to indicate the self mode of the AP.
-	 *
-	 * -- OR when a station is associated, PE sends 'ADD_STA' message
-         *     with this mode updated.
-	 */
-
-	enum sta_rate_mode mode;
-
-	/* 11b, 11a and aniLegacyRates are IE rates which gives rate in
-	 * unit of 500Kbps */
-	u16 llb_rates[WCN36XX_HAL_NUM_11B_RATES];
-	u16 lla_rates[WCN36XX_HAL_NUM_11A_RATES];
-	u16 legacy_rates[WCN36XX_HAL_NUM_POLARIS_RATES];
-	u16 reserved;
-
-	/* Taurus only supports 26 Titan Rates(no ESF/concat Rates will be
-	 * supported) First 26 bits are reserved for those Titan rates and
-	 * the last 4 bits(bit28-31) for Taurus, 2(bit26-27) bits are
-	 * reserved. */
-
-	/* Titan and Taurus Rates */
-	u32 enhanced_rate_bitmap;
-
-	/*
-	 * 0-76 bits used, remaining reserved
-	 * bits 0-15 and 32 should be set.
-	 */
-	u8 supported_mcs_set[WCN36XX_HAL_MAC_MAX_SUPPORTED_MCS_SET];
-
-	/*
-	 * RX Highest Supported Data Rate defines the highest data
-	 * rate that the STA is able to receive, in unites of 1Mbps.
-	 * This value is derived from "Supported MCS Set field" inside
-	 * the HT capability element.
-	 */
-	u16 rx_highest_data_rate;
-
-	/* Indicates the Maximum MCS that can be received for each number
-	 * of spacial streams */
-	u16 vht_rx_mcs_map;
-
-	/* Indicate the highest VHT data rate that the STA is able to receive */
-	u16 vht_rx_highest_data_rate;
-
-	/* Indicates the Maximum MCS that can be transmitted  for each number
-	 * of spacial streams */
-	u16 vht_tx_mcs_map;
-
-	/* Indicate the highest VHT data rate that the STA is able to
-	 * transmit */
-	u16 vht_tx_highest_data_rate;
-
-} __packed;
-
-struct wcn36xx_hal_config_sta_params_v1 {
-	/* BSSID of STA */
-	u8 bssid[ETH_ALEN];
-
-	/* ASSOC ID, as assigned by UMAC */
-	u16 aid;
-
-	/* STA entry Type: 0 - Self, 1 - Other/Peer, 2 - BSSID, 3 - BCAST */
-	u8 type;
-
-	/* Short Preamble Supported. */
-	u8 short_preamble_supported;
-
-	/* MAC Address of STA */
-	u8 mac[ETH_ALEN];
-
-	/* Listen interval of the STA */
-	u16 listen_interval;
-
-	/* Support for 11e/WMM */
-	u8 wmm;
-
-	/* 11n HT capable STA */
-	u8 ht;
-
-	/* TX Width Set: 0 - 20 MHz only, 1 - 20/40 MHz */
-	u8 tx_channel_width_set;
-
-	/* RIFS mode 0 - NA, 1 - Allowed */
-	u8 rifs_mode;
-
-	/* L-SIG TXOP Protection mechanism
-	   0 - No Support, 1 - Supported
-	   SG - there is global field */
-	u8 lsig_txop_protection;
-
-	/* Max Ampdu Size supported by STA. TPE programming.
-	   0 : 8k , 1 : 16k, 2 : 32k, 3 : 64k */
-	u8 max_ampdu_size;
-
-	/* Max Ampdu density. Used by RA.  3 : 0~7 : 2^(11nAMPDUdensity -4) */
-	u8 max_ampdu_density;
-
-	/* Max AMSDU size 1 : 3839 bytes, 0 : 7935 bytes */
-	u8 max_amsdu_size;
-
-	/* Short GI support for 40Mhz packets */
-	u8 sgi_40mhz;
-
-	/* Short GI support for 20Mhz packets */
-	u8 sgi_20Mhz;
-
-	/* Robust Management Frame (RMF) enabled/disabled */
-	u8 rmf;
-
-	/* The unicast encryption type in the association */
-	u32 encrypt_type;
-
-	/* HAL should update the existing STA entry, if this flag is set.
-	 * UMAC will set this flag in case of RE-ASSOC, where we want to
-	 * reuse the old STA ID. 0 = Add, 1 = Update */
-	u8 action;
-
-	/* U-APSD Flags: 1b per AC.  Encoded as follows:
-	   b7 b6 b5 b4 b3 b2 b1 b0 =
-	   X  X  X  X  BE BK VI VO */
-	u8 uapsd;
-
-	/* Max SP Length */
-	u8 max_sp_len;
-
-	/* 11n Green Field preamble support
-	   0 - Not supported, 1 - Supported */
-	u8 green_field_capable;
-
-	/* MIMO Power Save mode */
-	enum wcn36xx_hal_ht_mimo_state mimo_ps;
-
-	/* Delayed BA Support */
-	u8 delayed_ba_support;
-
-	/* Max AMPDU duration in 32us */
-	u8 max_ampdu_duration;
-
-	/* HT STA should set it to 1 if it is enabled in BSS. HT STA should
-	 * set it to 0 if AP does not support it. This indication is sent
-	 * to HAL and HAL uses this flag to pickup up appropriate 40Mhz
-	 * rates. */
-	u8 dsss_cck_mode_40mhz;
-
-	/* Valid STA Idx when action=Update. Set to 0xFF when invalid!
-	 * Retained for backward compalibity with existing HAL code */
-	u8 sta_index;
-
-	/* BSSID of BSS to which station is associated. Set to 0xFF when
-	 * invalid. Retained for backward compalibity with existing HAL
-	 * code */
-	u8 bssid_index;
-
-	u8 p2p;
-
-	/* Reserved to align next field on a dword boundary */
-	u8 ht_Ldpc_Enabled:1;
-	u8 vht_ldpc_enabled:1;
-	u8 vht_tx_bf_enabled:1;
-	u8 reserved:5;
-
-	/* These rates are the intersection of peer and self capabilities. */
-	struct wcn36xx_hal_supported_rates_v1 supported_rates;
-
-	u8 vht;
-	u8 vht_tx_channel_width_set;
-
-} __packed;
-
 struct wcn36xx_hal_config_sta_req_msg {
 	struct wcn36xx_hal_msg_header header;
-	union {
-		struct wcn36xx_hal_config_sta_params sta_params;
-		//TODO Not used so far
-		//struct wcn36xx_hal_config_sta_params_v1 sta_params_v1;
-	} u;
+	struct wcn36xx_hal_config_sta_params sta_params;
 } __packed;
 
 struct config_sta_rsp_params {
@@ -1627,153 +1439,9 @@ struct wcn36xx_hal_config_bss_params {
 	s8 max_tx_power;
 } __packed;
 
-struct wcn36xx_hal_config_bss_params_v1 {
-	/* BSSID */
-	u8 bssid[ETH_ALEN];
-
-	/* Self Mac Address */
-	u8 self_mac_addr[ETH_ALEN];
-
-	/* BSS type */
-	enum wcn36xx_hal_bss_type bss_type;
-
-	/* Operational Mode: AP =0, STA = 1 */
-	u8 oper_mode;
-
-	/* Network Type */
-	enum wcn36xx_hal_nw_type nw_type;
-
-	/* Used to classify PURE_11G/11G_MIXED to program MTU */
-	u8 short_slot_time_supported;
-
-	/* Co-exist with 11a STA */
-	u8 lla_coexist;
-
-	/* Co-exist with 11b STA */
-	u8 llb_coexist;
-
-	/* Co-exist with 11g STA */
-	u8 llg_coexist;
-
-	/* Coexistence with 11n STA */
-	u8 ht20_coexist;
-
-	/* Non GF coexist flag */
-	u8 lln_non_gf_coexist;
-
-	/* TXOP protection support */
-	u8 lsig_tx_op_protection_full_support;
-
-	/* RIFS mode */
-	u8 rifs_mode;
-
-	/* Beacon Interval in TU */
-	u16 beacon_interval;
-
-	/* DTIM period */
-	u8 dtim_period;
-
-	/* TX Width Set: 0 - 20 MHz only, 1 - 20/40 MHz */
-	u8 tx_channel_width_set;
-
-	/* Operating channel */
-	u8 current_oper_channel;
-
-	/* Extension channel for channel bonding */
-	u8 current_ext_channel;
-
-	/* Reserved to align next field on a dword boundary */
-	u8 reserved;
-
-	/* SSID of the BSS */
-	struct wcn36xx_hal_mac_ssid ssid;
-
-	/* HAL should update the existing BSS entry, if this flag is set.
-	 * UMAC will set this flag in case of reassoc, where we want to
-	 * resue the the old BSSID and still return success 0 = Add, 1 =
-	 * Update */
-	u8 action;
-
-	/* MAC Rate Set */
-	struct wcn36xx_hal_rate_set rateset;
-
-	/* Enable/Disable HT capabilities of the BSS */
-	u8 ht;
-
-	/* Enable/Disable OBSS protection */
-	u8 obss_prot;
-
-	/* RMF enabled/disabled */
-	u8 rmf;
-
-	/* HT Operating Mode operating mode of the 802.11n STA */
-	enum wcn36xx_hal_ht_operating_mode ht_oper_mode;
-
-	/* Dual CTS Protection: 0 - Unused, 1 - Used */
-	u8 dual_cts_protection;
-
-	/* Probe Response Max retries */
-	u8 max_probe_resp_retry_limit;
-
-	/* To Enable Hidden ssid */
-	u8 hidden_ssid;
-
-	/* To Enable Disable FW Proxy Probe Resp */
-	u8 proxy_probe_resp;
-
-	/* Boolean to indicate if EDCA params are valid. UMAC might not
-	 * have valid EDCA params or might not desire to apply EDCA params
-	 * during config BSS. 0 implies Not Valid ; Non-Zero implies
-	 * valid */
-	u8 edca_params_valid;
-
-	/* EDCA Parameters for Best Effort Access Category */
-	struct wcn36xx_hal_edca_param_record acbe;
-
-	/* EDCA Parameters forBackground Access Category */
-	struct wcn36xx_hal_edca_param_record acbk;
-
-	/* EDCA Parameters for Video Access Category */
-	struct wcn36xx_hal_edca_param_record acvi;
-
-	/* EDCA Parameters for Voice Access Category */
-	struct wcn36xx_hal_edca_param_record acvo;
-
-	/* Ext Bss Config Msg if set */
-	u8 ext_set_sta_key_param_valid;
-
-	/* SetStaKeyParams for ext bss msg */
-	struct wcn36xx_hal_set_sta_key_params ext_set_sta_key_param;
-
-	/* Persona for the BSS can be STA,AP,GO,CLIENT value same as enum wcn36xx_hal_con_mode */
-	u8 wcn36xx_hal_persona;
-
-	u8 spectrum_mgt;
-
-	/* HAL fills in the tx power used for mgmt frames in txMgmtPower */
-	s8 tx_mgmt_power;
-
-	/* maxTxPower has max power to be used after applying the power
-	 * constraint if any */
-	s8 max_tx_power;
-
-	/*Context of the station being added in HW
-	   Add a STA entry for "itself" -
-	   On AP  - Add the AP itself in an "STA context"
-	   On STA - Add the AP to which this STA is joining in an "STA context" */
-	struct wcn36xx_hal_config_sta_params_v1 sta;
-
-	u8 vht;
-	u8 vht_tx_channel_width_set;
-} __packed;
-
 struct wcn36xx_hal_config_bss_req_msg {
 	struct wcn36xx_hal_msg_header header;
-	union {
-		struct wcn36xx_hal_config_bss_params bss_params;
-		//TODO Not used so far
-		//struct wcn36xx_hal_config_bss_params_v1 bss_params_v1;
-	} u;
+	struct wcn36xx_hal_config_bss_params bss_params;
 } __packed;
 
 struct wcn36xx_hal_config_bss_rsp_params {
diff --git a/smd.c b/smd.c
index bfdf636..6986fe3 100644
--- a/smd.c
+++ b/smd.c
@@ -350,27 +350,27 @@ int wcn36xx_smd_config_sta(struct wcn36xx *wcn, u8 *bssid, u16 ass_id, u8 *sta_m
 
 	INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_STA_REQ);
 
-	memcpy(&msg_body.u.sta_params.bssid, bssid, ETH_ALEN);
-	memcpy(&msg_body.u.sta_params.mac, sta_mac, ETH_ALEN);
-	msg_body.u.sta_params.aid = 1;
-	msg_body.u.sta_params.type = 0;
-	msg_body.u.sta_params.listen_interval = 0x8;
-	msg_body.u.sta_params.ht_capable = 1;
-
-	msg_body.u.sta_params.max_ampdu_size = 3;
-	msg_body.u.sta_params.max_ampdu_density = 5;
-	msg_body.u.sta_params.sgi_40mhz = 1;
-	msg_body.u.sta_params.sgi_20Mhz = 1;
-
-	memcpy(&msg_body.u.sta_params.supported_rates, &wcn->supported_rates,
+	memcpy(&msg_body.sta_params.bssid, bssid, ETH_ALEN);
+	memcpy(&msg_body.sta_params.mac, sta_mac, ETH_ALEN);
+	msg_body.sta_params.aid = 1;
+	msg_body.sta_params.type = 0;
+	msg_body.sta_params.listen_interval = 0x8;
+	msg_body.sta_params.ht_capable = 1;
+
+	msg_body.sta_params.max_ampdu_size = 3;
+	msg_body.sta_params.max_ampdu_density = 5;
+	msg_body.sta_params.sgi_40mhz = 1;
+	msg_body.sta_params.sgi_20Mhz = 1;
+
+	memcpy(&msg_body.sta_params.supported_rates, &wcn->supported_rates,
 		sizeof(wcn->supported_rates));
-	msg_body.u.sta_params.sta_index = 1;
+	msg_body.sta_params.sta_index = 1;
 
 	PREPARE_HAL_BUF(wcn->smd_buf, msg_body);
 
 	wcn36xx_dbg(WCN36XX_DBG_HAL,
 		    "hal config sta bssid %pM mac %pM",
-		    msg_body.u.sta_params.bssid, msg_body.u.sta_params.mac);
+		    msg_body.sta_params.bssid, msg_body.sta_params.mac);
 
 	return wcn36xx_smd_send_and_wait(wcn, msg_body.header.len);
 }
@@ -397,73 +397,73 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, bool sta_mode, u8 *bssid, u8 upd
 	INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_BSS_REQ);
 
 	if(sta_mode) {
-		memcpy(&msg_body.u.bss_params.bssid, bssid, ETH_ALEN);
-		memcpy(&msg_body.u.bss_params.self_mac_addr, &wcn->addresses[0], ETH_ALEN);
-		msg_body.u.bss_params.bss_type = WCN36XX_HAL_INFRASTRUCTURE_MODE;
+		memcpy(&msg_body.bss_params.bssid, bssid, ETH_ALEN);
+		memcpy(&msg_body.bss_params.self_mac_addr, &wcn->addresses[0], ETH_ALEN);
+		msg_body.bss_params.bss_type = WCN36XX_HAL_INFRASTRUCTURE_MODE;
 		//TODO define enum for oper_mode
-		msg_body.u.bss_params.oper_mode = 1;  //0 - AP,  1-STA
-		msg_body.u.bss_params.llg_coexist = 1;
-		msg_body.u.bss_params.beacon_interval = 0x64;
-
-		msg_body.u.bss_params.oper_channel = wcn->ch;
-		memcpy(&msg_body.u.bss_params.sta.bssid, bssid, ETH_ALEN);
-		msg_body.u.bss_params.sta.type = 1;
-		msg_body.u.bss_params.sta.listen_interval = 0x64;
-		msg_body.u.bss_params.sta.wmm_enabled = 1;
-
-		msg_body.u.bss_params.sta.max_ampdu_size = 3;
-		msg_body.u.bss_params.sta.max_ampdu_density = 5;
-		msg_body.u.bss_params.sta.dsss_cck_mode_40mhz = 1;
+		msg_body.bss_params.oper_mode = 1;  //0 - AP,  1-STA
+		msg_body.bss_params.llg_coexist = 1;
+		msg_body.bss_params.beacon_interval = 0x64;
+
+		msg_body.bss_params.oper_channel = wcn->ch;
+		memcpy(&msg_body.bss_params.sta.bssid, bssid, ETH_ALEN);
+		msg_body.bss_params.sta.type = 1;
+		msg_body.bss_params.sta.listen_interval = 0x64;
+		msg_body.bss_params.sta.wmm_enabled = 1;
+
+		msg_body.bss_params.sta.max_ampdu_size = 3;
+		msg_body.bss_params.sta.max_ampdu_density = 5;
+		msg_body.bss_params.sta.dsss_cck_mode_40mhz = 1;
 	} else {
-		memcpy(&msg_body.u.bss_params.bssid, &wcn->addresses[0], ETH_ALEN);
-		memcpy(&msg_body.u.bss_params.self_mac_addr, &wcn->addresses[0], ETH_ALEN);
+		memcpy(&msg_body.bss_params.bssid, &wcn->addresses[0], ETH_ALEN);
+		memcpy(&msg_body.bss_params.self_mac_addr, &wcn->addresses[0], ETH_ALEN);
 
 		//TODO do all this configurabel
-		msg_body.u.bss_params.bss_type = WCN36XX_HAL_INFRA_AP_MODE;
-		msg_body.u.bss_params.oper_mode = 0; //0 - AP,  1-STA
-
-		msg_body.u.bss_params.short_slot_time_supported = 1;
-		msg_body.u.bss_params.beacon_interval = 0x64;
-		msg_body.u.bss_params.dtim_period = 2;
-		msg_body.u.bss_params.oper_channel = 1;
-		msg_body.u.bss_params.ssid.length = 1;
-		msg_body.u.bss_params.ssid.ssid[0] = 'K';
-		msg_body.u.bss_params.obss_prot_enabled = 1;
-		msg_body.u.bss_params.wcn36xx_hal_persona = 1;
-		msg_body.u.bss_params.max_tx_power = 0x10;
-
-		memcpy(&msg_body.u.bss_params.sta.bssid, &wcn->addresses[0], ETH_ALEN);
-		msg_body.u.bss_params.sta.short_preamble_supported = 1;
-		memcpy(&msg_body.u.bss_params.sta.mac, &wcn->addresses[0], ETH_ALEN);
-		msg_body.u.bss_params.sta.listen_interval = 8;
+		msg_body.bss_params.bss_type = WCN36XX_HAL_INFRA_AP_MODE;
+		msg_body.bss_params.oper_mode = 0; //0 - AP,  1-STA
+
+		msg_body.bss_params.short_slot_time_supported = 1;
+		msg_body.bss_params.beacon_interval = 0x64;
+		msg_body.bss_params.dtim_period = 2;
+		msg_body.bss_params.oper_channel = 1;
+		msg_body.bss_params.ssid.length = 1;
+		msg_body.bss_params.ssid.ssid[0] = 'K';
+		msg_body.bss_params.obss_prot_enabled = 1;
+		msg_body.bss_params.wcn36xx_hal_persona = 1;
+		msg_body.bss_params.max_tx_power = 0x10;
+
+		memcpy(&msg_body.bss_params.sta.bssid, &wcn->addresses[0], ETH_ALEN);
+		msg_body.bss_params.sta.short_preamble_supported = 1;
+		memcpy(&msg_body.bss_params.sta.mac, &wcn->addresses[0], ETH_ALEN);
+		msg_body.bss_params.sta.listen_interval = 8;
 	}
-	msg_body.u.bss_params.nw_type = WCN36XX_HAL_11G_NW_TYPE;
-	msg_body.u.bss_params.sta.ht_capable = 1;
-	msg_body.u.bss_params.sta.sgi_40mhz = 1;
-	msg_body.u.bss_params.sta.sgi_20Mhz = 1;
+	msg_body.bss_params.nw_type = WCN36XX_HAL_11G_NW_TYPE;
+	msg_body.bss_params.sta.ht_capable = 1;
+	msg_body.bss_params.sta.sgi_40mhz = 1;
+	msg_body.bss_params.sta.sgi_20Mhz = 1;
 	if (update == 1) {
-		msg_body.u.bss_params.short_slot_time_supported = 1;
-		msg_body.u.bss_params.lln_non_gf_coexist = 1;
-		msg_body.u.bss_params.dtim_period = 0;
-		msg_body.u.bss_params.sta.aid = 1;
-		msg_body.u.bss_params.sta.bssid_index = 0;
-		msg_body.u.bss_params.action = 1;
-		msg_body.u.bss_params.tx_mgmt_power = 6;
-		msg_body.u.bss_params.max_tx_power = 0x10;
+		msg_body.bss_params.short_slot_time_supported = 1;
+		msg_body.bss_params.lln_non_gf_coexist = 1;
+		msg_body.bss_params.dtim_period = 0;
+		msg_body.bss_params.sta.aid = 1;
+		msg_body.bss_params.sta.bssid_index = 0;
+		msg_body.bss_params.action = 1;
+		msg_body.bss_params.tx_mgmt_power = 6;
+		msg_body.bss_params.max_tx_power = 0x10;
 	} else {
-		msg_body.u.bss_params.max_tx_power = 0x14;
-		msg_body.u.bss_params.dtim_period = 1;
-		msg_body.u.bss_params.sta.bssid_index = 0xff;
+		msg_body.bss_params.max_tx_power = 0x14;
+		msg_body.bss_params.dtim_period = 1;
+		msg_body.bss_params.sta.bssid_index = 0xff;
 	}
-	msg_body.u.bss_params.sta.sta_index = 0xff;
+	msg_body.bss_params.sta.sta_index = 0xff;
 
-	memcpy(&msg_body.u.bss_params.sta.supported_rates, &wcn->supported_rates, sizeof(wcn->supported_rates));
+	memcpy(&msg_body.bss_params.sta.supported_rates, &wcn->supported_rates, sizeof(wcn->supported_rates));
 
 	PREPARE_HAL_BUF(wcn->smd_buf, msg_body);
 
 	wcn36xx_dbg(WCN36XX_DBG_HAL,
 		    "hal config bss bss_type %d",
-		    msg_body.u.bss_params.bss_type);
+		    msg_body.bss_params.bss_type);
 
 	return wcn36xx_smd_send_and_wait(wcn, msg_body.header.len);
 }




More information about the wcn36xx mailing list