ini.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * This file is part of wl1271
  3. *
  4. * Copyright (C) 2010 Nokia Corporation
  5. *
  6. * Contact: Luciano Coelho <luciano.coelho@nokia.com>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * version 2 as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA
  21. *
  22. */
  23. #ifndef __INI_H__
  24. #define __INI_H__
  25. #define WL1271_INI_MAX_SMART_REFLEX_PARAM 16
  26. struct wl1271_ini_general_params {
  27. u8 ref_clock;
  28. u8 settling_time;
  29. u8 clk_valid_on_wakeup;
  30. u8 dc2dc_mode;
  31. u8 dual_mode_select;
  32. u8 tx_bip_fem_auto_detect;
  33. u8 tx_bip_fem_manufacturer;
  34. u8 general_settings;
  35. u8 sr_state;
  36. u8 srf1[WL1271_INI_MAX_SMART_REFLEX_PARAM];
  37. u8 srf2[WL1271_INI_MAX_SMART_REFLEX_PARAM];
  38. u8 srf3[WL1271_INI_MAX_SMART_REFLEX_PARAM];
  39. } __packed;
  40. #define WL1271_INI_RSSI_PROCESS_COMPENS_SIZE 15
  41. struct wl1271_ini_band_params_2 {
  42. u8 rx_trace_insertion_loss;
  43. u8 tx_trace_loss;
  44. u8 rx_rssi_process_compens[WL1271_INI_RSSI_PROCESS_COMPENS_SIZE];
  45. } __packed;
  46. #define WL1271_INI_RATE_GROUP_COUNT 6
  47. #define WL1271_INI_CHANNEL_COUNT_2 14
  48. struct wl1271_ini_fem_params_2 {
  49. __le16 tx_bip_ref_pd_voltage;
  50. u8 tx_bip_ref_power;
  51. u8 tx_bip_ref_offset;
  52. u8 tx_per_rate_pwr_limits_normal[WL1271_INI_RATE_GROUP_COUNT];
  53. u8 tx_per_rate_pwr_limits_degraded[WL1271_INI_RATE_GROUP_COUNT];
  54. u8 tx_per_rate_pwr_limits_extreme[WL1271_INI_RATE_GROUP_COUNT];
  55. u8 tx_per_chan_pwr_limits_11b[WL1271_INI_CHANNEL_COUNT_2];
  56. u8 tx_per_chan_pwr_limits_ofdm[WL1271_INI_CHANNEL_COUNT_2];
  57. u8 tx_pd_vs_rate_offsets[WL1271_INI_RATE_GROUP_COUNT];
  58. u8 tx_ibias[WL1271_INI_RATE_GROUP_COUNT];
  59. u8 rx_fem_insertion_loss;
  60. u8 degraded_low_to_normal_thr;
  61. u8 normal_to_degraded_high_thr;
  62. } __packed;
  63. #define WL1271_INI_CHANNEL_COUNT_5 35
  64. #define WL1271_INI_SUB_BAND_COUNT_5 7
  65. struct wl1271_ini_band_params_5 {
  66. u8 rx_trace_insertion_loss[WL1271_INI_SUB_BAND_COUNT_5];
  67. u8 tx_trace_loss[WL1271_INI_SUB_BAND_COUNT_5];
  68. u8 rx_rssi_process_compens[WL1271_INI_RSSI_PROCESS_COMPENS_SIZE];
  69. } __packed;
  70. struct wl1271_ini_fem_params_5 {
  71. __le16 tx_bip_ref_pd_voltage[WL1271_INI_SUB_BAND_COUNT_5];
  72. u8 tx_bip_ref_power[WL1271_INI_SUB_BAND_COUNT_5];
  73. u8 tx_bip_ref_offset[WL1271_INI_SUB_BAND_COUNT_5];
  74. u8 tx_per_rate_pwr_limits_normal[WL1271_INI_RATE_GROUP_COUNT];
  75. u8 tx_per_rate_pwr_limits_degraded[WL1271_INI_RATE_GROUP_COUNT];
  76. u8 tx_per_rate_pwr_limits_extreme[WL1271_INI_RATE_GROUP_COUNT];
  77. u8 tx_per_chan_pwr_limits_ofdm[WL1271_INI_CHANNEL_COUNT_5];
  78. u8 tx_pd_vs_rate_offsets[WL1271_INI_RATE_GROUP_COUNT];
  79. u8 tx_ibias[WL1271_INI_RATE_GROUP_COUNT];
  80. u8 rx_fem_insertion_loss[WL1271_INI_SUB_BAND_COUNT_5];
  81. u8 degraded_low_to_normal_thr;
  82. u8 normal_to_degraded_high_thr;
  83. } __packed;
  84. /* NVS data structure */
  85. #define WL1271_INI_NVS_SECTION_SIZE 468
  86. #define WL1271_INI_FEM_MODULE_COUNT 2
  87. #define WL1271_INI_LEGACY_NVS_FILE_SIZE 800
  88. struct wl1271_nvs_file {
  89. /* NVS section */
  90. u8 nvs[WL1271_INI_NVS_SECTION_SIZE];
  91. /* INI section */
  92. struct wl1271_ini_general_params general_params;
  93. u8 padding1;
  94. struct wl1271_ini_band_params_2 stat_radio_params_2;
  95. u8 padding2;
  96. struct {
  97. struct wl1271_ini_fem_params_2 params;
  98. u8 padding;
  99. } dyn_radio_params_2[WL1271_INI_FEM_MODULE_COUNT];
  100. struct wl1271_ini_band_params_5 stat_radio_params_5;
  101. u8 padding3;
  102. struct {
  103. struct wl1271_ini_fem_params_5 params;
  104. u8 padding;
  105. } dyn_radio_params_5[WL1271_INI_FEM_MODULE_COUNT];
  106. } __packed;
  107. #endif