eeprom.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. /*
  2. * eeprom specific definitions for mac80211 Prism54 drivers
  3. *
  4. * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net>
  5. * Copyright (c) 2007-2009, Christian Lamparter <chunkeey@web.de>
  6. *
  7. * Based on:
  8. * - the islsm (softmac prism54) driver, which is:
  9. * Copyright 2004-2006 Jean-Baptiste Note <jbnote@gmail.com>, et al.
  10. *
  11. * - LMAC API interface header file for STLC4560 (lmac_longbow.h)
  12. * Copyright (C) 2007 Conexant Systems, Inc.
  13. *
  14. * - islmvc driver
  15. * Copyright (C) 2001 Intersil Americas Inc.
  16. *
  17. * This program is free software; you can redistribute it and/or modify
  18. * it under the terms of the GNU General Public License version 2 as
  19. * published by the Free Software Foundation.
  20. */
  21. #ifndef EEPROM_H
  22. #define EEPROM_H
  23. /* PDA defines are Copyright (C) 2005 Nokia Corporation (taken from islsm_pda.h) */
  24. struct pda_entry {
  25. __le16 len; /* includes both code and data */
  26. __le16 code;
  27. u8 data[0];
  28. } __packed;
  29. struct eeprom_pda_wrap {
  30. __le32 magic;
  31. __le16 pad;
  32. __le16 len;
  33. __le32 arm_opcode;
  34. u8 data[0];
  35. } __packed;
  36. struct p54_iq_autocal_entry {
  37. __le16 iq_param[4];
  38. } __packed;
  39. struct pda_iq_autocal_entry {
  40. __le16 freq;
  41. struct p54_iq_autocal_entry params;
  42. } __packed;
  43. struct pda_channel_output_limit {
  44. __le16 freq;
  45. u8 val_bpsk;
  46. u8 val_qpsk;
  47. u8 val_16qam;
  48. u8 val_64qam;
  49. u8 rate_set_mask;
  50. u8 rate_set_size;
  51. } __packed;
  52. struct pda_pa_curve_data_sample_rev0 {
  53. u8 rf_power;
  54. u8 pa_detector;
  55. u8 pcv;
  56. } __packed;
  57. struct pda_pa_curve_data_sample_rev1 {
  58. u8 rf_power;
  59. u8 pa_detector;
  60. u8 data_barker;
  61. u8 data_bpsk;
  62. u8 data_qpsk;
  63. u8 data_16qam;
  64. u8 data_64qam;
  65. } __packed;
  66. struct pda_pa_curve_data {
  67. u8 cal_method_rev;
  68. u8 channels;
  69. u8 points_per_channel;
  70. u8 padding;
  71. u8 data[0];
  72. } __packed;
  73. struct pda_rssi_cal_ext_entry {
  74. __le16 freq;
  75. __le16 mul;
  76. __le16 add;
  77. } __packed;
  78. struct pda_rssi_cal_entry {
  79. __le16 mul;
  80. __le16 add;
  81. } __packed;
  82. struct pda_country {
  83. u8 regdomain;
  84. u8 alpha2[2];
  85. u8 flags;
  86. } __packed;
  87. struct pda_antenna_gain {
  88. struct {
  89. u8 gain_5GHz; /* 0.25 dBi units */
  90. u8 gain_2GHz; /* 0.25 dBi units */
  91. } __packed antenna[0];
  92. } __packed;
  93. struct pda_custom_wrapper {
  94. __le16 entries;
  95. __le16 entry_size;
  96. __le16 offset;
  97. __le16 len;
  98. u8 data[0];
  99. } __packed;
  100. /*
  101. * this defines the PDR codes used to build PDAs as defined in document
  102. * number 553155. The current implementation mirrors version 1.1 of the
  103. * document and lists only PDRs supported by the ARM platform.
  104. */
  105. /* common and choice range (0x0000 - 0x0fff) */
  106. #define PDR_END 0x0000
  107. #define PDR_MANUFACTURING_PART_NUMBER 0x0001
  108. #define PDR_PDA_VERSION 0x0002
  109. #define PDR_NIC_SERIAL_NUMBER 0x0003
  110. #define PDR_NIC_RAM_SIZE 0x0005
  111. #define PDR_RFMODEM_SUP_RANGE 0x0006
  112. #define PDR_PRISM_MAC_SUP_RANGE 0x0007
  113. #define PDR_NIC_ID 0x0008
  114. #define PDR_MAC_ADDRESS 0x0101
  115. #define PDR_REGULATORY_DOMAIN_LIST 0x0103 /* obsolete */
  116. #define PDR_ALLOWED_CHAN_SET 0x0104
  117. #define PDR_DEFAULT_CHAN 0x0105
  118. #define PDR_TEMPERATURE_TYPE 0x0107
  119. #define PDR_IFR_SETTING 0x0200
  120. #define PDR_RFR_SETTING 0x0201
  121. #define PDR_3861_BASELINE_REG_SETTINGS 0x0202
  122. #define PDR_3861_SHADOW_REG_SETTINGS 0x0203
  123. #define PDR_3861_IFRF_REG_SETTINGS 0x0204
  124. #define PDR_3861_CHAN_CALIB_SET_POINTS 0x0300
  125. #define PDR_3861_CHAN_CALIB_INTEGRATOR 0x0301
  126. #define PDR_3842_PRISM_II_NIC_CONFIG 0x0400
  127. #define PDR_PRISM_USB_ID 0x0401
  128. #define PDR_PRISM_PCI_ID 0x0402
  129. #define PDR_PRISM_PCI_IF_CONFIG 0x0403
  130. #define PDR_PRISM_PCI_PM_CONFIG 0x0404
  131. #define PDR_3861_MF_TEST_CHAN_SET_POINTS 0x0900
  132. #define PDR_3861_MF_TEST_CHAN_INTEGRATORS 0x0901
  133. /* ARM range (0x1000 - 0x1fff) */
  134. #define PDR_COUNTRY_INFORMATION 0x1000 /* obsolete */
  135. #define PDR_INTERFACE_LIST 0x1001
  136. #define PDR_HARDWARE_PLATFORM_COMPONENT_ID 0x1002
  137. #define PDR_OEM_NAME 0x1003
  138. #define PDR_PRODUCT_NAME 0x1004
  139. #define PDR_UTF8_OEM_NAME 0x1005
  140. #define PDR_UTF8_PRODUCT_NAME 0x1006
  141. #define PDR_COUNTRY_LIST 0x1007
  142. #define PDR_DEFAULT_COUNTRY 0x1008
  143. #define PDR_ANTENNA_GAIN 0x1100
  144. #define PDR_PRISM_INDIGO_PA_CALIBRATION_DATA 0x1901
  145. #define PDR_RSSI_LINEAR_APPROXIMATION 0x1902
  146. #define PDR_PRISM_PA_CAL_OUTPUT_POWER_LIMITS 0x1903
  147. #define PDR_PRISM_PA_CAL_CURVE_DATA 0x1904
  148. #define PDR_RSSI_LINEAR_APPROXIMATION_DUAL_BAND 0x1905
  149. #define PDR_PRISM_ZIF_TX_IQ_CALIBRATION 0x1906
  150. #define PDR_REGULATORY_POWER_LIMITS 0x1907
  151. #define PDR_RSSI_LINEAR_APPROXIMATION_EXTENDED 0x1908
  152. #define PDR_RADIATED_TRANSMISSION_CORRECTION 0x1909
  153. #define PDR_PRISM_TX_IQ_CALIBRATION 0x190a
  154. /* reserved range (0x2000 - 0x7fff) */
  155. /* customer range (0x8000 - 0xffff) */
  156. #define PDR_BASEBAND_REGISTERS 0x8000
  157. #define PDR_PER_CHANNEL_BASEBAND_REGISTERS 0x8001
  158. /* used by our modificated eeprom image */
  159. #define PDR_RSSI_LINEAR_APPROXIMATION_CUSTOM 0xDEAD
  160. #define PDR_RSSI_LINEAR_APPROXIMATION_CUSTOMV2 0xCAFF
  161. #define PDR_PRISM_PA_CAL_OUTPUT_POWER_LIMITS_CUSTOM 0xBEEF
  162. #define PDR_PRISM_PA_CAL_CURVE_DATA_CUSTOM 0xB05D
  163. /* Interface Definitions */
  164. #define PDR_INTERFACE_ROLE_SERVER 0x0000
  165. #define PDR_INTERFACE_ROLE_CLIENT 0x0001
  166. /* PDR definitions for default country & country list */
  167. #define PDR_COUNTRY_CERT_CODE 0x80
  168. #define PDR_COUNTRY_CERT_CODE_REAL 0x00
  169. #define PDR_COUNTRY_CERT_CODE_PSEUDO 0x80
  170. #define PDR_COUNTRY_CERT_BAND 0x40
  171. #define PDR_COUNTRY_CERT_BAND_2GHZ 0x00
  172. #define PDR_COUNTRY_CERT_BAND_5GHZ 0x40
  173. #define PDR_COUNTRY_CERT_IODOOR 0x30
  174. #define PDR_COUNTRY_CERT_IODOOR_BOTH 0x00
  175. #define PDR_COUNTRY_CERT_IODOOR_INDOOR 0x20
  176. #define PDR_COUNTRY_CERT_IODOOR_OUTDOOR 0x30
  177. #define PDR_COUNTRY_CERT_INDEX 0x0f
  178. /* Specific LMAC FW/HW variant definitions */
  179. #define PDR_SYNTH_FRONTEND_MASK 0x0007
  180. #define PDR_SYNTH_FRONTEND_DUETTE3 0x0001
  181. #define PDR_SYNTH_FRONTEND_DUETTE2 0x0002
  182. #define PDR_SYNTH_FRONTEND_FRISBEE 0x0003
  183. #define PDR_SYNTH_FRONTEND_XBOW 0x0004
  184. #define PDR_SYNTH_FRONTEND_LONGBOW 0x0005
  185. #define PDR_SYNTH_IQ_CAL_MASK 0x0018
  186. #define PDR_SYNTH_IQ_CAL_PA_DETECTOR 0x0000
  187. #define PDR_SYNTH_IQ_CAL_DISABLED 0x0008
  188. #define PDR_SYNTH_IQ_CAL_ZIF 0x0010
  189. #define PDR_SYNTH_FAA_SWITCH_MASK 0x0020
  190. #define PDR_SYNTH_FAA_SWITCH_ENABLED 0x0020
  191. #define PDR_SYNTH_24_GHZ_MASK 0x0040
  192. #define PDR_SYNTH_24_GHZ_DISABLED 0x0040
  193. #define PDR_SYNTH_5_GHZ_MASK 0x0080
  194. #define PDR_SYNTH_5_GHZ_DISABLED 0x0080
  195. #define PDR_SYNTH_RX_DIV_MASK 0x0100
  196. #define PDR_SYNTH_RX_DIV_SUPPORTED 0x0100
  197. #define PDR_SYNTH_TX_DIV_MASK 0x0200
  198. #define PDR_SYNTH_TX_DIV_SUPPORTED 0x0200
  199. #define PDR_SYNTH_ASM_MASK 0x0400
  200. #define PDR_SYNTH_ASM_XSWON 0x0400
  201. #endif /* EEPROM_H */