hal_btcoex_wifionly.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. #include <drv_types.h>
  18. #include <hal_data.h>
  19. /* Define the ICs that support wifi only cfg in coex. codes */
  20. #if defined(CONFIG_RTL8723B) || defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C)
  21. #define CONFIG_BTCOEX_SUPPORT_WIFI_ONLY_CFG 1
  22. #else
  23. #define CONFIG_BTCOEX_SUPPORT_WIFI_ONLY_CFG 0
  24. #endif
  25. #if (CONFIG_BTCOEX_SUPPORT_WIFI_ONLY_CFG == 1)
  26. typedef enum _WIFIONLY_CHIP_INTERFACE {
  27. WIFIONLY_INTF_UNKNOWN = 0,
  28. WIFIONLY_INTF_PCI = 1,
  29. WIFIONLY_INTF_USB = 2,
  30. WIFIONLY_INTF_SDIO = 3,
  31. WIFIONLY_INTF_MAX
  32. } WIFIONLY_CHIP_INTERFACE, *PWIFIONLY_CHIP_INTERFACE;
  33. typedef enum _WIFIONLY_CUSTOMER_ID {
  34. CUSTOMER_NORMAL = 0,
  35. CUSTOMER_HP_1 = 1
  36. } WIFIONLY_CUSTOMER_ID, *PWIFIONLY_CUSTOMER_ID;
  37. struct wifi_only_haldata {
  38. u16 customer_id;
  39. u8 efuse_pg_antnum;
  40. u8 efuse_pg_antpath;
  41. u8 rfe_type;
  42. u8 ant_div_cfg;
  43. };
  44. struct wifi_only_cfg {
  45. PVOID Adapter;
  46. struct wifi_only_haldata haldata_info;
  47. WIFIONLY_CHIP_INTERFACE chip_interface;
  48. };
  49. void halwifionly_write1byte(PVOID pwifionlyContext, u32 RegAddr, u8 Data);
  50. void halwifionly_write2byte(PVOID pwifionlyContext, u32 RegAddr, u16 Data);
  51. void halwifionly_write4byte(PVOID pwifionlyContext, u32 RegAddr, u32 Data);
  52. u8 halwifionly_read1byte(PVOID pwifionlyContext, u32 RegAddr);
  53. u16 halwifionly_read2byte(PVOID pwifionlyContext, u32 RegAddr);
  54. u32 halwifionly_read4byte(PVOID pwifionlyContext, u32 RegAddr);
  55. void halwifionly_bitmaskwrite1byte(PVOID pwifionlyContext, u32 regAddr, u8 bitMask, u8 data);
  56. void halwifionly_phy_set_rf_reg(PVOID pwifionlyContext, enum rf_path eRFPath, u32 RegAddr, u32 BitMask, u32 Data);
  57. void halwifionly_phy_set_bb_reg(PVOID pwifionlyContext, u32 RegAddr, u32 BitMask, u32 Data);
  58. void hal_btcoex_wifionly_switchband_notify(PADAPTER padapter);
  59. void hal_btcoex_wifionly_scan_notify(PADAPTER padapter);
  60. void hal_btcoex_wifionly_connect_notify(PADAPTER padapter);
  61. void hal_btcoex_wifionly_hw_config(PADAPTER padapter);
  62. void hal_btcoex_wifionly_initlizevariables(PADAPTER padapter);
  63. void hal_btcoex_wifionly_AntInfoSetting(PADAPTER padapter);
  64. #else
  65. #define hal_btcoex_wifionly_switchband_notify(padapter)
  66. #define hal_btcoex_wifionly_scan_notify(padapter)
  67. #define hal_btcoex_wifionly_connect_notify(padapter)
  68. #define hal_btcoex_wifionly_hw_config(padapter)
  69. #define hal_btcoex_wifionly_initlizevariables(padapter)
  70. #define hal_btcoex_wifionly_AntInfoSetting(padapter)
  71. #endif
  72. #endif