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