Forest Bond | 92b9679 | 2009-06-13 07:38:31 -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 | * |
| 19 | * File: rxtx.h |
| 20 | * |
| 21 | * Purpose: |
| 22 | * |
| 23 | * Author: Jerry Chen |
| 24 | * |
| 25 | * Date: Jun. 27, 2002 |
| 26 | * |
| 27 | */ |
| 28 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 29 | #ifndef __RXTX_H__ |
| 30 | #define __RXTX_H__ |
| 31 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 32 | #include "device.h" |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 33 | #include "wcmd.h" |
Malcolm Priestley | aed387c | 2013-08-20 22:52:30 +0100 | [diff] [blame] | 34 | #include "baseband.h" |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 35 | |
Malcolm Priestley | 5a5d6a8 | 2013-08-23 14:33:55 +0100 | [diff] [blame] | 36 | /* MIC HDR data header */ |
| 37 | struct vnt_mic_hdr { |
| 38 | u8 id; |
| 39 | u8 tx_priority; |
| 40 | u8 mic_addr2[6]; |
| 41 | __be32 tsc_47_16; |
| 42 | __be16 tsc_15_0; |
| 43 | __be16 payload_len; |
| 44 | __be16 hlen; |
| 45 | __le16 frame_control; |
| 46 | u8 addr1[6]; |
| 47 | u8 addr2[6]; |
| 48 | u8 addr3[6]; |
| 49 | __le16 seq_ctrl; |
| 50 | u8 addr4[6]; |
| 51 | u16 packing; /* packing to 48 bytes */ |
| 52 | } __packed; |
| 53 | |
Malcolm Priestley | 6398a59 | 2013-08-16 21:26:55 +0100 | [diff] [blame] | 54 | /* RsvTime buffer header */ |
| 55 | struct vnt_rrv_time_rts { |
| 56 | u16 wRTSTxRrvTime_ba; |
| 57 | u16 wRTSTxRrvTime_aa; |
| 58 | u16 wRTSTxRrvTime_bb; |
| 59 | u16 wReserved; |
| 60 | u16 wTxRrvTime_b; |
| 61 | u16 wTxRrvTime_a; |
| 62 | } __packed; |
| 63 | |
Malcolm Priestley | 4f99005 | 2013-08-16 23:38:57 +0100 | [diff] [blame] | 64 | struct vnt_rrv_time_cts { |
| 65 | u16 wCTSTxRrvTime_ba; |
| 66 | u16 wReserved; |
| 67 | u16 wTxRrvTime_b; |
| 68 | u16 wTxRrvTime_a; |
| 69 | } __packed; |
| 70 | |
Malcolm Priestley | 976467d | 2013-08-16 23:44:04 +0100 | [diff] [blame] | 71 | struct vnt_rrv_time_ab { |
| 72 | u16 wRTSTxRrvTime; |
| 73 | u16 wTxRrvTime; |
| 74 | } __packed; |
| 75 | |
Malcolm Priestley | 7e60a3de | 2013-08-16 23:48:03 +0100 | [diff] [blame] | 76 | /* TX data header */ |
| 77 | struct vnt_tx_datahead_g { |
Malcolm Priestley | aed387c | 2013-08-20 22:52:30 +0100 | [diff] [blame] | 78 | struct vnt_phy_field b; |
| 79 | struct vnt_phy_field a; |
Malcolm Priestley | 7e60a3de | 2013-08-16 23:48:03 +0100 | [diff] [blame] | 80 | u16 wDuration_b; |
| 81 | u16 wDuration_a; |
| 82 | u16 wTimeStampOff_b; |
| 83 | u16 wTimeStampOff_a; |
| 84 | } __packed; |
| 85 | |
Malcolm Priestley | 7c05c54 | 2013-08-16 23:49:15 +0100 | [diff] [blame] | 86 | struct vnt_tx_datahead_g_fb { |
Malcolm Priestley | aed387c | 2013-08-20 22:52:30 +0100 | [diff] [blame] | 87 | struct vnt_phy_field b; |
| 88 | struct vnt_phy_field a; |
Malcolm Priestley | 7c05c54 | 2013-08-16 23:49:15 +0100 | [diff] [blame] | 89 | u16 wDuration_b; |
| 90 | u16 wDuration_a; |
| 91 | u16 wDuration_a_f0; |
| 92 | u16 wDuration_a_f1; |
| 93 | u16 wTimeStampOff_b; |
| 94 | u16 wTimeStampOff_a; |
| 95 | } __packed; |
| 96 | |
Malcolm Priestley | 558becf | 2013-08-16 23:50:32 +0100 | [diff] [blame] | 97 | struct vnt_tx_datahead_ab { |
Malcolm Priestley | aed387c | 2013-08-20 22:52:30 +0100 | [diff] [blame] | 98 | struct vnt_phy_field ab; |
Malcolm Priestley | 558becf | 2013-08-16 23:50:32 +0100 | [diff] [blame] | 99 | u16 wDuration; |
| 100 | u16 wTimeStampOff; |
| 101 | } __packed; |
| 102 | |
Malcolm Priestley | 1da4ee2 | 2013-08-16 23:51:38 +0100 | [diff] [blame] | 103 | struct vnt_tx_datahead_a_fb { |
Malcolm Priestley | aed387c | 2013-08-20 22:52:30 +0100 | [diff] [blame] | 104 | struct vnt_phy_field a; |
Malcolm Priestley | 1da4ee2 | 2013-08-16 23:51:38 +0100 | [diff] [blame] | 105 | u16 wDuration; |
| 106 | u16 wTimeStampOff; |
| 107 | u16 wDuration_f0; |
| 108 | u16 wDuration_f1; |
| 109 | } __packed; |
| 110 | |
Malcolm Priestley | c521cb5 | 2013-08-15 21:23:25 +0100 | [diff] [blame] | 111 | /* RTS buffer header */ |
| 112 | struct vnt_rts_g { |
Malcolm Priestley | aed387c | 2013-08-20 22:52:30 +0100 | [diff] [blame] | 113 | struct vnt_phy_field b; |
| 114 | struct vnt_phy_field a; |
Malcolm Priestley | c521cb5 | 2013-08-15 21:23:25 +0100 | [diff] [blame] | 115 | u16 wDuration_ba; |
| 116 | u16 wDuration_aa; |
| 117 | u16 wDuration_bb; |
| 118 | u16 wReserved; |
| 119 | struct ieee80211_rts data; |
Malcolm Priestley | 78363fd | 2013-10-01 15:52:16 +0100 | [diff] [blame] | 120 | struct vnt_tx_datahead_g data_head; |
Malcolm Priestley | c521cb5 | 2013-08-15 21:23:25 +0100 | [diff] [blame] | 121 | } __packed; |
| 122 | |
| 123 | struct vnt_rts_g_fb { |
Malcolm Priestley | aed387c | 2013-08-20 22:52:30 +0100 | [diff] [blame] | 124 | struct vnt_phy_field b; |
| 125 | struct vnt_phy_field a; |
Malcolm Priestley | c521cb5 | 2013-08-15 21:23:25 +0100 | [diff] [blame] | 126 | u16 wDuration_ba; |
| 127 | u16 wDuration_aa; |
| 128 | u16 wDuration_bb; |
| 129 | u16 wReserved; |
| 130 | u16 wRTSDuration_ba_f0; |
| 131 | u16 wRTSDuration_aa_f0; |
| 132 | u16 wRTSDuration_ba_f1; |
| 133 | u16 wRTSDuration_aa_f1; |
| 134 | struct ieee80211_rts data; |
Malcolm Priestley | 5b852f5 | 2013-10-01 15:54:56 +0100 | [diff] [blame] | 135 | struct vnt_tx_datahead_g_fb data_head; |
Malcolm Priestley | c521cb5 | 2013-08-15 21:23:25 +0100 | [diff] [blame] | 136 | } __packed; |
| 137 | |
| 138 | struct vnt_rts_ab { |
Malcolm Priestley | aed387c | 2013-08-20 22:52:30 +0100 | [diff] [blame] | 139 | struct vnt_phy_field ab; |
Malcolm Priestley | c521cb5 | 2013-08-15 21:23:25 +0100 | [diff] [blame] | 140 | u16 wDuration; |
| 141 | u16 wReserved; |
| 142 | struct ieee80211_rts data; |
| 143 | } __packed; |
| 144 | |
| 145 | struct vnt_rts_a_fb { |
Malcolm Priestley | aed387c | 2013-08-20 22:52:30 +0100 | [diff] [blame] | 146 | struct vnt_phy_field a; |
Malcolm Priestley | c521cb5 | 2013-08-15 21:23:25 +0100 | [diff] [blame] | 147 | u16 wDuration; |
| 148 | u16 wReserved; |
| 149 | u16 wRTSDuration_f0; |
| 150 | u16 wRTSDuration_f1; |
| 151 | struct ieee80211_rts data; |
Malcolm Priestley | bd3f51f | 2013-10-01 15:56:48 +0100 | [diff] [blame] | 152 | struct vnt_tx_datahead_a_fb data_head; |
Malcolm Priestley | c521cb5 | 2013-08-15 21:23:25 +0100 | [diff] [blame] | 153 | } __packed; |
| 154 | |
Malcolm Priestley | f0c5ba2 | 2013-08-15 21:27:22 +0100 | [diff] [blame] | 155 | /* CTS buffer header */ |
| 156 | struct vnt_cts { |
Malcolm Priestley | aed387c | 2013-08-20 22:52:30 +0100 | [diff] [blame] | 157 | struct vnt_phy_field b; |
Malcolm Priestley | f0c5ba2 | 2013-08-15 21:27:22 +0100 | [diff] [blame] | 158 | u16 wDuration_ba; |
| 159 | u16 wReserved; |
| 160 | struct ieee80211_cts data; |
| 161 | u16 reserved2; |
Malcolm Priestley | 78363fd | 2013-10-01 15:52:16 +0100 | [diff] [blame] | 162 | struct vnt_tx_datahead_g data_head; |
Malcolm Priestley | f0c5ba2 | 2013-08-15 21:27:22 +0100 | [diff] [blame] | 163 | } __packed; |
| 164 | |
| 165 | struct vnt_cts_fb { |
Malcolm Priestley | aed387c | 2013-08-20 22:52:30 +0100 | [diff] [blame] | 166 | struct vnt_phy_field b; |
Malcolm Priestley | f0c5ba2 | 2013-08-15 21:27:22 +0100 | [diff] [blame] | 167 | u16 wDuration_ba; |
| 168 | u16 wReserved; |
| 169 | u16 wCTSDuration_ba_f0; |
| 170 | u16 wCTSDuration_ba_f1; |
| 171 | struct ieee80211_cts data; |
| 172 | u16 reserved2; |
Malcolm Priestley | 5b852f5 | 2013-10-01 15:54:56 +0100 | [diff] [blame] | 173 | struct vnt_tx_datahead_g_fb data_head; |
Malcolm Priestley | f0c5ba2 | 2013-08-15 21:27:22 +0100 | [diff] [blame] | 174 | } __packed; |
| 175 | |
Malcolm Priestley | 13fe62a | 2013-08-26 11:17:52 +0100 | [diff] [blame] | 176 | union vnt_tx_data_head { |
| 177 | /* rts g */ |
| 178 | struct vnt_rts_g rts_g; |
| 179 | struct vnt_rts_g_fb rts_g_fb; |
| 180 | /* rts a/b */ |
| 181 | struct vnt_rts_ab rts_ab; |
| 182 | struct vnt_rts_a_fb rts_a_fb; |
| 183 | /* cts g */ |
| 184 | struct vnt_cts cts_g; |
| 185 | struct vnt_cts_fb cts_g_fb; |
Malcolm Priestley | a90186e | 2013-10-01 15:58:54 +0100 | [diff] [blame^] | 186 | /* no rts/cts */ |
| 187 | struct vnt_tx_datahead_a_fb data_head_a_fb; |
Malcolm Priestley | 13fe62a | 2013-08-26 11:17:52 +0100 | [diff] [blame] | 188 | }; |
| 189 | |
Malcolm Priestley | 56c60e4 | 2013-09-26 18:49:44 +0100 | [diff] [blame] | 190 | struct vnt_tx_mic_hdr { |
| 191 | struct vnt_mic_hdr hdr; |
| 192 | union vnt_tx_data_head head; |
| 193 | } __packed; |
| 194 | |
| 195 | union vnt_tx { |
| 196 | struct vnt_tx_mic_hdr mic; |
| 197 | union vnt_tx_data_head head; |
| 198 | }; |
| 199 | |
Malcolm Priestley | 9e38a5c | 2013-09-26 18:47:25 +0100 | [diff] [blame] | 200 | union vnt_tx_head { |
Malcolm Priestley | 56c60e4 | 2013-09-26 18:49:44 +0100 | [diff] [blame] | 201 | struct { |
| 202 | struct vnt_rrv_time_rts rts; |
| 203 | union vnt_tx tx; |
| 204 | } __packed tx_rts; |
| 205 | struct { |
| 206 | struct vnt_rrv_time_cts cts; |
| 207 | union vnt_tx tx; |
| 208 | } __packed tx_cts; |
| 209 | struct { |
| 210 | struct vnt_rrv_time_ab ab; |
| 211 | union vnt_tx tx; |
| 212 | } __packed tx_ab; |
Malcolm Priestley | 9e38a5c | 2013-09-26 18:47:25 +0100 | [diff] [blame] | 213 | }; |
| 214 | |
Malcolm Priestley | d66caad | 2013-09-17 19:54:35 +0100 | [diff] [blame] | 215 | struct vnt_tx_fifo_head { |
Malcolm Priestley | ed74395 | 2012-11-11 15:34:51 +0000 | [diff] [blame] | 216 | u32 adwTxKey[4]; |
Malcolm Priestley | f39c0d8 | 2013-08-15 19:34:37 +0100 | [diff] [blame] | 217 | u16 wFIFOCtl; |
| 218 | u16 wTimeStamp; |
| 219 | u16 wFragCtl; |
| 220 | u16 wReserved; |
| 221 | } __packed; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 222 | |
Malcolm Priestley | d66caad | 2013-09-17 19:54:35 +0100 | [diff] [blame] | 223 | struct vnt_tx_buffer { |
| 224 | u8 byType; |
| 225 | u8 byPKTNO; |
| 226 | u16 wTxByteCount; |
| 227 | struct vnt_tx_fifo_head fifo_head; |
Malcolm Priestley | 9e38a5c | 2013-09-26 18:47:25 +0100 | [diff] [blame] | 228 | union vnt_tx_head tx_head; |
Malcolm Priestley | d66caad | 2013-09-17 19:54:35 +0100 | [diff] [blame] | 229 | } __packed; |
| 230 | |
Malcolm Priestley | 01f865b | 2013-08-15 19:40:08 +0100 | [diff] [blame] | 231 | struct vnt_beacon_buffer { |
| 232 | u8 byType; |
| 233 | u8 byPKTNO; |
| 234 | u16 wTxByteCount; |
| 235 | u16 wFIFOCtl; |
| 236 | u16 wTimeStamp; |
| 237 | } __packed; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 238 | |
Malcolm Priestley | d56131d | 2013-01-17 23:15:22 +0000 | [diff] [blame] | 239 | void vDMA0_tx_80211(struct vnt_private *, struct sk_buff *skb); |
| 240 | int nsDMA_tx_packet(struct vnt_private *, u32 uDMAIdx, struct sk_buff *skb); |
| 241 | CMD_STATUS csMgmt_xmit(struct vnt_private *, struct vnt_tx_mgmt *); |
| 242 | CMD_STATUS csBeacon_xmit(struct vnt_private *, struct vnt_tx_mgmt *); |
| 243 | int bRelayPacketSend(struct vnt_private *, u8 *pbySkbData, u32 uDataLen, |
| 244 | u32 uNodeIndex); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 245 | |
Andres More | e7b07d1 | 2010-05-01 19:12:26 -0300 | [diff] [blame] | 246 | #endif /* __RXTX_H__ */ |