18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Copyright (c) 2010-2011 Atheros Communications Inc. 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Permission to use, copy, modify, and/or distribute this software for any 58c2ecf20Sopenharmony_ci * purpose with or without fee is hereby granted, provided that the above 68c2ecf20Sopenharmony_ci * copyright notice and this permission notice appear in all copies. 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 98c2ecf20Sopenharmony_ci * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 108c2ecf20Sopenharmony_ci * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 118c2ecf20Sopenharmony_ci * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 128c2ecf20Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 138c2ecf20Sopenharmony_ci * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 148c2ecf20Sopenharmony_ci * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 158c2ecf20Sopenharmony_ci */ 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#ifndef AR9003_MCI_H 188c2ecf20Sopenharmony_ci#define AR9003_MCI_H 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#define MCI_FLAG_DISABLE_TIMESTAMP 0x00000001 /* Disable time stamp */ 218c2ecf20Sopenharmony_ci#define MCI_RECOVERY_DUR_TSF (100 * 1000) /* 100 ms */ 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci/* Default remote BT device MCI COEX version */ 248c2ecf20Sopenharmony_ci#define MCI_GPM_COEX_MAJOR_VERSION_DEFAULT 3 258c2ecf20Sopenharmony_ci#define MCI_GPM_COEX_MINOR_VERSION_DEFAULT 0 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci/* Local WLAN MCI COEX version */ 288c2ecf20Sopenharmony_ci#define MCI_GPM_COEX_MAJOR_VERSION_WLAN 3 298c2ecf20Sopenharmony_ci#define MCI_GPM_COEX_MINOR_VERSION_WLAN 0 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_cienum mci_gpm_coex_query_type { 328c2ecf20Sopenharmony_ci MCI_GPM_COEX_QUERY_BT_ALL_INFO = BIT(0), 338c2ecf20Sopenharmony_ci MCI_GPM_COEX_QUERY_BT_TOPOLOGY = BIT(1), 348c2ecf20Sopenharmony_ci MCI_GPM_COEX_QUERY_BT_DEBUG = BIT(2), 358c2ecf20Sopenharmony_ci}; 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_cienum mci_gpm_coex_halt_bt_gpm { 388c2ecf20Sopenharmony_ci MCI_GPM_COEX_BT_GPM_UNHALT, 398c2ecf20Sopenharmony_ci MCI_GPM_COEX_BT_GPM_HALT 408c2ecf20Sopenharmony_ci}; 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_cienum mci_gpm_coex_bt_update_flags_op { 438c2ecf20Sopenharmony_ci MCI_GPM_COEX_BT_FLAGS_READ, 448c2ecf20Sopenharmony_ci MCI_GPM_COEX_BT_FLAGS_SET, 458c2ecf20Sopenharmony_ci MCI_GPM_COEX_BT_FLAGS_CLEAR 468c2ecf20Sopenharmony_ci}; 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci#define MCI_NUM_BT_CHANNELS 79 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ci#define MCI_BT_MCI_FLAGS_UPDATE_CORR 0x00000002 518c2ecf20Sopenharmony_ci#define MCI_BT_MCI_FLAGS_UPDATE_HDR 0x00000004 528c2ecf20Sopenharmony_ci#define MCI_BT_MCI_FLAGS_UPDATE_PLD 0x00000008 538c2ecf20Sopenharmony_ci#define MCI_BT_MCI_FLAGS_LNA_CTRL 0x00000010 548c2ecf20Sopenharmony_ci#define MCI_BT_MCI_FLAGS_DEBUG 0x00000020 558c2ecf20Sopenharmony_ci#define MCI_BT_MCI_FLAGS_SCHED_MSG 0x00000040 568c2ecf20Sopenharmony_ci#define MCI_BT_MCI_FLAGS_CONT_MSG 0x00000080 578c2ecf20Sopenharmony_ci#define MCI_BT_MCI_FLAGS_COEX_GPM 0x00000100 588c2ecf20Sopenharmony_ci#define MCI_BT_MCI_FLAGS_CPU_INT_MSG 0x00000200 598c2ecf20Sopenharmony_ci#define MCI_BT_MCI_FLAGS_MCI_MODE 0x00000400 608c2ecf20Sopenharmony_ci#define MCI_BT_MCI_FLAGS_AR9462_MODE 0x00001000 618c2ecf20Sopenharmony_ci#define MCI_BT_MCI_FLAGS_OTHER 0x00010000 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci#define MCI_DEFAULT_BT_MCI_FLAGS 0x00011dde 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ci#define MCI_TOGGLE_BT_MCI_FLAGS (MCI_BT_MCI_FLAGS_UPDATE_CORR | \ 668c2ecf20Sopenharmony_ci MCI_BT_MCI_FLAGS_UPDATE_HDR | \ 678c2ecf20Sopenharmony_ci MCI_BT_MCI_FLAGS_UPDATE_PLD | \ 688c2ecf20Sopenharmony_ci MCI_BT_MCI_FLAGS_MCI_MODE) 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ci#define MCI_2G_FLAGS_CLEAR_MASK 0x00000000 718c2ecf20Sopenharmony_ci#define MCI_2G_FLAGS_SET_MASK MCI_TOGGLE_BT_MCI_FLAGS 728c2ecf20Sopenharmony_ci#define MCI_2G_FLAGS MCI_DEFAULT_BT_MCI_FLAGS 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci#define MCI_5G_FLAGS_CLEAR_MASK MCI_TOGGLE_BT_MCI_FLAGS 758c2ecf20Sopenharmony_ci#define MCI_5G_FLAGS_SET_MASK 0x00000000 768c2ecf20Sopenharmony_ci#define MCI_5G_FLAGS (MCI_DEFAULT_BT_MCI_FLAGS & \ 778c2ecf20Sopenharmony_ci ~MCI_TOGGLE_BT_MCI_FLAGS) 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ci/* 808c2ecf20Sopenharmony_ci * Default value for AR9462 is 0x00002201 818c2ecf20Sopenharmony_ci */ 828c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_CONCUR_TX 0x00000003 838c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_MCI_OBS_MCI 0x00000004 848c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_MCI_OBS_TXRX 0x00000008 858c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_MCI_OBS_BT 0x00000010 868c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_DISABLE_MCI_CAL 0x00000020 878c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_DISABLE_OSLA 0x00000040 888c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_DISABLE_FTP_STOMP 0x00000080 898c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_AGGR_THRESH 0x00000700 908c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_AGGR_THRESH_S 8 918c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_DISABLE_AGGR_THRESH 0x00000800 928c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_CLK_DIV 0x00003000 938c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_CLK_DIV_S 12 948c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_DISABLE_TUNING 0x00004000 958c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_DISABLE_AIC 0x00008000 968c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_AIC_CAL_NUM_CHAN 0x007f0000 978c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_AIC_CAL_NUM_CHAN_S 16 988c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_NO_QUIET_ACK 0x00800000 998c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_NO_QUIET_ACK_S 23 1008c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_ANT_ARCH 0x07000000 1018c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_ANT_ARCH_S 24 1028c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_FORCE_QUIET_ACK 0x08000000 1038c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_FORCE_QUIET_ACK_S 27 1048c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_FORCE_2CHAIN_ACK 0x10000000 1058c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_MCI_STAT_DBG 0x20000000 1068c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_MCI_WEIGHT_DBG 0x40000000 1078c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_DISABLE_MCI 0x80000000 1088c2ecf20Sopenharmony_ci 1098c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_MCI_OBS_MASK (ATH_MCI_CONFIG_MCI_OBS_MCI | \ 1108c2ecf20Sopenharmony_ci ATH_MCI_CONFIG_MCI_OBS_TXRX | \ 1118c2ecf20Sopenharmony_ci ATH_MCI_CONFIG_MCI_OBS_BT) 1128c2ecf20Sopenharmony_ci 1138c2ecf20Sopenharmony_ci#define ATH_MCI_CONFIG_MCI_OBS_GPIO 0x0000002F 1148c2ecf20Sopenharmony_ci 1158c2ecf20Sopenharmony_ci#define ATH_MCI_ANT_ARCH_1_ANT_PA_LNA_NON_SHARED 0x00 1168c2ecf20Sopenharmony_ci#define ATH_MCI_ANT_ARCH_1_ANT_PA_LNA_SHARED 0x01 1178c2ecf20Sopenharmony_ci#define ATH_MCI_ANT_ARCH_2_ANT_PA_LNA_NON_SHARED 0x02 1188c2ecf20Sopenharmony_ci#define ATH_MCI_ANT_ARCH_2_ANT_PA_LNA_SHARED 0x03 1198c2ecf20Sopenharmony_ci#define ATH_MCI_ANT_ARCH_3_ANT 0x04 1208c2ecf20Sopenharmony_ci 1218c2ecf20Sopenharmony_ci#define MCI_ANT_ARCH_PA_LNA_SHARED(mci) \ 1228c2ecf20Sopenharmony_ci ((MS(mci->config, ATH_MCI_CONFIG_ANT_ARCH) == ATH_MCI_ANT_ARCH_1_ANT_PA_LNA_SHARED) || \ 1238c2ecf20Sopenharmony_ci (MS(mci->config, ATH_MCI_CONFIG_ANT_ARCH) == ATH_MCI_ANT_ARCH_2_ANT_PA_LNA_SHARED)) 1248c2ecf20Sopenharmony_ci 1258c2ecf20Sopenharmony_cienum mci_message_header { /* length of payload */ 1268c2ecf20Sopenharmony_ci MCI_LNA_CTRL = 0x10, /* len = 0 */ 1278c2ecf20Sopenharmony_ci MCI_CONT_NACK = 0x20, /* len = 0 */ 1288c2ecf20Sopenharmony_ci MCI_CONT_INFO = 0x30, /* len = 4 */ 1298c2ecf20Sopenharmony_ci MCI_CONT_RST = 0x40, /* len = 0 */ 1308c2ecf20Sopenharmony_ci MCI_SCHD_INFO = 0x50, /* len = 16 */ 1318c2ecf20Sopenharmony_ci MCI_CPU_INT = 0x60, /* len = 4 */ 1328c2ecf20Sopenharmony_ci MCI_SYS_WAKING = 0x70, /* len = 0 */ 1338c2ecf20Sopenharmony_ci MCI_GPM = 0x80, /* len = 16 */ 1348c2ecf20Sopenharmony_ci MCI_LNA_INFO = 0x90, /* len = 1 */ 1358c2ecf20Sopenharmony_ci MCI_LNA_STATE = 0x94, 1368c2ecf20Sopenharmony_ci MCI_LNA_TAKE = 0x98, 1378c2ecf20Sopenharmony_ci MCI_LNA_TRANS = 0x9c, 1388c2ecf20Sopenharmony_ci MCI_SYS_SLEEPING = 0xa0, /* len = 0 */ 1398c2ecf20Sopenharmony_ci MCI_REQ_WAKE = 0xc0, /* len = 0 */ 1408c2ecf20Sopenharmony_ci MCI_DEBUG_16 = 0xfe, /* len = 2 */ 1418c2ecf20Sopenharmony_ci MCI_REMOTE_RESET = 0xff /* len = 16 */ 1428c2ecf20Sopenharmony_ci}; 1438c2ecf20Sopenharmony_ci 1448c2ecf20Sopenharmony_cienum ath_mci_gpm_coex_profile_type { 1458c2ecf20Sopenharmony_ci MCI_GPM_COEX_PROFILE_UNKNOWN, 1468c2ecf20Sopenharmony_ci MCI_GPM_COEX_PROFILE_RFCOMM, 1478c2ecf20Sopenharmony_ci MCI_GPM_COEX_PROFILE_A2DP, 1488c2ecf20Sopenharmony_ci MCI_GPM_COEX_PROFILE_HID, 1498c2ecf20Sopenharmony_ci MCI_GPM_COEX_PROFILE_BNEP, 1508c2ecf20Sopenharmony_ci MCI_GPM_COEX_PROFILE_VOICE, 1518c2ecf20Sopenharmony_ci MCI_GPM_COEX_PROFILE_A2DPVO, 1528c2ecf20Sopenharmony_ci MCI_GPM_COEX_PROFILE_MAX 1538c2ecf20Sopenharmony_ci}; 1548c2ecf20Sopenharmony_ci 1558c2ecf20Sopenharmony_ci/* MCI GPM/Coex opcode/type definitions */ 1568c2ecf20Sopenharmony_cienum { 1578c2ecf20Sopenharmony_ci MCI_GPM_COEX_W_GPM_PAYLOAD = 1, 1588c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_GPM_TYPE = 4, 1598c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_GPM_OPCODE = 5, 1608c2ecf20Sopenharmony_ci /* MCI_GPM_WLAN_CAL_REQ, MCI_GPM_WLAN_CAL_DONE */ 1618c2ecf20Sopenharmony_ci MCI_GPM_WLAN_CAL_W_SEQUENCE = 2, 1628c2ecf20Sopenharmony_ci 1638c2ecf20Sopenharmony_ci /* MCI_GPM_COEX_VERSION_QUERY */ 1648c2ecf20Sopenharmony_ci /* MCI_GPM_COEX_VERSION_RESPONSE */ 1658c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_MAJOR_VERSION = 6, 1668c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_MINOR_VERSION = 7, 1678c2ecf20Sopenharmony_ci /* MCI_GPM_COEX_STATUS_QUERY */ 1688c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_BT_BITMAP = 6, 1698c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_WLAN_BITMAP = 7, 1708c2ecf20Sopenharmony_ci /* MCI_GPM_COEX_HALT_BT_GPM */ 1718c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_HALT_STATE = 6, 1728c2ecf20Sopenharmony_ci /* MCI_GPM_COEX_WLAN_CHANNELS */ 1738c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_CHANNEL_MAP = 6, 1748c2ecf20Sopenharmony_ci /* MCI_GPM_COEX_BT_PROFILE_INFO */ 1758c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_PROFILE_TYPE = 6, 1768c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_PROFILE_LINKID = 7, 1778c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_PROFILE_STATE = 8, 1788c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_PROFILE_ROLE = 9, 1798c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_PROFILE_RATE = 10, 1808c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_PROFILE_VOTYPE = 11, 1818c2ecf20Sopenharmony_ci MCI_GPM_COEX_H_PROFILE_T = 12, 1828c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_PROFILE_W = 14, 1838c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_PROFILE_A = 15, 1848c2ecf20Sopenharmony_ci /* MCI_GPM_COEX_BT_STATUS_UPDATE */ 1858c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_STATUS_TYPE = 6, 1868c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_STATUS_LINKID = 7, 1878c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_STATUS_STATE = 8, 1888c2ecf20Sopenharmony_ci /* MCI_GPM_COEX_BT_UPDATE_FLAGS */ 1898c2ecf20Sopenharmony_ci MCI_GPM_COEX_W_BT_FLAGS = 6, 1908c2ecf20Sopenharmony_ci MCI_GPM_COEX_B_BT_FLAGS_OP = 10 1918c2ecf20Sopenharmony_ci}; 1928c2ecf20Sopenharmony_ci 1938c2ecf20Sopenharmony_cienum mci_gpm_subtype { 1948c2ecf20Sopenharmony_ci MCI_GPM_BT_CAL_REQ = 0, 1958c2ecf20Sopenharmony_ci MCI_GPM_BT_CAL_GRANT = 1, 1968c2ecf20Sopenharmony_ci MCI_GPM_BT_CAL_DONE = 2, 1978c2ecf20Sopenharmony_ci MCI_GPM_WLAN_CAL_REQ = 3, 1988c2ecf20Sopenharmony_ci MCI_GPM_WLAN_CAL_GRANT = 4, 1998c2ecf20Sopenharmony_ci MCI_GPM_WLAN_CAL_DONE = 5, 2008c2ecf20Sopenharmony_ci MCI_GPM_COEX_AGENT = 0x0c, 2018c2ecf20Sopenharmony_ci MCI_GPM_RSVD_PATTERN = 0xfe, 2028c2ecf20Sopenharmony_ci MCI_GPM_RSVD_PATTERN32 = 0xfefefefe, 2038c2ecf20Sopenharmony_ci MCI_GPM_BT_DEBUG = 0xff 2048c2ecf20Sopenharmony_ci}; 2058c2ecf20Sopenharmony_ci 2068c2ecf20Sopenharmony_cienum mci_bt_state { 2078c2ecf20Sopenharmony_ci MCI_BT_SLEEP, 2088c2ecf20Sopenharmony_ci MCI_BT_AWAKE, 2098c2ecf20Sopenharmony_ci MCI_BT_CAL_START, 2108c2ecf20Sopenharmony_ci MCI_BT_CAL 2118c2ecf20Sopenharmony_ci}; 2128c2ecf20Sopenharmony_ci 2138c2ecf20Sopenharmony_cienum mci_ps_state { 2148c2ecf20Sopenharmony_ci MCI_PS_DISABLE, 2158c2ecf20Sopenharmony_ci MCI_PS_ENABLE, 2168c2ecf20Sopenharmony_ci MCI_PS_ENABLE_OFF, 2178c2ecf20Sopenharmony_ci MCI_PS_ENABLE_ON 2188c2ecf20Sopenharmony_ci}; 2198c2ecf20Sopenharmony_ci 2208c2ecf20Sopenharmony_ci/* Type of state query */ 2218c2ecf20Sopenharmony_cienum mci_state_type { 2228c2ecf20Sopenharmony_ci MCI_STATE_ENABLE, 2238c2ecf20Sopenharmony_ci MCI_STATE_INIT_GPM_OFFSET, 2248c2ecf20Sopenharmony_ci MCI_STATE_CHECK_GPM_OFFSET, 2258c2ecf20Sopenharmony_ci MCI_STATE_NEXT_GPM_OFFSET, 2268c2ecf20Sopenharmony_ci MCI_STATE_LAST_GPM_OFFSET, 2278c2ecf20Sopenharmony_ci MCI_STATE_BT, 2288c2ecf20Sopenharmony_ci MCI_STATE_SET_BT_SLEEP, 2298c2ecf20Sopenharmony_ci MCI_STATE_SET_BT_AWAKE, 2308c2ecf20Sopenharmony_ci MCI_STATE_SET_BT_CAL_START, 2318c2ecf20Sopenharmony_ci MCI_STATE_SET_BT_CAL, 2328c2ecf20Sopenharmony_ci MCI_STATE_LAST_SCHD_MSG_OFFSET, 2338c2ecf20Sopenharmony_ci MCI_STATE_REMOTE_SLEEP, 2348c2ecf20Sopenharmony_ci MCI_STATE_CONT_STATUS, 2358c2ecf20Sopenharmony_ci MCI_STATE_RESET_REQ_WAKE, 2368c2ecf20Sopenharmony_ci MCI_STATE_SEND_WLAN_COEX_VERSION, 2378c2ecf20Sopenharmony_ci MCI_STATE_SET_BT_COEX_VERSION, 2388c2ecf20Sopenharmony_ci MCI_STATE_SEND_WLAN_CHANNELS, 2398c2ecf20Sopenharmony_ci MCI_STATE_SEND_VERSION_QUERY, 2408c2ecf20Sopenharmony_ci MCI_STATE_SEND_STATUS_QUERY, 2418c2ecf20Sopenharmony_ci MCI_STATE_NEED_FLUSH_BT_INFO, 2428c2ecf20Sopenharmony_ci MCI_STATE_SET_CONCUR_TX_PRI, 2438c2ecf20Sopenharmony_ci MCI_STATE_RECOVER_RX, 2448c2ecf20Sopenharmony_ci MCI_STATE_NEED_FTP_STOMP, 2458c2ecf20Sopenharmony_ci MCI_STATE_NEED_TUNING, 2468c2ecf20Sopenharmony_ci MCI_STATE_NEED_STAT_DEBUG, 2478c2ecf20Sopenharmony_ci MCI_STATE_SHARED_CHAIN_CONCUR_TX, 2488c2ecf20Sopenharmony_ci MCI_STATE_AIC_CAL, 2498c2ecf20Sopenharmony_ci MCI_STATE_AIC_START, 2508c2ecf20Sopenharmony_ci MCI_STATE_AIC_CAL_RESET, 2518c2ecf20Sopenharmony_ci MCI_STATE_AIC_CAL_SINGLE, 2528c2ecf20Sopenharmony_ci MCI_STATE_IS_AR9462, 2538c2ecf20Sopenharmony_ci MCI_STATE_IS_AR9565_1ANT, 2548c2ecf20Sopenharmony_ci MCI_STATE_IS_AR9565_2ANT, 2558c2ecf20Sopenharmony_ci MCI_STATE_WLAN_WEAK_SIGNAL, 2568c2ecf20Sopenharmony_ci MCI_STATE_SET_WLAN_PS_STATE, 2578c2ecf20Sopenharmony_ci MCI_STATE_GET_WLAN_PS_STATE, 2588c2ecf20Sopenharmony_ci MCI_STATE_DEBUG, 2598c2ecf20Sopenharmony_ci MCI_STATE_STAT_DEBUG, 2608c2ecf20Sopenharmony_ci MCI_STATE_ALLOW_FCS, 2618c2ecf20Sopenharmony_ci MCI_STATE_SET_2G_CONTENTION, 2628c2ecf20Sopenharmony_ci MCI_STATE_MAX 2638c2ecf20Sopenharmony_ci}; 2648c2ecf20Sopenharmony_ci 2658c2ecf20Sopenharmony_cienum mci_gpm_coex_opcode { 2668c2ecf20Sopenharmony_ci MCI_GPM_COEX_VERSION_QUERY, 2678c2ecf20Sopenharmony_ci MCI_GPM_COEX_VERSION_RESPONSE, 2688c2ecf20Sopenharmony_ci MCI_GPM_COEX_STATUS_QUERY, 2698c2ecf20Sopenharmony_ci MCI_GPM_COEX_HALT_BT_GPM, 2708c2ecf20Sopenharmony_ci MCI_GPM_COEX_WLAN_CHANNELS, 2718c2ecf20Sopenharmony_ci MCI_GPM_COEX_BT_PROFILE_INFO, 2728c2ecf20Sopenharmony_ci MCI_GPM_COEX_BT_STATUS_UPDATE, 2738c2ecf20Sopenharmony_ci MCI_GPM_COEX_BT_UPDATE_FLAGS, 2748c2ecf20Sopenharmony_ci MCI_GPM_COEX_NOOP, 2758c2ecf20Sopenharmony_ci}; 2768c2ecf20Sopenharmony_ci 2778c2ecf20Sopenharmony_ci#define MCI_GPM_NOMORE 0 2788c2ecf20Sopenharmony_ci#define MCI_GPM_MORE 1 2798c2ecf20Sopenharmony_ci#define MCI_GPM_INVALID 0xffffffff 2808c2ecf20Sopenharmony_ci 2818c2ecf20Sopenharmony_ci#define MCI_GPM_RECYCLE(_p_gpm) do { \ 2828c2ecf20Sopenharmony_ci *(((u32 *)_p_gpm) + MCI_GPM_COEX_W_GPM_PAYLOAD) = \ 2838c2ecf20Sopenharmony_ci MCI_GPM_RSVD_PATTERN32; \ 2848c2ecf20Sopenharmony_ci} while (0) 2858c2ecf20Sopenharmony_ci 2868c2ecf20Sopenharmony_ci#define MCI_GPM_TYPE(_p_gpm) \ 2878c2ecf20Sopenharmony_ci (*(((u8 *)(_p_gpm)) + MCI_GPM_COEX_B_GPM_TYPE) & 0xff) 2888c2ecf20Sopenharmony_ci 2898c2ecf20Sopenharmony_ci#define MCI_GPM_OPCODE(_p_gpm) \ 2908c2ecf20Sopenharmony_ci (*(((u8 *)(_p_gpm)) + MCI_GPM_COEX_B_GPM_OPCODE) & 0xff) 2918c2ecf20Sopenharmony_ci 2928c2ecf20Sopenharmony_ci#define MCI_GPM_SET_CAL_TYPE(_p_gpm, _cal_type) do { \ 2938c2ecf20Sopenharmony_ci *(((u8 *)(_p_gpm)) + MCI_GPM_COEX_B_GPM_TYPE) = (_cal_type) & 0xff;\ 2948c2ecf20Sopenharmony_ci} while (0) 2958c2ecf20Sopenharmony_ci 2968c2ecf20Sopenharmony_ci#define MCI_GPM_SET_TYPE_OPCODE(_p_gpm, _type, _opcode) do { \ 2978c2ecf20Sopenharmony_ci *(((u8 *)(_p_gpm)) + MCI_GPM_COEX_B_GPM_TYPE) = (_type) & 0xff; \ 2988c2ecf20Sopenharmony_ci *(((u8 *)(_p_gpm)) + MCI_GPM_COEX_B_GPM_OPCODE) = (_opcode) & 0xff;\ 2998c2ecf20Sopenharmony_ci} while (0) 3008c2ecf20Sopenharmony_ci 3018c2ecf20Sopenharmony_ci#define MCI_GPM_IS_CAL_TYPE(_type) ((_type) <= MCI_GPM_WLAN_CAL_DONE) 3028c2ecf20Sopenharmony_ci 3038c2ecf20Sopenharmony_ci/* 3048c2ecf20Sopenharmony_ci * Functions that are available to the MCI driver core. 3058c2ecf20Sopenharmony_ci */ 3068c2ecf20Sopenharmony_cibool ar9003_mci_send_message(struct ath_hw *ah, u8 header, u32 flag, 3078c2ecf20Sopenharmony_ci u32 *payload, u8 len, bool wait_done, 3088c2ecf20Sopenharmony_ci bool check_bt); 3098c2ecf20Sopenharmony_ciu32 ar9003_mci_state(struct ath_hw *ah, u32 state_type); 3108c2ecf20Sopenharmony_ciint ar9003_mci_setup(struct ath_hw *ah, u32 gpm_addr, void *gpm_buf, 3118c2ecf20Sopenharmony_ci u16 len, u32 sched_addr); 3128c2ecf20Sopenharmony_civoid ar9003_mci_cleanup(struct ath_hw *ah); 3138c2ecf20Sopenharmony_civoid ar9003_mci_get_interrupt(struct ath_hw *ah, u32 *raw_intr, 3148c2ecf20Sopenharmony_ci u32 *rx_msg_intr); 3158c2ecf20Sopenharmony_ciu32 ar9003_mci_get_next_gpm_offset(struct ath_hw *ah, u32 *more); 3168c2ecf20Sopenharmony_civoid ar9003_mci_set_bt_version(struct ath_hw *ah, u8 major, u8 minor); 3178c2ecf20Sopenharmony_civoid ar9003_mci_send_wlan_channels(struct ath_hw *ah); 3188c2ecf20Sopenharmony_ci/* 3198c2ecf20Sopenharmony_ci * These functions are used by ath9k_hw. 3208c2ecf20Sopenharmony_ci */ 3218c2ecf20Sopenharmony_ci 3228c2ecf20Sopenharmony_ci#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT 3238c2ecf20Sopenharmony_ci 3248c2ecf20Sopenharmony_civoid ar9003_mci_stop_bt(struct ath_hw *ah, bool save_fullsleep); 3258c2ecf20Sopenharmony_civoid ar9003_mci_init_cal_req(struct ath_hw *ah, bool *is_reusable); 3268c2ecf20Sopenharmony_civoid ar9003_mci_init_cal_done(struct ath_hw *ah); 3278c2ecf20Sopenharmony_civoid ar9003_mci_set_full_sleep(struct ath_hw *ah); 3288c2ecf20Sopenharmony_civoid ar9003_mci_2g5g_switch(struct ath_hw *ah, bool force); 3298c2ecf20Sopenharmony_civoid ar9003_mci_check_bt(struct ath_hw *ah); 3308c2ecf20Sopenharmony_cibool ar9003_mci_start_reset(struct ath_hw *ah, struct ath9k_channel *chan); 3318c2ecf20Sopenharmony_ciint ar9003_mci_end_reset(struct ath_hw *ah, struct ath9k_channel *chan, 3328c2ecf20Sopenharmony_ci struct ath9k_hw_cal_data *caldata); 3338c2ecf20Sopenharmony_ciint ar9003_mci_reset(struct ath_hw *ah, bool en_int, bool is_2g, 3348c2ecf20Sopenharmony_ci bool is_full_sleep); 3358c2ecf20Sopenharmony_civoid ar9003_mci_get_isr(struct ath_hw *ah, enum ath9k_int *masked); 3368c2ecf20Sopenharmony_civoid ar9003_mci_bt_gain_ctrl(struct ath_hw *ah); 3378c2ecf20Sopenharmony_civoid ar9003_mci_set_power_awake(struct ath_hw *ah); 3388c2ecf20Sopenharmony_civoid ar9003_mci_check_gpm_offset(struct ath_hw *ah); 3398c2ecf20Sopenharmony_ciu16 ar9003_mci_get_max_txpower(struct ath_hw *ah, u8 ctlmode); 3408c2ecf20Sopenharmony_ci 3418c2ecf20Sopenharmony_ci#else 3428c2ecf20Sopenharmony_ci 3438c2ecf20Sopenharmony_cistatic inline void ar9003_mci_stop_bt(struct ath_hw *ah, bool save_fullsleep) 3448c2ecf20Sopenharmony_ci{ 3458c2ecf20Sopenharmony_ci} 3468c2ecf20Sopenharmony_cistatic inline void ar9003_mci_init_cal_req(struct ath_hw *ah, bool *is_reusable) 3478c2ecf20Sopenharmony_ci{ 3488c2ecf20Sopenharmony_ci} 3498c2ecf20Sopenharmony_cistatic inline void ar9003_mci_init_cal_done(struct ath_hw *ah) 3508c2ecf20Sopenharmony_ci{ 3518c2ecf20Sopenharmony_ci} 3528c2ecf20Sopenharmony_cistatic inline void ar9003_mci_set_full_sleep(struct ath_hw *ah) 3538c2ecf20Sopenharmony_ci{ 3548c2ecf20Sopenharmony_ci} 3558c2ecf20Sopenharmony_cistatic inline void ar9003_mci_2g5g_switch(struct ath_hw *ah, bool wait_done) 3568c2ecf20Sopenharmony_ci{ 3578c2ecf20Sopenharmony_ci} 3588c2ecf20Sopenharmony_cistatic inline void ar9003_mci_check_bt(struct ath_hw *ah) 3598c2ecf20Sopenharmony_ci{ 3608c2ecf20Sopenharmony_ci} 3618c2ecf20Sopenharmony_cistatic inline bool ar9003_mci_start_reset(struct ath_hw *ah, struct ath9k_channel *chan) 3628c2ecf20Sopenharmony_ci{ 3638c2ecf20Sopenharmony_ci return false; 3648c2ecf20Sopenharmony_ci} 3658c2ecf20Sopenharmony_cistatic inline int ar9003_mci_end_reset(struct ath_hw *ah, struct ath9k_channel *chan, 3668c2ecf20Sopenharmony_ci struct ath9k_hw_cal_data *caldata) 3678c2ecf20Sopenharmony_ci{ 3688c2ecf20Sopenharmony_ci return 0; 3698c2ecf20Sopenharmony_ci} 3708c2ecf20Sopenharmony_cistatic inline void ar9003_mci_reset(struct ath_hw *ah, bool en_int, bool is_2g, 3718c2ecf20Sopenharmony_ci bool is_full_sleep) 3728c2ecf20Sopenharmony_ci{ 3738c2ecf20Sopenharmony_ci} 3748c2ecf20Sopenharmony_cistatic inline void ar9003_mci_get_isr(struct ath_hw *ah, enum ath9k_int *masked) 3758c2ecf20Sopenharmony_ci{ 3768c2ecf20Sopenharmony_ci} 3778c2ecf20Sopenharmony_cistatic inline void ar9003_mci_bt_gain_ctrl(struct ath_hw *ah) 3788c2ecf20Sopenharmony_ci{ 3798c2ecf20Sopenharmony_ci} 3808c2ecf20Sopenharmony_cistatic inline void ar9003_mci_set_power_awake(struct ath_hw *ah) 3818c2ecf20Sopenharmony_ci{ 3828c2ecf20Sopenharmony_ci} 3838c2ecf20Sopenharmony_cistatic inline void ar9003_mci_check_gpm_offset(struct ath_hw *ah) 3848c2ecf20Sopenharmony_ci{ 3858c2ecf20Sopenharmony_ci} 3868c2ecf20Sopenharmony_cistatic inline u16 ar9003_mci_get_max_txpower(struct ath_hw *ah, u8 ctlmode) 3878c2ecf20Sopenharmony_ci{ 3888c2ecf20Sopenharmony_ci return -1; 3898c2ecf20Sopenharmony_ci} 3908c2ecf20Sopenharmony_ci#endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */ 3918c2ecf20Sopenharmony_ci 3928c2ecf20Sopenharmony_ci#endif 393