rxtx.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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 "ttype.h"
  31. #include "device.h"
  32. #include "wcmd.h"
  33. /*--------------------- Export Definitions -------------------------*/
  34. /*--------------------- Export Variables --------------------------*/
  35. /*--------------------- Export Functions --------------------------*/
  36. /* MIC HDR data header */
  37. struct vnt_mic_hdr {
  38. u8 id;
  39. u8 tx_priority;
  40. u8 mic_addr2[ETH_ALEN];
  41. u8 ccmp_pn[IEEE80211_CCMP_PN_LEN];
  42. __be16 payload_len;
  43. __be16 hlen;
  44. __le16 frame_control;
  45. u8 addr1[ETH_ALEN];
  46. u8 addr2[ETH_ALEN];
  47. u8 addr3[ETH_ALEN];
  48. __le16 seq_ctrl;
  49. u8 addr4[ETH_ALEN];
  50. u16 packing; /* packing to 48 bytes */
  51. } __packed;
  52. /* RsvTime buffer header */
  53. struct vnt_rrv_time_rts {
  54. __le16 rts_rrv_time_ba;
  55. __le16 rts_rrv_time_aa;
  56. __le16 rts_rrv_time_bb;
  57. u16 reserved;
  58. __le16 rrv_time_b;
  59. __le16 rrv_time_a;
  60. } __packed;
  61. struct vnt_rrv_time_cts {
  62. __le16 cts_rrv_time_ba;
  63. u16 reserved;
  64. __le16 rrv_time_b;
  65. __le16 rrv_time_a;
  66. } __packed;
  67. struct vnt_rrv_time_ab {
  68. __le16 rts_rrv_time;
  69. __le16 rrv_time;
  70. } __packed;
  71. /* TX data header */
  72. struct vnt_tx_datahead_g {
  73. struct vnt_phy_field b;
  74. struct vnt_phy_field a;
  75. __le16 duration_b;
  76. __le16 duration_a;
  77. __le16 time_stamp_off_b;
  78. __le16 time_stamp_off_a;
  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. } __packed;
  90. struct vnt_tx_datahead_ab {
  91. struct vnt_phy_field ab;
  92. __le16 duration;
  93. __le16 time_stamp_off;
  94. } __packed;
  95. struct vnt_tx_datahead_a_fb {
  96. struct vnt_phy_field a;
  97. __le16 duration;
  98. __le16 time_stamp_off;
  99. __le16 duration_f0;
  100. __le16 duration_f1;
  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 reserved;
  110. struct ieee80211_rts data;
  111. } __packed;
  112. struct vnt_rts_g_fb {
  113. struct vnt_phy_field b;
  114. struct vnt_phy_field a;
  115. __le16 duration_ba;
  116. __le16 duration_aa;
  117. __le16 duration_bb;
  118. u16 wReserved;
  119. __le16 rts_duration_ba_f0;
  120. __le16 rts_duration_aa_f0;
  121. __le16 rts_duration_ba_f1;
  122. __le16 rts_duration_aa_f1;
  123. struct ieee80211_rts data;
  124. } __packed;
  125. struct vnt_rts_ab {
  126. struct vnt_phy_field ab;
  127. __le16 duration;
  128. u16 reserved;
  129. struct ieee80211_rts data;
  130. } __packed;
  131. struct vnt_rts_a_fb {
  132. struct vnt_phy_field a;
  133. __le16 duration;
  134. u16 reserved;
  135. __le16 rts_duration_f0;
  136. __le16 rts_duration_f1;
  137. struct ieee80211_rts data;
  138. } __packed;
  139. /* CTS buffer header */
  140. struct vnt_cts {
  141. struct vnt_phy_field b;
  142. __le16 duration_ba;
  143. u16 reserved;
  144. struct ieee80211_cts data;
  145. u16 reserved2;
  146. } __packed;
  147. struct vnt_cts_fb {
  148. struct vnt_phy_field b;
  149. __le16 duration_ba;
  150. u16 reserved;
  151. __le16 cts_duration_ba_f0;
  152. __le16 cts_duration_ba_f1;
  153. struct ieee80211_cts data;
  154. u16 reserved2;
  155. } __packed;
  156. struct vnt_tx_short_buf_head {
  157. __le16 fifo_ctl;
  158. u16 time_stamp;
  159. struct vnt_phy_field ab;
  160. __le16 duration;
  161. __le16 time_stamp_off;
  162. } __packed;
  163. void
  164. vGenerateMACHeader(
  165. struct vnt_private *,
  166. unsigned char *pbyBufferAddr,
  167. unsigned short wDuration,
  168. PSEthernetHeader psEthHeader,
  169. bool bNeedEncrypt,
  170. unsigned short wFragType,
  171. unsigned int uDMAIdx,
  172. unsigned int uFragIdx
  173. );
  174. unsigned int
  175. cbGetFragCount(
  176. struct vnt_private *,
  177. PSKeyItem pTransmitKey,
  178. unsigned int cbFrameBodySize,
  179. PSEthernetHeader psEthHeader
  180. );
  181. void
  182. vGenerateFIFOHeader(struct vnt_private *, unsigned char byPktTyp,
  183. unsigned char *pbyTxBufferAddr, bool bNeedEncrypt,
  184. unsigned int cbPayloadSize, unsigned int uDMAIdx,
  185. PSTxDesc pHeadTD, PSEthernetHeader psEthHeader,
  186. unsigned char *pPacket, PSKeyItem pTransmitKey,
  187. unsigned int uNodeIndex, unsigned int *puMACfragNum,
  188. unsigned int *pcbHeaderSize);
  189. void vDMA0_tx_80211(struct vnt_private *, struct sk_buff *skb,
  190. unsigned char *pbMPDU, unsigned int cbMPDULen);
  191. CMD_STATUS csMgmt_xmit(struct vnt_private *, PSTxMgmtPacket pPacket);
  192. CMD_STATUS csBeacon_xmit(struct vnt_private *, PSTxMgmtPacket pPacket);
  193. #endif // __RXTX_H__