diff options
author | Bartosz Markowski <bartosz.markowski@tieto.com> | 2013-09-26 11:47:13 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2013-09-27 07:58:15 -0400 |
commit | 12b2b9e33a58ff51a1a41a90e976a863736cc863 (patch) | |
tree | 8c1bd8ba6aeff3605f1cd1cd045e60ddd3dde340 /drivers/net/wireless/ath/ath10k/wmi.c | |
parent | 5e00d31a0fb74c36f3b174ff0d4914cf09016e6f (diff) |
ath10k: split wmi_cmd_init path
Due to API differences in initialization structures for
main and 10.x firmwares we need to split the wmi_init_cmd
and wmi_resource_config structures.
This will be usefull also when setting the correct TARGET values,
like: number of peers, vdevs, pdevs etc.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/wmi.c')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.c | 105 |
1 files changed, 104 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 8c223671ecc4..71ad1b8868b2 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c | |||
@@ -1908,7 +1908,7 @@ int ath10k_wmi_pdev_set_param(struct ath10k *ar, enum wmi_pdev_param id, | |||
1908 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_set_param_cmdid); | 1908 | return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_set_param_cmdid); |
1909 | } | 1909 | } |
1910 | 1910 | ||
1911 | int ath10k_wmi_cmd_init(struct ath10k *ar) | 1911 | static int ath10k_wmi_main_cmd_init(struct ath10k *ar) |
1912 | { | 1912 | { |
1913 | struct wmi_init_cmd *cmd; | 1913 | struct wmi_init_cmd *cmd; |
1914 | struct sk_buff *buf; | 1914 | struct sk_buff *buf; |
@@ -2007,6 +2007,109 @@ out: | |||
2007 | return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->init_cmdid); | 2007 | return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->init_cmdid); |
2008 | } | 2008 | } |
2009 | 2009 | ||
2010 | static int ath10k_wmi_10x_cmd_init(struct ath10k *ar) | ||
2011 | { | ||
2012 | struct wmi_init_cmd_10x *cmd; | ||
2013 | struct sk_buff *buf; | ||
2014 | struct wmi_resource_config_10x config = {}; | ||
2015 | u32 len, val; | ||
2016 | int i; | ||
2017 | |||
2018 | config.num_vdevs = __cpu_to_le32(TARGET_NUM_VDEVS); | ||
2019 | config.num_peers = __cpu_to_le32(TARGET_NUM_PEERS + TARGET_NUM_VDEVS); | ||
2020 | config.num_peer_keys = __cpu_to_le32(TARGET_NUM_PEER_KEYS); | ||
2021 | config.num_tids = __cpu_to_le32(TARGET_NUM_TIDS); | ||
2022 | config.ast_skid_limit = __cpu_to_le32(TARGET_AST_SKID_LIMIT); | ||
2023 | config.tx_chain_mask = __cpu_to_le32(TARGET_TX_CHAIN_MASK); | ||
2024 | config.rx_chain_mask = __cpu_to_le32(TARGET_RX_CHAIN_MASK); | ||
2025 | config.rx_timeout_pri_vo = __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI); | ||
2026 | config.rx_timeout_pri_vi = __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI); | ||
2027 | config.rx_timeout_pri_be = __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI); | ||
2028 | config.rx_timeout_pri_bk = __cpu_to_le32(TARGET_RX_TIMEOUT_HI_PRI); | ||
2029 | config.rx_decap_mode = __cpu_to_le32(TARGET_RX_DECAP_MODE); | ||
2030 | |||
2031 | config.scan_max_pending_reqs = | ||
2032 | __cpu_to_le32(TARGET_SCAN_MAX_PENDING_REQS); | ||
2033 | |||
2034 | config.bmiss_offload_max_vdev = | ||
2035 | __cpu_to_le32(TARGET_BMISS_OFFLOAD_MAX_VDEV); | ||
2036 | |||
2037 | config.roam_offload_max_vdev = | ||
2038 | __cpu_to_le32(TARGET_ROAM_OFFLOAD_MAX_VDEV); | ||
2039 | |||
2040 | config.roam_offload_max_ap_profiles = | ||
2041 | __cpu_to_le32(TARGET_ROAM_OFFLOAD_MAX_AP_PROFILES); | ||
2042 | |||
2043 | config.num_mcast_groups = __cpu_to_le32(TARGET_NUM_MCAST_GROUPS); | ||
2044 | config.num_mcast_table_elems = | ||
2045 | __cpu_to_le32(TARGET_NUM_MCAST_TABLE_ELEMS); | ||
2046 | |||
2047 | config.mcast2ucast_mode = __cpu_to_le32(TARGET_MCAST2UCAST_MODE); | ||
2048 | config.tx_dbg_log_size = __cpu_to_le32(TARGET_TX_DBG_LOG_SIZE); | ||
2049 | config.num_wds_entries = __cpu_to_le32(TARGET_NUM_WDS_ENTRIES); | ||
2050 | config.dma_burst_size = __cpu_to_le32(TARGET_DMA_BURST_SIZE); | ||
2051 | config.mac_aggr_delim = __cpu_to_le32(TARGET_MAC_AGGR_DELIM); | ||
2052 | |||
2053 | val = TARGET_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK; | ||
2054 | config.rx_skip_defrag_timeout_dup_detection_check = __cpu_to_le32(val); | ||
2055 | |||
2056 | config.vow_config = __cpu_to_le32(TARGET_VOW_CONFIG); | ||
2057 | |||
2058 | config.num_msdu_desc = __cpu_to_le32(TARGET_NUM_MSDU_DESC); | ||
2059 | config.max_frag_entries = __cpu_to_le32(TARGET_MAX_FRAG_ENTRIES); | ||
2060 | |||
2061 | len = sizeof(*cmd) + | ||
2062 | (sizeof(struct host_memory_chunk) * ar->wmi.num_mem_chunks); | ||
2063 | |||
2064 | buf = ath10k_wmi_alloc_skb(len); | ||
2065 | if (!buf) | ||
2066 | return -ENOMEM; | ||
2067 | |||
2068 | cmd = (struct wmi_init_cmd_10x *)buf->data; | ||
2069 | |||
2070 | if (ar->wmi.num_mem_chunks == 0) { | ||
2071 | cmd->num_host_mem_chunks = 0; | ||
2072 | goto out; | ||
2073 | } | ||
2074 | |||
2075 | ath10k_dbg(ATH10K_DBG_WMI, "wmi sending %d memory chunks info.\n", | ||
2076 | __cpu_to_le32(ar->wmi.num_mem_chunks)); | ||
2077 | |||
2078 | cmd->num_host_mem_chunks = __cpu_to_le32(ar->wmi.num_mem_chunks); | ||
2079 | |||
2080 | for (i = 0; i < ar->wmi.num_mem_chunks; i++) { | ||
2081 | cmd->host_mem_chunks[i].ptr = | ||
2082 | __cpu_to_le32(ar->wmi.mem_chunks[i].paddr); | ||
2083 | cmd->host_mem_chunks[i].size = | ||
2084 | __cpu_to_le32(ar->wmi.mem_chunks[i].len); | ||
2085 | cmd->host_mem_chunks[i].req_id = | ||
2086 | __cpu_to_le32(ar->wmi.mem_chunks[i].req_id); | ||
2087 | |||
2088 | ath10k_dbg(ATH10K_DBG_WMI, | ||
2089 | "wmi chunk %d len %d requested, addr 0x%x\n", | ||
2090 | i, | ||
2091 | cmd->host_mem_chunks[i].size, | ||
2092 | cmd->host_mem_chunks[i].ptr); | ||
2093 | } | ||
2094 | out: | ||
2095 | memcpy(&cmd->resource_config, &config, sizeof(config)); | ||
2096 | |||
2097 | ath10k_dbg(ATH10K_DBG_WMI, "wmi init 10x\n"); | ||
2098 | return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->init_cmdid); | ||
2099 | } | ||
2100 | |||
2101 | int ath10k_wmi_cmd_init(struct ath10k *ar) | ||
2102 | { | ||
2103 | int ret; | ||
2104 | |||
2105 | if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) | ||
2106 | ret = ath10k_wmi_10x_cmd_init(ar); | ||
2107 | else | ||
2108 | ret = ath10k_wmi_main_cmd_init(ar); | ||
2109 | |||
2110 | return ret; | ||
2111 | } | ||
2112 | |||
2010 | static int ath10k_wmi_start_scan_calc_len(const struct wmi_start_scan_arg *arg) | 2113 | static int ath10k_wmi_start_scan_calc_len(const struct wmi_start_scan_arg *arg) |
2011 | { | 2114 | { |
2012 | int len; | 2115 | int len; |