eeprom.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. * Intel Wireless Multicomm 3200 WiFi driver
  3. *
  4. * Copyright (C) 2009 Intel Corporation. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * * Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * * Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in
  14. * the documentation and/or other materials provided with the
  15. * distribution.
  16. * * Neither the name of Intel Corporation nor the names of its
  17. * contributors may be used to endorse or promote products derived
  18. * from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. *
  32. *
  33. * Intel Corporation <ilw@linux.intel.com>
  34. * Samuel Ortiz <samuel.ortiz@intel.com>
  35. * Zhu Yi <yi.zhu@intel.com>
  36. *
  37. */
  38. #ifndef __IWM_EEPROM_H__
  39. #define __IWM_EEPROM_H__
  40. enum {
  41. IWM_EEPROM_SIG = 0,
  42. IWM_EEPROM_FIRST = IWM_EEPROM_SIG,
  43. IWM_EEPROM_VERSION,
  44. IWM_EEPROM_OEM_HW_VERSION,
  45. IWM_EEPROM_MAC_VERSION,
  46. IWM_EEPROM_CARD_ID,
  47. IWM_EEPROM_RADIO_CONF,
  48. IWM_EEPROM_SKU_CAP,
  49. IWM_EEPROM_FAT_CHANNELS_CAP,
  50. IWM_EEPROM_INDIRECT_OFFSET,
  51. IWM_EEPROM_CALIB_RXIQ_OFFSET = IWM_EEPROM_INDIRECT_OFFSET,
  52. IWM_EEPROM_INDIRECT_DATA,
  53. IWM_EEPROM_CALIB_RXIQ = IWM_EEPROM_INDIRECT_DATA,
  54. IWM_EEPROM_LAST,
  55. };
  56. #define IWM_EEPROM_SIG_OFF 0x00
  57. #define IWM_EEPROM_VERSION_OFF (0x54 << 1)
  58. #define IWM_EEPROM_OEM_HW_VERSION_OFF (0x56 << 1)
  59. #define IWM_EEPROM_MAC_VERSION_OFF (0x30 << 1)
  60. #define IWM_EEPROM_CARD_ID_OFF (0x5d << 1)
  61. #define IWM_EEPROM_RADIO_CONF_OFF (0x58 << 1)
  62. #define IWM_EEPROM_SKU_CAP_OFF (0x55 << 1)
  63. #define IWM_EEPROM_CALIB_CONFIG_OFF (0x7c << 1)
  64. #define IWM_EEPROM_FAT_CHANNELS_CAP_OFF (0xde << 1)
  65. #define IWM_EEPROM_SIG_LEN 4
  66. #define IWM_EEPROM_VERSION_LEN 2
  67. #define IWM_EEPROM_OEM_HW_VERSION_LEN 2
  68. #define IWM_EEPROM_MAC_VERSION_LEN 1
  69. #define IWM_EEPROM_CARD_ID_LEN 2
  70. #define IWM_EEPROM_RADIO_CONF_LEN 2
  71. #define IWM_EEPROM_SKU_CAP_LEN 2
  72. #define IWM_EEPROM_FAT_CHANNELS_CAP_LEN 40
  73. #define IWM_EEPROM_INDIRECT_LEN 2
  74. #define IWM_MAX_EEPROM_DATA_LEN 240
  75. #define IWM_EEPROM_LEN 0x800
  76. #define IWM_EEPROM_MIN_ALLOWED_VERSION 0x0610
  77. #define IWM_EEPROM_MAX_ALLOWED_VERSION 0x0700
  78. #define IWM_EEPROM_CURRENT_VERSION 0x0612
  79. #define IWM_EEPROM_SKU_CAP_BAND_24GHZ (1 << 4)
  80. #define IWM_EEPROM_SKU_CAP_BAND_52GHZ (1 << 5)
  81. #define IWM_EEPROM_SKU_CAP_11N_ENABLE (1 << 6)
  82. #define IWM_EEPROM_FAT_CHANNELS 20
  83. /* 2.4 gHz FAT primary channels: 1, 2, 3, 4, 5, 6, 7, 8, 9 */
  84. #define IWM_EEPROM_FAT_CHANNELS_24 9
  85. /* 5.2 gHz FAT primary channels: 36,44,52,60,100,108,116,124,132,149,157 */
  86. #define IWM_EEPROM_FAT_CHANNELS_52 11
  87. #define IWM_EEPROM_FAT_CHANNEL_ENABLED (1 << 0)
  88. enum {
  89. IWM_EEPROM_CALIB_CAL_HDR,
  90. IWM_EEPROM_CALIB_TX_POWER,
  91. IWM_EEPROM_CALIB_XTAL,
  92. IWM_EEPROM_CALIB_TEMPERATURE,
  93. IWM_EEPROM_CALIB_RX_BB_FILTER,
  94. IWM_EEPROM_CALIB_RX_IQ,
  95. IWM_EEPROM_CALIB_MAX,
  96. };
  97. #define IWM_EEPROM_CALIB_RXIQ_OFF (IWM_EEPROM_CALIB_CONFIG_OFF + \
  98. (IWM_EEPROM_CALIB_RX_IQ << 1))
  99. #define IWM_EEPROM_CALIB_RXIQ_LEN sizeof(struct iwm_lmac_calib_rxiq)
  100. struct iwm_eeprom_entry {
  101. char *name;
  102. u32 offset;
  103. u32 length;
  104. };
  105. int iwm_eeprom_init(struct iwm_priv *iwm);
  106. void iwm_eeprom_exit(struct iwm_priv *iwm);
  107. u8 *iwm_eeprom_access(struct iwm_priv *iwm, u8 eeprom_id);
  108. int iwm_eeprom_fat_channels(struct iwm_priv *iwm);
  109. u32 iwm_eeprom_wireless_mode(struct iwm_priv *iwm);
  110. #endif