Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | #ifndef WMA_API_H |
| 29 | #define WMA_API_H |
| 30 | |
| 31 | #include "osdep.h" |
| 32 | #include "cds_mq.h" |
| 33 | #include "ani_global.h" |
| 34 | #include "a_types.h" |
| 35 | #include "wmi_unified.h" |
| 36 | #ifdef NOT_YET |
| 37 | #include "htc_api.h" |
| 38 | #endif |
| 39 | #include "lim_global.h" |
| 40 | |
| 41 | typedef void *WMA_HANDLE; |
| 42 | |
| 43 | /** |
| 44 | * enum GEN_PARAM - general parameters |
| 45 | * @GEN_VDEV_PARAM_AMPDU: Set ampdu size |
| 46 | * @GEN_VDEV_PARAM_AMSDU: Set amsdu size |
| 47 | * @GEN_PARAM_DUMP_AGC_START: dump agc start |
| 48 | * @GEN_PARAM_DUMP_AGC: dump agc |
| 49 | * @GEN_PARAM_DUMP_CHANINFO_START: dump channel info start |
| 50 | * @GEN_PARAM_DUMP_CHANINFO: dump channel info |
| 51 | * @GEN_PARAM_CRASH_INJECT: inject crash |
| 52 | * @GEN_PARAM_DUMP_PCIE_ACCESS_LOG: dump pcie access log |
| 53 | * @GEN_PARAM_TX_CHAIN_MASK_CCK: cck tx chain mask |
| 54 | */ |
| 55 | typedef enum { |
| 56 | GEN_VDEV_PARAM_AMPDU = 0x1, |
| 57 | GEN_VDEV_PARAM_AMSDU, |
| 58 | GEN_PARAM_DUMP_AGC_START, |
| 59 | GEN_PARAM_DUMP_AGC, |
| 60 | GEN_PARAM_DUMP_CHANINFO_START, |
| 61 | GEN_PARAM_DUMP_CHANINFO, |
| 62 | GEN_PARAM_DUMP_WATCHDOG, |
| 63 | GEN_PARAM_CRASH_INJECT, |
| 64 | #ifdef CONFIG_ATH_PCIE_ACCESS_DEBUG |
| 65 | GEN_PARAM_DUMP_PCIE_ACCESS_LOG, |
| 66 | #endif |
| 67 | GEN_PARAM_MODULATED_DTIM, |
| 68 | } GEN_PARAM; |
| 69 | |
| 70 | #define VDEV_CMD 1 |
| 71 | #define PDEV_CMD 2 |
| 72 | #define GEN_CMD 3 |
| 73 | #define DBG_CMD 4 |
| 74 | #define PPS_CMD 5 |
| 75 | #define QPOWER_CMD 6 |
| 76 | #define GTX_CMD 7 |
| 77 | |
| 78 | typedef void (*wma_peer_authorized_fp) (uint32_t vdev_id); |
| 79 | |
| 80 | |
| 81 | CDF_STATUS wma_pre_start(void *cds_context); |
| 82 | |
| 83 | CDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg); |
| 84 | |
| 85 | CDF_STATUS wma_start(void *cds_context); |
| 86 | |
| 87 | CDF_STATUS wma_stop(void *cds_context, uint8_t reason); |
| 88 | |
| 89 | CDF_STATUS wma_close(void *cds_context); |
| 90 | |
| 91 | CDF_STATUS wma_wmi_service_close(void *cds_context); |
| 92 | |
| 93 | void wma_rx_ready_event(WMA_HANDLE handle, void *ev); |
| 94 | |
| 95 | void wma_rx_service_ready_event(WMA_HANDLE handle, void *ev); |
| 96 | |
| 97 | void wma_rx_service_ready_ext_event(WMA_HANDLE handle, void *ev); |
| 98 | |
| 99 | void wma_setneedshutdown(void *cds_context); |
| 100 | |
| 101 | bool wma_needshutdown(void *cds_context); |
| 102 | |
| 103 | CDF_STATUS wma_wait_for_ready_event(WMA_HANDLE handle); |
| 104 | |
| 105 | uint8_t wma_map_channel(uint8_t mapChannel); |
| 106 | |
| 107 | int wma_cli_get_command(int vdev_id, int param_id, int vpdev); |
| 108 | int wma_cli_set_command(int vdev_id, int param_id, int sval, int vpdev); |
| 109 | int wma_cli_set2_command(int vdev_id, int param_id, int sval1, |
| 110 | int sval2, int vpdev); |
| 111 | |
| 112 | CDF_STATUS wma_set_htconfig(uint8_t vdev_id, uint16_t ht_capab, int value); |
| 113 | CDF_STATUS wma_set_reg_domain(void *clientCtxt, v_REGDOMAIN_t regId); |
| 114 | |
| 115 | CDF_STATUS wma_get_wcnss_software_version(void *p_cds_gctx, |
| 116 | uint8_t *pVersion, |
| 117 | uint32_t versionBufferSize); |
| 118 | int wma_bus_suspend(void); |
| 119 | int wma_suspend_target(WMA_HANDLE handle, int disable_target_intr); |
| 120 | void wma_target_suspend_acknowledge(void *context); |
| 121 | int wma_bus_resume(void); |
| 122 | int wma_resume_target(WMA_HANDLE handle); |
| 123 | CDF_STATUS wma_disable_wow_in_fw(WMA_HANDLE handle); |
| 124 | CDF_STATUS wma_disable_d0wow_in_fw(WMA_HANDLE handle); |
| 125 | int wma_is_wow_mode_selected(WMA_HANDLE handle); |
| 126 | CDF_STATUS wma_enable_wow_in_fw(WMA_HANDLE handle); |
| 127 | CDF_STATUS wma_enable_d0wow_in_fw(WMA_HANDLE handle); |
| 128 | bool wma_check_scan_in_progress(WMA_HANDLE handle); |
| 129 | void wma_set_peer_authorized_cb(void *wma_ctx, wma_peer_authorized_fp auth_cb); |
| 130 | int wma_set_peer_param(void *wma_ctx, uint8_t *peer_addr, uint32_t param_id, |
| 131 | uint32_t param_value, uint32_t vdev_id); |
| 132 | #ifdef NOT_YET |
| 133 | CDF_STATUS wma_update_channel_list(WMA_HANDLE handle, void *scan_chan_info); |
| 134 | #endif |
| 135 | |
| 136 | uint8_t *wma_get_vdev_address_by_vdev_id(uint8_t vdev_id); |
| 137 | struct wma_txrx_node *wma_get_interface_by_vdev_id(uint8_t vdev_id); |
| 138 | bool wma_is_vdev_up(uint8_t vdev_id); |
| 139 | |
| 140 | void *wma_get_beacon_buffer_by_vdev_id(uint8_t vdev_id, uint32_t *buffer_size); |
| 141 | |
| 142 | uint8_t wma_get_fw_wlan_feat_caps(uint8_t featEnumValue); |
| 143 | tSirRetStatus wma_post_ctrl_msg(tpAniSirGlobal pMac, tSirMsgQ *pMsg); |
| 144 | |
| 145 | void wma_enable_disable_wakeup_event(WMA_HANDLE handle, |
| 146 | uint32_t vdev_id, |
| 147 | uint32_t bitmap, |
| 148 | bool enable); |
| 149 | void wma_register_wow_wakeup_events(WMA_HANDLE handle, uint8_t vdev_id, |
| 150 | uint8_t vdev_type, uint8_t sub_type); |
| 151 | void wma_register_wow_default_patterns(WMA_HANDLE handle, uint8_t vdev_id); |
| 152 | int8_t wma_get_hw_mode_idx_from_dbs_hw_list(enum hw_mode_ss_config mac0_ss, |
| 153 | enum hw_mode_bandwidth mac0_bw, |
| 154 | enum hw_mode_ss_config mac1_ss, |
| 155 | enum hw_mode_bandwidth mac1_bw, |
| 156 | enum hw_mode_dbs_capab dbs, |
| 157 | enum hw_mode_agile_dfs_capab dfs); |
| 158 | CDF_STATUS wma_get_hw_mode_from_idx(uint32_t idx, |
| 159 | struct sir_hw_mode_params *hw_mode); |
| 160 | int8_t wma_get_num_dbs_hw_modes(void); |
| 161 | bool wma_is_hw_dbs_capable(void); |
| 162 | bool wma_is_hw_agile_dfs_capable(void); |
| 163 | int8_t wma_get_mac_id_of_vdev(uint32_t vdev_id); |
| 164 | void wma_update_intf_hw_mode_params(uint32_t vdev_id, uint32_t mac_id, |
| 165 | uint32_t cfgd_hw_mode_index); |
| 166 | CDF_STATUS wma_get_old_and_new_hw_index(uint32_t *old_hw_mode_index, |
| 167 | uint32_t *new_hw_mode_index); |
| 168 | void wma_set_dbs_capability_ut(uint32_t dbs); |
| 169 | CDF_STATUS wma_get_dbs_hw_modes(bool *one_by_one_dbs, bool *two_by_two_dbs); |
| 170 | CDF_STATUS wma_get_current_hw_mode(struct sir_hw_mode_params *hw_mode); |
| 171 | bool wma_is_dbs_enable(void); |
| 172 | bool wma_is_agile_dfs_enable(void); |
| 173 | CDF_STATUS wma_get_updated_scan_config(uint32_t *scan_config, |
| 174 | bool dbs_scan, |
| 175 | bool dbs_plus_agile_scan, |
| 176 | bool single_mac_scan_with_dfs); |
| 177 | CDF_STATUS wma_get_updated_fw_mode_config(uint32_t *fw_mode_config, |
| 178 | bool dbs, |
| 179 | bool agile_dfs); |
| 180 | bool wma_get_dbs_scan_config(void); |
| 181 | bool wma_get_dbs_plus_agile_scan_config(void); |
| 182 | bool wma_get_single_mac_scan_with_dfs_config(void); |
| 183 | bool wma_get_dbs_config(void); |
| 184 | bool wma_get_agile_dfs_config(void); |
| 185 | bool wma_is_dual_mac_disabled_in_ini(void); |
| 186 | bool wma_get_prev_dbs_config(void); |
| 187 | bool wma_get_prev_agile_dfs_config(void); |
| 188 | bool wma_get_prev_dbs_scan_config(void); |
| 189 | bool wma_get_prev_dbs_plus_agile_scan_config(void); |
| 190 | bool wma_get_prev_single_mac_scan_with_dfs_config(void); |
| 191 | |
| 192 | #define LRO_IPV4_SEED_ARR_SZ 5 |
| 193 | #define LRO_IPV6_SEED_ARR_SZ 11 |
| 194 | |
| 195 | /** |
| 196 | * struct wma_lro_init_cmd_t - set LRO init parameters |
| 197 | * @lro_enable: indicates whether lro is enabled |
| 198 | * @tcp_flag: If the TCP flags from the packet do not match |
| 199 | * the values in this field after masking with TCP flags mask |
| 200 | * below, packet is not LRO eligible |
| 201 | * @tcp_flag_mask: field for comparing the TCP values provided |
| 202 | * above with the TCP flags field in the received packet |
| 203 | * @toeplitz_hash_ipv4: contains seed needed to compute the flow id |
| 204 | * 5-tuple toeplitz hash for ipv4 packets |
| 205 | * @toeplitz_hash_ipv6: contains seed needed to compute the flow id |
| 206 | * 5-tuple toeplitz hash for ipv6 packets |
| 207 | */ |
| 208 | struct wma_lro_config_cmd_t { |
| 209 | uint32_t lro_enable; |
| 210 | uint32_t tcp_flag:9, |
| 211 | tcp_flag_mask:9; |
| 212 | uint32_t toeplitz_hash_ipv4[LRO_IPV4_SEED_ARR_SZ]; |
| 213 | uint32_t toeplitz_hash_ipv6[LRO_IPV6_SEED_ARR_SZ]; |
| 214 | }; |
| 215 | |
| 216 | #if defined(FEATURE_LRO) |
| 217 | int wma_lro_init(struct wma_lro_config_cmd_t *lro_config); |
| 218 | #endif |
| 219 | bool wma_is_scan_simultaneous_capable(void); |
| 220 | #endif |