Greg Kroah-Hartman | 3c05bed | 2014-01-21 11:20:45 -0800 | [diff] [blame] | 1 | //=========================================== |
| 2 | // The following is for 8812A_1ANT BT Co-exist definition |
| 3 | //=========================================== |
| 4 | #define BT_INFO_8812A_1ANT_B_FTP BIT7 |
| 5 | #define BT_INFO_8812A_1ANT_B_A2DP BIT6 |
| 6 | #define BT_INFO_8812A_1ANT_B_HID BIT5 |
| 7 | #define BT_INFO_8812A_1ANT_B_SCO_BUSY BIT4 |
| 8 | #define BT_INFO_8812A_1ANT_B_ACL_BUSY BIT3 |
| 9 | #define BT_INFO_8812A_1ANT_B_INQ_PAGE BIT2 |
| 10 | #define BT_INFO_8812A_1ANT_B_SCO_ESCO BIT1 |
| 11 | #define BT_INFO_8812A_1ANT_B_CONNECTION BIT0 |
| 12 | |
| 13 | #define BT_INFO_8812A_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \ |
| 14 | (((_BT_INFO_EXT_&BIT0))? true:false) |
| 15 | |
| 16 | #define BTC_RSSI_COEX_THRESH_TOL_8812A_1ANT 2 |
| 17 | |
| 18 | #define |
| 19 | #define OUT |
| 20 | |
| 21 | typedef enum _BT_INFO_SRC_8812A_1ANT{ |
| 22 | BT_INFO_SRC_8812A_1ANT_WIFI_FW = 0x0, |
| 23 | BT_INFO_SRC_8812A_1ANT_BT_RSP = 0x1, |
| 24 | BT_INFO_SRC_8812A_1ANT_BT_ACTIVE_SEND = 0x2, |
| 25 | BT_INFO_SRC_8812A_1ANT_MAX |
| 26 | }BT_INFO_SRC_8812A_1ANT,*PBT_INFO_SRC_8812A_1ANT; |
| 27 | |
| 28 | typedef enum _BT_8812A_1ANT_BT_STATUS{ |
| 29 | BT_8812A_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0, |
| 30 | BT_8812A_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1, |
| 31 | BT_8812A_1ANT_BT_STATUS_INQ_PAGE = 0x2, |
| 32 | BT_8812A_1ANT_BT_STATUS_ACL_BUSY = 0x3, |
| 33 | BT_8812A_1ANT_BT_STATUS_SCO_BUSY = 0x4, |
| 34 | BT_8812A_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5, |
| 35 | BT_8812A_1ANT_BT_STATUS_MAX |
| 36 | }BT_8812A_1ANT_BT_STATUS,*PBT_8812A_1ANT_BT_STATUS; |
| 37 | |
| 38 | typedef enum _BT_8812A_1ANT_COEX_ALGO{ |
| 39 | BT_8812A_1ANT_COEX_ALGO_UNDEFINED = 0x0, |
| 40 | BT_8812A_1ANT_COEX_ALGO_SCO = 0x1, |
| 41 | BT_8812A_1ANT_COEX_ALGO_HID = 0x2, |
| 42 | BT_8812A_1ANT_COEX_ALGO_A2DP = 0x3, |
| 43 | BT_8812A_1ANT_COEX_ALGO_A2DP_PANHS = 0x4, |
| 44 | BT_8812A_1ANT_COEX_ALGO_PANEDR = 0x5, |
| 45 | BT_8812A_1ANT_COEX_ALGO_PANHS = 0x6, |
| 46 | BT_8812A_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7, |
| 47 | BT_8812A_1ANT_COEX_ALGO_PANEDR_HID = 0x8, |
| 48 | BT_8812A_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9, |
| 49 | BT_8812A_1ANT_COEX_ALGO_HID_A2DP = 0xa, |
| 50 | BT_8812A_1ANT_COEX_ALGO_MAX = 0xb, |
| 51 | }BT_8812A_1ANT_COEX_ALGO,*PBT_8812A_1ANT_COEX_ALGO; |
| 52 | |
| 53 | typedef struct _COEX_DM_8812A_1ANT{ |
| 54 | // fw mechanism |
| 55 | bool pre_dec_bt_pwr; |
| 56 | bool cur_dec_bt_pwr; |
| 57 | bool bPreBtLnaConstrain; |
| 58 | bool bCurBtLnaConstrain; |
| 59 | u8 bPreBtPsdMode; |
| 60 | u8 bCurBtPsdMode; |
| 61 | u8 pre_fw_dac_swing_lvl; |
| 62 | u8 cur_fw_dac_swing_lvl; |
| 63 | bool cur_ignore_wlan_act; |
| 64 | bool pre_ignore_wlan_act; |
| 65 | u8 pre_ps_tdma; |
| 66 | u8 cur_ps_tdma; |
| 67 | u8 ps_tdma_para[5]; |
| 68 | u8 ps_tdma_du_adj_type; |
| 69 | bool reset_tdma_adjust; |
| 70 | bool pre_ps_tdma_on; |
| 71 | bool cur_ps_tdma_on; |
| 72 | bool pre_bt_auto_report; |
| 73 | bool cur_bt_auto_report; |
| 74 | u8 pre_lps; |
| 75 | u8 cur_lps; |
| 76 | u8 pre_rpwm; |
| 77 | u8 cur_rpwm; |
| 78 | |
| 79 | // sw mechanism |
| 80 | bool pre_rf_rx_lpf_shrink; |
| 81 | bool cur_rf_rx_lpf_shrink; |
| 82 | u32 bt_rf0x1e_backup; |
| 83 | bool pre_low_penalty_ra; |
| 84 | bool cur_low_penalty_ra; |
| 85 | bool pre_dac_swing_on; |
| 86 | u32 pre_dac_swing_lvl; |
| 87 | bool cur_dac_swing_on; |
| 88 | u32 cur_dac_swing_lvl; |
| 89 | bool pre_adc_back_off; |
| 90 | bool cur_adc_back_off; |
| 91 | bool pre_agc_table_en; |
| 92 | bool cur_agc_table_en; |
| 93 | u32 pre_val0x6c0; |
| 94 | u32 cur_val0x6c0; |
| 95 | u32 pre_val0x6c4; |
| 96 | u32 cur_val0x6c4; |
| 97 | u32 pre_val0x6c8; |
| 98 | u32 cur_val0x6c8; |
| 99 | u8 pre_val0x6cc; |
| 100 | u8 cur_val0x6cc; |
| 101 | bool limited_dig; |
| 102 | |
| 103 | // algorithm related |
| 104 | u8 pre_algorithm; |
| 105 | u8 cur_algorithm; |
| 106 | u8 bt_status; |
| 107 | u8 wifi_chnl_info[3]; |
| 108 | |
| 109 | u8 error_condition; |
| 110 | } COEX_DM_8812A_1ANT, *PCOEX_DM_8812A_1ANT; |
| 111 | |
| 112 | typedef struct _COEX_STA_8812A_1ANT{ |
| 113 | bool under_lps; |
| 114 | bool under_ips; |
| 115 | u32 high_priority_tx; |
| 116 | u32 high_priority_rx; |
| 117 | u32 low_priority_tx; |
| 118 | u32 low_priority_rx; |
| 119 | u8 bt_rssi; |
| 120 | u8 pre_bt_rssi_state; |
| 121 | u8 pre_wifi_rssi_state[4]; |
| 122 | bool c2h_bt_info_req_sent; |
| 123 | u8 bt_info_c2h[BT_INFO_SRC_8812A_1ANT_MAX][10]; |
| 124 | u32 bt_info_c2h_cnt[BT_INFO_SRC_8812A_1ANT_MAX]; |
| 125 | bool c2h_bt_inquiry_page; |
| 126 | u8 bt_retry_cnt; |
| 127 | u8 bt_info_ext; |
| 128 | }COEX_STA_8812A_1ANT, *PCOEX_STA_8812A_1ANT; |
| 129 | |
| 130 | //=========================================== |
| 131 | // The following is interface which will notify coex module. |
| 132 | //=========================================== |
| 133 | void |
| 134 | EXhalbtc8812a1ant_InitHwConfig( |
| 135 | PBTC_COEXIST btcoexist |
| 136 | ); |
| 137 | void |
| 138 | EXhalbtc8812a1ant_InitCoexDm( |
| 139 | PBTC_COEXIST btcoexist |
| 140 | ); |
| 141 | void |
| 142 | EXhalbtc8812a1ant_IpsNotify( |
| 143 | PBTC_COEXIST btcoexist, |
| 144 | u8 type |
| 145 | ); |
| 146 | void |
| 147 | EXhalbtc8812a1ant_LpsNotify( |
| 148 | PBTC_COEXIST btcoexist, |
| 149 | u8 type |
| 150 | ); |
| 151 | void |
| 152 | EXhalbtc8812a1ant_ScanNotify( |
| 153 | PBTC_COEXIST btcoexist, |
| 154 | u8 type |
| 155 | ); |
| 156 | void |
| 157 | EXhalbtc8812a1ant_ConnectNotify( |
| 158 | PBTC_COEXIST btcoexist, |
| 159 | u8 type |
| 160 | ); |
| 161 | void |
| 162 | EXhalbtc8812a1ant_MediaStatusNotify( |
| 163 | PBTC_COEXIST btcoexist, |
| 164 | u8 type |
| 165 | ); |
| 166 | void |
| 167 | EXhalbtc8812a1ant_SpecialPacketNotify( |
| 168 | PBTC_COEXIST btcoexist, |
| 169 | u8 type |
| 170 | ); |
| 171 | void |
| 172 | EXhalbtc8812a1ant_BtInfoNotify( |
| 173 | PBTC_COEXIST btcoexist, |
| 174 | u8 *tmp_buf, |
| 175 | u8 length |
| 176 | ); |
| 177 | void |
| 178 | EXhalbtc8812a1ant_StackOperationNotify( |
| 179 | PBTC_COEXIST btcoexist, |
| 180 | u8 type |
| 181 | ); |
| 182 | void |
| 183 | EXhalbtc8812a1ant_HaltNotify( |
| 184 | PBTC_COEXIST btcoexist |
| 185 | ); |
| 186 | void |
| 187 | EXhalbtc8812a1ant_PnpNotify( |
| 188 | PBTC_COEXIST btcoexist, |
| 189 | u8 pnpState |
| 190 | ); |
| 191 | void |
| 192 | EXhalbtc8812a1ant_Periodical( |
| 193 | PBTC_COEXIST btcoexist |
| 194 | ); |
| 195 | void |
| 196 | EXhalbtc8812a1ant_DisplayCoexInfo( |
| 197 | PBTC_COEXIST btcoexist |
| 198 | ); |
| 199 | void |
| 200 | EXhalbtc8812a1ant_DbgControl( |
| 201 | PBTC_COEXIST btcoexist, |
| 202 | u8 opCode, |
| 203 | u8 opLen, |
| 204 | u8 *pData |
| 205 | ); |