phydm_primary_cca.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 __PHYDM_PRIMARYCCA_H__
  26. #define __PHYDM_PRIMARYCCA_H__
  27. #ifdef PHYDM_PRIMARY_CCA
  28. #define PRIMARYCCA_VERSION "2.0"
  29. /*@============================================================*/
  30. /*@Definition */
  31. /*@============================================================*/
  32. #if (DM_ODM_SUPPORT_TYPE == ODM_CE)
  33. #define SECOND_CH_AT_LSB 2 /*@primary CH @ MSB, SD4: HAL_PRIME_CHNL_OFFSET_UPPER*/
  34. #define SECOND_CH_AT_USB 1 /*@primary CH @ LSB, SD4: HAL_PRIME_CHNL_OFFSET_LOWER*/
  35. #elif (DM_ODM_SUPPORT_TYPE == ODM_WIN)
  36. #define SECOND_CH_AT_LSB 2 /*@primary CH @ MSB, SD7: HAL_PRIME_CHNL_OFFSET_UPPER*/
  37. #define SECOND_CH_AT_USB 1 /*@primary CH @ LSB, SD7: HAL_PRIME_CHNL_OFFSET_LOWER*/
  38. #else /*if (DM_ODM_SUPPORT_TYPE == ODM_AP)*/
  39. #define SECOND_CH_AT_LSB 1 /*@primary CH @ MSB, SD8: HT_2NDCH_OFFSET_BELOW*/
  40. #define SECOND_CH_AT_USB 2 /*@primary CH @ LSB, SD8: HT_2NDCH_OFFSET_ABOVE*/
  41. #endif
  42. #define OFDMCCA_TH 500
  43. #define bw_ind_bias 500
  44. #define PRI_CCA_MONITOR_TIME 30
  45. /*@============================================================*/
  46. /*structure and define*/
  47. /*@============================================================*/
  48. enum primary_cca_ch_position { /*N-series REG0xc6c[8:7]*/
  49. MF_USC_LSC = 0,
  50. MF_LSC = 1,
  51. MF_USC = 2
  52. };
  53. struct phydm_pricca_struct {
  54. #if (RTL8188E_SUPPORT == 1) || (RTL8192E_SUPPORT == 1)
  55. u8 pri_cca_flag;
  56. u8 intf_flag;
  57. u8 intf_type;
  58. u8 monitor_flag;
  59. u8 ch_offset;
  60. #endif
  61. u8 dup_rts_flag;
  62. u8 cca_th_40m_bkp; /*@c84[31:28]*/
  63. enum channel_width pre_bw;
  64. u8 pri_cca_is_become_linked;
  65. u8 mf_state;
  66. };
  67. /*@============================================================*/
  68. /*@function prototype*/
  69. /*@============================================================*/
  70. void phydm_write_dynamic_cca(void *dm_void, u8 curr_mf_state);
  71. boolean odm_dynamic_primary_cca_dup_rts(void *dm_void);
  72. void phydm_primary_cca_init(void *dm_void);
  73. void phydm_primary_cca(void *dm_void);
  74. #endif /*@#ifdef PHYDM_PRIMARY_CCA*/
  75. #endif /*@#ifndef __PHYDM_PRIMARYCCA_H__*/