]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
rtlwifi: btcoex: Remove typedef statements
[linux.git] / drivers / net / wireless / realtek / rtlwifi / btcoexist / halbtcoutsrc.h
index f9b87c12db099abe361bf769d60e770d4a4f2c50..55d648546de144239691fc3a15adae33b349a1d6 100644 (file)
@@ -103,8 +103,6 @@ enum btc_msg_type {
        BTC_MSG_MAX
 };
 
-extern u32 btc_dbg_type[];
-
 /* following is for BTC_MSG_INTERFACE */
 #define                INTF_INIT                               BIT0
 #define                INTF_NOTIFY                             BIT2
@@ -152,7 +150,6 @@ struct btc_board_info {
        u8 btdm_ant_num;        /* ant number for btdm */
        u8 btdm_ant_pos;
        u8 single_ant_path; /* current used for 8723b only, 1=>s0,  0=>s1 */
-       bool bt_exist;
        bool tfbga_package;
 };
 
@@ -181,6 +178,12 @@ enum btc_wifi_role {
        BTC_ROLE_MAX
 };
 
+enum btc_wireless_freq {
+       BTC_FREQ_2_4G = 0x0,
+       BTC_FREQ_5G = 0x1,
+       BTC_FREQ_MAX
+};
+
 enum btc_wifi_bw_mode {
        BTC_WIFI_BW_LEGACY = 0x0,
        BTC_WIFI_BW_HT20 = 0x1,
@@ -355,6 +358,7 @@ enum btc_dbg_disp_type {
        BTC_DBG_DISP_BT_LINK_INFO = 0x1,
        BTC_DBG_DISP_BT_FW_VER = 0x2,
        BTC_DBG_DISP_FW_PWR_MODE_CMD = 0x3,
+       BTC_DBG_DISP_WIFI_STATUS = 0x04,
        BTC_DBG_DISP_MAX
 };
 
@@ -417,49 +421,6 @@ enum btc_notify_type_stack_operation {
        BTC_STACK_OP_MAX
 };
 
-typedef u8 (*bfp_btc_r1)(void *btc_context, u32 reg_addr);
-
-typedef u16 (*bfp_btc_r2)(void *btc_context, u32 reg_addr);
-
-typedef u32 (*bfp_btc_r4)(void *btc_context, u32 reg_addr);
-
-typedef void (*bfp_btc_w1)(void *btc_context, u32 reg_addr, u32 data);
-
-typedef void (*bfp_btc_w1_bit_mak)(void *btc_context, u32 reg_addr,
-                                  u32 bit_mask, u8 data1b);
-
-typedef void (*bfp_btc_w2)(void *btc_context, u32 reg_addr, u16 data);
-
-typedef void (*bfp_btc_w4)(void *btc_context, u32 reg_addr, u32 data);
-
-typedef void (*bfp_btc_local_reg_w1)(void *btc_context, u32 reg_addr, u8 data);
-typedef void (*bfp_btc_wr_1byte_bit_mask)(void *btc_context, u32 reg_addr,
-                                         u8 bit_mask, u8 data);
-
-typedef void (*bfp_btc_set_bb_reg)(void *btc_context, u32 reg_addr,
-                                  u32 bit_mask, u32 data);
-
-typedef u32 (*bfp_btc_get_bb_reg)(void *btc_context, u32 reg_addr,
-                                 u32 bit_mask);
-
-typedef void (*bfp_btc_set_rf_reg)(void *btc_context, u8 rf_path, u32 reg_addr,
-                                  u32 bit_mask, u32 data);
-
-typedef u32 (*bfp_btc_get_rf_reg)(void *btc_context, u8 rf_path,
-                                 u32 reg_addr, u32 bit_mask);
-
-typedef void (*bfp_btc_fill_h2c)(void *btc_context, u8 element_id,
-                                u32 cmd_len, u8 *cmd_buffer);
-
-typedef        bool (*bfp_btc_get)(void *btcoexist, u8 get_type, void *out_buf);
-
-typedef        bool (*bfp_btc_set)(void *btcoexist, u8 set_type, void *in_buf);
-
-typedef void (*bfp_btc_set_bt_reg)(void *btc_context, u8 reg_type, u32 offset,
-                                  u32 value);
-
-typedef void (*bfp_btc_disp_dbg_msg)(void *btcoexist, u8 disp_type);
-
 struct btc_bt_info {
        bool bt_disabled;
        u8 rssi_adjust_for_agc_table_on;
@@ -570,37 +531,47 @@ struct btc_coexist {
        u8 pwr_mode_val[10];
 
        /* function pointers - io related */
-       bfp_btc_r1 btc_read_1byte;
-       bfp_btc_w1 btc_write_1byte;
-       bfp_btc_w1_bit_mak btc_write_1byte_bitmask;
-       bfp_btc_r2 btc_read_2byte;
-       bfp_btc_w2 btc_write_2byte;
-       bfp_btc_r4 btc_read_4byte;
-       bfp_btc_w4 btc_write_4byte;
-       bfp_btc_local_reg_w1 btc_write_local_reg_1byte;
-
-       bfp_btc_set_bb_reg btc_set_bb_reg;
-       bfp_btc_get_bb_reg btc_get_bb_reg;
-
-       bfp_btc_set_rf_reg btc_set_rf_reg;
-       bfp_btc_get_rf_reg btc_get_rf_reg;
-
-       bfp_btc_fill_h2c btc_fill_h2c;
-
-       bfp_btc_disp_dbg_msg btc_disp_dbg_msg;
-
-       bfp_btc_get btc_get;
-       bfp_btc_set btc_set;
-
-       bfp_btc_set_bt_reg btc_set_bt_reg;
+       u8 (*btc_read_1byte)(void *btc_context, u32 reg_addr);
+       void (*btc_write_1byte)(void *btc_context, u32 reg_addr, u32 data);
+       void (*btc_write_1byte_bitmask)(void *btc_context, u32 reg_addr,
+                                       u32 bit_mask, u8 data1b);
+       u16 (*btc_read_2byte)(void *btc_context, u32 reg_addr);
+       void (*btc_write_2byte)(void *btc_context, u32 reg_addr, u16 data);
+       u32 (*btc_read_4byte)(void *btc_context, u32 reg_addr);
+       void (*btc_write_4byte)(void *btc_context, u32 reg_addr, u32 data);
+
+       void (*btc_write_local_reg_1byte)(void *btc_context, u32 reg_addr,
+                                         u8 data);
+       void (*btc_set_bb_reg)(void *btc_context, u32 reg_addr,
+                              u32 bit_mask, u32 data);
+       u32 (*btc_get_bb_reg)(void *btc_context, u32 reg_addr,
+                             u32 bit_mask);
+       void (*btc_set_rf_reg)(void *btc_context, u8 rf_path, u32 reg_addr,
+                              u32 bit_mask, u32 data);
+       u32 (*btc_get_rf_reg)(void *btc_context, u8 rf_path,
+                             u32 reg_addr, u32 bit_mask);
+
+       void (*btc_fill_h2c)(void *btc_context, u8 element_id,
+                            u32 cmd_len, u8 *cmd_buffer);
+
+       void (*btc_disp_dbg_msg)(void *btcoexist, u8 disp_type,
+                                struct seq_file *m);
+
+       bool (*btc_get)(void *btcoexist, u8 get_type, void *out_buf);
+       bool (*btc_set)(void *btcoexist, u8 set_type, void *in_buf);
+
+       void (*btc_set_bt_reg)(void *btc_context, u8 reg_type, u32 offset,
+                              u32 value);
 };
 
 bool halbtc_is_wifi_uplink(struct rtl_priv *adapter);
 
-extern struct btc_coexist gl_bt_coexist;
+#define rtl_btc_coexist(rtlpriv)                               \
+       ((struct btc_coexist *)((rtlpriv)->btcoexist.btc_context))
 
-bool exhalbtc_initlize_variables(void);
+bool exhalbtc_initlize_variables(struct rtl_priv *rtlpriv);
 bool exhalbtc_bind_bt_coex_withadapter(void *adapter);
+void exhalbtc_power_on_setting(struct btc_coexist *btcoexist);
 void exhalbtc_init_hw_config(struct btc_coexist *btcoexist, bool wifi_only);
 void exhalbtc_init_coex_dm(struct btc_coexist *btcoexist);
 void exhalbtc_ips_notify(struct btc_coexist *btcoexist, u8 type);
@@ -620,17 +591,20 @@ void exhalbtc_periodical(struct btc_coexist *btcoexist);
 void exhalbtc_dbg_control(struct btc_coexist *btcoexist, u8 code, u8 len,
                          u8 *data);
 void exhalbtc_stack_update_profile_info(void);
-void exhalbtc_set_hci_version(u16 hci_version);
-void exhalbtc_set_bt_patch_version(u16 bt_hci_version, u16 bt_patch_version);
-void exhalbtc_update_min_bt_rssi(s8 bt_rssi);
-void exhalbtc_set_bt_exist(bool bt_exist);
-void exhalbtc_set_chip_type(u8 chip_type);
+void exhalbtc_set_hci_version(struct btc_coexist *btcoexist, u16 hci_version);
+void exhalbtc_set_bt_patch_version(struct btc_coexist *btcoexist,
+                                  u16 bt_hci_version, u16 bt_patch_version);
+void exhalbtc_update_min_bt_rssi(struct btc_coexist *btcoexist, s8 bt_rssi);
+void exhalbtc_set_bt_exist(struct btc_coexist *btcoexist, bool bt_exist);
+void exhalbtc_set_chip_type(struct btc_coexist *btcoexist, u8 chip_type);
 void exhalbtc_set_ant_num(struct rtl_priv *rtlpriv, u8 type, u8 ant_num);
-void exhalbtc_display_bt_coex_info(struct btc_coexist *btcoexist);
+void exhalbtc_display_bt_coex_info(struct btc_coexist *btcoexist,
+                                  struct seq_file *m);
 void exhalbtc_signal_compensation(struct btc_coexist *btcoexist,
                                  u8 *rssi_wifi, u8 *rssi_bt);
 void exhalbtc_lps_leave(struct btc_coexist *btcoexist);
 void exhalbtc_low_wifi_traffic_notify(struct btc_coexist *btcoexist);
-void exhalbtc_set_single_ant_path(u8 single_ant_path);
+void exhalbtc_set_single_ant_path(struct btc_coexist *btcoexist,
+                                 u8 single_ant_path);
 
 #endif