rxtx.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. /*
  2. * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
  3. * All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. *
  16. * File: rxtx.h
  17. *
  18. * Purpose:
  19. *
  20. * Author: Jerry Chen
  21. *
  22. * Date: Jun. 27, 2002
  23. *
  24. */
  25. #ifndef __RXTX_H__
  26. #define __RXTX_H__
  27. #include "device.h"
  28. #include "wcmd.h"
  29. #include "baseband.h"
  30. #define DEFAULT_MGN_LIFETIME_RES_64us 125 /* 64us */
  31. #define DEFAULT_MSDU_LIFETIME_RES_64us 8000
  32. /* MIC HDR data header */
  33. struct vnt_mic_hdr {
  34. u8 id;
  35. u8 tx_priority;
  36. u8 mic_addr2[6];
  37. u8 ccmp_pn[IEEE80211_CCMP_PN_LEN];
  38. __be16 payload_len;
  39. __be16 hlen;
  40. __le16 frame_control;
  41. u8 addr1[6];
  42. u8 addr2[6];
  43. u8 addr3[6];
  44. __le16 seq_ctrl;
  45. u8 addr4[6];
  46. u16 packing; /* packing to 48 bytes */
  47. } __packed;
  48. /* RsvTime buffer header */
  49. struct vnt_rrv_time_rts {
  50. __le16 rts_rrv_time_ba;
  51. __le16 rts_rrv_time_aa;
  52. __le16 rts_rrv_time_bb;
  53. u16 wReserved;
  54. __le16 rrv_time_b;
  55. __le16 rrv_time_a;
  56. } __packed;
  57. struct vnt_rrv_time_cts {
  58. __le16 cts_rrv_time_ba;
  59. u16 wReserved;
  60. __le16 rrv_time_b;
  61. __le16 rrv_time_a;
  62. } __packed;
  63. struct vnt_rrv_time_ab {
  64. __le16 rts_rrv_time;
  65. __le16 rrv_time;
  66. } __packed;
  67. /* TX data header */
  68. struct vnt_tx_datahead_g {
  69. struct vnt_phy_field b;
  70. struct vnt_phy_field a;
  71. __le16 duration_b;
  72. __le16 duration_a;
  73. __le16 time_stamp_off_b;
  74. __le16 time_stamp_off_a;
  75. struct ieee80211_hdr hdr;
  76. } __packed;
  77. struct vnt_tx_datahead_g_fb {
  78. struct vnt_phy_field b;
  79. struct vnt_phy_field a;
  80. __le16 duration_b;
  81. __le16 duration_a;
  82. __le16 duration_a_f0;
  83. __le16 duration_a_f1;
  84. __le16 time_stamp_off_b;
  85. __le16 time_stamp_off_a;
  86. struct ieee80211_hdr hdr;
  87. } __packed;
  88. struct vnt_tx_datahead_ab {
  89. struct vnt_phy_field ab;
  90. __le16 duration;
  91. __le16 time_stamp_off;
  92. struct ieee80211_hdr hdr;
  93. } __packed;
  94. struct vnt_tx_datahead_a_fb {
  95. struct vnt_phy_field a;
  96. __le16 duration;
  97. __le16 time_stamp_off;
  98. __le16 duration_f0;
  99. __le16 duration_f1;
  100. struct ieee80211_hdr hdr;
  101. } __packed;
  102. /* RTS buffer header */
  103. struct vnt_rts_g {
  104. struct vnt_phy_field b;
  105. struct vnt_phy_field a;
  106. __le16 duration_ba;
  107. __le16 duration_aa;
  108. __le16 duration_bb;
  109. u16 wReserved;
  110. struct ieee80211_rts data;
  111. struct vnt_tx_datahead_g data_head;
  112. } __packed;
  113. struct vnt_rts_g_fb {
  114. struct vnt_phy_field b;
  115. struct vnt_phy_field a;
  116. __le16 duration_ba;
  117. __le16 duration_aa;
  118. __le16 duration_bb;
  119. u16 wReserved;
  120. __le16 rts_duration_ba_f0;
  121. __le16 rts_duration_aa_f0;
  122. __le16 rts_duration_ba_f1;
  123. __le16 rts_duration_aa_f1;
  124. struct ieee80211_rts data;
  125. struct vnt_tx_datahead_g_fb data_head;
  126. } __packed;
  127. struct vnt_rts_ab {
  128. struct vnt_phy_field ab;
  129. __le16 duration;
  130. u16 wReserved;
  131. struct ieee80211_rts data;
  132. struct vnt_tx_datahead_ab data_head;
  133. } __packed;
  134. struct vnt_rts_a_fb {
  135. struct vnt_phy_field a;
  136. __le16 duration;
  137. u16 wReserved;
  138. __le16 rts_duration_f0;
  139. __le16 rts_duration_f1;
  140. struct ieee80211_rts data;
  141. struct vnt_tx_datahead_a_fb data_head;
  142. } __packed;
  143. /* CTS buffer header */
  144. struct vnt_cts {
  145. struct vnt_phy_field b;
  146. __le16 duration_ba;
  147. u16 wReserved;
  148. struct ieee80211_cts data;
  149. u16 reserved2;
  150. struct vnt_tx_datahead_g data_head;
  151. } __packed;
  152. struct vnt_cts_fb {
  153. struct vnt_phy_field b;
  154. __le16 duration_ba;
  155. u16 wReserved;
  156. __le16 cts_duration_ba_f0;
  157. __le16 cts_duration_ba_f1;
  158. struct ieee80211_cts data;
  159. u16 reserved2;
  160. struct vnt_tx_datahead_g_fb data_head;
  161. } __packed;
  162. union vnt_tx_data_head {
  163. /* rts g */
  164. struct vnt_rts_g rts_g;
  165. struct vnt_rts_g_fb rts_g_fb;
  166. /* rts a/b */
  167. struct vnt_rts_ab rts_ab;
  168. struct vnt_rts_a_fb rts_a_fb;
  169. /* cts g */
  170. struct vnt_cts cts_g;
  171. struct vnt_cts_fb cts_g_fb;
  172. /* no rts/cts */
  173. struct vnt_tx_datahead_a_fb data_head_a_fb;
  174. struct vnt_tx_datahead_ab data_head_ab;
  175. };
  176. struct vnt_tx_mic_hdr {
  177. struct vnt_mic_hdr hdr;
  178. union vnt_tx_data_head head;
  179. } __packed;
  180. union vnt_tx {
  181. struct vnt_tx_mic_hdr mic;
  182. union vnt_tx_data_head head;
  183. };
  184. union vnt_tx_head {
  185. struct {
  186. struct vnt_rrv_time_rts rts;
  187. union vnt_tx tx;
  188. } __packed tx_rts;
  189. struct {
  190. struct vnt_rrv_time_cts cts;
  191. union vnt_tx tx;
  192. } __packed tx_cts;
  193. struct {
  194. struct vnt_rrv_time_ab ab;
  195. union vnt_tx tx;
  196. } __packed tx_ab;
  197. };
  198. struct vnt_tx_fifo_head {
  199. u8 tx_key[WLAN_KEY_LEN_CCMP];
  200. __le16 fifo_ctl;
  201. __le16 time_stamp;
  202. __le16 frag_ctl;
  203. __le16 current_rate;
  204. } __packed;
  205. struct vnt_tx_buffer {
  206. u8 type;
  207. u8 pkt_no;
  208. __le16 tx_byte_count;
  209. struct vnt_tx_fifo_head fifo_head;
  210. union vnt_tx_head tx_head;
  211. } __packed;
  212. struct vnt_tx_short_buf_head {
  213. __le16 fifo_ctl;
  214. u16 time_stamp;
  215. struct vnt_phy_field ab;
  216. __le16 duration;
  217. __le16 time_stamp_off;
  218. } __packed;
  219. struct vnt_beacon_buffer {
  220. u8 type;
  221. u8 pkt_no;
  222. __le16 tx_byte_count;
  223. struct vnt_tx_short_buf_head short_head;
  224. struct ieee80211_mgmt mgmt_hdr;
  225. } __packed;
  226. int vnt_tx_packet(struct vnt_private *, struct sk_buff *);
  227. int vnt_beacon_make(struct vnt_private *, struct ieee80211_vif *);
  228. int vnt_beacon_enable(struct vnt_private *, struct ieee80211_vif *,
  229. struct ieee80211_bss_conf *);
  230. #endif /* __RXTX_H__ */