hal_btc.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2009-2012 Realtek Corporation.
  4. *
  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.
  8. *
  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
  12. * more details.
  13. *
  14. * The full GNU General Public License is included in this distribution in the
  15. * file called LICENSE.
  16. *
  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>
  22. *
  23. *****************************************************************************/
  24. #ifndef __RTL8723E_HAL_BTC_H__
  25. #define __RTL8723E_HAL_BTC_H__
  26. #include "../wifi.h"
  27. #include "btc.h"
  28. #include "hal_bt_coexist.h"
  29. #define BT_TXRX_CNT_THRES_1 1200
  30. #define BT_TXRX_CNT_THRES_2 1400
  31. #define BT_TXRX_CNT_THRES_3 3000
  32. /* < 1200 */
  33. #define BT_TXRX_CNT_LEVEL_0 0
  34. /* >= 1200 && < 1400 */
  35. #define BT_TXRX_CNT_LEVEL_1 1
  36. /* >= 1400 */
  37. #define BT_TXRX_CNT_LEVEL_2 2
  38. #define BT_TXRX_CNT_LEVEL_3 3
  39. #define BT_COEX_DISABLE 0
  40. #define BT_Q_PKT_OFF 0
  41. #define BT_Q_PKT_ON 1
  42. #define BT_TX_PWR_OFF 0
  43. #define BT_TX_PWR_ON 1
  44. /* TDMA mode definition */
  45. #define TDMA_2ANT 0
  46. #define TDMA_1ANT 1
  47. #define TDMA_NAV_OFF 0
  48. #define TDMA_NAV_ON 1
  49. #define TDMA_DAC_SWING_OFF 0
  50. #define TDMA_DAC_SWING_ON 1
  51. /* PTA mode related definition */
  52. #define BT_PTA_MODE_OFF 0
  53. #define BT_PTA_MODE_ON 1
  54. /* Penalty Tx Rate Adaptive */
  55. #define BT_TX_RATE_ADAPTIVE_NORMAL 0
  56. #define BT_TX_RATE_ADAPTIVE_LOW_PENALTY 1
  57. /* RF Corner */
  58. #define BT_RF_RX_LPF_CORNER_RESUME 0
  59. #define BT_RF_RX_LPF_CORNER_SHRINK 1
  60. #define C2H_EVT_HOST_CLOSE 0x00
  61. #define C2H_EVT_FW_CLOSE 0xFF
  62. enum bt_traffic_mode {
  63. BT_MOTOR_EXT_BE = 0x00,
  64. BT_MOTOR_EXT_GUL = 0x01,
  65. BT_MOTOR_EXT_GUB = 0x02,
  66. BT_MOTOR_EXT_GULB = 0x03
  67. };
  68. enum bt_traffic_mode_profile {
  69. BT_PROFILE_NONE,
  70. BT_PROFILE_A2DP,
  71. BT_PROFILE_PAN,
  72. BT_PROFILE_HID,
  73. BT_PROFILE_SCO
  74. };
  75. /*
  76. enum hci_ext_bt_operation {
  77. HCI_BT_OP_NONE = 0x0,
  78. HCI_BT_OP_INQUIRE_START = 0x1,
  79. HCI_BT_OP_INQUIRE_FINISH = 0x2,
  80. HCI_BT_OP_PAGING_START = 0x3,
  81. HCI_BT_OP_PAGING_SUCCESS = 0x4,
  82. HCI_BT_OP_PAGING_UNSUCCESS = 0x5,
  83. HCI_BT_OP_PAIRING_START = 0x6,
  84. HCI_BT_OP_PAIRING_FINISH = 0x7,
  85. HCI_BT_OP_BT_DEV_ENABLE = 0x8,
  86. HCI_BT_OP_BT_DEV_DISABLE = 0x9,
  87. HCI_BT_OP_MAX,
  88. };
  89. */
  90. enum bt_spec {
  91. BT_SPEC_1_0_b = 0x00,
  92. BT_SPEC_1_1 = 0x01,
  93. BT_SPEC_1_2 = 0x02,
  94. BT_SPEC_2_0_EDR = 0x03,
  95. BT_SPEC_2_1_EDR = 0x04,
  96. BT_SPEC_3_0_HS = 0x05,
  97. BT_SPEC_4_0 = 0x06
  98. };
  99. struct c2h_evt_hdr {
  100. u8 cmd_id;
  101. u8 cmd_len;
  102. u8 cmd_seq;
  103. };
  104. enum bt_state {
  105. BT_INFO_STATE_DISABLED = 0,
  106. BT_INFO_STATE_NO_CONNECTION = 1,
  107. BT_INFO_STATE_CONNECT_IDLE = 2,
  108. BT_INFO_STATE_INQ_OR_PAG = 3,
  109. BT_INFO_STATE_ACL_ONLY_BUSY = 4,
  110. BT_INFO_STATE_SCO_ONLY_BUSY = 5,
  111. BT_INFO_STATE_ACL_SCO_BUSY = 6,
  112. BT_INFO_STATE_HID_BUSY = 7,
  113. BT_INFO_STATE_HID_SCO_BUSY = 8,
  114. BT_INFO_STATE_MAX = 7
  115. };
  116. enum rtl8723e_c2h_evt_v0 {
  117. C2H_V0_DBG = 0,
  118. C2H_V0_TSF = 1,
  119. C2H_V0_AP_RPT_RSP = 2,
  120. /* The FW notify the report of the specific tx packet. */
  121. C2H_V0_CCX_TX_RPT = 3,
  122. C2H_V0_BT_RSSI = 4,
  123. C2H_V0_BT_OP_MODE = 5,
  124. C2H_V0_HW_INFO_EXCH = 10,
  125. C2H_V0_C2H_H2C_TEST = 11,
  126. C2H_V0_BT_INFO = 12,
  127. MAX_C2HEVENT
  128. };
  129. void rtl8723e_dm_bt_fw_coex_all_off_8723a(struct ieee80211_hw *hw);
  130. void rtl8723e_dm_bt_sw_coex_all_off_8723a(struct ieee80211_hw *hw);
  131. void rtl8723e_dm_bt_hw_coex_all_off_8723a(struct ieee80211_hw *hw);
  132. void rtl8723e_dm_bt_coexist_8723(struct ieee80211_hw *hw);
  133. void rtl8723e_dm_bt_set_bt_dm(struct ieee80211_hw *hw,
  134. struct btdm_8723 *p_btdm);
  135. void rtl_8723e_c2h_command_handle(struct ieee80211_hw *hw);
  136. void rtl_8723e_bt_wifi_media_status_notify(struct ieee80211_hw *hw,
  137. bool mstatus);
  138. void rtl8723e_dm_bt_turn_off_bt_coexist_before_enter_lps(
  139. struct ieee80211_hw *hw);
  140. #endif