.. | .. |
---|
1 | | -/****************************************************************************** |
---|
2 | | - * |
---|
3 | | - * Copyright(c) 2009-2012 Realtek Corporation. All rights reserved. |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify it |
---|
6 | | - * under the terms of version 2 of the GNU General Public License as |
---|
7 | | - * published by the Free Software Foundation. |
---|
8 | | - * |
---|
9 | | - * This program is distributed in the hope that it will be useful, but WITHOUT |
---|
10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
12 | | - * more details. |
---|
13 | | - * |
---|
14 | | - * The full GNU General Public License is included in this distribution in the |
---|
15 | | - * file called LICENSE. |
---|
16 | | - * |
---|
17 | | - * Contact Information: |
---|
18 | | - * wlanfae <wlanfae@realtek.com> |
---|
19 | | - * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, |
---|
20 | | - * Hsinchu 300, Taiwan. |
---|
21 | | - * |
---|
22 | | - * Larry Finger <Larry.Finger@lwfinger.net> |
---|
23 | | - * |
---|
24 | | - *****************************************************************************/ |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
---|
| 2 | +/* Copyright(c) 2009-2012 Realtek Corporation.*/ |
---|
25 | 3 | |
---|
26 | 4 | #include "../wifi.h" |
---|
27 | 5 | #include "../usb.h" |
---|
.. | .. |
---|
36 | 14 | #include "trx.h" |
---|
37 | 15 | #include "../rtl8192c/fw_common.h" |
---|
38 | 16 | |
---|
39 | | -static int _ConfigVerTOutEP(struct ieee80211_hw *hw) |
---|
| 17 | +static int configvertoutep(struct ieee80211_hw *hw) |
---|
40 | 18 | { |
---|
41 | 19 | u8 ep_cfg, txqsele; |
---|
42 | 20 | u8 ep_nums = 0; |
---|
.. | .. |
---|
69 | 47 | return (rtlusb->out_ep_nums == ep_nums) ? 0 : -EINVAL; |
---|
70 | 48 | } |
---|
71 | 49 | |
---|
72 | | -static int _ConfigVerNOutEP(struct ieee80211_hw *hw) |
---|
| 50 | +static int configvernoutep(struct ieee80211_hw *hw) |
---|
73 | 51 | { |
---|
74 | 52 | u8 ep_cfg; |
---|
75 | 53 | u8 ep_nums = 0; |
---|
.. | .. |
---|
98 | 76 | return (rtlusb->out_ep_nums == ep_nums) ? 0 : -EINVAL; |
---|
99 | 77 | } |
---|
100 | 78 | |
---|
101 | | -static void _TwoOutEpMapping(struct ieee80211_hw *hw, bool bIsChipB, |
---|
| 79 | +static void twooutepmapping(struct ieee80211_hw *hw, bool is_chip8, |
---|
102 | 80 | bool bwificfg, struct rtl_ep_map *ep_map) |
---|
103 | 81 | { |
---|
104 | 82 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
---|
105 | 83 | |
---|
106 | 84 | if (bwificfg) { /* for WMM */ |
---|
107 | | - RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
---|
108 | | - "USB Chip-B & WMM Setting.....\n"); |
---|
| 85 | + rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG, |
---|
| 86 | + "USB Chip-B & WMM Setting.....\n"); |
---|
109 | 87 | ep_map->ep_mapping[RTL_TXQ_BE] = 2; |
---|
110 | 88 | ep_map->ep_mapping[RTL_TXQ_BK] = 3; |
---|
111 | 89 | ep_map->ep_mapping[RTL_TXQ_VI] = 3; |
---|
.. | .. |
---|
114 | 92 | ep_map->ep_mapping[RTL_TXQ_BCN] = 2; |
---|
115 | 93 | ep_map->ep_mapping[RTL_TXQ_HI] = 2; |
---|
116 | 94 | } else { /* typical setting */ |
---|
117 | | - RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
---|
118 | | - "USB typical Setting.....\n"); |
---|
| 95 | + rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG, |
---|
| 96 | + "USB typical Setting.....\n"); |
---|
119 | 97 | ep_map->ep_mapping[RTL_TXQ_BE] = 3; |
---|
120 | 98 | ep_map->ep_mapping[RTL_TXQ_BK] = 3; |
---|
121 | 99 | ep_map->ep_mapping[RTL_TXQ_VI] = 2; |
---|
.. | .. |
---|
126 | 104 | } |
---|
127 | 105 | } |
---|
128 | 106 | |
---|
129 | | -static void _ThreeOutEpMapping(struct ieee80211_hw *hw, bool bwificfg, |
---|
| 107 | +static void threeoutepmapping(struct ieee80211_hw *hw, bool bwificfg, |
---|
130 | 108 | struct rtl_ep_map *ep_map) |
---|
131 | 109 | { |
---|
132 | 110 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
---|
| 111 | + |
---|
133 | 112 | if (bwificfg) { /* for WMM */ |
---|
134 | | - RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
---|
135 | | - "USB 3EP Setting for WMM.....\n"); |
---|
| 113 | + rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG, |
---|
| 114 | + "USB 3EP Setting for WMM.....\n"); |
---|
136 | 115 | ep_map->ep_mapping[RTL_TXQ_BE] = 5; |
---|
137 | 116 | ep_map->ep_mapping[RTL_TXQ_BK] = 3; |
---|
138 | 117 | ep_map->ep_mapping[RTL_TXQ_VI] = 3; |
---|
.. | .. |
---|
141 | 120 | ep_map->ep_mapping[RTL_TXQ_BCN] = 2; |
---|
142 | 121 | ep_map->ep_mapping[RTL_TXQ_HI] = 2; |
---|
143 | 122 | } else { /* typical setting */ |
---|
144 | | - RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
---|
145 | | - "USB 3EP Setting for typical.....\n"); |
---|
| 123 | + rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG, |
---|
| 124 | + "USB 3EP Setting for typical.....\n"); |
---|
146 | 125 | ep_map->ep_mapping[RTL_TXQ_BE] = 5; |
---|
147 | 126 | ep_map->ep_mapping[RTL_TXQ_BK] = 5; |
---|
148 | 127 | ep_map->ep_mapping[RTL_TXQ_VI] = 3; |
---|
.. | .. |
---|
153 | 132 | } |
---|
154 | 133 | } |
---|
155 | 134 | |
---|
156 | | -static void _OneOutEpMapping(struct ieee80211_hw *hw, struct rtl_ep_map *ep_map) |
---|
| 135 | +static void oneoutepmapping(struct ieee80211_hw *hw, struct rtl_ep_map *ep_map) |
---|
157 | 136 | { |
---|
158 | 137 | ep_map->ep_mapping[RTL_TXQ_BE] = 2; |
---|
159 | 138 | ep_map->ep_mapping[RTL_TXQ_BK] = 2; |
---|
.. | .. |
---|
163 | 142 | ep_map->ep_mapping[RTL_TXQ_BCN] = 2; |
---|
164 | 143 | ep_map->ep_mapping[RTL_TXQ_HI] = 2; |
---|
165 | 144 | } |
---|
| 145 | + |
---|
166 | 146 | static int _out_ep_mapping(struct ieee80211_hw *hw) |
---|
167 | 147 | { |
---|
168 | 148 | int err = 0; |
---|
169 | | - bool bIsChipN, bwificfg = false; |
---|
| 149 | + bool ischipn, bwificfg = false; |
---|
170 | 150 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); |
---|
171 | 151 | struct rtl_usb_priv *usb_priv = rtl_usbpriv(hw); |
---|
172 | 152 | struct rtl_usb *rtlusb = rtl_usbdev(usb_priv); |
---|
173 | 153 | struct rtl_ep_map *ep_map = &(rtlusb->ep_map); |
---|
174 | 154 | |
---|
175 | | - bIsChipN = IS_NORMAL_CHIP(rtlhal->version); |
---|
| 155 | + ischipn = IS_NORMAL_CHIP(rtlhal->version); |
---|
176 | 156 | switch (rtlusb->out_ep_nums) { |
---|
177 | 157 | case 2: |
---|
178 | | - _TwoOutEpMapping(hw, bIsChipN, bwificfg, ep_map); |
---|
| 158 | + twooutepmapping(hw, ischipn, bwificfg, ep_map); |
---|
179 | 159 | break; |
---|
180 | 160 | case 3: |
---|
181 | 161 | /* Test chip doesn't support three out EPs. */ |
---|
182 | | - if (!bIsChipN) { |
---|
| 162 | + if (!ischipn) { |
---|
183 | 163 | err = -EINVAL; |
---|
184 | 164 | goto err_out; |
---|
185 | 165 | } |
---|
186 | | - _ThreeOutEpMapping(hw, bIsChipN, ep_map); |
---|
| 166 | + threeoutepmapping(hw, ischipn, ep_map); |
---|
187 | 167 | break; |
---|
188 | 168 | case 1: |
---|
189 | | - _OneOutEpMapping(hw, ep_map); |
---|
| 169 | + oneoutepmapping(hw, ep_map); |
---|
190 | 170 | break; |
---|
191 | 171 | default: |
---|
192 | 172 | err = -EINVAL; |
---|
.. | .. |
---|
196 | 176 | return err; |
---|
197 | 177 | |
---|
198 | 178 | } |
---|
| 179 | + |
---|
199 | 180 | /* endpoint mapping */ |
---|
200 | 181 | int rtl8192cu_endpoint_mapping(struct ieee80211_hw *hw) |
---|
201 | 182 | { |
---|
202 | 183 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); |
---|
203 | 184 | int error = 0; |
---|
| 185 | + |
---|
204 | 186 | if (likely(IS_NORMAL_CHIP(rtlhal->version))) |
---|
205 | | - error = _ConfigVerNOutEP(hw); |
---|
| 187 | + error = configvernoutep(hw); |
---|
206 | 188 | else |
---|
207 | | - error = _ConfigVerTOutEP(hw); |
---|
| 189 | + error = configvertoutep(hw); |
---|
208 | 190 | if (error) |
---|
209 | 191 | goto err_out; |
---|
210 | 192 | error = _out_ep_mapping(hw); |
---|
.. | .. |
---|
266 | 248 | switch (mac80211_queue_index) { |
---|
267 | 249 | case 0: /* VO */ |
---|
268 | 250 | qsel = QSLT_VO; |
---|
269 | | - RT_TRACE(rtlpriv, COMP_USB, DBG_DMESG, |
---|
270 | | - "VO queue, set qsel = 0x%x\n", QSLT_VO); |
---|
| 251 | + rtl_dbg(rtlpriv, COMP_USB, DBG_DMESG, |
---|
| 252 | + "VO queue, set qsel = 0x%x\n", QSLT_VO); |
---|
271 | 253 | break; |
---|
272 | 254 | case 1: /* VI */ |
---|
273 | 255 | qsel = QSLT_VI; |
---|
274 | | - RT_TRACE(rtlpriv, COMP_USB, DBG_DMESG, |
---|
275 | | - "VI queue, set qsel = 0x%x\n", QSLT_VI); |
---|
| 256 | + rtl_dbg(rtlpriv, COMP_USB, DBG_DMESG, |
---|
| 257 | + "VI queue, set qsel = 0x%x\n", QSLT_VI); |
---|
276 | 258 | break; |
---|
277 | 259 | case 3: /* BK */ |
---|
278 | 260 | qsel = QSLT_BK; |
---|
279 | | - RT_TRACE(rtlpriv, COMP_USB, DBG_DMESG, |
---|
280 | | - "BK queue, set qsel = 0x%x\n", QSLT_BK); |
---|
| 261 | + rtl_dbg(rtlpriv, COMP_USB, DBG_DMESG, |
---|
| 262 | + "BK queue, set qsel = 0x%x\n", QSLT_BK); |
---|
281 | 263 | break; |
---|
282 | 264 | case 2: /* BE */ |
---|
283 | 265 | default: |
---|
284 | 266 | qsel = QSLT_BE; |
---|
285 | | - RT_TRACE(rtlpriv, COMP_USB, DBG_DMESG, |
---|
286 | | - "BE queue, set qsel = 0x%x\n", QSLT_BE); |
---|
| 267 | + rtl_dbg(rtlpriv, COMP_USB, DBG_DMESG, |
---|
| 268 | + "BE queue, set qsel = 0x%x\n", QSLT_BE); |
---|
287 | 269 | break; |
---|
288 | 270 | } |
---|
289 | 271 | out: |
---|
.. | .. |
---|
300 | 282 | bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw, |
---|
301 | 283 | struct rtl_stats *stats, |
---|
302 | 284 | struct ieee80211_rx_status *rx_status, |
---|
303 | | - u8 *pdesc, struct sk_buff *skb) |
---|
| 285 | + u8 *pdesc8, struct sk_buff *skb) |
---|
304 | 286 | { |
---|
305 | 287 | struct rx_fwinfo_92c *p_drvinfo; |
---|
306 | | - struct rx_desc_92c *p_desc = (struct rx_desc_92c *)pdesc; |
---|
307 | | - u32 phystatus = GET_RX_DESC_PHY_STATUS(pdesc); |
---|
| 288 | + struct rx_desc_92c *p_desc = (struct rx_desc_92c *)pdesc8; |
---|
| 289 | + __le32 *pdesc = (__le32 *)pdesc8; |
---|
| 290 | + u32 phystatus = get_rx_desc_phy_status(pdesc); |
---|
308 | 291 | |
---|
309 | | - stats->length = (u16) GET_RX_DESC_PKT_LEN(pdesc); |
---|
310 | | - stats->rx_drvinfo_size = (u8)GET_RX_DESC_DRVINFO_SIZE(pdesc) * |
---|
| 292 | + stats->length = (u16)get_rx_desc_pkt_len(pdesc); |
---|
| 293 | + stats->rx_drvinfo_size = (u8)get_rx_desc_drvinfo_size(pdesc) * |
---|
311 | 294 | RX_DRV_INFO_SIZE_UNIT; |
---|
312 | | - stats->rx_bufshift = (u8) (GET_RX_DESC_SHIFT(pdesc) & 0x03); |
---|
313 | | - stats->icv = (u16) GET_RX_DESC_ICV(pdesc); |
---|
314 | | - stats->crc = (u16) GET_RX_DESC_CRC32(pdesc); |
---|
| 295 | + stats->rx_bufshift = (u8)(get_rx_desc_shift(pdesc) & 0x03); |
---|
| 296 | + stats->icv = (u16)get_rx_desc_icv(pdesc); |
---|
| 297 | + stats->crc = (u16)get_rx_desc_crc32(pdesc); |
---|
315 | 298 | stats->hwerror = (stats->crc | stats->icv); |
---|
316 | | - stats->decrypted = !GET_RX_DESC_SWDEC(pdesc); |
---|
317 | | - stats->rate = (u8) GET_RX_DESC_RX_MCS(pdesc); |
---|
318 | | - stats->shortpreamble = (u16) GET_RX_DESC_SPLCP(pdesc); |
---|
319 | | - stats->isampdu = (bool) (GET_RX_DESC_PAGGR(pdesc) == 1); |
---|
320 | | - stats->isfirst_ampdu = (bool)((GET_RX_DESC_PAGGR(pdesc) == 1) |
---|
321 | | - && (GET_RX_DESC_FAGGR(pdesc) == 1)); |
---|
322 | | - stats->timestamp_low = GET_RX_DESC_TSFL(pdesc); |
---|
323 | | - stats->rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(pdesc); |
---|
324 | | - stats->is_ht = (bool)GET_RX_DESC_RX_HT(pdesc); |
---|
| 299 | + stats->decrypted = !get_rx_desc_swdec(pdesc); |
---|
| 300 | + stats->rate = (u8)get_rx_desc_rx_mcs(pdesc); |
---|
| 301 | + stats->shortpreamble = (u16)get_rx_desc_splcp(pdesc); |
---|
| 302 | + stats->isampdu = (bool)(get_rx_desc_paggr(pdesc) == 1); |
---|
| 303 | + stats->isfirst_ampdu = (bool)((get_rx_desc_paggr(pdesc) == 1) && |
---|
| 304 | + (get_rx_desc_faggr(pdesc) == 1)); |
---|
| 305 | + stats->timestamp_low = get_rx_desc_tsfl(pdesc); |
---|
| 306 | + stats->rx_is40mhzpacket = (bool)get_rx_desc_bw(pdesc); |
---|
| 307 | + stats->is_ht = (bool)get_rx_desc_rx_ht(pdesc); |
---|
325 | 308 | rx_status->freq = hw->conf.chandef.chan->center_freq; |
---|
326 | 309 | rx_status->band = hw->conf.chandef.chan->band; |
---|
327 | | - if (GET_RX_DESC_CRC32(pdesc)) |
---|
| 310 | + if (get_rx_desc_crc32(pdesc)) |
---|
328 | 311 | rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; |
---|
329 | | - if (!GET_RX_DESC_SWDEC(pdesc)) |
---|
| 312 | + if (!get_rx_desc_swdec(pdesc)) |
---|
330 | 313 | rx_status->flag |= RX_FLAG_DECRYPTED; |
---|
331 | | - if (GET_RX_DESC_BW(pdesc)) |
---|
| 314 | + if (get_rx_desc_bw(pdesc)) |
---|
332 | 315 | rx_status->bw = RATE_INFO_BW_40; |
---|
333 | | - if (GET_RX_DESC_RX_HT(pdesc)) |
---|
| 316 | + if (get_rx_desc_rx_ht(pdesc)) |
---|
334 | 317 | rx_status->encoding = RX_ENC_HT; |
---|
335 | 318 | rx_status->flag |= RX_FLAG_MACTIME_START; |
---|
336 | 319 | if (stats->decrypted) |
---|
337 | 320 | rx_status->flag |= RX_FLAG_DECRYPTED; |
---|
338 | 321 | rx_status->rate_idx = rtlwifi_rate_mapping(hw, stats->is_ht, |
---|
339 | 322 | false, stats->rate); |
---|
340 | | - rx_status->mactime = GET_RX_DESC_TSFL(pdesc); |
---|
| 323 | + rx_status->mactime = get_rx_desc_tsfl(pdesc); |
---|
341 | 324 | if (phystatus) { |
---|
342 | 325 | p_drvinfo = (struct rx_fwinfo_92c *)(skb->data + |
---|
343 | 326 | stats->rx_bufshift); |
---|
.. | .. |
---|
357 | 340 | (struct ieee80211_rx_status *)IEEE80211_SKB_RXCB(skb); |
---|
358 | 341 | u32 skb_len, pkt_len, drvinfo_len; |
---|
359 | 342 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
---|
360 | | - u8 *rxdesc; |
---|
| 343 | + __le32 *rxdesc; |
---|
361 | 344 | struct rtl_stats stats = { |
---|
362 | 345 | .signal = 0, |
---|
363 | 346 | .rate = 0, |
---|
.. | .. |
---|
368 | 351 | struct ieee80211_hdr *hdr; |
---|
369 | 352 | |
---|
370 | 353 | memset(rx_status, 0, sizeof(*rx_status)); |
---|
371 | | - rxdesc = skb->data; |
---|
| 354 | + rxdesc = (__le32 *)skb->data; |
---|
372 | 355 | skb_len = skb->len; |
---|
373 | | - drvinfo_len = (GET_RX_DESC_DRVINFO_SIZE(rxdesc) * RTL_RX_DRV_INFO_UNIT); |
---|
374 | | - pkt_len = GET_RX_DESC_PKT_LEN(rxdesc); |
---|
| 356 | + drvinfo_len = (get_rx_desc_drvinfo_size(rxdesc) * RTL_RX_DRV_INFO_UNIT); |
---|
| 357 | + pkt_len = get_rx_desc_pkt_len(rxdesc); |
---|
375 | 358 | /* TODO: Error recovery. drop this skb or something. */ |
---|
376 | 359 | WARN_ON(skb_len < (pkt_len + RTL_RX_DESC_SIZE + drvinfo_len)); |
---|
377 | | - stats.length = (u16) GET_RX_DESC_PKT_LEN(rxdesc); |
---|
378 | | - stats.rx_drvinfo_size = (u8)GET_RX_DESC_DRVINFO_SIZE(rxdesc) * |
---|
| 360 | + stats.length = (u16)get_rx_desc_pkt_len(rxdesc); |
---|
| 361 | + stats.rx_drvinfo_size = (u8)get_rx_desc_drvinfo_size(rxdesc) * |
---|
379 | 362 | RX_DRV_INFO_SIZE_UNIT; |
---|
380 | | - stats.rx_bufshift = (u8) (GET_RX_DESC_SHIFT(rxdesc) & 0x03); |
---|
381 | | - stats.icv = (u16) GET_RX_DESC_ICV(rxdesc); |
---|
382 | | - stats.crc = (u16) GET_RX_DESC_CRC32(rxdesc); |
---|
| 363 | + stats.rx_bufshift = (u8)(get_rx_desc_shift(rxdesc) & 0x03); |
---|
| 364 | + stats.icv = (u16)get_rx_desc_icv(rxdesc); |
---|
| 365 | + stats.crc = (u16)get_rx_desc_crc32(rxdesc); |
---|
383 | 366 | stats.hwerror = (stats.crc | stats.icv); |
---|
384 | | - stats.decrypted = !GET_RX_DESC_SWDEC(rxdesc); |
---|
385 | | - stats.rate = (u8) GET_RX_DESC_RX_MCS(rxdesc); |
---|
386 | | - stats.shortpreamble = (u16) GET_RX_DESC_SPLCP(rxdesc); |
---|
387 | | - stats.isampdu = (bool) ((GET_RX_DESC_PAGGR(rxdesc) == 1) |
---|
388 | | - && (GET_RX_DESC_FAGGR(rxdesc) == 1)); |
---|
389 | | - stats.timestamp_low = GET_RX_DESC_TSFL(rxdesc); |
---|
390 | | - stats.rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(rxdesc); |
---|
391 | | - stats.is_ht = (bool)GET_RX_DESC_RX_HT(rxdesc); |
---|
| 367 | + stats.decrypted = !get_rx_desc_swdec(rxdesc); |
---|
| 368 | + stats.rate = (u8)get_rx_desc_rx_mcs(rxdesc); |
---|
| 369 | + stats.shortpreamble = (u16)get_rx_desc_splcp(rxdesc); |
---|
| 370 | + stats.isampdu = (bool)((get_rx_desc_paggr(rxdesc) == 1) && |
---|
| 371 | + (get_rx_desc_faggr(rxdesc) == 1)); |
---|
| 372 | + stats.timestamp_low = get_rx_desc_tsfl(rxdesc); |
---|
| 373 | + stats.rx_is40mhzpacket = (bool)get_rx_desc_bw(rxdesc); |
---|
| 374 | + stats.is_ht = (bool)get_rx_desc_rx_ht(rxdesc); |
---|
392 | 375 | /* TODO: is center_freq changed when doing scan? */ |
---|
393 | 376 | /* TODO: Shall we add protection or just skip those two step? */ |
---|
394 | 377 | rx_status->freq = hw->conf.chandef.chan->center_freq; |
---|
395 | 378 | rx_status->band = hw->conf.chandef.chan->band; |
---|
396 | | - if (GET_RX_DESC_CRC32(rxdesc)) |
---|
| 379 | + if (get_rx_desc_crc32(rxdesc)) |
---|
397 | 380 | rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; |
---|
398 | | - if (!GET_RX_DESC_SWDEC(rxdesc)) |
---|
| 381 | + if (!get_rx_desc_swdec(rxdesc)) |
---|
399 | 382 | rx_status->flag |= RX_FLAG_DECRYPTED; |
---|
400 | | - if (GET_RX_DESC_BW(rxdesc)) |
---|
| 383 | + if (get_rx_desc_bw(rxdesc)) |
---|
401 | 384 | rx_status->bw = RATE_INFO_BW_40; |
---|
402 | | - if (GET_RX_DESC_RX_HT(rxdesc)) |
---|
| 385 | + if (get_rx_desc_rx_ht(rxdesc)) |
---|
403 | 386 | rx_status->encoding = RX_ENC_HT; |
---|
404 | 387 | /* Data rate */ |
---|
405 | 388 | rx_status->rate_idx = rtlwifi_rate_mapping(hw, stats.is_ht, |
---|
406 | 389 | false, stats.rate); |
---|
407 | 390 | /* There is a phy status after this rx descriptor. */ |
---|
408 | | - if (GET_RX_DESC_PHY_STATUS(rxdesc)) { |
---|
| 391 | + if (get_rx_desc_phy_status(rxdesc)) { |
---|
409 | 392 | p_drvinfo = (struct rx_fwinfo_92c *)(rxdesc + RTL_RX_DESC_SIZE); |
---|
410 | 393 | rtl92c_translate_rx_signal_stuff(hw, skb, &stats, |
---|
411 | 394 | (struct rx_desc_92c *)rxdesc, p_drvinfo); |
---|
.. | .. |
---|
415 | 398 | fc = hdr->frame_control; |
---|
416 | 399 | bv = ieee80211_is_probe_resp(fc); |
---|
417 | 400 | if (bv) |
---|
418 | | - RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
---|
419 | | - "Got probe response frame\n"); |
---|
| 401 | + rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG, |
---|
| 402 | + "Got probe response frame\n"); |
---|
420 | 403 | if (ieee80211_is_beacon(fc)) |
---|
421 | | - RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "Got beacon frame\n"); |
---|
| 404 | + rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG, "Got beacon frame\n"); |
---|
422 | 405 | if (ieee80211_is_data(fc)) |
---|
423 | | - RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "Got data frame\n"); |
---|
424 | | - RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
---|
425 | | - "Fram: fc = 0x%X addr1 = 0x%02X:0x%02X:0x%02X:0x%02X:0x%02X:0x%02X\n", |
---|
426 | | - fc, |
---|
427 | | - (u32)hdr->addr1[0], (u32)hdr->addr1[1], |
---|
428 | | - (u32)hdr->addr1[2], (u32)hdr->addr1[3], |
---|
429 | | - (u32)hdr->addr1[4], (u32)hdr->addr1[5]); |
---|
| 406 | + rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG, "Got data frame\n"); |
---|
| 407 | + rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG, |
---|
| 408 | + "Fram: fc = 0x%X addr1 = 0x%02X:0x%02X:0x%02X:0x%02X:0x%02X:0x%02X\n", |
---|
| 409 | + fc, |
---|
| 410 | + (u32)hdr->addr1[0], (u32)hdr->addr1[1], |
---|
| 411 | + (u32)hdr->addr1[2], (u32)hdr->addr1[3], |
---|
| 412 | + (u32)hdr->addr1[4], (u32)hdr->addr1[5]); |
---|
430 | 413 | ieee80211_rx(hw, skb); |
---|
431 | 414 | } |
---|
432 | 415 | |
---|
.. | .. |
---|
458 | 441 | |
---|
459 | 442 | /*======================================== trx ===============================*/ |
---|
460 | 443 | |
---|
461 | | -static void _rtl_fill_usb_tx_desc(u8 *txdesc) |
---|
| 444 | +static void _rtl_fill_usb_tx_desc(__le32 *txdesc) |
---|
462 | 445 | { |
---|
463 | | - SET_TX_DESC_OWN(txdesc, 1); |
---|
464 | | - SET_TX_DESC_LAST_SEG(txdesc, 1); |
---|
465 | | - SET_TX_DESC_FIRST_SEG(txdesc, 1); |
---|
| 446 | + set_tx_desc_own(txdesc, 1); |
---|
| 447 | + set_tx_desc_last_seg(txdesc, 1); |
---|
| 448 | + set_tx_desc_first_seg(txdesc, 1); |
---|
466 | 449 | } |
---|
| 450 | + |
---|
467 | 451 | /** |
---|
468 | 452 | * For HW recovery information |
---|
469 | 453 | */ |
---|
470 | | -static void _rtl_tx_desc_checksum(u8 *txdesc) |
---|
| 454 | +static void _rtl_tx_desc_checksum(__le32 *txdesc) |
---|
471 | 455 | { |
---|
472 | 456 | __le16 *ptr = (__le16 *)txdesc; |
---|
473 | 457 | u16 checksum = 0; |
---|
474 | 458 | u32 index; |
---|
475 | 459 | |
---|
476 | 460 | /* Clear first */ |
---|
477 | | - SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, 0); |
---|
| 461 | + set_tx_desc_tx_desc_checksum(txdesc, 0); |
---|
478 | 462 | for (index = 0; index < 16; index++) |
---|
479 | 463 | checksum = checksum ^ le16_to_cpu(*(ptr + index)); |
---|
480 | | - SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, checksum); |
---|
| 464 | + set_tx_desc_tx_desc_checksum(txdesc, checksum); |
---|
481 | 465 | } |
---|
482 | 466 | |
---|
483 | 467 | void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, |
---|
.. | .. |
---|
500 | 484 | u16 pktlen = skb->len; |
---|
501 | 485 | enum rtl_desc_qsel fw_qsel = _rtl8192cu_mq_to_descq(hw, fc, |
---|
502 | 486 | skb_get_queue_mapping(skb)); |
---|
503 | | - u8 *txdesc; |
---|
| 487 | + u8 *txdesc8; |
---|
| 488 | + __le32 *txdesc; |
---|
504 | 489 | |
---|
505 | 490 | seq_number = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; |
---|
506 | 491 | rtl_get_tcb_desc(hw, info, sta, skb, tcb_desc); |
---|
507 | | - txdesc = skb_push(skb, RTL_TX_HEADER_SIZE); |
---|
| 492 | + txdesc8 = skb_push(skb, RTL_TX_HEADER_SIZE); |
---|
| 493 | + txdesc = (__le32 *)txdesc8; |
---|
508 | 494 | memset(txdesc, 0, RTL_TX_HEADER_SIZE); |
---|
509 | | - SET_TX_DESC_PKT_SIZE(txdesc, pktlen); |
---|
510 | | - SET_TX_DESC_LINIP(txdesc, 0); |
---|
511 | | - SET_TX_DESC_PKT_OFFSET(txdesc, RTL_DUMMY_OFFSET); |
---|
512 | | - SET_TX_DESC_OFFSET(txdesc, RTL_TX_HEADER_SIZE); |
---|
513 | | - SET_TX_DESC_TX_RATE(txdesc, tcb_desc->hw_rate); |
---|
| 495 | + set_tx_desc_pkt_size(txdesc, pktlen); |
---|
| 496 | + set_tx_desc_linip(txdesc, 0); |
---|
| 497 | + set_tx_desc_pkt_offset(txdesc, RTL_DUMMY_OFFSET); |
---|
| 498 | + set_tx_desc_offset(txdesc, RTL_TX_HEADER_SIZE); |
---|
| 499 | + set_tx_desc_tx_rate(txdesc, tcb_desc->hw_rate); |
---|
514 | 500 | if (tcb_desc->use_shortgi || tcb_desc->use_shortpreamble) |
---|
515 | | - SET_TX_DESC_DATA_SHORTGI(txdesc, 1); |
---|
| 501 | + set_tx_desc_data_shortgi(txdesc, 1); |
---|
516 | 502 | if (mac->tids[tid].agg.agg_state == RTL_AGG_ON && |
---|
517 | 503 | info->flags & IEEE80211_TX_CTL_AMPDU) { |
---|
518 | | - SET_TX_DESC_AGG_ENABLE(txdesc, 1); |
---|
519 | | - SET_TX_DESC_MAX_AGG_NUM(txdesc, 0x14); |
---|
| 504 | + set_tx_desc_agg_enable(txdesc, 1); |
---|
| 505 | + set_tx_desc_max_agg_num(txdesc, 0x14); |
---|
520 | 506 | } else { |
---|
521 | | - SET_TX_DESC_AGG_BREAK(txdesc, 1); |
---|
| 507 | + set_tx_desc_agg_break(txdesc, 1); |
---|
522 | 508 | } |
---|
523 | | - SET_TX_DESC_SEQ(txdesc, seq_number); |
---|
524 | | - SET_TX_DESC_RTS_ENABLE(txdesc, ((tcb_desc->rts_enable && |
---|
525 | | - !tcb_desc->cts_enable) ? 1 : 0)); |
---|
526 | | - SET_TX_DESC_HW_RTS_ENABLE(txdesc, ((tcb_desc->rts_enable || |
---|
527 | | - tcb_desc->cts_enable) ? 1 : 0)); |
---|
528 | | - SET_TX_DESC_CTS2SELF(txdesc, ((tcb_desc->cts_enable) ? 1 : 0)); |
---|
529 | | - SET_TX_DESC_RTS_STBC(txdesc, ((tcb_desc->rts_stbc) ? 1 : 0)); |
---|
530 | | - SET_TX_DESC_RTS_RATE(txdesc, tcb_desc->rts_rate); |
---|
531 | | - SET_TX_DESC_RTS_BW(txdesc, 0); |
---|
532 | | - SET_TX_DESC_RTS_SC(txdesc, tcb_desc->rts_sc); |
---|
533 | | - SET_TX_DESC_RTS_SHORT(txdesc, |
---|
| 509 | + set_tx_desc_seq(txdesc, seq_number); |
---|
| 510 | + set_tx_desc_rts_enable(txdesc, |
---|
| 511 | + ((tcb_desc->rts_enable && |
---|
| 512 | + !tcb_desc->cts_enable) ? 1 : 0)); |
---|
| 513 | + set_tx_desc_hw_rts_enable(txdesc, |
---|
| 514 | + ((tcb_desc->rts_enable || |
---|
| 515 | + tcb_desc->cts_enable) ? 1 : 0)); |
---|
| 516 | + set_tx_desc_cts2self(txdesc, ((tcb_desc->cts_enable) ? 1 : 0)); |
---|
| 517 | + set_tx_desc_rts_stbc(txdesc, ((tcb_desc->rts_stbc) ? 1 : 0)); |
---|
| 518 | + set_tx_desc_rts_rate(txdesc, tcb_desc->rts_rate); |
---|
| 519 | + set_tx_desc_rts_bw(txdesc, 0); |
---|
| 520 | + set_tx_desc_rts_sc(txdesc, tcb_desc->rts_sc); |
---|
| 521 | + set_tx_desc_rts_short(txdesc, |
---|
534 | 522 | ((tcb_desc->rts_rate <= DESC_RATE54M) ? |
---|
535 | 523 | (tcb_desc->rts_use_shortpreamble ? 1 : 0) |
---|
536 | 524 | : (tcb_desc->rts_use_shortgi ? 1 : 0))); |
---|
537 | 525 | if (mac->bw_40) { |
---|
538 | 526 | if (rate_flag & IEEE80211_TX_RC_DUP_DATA) { |
---|
539 | | - SET_TX_DESC_DATA_BW(txdesc, 1); |
---|
540 | | - SET_TX_DESC_DATA_SC(txdesc, 3); |
---|
| 527 | + set_tx_desc_data_bw(txdesc, 1); |
---|
| 528 | + set_tx_desc_data_sc(txdesc, 3); |
---|
541 | 529 | } else if(rate_flag & IEEE80211_TX_RC_40_MHZ_WIDTH){ |
---|
542 | | - SET_TX_DESC_DATA_BW(txdesc, 1); |
---|
543 | | - SET_TX_DESC_DATA_SC(txdesc, mac->cur_40_prime_sc); |
---|
| 530 | + set_tx_desc_data_bw(txdesc, 1); |
---|
| 531 | + set_tx_desc_data_sc(txdesc, mac->cur_40_prime_sc); |
---|
544 | 532 | } else { |
---|
545 | | - SET_TX_DESC_DATA_BW(txdesc, 0); |
---|
546 | | - SET_TX_DESC_DATA_SC(txdesc, 0); |
---|
| 533 | + set_tx_desc_data_bw(txdesc, 0); |
---|
| 534 | + set_tx_desc_data_sc(txdesc, 0); |
---|
547 | 535 | } |
---|
548 | 536 | } else { |
---|
549 | | - SET_TX_DESC_DATA_BW(txdesc, 0); |
---|
550 | | - SET_TX_DESC_DATA_SC(txdesc, 0); |
---|
| 537 | + set_tx_desc_data_bw(txdesc, 0); |
---|
| 538 | + set_tx_desc_data_sc(txdesc, 0); |
---|
551 | 539 | } |
---|
552 | 540 | rcu_read_lock(); |
---|
553 | 541 | sta = ieee80211_find_sta(mac->vif, mac->bssid); |
---|
554 | 542 | if (sta) { |
---|
555 | 543 | u8 ampdu_density = sta->ht_cap.ampdu_density; |
---|
556 | | - SET_TX_DESC_AMPDU_DENSITY(txdesc, ampdu_density); |
---|
| 544 | + |
---|
| 545 | + set_tx_desc_ampdu_density(txdesc, ampdu_density); |
---|
557 | 546 | } |
---|
558 | 547 | rcu_read_unlock(); |
---|
559 | 548 | if (info->control.hw_key) { |
---|
560 | 549 | struct ieee80211_key_conf *keyconf = info->control.hw_key; |
---|
| 550 | + |
---|
561 | 551 | switch (keyconf->cipher) { |
---|
562 | 552 | case WLAN_CIPHER_SUITE_WEP40: |
---|
563 | 553 | case WLAN_CIPHER_SUITE_WEP104: |
---|
564 | 554 | case WLAN_CIPHER_SUITE_TKIP: |
---|
565 | | - SET_TX_DESC_SEC_TYPE(txdesc, 0x1); |
---|
| 555 | + set_tx_desc_sec_type(txdesc, 0x1); |
---|
566 | 556 | break; |
---|
567 | 557 | case WLAN_CIPHER_SUITE_CCMP: |
---|
568 | | - SET_TX_DESC_SEC_TYPE(txdesc, 0x3); |
---|
| 558 | + set_tx_desc_sec_type(txdesc, 0x3); |
---|
569 | 559 | break; |
---|
570 | 560 | default: |
---|
571 | | - SET_TX_DESC_SEC_TYPE(txdesc, 0x0); |
---|
| 561 | + set_tx_desc_sec_type(txdesc, 0x0); |
---|
572 | 562 | break; |
---|
573 | 563 | } |
---|
574 | 564 | } |
---|
575 | | - SET_TX_DESC_PKT_ID(txdesc, 0); |
---|
576 | | - SET_TX_DESC_QUEUE_SEL(txdesc, fw_qsel); |
---|
577 | | - SET_TX_DESC_DATA_RATE_FB_LIMIT(txdesc, 0x1F); |
---|
578 | | - SET_TX_DESC_RTS_RATE_FB_LIMIT(txdesc, 0xF); |
---|
579 | | - SET_TX_DESC_DISABLE_FB(txdesc, 0); |
---|
580 | | - SET_TX_DESC_USE_RATE(txdesc, tcb_desc->use_driver_rate ? 1 : 0); |
---|
| 565 | + set_tx_desc_pkt_id(txdesc, 0); |
---|
| 566 | + set_tx_desc_queue_sel(txdesc, fw_qsel); |
---|
| 567 | + set_tx_desc_data_rate_fb_limit(txdesc, 0x1F); |
---|
| 568 | + set_tx_desc_rts_rate_fb_limit(txdesc, 0xF); |
---|
| 569 | + set_tx_desc_disable_fb(txdesc, 0); |
---|
| 570 | + set_tx_desc_use_rate(txdesc, tcb_desc->use_driver_rate ? 1 : 0); |
---|
581 | 571 | if (ieee80211_is_data_qos(fc)) { |
---|
582 | 572 | if (mac->rdg_en) { |
---|
583 | | - RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, |
---|
584 | | - "Enable RDG function\n"); |
---|
585 | | - SET_TX_DESC_RDG_ENABLE(txdesc, 1); |
---|
586 | | - SET_TX_DESC_HTC(txdesc, 1); |
---|
| 573 | + rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE, |
---|
| 574 | + "Enable RDG function\n"); |
---|
| 575 | + set_tx_desc_rdg_enable(txdesc, 1); |
---|
| 576 | + set_tx_desc_htc(txdesc, 1); |
---|
587 | 577 | } |
---|
588 | 578 | } |
---|
589 | 579 | if (rtlpriv->dm.useramask) { |
---|
590 | | - SET_TX_DESC_RATE_ID(txdesc, tcb_desc->ratr_index); |
---|
591 | | - SET_TX_DESC_MACID(txdesc, tcb_desc->mac_id); |
---|
| 580 | + set_tx_desc_rate_id(txdesc, tcb_desc->ratr_index); |
---|
| 581 | + set_tx_desc_macid(txdesc, tcb_desc->mac_id); |
---|
592 | 582 | } else { |
---|
593 | | - SET_TX_DESC_RATE_ID(txdesc, 0xC + tcb_desc->ratr_index); |
---|
594 | | - SET_TX_DESC_MACID(txdesc, tcb_desc->ratr_index); |
---|
| 583 | + set_tx_desc_rate_id(txdesc, 0xC + tcb_desc->ratr_index); |
---|
| 584 | + set_tx_desc_macid(txdesc, tcb_desc->ratr_index); |
---|
595 | 585 | } |
---|
596 | 586 | if ((!ieee80211_is_data_qos(fc)) && ppsc->leisure_ps && |
---|
597 | 587 | ppsc->fwctrl_lps) { |
---|
598 | | - SET_TX_DESC_HWSEQ_EN(txdesc, 1); |
---|
599 | | - SET_TX_DESC_PKT_ID(txdesc, 8); |
---|
| 588 | + set_tx_desc_hwseq_en(txdesc, 1); |
---|
| 589 | + set_tx_desc_pkt_id(txdesc, 8); |
---|
600 | 590 | if (!defaultadapter) |
---|
601 | | - SET_TX_DESC_QOS(txdesc, 1); |
---|
| 591 | + set_tx_desc_qos(txdesc, 1); |
---|
602 | 592 | } |
---|
603 | 593 | if (ieee80211_has_morefrags(fc)) |
---|
604 | | - SET_TX_DESC_MORE_FRAG(txdesc, 1); |
---|
| 594 | + set_tx_desc_more_frag(txdesc, 1); |
---|
605 | 595 | if (is_multicast_ether_addr(ieee80211_get_DA(hdr)) || |
---|
606 | 596 | is_broadcast_ether_addr(ieee80211_get_DA(hdr))) |
---|
607 | | - SET_TX_DESC_BMC(txdesc, 1); |
---|
| 597 | + set_tx_desc_bmc(txdesc, 1); |
---|
608 | 598 | _rtl_fill_usb_tx_desc(txdesc); |
---|
609 | 599 | _rtl_tx_desc_checksum(txdesc); |
---|
610 | | - RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, "==>\n"); |
---|
| 600 | + rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE, "==>\n"); |
---|
611 | 601 | } |
---|
612 | 602 | |
---|
613 | | -void rtl92cu_fill_fake_txdesc(struct ieee80211_hw *hw, u8 * pDesc, |
---|
614 | | - u32 buffer_len, bool bIsPsPoll) |
---|
| 603 | +void rtl92cu_fill_fake_txdesc(struct ieee80211_hw *hw, u8 *pdesc8, |
---|
| 604 | + u32 buffer_len, bool is_pspoll) |
---|
615 | 605 | { |
---|
| 606 | + __le32 *pdesc = (__le32 *)pdesc8; |
---|
| 607 | + |
---|
616 | 608 | /* Clear all status */ |
---|
617 | | - memset(pDesc, 0, RTL_TX_HEADER_SIZE); |
---|
618 | | - SET_TX_DESC_FIRST_SEG(pDesc, 1); /* bFirstSeg; */ |
---|
619 | | - SET_TX_DESC_LAST_SEG(pDesc, 1); /* bLastSeg; */ |
---|
620 | | - SET_TX_DESC_OFFSET(pDesc, RTL_TX_HEADER_SIZE); /* Offset = 32 */ |
---|
621 | | - SET_TX_DESC_PKT_SIZE(pDesc, buffer_len); /* Buffer size + command hdr */ |
---|
622 | | - SET_TX_DESC_QUEUE_SEL(pDesc, QSLT_MGNT); /* Fixed queue of Mgnt queue */ |
---|
| 609 | + memset(pdesc, 0, RTL_TX_HEADER_SIZE); |
---|
| 610 | + set_tx_desc_first_seg(pdesc, 1); /* bFirstSeg; */ |
---|
| 611 | + set_tx_desc_last_seg(pdesc, 1); /* bLastSeg; */ |
---|
| 612 | + set_tx_desc_offset(pdesc, RTL_TX_HEADER_SIZE); /* Offset = 32 */ |
---|
| 613 | + set_tx_desc_pkt_size(pdesc, buffer_len); /* Buffer size + command hdr */ |
---|
| 614 | + set_tx_desc_queue_sel(pdesc, QSLT_MGNT); /* Fixed queue of Mgnt queue */ |
---|
623 | 615 | /* Set NAVUSEHDR to prevent Ps-poll AId filed to be changed to error |
---|
624 | 616 | * vlaue by Hw. */ |
---|
625 | | - if (bIsPsPoll) { |
---|
626 | | - SET_TX_DESC_NAV_USE_HDR(pDesc, 1); |
---|
| 617 | + if (is_pspoll) { |
---|
| 618 | + set_tx_desc_nav_use_hdr(pdesc, 1); |
---|
627 | 619 | } else { |
---|
628 | | - SET_TX_DESC_HWSEQ_EN(pDesc, 1); /* Hw set sequence number */ |
---|
629 | | - SET_TX_DESC_PKT_ID(pDesc, 0x100); /* set bit3 to 1. */ |
---|
| 620 | + set_tx_desc_hwseq_en(pdesc, 1); /* Hw set sequence number */ |
---|
| 621 | + set_tx_desc_pkt_id(pdesc, BIT(3)); /* set bit3 to 1. */ |
---|
630 | 622 | } |
---|
631 | | - SET_TX_DESC_USE_RATE(pDesc, 1); /* use data rate which is set by Sw */ |
---|
632 | | - SET_TX_DESC_OWN(pDesc, 1); |
---|
633 | | - SET_TX_DESC_TX_RATE(pDesc, DESC_RATE1M); |
---|
634 | | - _rtl_tx_desc_checksum(pDesc); |
---|
| 623 | + set_tx_desc_use_rate(pdesc, 1); /* use data rate which is set by Sw */ |
---|
| 624 | + set_tx_desc_own(pdesc, 1); |
---|
| 625 | + set_tx_desc_tx_rate(pdesc, DESC_RATE1M); |
---|
| 626 | + _rtl_tx_desc_checksum(pdesc); |
---|
635 | 627 | } |
---|
636 | 628 | |
---|
637 | 629 | void rtl92cu_tx_fill_cmddesc(struct ieee80211_hw *hw, |
---|
638 | | - u8 *pdesc, bool firstseg, |
---|
| 630 | + u8 *pdesc8, bool firstseg, |
---|
639 | 631 | bool lastseg, struct sk_buff *skb) |
---|
640 | 632 | { |
---|
641 | 633 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
---|
642 | 634 | u8 fw_queue = QSLT_BEACON; |
---|
643 | 635 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data); |
---|
644 | 636 | __le16 fc = hdr->frame_control; |
---|
| 637 | + __le32 *pdesc = (__le32 *)pdesc8; |
---|
645 | 638 | |
---|
646 | 639 | memset((void *)pdesc, 0, RTL_TX_HEADER_SIZE); |
---|
647 | 640 | if (firstseg) |
---|
648 | | - SET_TX_DESC_OFFSET(pdesc, RTL_TX_HEADER_SIZE); |
---|
649 | | - SET_TX_DESC_TX_RATE(pdesc, DESC_RATE1M); |
---|
650 | | - SET_TX_DESC_SEQ(pdesc, 0); |
---|
651 | | - SET_TX_DESC_LINIP(pdesc, 0); |
---|
652 | | - SET_TX_DESC_QUEUE_SEL(pdesc, fw_queue); |
---|
653 | | - SET_TX_DESC_FIRST_SEG(pdesc, 1); |
---|
654 | | - SET_TX_DESC_LAST_SEG(pdesc, 1); |
---|
655 | | - SET_TX_DESC_RATE_ID(pdesc, 7); |
---|
656 | | - SET_TX_DESC_MACID(pdesc, 0); |
---|
657 | | - SET_TX_DESC_OWN(pdesc, 1); |
---|
658 | | - SET_TX_DESC_PKT_SIZE(pdesc, (u16)skb->len); |
---|
659 | | - SET_TX_DESC_FIRST_SEG(pdesc, 1); |
---|
660 | | - SET_TX_DESC_LAST_SEG(pdesc, 1); |
---|
661 | | - SET_TX_DESC_OFFSET(pdesc, 0x20); |
---|
662 | | - SET_TX_DESC_USE_RATE(pdesc, 1); |
---|
| 641 | + set_tx_desc_offset(pdesc, RTL_TX_HEADER_SIZE); |
---|
| 642 | + set_tx_desc_tx_rate(pdesc, DESC_RATE1M); |
---|
| 643 | + set_tx_desc_seq(pdesc, 0); |
---|
| 644 | + set_tx_desc_linip(pdesc, 0); |
---|
| 645 | + set_tx_desc_queue_sel(pdesc, fw_queue); |
---|
| 646 | + set_tx_desc_first_seg(pdesc, 1); |
---|
| 647 | + set_tx_desc_last_seg(pdesc, 1); |
---|
| 648 | + set_tx_desc_rate_id(pdesc, 7); |
---|
| 649 | + set_tx_desc_macid(pdesc, 0); |
---|
| 650 | + set_tx_desc_own(pdesc, 1); |
---|
| 651 | + set_tx_desc_pkt_size(pdesc, (u16)skb->len); |
---|
| 652 | + set_tx_desc_first_seg(pdesc, 1); |
---|
| 653 | + set_tx_desc_last_seg(pdesc, 1); |
---|
| 654 | + set_tx_desc_offset(pdesc, 0x20); |
---|
| 655 | + set_tx_desc_use_rate(pdesc, 1); |
---|
663 | 656 | if (!ieee80211_is_data_qos(fc)) { |
---|
664 | | - SET_TX_DESC_HWSEQ_EN(pdesc, 1); |
---|
665 | | - SET_TX_DESC_PKT_ID(pdesc, 8); |
---|
| 657 | + set_tx_desc_hwseq_en(pdesc, 1); |
---|
| 658 | + set_tx_desc_pkt_id(pdesc, 8); |
---|
666 | 659 | } |
---|
667 | 660 | RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_LOUD, "H2C Tx Cmd Content", |
---|
668 | 661 | pdesc, RTL_TX_DESC_SIZE); |
---|