rxtx.h 4.9 KB

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