Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/hal/rtl8814a/rtl8814a_xmit.c
1307 views
1
/******************************************************************************
2
*
3
* Copyright(c) 2007 - 2017 Realtek Corporation.
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
*****************************************************************************/
15
#define _RTL8814A_XMIT_C_
16
17
/* #include <drv_types.h> */
18
#include <rtl8814a_hal.h>
19
20
void _dbg_dump_tx_info(_adapter *padapter, int frame_tag, u8 *ptxdesc)
21
{
22
u8 bDumpTxPkt;
23
u8 bDumpTxDesc = _FALSE;
24
rtw_hal_get_def_var(padapter, HAL_DEF_DBG_DUMP_TXPKT, &(bDumpTxPkt));
25
26
if (bDumpTxPkt == 1) { /* dump txdesc for data frame */
27
RTW_INFO("dump tx_desc for data frame\n");
28
if ((frame_tag & 0x0f) == DATA_FRAMETAG)
29
bDumpTxDesc = _TRUE;
30
} else if (bDumpTxPkt == 2) { /* dump txdesc for mgnt frame */
31
RTW_INFO("dump tx_desc for mgnt frame\n");
32
if ((frame_tag & 0x0f) == MGNT_FRAMETAG)
33
bDumpTxDesc = _TRUE;
34
} else if (bDumpTxPkt == 3) { /* dump early info */
35
}
36
37
if (bDumpTxDesc) {
38
/* ptxdesc->txdw4 = cpu_to_le32(0x00001006); */ /* RTS Rate=24M */
39
/* ptxdesc->txdw6 = 0x6666f800; */
40
RTW_INFO("=====================================\n");
41
RTW_INFO("Offset00(0x%08x)\n", *((u32 *)(ptxdesc)));
42
RTW_INFO("Offset04(0x%08x)\n", *((u32 *)(ptxdesc + 4)));
43
RTW_INFO("Offset08(0x%08x)\n", *((u32 *)(ptxdesc + 8)));
44
RTW_INFO("Offset12(0x%08x)\n", *((u32 *)(ptxdesc + 12)));
45
RTW_INFO("Offset16(0x%08x)\n", *((u32 *)(ptxdesc + 16)));
46
RTW_INFO("Offset20(0x%08x)\n", *((u32 *)(ptxdesc + 20)));
47
RTW_INFO("Offset24(0x%08x)\n", *((u32 *)(ptxdesc + 24)));
48
RTW_INFO("Offset28(0x%08x)\n", *((u32 *)(ptxdesc + 28)));
49
RTW_INFO("Offset32(0x%08x)\n", *((u32 *)(ptxdesc + 32)));
50
RTW_INFO("Offset36(0x%08x)\n", *((u32 *)(ptxdesc + 36)));
51
RTW_INFO("=====================================\n");
52
}
53
54
}
55
56
/*
57
* Description:
58
* Aggregation packets and send to hardware
59
*
60
* Return:
61
* 0 Success
62
* -1 Hardware resource(TX FIFO) not ready
63
* -2 Software resource(xmitbuf) not ready
64
*/
65
#ifdef CONFIG_TX_EARLY_MODE
66
67
/* #define DBG_EMINFO */
68
69
#if RTL8188E_EARLY_MODE_PKT_NUM_10 == 1
70
#define EARLY_MODE_MAX_PKT_NUM 10
71
#else
72
#define EARLY_MODE_MAX_PKT_NUM 5
73
#endif
74
75
76
struct EMInfo {
77
u8 EMPktNum;
78
u16 EMPktLen[EARLY_MODE_MAX_PKT_NUM];
79
};
80
81
82
void
83
InsertEMContent_8814(
84
struct EMInfo *pEMInfo,
85
u8 *VirtualAddress)
86
{
87
88
#if RTL8188E_EARLY_MODE_PKT_NUM_10 == 1
89
u8 index = 0;
90
u32 dwtmp = 0;
91
#endif
92
93
_rtw_memset(VirtualAddress, 0, EARLY_MODE_INFO_SIZE);
94
if (pEMInfo->EMPktNum == 0)
95
return;
96
97
#ifdef DBG_EMINFO
98
{
99
int i;
100
RTW_INFO("\n%s ==> pEMInfo->EMPktNum =%d\n", __FUNCTION__, pEMInfo->EMPktNum);
101
for (i = 0; i < EARLY_MODE_MAX_PKT_NUM; i++)
102
RTW_INFO("%s ==> pEMInfo->EMPktLen[%d] =%d\n", __FUNCTION__, i, pEMInfo->EMPktLen[i]);
103
104
}
105
#endif
106
107
#if RTL8188E_EARLY_MODE_PKT_NUM_10 == 1
108
SET_EARLYMODE_PKTNUM(VirtualAddress, pEMInfo->EMPktNum);
109
110
if (pEMInfo->EMPktNum == 1)
111
dwtmp = pEMInfo->EMPktLen[0];
112
else {
113
dwtmp = pEMInfo->EMPktLen[0];
114
dwtmp += ((dwtmp % 4) ? (4 - dwtmp % 4) : 0) + 4;
115
dwtmp += pEMInfo->EMPktLen[1];
116
}
117
SET_EARLYMODE_LEN0(VirtualAddress, dwtmp);
118
if (pEMInfo->EMPktNum <= 3)
119
dwtmp = pEMInfo->EMPktLen[2];
120
else {
121
dwtmp = pEMInfo->EMPktLen[2];
122
dwtmp += ((dwtmp % 4) ? (4 - dwtmp % 4) : 0) + 4;
123
dwtmp += pEMInfo->EMPktLen[3];
124
}
125
SET_EARLYMODE_LEN1(VirtualAddress, dwtmp);
126
if (pEMInfo->EMPktNum <= 5)
127
dwtmp = pEMInfo->EMPktLen[4];
128
else {
129
dwtmp = pEMInfo->EMPktLen[4];
130
dwtmp += ((dwtmp % 4) ? (4 - dwtmp % 4) : 0) + 4;
131
dwtmp += pEMInfo->EMPktLen[5];
132
}
133
SET_EARLYMODE_LEN2_1(VirtualAddress, dwtmp & 0xF);
134
SET_EARLYMODE_LEN2_2(VirtualAddress, dwtmp >> 4);
135
if (pEMInfo->EMPktNum <= 7)
136
dwtmp = pEMInfo->EMPktLen[6];
137
else {
138
dwtmp = pEMInfo->EMPktLen[6];
139
dwtmp += ((dwtmp % 4) ? (4 - dwtmp % 4) : 0) + 4;
140
dwtmp += pEMInfo->EMPktLen[7];
141
}
142
SET_EARLYMODE_LEN3(VirtualAddress, dwtmp);
143
if (pEMInfo->EMPktNum <= 9)
144
dwtmp = pEMInfo->EMPktLen[8];
145
else {
146
dwtmp = pEMInfo->EMPktLen[8];
147
dwtmp += ((dwtmp % 4) ? (4 - dwtmp % 4) : 0) + 4;
148
dwtmp += pEMInfo->EMPktLen[9];
149
}
150
SET_EARLYMODE_LEN4(VirtualAddress, dwtmp);
151
#else
152
SET_EARLYMODE_PKTNUM(VirtualAddress, pEMInfo->EMPktNum);
153
SET_EARLYMODE_LEN0(VirtualAddress, pEMInfo->EMPktLen[0]);
154
SET_EARLYMODE_LEN1(VirtualAddress, pEMInfo->EMPktLen[1]);
155
SET_EARLYMODE_LEN2_1(VirtualAddress, pEMInfo->EMPktLen[2] & 0xF);
156
SET_EARLYMODE_LEN2_2(VirtualAddress, pEMInfo->EMPktLen[2] >> 4);
157
SET_EARLYMODE_LEN3(VirtualAddress, pEMInfo->EMPktLen[3]);
158
SET_EARLYMODE_LEN4(VirtualAddress, pEMInfo->EMPktLen[4]);
159
#endif
160
161
}
162
163
164
165
void UpdateEarlyModeInfo8814(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
166
{
167
/* _adapter *padapter, struct xmit_frame *pxmitframe,struct tx_servq *ptxservq */
168
int index, j;
169
u16 offset, pktlen;
170
PTXDESC_8814 ptxdesc;
171
172
u8 *pmem, *pEMInfo_mem;
173
s8 node_num_0 = 0, node_num_1 = 0;
174
struct EMInfo eminfo;
175
struct agg_pkt_info *paggpkt;
176
struct xmit_frame *pframe = (struct xmit_frame *)pxmitbuf->priv_data;
177
pmem = pframe->buf_addr;
178
179
#ifdef DBG_EMINFO
180
RTW_INFO("\n%s ==> agg_num:%d\n", __FUNCTION__, pframe->agg_num);
181
for (index = 0; index < pframe->agg_num; index++) {
182
offset = pxmitpriv->agg_pkt[index].offset;
183
pktlen = pxmitpriv->agg_pkt[index].pkt_len;
184
RTW_INFO("%s ==> agg_pkt[%d].offset=%d\n", __FUNCTION__, index, offset);
185
RTW_INFO("%s ==> agg_pkt[%d].pkt_len=%d\n", __FUNCTION__, index, pktlen);
186
}
187
#endif
188
189
if (pframe->agg_num > EARLY_MODE_MAX_PKT_NUM) {
190
node_num_0 = pframe->agg_num;
191
node_num_1 = EARLY_MODE_MAX_PKT_NUM - 1;
192
}
193
194
for (index = 0; index < pframe->agg_num; index++) {
195
196
offset = pxmitpriv->agg_pkt[index].offset;
197
pktlen = pxmitpriv->agg_pkt[index].pkt_len;
198
199
_rtw_memset(&eminfo, 0, sizeof(struct EMInfo));
200
if (pframe->agg_num > EARLY_MODE_MAX_PKT_NUM) {
201
if (node_num_0 > EARLY_MODE_MAX_PKT_NUM) {
202
eminfo.EMPktNum = EARLY_MODE_MAX_PKT_NUM;
203
node_num_0--;
204
} else {
205
eminfo.EMPktNum = node_num_1;
206
node_num_1--;
207
}
208
} else
209
eminfo.EMPktNum = pframe->agg_num - (index + 1);
210
for (j = 0; j < eminfo.EMPktNum ; j++) {
211
eminfo.EMPktLen[j] = pxmitpriv->agg_pkt[index + 1 + j].pkt_len + 4; /* 4 bytes CRC */
212
}
213
214
if (pmem) {
215
if (index == 0) {
216
ptxdesc = (PTXDESC_8814)(pmem);
217
pEMInfo_mem = ((u8 *)ptxdesc) + TXDESC_SIZE;
218
} else {
219
pmem = pmem + pxmitpriv->agg_pkt[index - 1].offset;
220
ptxdesc = (PTXDESC_8814)(pmem);
221
pEMInfo_mem = ((u8 *)ptxdesc) + TXDESC_SIZE;
222
}
223
224
#ifdef DBG_EMINFO
225
RTW_INFO("%s ==> desc.pkt_len=%d\n", __FUNCTION__, ptxdesc->pktlen);
226
#endif
227
InsertEMContent_8814(&eminfo, pEMInfo_mem);
228
}
229
230
231
}
232
_rtw_memset(pxmitpriv->agg_pkt, 0, sizeof(struct agg_pkt_info) * MAX_AGG_PKT_NUM);
233
234
}
235
#endif
236
237
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI)
238
void rtl8814a_cal_txdesc_chksum(u8 *ptxdesc)
239
{
240
u16 *usPtr;
241
u32 count;
242
u32 index;
243
u16 checksum = 0;
244
245
246
usPtr = (u16 *)ptxdesc;
247
/* checksume is always calculated by first 32 bytes, */
248
/* and it doesn't depend on TX DESC length. */
249
/* Thomas,Lucas@SD4,20130515 */
250
count = 16;
251
252
/* Clear first */
253
SET_TX_DESC_TX_DESC_CHECKSUM_8814A(ptxdesc, 0);
254
255
for (index = 0 ; index < count ; index++)
256
checksum = checksum ^ le16_to_cpu(*(usPtr + index));
257
258
SET_TX_DESC_TX_DESC_CHECKSUM_8814A(ptxdesc, checksum);
259
}
260
#endif
261
262
/*
263
* Description: In normal chip, we should send some packet to Hw which will be used by Fw
264
* in FW LPS mode. The function is to fill the Tx descriptor of this packets, then
265
* Fw can tell Hw to send these packet derectly.
266
* */
267
void rtl8814a_fill_fake_txdesc(
268
PADAPTER padapter,
269
u8 *pDesc,
270
u32 BufferLen,
271
u8 IsPsPoll,
272
u8 IsBTQosNull,
273
u8 bDataFrame)
274
{
275
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
276
277
278
/* Clear all status */
279
_rtw_memset(pDesc, 0, TXDESC_SIZE);
280
281
SET_TX_DESC_LAST_SEG_8814A(pDesc, 1);
282
283
SET_TX_DESC_OFFSET_8814A(pDesc, TXDESC_SIZE);
284
285
SET_TX_DESC_PKT_SIZE_8814A(pDesc, BufferLen);
286
287
SET_TX_DESC_QUEUE_SEL_8814A(pDesc, QSLT_MGNT);
288
289
if (pmlmeext->cur_wireless_mode & WIRELESS_11B)
290
SET_TX_DESC_RATE_ID_8814A(pDesc, RATEID_IDX_B);
291
else
292
SET_TX_DESC_RATE_ID_8814A(pDesc, RATEID_IDX_G);
293
294
/* Set NAVUSEHDR to prevent Ps-poll AId filed to be changed to error vlaue by Hw. */
295
if (IsPsPoll)
296
SET_TX_DESC_NAV_USE_HDR_8814A(pDesc, 1);
297
else {
298
SET_TX_DESC_HWSEQ_EN_8814A(pDesc, 1); /* Hw set sequence number */
299
}
300
#if 0 /* todo */
301
if (IsBTQosNull)
302
SET_TX_DESC_BT_INT_8812(pDesc, 1);
303
#endif /* 0 */
304
305
SET_TX_DESC_USE_RATE_8814A(pDesc, 1);
306
307
/* 8814 no OWN bit? */
308
/* SET_TX_DESC_OWN_8812(pDesc, 1); */
309
310
/* */
311
/* Encrypt the data frame if under security mode excepct null data. Suggested by CCW. */
312
/* */
313
if (_TRUE == bDataFrame) {
314
u32 EncAlg;
315
316
EncAlg = padapter->securitypriv.dot11PrivacyAlgrthm;
317
switch (EncAlg) {
318
case _NO_PRIVACY_:
319
SET_TX_DESC_SEC_TYPE_8814A(pDesc, 0x0);
320
break;
321
case _WEP40_:
322
case _WEP104_:
323
case _TKIP_:
324
SET_TX_DESC_SEC_TYPE_8814A(pDesc, 0x1);
325
break;
326
case _SMS4_:
327
SET_TX_DESC_SEC_TYPE_8814A(pDesc, 0x2);
328
break;
329
case _AES_:
330
SET_TX_DESC_SEC_TYPE_8814A(pDesc, 0x3);
331
break;
332
default:
333
SET_TX_DESC_SEC_TYPE_8814A(pDesc, 0x0);
334
break;
335
}
336
}
337
SET_TX_DESC_TX_RATE_8814A(pDesc, MRateToHwRate(pmlmeext->tx_rate));
338
339
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI)
340
/* USB interface drop packet if the checksum of descriptor isn't correct. */
341
/* Using this checksum can let hardware recovery from packet bulk out error (e.g. Cancel URC, Bulk out error.). */
342
rtl8814a_cal_txdesc_chksum(pDesc);
343
#endif
344
}
345
346
#if defined(CONFIG_CONCURRENT_MODE)
347
void fill_txdesc_force_bmc_camid(struct pkt_attrib *pattrib, u8 *ptxdesc)
348
{
349
if ((pattrib->encrypt > 0) && (!pattrib->bswenc)
350
&& (pattrib->bmc_camid != INVALID_SEC_MAC_CAM_ID)) {
351
352
SET_TX_DESC_EN_DESC_ID_8814A(ptxdesc, 1);
353
SET_TX_DESC_MACID_8814A(ptxdesc, pattrib->bmc_camid);
354
}
355
}
356
#endif
357
void fill_txdesc_bmc_tx_rate(struct pkt_attrib *pattrib, u8 *ptxdesc)
358
{
359
SET_TX_DESC_USE_RATE_8814A(ptxdesc, 1);
360
SET_TX_DESC_TX_RATE_8814A(ptxdesc, MRateToHwRate(pattrib->rate));
361
SET_TX_DESC_DISABLE_FB_8814A(ptxdesc, 1);
362
}
363
364
void rtl8814a_fill_txdesc_sectype(struct pkt_attrib *pattrib, u8 *ptxdesc)
365
{
366
if ((pattrib->encrypt > 0) && !pattrib->bswenc) {
367
switch (pattrib->encrypt) {
368
/* SEC_TYPE : 0:NO_ENC,1:WEP40/TKIP,2:WAPI,3:AES */
369
case _WEP40_:
370
case _WEP104_:
371
case _TKIP_:
372
case _TKIP_WTMIC_:
373
SET_TX_DESC_SEC_TYPE_8814A(ptxdesc, 0x1);
374
break;
375
#ifdef CONFIG_WAPI_SUPPORT
376
case _SMS4_:
377
SET_TX_DESC_SEC_TYPE_8814A(ptxdesc, 0x2);
378
break;
379
#endif
380
case _AES_:
381
SET_TX_DESC_SEC_TYPE_8814A(ptxdesc, 0x3);
382
break;
383
case _NO_PRIVACY_:
384
default:
385
SET_TX_DESC_SEC_TYPE_8814A(ptxdesc, 0x0);
386
break;
387
388
}
389
390
}
391
392
}
393
394
void rtl8814a_fill_txdesc_vcs(PADAPTER padapter, struct pkt_attrib *pattrib, u8 *ptxdesc)
395
{
396
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
397
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
398
399
/* RTW_INFO("vcs_mode=%d\n", pattrib->vcs_mode); */
400
401
if (pattrib->vcs_mode) {
402
403
switch (pattrib->vcs_mode) {
404
case RTS_CTS:
405
SET_TX_DESC_RTS_ENABLE_8814A(ptxdesc, 1);
406
break;
407
case CTS_TO_SELF:
408
SET_TX_DESC_CTS2SELF_8814A(ptxdesc, 1);
409
break;
410
case NONE_VCS:
411
default:
412
break;
413
}
414
415
if (pmlmeinfo->preamble_mode == PREAMBLE_SHORT)
416
SET_TX_DESC_RTS_SHORT_8814A(ptxdesc, 1);
417
418
/* RTS Rate=24M */
419
SET_TX_DESC_RTS_RATE_8814A(ptxdesc, 0x8);
420
421
/* compatibility for MCC consideration, use pmlmeext->cur_channel */
422
if (pmlmeext->cur_channel > 14)
423
/* RTS retry to rate OFDM 6M for 5G */
424
SET_TX_DESC_RTS_RATE_FB_LIMIT_8814A(ptxdesc, 4);
425
else
426
/* RTS retry to rate CCK 1M for 2.4G */
427
SET_TX_DESC_RTS_RATE_FB_LIMIT_8814A(ptxdesc, 0);
428
}
429
}
430
431
432
u8
433
BWMapping_8814(
434
PADAPTER Adapter,
435
struct pkt_attrib *pattrib
436
)
437
{
438
u8 BWSettingOfDesc = 0;
439
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
440
441
/* RTW_INFO("BWMapping pHalData->current_channel_bw %d, pattrib->bwmode %d\n",pHalData->current_channel_bw,pattrib->bwmode); */
442
443
if (pHalData->current_channel_bw == CHANNEL_WIDTH_80) {
444
if (pattrib->bwmode == CHANNEL_WIDTH_80)
445
BWSettingOfDesc = 2;
446
else if (pattrib->bwmode == CHANNEL_WIDTH_40)
447
BWSettingOfDesc = 1;
448
else
449
BWSettingOfDesc = 0;
450
} else if (pHalData->current_channel_bw == CHANNEL_WIDTH_40) {
451
if ((pattrib->bwmode == CHANNEL_WIDTH_40) || (pattrib->bwmode == CHANNEL_WIDTH_80))
452
BWSettingOfDesc = 1;
453
else
454
BWSettingOfDesc = 0;
455
} else
456
BWSettingOfDesc = 0;
457
458
return BWSettingOfDesc;
459
}
460
461
u8
462
SCMapping_8814(
463
PADAPTER Adapter,
464
struct pkt_attrib *pattrib
465
)
466
{
467
u8 SCSettingOfDesc = 0;
468
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
469
/* RTW_INFO("SCMapping: pHalData->current_channel_bw %d, pHalData->nCur80MhzPrimeSC %d, pHalData->nCur40MhzPrimeSC %d\n",pHalData->current_channel_bw,pHalData->nCur80MhzPrimeSC,pHalData->nCur40MhzPrimeSC); */
470
471
if (pHalData->current_channel_bw == CHANNEL_WIDTH_80) {
472
if (pattrib->bwmode == CHANNEL_WIDTH_80)
473
SCSettingOfDesc = VHT_DATA_SC_DONOT_CARE;
474
else if (pattrib->bwmode == CHANNEL_WIDTH_40) {
475
if (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER)
476
SCSettingOfDesc = VHT_DATA_SC_40_LOWER_OF_80MHZ;
477
else if (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER)
478
SCSettingOfDesc = VHT_DATA_SC_40_UPPER_OF_80MHZ;
479
else
480
RTW_INFO("SCMapping: DONOT CARE Mode Setting\n");
481
} else {
482
if ((pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) && (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER))
483
SCSettingOfDesc = VHT_DATA_SC_20_LOWEST_OF_80MHZ;
484
else if ((pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) && (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER))
485
SCSettingOfDesc = VHT_DATA_SC_20_LOWER_OF_80MHZ;
486
else if ((pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) && (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER))
487
SCSettingOfDesc = VHT_DATA_SC_20_UPPER_OF_80MHZ;
488
else if ((pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) && (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER))
489
SCSettingOfDesc = VHT_DATA_SC_20_UPPERST_OF_80MHZ;
490
else
491
RTW_INFO("SCMapping: DONOT CARE Mode Setting\n");
492
}
493
} else if (pHalData->current_channel_bw == CHANNEL_WIDTH_40) {
494
/* RTW_INFO("SCMapping: HT Case: pHalData->current_channel_bw %d, pHalData->nCur40MhzPrimeSC %d\n",pHalData->current_channel_bw,pHalData->nCur40MhzPrimeSC); */
495
496
if (pattrib->bwmode == CHANNEL_WIDTH_40)
497
SCSettingOfDesc = VHT_DATA_SC_DONOT_CARE;
498
else if (pattrib->bwmode == CHANNEL_WIDTH_20) {
499
if (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER)
500
SCSettingOfDesc = VHT_DATA_SC_20_UPPER_OF_80MHZ;
501
else if (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER)
502
SCSettingOfDesc = VHT_DATA_SC_20_LOWER_OF_80MHZ;
503
else
504
SCSettingOfDesc = VHT_DATA_SC_DONOT_CARE;
505
506
}
507
} else
508
SCSettingOfDesc = VHT_DATA_SC_DONOT_CARE;
509
510
return SCSettingOfDesc;
511
}
512
513
514
void rtl8814a_fill_txdesc_phy(PADAPTER padapter, struct pkt_attrib *pattrib, u8 *ptxdesc)
515
{
516
/* RTW_INFO("bwmode=%d, ch_off=%d\n", pattrib->bwmode, pattrib->ch_offset); */
517
518
if (pattrib->ht_en) {
519
/* Set Bandwidth and sub-channel settings. */
520
SET_TX_DESC_DATA_BW_8814A(ptxdesc, BWMapping_8814(padapter, pattrib));
521
522
SET_TX_DESC_DATA_SC_8814A(ptxdesc, SCMapping_8814(padapter, pattrib));
523
}
524
}
525
526