1 /******************************************************************************
3 * Copyright(c) 2009-2012 Realtek Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * The full GNU General Public License is included in this distribution in the
15 * file called LICENSE.
17 * Contact Information:
18 * wlanfae <wlanfae@realtek.com>
19 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20 * Hsinchu 300, Taiwan.
21 * Larry Finger <Larry.Finger@lwfinger.net>
23 *****************************************************************************/
25 #ifndef __RTL8723E_HAL_BTC_H__
26 #define __RTL8723E_HAL_BTC_H__
30 #include "hal_bt_coexist.h"
32 #define BT_TXRX_CNT_THRES_1 1200
33 #define BT_TXRX_CNT_THRES_2 1400
34 #define BT_TXRX_CNT_THRES_3 3000
36 #define BT_TXRX_CNT_LEVEL_0 0
37 /* >= 1200 && < 1400 */
38 #define BT_TXRX_CNT_LEVEL_1 1
40 #define BT_TXRX_CNT_LEVEL_2 2
41 #define BT_TXRX_CNT_LEVEL_3 3
43 #define BT_COEX_DISABLE 0
44 #define BT_Q_PKT_OFF 0
47 #define BT_TX_PWR_OFF 0
48 #define BT_TX_PWR_ON 1
50 /* TDMA mode definition */
53 #define TDMA_NAV_OFF 0
55 #define TDMA_DAC_SWING_OFF 0
56 #define TDMA_DAC_SWING_ON 1
58 /* PTA mode related definition */
59 #define BT_PTA_MODE_OFF 0
60 #define BT_PTA_MODE_ON 1
62 /* Penalty Tx Rate Adaptive */
63 #define BT_TX_RATE_ADAPTIVE_NORMAL 0
64 #define BT_TX_RATE_ADAPTIVE_LOW_PENALTY 1
67 #define BT_RF_RX_LPF_CORNER_RESUME 0
68 #define BT_RF_RX_LPF_CORNER_SHRINK 1
70 #define C2H_EVT_HOST_CLOSE 0x00
71 #define C2H_EVT_FW_CLOSE 0xFF
73 enum bt_traffic_mode
{
74 BT_MOTOR_EXT_BE
= 0x00,
75 BT_MOTOR_EXT_GUL
= 0x01,
76 BT_MOTOR_EXT_GUB
= 0x02,
77 BT_MOTOR_EXT_GULB
= 0x03
80 enum bt_traffic_mode_profile
{
89 enum hci_ext_bt_operation {
91 HCI_BT_OP_INQUIRE_START = 0x1,
92 HCI_BT_OP_INQUIRE_FINISH = 0x2,
93 HCI_BT_OP_PAGING_START = 0x3,
94 HCI_BT_OP_PAGING_SUCCESS = 0x4,
95 HCI_BT_OP_PAGING_UNSUCCESS = 0x5,
96 HCI_BT_OP_PAIRING_START = 0x6,
97 HCI_BT_OP_PAIRING_FINISH = 0x7,
98 HCI_BT_OP_BT_DEV_ENABLE = 0x8,
99 HCI_BT_OP_BT_DEV_DISABLE = 0x9,
105 BT_SPEC_1_0_b
= 0x00,
108 BT_SPEC_2_0_EDR
= 0x03,
109 BT_SPEC_2_1_EDR
= 0x04,
110 BT_SPEC_3_0_HS
= 0x05,
121 BT_INFO_STATE_DISABLED
= 0,
122 BT_INFO_STATE_NO_CONNECTION
= 1,
123 BT_INFO_STATE_CONNECT_IDLE
= 2,
124 BT_INFO_STATE_INQ_OR_PAG
= 3,
125 BT_INFO_STATE_ACL_ONLY_BUSY
= 4,
126 BT_INFO_STATE_SCO_ONLY_BUSY
= 5,
127 BT_INFO_STATE_ACL_SCO_BUSY
= 6,
128 BT_INFO_STATE_HID_BUSY
= 7,
129 BT_INFO_STATE_HID_SCO_BUSY
= 8,
130 BT_INFO_STATE_MAX
= 7
133 enum rtl8723e_c2h_evt
{
137 /* The FW notify the report of the specific tx packet. */
141 C2H_HW_INFO_EXCH
= 10,
142 C2H_C2H_H2C_TEST
= 11,
147 void rtl8723e_dm_bt_fw_coex_all_off_8723a(struct ieee80211_hw
*hw
);
148 void rtl8723e_dm_bt_sw_coex_all_off_8723a(struct ieee80211_hw
*hw
);
149 void rtl8723e_dm_bt_hw_coex_all_off_8723a(struct ieee80211_hw
*hw
);
150 void rtl8723e_dm_bt_coexist_8723(struct ieee80211_hw
*hw
);
151 void rtl8723e_dm_bt_set_bt_dm(struct ieee80211_hw
*hw
,
152 struct btdm_8723
*p_btdm
);
153 void rtl_8723e_c2h_command_handle(struct ieee80211_hw
*hw
);
154 void rtl_8723e_bt_wifi_media_status_notify(struct ieee80211_hw
*hw
,
156 void rtl8723e_dm_bt_turn_off_bt_coexist_before_enter_lps(
157 struct ieee80211_hw
*hw
);