phydm_cfotracking.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 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. * 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 __PHYDMCFOTRACK_H__
  26. #define __PHYDMCFOTRACK_H__
  27. #define CFO_TRACKING_VERSION "2.0"
  28. #define CFO_TRK_ENABLE_TH 20 /* @kHz enable CFO_Track threshold*/
  29. #define CFO_TRK_STOP_TH 10 /* @kHz disable CFO_Track threshold*/
  30. #define CFO_TH_ATC 80 /* @kHz */
  31. struct phydm_cfo_track_struct {
  32. boolean is_atc_status;
  33. boolean is_adjust; /*@already modify crystal cap*/
  34. u8 crystal_cap;
  35. u8 crystal_cap_default;
  36. u8 def_x_cap;
  37. s32 CFO_tail[4];
  38. u32 CFO_cnt[4];
  39. s32 CFO_ave_pre;
  40. u32 packet_count;
  41. u32 packet_count_pre;
  42. };
  43. struct phydm_cfo_rpt {
  44. s32 cfo_rpt_s[PHYDM_MAX_RF_PATH];
  45. s32 cfo_rpt_l[PHYDM_MAX_RF_PATH];
  46. s32 cfo_rpt_acq[PHYDM_MAX_RF_PATH];
  47. s32 cfo_rpt_sec[PHYDM_MAX_RF_PATH];
  48. s32 cfo_rpt_end[PHYDM_MAX_RF_PATH];
  49. };
  50. void phydm_get_cfo_info(void *dm_void, struct phydm_cfo_rpt *cfo);
  51. void phydm_set_crystal_cap(void *dm_void, u8 crystal_cap);
  52. void phydm_cfo_tracking_init(void *dm_void);
  53. void phydm_cfo_tracking(void *dm_void);
  54. void phydm_parsing_cfo(void *dm_void, void *pktinfo_void, s8 *pcfotail,
  55. u8 num_ss);
  56. #endif