phy_common.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2009-2014 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. * The full GNU General Public License is included in this distribution in the
  15. * file called LICENSE.
  16. *
  17. * Contact Information:
  18. * wlanfae <wlanfae@realtek.com>
  19. * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
  20. * Hsinchu 300, Taiwan.
  21. *
  22. * Larry Finger <Larry.Finger@lwfinger.net>
  23. *
  24. *****************************************************************************/
  25. #ifndef __PHY_COMMON__
  26. #define __PHY_COMMON__
  27. #define RT_CANNOT_IO(hw) false
  28. enum swchnlcmd_id {
  29. CMDID_END,
  30. CMDID_SET_TXPOWEROWER_LEVEL,
  31. CMDID_BBREGWRITE10,
  32. CMDID_WRITEPORT_ULONG,
  33. CMDID_WRITEPORT_USHORT,
  34. CMDID_WRITEPORT_UCHAR,
  35. CMDID_RF_WRITEREG,
  36. };
  37. struct swchnlcmd {
  38. enum swchnlcmd_id cmdid;
  39. u32 para1;
  40. u32 para2;
  41. u32 msdelay;
  42. };
  43. u32 rtl8723_phy_query_bb_reg(struct ieee80211_hw *hw,
  44. u32 regaddr, u32 bitmask);
  45. void rtl8723_phy_set_bb_reg(struct ieee80211_hw *hw, u32 regaddr,
  46. u32 bitmask, u32 data);
  47. u32 rtl8723_phy_calculate_bit_shift(u32 bitmask);
  48. u32 rtl8723_phy_rf_serial_read(struct ieee80211_hw *hw,
  49. enum radio_path rfpath, u32 offset);
  50. void rtl8723_phy_rf_serial_write(struct ieee80211_hw *hw,
  51. enum radio_path rfpath,
  52. u32 offset, u32 data);
  53. long rtl8723_phy_txpwr_idx_to_dbm(struct ieee80211_hw *hw,
  54. enum wireless_mode wirelessmode,
  55. u8 txpwridx);
  56. void rtl8723_phy_init_bb_rf_reg_def(struct ieee80211_hw *hw);
  57. bool rtl8723_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
  58. u32 cmdtableidx,
  59. u32 cmdtablesz,
  60. enum swchnlcmd_id cmdid,
  61. u32 para1, u32 para2,
  62. u32 msdelay);
  63. void rtl8723_phy_path_a_fill_iqk_matrix(struct ieee80211_hw *hw,
  64. bool iqk_ok,
  65. long result[][8],
  66. u8 final_candidate,
  67. bool btxonly);
  68. void rtl8723_save_adda_registers(struct ieee80211_hw *hw, u32 *addareg,
  69. u32 *addabackup, u32 registernum);
  70. void rtl8723_phy_save_mac_registers(struct ieee80211_hw *hw,
  71. u32 *macreg, u32 *macbackup);
  72. void rtl8723_phy_reload_adda_registers(struct ieee80211_hw *hw,
  73. u32 *addareg, u32 *addabackup,
  74. u32 regiesternum);
  75. void rtl8723_phy_reload_mac_registers(struct ieee80211_hw *hw,
  76. u32 *macreg, u32 *macbackup);
  77. void rtl8723_phy_path_adda_on(struct ieee80211_hw *hw, u32 *addareg,
  78. bool is_patha_on, bool is2t);
  79. void rtl8723_phy_mac_setting_calibration(struct ieee80211_hw *hw,
  80. u32 *macreg, u32 *macbackup);
  81. void rtl8723_phy_path_a_standby(struct ieee80211_hw *hw);
  82. void rtl8723_phy_pi_mode_switch(struct ieee80211_hw *hw, bool pi_mode);
  83. #endif