• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  * Copyright(c) 2016 - 2017 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  *****************************************************************************/
15 #ifndef __HALBTC_WIFIONLY_H__
16 #define __HALBTC_WIFIONLY_H__
17 
18 #include <drv_types.h>
19 #include <hal_data.h>
20 
21 /* Define the ICs that support wifi only cfg in coex. codes */
22 #if defined(CONFIG_RTL8723B) || defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8814B) \
23 || defined(CONFIG_RTL8723F)
24 #define CONFIG_BTCOEX_SUPPORT_WIFI_ONLY_CFG 1
25 #else
26 #define CONFIG_BTCOEX_SUPPORT_WIFI_ONLY_CFG 0
27 #endif
28 
29 /* Define the ICs that support hal btc common file structure */
30 #if defined(CONFIG_RTL8822C) || (defined(CONFIG_RTL8192F) || defined(CONFIG_RTL8723F)&& defined(CONFIG_BT_COEXIST))
31 #define CONFIG_BTCOEX_SUPPORT_BTC_CMN 1
32 #else
33 #define CONFIG_BTCOEX_SUPPORT_BTC_CMN 0
34 #endif
35 
36 #if (CONFIG_BTCOEX_SUPPORT_WIFI_ONLY_CFG == 1)
37 
38 typedef enum _WIFIONLY_CHIP_INTERFACE {
39 	WIFIONLY_INTF_UNKNOWN	= 0,
40 	WIFIONLY_INTF_PCI		= 1,
41 	WIFIONLY_INTF_USB		= 2,
42 	WIFIONLY_INTF_SDIO		= 3,
43 	WIFIONLY_INTF_MAX
44 } WIFIONLY_CHIP_INTERFACE, *PWIFIONLY_CHIP_INTERFACE;
45 
46 typedef enum _WIFIONLY_CUSTOMER_ID {
47 	CUSTOMER_NORMAL			= 0,
48 	CUSTOMER_HP_1			= 1
49 } WIFIONLY_CUSTOMER_ID, *PWIFIONLY_CUSTOMER_ID;
50 
51 struct wifi_only_haldata {
52 	u16		customer_id;
53 	u8		efuse_pg_antnum;
54 	u8		efuse_pg_antpath;
55 	u8		rfe_type;
56 	u8		ant_div_cfg;
57 };
58 
59 struct wifi_only_cfg {
60 	void *Adapter;
61 	struct wifi_only_haldata	haldata_info;
62 	WIFIONLY_CHIP_INTERFACE	chip_interface;
63 };
64 
65 void halwifionly_write1byte(void *pwifionlyContext, u32 RegAddr, u8 Data);
66 void halwifionly_write2byte(void *pwifionlyContext, u32 RegAddr, u16 Data);
67 void halwifionly_write4byte(void *pwifionlyContext, u32 RegAddr, u32 Data);
68 u8 halwifionly_read1byte(void *pwifionlyContext, u32 RegAddr);
69 u16 halwifionly_read2byte(void *pwifionlyContext, u32 RegAddr);
70 u32 halwifionly_read4byte(void *pwifionlyContext, u32 RegAddr);
71 void halwifionly_bitmaskwrite1byte(void *pwifionlyContext, u32 regAddr, u8 bitMask, u8 data);
72 void halwifionly_phy_set_rf_reg(void *pwifionlyContext, enum rf_path eRFPath, u32 RegAddr, u32 BitMask, u32 Data);
73 void halwifionly_phy_set_bb_reg(void *pwifionlyContext, u32 RegAddr, u32 BitMask, u32 Data);
74 void hal_btcoex_wifionly_switchband_notify(PADAPTER padapter);
75 void hal_btcoex_wifionly_scan_notify(PADAPTER padapter);
76 void hal_btcoex_wifionly_connect_notify(PADAPTER padapter);
77 void hal_btcoex_wifionly_hw_config(PADAPTER padapter);
78 void hal_btcoex_wifionly_initlizevariables(PADAPTER padapter);
79 void hal_btcoex_wifionly_AntInfoSetting(PADAPTER padapter);
80 #else
81 #define hal_btcoex_wifionly_switchband_notify(padapter)
82 #define hal_btcoex_wifionly_scan_notify(padapter)
83 #define hal_btcoex_wifionly_connect_notify(padapter)
84 #define hal_btcoex_wifionly_hw_config(padapter)
85 #define hal_btcoex_wifionly_initlizevariables(padapter)
86 #define hal_btcoex_wifionly_AntInfoSetting(padapter)
87 #endif
88 
89 #endif
90