Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 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 | * |
Jim Lieb | 612822f | 2009-08-12 14:54:03 -0700 | [diff] [blame] | 19 | * File: rxtx.h |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 20 | * |
| 21 | * Purpose: |
| 22 | * |
| 23 | * Author: Jerry Chen |
| 24 | * |
| 25 | * Date: Jun. 27, 2002 |
| 26 | * |
| 27 | */ |
| 28 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 29 | #ifndef __RXTX_H__ |
| 30 | #define __RXTX_H__ |
| 31 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 32 | #include "ttype.h" |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 33 | #include "device.h" |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 34 | #include "wcmd.h" |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 35 | |
| 36 | /*--------------------- Export Definitions -------------------------*/ |
| 37 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 38 | /*--------------------- Export Variables --------------------------*/ |
| 39 | |
| 40 | /*--------------------- Export Functions --------------------------*/ |
| 41 | |
Malcolm Priestley | 11a72e5 | 2014-08-09 20:15:56 +0100 | [diff] [blame] | 42 | /* MIC HDR data header */ |
| 43 | struct vnt_mic_hdr { |
| 44 | u8 id; |
| 45 | u8 tx_priority; |
| 46 | u8 mic_addr2[ETH_ALEN]; |
Malcolm Priestley | 09a903b | 2014-08-22 22:35:10 +0100 | [diff] [blame] | 47 | u8 ccmp_pn[IEEE80211_CCMP_PN_LEN]; |
Malcolm Priestley | 11a72e5 | 2014-08-09 20:15:56 +0100 | [diff] [blame] | 48 | __be16 payload_len; |
| 49 | __be16 hlen; |
| 50 | __le16 frame_control; |
| 51 | u8 addr1[ETH_ALEN]; |
| 52 | u8 addr2[ETH_ALEN]; |
| 53 | u8 addr3[ETH_ALEN]; |
| 54 | __le16 seq_ctrl; |
| 55 | u8 addr4[ETH_ALEN]; |
| 56 | u16 packing; /* packing to 48 bytes */ |
| 57 | } __packed; |
| 58 | |
Malcolm Priestley | a9e6a2d | 2014-08-30 22:25:27 +0100 | [diff] [blame] | 59 | /* RsvTime buffer header */ |
| 60 | struct vnt_rrv_time_rts { |
| 61 | __le16 rts_rrv_time_ba; |
| 62 | __le16 rts_rrv_time_aa; |
| 63 | __le16 rts_rrv_time_bb; |
| 64 | u16 reserved; |
| 65 | __le16 rrv_time_b; |
| 66 | __le16 rrv_time_a; |
| 67 | } __packed; |
| 68 | |
Malcolm Priestley | d66a5a7 | 2014-08-30 22:25:28 +0100 | [diff] [blame] | 69 | struct vnt_rrv_time_cts { |
| 70 | __le16 cts_rrv_time_ba; |
| 71 | u16 reserved; |
| 72 | __le16 rrv_time_b; |
| 73 | __le16 rrv_time_a; |
| 74 | } __packed; |
| 75 | |
Malcolm Priestley | f6a634c | 2014-08-30 22:25:29 +0100 | [diff] [blame] | 76 | struct vnt_rrv_time_ab { |
| 77 | __le16 rts_rrv_time; |
| 78 | __le16 rrv_time; |
| 79 | } __packed; |
| 80 | |
Malcolm Priestley | 72edb7e | 2014-08-30 22:25:34 +0100 | [diff] [blame] | 81 | /* TX data header */ |
| 82 | struct vnt_tx_datahead_g { |
| 83 | struct vnt_phy_field b; |
| 84 | struct vnt_phy_field a; |
| 85 | __le16 duration_b; |
| 86 | __le16 duration_a; |
| 87 | __le16 time_stamp_off_b; |
| 88 | __le16 time_stamp_off_a; |
| 89 | } __packed; |
| 90 | |
Malcolm Priestley | 2dd7667 | 2014-08-30 22:25:35 +0100 | [diff] [blame] | 91 | struct vnt_tx_datahead_g_fb { |
| 92 | struct vnt_phy_field b; |
| 93 | struct vnt_phy_field a; |
| 94 | __le16 duration_b; |
| 95 | __le16 duration_a; |
| 96 | __le16 duration_a_f0; |
| 97 | __le16 duration_a_f1; |
| 98 | __le16 time_stamp_off_b; |
| 99 | __le16 time_stamp_off_a; |
| 100 | } __packed; |
| 101 | |
Malcolm Priestley | 9ce842a | 2014-08-30 22:25:36 +0100 | [diff] [blame] | 102 | struct vnt_tx_datahead_ab { |
| 103 | struct vnt_phy_field ab; |
| 104 | __le16 duration; |
| 105 | __le16 time_stamp_off; |
| 106 | } __packed; |
| 107 | |
Malcolm Priestley | 9c62c7a | 2014-08-30 22:25:37 +0100 | [diff] [blame] | 108 | struct vnt_tx_datahead_a_fb { |
| 109 | struct vnt_phy_field a; |
| 110 | __le16 duration; |
| 111 | __le16 time_stamp_off; |
| 112 | __le16 duration_f0; |
| 113 | __le16 duration_f1; |
| 114 | } __packed; |
| 115 | |
Malcolm Priestley | 17434f0 | 2014-08-30 22:25:41 +0100 | [diff] [blame] | 116 | /* RTS buffer header */ |
| 117 | struct vnt_rts_g { |
| 118 | struct vnt_phy_field b; |
| 119 | struct vnt_phy_field a; |
| 120 | __le16 duration_ba; |
| 121 | __le16 duration_aa; |
| 122 | __le16 duration_bb; |
| 123 | u16 reserved; |
| 124 | struct ieee80211_rts data; |
| 125 | } __packed; |
| 126 | |
Malcolm Priestley | 9587b09 | 2014-08-30 22:25:42 +0100 | [diff] [blame] | 127 | struct vnt_rts_g_fb { |
| 128 | struct vnt_phy_field b; |
| 129 | struct vnt_phy_field a; |
| 130 | __le16 duration_ba; |
| 131 | __le16 duration_aa; |
| 132 | __le16 duration_bb; |
| 133 | u16 wReserved; |
| 134 | __le16 rts_duration_ba_f0; |
| 135 | __le16 rts_duration_aa_f0; |
| 136 | __le16 rts_duration_ba_f1; |
| 137 | __le16 rts_duration_aa_f1; |
| 138 | struct ieee80211_rts data; |
| 139 | } __packed; |
| 140 | |
Malcolm Priestley | e21eb1c | 2014-08-30 22:25:43 +0100 | [diff] [blame] | 141 | struct vnt_rts_ab { |
| 142 | struct vnt_phy_field ab; |
| 143 | __le16 duration; |
| 144 | u16 reserved; |
| 145 | struct ieee80211_rts data; |
| 146 | } __packed; |
| 147 | |
Malcolm Priestley | 8e44804 | 2014-08-30 22:25:44 +0100 | [diff] [blame] | 148 | struct vnt_rts_a_fb { |
| 149 | struct vnt_phy_field a; |
| 150 | __le16 duration; |
| 151 | u16 reserved; |
| 152 | __le16 rts_duration_f0; |
| 153 | __le16 rts_duration_f1; |
| 154 | struct ieee80211_rts data; |
| 155 | } __packed; |
| 156 | |
Malcolm Priestley | f5172b0 | 2014-08-30 22:25:45 +0100 | [diff] [blame] | 157 | /* CTS buffer header */ |
| 158 | struct vnt_cts { |
| 159 | struct vnt_phy_field b; |
| 160 | __le16 duration_ba; |
| 161 | u16 reserved; |
| 162 | struct ieee80211_cts data; |
| 163 | u16 reserved2; |
| 164 | } __packed; |
| 165 | |
Malcolm Priestley | db1afd1 | 2014-08-30 22:25:46 +0100 | [diff] [blame] | 166 | struct vnt_cts_fb { |
| 167 | struct vnt_phy_field b; |
| 168 | __le16 duration_ba; |
| 169 | u16 reserved; |
| 170 | __le16 cts_duration_ba_f0; |
| 171 | __le16 cts_duration_ba_f1; |
| 172 | struct ieee80211_cts data; |
| 173 | u16 reserved2; |
| 174 | } __packed; |
| 175 | |
Malcolm Priestley | 01eec15 | 2014-10-29 17:43:38 +0000 | [diff] [blame] | 176 | struct vnt_tx_fifo_head { |
| 177 | u8 tx_key[WLAN_KEY_LEN_CCMP]; |
| 178 | __le16 fifo_ctl; |
| 179 | __le16 time_stamp; |
| 180 | __le16 frag_ctl; |
| 181 | __le16 current_rate; |
| 182 | } __packed; |
| 183 | |
Malcolm Priestley | 9641723 | 2014-08-22 22:35:11 +0100 | [diff] [blame] | 184 | struct vnt_tx_short_buf_head { |
| 185 | __le16 fifo_ctl; |
| 186 | u16 time_stamp; |
| 187 | struct vnt_phy_field ab; |
| 188 | __le16 duration; |
| 189 | __le16 time_stamp_off; |
| 190 | } __packed; |
| 191 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 192 | void |
Joe Perches | 547f1cf | 2013-03-18 10:45:01 -0700 | [diff] [blame] | 193 | vGenerateMACHeader( |
Malcolm Priestley | cf76dc4 | 2014-08-10 15:46:59 +0100 | [diff] [blame] | 194 | struct vnt_private *, |
Joe Perches | 547f1cf | 2013-03-18 10:45:01 -0700 | [diff] [blame] | 195 | unsigned char *pbyBufferAddr, |
| 196 | unsigned short wDuration, |
| 197 | PSEthernetHeader psEthHeader, |
| 198 | bool bNeedEncrypt, |
| 199 | unsigned short wFragType, |
| 200 | unsigned int uDMAIdx, |
| 201 | unsigned int uFragIdx |
| 202 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 203 | |
Charles Clément | b6e95cd | 2010-06-02 09:52:01 -0700 | [diff] [blame] | 204 | unsigned int |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 205 | cbGetFragCount( |
Malcolm Priestley | cf76dc4 | 2014-08-10 15:46:59 +0100 | [diff] [blame] | 206 | struct vnt_private *, |
Joe Perches | 547f1cf | 2013-03-18 10:45:01 -0700 | [diff] [blame] | 207 | PSKeyItem pTransmitKey, |
| 208 | unsigned int cbFrameBodySize, |
| 209 | PSEthernetHeader psEthHeader |
| 210 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 211 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 212 | void |
Malcolm Priestley | cf76dc4 | 2014-08-10 15:46:59 +0100 | [diff] [blame] | 213 | vGenerateFIFOHeader(struct vnt_private *, unsigned char byPktTyp, |
| 214 | unsigned char *pbyTxBufferAddr, bool bNeedEncrypt, |
| 215 | unsigned int cbPayloadSize, unsigned int uDMAIdx, |
| 216 | PSTxDesc pHeadTD, PSEthernetHeader psEthHeader, |
| 217 | unsigned char *pPacket, PSKeyItem pTransmitKey, |
| 218 | unsigned int uNodeIndex, unsigned int *puMACfragNum, |
| 219 | unsigned int *pcbHeaderSize); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 220 | |
Malcolm Priestley | cf76dc4 | 2014-08-10 15:46:59 +0100 | [diff] [blame] | 221 | void vDMA0_tx_80211(struct vnt_private *, struct sk_buff *skb, |
| 222 | unsigned char *pbMPDU, unsigned int cbMPDULen); |
| 223 | CMD_STATUS csMgmt_xmit(struct vnt_private *, PSTxMgmtPacket pPacket); |
| 224 | CMD_STATUS csBeacon_xmit(struct vnt_private *, PSTxMgmtPacket pPacket); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 225 | |
Malcolm Priestley | 01eec15 | 2014-10-29 17:43:38 +0000 | [diff] [blame] | 226 | int vnt_generate_fifo_header(struct vnt_private *, u32, |
| 227 | PSTxDesc head_td, struct sk_buff *); |
| 228 | int vnt_beacon_make(struct vnt_private *, struct ieee80211_vif *); |
| 229 | int vnt_beacon_enable(struct vnt_private *, struct ieee80211_vif *, |
| 230 | struct ieee80211_bss_conf *); |
| 231 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 232 | #endif // __RXTX_H__ |