[PATCH 3/7] Move CONFIG_BSS and CONFIG_STA commands to use hal.h
Eugene Krasnikov
k.eugene.e at gmail.com
Thu May 2 13:00:20 EDT 2013
Signed-off-by: Eugene Krasnikov <k.eugene.e at gmail.com>
---
hal.h | 121 ++++++++++++++++++++--------------------
main.c | 18 ++++++
smd.c | 186 +++++++++++++++++++++++++++-----------------------------------
smd.h | 150 --------------------------------------------------
wcn36xx.h | 4 ++
5 files changed, 162 insertions(+), 317 deletions(-)
diff --git a/hal.h b/hal.h
index d57faf0..d1658e9 100644
--- a/hal.h
+++ b/hal.h
@@ -629,10 +629,10 @@ struct wcn36xx_hal_keys {
u16 length;
u8 key[WCN36XX_HAL_MAC_MAX_KEY_LENGTH];
-};
+} __packed;
/* SetStaKeyParams Moving here since it is shared by configbss/setstakey msgs */
-struct set_sta_key_params {
+struct wcn36xx_hal_set_sta_key_params {
/* STA Index */
u16 index;
@@ -654,7 +654,7 @@ struct set_sta_key_params {
*/
u8 single_tid_rc;
-};
+} __packed;
/* 4-byte control message header used by HAL*/
struct wcn36xx_hal_msg_header {
@@ -997,7 +997,7 @@ struct wcn36xx_hal_finish_scan_rsp_msg {
/* success or failure */
u32 status;
-};
+} __packed;
struct wcn36xx_hal_supported_rates {
/*
@@ -1049,9 +1049,9 @@ struct wcn36xx_hal_supported_rates {
*/
u16 rx_highest_data_rate;
-};
+} __packed;
-struct config_sta_params {
+struct wcn36xx_hal_config_sta_params {
/* BSSID of STA */
u8 bssid[ETH_ALEN];
@@ -1103,6 +1103,10 @@ struct config_sta_params {
/* Short GI support for 20Mhz packets */
u8 sgi_20Mhz;
+ // TODO move this parameter to the end for 3680
+ /* These rates are the intersection of peer and self capabilities. */
+ struct wcn36xx_hal_supported_rates supported_rates;
+
/* Robust Management Frame (RMF) enabled/disabled */
u8 rmf;
@@ -1152,13 +1156,10 @@ struct config_sta_params {
u8 p2p;
+ // TODO add this parameter for 3680.
/* Reserved to align next field on a dword boundary */
- u8 reserved;
-
- /* These rates are the intersection of peer and self capabilities. */
- struct wcn36xx_hal_supported_rates supported_rates;
-
-};
+ //u8 reserved;
+} __packed;
struct wcn36xx_hal_supported_rates_v1 {
/*
@@ -1227,9 +1228,9 @@ struct wcn36xx_hal_supported_rates_v1 {
* transmit */
u16 vht_tx_highest_data_rate;
-};
+} __packed;
-struct config_sta_params_v1 {
+struct wcn36xx_hal_config_sta_params_v1 {
/* BSSID of STA */
u8 bssid[ETH_ALEN];
@@ -1342,15 +1343,16 @@ struct config_sta_params_v1 {
u8 vht;
u8 vht_tx_channel_width_set;
-};
+} __packed;
-struct config_sta_req_msg {
+struct wcn36xx_hal_config_sta_req_msg {
struct wcn36xx_hal_msg_header header;
union {
- struct config_sta_params sta_params;
- struct config_sta_params_v1 sta_params_v1;
+ struct wcn36xx_hal_config_sta_params sta_params;
+ //TODO Not used so far
+ //struct wcn36xx_hal_config_sta_params_v1 sta_params_v1;
} u;
-};
+} __packed;
struct config_sta_rsp_params {
/* success or failure */
@@ -1382,12 +1384,12 @@ struct config_sta_rsp_params {
u8 p2p;
-};
+} __packed;
-struct config_sta_rsp_msg {
+struct wcn36xx_hal_config_sta_rsp_msg {
struct wcn36xx_hal_msg_header header;
struct config_sta_rsp_params configStaRspParams;
-};
+} __packed;
/* Delete STA Request message */
struct delete_sta_req_msg {
@@ -1414,7 +1416,7 @@ struct delete_sta_rsp_msg {
struct wcn36xx_hal_rate_set {
u8 num_rates;
u8 rate[WCN36XX_HAL_MAC_RATESET_EID_MAX];
-};
+} __packed;
/* access category record */
struct wcn36xx_hal_aci_aifsn {
@@ -1429,7 +1431,7 @@ struct wcn36xx_hal_aci_aifsn {
u8 aci:2;
u8 rsvd:1;
#endif
-};
+} __packed;
/* contention window size */
struct wcn36xx_hal_mac_cw {
@@ -1440,18 +1442,18 @@ struct wcn36xx_hal_mac_cw {
u8 min:4;
u8 max:4;
#endif
-};
+} __packed;
struct wcn36xx_hal_edca_param_record {
struct wcn36xx_hal_aci_aifsn aci;
struct wcn36xx_hal_mac_cw cw;
u16 txop_limit;
-};
+} __packed;
struct wcn36xx_hal_mac_ssid {
u8 length;
u8 ssid[32];
-};
+} __packed;
/* Concurrency role. These are generic IDs that identify the various roles
* in the software system. */
@@ -1483,7 +1485,7 @@ enum wcn36xx_hal_concurrency_mode {
HAL_MAX_CONCURRENCY_PERSONA = 4
};
-struct config_bss_params {
+struct wcn36xx_hal_config_bss_params {
/* BSSID */
u8 bssid[ETH_ALEN];
@@ -1541,6 +1543,16 @@ struct config_bss_params {
/* Reserved to align next field on a dword boundary */
u8 reserved;
+ //TODO move sta to the end for 3680
+ /* 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 sta;
/* SSID of the BSS */
struct wcn36xx_hal_mac_ssid ssid;
@@ -1595,13 +1607,11 @@ struct config_bss_params {
/* EDCA Parameters for Voice Access Category */
struct wcn36xx_hal_edca_param_record acvo;
-#ifdef WLAN_FEATURE_VOWIFI_11R
/* Ext Bss Config Msg if set */
u8 ext_set_sta_key_param_valid;
/* SetStaKeyParams for ext bss msg */
- tSetStaKeyParams ext_set_sta_key_param;
-#endif
+ 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 */
@@ -1615,19 +1625,9 @@ struct config_bss_params {
/* maxTxPower has max power to be used after applying the power
* constraint if any */
s8 max_tx_power;
+} __packed;
- /* 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 config_sta_params sta;
-};
-
-struct config_bss_params_v1 {
+struct wcn36xx_hal_config_bss_params_v1 {
/* BSSID */
u8 bssid[ETH_ALEN];
@@ -1739,13 +1739,11 @@ struct config_bss_params_v1 {
/* EDCA Parameters for Voice Access Category */
struct wcn36xx_hal_edca_param_record acvo;
-#ifdef WLAN_FEATURE_VOWIFI_11R
/* Ext Bss Config Msg if set */
u8 ext_set_sta_key_param_valid;
/* SetStaKeyParams for ext bss msg */
- tSetStaKeyParams ext_set_sta_key_param;
-#endif
+ 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;
@@ -1763,21 +1761,22 @@ struct config_bss_params_v1 {
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 config_sta_params_v1 sta;
+ struct wcn36xx_hal_config_sta_params_v1 sta;
u8 vht;
u8 vht_tx_channel_width_set;
-};
+} __packed;
-struct config_bss_req_msg {
+struct wcn36xx_hal_config_bss_req_msg {
struct wcn36xx_hal_msg_header header;
union {
- struct config_bss_params bss_params;
- struct config_bss_params_v1 bss_params_v1;
+ struct wcn36xx_hal_config_bss_params bss_params;
+ //TODO Not used so far
+ //struct wcn36xx_hal_config_bss_params_v1 bss_params_v1;
} u;
-};
+} __packed;
-struct config_bss_rsp_params {
+struct wcn36xx_hal_config_bss_rsp_params {
/* Success or Failure */
u32 status;
@@ -1817,12 +1816,12 @@ struct config_bss_rsp_params {
/* HAL fills in the tx power used for mgmt frames in this field. */
s8 tx_mgmt_power;
-};
+} __packed;
-struct config_bss_rsp_msg {
+struct wcn36xx_hal_config_bss_rsp_msg {
struct wcn36xx_hal_msg_header header;
- struct config_bss_rsp_params bss_rsp_params;
-};
+ struct wcn36xx_hal_config_bss_rsp_params bss_rsp_params;
+} __packed;
struct delete_bss_req_msg {
struct wcn36xx_hal_msg_header header;
@@ -1881,14 +1880,14 @@ struct wcn36xx_hal_join_rsp_msg {
struct post_assoc_req_msg {
struct wcn36xx_hal_msg_header header;
- struct config_sta_params sta_params;
- struct config_bss_params bss_params;
+ struct wcn36xx_hal_config_sta_params sta_params;
+ struct wcn36xx_hal_config_bss_params bss_params;
};
struct post_assoc_rsp_msg {
struct wcn36xx_hal_msg_header header;
struct config_sta_rsp_params sta_rsp_params;
- struct config_bss_rsp_params bss_rsp_params;
+ struct wcn36xx_hal_config_bss_rsp_params bss_rsp_params;
};
/* This is used by PE to create a set of WEP keys for a given BSS. */
@@ -1933,7 +1932,7 @@ struct set_bss_key_rsp_msg {
*/
struct set_sta_key_req_msg {
struct wcn36xx_hal_msg_header header;
- struct set_sta_key_params setStaKeyParams;
+ struct wcn36xx_hal_set_sta_key_params set_sta_key_params;
};
struct set_sta_key_rsp_msg {
diff --git a/main.c b/main.c
index 466935a..6fcd8b9 100644
--- a/main.c
+++ b/main.c
@@ -496,6 +496,24 @@ static int __init wcn36xx_init(void)
wcn->addresses[1].addr[4] = 0x26;
wcn->addresses[1].addr[5] = 0x4D;
+ // Configuring supported rates
+ wcn->supported_rates.op_rate_mode = STA_11n;
+ wcn->supported_rates.llb_rates[0] = 0x82;
+ wcn->supported_rates.llb_rates[1] = 0x84;
+ wcn->supported_rates.llb_rates[2] = 0x8b;
+ wcn->supported_rates.llb_rates[3] = 0x96;
+
+ wcn->supported_rates.lla_rates[0] = 0x0C;
+ wcn->supported_rates.lla_rates[1] = 0x12;
+ wcn->supported_rates.lla_rates[2] = 0x18;
+ wcn->supported_rates.lla_rates[3] = 0x24;
+ wcn->supported_rates.lla_rates[4] = 0x30;
+ wcn->supported_rates.lla_rates[5] = 0x48;
+ wcn->supported_rates.lla_rates[6] = 0x60;
+ wcn->supported_rates.lla_rates[7] = 0x6C;
+
+ wcn->supported_rates.supported_mcs_set[0] = 0xFF;
+
wcn->hw->wiphy->n_addresses = ARRAY_SIZE(wcn->addresses);
wcn->hw->wiphy->addresses = wcn->addresses;
diff --git a/smd.c b/smd.c
index b146a1c..bf7ffda 100644
--- a/smd.c
+++ b/smd.c
@@ -312,42 +312,29 @@ int wcn36xx_smd_set_link_st(struct wcn36xx *wcn, u8 *bssid, u8 *sta_mac, enum wc
int wcn36xx_smd_config_sta(struct wcn36xx *wcn, u8 *bssid, u16 ass_id, u8 *sta_mac)
{
- struct wcn36xx_fw_msg_config_sta msg_body;
- struct wcn36xx_fw_msg_header msg_header;
+ struct wcn36xx_hal_config_sta_req_msg msg_body;
- INIT_MSG(msg_header, &msg_body, WCN36XX_HAL_CONFIG_STA_REQ)
+ INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_STA_REQ)
- memcpy(&msg_body.bssid, bssid, ETH_ALEN);
- memcpy(&msg_body.sta_mac, sta_mac, ETH_ALEN);
- msg_body.ass_id = 1;
- msg_body.sta_type = 0;
- msg_body.listen_int = 0x8;
- msg_body.ht_cap = 1;
-
- msg_body.max_ampdu_size = 3;
- msg_body.max_ampdu_dens = 5;
- msg_body.short_gi40mhz = 1;
- msg_body.short_gi20mhz = 1;
- msg_body.supported_rates.sta_rate_mode = WCN36XX_FW_MSG_STA_RATE_MODE_11N;
- msg_body.supported_rates.rates_11b[0] = 0x82;
- msg_body.supported_rates.rates_11b[1] = 0x84;
- msg_body.supported_rates.rates_11b[2] = 0x8b;
- msg_body.supported_rates.rates_11b[3] = 0x96;
-
- msg_body.supported_rates.rates_11a[0] = 0x0C;
- msg_body.supported_rates.rates_11a[1] = 0x12;
- msg_body.supported_rates.rates_11a[2] = 0x18;
- msg_body.supported_rates.rates_11a[3] = 0x24;
- msg_body.supported_rates.rates_11a[4] = 0x30;
- msg_body.supported_rates.rates_11a[5] = 0x48;
- msg_body.supported_rates.rates_11a[6] = 0x60;
- msg_body.supported_rates.rates_11a[7] = 0x6C;
- msg_body.supported_rates.supported_mcs_set[0] = 0xFF;
- msg_body.sta_id = 1;
+ 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;
- PREPARE_BUF(wcn->smd_buf, msg_header, &msg_body)
+ 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;
- return wcn36xx_smd_send_and_wait(wcn, msg_header.msg_len);
+ memcpy(&msg_body.u.sta_params.supported_rates, &wcn->supported_rates,
+ sizeof(wcn->supported_rates));
+ msg_body.u.sta_params.sta_index = 1;
+
+ PREPARE_HAL_BUF(wcn->smd_buf, msg_body)
+
+ return wcn36xx_smd_send_and_wait(wcn, msg_body.header.len);
}
static int wcn36xx_smd_join_rsp(void *buf, size_t len)
{
@@ -365,90 +352,76 @@ static int wcn36xx_smd_join_rsp(void *buf, size_t len)
int wcn36xx_smd_config_bss(struct wcn36xx *wcn, bool sta_mode, u8 *bssid, u8 update)
{
- struct wcn36xx_fw_msg_config_bss_req msg_body;
- struct wcn36xx_fw_msg_header msg_header;
+ struct wcn36xx_hal_config_bss_req_msg msg_body;
- INIT_MSG(msg_header, &msg_body, WCN36XX_FW_MSG_TYPE_CONFIG_BSS_REQ)
+ INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_BSS_REQ)
if(sta_mode) {
- memcpy(&msg_body.bssid, bssid, ETH_ALEN);
- memcpy(&msg_body.self_mac, &wcn->addresses[0], ETH_ALEN);
- msg_body.bss_type = WCN36XX_FW_MSG_BSS_TYPE_STA;
- msg_body.oper_mode = 1; //0 - AP, 1-STA
- msg_body.net_type = WCN36XX_FW_MSG_NET_TYPE_11G;
- msg_body.coex_11g = 1;
- msg_body.beacon_interval = 0x64;
-
- msg_body.cur_op_ch = wcn->ch;
- memcpy(&msg_body.sta_context.bssid, bssid, ETH_ALEN);
- msg_body.sta_context.sta_type = 1;
- msg_body.sta_context.listen_int = 0x64;
- msg_body.sta_context.wmm_en = 1;
-
- msg_body.sta_context.max_ampdu_size = 3;
- msg_body.sta_context.max_ampdu_dens = 5;
- msg_body.sta_context.dsss_cck_mode_40mhz = 1;
+ 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;
+ //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;
} else {
- memcpy(&msg_body.bssid, &wcn->addresses[0], ETH_ALEN);
- memcpy(&msg_body.self_mac, &wcn->addresses[0], ETH_ALEN);
+ 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);
//TODO do all this configurabel
- msg_body.bss_type = WCN36XX_FW_MSG_BSS_TYPE_AP;
- msg_body.oper_mode = 0; //0 - AP, 1-STA
- msg_body.net_type = WCN36XX_FW_MSG_NET_TYPE_11G;
- msg_body.short_slot_time = 1;
- msg_body.beacon_interval = 0x64;
- msg_body.dtim_period = 2;
- msg_body.cur_op_ch = 1;
- msg_body.ssid.len = 1;
- msg_body.ssid.ssid[0] = 'K';
- msg_body.obss_prot = 1;
- msg_body.hal_pers = 1;
- msg_body.max_tx_power = 0x10;
-
- memcpy(&msg_body.sta_context.bssid, &wcn->addresses[0], ETH_ALEN);
- msg_body.sta_context.short_pream_sup = 1;
- memcpy(&msg_body.sta_context.sta_mac, &wcn->addresses[0], ETH_ALEN);
- msg_body.sta_context.listen_int = 8;
+ 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.sta_context.ht_cap = 1;
- msg_body.sta_context.short_gi40mhz = 1;
- msg_body.sta_context.short_gi20mhz = 1;
+ 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;
if (update == 1) {
- msg_body.short_slot_time = 1;
- msg_body.coex_11n_non_gf = 1;
- msg_body.dtim_period = 0;
- msg_body.sta_context.ass_id = 1;
- msg_body.sta_context.bss_id = 0;
- msg_body.action = 1;
- msg_body.tx_mgmt_power = 6;
- msg_body.max_tx_power = 0x10;
+ 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;
} else {
- msg_body.max_tx_power = 0x14;
- msg_body.dtim_period = 1;
- msg_body.sta_context.bss_id = 0xff;
+ 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.sta_context.sta_id = 0xff;
-
- msg_body.sta_context.supported_rates.sta_rate_mode = WCN36XX_FW_MSG_STA_RATE_MODE_11N;
- msg_body.sta_context.supported_rates.rates_11b[0] = 0x82;
- msg_body.sta_context.supported_rates.rates_11b[1] = 0x84;
- msg_body.sta_context.supported_rates.rates_11b[2] = 0x8b;
- msg_body.sta_context.supported_rates.rates_11b[3] = 0x96;
-
- msg_body.sta_context.supported_rates.rates_11a[0] = 0x0C;
- msg_body.sta_context.supported_rates.rates_11a[1] = 0x12;
- msg_body.sta_context.supported_rates.rates_11a[2] = 0x18;
- msg_body.sta_context.supported_rates.rates_11a[3] = 0x24;
- msg_body.sta_context.supported_rates.rates_11a[4] = 0x30;
- msg_body.sta_context.supported_rates.rates_11a[5] = 0x48;
- msg_body.sta_context.supported_rates.rates_11a[6] = 0x60;
- msg_body.sta_context.supported_rates.rates_11a[7] = 0x6C;
-
- msg_body.sta_context.supported_rates.supported_mcs_set[0] = 0xFF;
- PREPARE_BUF(wcn->smd_buf, msg_header, &msg_body)
+ msg_body.u.bss_params.sta.sta_index = 0xff;
- return wcn36xx_smd_send_and_wait(wcn, msg_header.msg_len);
+ memcpy(&msg_body.u.bss_params.sta.supported_rates, &wcn->supported_rates, sizeof(wcn->supported_rates));
+
+ PREPARE_HAL_BUF(wcn->smd_buf, msg_body)
+
+ return wcn36xx_smd_send_and_wait(wcn, msg_body.header.len);
}
int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct sk_buff *skb_beacon, u16 tim_off, u16 p2p_off){
struct wcn36xx_fw_msg_send_bcn_req msg_body;
@@ -516,7 +489,8 @@ static void wcn36xx_smd_rsp_process (void *buf, size_t len)
case WCN36XX_HAL_DOWNLOAD_NV_RSP:
case WCN36XX_FW_MSG_TYPE_ENTER_IMPS_RSP:
case WCN36XX_FW_MSG_TYPE_EXIT_IMPS_RSP:
- case WCN36XX_FW_MSG_TYPE_CONFIG_BSS_RSP:
+ case WCN36XX_HAL_CONFIG_BSS_RSP:
+ case WCN36XX_HAL_CONFIG_STA_RSP:
case WCN36XX_FW_MSG_TYPE_SEND_BEACON_RSP:
if(wcn36xx_smd_rsp_status_check(buf, len)) {
diff --git a/smd.h b/smd.h
index 55ba413..6ff1d4e 100644
--- a/smd.h
+++ b/smd.h
@@ -29,12 +29,6 @@
#define WCN36XX_SMSM_WLAN_TX_RINGS_EMPTY 0x00000200
enum wcn36xx_fw_msg_type {
- WCN36XX_FW_MSG_TYPE_CONFIG_BSS_REQ = 16,
- WCN36XX_FW_MSG_TYPE_CONFIG_BSS_RSP = 17,
-
- WCN36XX_FW_MSG_TYPE_SET_LINK_ST_REQ = 44,
- WCN36XX_FW_MSG_TYPE_SET_LINK_ST_RSP = 45,
-
/* CFG */
WCN36XX_FW_MSG_TYPE_UPDATE_CFG_REQ = 48,
WCN36XX_FW_MSG_TYPE_UPDATE_CFG_RSP = 49,
@@ -68,40 +62,6 @@ enum wcn36xx_fw_msg_ver {
WCN36XX_FW_MSG_VER0 = 0
};
-enum wcn36xx_fw_msg_bss_type {
- WCN36XX_FW_MSG_BSS_TYPE_STA = 0,
- WCN36XX_FW_MSG_BSS_TYPE_AP = 1
-};
-enum wcn36xx_fw_msg_bss_oper_mode {
- WCN36XX_FW_MSG_BSS_MODE_AP = 0,
- WCN36XX_FW_MSG_BSS_MODE_STA = 1
-};
-enum wcn36xx_fw_msg_network_type {
- WCN36XX_FW_MSG_NET_TYPE_11A = 0,
- WCN36XX_FW_MSG_NET_TYPE_11B = 1,
- WCN36XX_FW_MSG_NET_TYPE_11G = 2,
- WCN36XX_FW_MSG_NET_TYPE_11N = 3
-};
-enum wcn36xx_fw_msg_ht_op_mode {
- WCN36XX_FW_MSG_HT_OP_MODE_PURE = 0,
- WCN36XX_FW_MSG_HT_OP_MODE_OVERLAP_LEG = 1,
- WCN36XX_FW_MSG_HT_OP_MODE_NO_LEG = 2,
- WCN36XX_FW_MSG_HT_OP_MODE_MIXED = 3
-};
-enum wcn36xx_fw_msg_ht_mimo_ps {
- WCN36XX_FW_MSG_HT_MIMO_PS_STATIC = 0,
- WCN36XX_FW_MSG_HT_MIMO_PS_DYNAMIC = 1
-};
-enum wcn36xx_fw_msg_sta_rate_mode {
- WCN36XX_FW_MSG_STA_RATE_MODE_TAURUS = 0,
- WCN36XX_FW_MSG_STA_RATE_MODE_TITAN = 1,
- WCN36XX_FW_MSG_STA_RATE_MODE_POLARIS = 2,
- WCN36XX_FW_MSG_STA_RATE_MODE_11B = 3,
- WCN36XX_FW_MSG_STA_RATE_MODE_11BG = 4,
- WCN36XX_FW_MSG_STA_RATE_MODE_11A = 5,
- WCN36XX_FW_MSG_STA_RATE_MODE_11N = 6
-};
-
/******************************/
/* SMD requests and responses */
/******************************/
@@ -125,116 +85,6 @@ struct wcn36xx_fw_msg_ex_capabilities_req {
} __packed;
#define wcn36xx_fw_msg_ex_capabilities_rsp wcn36xx_fw_msg_ex_capabilities_req
-//TODO
-/* WCN36XX_FW_MSG_TYPE_CONFIG_STA_REQ */
-struct wcn36xx_fw_msg_supported_rates {
- enum wcn36xx_fw_msg_sta_rate_mode sta_rate_mode;
- u16 rates_11b[4];
- u16 rates_11a[8];
- u16 ani_leg_rate[3];
- u16 reserved;
- u32 enhan_rate_bitmap;
- u8 supported_mcs_set[16];
- u16 rx_highes_rate;
-} __packed;
-
-struct wcn36xx_fw_msg_config_sta {
- u8 bssid[ETH_ALEN];
- u16 ass_id;
- u8 sta_type;
- u8 short_pream_sup;
- u8 sta_mac[ETH_ALEN];
- u16 listen_int;
- u8 wmm_en;
- u8 ht_cap;
- u8 tx_ch_width;
- u8 rifs_mode;
- u8 lsig_txop_prot;
- u8 max_ampdu_size;
- u8 max_ampdu_dens;
- u8 max_amsdu_size;
- u8 short_gi40mhz;
- u8 short_gi20mhz;
- struct wcn36xx_fw_msg_supported_rates supported_rates;
- u8 rmf_en; // robust management frame
- u32 encrypt_type;
- u8 action;
- u8 uapsd;
- u8 max_sp_len;
- u8 gf_cap;
- enum wcn36xx_fw_msg_ht_mimo_ps mimo_ps;
- u8 delayed_ba;
- u8 max_ampdu_dur;
- u8 dsss_cck_mode_40mhz;
- u8 sta_id;
- u8 bss_id;
- u8 p2p_cap;
- // TODO add this parameter for 3680.
- //u8 reserved;
-} __packed;
-
-/* WCN36XX_FW_MSG_TYPE_CONFIG_BSS_REQ */
-struct wcn36xx_fw_msg_ssid {
- u8 len;
- u8 ssid[IEEE80211_MAX_SSID_LEN];
-} __packed;
-
-struct wcn36xx_fw_msg_rate_set {
- u8 num;
- u8 rate[12];
-} __packed;
-
-struct wcn36xx_fw_msg_edca_param {
- u8 ac; //access category
- u8 cw; // contention window size
- u16 tx_op_limit;
-} __packed;
-
-struct wcn36xx_fw_msg_config_bss_req {
- u8 bssid[ETH_ALEN];
- u8 self_mac[ETH_ALEN];
- enum wcn36xx_fw_msg_bss_type bss_type;
- u8 oper_mode;
- enum wcn36xx_fw_msg_network_type net_type;
- u8 short_slot_time;
- u8 coex_11a;
- u8 coex_11b;
- u8 coex_11g;
- u8 coex_ht20;
- u8 coex_11n_non_gf;
- u8 lsig_txop_prot;
- u8 rifs_mode;
- u16 beacon_interval;
- u8 dtim_period;
- u8 tx_ch_width;
- u8 cur_op_ch;
- u8 cur_ext_ch;
- u8 reserved;
- struct wcn36xx_fw_msg_config_sta sta_context;
- struct wcn36xx_fw_msg_ssid ssid;
- u8 action;
- struct wcn36xx_fw_msg_rate_set rate_set;
- u8 ht_caps;
- u8 obss_prot;
- u8 rmf;
- enum wcn36xx_fw_msg_ht_op_mode ht_op_mode;
- u8 dual_cts_prot;
- u8 prb_resp_max_ret;
- u8 hidden_ssid_en;
- u8 proxy_prb_rsp_en;
- u8 edca_params_valid;
- struct wcn36xx_fw_msg_edca_param acbe;
- struct wcn36xx_fw_msg_edca_param acbk;
- struct wcn36xx_fw_msg_edca_param acvi;
- struct wcn36xx_fw_msg_edca_param acvo;
- // TODO So far support only open network
- u8 sta_key_params[241];
- u8 hal_pers;
- u8 spec_mgmt_en;
- u8 tx_mgmt_power;
- u8 max_tx_power;
-} __packed;
-
/* WCN36XX_FW_MSG_TYPE_ADD_BCN_FILTER_REQ */
struct wcn36xx_fw_msg_add_bcn_filter_req {
u8 enable_11d;
diff --git a/wcn36xx.h b/wcn36xx.h
index 1d76ac2..8e325d3 100644
--- a/wcn36xx.h
+++ b/wcn36xx.h
@@ -26,6 +26,7 @@
#include "smd.h"
#include "dxe.h"
+#include "hal.h"
#define DRIVER_PREFIX "wcn36xx: "
#define WLAN_NV_FILE "wlan/prima/WCNSS_qcom_wlan_nv.bin"
@@ -85,6 +86,9 @@ struct wcn36xx {
int rx_irq; // RX ready irq
void __iomem *mmio;
+ // Rates
+ struct wcn36xx_hal_supported_rates supported_rates;
+
// SMD related
smd_channel_t *smd_ch;
u8 *smd_buf;
--
1.7.11.3
More information about the wcn36xx
mailing list