Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* Copyright(c) 2012  Realtek Corporation.*/
0003 
0004 /*****************************************************************
0005  *   The following is for 8192E 2Ant BT Co-exist definition
0006  *****************************************************************/
0007 #define BT_INFO_8192E_2ANT_B_FTP            BIT7
0008 #define BT_INFO_8192E_2ANT_B_A2DP           BIT6
0009 #define BT_INFO_8192E_2ANT_B_HID            BIT5
0010 #define BT_INFO_8192E_2ANT_B_SCO_BUSY           BIT4
0011 #define BT_INFO_8192E_2ANT_B_ACL_BUSY           BIT3
0012 #define BT_INFO_8192E_2ANT_B_INQ_PAGE           BIT2
0013 #define BT_INFO_8192E_2ANT_B_SCO_ESCO           BIT1
0014 #define BT_INFO_8192E_2ANT_B_CONNECTION         BIT0
0015 
0016 #define BTC_RSSI_COEX_THRESH_TOL_8192E_2ANT     2
0017 
0018 enum bt_info_src_8192e_2ant {
0019     BT_INFO_SRC_8192E_2ANT_WIFI_FW          = 0x0,
0020     BT_INFO_SRC_8192E_2ANT_BT_RSP           = 0x1,
0021     BT_INFO_SRC_8192E_2ANT_BT_ACTIVE_SEND       = 0x2,
0022     BT_INFO_SRC_8192E_2ANT_MAX
0023 };
0024 
0025 enum bt_8192e_2ant_bt_status {
0026     BT_8192E_2ANT_BT_STATUS_NON_CONNECTED_IDLE  = 0x0,
0027     BT_8192E_2ANT_BT_STATUS_CONNECTED_IDLE      = 0x1,
0028     BT_8192E_2ANT_BT_STATUS_INQ_PAGE        = 0x2,
0029     BT_8192E_2ANT_BT_STATUS_ACL_BUSY        = 0x3,
0030     BT_8192E_2ANT_BT_STATUS_SCO_BUSY        = 0x4,
0031     BT_8192E_2ANT_BT_STATUS_ACL_SCO_BUSY        = 0x5,
0032     BT_8192E_2ANT_BT_STATUS_MAX
0033 };
0034 
0035 enum bt_8192e_2ant_coex_algo {
0036     BT_8192E_2ANT_COEX_ALGO_UNDEFINED       = 0x0,
0037     BT_8192E_2ANT_COEX_ALGO_SCO         = 0x1,
0038     BT_8192E_2ANT_COEX_ALGO_SCO_PAN         = 0x2,
0039     BT_8192E_2ANT_COEX_ALGO_HID         = 0x3,
0040     BT_8192E_2ANT_COEX_ALGO_A2DP            = 0x4,
0041     BT_8192E_2ANT_COEX_ALGO_A2DP_PANHS      = 0x5,
0042     BT_8192E_2ANT_COEX_ALGO_PANEDR          = 0x6,
0043     BT_8192E_2ANT_COEX_ALGO_PANHS           = 0x7,
0044     BT_8192E_2ANT_COEX_ALGO_PANEDR_A2DP     = 0x8,
0045     BT_8192E_2ANT_COEX_ALGO_PANEDR_HID      = 0x9,
0046     BT_8192E_2ANT_COEX_ALGO_HID_A2DP_PANEDR     = 0xa,
0047     BT_8192E_2ANT_COEX_ALGO_HID_A2DP        = 0xb,
0048     BT_8192E_2ANT_COEX_ALGO_MAX         = 0xc
0049 };
0050 
0051 struct coex_dm_8192e_2ant {
0052     /* fw mechanism */
0053     u8 pre_dec_bt_pwr;
0054     u8 cur_dec_bt_pwr;
0055     u8 pre_fw_dac_swing_lvl;
0056     u8 cur_fw_dac_swing_lvl;
0057     bool cur_ignore_wlan_act;
0058     bool pre_ignore_wlan_act;
0059     u8 pre_ps_tdma;
0060     u8 cur_ps_tdma;
0061     u8 ps_tdma_para[5];
0062     u8 tdma_adj_type;
0063     bool reset_tdma_adjust;
0064     bool auto_tdma_adjust;
0065     bool pre_ps_tdma_on;
0066     bool cur_ps_tdma_on;
0067     bool pre_bt_auto_report;
0068     bool cur_bt_auto_report;
0069 
0070     /* sw mechanism */
0071     bool pre_rf_rx_lpf_shrink;
0072     bool cur_rf_rx_lpf_shrink;
0073     u32 bt_rf0x1e_backup;
0074     bool pre_low_penalty_ra;
0075     bool cur_low_penalty_ra;
0076     bool pre_dac_swing_on;
0077     u32 pre_dac_swing_lvl;
0078     bool cur_dac_swing_on;
0079     u32 cur_dac_swing_lvl;
0080     bool pre_adc_back_off;
0081     bool cur_adc_back_off;
0082     bool pre_agc_table_en;
0083     bool cur_agc_table_en;
0084     u32 pre_val0x6c0;
0085     u32 cur_val0x6c0;
0086     u32 pre_val0x6c4;
0087     u32 cur_val0x6c4;
0088     u32 pre_val0x6c8;
0089     u32 cur_val0x6c8;
0090     u8 pre_val0x6cc;
0091     u8 cur_val0x6cc;
0092     bool limited_dig;
0093 
0094     u32 backup_arfr_cnt1;   /* Auto Rate Fallback Retry cnt */
0095     u32 backup_arfr_cnt2;   /* Auto Rate Fallback Retry cnt */
0096     u16 backup_retry_limit;
0097     u8 backup_ampdu_maxtime;
0098 
0099     /* algorithm related */
0100     u8 pre_algorithm;
0101     u8 cur_algorithm;
0102     u8 bt_status;
0103     u8 wifi_chnl_info[3];
0104 
0105     u8 pre_ss_type;
0106     u8 cur_ss_type;
0107 
0108     u32 pre_ra_mask;
0109     u32 cur_ra_mask;
0110     u8 cur_ra_mask_type;
0111     u8 pre_arfr_type;
0112     u8 cur_arfr_type;
0113     u8 pre_retry_limit_type;
0114     u8 cur_retry_limit_type;
0115     u8 pre_ampdu_time_type;
0116     u8 cur_ampdu_time_type;
0117 };
0118 
0119 struct coex_sta_8192e_2ant {
0120     bool bt_link_exist;
0121     bool sco_exist;
0122     bool a2dp_exist;
0123     bool hid_exist;
0124     bool pan_exist;
0125 
0126     bool under_lps;
0127     bool under_ips;
0128     u32 high_priority_tx;
0129     u32 high_priority_rx;
0130     u32 low_priority_tx;
0131     u32 low_priority_rx;
0132     u8 bt_rssi;
0133     u8 pre_bt_rssi_state;
0134     u8 pre_wifi_rssi_state[4];
0135     bool c2h_bt_info_req_sent;
0136     u8 bt_info_c2h[BT_INFO_SRC_8192E_2ANT_MAX][10];
0137     u32 bt_info_c2h_cnt[BT_INFO_SRC_8192E_2ANT_MAX];
0138     bool c2h_bt_inquiry_page;
0139     u8 bt_retry_cnt;
0140     u8 bt_info_ext;
0141 };
0142 
0143 /****************************************************************
0144  *    The following is interface which will notify coex module.
0145  ****************************************************************/
0146 void ex_btc8192e2ant_init_hwconfig(struct btc_coexist *btcoexist);
0147 void ex_btc8192e2ant_init_coex_dm(struct btc_coexist *btcoexist);
0148 void ex_btc8192e2ant_ips_notify(struct btc_coexist *btcoexist, u8 type);
0149 void ex_btc8192e2ant_lps_notify(struct btc_coexist *btcoexist, u8 type);
0150 void ex_btc8192e2ant_scan_notify(struct btc_coexist *btcoexist, u8 type);
0151 void ex_btc8192e2ant_connect_notify(struct btc_coexist *btcoexist, u8 type);
0152 void ex_btc8192e2ant_media_status_notify(struct btc_coexist *btcoexist,
0153                      u8 type);
0154 void ex_btc8192e2ant_special_packet_notify(struct btc_coexist *btcoexist,
0155                        u8 type);
0156 void ex_btc8192e2ant_bt_info_notify(struct btc_coexist *btcoexist,
0157                     u8 *tmpbuf, u8 length);
0158 void ex_btc8192e2ant_stack_operation_notify(struct btc_coexist *btcoexist,
0159                         u8 type);
0160 void ex_btc8192e2ant_halt_notify(struct btc_coexist *btcoexist);
0161 void ex_btc8192e2ant_periodical(struct btc_coexist *btcoexist);
0162 void ex_btc8192e2ant_display_coex_info(struct btc_coexist *btcoexist,
0163                        struct seq_file *m);