rxtx.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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. * You should have received a copy of the GNU General Public License along
  16. * with this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18. *
  19. * File: rxtx.h
  20. *
  21. * Purpose:
  22. *
  23. * Author: Jerry Chen
  24. *
  25. * Date: Jun. 27, 2002
  26. *
  27. */
  28. #ifndef __RXTX_H__
  29. #define __RXTX_H__
  30. #include "device.h"
  31. #include "wcmd.h"
  32. #include "baseband.h"
  33. #define DEFAULT_MGN_LIFETIME_RES_64us 125 /* 64us */
  34. #define DEFAULT_MSDU_LIFETIME_RES_64us 8000
  35. /* MIC HDR data header */
  36. struct vnt_mic_hdr {
  37. u8 id;
  38. u8 tx_priority;
  39. u8 mic_addr2[6];
  40. u8 ccmp_pn[IEEE80211_CCMP_PN_LEN];
  41. __be16 payload_len;
  42. __be16 hlen;
  43. __le16 frame_control;
  44. u8 addr1[6];
  45. u8 addr2[6];
  46. u8 addr3[6];
  47. __le16 seq_ctrl;
  48. u8 addr4[6];
  49. u16 packing; /* packing to 48 bytes */
  50. } __packed;
  51. /* RsvTime buffer header */
  52. struct vnt_rrv_time_rts {
  53. __le16 rts_rrv_time_ba;
  54. __le16 rts_rrv_time_aa;
  55. __le16 rts_rrv_time_bb;
  56. u16 wReserved;
  57. __le16 rrv_time_b;
  58. __le16 rrv_time_a;
  59. } __packed;
  60. struct vnt_rrv_time_cts {
  61. __le16 cts_rrv_time_ba;
  62. u16 wReserved;
  63. __le16 rrv_time_b;
  64. __le16 rrv_time_a;
  65. } __packed;
  66. struct vnt_rrv_time_ab {
  67. __le16 rts_rrv_time;
  68. __le16 rrv_time;
  69. } __packed;
  70. /* TX data header */
  71. struct vnt_tx_datahead_g {
  72. struct vnt_phy_field b;
  73. struct vnt_phy_field a;
  74. __le16 duration_b;
  75. __le16 duration_a;
  76. __le16 time_stamp_off_b;
  77. __le16 time_stamp_off_a;
  78. struct ieee80211_hdr hdr;
  79. } __packed;
  80. struct vnt_tx_datahead_g_fb {
  81. struct vnt_phy_field b;
  82. struct vnt_phy_field a;
  83. __le16 duration_b;
  84. __le16 duration_a;
  85. __le16 duration_a_f0;
  86. __le16 duration_a_f1;
  87. __le16 time_stamp_off_b;
  88. __le16 time_stamp_off_a;
  89. struct ieee80211_hdr hdr;
  90. } __packed;
  91. struct vnt_tx_datahead_ab {
  92. struct vnt_phy_field ab;
  93. __le16 duration;
  94. __le16 time_stamp_off;
  95. struct ieee80211_hdr hdr;
  96. } __packed;
  97. struct vnt_tx_datahead_a_fb {
  98. struct vnt_phy_field a;
  99. __le16 duration;
  100. __le16 time_stamp_off;
  101. __le16 duration_f0;
  102. __le16 duration_f1;
  103. struct ieee80211_hdr hdr;
  104. } __packed;
  105. /* RTS buffer header */
  106. struct vnt_rts_g {
  107. struct vnt_phy_field b;
  108. struct vnt_phy_field a;
  109. __le16 duration_ba;
  110. __le16 duration_aa;
  111. __le16 duration_bb;
  112. u16 wReserved;
  113. struct ieee80211_rts data;
  114. struct vnt_tx_datahead_g data_head;
  115. } __packed;
  116. struct vnt_rts_g_fb {
  117. struct vnt_phy_field b;
  118. struct vnt_phy_field a;
  119. __le16 duration_ba;
  120. __le16 duration_aa;
  121. __le16 duration_bb;
  122. u16 wReserved;
  123. __le16 rts_duration_ba_f0;
  124. __le16 rts_duration_aa_f0;
  125. __le16 rts_duration_ba_f1;
  126. __le16 rts_duration_aa_f1;
  127. struct ieee80211_rts data;
  128. struct vnt_tx_datahead_g_fb data_head;
  129. } __packed;
  130. struct vnt_rts_ab {
  131. struct vnt_phy_field ab;
  132. __le16 duration;
  133. u16 wReserved;
  134. struct ieee80211_rts data;
  135. struct vnt_tx_datahead_ab data_head;
  136. } __packed;
  137. struct vnt_rts_a_fb {
  138. struct vnt_phy_field a;
  139. __le16 duration;
  140. u16 wReserved;
  141. __le16 rts_duration_f0;
  142. __le16 rts_duration_f1;
  143. struct ieee80211_rts data;
  144. struct vnt_tx_datahead_a_fb data_head;
  145. } __packed;
  146. /* CTS buffer header */
  147. struct vnt_cts {
  148. struct vnt_phy_field b;
  149. __le16 duration_ba;
  150. u16 wReserved;
  151. struct ieee80211_cts data;
  152. u16 reserved2;
  153. struct vnt_tx_datahead_g data_head;
  154. } __packed;
  155. struct vnt_cts_fb {
  156. struct vnt_phy_field b;
  157. __le16 duration_ba;
  158. u16 wReserved;
  159. __le16 cts_duration_ba_f0;
  160. __le16 cts_duration_ba_f1;
  161. struct ieee80211_cts data;
  162. u16 reserved2;
  163. struct vnt_tx_datahead_g_fb data_head;
  164. } __packed;
  165. union vnt_tx_data_head {
  166. /* rts g */
  167. struct vnt_rts_g rts_g;
  168. struct vnt_rts_g_fb rts_g_fb;
  169. /* rts a/b */
  170. struct vnt_rts_ab rts_ab;
  171. struct vnt_rts_a_fb rts_a_fb;
  172. /* cts g */
  173. struct vnt_cts cts_g;
  174. struct vnt_cts_fb cts_g_fb;
  175. /* no rts/cts */
  176. struct vnt_tx_datahead_a_fb data_head_a_fb;
  177. struct vnt_tx_datahead_ab data_head_ab;
  178. };
  179. struct vnt_tx_mic_hdr {
  180. struct vnt_mic_hdr hdr;
  181. union vnt_tx_data_head head;
  182. } __packed;
  183. union vnt_tx {
  184. struct vnt_tx_mic_hdr mic;
  185. union vnt_tx_data_head head;
  186. };
  187. union vnt_tx_head {
  188. struct {
  189. struct vnt_rrv_time_rts rts;
  190. union vnt_tx tx;
  191. } __packed tx_rts;
  192. struct {
  193. struct vnt_rrv_time_cts cts;
  194. union vnt_tx tx;
  195. } __packed tx_cts;
  196. struct {
  197. struct vnt_rrv_time_ab ab;
  198. union vnt_tx tx;
  199. } __packed tx_ab;
  200. };
  201. struct vnt_tx_fifo_head {
  202. u8 tx_key[WLAN_KEY_LEN_CCMP];
  203. __le16 fifo_ctl;
  204. __le16 time_stamp;
  205. __le16 frag_ctl;
  206. __le16 current_rate;
  207. } __packed;
  208. struct vnt_tx_buffer {
  209. u8 type;
  210. u8 pkt_no;
  211. __le16 tx_byte_count;
  212. struct vnt_tx_fifo_head fifo_head;
  213. union vnt_tx_head tx_head;
  214. } __packed;
  215. struct vnt_tx_short_buf_head {
  216. __le16 fifo_ctl;
  217. u16 time_stamp;
  218. struct vnt_phy_field ab;
  219. __le16 duration;
  220. __le16 time_stamp_off;
  221. } __packed;
  222. struct vnt_beacon_buffer {
  223. u8 type;
  224. u8 pkt_no;
  225. __le16 tx_byte_count;
  226. struct vnt_tx_short_buf_head short_head;
  227. struct ieee80211_mgmt mgmt_hdr;
  228. } __packed;
  229. int vnt_tx_packet(struct vnt_private *, struct sk_buff *);
  230. int vnt_beacon_make(struct vnt_private *, struct ieee80211_vif *);
  231. int vnt_beacon_enable(struct vnt_private *, struct ieee80211_vif *,
  232. struct ieee80211_bss_conf *);
  233. #endif /* __RXTX_H__ */