p54common.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. #ifndef PRISM54COMMON_H
  2. #define PRISM54COMMON_H
  3. /*
  4. * Common code specific definitions for mac80211 Prism54 drivers
  5. *
  6. * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net>
  7. * Copyright (c) 2007, Christian Lamparter <chunkeey@web.de>
  8. *
  9. * Based on the islsm (softmac prism54) driver, which is:
  10. * Copyright 2004-2006 Jean-Baptiste Note <jbnote@gmail.com>, et al.
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License version 2 as
  14. * published by the Free Software Foundation.
  15. */
  16. struct bootrec {
  17. __le32 code;
  18. __le32 len;
  19. u32 data[0];
  20. } __attribute__((packed));
  21. struct bootrec_exp_if {
  22. __le16 role;
  23. __le16 if_id;
  24. __le16 variant;
  25. __le16 btm_compat;
  26. __le16 top_compat;
  27. } __attribute__((packed));
  28. #define BR_CODE_MIN 0x80000000
  29. #define BR_CODE_COMPONENT_ID 0x80000001
  30. #define BR_CODE_COMPONENT_VERSION 0x80000002
  31. #define BR_CODE_DEPENDENT_IF 0x80000003
  32. #define BR_CODE_EXPOSED_IF 0x80000004
  33. #define BR_CODE_DESCR 0x80000101
  34. #define BR_CODE_MAX 0x8FFFFFFF
  35. #define BR_CODE_END_OF_BRA 0xFF0000FF
  36. #define LEGACY_BR_CODE_END_OF_BRA 0xFFFFFFFF
  37. #define FW_FMAC 0x464d4143
  38. #define FW_LM86 0x4c4d3836
  39. #define FW_LM87 0x4c4d3837
  40. #define FW_LM20 0x4c4d3230
  41. /* PDA defines are Copyright (C) 2005 Nokia Corporation (taken from islsm_pda.h) */
  42. struct pda_entry {
  43. __le16 len; /* includes both code and data */
  44. __le16 code;
  45. u8 data[0];
  46. } __attribute__ ((packed));
  47. struct eeprom_pda_wrap {
  48. __le32 magic;
  49. __le16 pad;
  50. __le16 len;
  51. __le32 arm_opcode;
  52. u8 data[0];
  53. } __attribute__ ((packed));
  54. struct pda_iq_autocal_entry {
  55. __le16 freq;
  56. __le16 iq_param[4];
  57. } __attribute__ ((packed));
  58. struct pda_channel_output_limit {
  59. __le16 freq;
  60. u8 val_bpsk;
  61. u8 val_qpsk;
  62. u8 val_16qam;
  63. u8 val_64qam;
  64. u8 rate_set_mask;
  65. u8 rate_set_size;
  66. } __attribute__ ((packed));
  67. struct pda_pa_curve_data_sample_rev0 {
  68. u8 rf_power;
  69. u8 pa_detector;
  70. u8 pcv;
  71. } __attribute__ ((packed));
  72. struct pda_pa_curve_data_sample_rev1 {
  73. u8 rf_power;
  74. u8 pa_detector;
  75. u8 data_barker;
  76. u8 data_bpsk;
  77. u8 data_qpsk;
  78. u8 data_16qam;
  79. u8 data_64qam;
  80. u8 padding;
  81. } __attribute__ ((packed));
  82. struct pda_pa_curve_data {
  83. u8 cal_method_rev;
  84. u8 channels;
  85. u8 points_per_channel;
  86. u8 padding;
  87. u8 data[0];
  88. } __attribute__ ((packed));
  89. /*
  90. * this defines the PDR codes used to build PDAs as defined in document
  91. * number 553155. The current implementation mirrors version 1.1 of the
  92. * document and lists only PDRs supported by the ARM platform.
  93. */
  94. /* common and choice range (0x0000 - 0x0fff) */
  95. #define PDR_END 0x0000
  96. #define PDR_MANUFACTURING_PART_NUMBER 0x0001
  97. #define PDR_PDA_VERSION 0x0002
  98. #define PDR_NIC_SERIAL_NUMBER 0x0003
  99. #define PDR_MAC_ADDRESS 0x0101
  100. #define PDR_REGULATORY_DOMAIN_LIST 0x0103
  101. #define PDR_TEMPERATURE_TYPE 0x0107
  102. #define PDR_PRISM_PCI_IDENTIFIER 0x0402
  103. /* ARM range (0x1000 - 0x1fff) */
  104. #define PDR_COUNTRY_INFORMATION 0x1000
  105. #define PDR_INTERFACE_LIST 0x1001
  106. #define PDR_HARDWARE_PLATFORM_COMPONENT_ID 0x1002
  107. #define PDR_OEM_NAME 0x1003
  108. #define PDR_PRODUCT_NAME 0x1004
  109. #define PDR_UTF8_OEM_NAME 0x1005
  110. #define PDR_UTF8_PRODUCT_NAME 0x1006
  111. #define PDR_COUNTRY_LIST 0x1007
  112. #define PDR_DEFAULT_COUNTRY 0x1008
  113. #define PDR_ANTENNA_GAIN 0x1100
  114. #define PDR_PRISM_INDIGO_PA_CALIBRATION_DATA 0x1901
  115. #define PDR_RSSI_LINEAR_APPROXIMATION 0x1902
  116. #define PDR_PRISM_PA_CAL_OUTPUT_POWER_LIMITS 0x1903
  117. #define PDR_PRISM_PA_CAL_CURVE_DATA 0x1904
  118. #define PDR_RSSI_LINEAR_APPROXIMATION_DUAL_BAND 0x1905
  119. #define PDR_PRISM_ZIF_TX_IQ_CALIBRATION 0x1906
  120. #define PDR_REGULATORY_POWER_LIMITS 0x1907
  121. #define PDR_RSSI_LINEAR_APPROXIMATION_EXTENDED 0x1908
  122. #define PDR_RADIATED_TRANSMISSION_CORRECTION 0x1909
  123. #define PDR_PRISM_TX_IQ_CALIBRATION 0x190a
  124. /* reserved range (0x2000 - 0x7fff) */
  125. /* customer range (0x8000 - 0xffff) */
  126. #define PDR_BASEBAND_REGISTERS 0x8000
  127. #define PDR_PER_CHANNEL_BASEBAND_REGISTERS 0x8001
  128. /* stored in skb->cb */
  129. struct memrecord {
  130. u32 start_addr;
  131. u32 end_addr;
  132. };
  133. struct p54_eeprom_lm86 {
  134. __le16 offset;
  135. __le16 len;
  136. u8 data[0];
  137. } __attribute__ ((packed));
  138. struct p54_rx_hdr {
  139. __le16 magic;
  140. __le16 len;
  141. __le16 freq;
  142. u8 antenna;
  143. u8 rate;
  144. u8 rssi;
  145. u8 quality;
  146. u16 unknown2;
  147. __le64 timestamp;
  148. u8 data[0];
  149. } __attribute__ ((packed));
  150. struct p54_frame_sent_hdr {
  151. u8 status;
  152. u8 retries;
  153. __le16 ack_rssi;
  154. __le16 seq;
  155. u16 rate;
  156. } __attribute__ ((packed));
  157. struct p54_tx_control_allocdata {
  158. u8 rateset[8];
  159. u16 padding;
  160. u8 wep_key_present;
  161. u8 wep_key_len;
  162. u8 wep_key[16];
  163. __le32 frame_type;
  164. u32 padding2;
  165. __le16 magic4;
  166. u8 antenna;
  167. u8 output_power;
  168. __le32 magic5;
  169. u8 align[0];
  170. } __attribute__ ((packed));
  171. struct p54_tx_control_filter {
  172. __le16 filter_type;
  173. u8 dst[ETH_ALEN];
  174. u8 src[ETH_ALEN];
  175. u8 antenna;
  176. u8 debug;
  177. __le32 magic3;
  178. u8 rates[8]; // FIXME: what's this for?
  179. __le32 rx_addr;
  180. __le16 max_rx;
  181. __le16 rxhw;
  182. __le16 magic8;
  183. __le16 magic9;
  184. } __attribute__ ((packed));
  185. struct p54_tx_control_channel {
  186. __le16 magic1;
  187. __le16 magic2;
  188. u8 padding1[20];
  189. struct pda_iq_autocal_entry iq_autocal;
  190. u8 pa_points_per_curve;
  191. u8 val_barker;
  192. u8 val_bpsk;
  193. u8 val_qpsk;
  194. u8 val_16qam;
  195. u8 val_64qam;
  196. struct pda_pa_curve_data_sample_rev1 curve_data[0];
  197. /* additional padding/data after curve_data */
  198. } __attribute__ ((packed));
  199. struct p54_tx_control_led {
  200. __le16 mode;
  201. __le16 led_temporary;
  202. __le16 led_permanent;
  203. __le16 duration;
  204. } __attribute__ ((packed));
  205. struct p54_tx_vdcf_queues {
  206. __le16 aifs;
  207. __le16 cwmin;
  208. __le16 cwmax;
  209. __le16 txop;
  210. } __attribute__ ((packed));
  211. struct p54_tx_control_vdcf {
  212. u8 padding;
  213. u8 slottime;
  214. u8 magic1;
  215. u8 magic2;
  216. struct p54_tx_vdcf_queues queue[8];
  217. u8 pad2[4];
  218. __le16 frameburst;
  219. } __attribute__ ((packed));
  220. #endif /* PRISM54COMMON_H */