wl1271_init.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. * This file is part of wl1271
  3. *
  4. * Copyright (C) 2009 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 __WL1271_INIT_H__
  24. #define __WL1271_INIT_H__
  25. #include "wl1271.h"
  26. int wl1271_hw_init_power_auth(struct wl1271 *wl);
  27. int wl1271_hw_init(struct wl1271 *wl);
  28. /* These are not really a TEST_CMD, but the ref driver uses them as such */
  29. #define TEST_CMD_INI_FILE_RADIO_PARAM 0x19
  30. #define TEST_CMD_INI_FILE_GENERAL_PARAM 0x1E
  31. struct wl1271_general_parms {
  32. u8 id;
  33. u8 padding[3];
  34. u8 ref_clk;
  35. u8 settling_time;
  36. u8 clk_valid_on_wakeup;
  37. u8 dc2dcmode;
  38. u8 single_dual_band;
  39. u8 tx_bip_fem_autodetect;
  40. u8 tx_bip_fem_manufacturer;
  41. u8 settings;
  42. } __attribute__ ((packed));
  43. enum ref_clk_enum {
  44. REF_CLK_19_2_E,
  45. REF_CLK_26_E,
  46. REF_CLK_38_4_E,
  47. REF_CLK_52_E
  48. };
  49. #define RSSI_AND_PROCESS_COMPENSATION_SIZE 15
  50. #define NUMBER_OF_SUB_BANDS_5 7
  51. #define NUMBER_OF_RATE_GROUPS 6
  52. #define NUMBER_OF_CHANNELS_2_4 14
  53. #define NUMBER_OF_CHANNELS_5 35
  54. struct wl1271_radio_parms {
  55. u8 id;
  56. u8 padding[3];
  57. /* Static radio parameters */
  58. /* 2.4GHz */
  59. u8 rx_trace_loss;
  60. u8 tx_trace_loss;
  61. s8 rx_rssi_and_proc_compens[RSSI_AND_PROCESS_COMPENSATION_SIZE];
  62. /* 5GHz */
  63. u8 rx_trace_loss_5[NUMBER_OF_SUB_BANDS_5];
  64. u8 tx_trace_loss_5[NUMBER_OF_SUB_BANDS_5];
  65. s8 rx_rssi_and_proc_compens_5[RSSI_AND_PROCESS_COMPENSATION_SIZE];
  66. /* Dynamic radio parameters */
  67. /* 2.4GHz */
  68. s16 tx_ref_pd_voltage;
  69. s8 tx_ref_power;
  70. s8 tx_offset_db;
  71. s8 tx_rate_limits_normal[NUMBER_OF_RATE_GROUPS];
  72. s8 tx_rate_limits_degraded[NUMBER_OF_RATE_GROUPS];
  73. s8 tx_channel_limits_11b[NUMBER_OF_CHANNELS_2_4];
  74. s8 tx_channel_limits_ofdm[NUMBER_OF_CHANNELS_2_4];
  75. s8 tx_pdv_rate_offsets[NUMBER_OF_RATE_GROUPS];
  76. u8 tx_ibias[NUMBER_OF_RATE_GROUPS];
  77. u8 rx_fem_insertion_loss;
  78. u8 padding2;
  79. /* 5GHz */
  80. s16 tx_ref_pd_voltage_5[NUMBER_OF_SUB_BANDS_5];
  81. s8 tx_ref_power_5[NUMBER_OF_SUB_BANDS_5];
  82. s8 tx_offset_db_5[NUMBER_OF_SUB_BANDS_5];
  83. s8 tx_rate_limits_normal_5[NUMBER_OF_RATE_GROUPS];
  84. s8 tx_rate_limits_degraded_5[NUMBER_OF_RATE_GROUPS];
  85. s8 tx_channel_limits_ofdm_5[NUMBER_OF_CHANNELS_5];
  86. s8 tx_pdv_rate_offsets_5[NUMBER_OF_RATE_GROUPS];
  87. /* FIXME: this is inconsistent with the types for 2.4GHz */
  88. s8 tx_ibias_5[NUMBER_OF_RATE_GROUPS];
  89. s8 rx_fem_insertion_loss_5[NUMBER_OF_SUB_BANDS_5];
  90. u8 padding3[2];
  91. } __attribute__ ((packed));
  92. #endif