p54common.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. #ifndef P54COMMON_H
  2. #define P54COMMON_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. } __attribute__ ((packed));
  81. struct p54_pa_curve_data_sample {
  82. u8 rf_power;
  83. u8 pa_detector;
  84. u8 data_barker;
  85. u8 data_bpsk;
  86. u8 data_qpsk;
  87. u8 data_16qam;
  88. u8 data_64qam;
  89. u8 padding;
  90. } __attribute__ ((packed));
  91. struct pda_pa_curve_data {
  92. u8 cal_method_rev;
  93. u8 channels;
  94. u8 points_per_channel;
  95. u8 padding;
  96. u8 data[0];
  97. } __attribute__ ((packed));
  98. /*
  99. * this defines the PDR codes used to build PDAs as defined in document
  100. * number 553155. The current implementation mirrors version 1.1 of the
  101. * document and lists only PDRs supported by the ARM platform.
  102. */
  103. /* common and choice range (0x0000 - 0x0fff) */
  104. #define PDR_END 0x0000
  105. #define PDR_MANUFACTURING_PART_NUMBER 0x0001
  106. #define PDR_PDA_VERSION 0x0002
  107. #define PDR_NIC_SERIAL_NUMBER 0x0003
  108. #define PDR_MAC_ADDRESS 0x0101
  109. #define PDR_REGULATORY_DOMAIN_LIST 0x0103
  110. #define PDR_TEMPERATURE_TYPE 0x0107
  111. #define PDR_PRISM_PCI_IDENTIFIER 0x0402
  112. /* ARM range (0x1000 - 0x1fff) */
  113. #define PDR_COUNTRY_INFORMATION 0x1000
  114. #define PDR_INTERFACE_LIST 0x1001
  115. #define PDR_HARDWARE_PLATFORM_COMPONENT_ID 0x1002
  116. #define PDR_OEM_NAME 0x1003
  117. #define PDR_PRODUCT_NAME 0x1004
  118. #define PDR_UTF8_OEM_NAME 0x1005
  119. #define PDR_UTF8_PRODUCT_NAME 0x1006
  120. #define PDR_COUNTRY_LIST 0x1007
  121. #define PDR_DEFAULT_COUNTRY 0x1008
  122. #define PDR_ANTENNA_GAIN 0x1100
  123. #define PDR_PRISM_INDIGO_PA_CALIBRATION_DATA 0x1901
  124. #define PDR_RSSI_LINEAR_APPROXIMATION 0x1902
  125. #define PDR_PRISM_PA_CAL_OUTPUT_POWER_LIMITS 0x1903
  126. #define PDR_PRISM_PA_CAL_CURVE_DATA 0x1904
  127. #define PDR_RSSI_LINEAR_APPROXIMATION_DUAL_BAND 0x1905
  128. #define PDR_PRISM_ZIF_TX_IQ_CALIBRATION 0x1906
  129. #define PDR_REGULATORY_POWER_LIMITS 0x1907
  130. #define PDR_RSSI_LINEAR_APPROXIMATION_EXTENDED 0x1908
  131. #define PDR_RADIATED_TRANSMISSION_CORRECTION 0x1909
  132. #define PDR_PRISM_TX_IQ_CALIBRATION 0x190a
  133. /* reserved range (0x2000 - 0x7fff) */
  134. /* customer range (0x8000 - 0xffff) */
  135. #define PDR_BASEBAND_REGISTERS 0x8000
  136. #define PDR_PER_CHANNEL_BASEBAND_REGISTERS 0x8001
  137. /* stored in skb->cb */
  138. struct memrecord {
  139. u32 start_addr;
  140. u32 end_addr;
  141. };
  142. struct p54_eeprom_lm86 {
  143. __le16 offset;
  144. __le16 len;
  145. u8 data[0];
  146. } __attribute__ ((packed));
  147. struct p54_rx_hdr {
  148. __le16 magic;
  149. __le16 len;
  150. __le16 freq;
  151. u8 antenna;
  152. u8 rate;
  153. u8 rssi;
  154. u8 quality;
  155. u16 unknown2;
  156. __le64 timestamp;
  157. u8 data[0];
  158. } __attribute__ ((packed));
  159. struct p54_frame_sent_hdr {
  160. u8 status;
  161. u8 retries;
  162. __le16 ack_rssi;
  163. __le16 seq;
  164. u16 rate;
  165. } __attribute__ ((packed));
  166. struct p54_tx_control_allocdata {
  167. u8 rateset[8];
  168. u8 unalloc0[2];
  169. u8 key_type;
  170. u8 key_len;
  171. u8 key[16];
  172. u8 hw_queue;
  173. u8 unalloc1[9];
  174. u8 tx_antenna;
  175. u8 output_power;
  176. u8 cts_rate;
  177. u8 unalloc2[3];
  178. u8 align[0];
  179. } __attribute__ ((packed));
  180. struct p54_tx_control_filter {
  181. __le16 filter_type;
  182. u8 dst[ETH_ALEN];
  183. u8 src[ETH_ALEN];
  184. u8 antenna;
  185. u8 debug;
  186. __le32 magic3;
  187. u8 rates[8]; // FIXME: what's this for?
  188. __le32 rx_addr;
  189. __le16 max_rx;
  190. __le16 rxhw;
  191. __le16 magic8;
  192. __le16 magic9;
  193. } __attribute__ ((packed));
  194. struct p54_tx_control_channel {
  195. __le16 flags;
  196. __le16 dwell;
  197. u8 padding1[20];
  198. struct pda_iq_autocal_entry iq_autocal;
  199. u8 pa_points_per_curve;
  200. u8 val_barker;
  201. u8 val_bpsk;
  202. u8 val_qpsk;
  203. u8 val_16qam;
  204. u8 val_64qam;
  205. struct pda_pa_curve_data_sample_rev1 curve_data[8];
  206. u8 dup_bpsk;
  207. u8 dup_qpsk;
  208. u8 dup_16qam;
  209. u8 dup_64qam;
  210. __le16 rssical_mul;
  211. __le16 rssical_add;
  212. } __attribute__ ((packed));
  213. struct p54_tx_control_led {
  214. __le16 mode;
  215. __le16 led_temporary;
  216. __le16 led_permanent;
  217. __le16 duration;
  218. } __attribute__ ((packed));
  219. struct p54_tx_vdcf_queues {
  220. __le16 aifs;
  221. __le16 cwmin;
  222. __le16 cwmax;
  223. __le16 txop;
  224. } __attribute__ ((packed));
  225. struct p54_tx_control_vdcf {
  226. u8 padding;
  227. u8 slottime;
  228. u8 magic1;
  229. u8 magic2;
  230. struct p54_tx_vdcf_queues queue[8];
  231. u8 pad2[4];
  232. __le16 frameburst;
  233. } __attribute__ ((packed));
  234. #endif /* P54COMMON_H */