1 /****************************************************************************** 2 * 3 * Copyright(c) 2007 - 2019 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 #ifndef _RTW_XMIT_H_ 16 #define _RTW_XMIT_H_ 17 18 19 #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) 20 #ifdef CONFIG_TX_AGGREGATION 21 #ifdef CONFIG_RTL8822C 22 #ifdef CONFIG_SDIO_TX_FORMAT_DUMMY_AUTO 23 #define MAX_XMITBUF_SZ (51200) 24 #else 25 #define MAX_XMITBUF_SZ (32764) 26 #endif 27 #else 28 #define MAX_XMITBUF_SZ (20480) /* 20k */ 29 #endif 30 /* #define SDIO_TX_AGG_MAX 5 */ 31 #else 32 #define MAX_XMITBUF_SZ (1664) 33 #define SDIO_TX_AGG_MAX 1 34 #endif 35 36 #if defined CONFIG_SDIO_HCI 37 #define NR_XMITBUFF (16) 38 #define SDIO_TX_DIV_NUM (2) 39 #endif 40 #if defined(CONFIG_GSPI_HCI) 41 #define NR_XMITBUFF (128) 42 #endif 43 44 #elif defined (CONFIG_USB_HCI) 45 46 #ifdef CONFIG_USB_TX_AGGREGATION 47 #if defined(CONFIG_PLATFORM_ARM_SUNxI) || defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I) || defined(CONFIG_PLATFORM_ARM_SUN8I) || defined(CONFIG_PLATFORM_ARM_SUN50IW1P1) 48 #define MAX_XMITBUF_SZ (12288) /* 12k 1536*8 */ 49 #elif defined (CONFIG_PLATFORM_MSTAR) 50 #define MAX_XMITBUF_SZ 7680 /* 7.5k */ 51 #else 52 #define MAX_XMITBUF_SZ (20480) /* 20k */ 53 #endif 54 #else 55 #define MAX_XMITBUF_SZ (2048) 56 #endif 57 58 #ifdef CONFIG_SINGLE_XMIT_BUF 59 #define NR_XMITBUFF (1) 60 #else 61 #define NR_XMITBUFF (4) 62 #endif /* CONFIG_SINGLE_XMIT_BUF */ 63 #elif defined (CONFIG_PCI_HCI) 64 #ifdef CONFIG_TX_AMSDU 65 #define MAX_XMITBUF_SZ (3500) 66 #else 67 #define MAX_XMITBUF_SZ (1664) 68 #endif 69 #ifdef CONFIG_PCI_TX_POLLING 70 #define NR_XMITBUFF (256) 71 #else 72 #define NR_XMITBUFF (128) 73 #endif 74 #endif 75 76 77 #ifdef CONFIG_PCI_HCI 78 #define XMITBUF_ALIGN_SZ 4 79 #else 80 #ifdef USB_XMITBUF_ALIGN_SZ 81 #define XMITBUF_ALIGN_SZ (USB_XMITBUF_ALIGN_SZ) 82 #else 83 #define XMITBUF_ALIGN_SZ 512 84 #endif 85 #endif 86 87 88 /* xmit extension buff defination */ 89 #define MAX_XMIT_EXTBUF_SZ (1536) 90 91 #ifdef CONFIG_SINGLE_XMIT_BUF 92 #define NR_XMIT_EXTBUFF (1) 93 #elif defined(CONFIG_RTW_MGMT_QUEUE) 94 #define NR_XMIT_EXTBUFF (64) 95 #else 96 #define NR_XMIT_EXTBUFF (32) 97 #endif 98 99 #ifdef CONFIG_RTL8812A 100 #define MAX_CMDBUF_SZ (512 * 18) 101 #elif defined(CONFIG_RTL8723D) && defined(CONFIG_LPS_POFF) 102 #define MAX_CMDBUF_SZ (128*70) /*(8960)*/ 103 #elif defined(CONFIG_RTL8822C) && defined(CONFIG_WAR_OFFLOAD) 104 #define MAX_CMDBUF_SZ (128*128) /*(16k) */ 105 #else 106 #define MAX_CMDBUF_SZ (5120) /* (4096) */ 107 #endif 108 109 #define MAX_BEACON_LEN 512 110 111 #define MAX_NUMBLKS (1) 112 113 #define XMIT_VO_QUEUE (0) 114 #define XMIT_VI_QUEUE (1) 115 #define XMIT_BE_QUEUE (2) 116 #define XMIT_BK_QUEUE (3) 117 118 #define VO_QUEUE_INX 0 119 #define VI_QUEUE_INX 1 120 #define BE_QUEUE_INX 2 121 #define BK_QUEUE_INX 3 122 #define BCN_QUEUE_INX 4 123 #define MGT_QUEUE_INX 5 124 #define TXCMD_QUEUE_INX 6 125 #define HIGH_QUEUE_INX 7 126 /* keep high queue to be the last one, so we can extend HIQ to port 1, 2, ... */ 127 128 #ifndef CONFIG_PORT_BASED_HIQ 129 #define HW_QUEUE_ENTRY 8 130 #else 131 #define HI_QUEUE_INX(n) (HIGH_QUEUE_INX + (n)) 132 #define HW_QUEUE_ENTRY (8 + CONFIG_IFACE_NUMBER - 1) 133 #endif 134 135 #ifdef CONFIG_PCI_HCI 136 #ifdef CONFIG_TRX_BD_ARCH 137 #define TX_BD_NUM (128+1) /* +1 result from ring buffer */ 138 #else 139 #define TXDESC_NUM 128 140 #endif 141 #endif 142 143 #define WEP_IV(pattrib_iv, dot11txpn, keyidx)\ 144 do {\ 145 dot11txpn.val = (dot11txpn.val == 0xffffff) ? 0 : (dot11txpn.val + 1);\ 146 pattrib_iv[0] = dot11txpn._byte_.TSC0;\ 147 pattrib_iv[1] = dot11txpn._byte_.TSC1;\ 148 pattrib_iv[2] = dot11txpn._byte_.TSC2;\ 149 pattrib_iv[3] = ((keyidx & 0x3)<<6);\ 150 } while (0) 151 152 153 #define TKIP_IV(pattrib_iv, dot11txpn, keyidx)\ 154 do {\ 155 dot11txpn.val = dot11txpn.val == 0xffffffffffffULL ? 0 : (dot11txpn.val + 1);\ 156 pattrib_iv[0] = dot11txpn._byte_.TSC1;\ 157 pattrib_iv[1] = (dot11txpn._byte_.TSC1 | 0x20) & 0x7f;\ 158 pattrib_iv[2] = dot11txpn._byte_.TSC0;\ 159 pattrib_iv[3] = BIT(5) | ((keyidx & 0x3)<<6);\ 160 pattrib_iv[4] = dot11txpn._byte_.TSC2;\ 161 pattrib_iv[5] = dot11txpn._byte_.TSC3;\ 162 pattrib_iv[6] = dot11txpn._byte_.TSC4;\ 163 pattrib_iv[7] = dot11txpn._byte_.TSC5;\ 164 } while (0) 165 166 #define AES_IV(pattrib_iv, dot11txpn, keyidx)\ 167 do {\ 168 dot11txpn.val = dot11txpn.val == 0xffffffffffffULL ? 0 : (dot11txpn.val + 1);\ 169 pattrib_iv[0] = dot11txpn._byte_.TSC0;\ 170 pattrib_iv[1] = dot11txpn._byte_.TSC1;\ 171 pattrib_iv[2] = 0;\ 172 pattrib_iv[3] = BIT(5) | ((keyidx & 0x3)<<6);\ 173 pattrib_iv[4] = dot11txpn._byte_.TSC2;\ 174 pattrib_iv[5] = dot11txpn._byte_.TSC3;\ 175 pattrib_iv[6] = dot11txpn._byte_.TSC4;\ 176 pattrib_iv[7] = dot11txpn._byte_.TSC5;\ 177 } while (0) 178 179 #define GCMP_IV(a, b, c) AES_IV(a, b, c) 180 181 /* Check if AMPDU Tx is supported or not. If it is supported, 182 * it need to check "amsdu in ampdu" is supported or not. 183 * (ampdu_en, amsdu_ampdu_en) = 184 * (0, x) : AMPDU is not enable, but AMSDU is valid to send. 185 * (1, 0) : AMPDU is enable, AMSDU in AMPDU is not enable. So, AMSDU is not valid to send. 186 * (1, 1) : AMPDU and AMSDU in AMPDU are enable. So, AMSDU is valid to send. 187 */ 188 #define IS_AMSDU_AMPDU_NOT_VALID(pattrib)\ 189 ((pattrib->ampdu_en == _TRUE) && (pattrib->amsdu_ampdu_en == _FALSE)) 190 191 #define IS_AMSDU_AMPDU_VALID(pattrib)\ 192 !((pattrib->ampdu_en == _TRUE) && (pattrib->amsdu_ampdu_en == _FALSE)) 193 194 #ifdef CONFIG_RTW_MGMT_QUEUE 195 #define HWXMIT_ENTRY 5 196 #else 197 #define HWXMIT_ENTRY 4 198 #endif 199 200 enum DEQUEUE_TYPE { 201 UNI_BMC_DATA, 202 UNI_MGMT, 203 ALL_FRAME 204 }; 205 206 /* For Buffer Descriptor ring architecture */ 207 #if defined(BUF_DESC_ARCH) || defined(CONFIG_TRX_BD_ARCH) 208 #if defined(CONFIG_RTL8192E) 209 #define TX_BUFFER_SEG_NUM 1 /* 0:2 seg, 1: 4 seg, 2: 8 seg. */ 210 #elif defined(CONFIG_RTL8814A) 211 #define TX_BUFFER_SEG_NUM 1 /* 0:2 seg, 1: 4 seg, 2: 8 seg. */ 212 #else 213 #define TX_BUFFER_SEG_NUM 1 /* 0:2 seg, 1: 4 seg, 2: 8 seg. */ 214 #endif 215 #endif 216 217 #if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) ||\ 218 defined(CONFIG_RTL8723B) || defined(CONFIG_RTL8192E) ||\ 219 defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8703B) ||\ 220 defined(CONFIG_RTL8188F) || defined(CONFIG_RTL8188GTV) || defined(CONFIG_RTL8723D) ||\ 221 defined(CONFIG_RTL8710B) || defined(CONFIG_RTL8192F) ||\ 222 defined(CONFIG_RTL8723F) 223 #define TXDESC_SIZE 40 224 #elif defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8822C) 225 #define TXDESC_SIZE 48 /* HALMAC_TX_DESC_SIZE_8822B */ 226 #elif defined(CONFIG_RTL8821C) 227 #define TXDESC_SIZE 48 /* HALMAC_TX_DESC_SIZE_8821C */ 228 #elif defined(CONFIG_RTL8814B) 229 #define TXDESC_SIZE (16 + 32) 230 #else 231 #define TXDESC_SIZE 32 /* old IC (ex: 8188E) */ 232 #endif 233 234 #ifdef CONFIG_TX_EARLY_MODE 235 #define EARLY_MODE_INFO_SIZE 8 236 #endif 237 238 239 #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) 240 #define TXDESC_OFFSET TXDESC_SIZE 241 #endif 242 243 #ifdef CONFIG_USB_HCI 244 #ifdef USB_PACKET_OFFSET_SZ 245 #define PACKET_OFFSET_SZ (USB_PACKET_OFFSET_SZ) 246 #else 247 #define PACKET_OFFSET_SZ (8) 248 #endif 249 #define TXDESC_OFFSET (TXDESC_SIZE + PACKET_OFFSET_SZ) 250 #endif 251 252 #ifdef CONFIG_PCI_HCI 253 #if defined(CONFIG_RTL8192E) || defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C) || defined(CONFIG_TRX_BD_ARCH) 254 /* this section is defined for buffer descriptor ring architecture */ 255 #define TX_WIFI_INFO_SIZE (TXDESC_SIZE) /* it may add 802.11 hdr or others... */ 256 /* tx desc and payload are in the same buf */ 257 #define TXDESC_OFFSET (TX_WIFI_INFO_SIZE) 258 #else 259 /* tx desc and payload are NOT in the same buf */ 260 #define TXDESC_OFFSET (0) 261 /* 8188ee/8723be/8812ae/8821ae has extra PCI DMA info in tx desc */ 262 #define TX_DESC_NEXT_DESC_OFFSET (TXDESC_SIZE + 8) 263 #endif 264 #endif /* CONFIG_PCI_HCI */ 265 266 enum TXDESC_SC { 267 SC_DONT_CARE = 0x00, 268 SC_UPPER = 0x01, 269 SC_LOWER = 0x02, 270 SC_DUPLICATE = 0x03 271 }; 272 273 #ifdef CONFIG_PCI_HCI 274 #ifndef CONFIG_TRX_BD_ARCH /* CONFIG_TRX_BD_ARCH doesn't need this */ 275 #define TXDESC_64_BYTES 276 #endif 277 #elif defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) || defined(CONFIG_RTL8723B) \ 278 || defined(CONFIG_RTL8188F) || defined(CONFIG_RTL8188GTV) || defined(CONFIG_RTL8723D) \ 279 || defined(CONFIG_RTL8192F) || defined(CONFIG_RTL8723F) 280 #define TXDESC_40_BYTES 281 #endif 282 283 #ifdef CONFIG_TRX_BD_ARCH 284 struct tx_buf_desc { 285 #ifdef CONFIG_64BIT_DMA 286 #define TX_BUFFER_SEG_SIZE 4 /* in unit of DWORD */ 287 #else 288 #define TX_BUFFER_SEG_SIZE 2 /* in unit of DWORD */ 289 #endif 290 unsigned int dword[TX_BUFFER_SEG_SIZE * (2 << TX_BUFFER_SEG_NUM)]; 291 } __packed; 292 #elif (defined(CONFIG_RTL8192E) || defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8822C)) && defined(CONFIG_PCI_HCI) /* 8192ee or 8814ae */ 293 /* 8192EE_TODO */ 294 struct tx_desc { 295 unsigned int txdw0; 296 unsigned int txdw1; 297 unsigned int txdw2; 298 unsigned int txdw3; 299 unsigned int txdw4; 300 unsigned int txdw5; 301 unsigned int txdw6; 302 unsigned int txdw7; 303 }; 304 #else 305 struct tx_desc { 306 unsigned int txdw0; 307 unsigned int txdw1; 308 unsigned int txdw2; 309 unsigned int txdw3; 310 unsigned int txdw4; 311 unsigned int txdw5; 312 unsigned int txdw6; 313 unsigned int txdw7; 314 315 #if defined(TXDESC_40_BYTES) || defined(TXDESC_64_BYTES) 316 unsigned int txdw8; 317 unsigned int txdw9; 318 #endif /* TXDESC_40_BYTES */ 319 320 #ifdef TXDESC_64_BYTES 321 unsigned int txdw10; 322 unsigned int txdw11; 323 324 /* 2008/05/15 MH Because PCIE HW memory R/W 4K limit. And now, our descriptor */ 325 /* size is 40 bytes. If you use more than 102 descriptor( 103*40>4096), HW will execute */ 326 /* memoryR/W CRC error. And then all DMA fetch will fail. We must decrease descriptor */ 327 /* number or enlarge descriptor size as 64 bytes. */ 328 unsigned int txdw12; 329 unsigned int txdw13; 330 unsigned int txdw14; 331 unsigned int txdw15; 332 #endif 333 }; 334 #endif 335 336 #ifndef CONFIG_TRX_BD_ARCH 337 union txdesc { 338 struct tx_desc txdesc; 339 unsigned int value[TXDESC_SIZE >> 2]; 340 }; 341 #endif 342 343 #ifdef CONFIG_PCI_HCI 344 #define PCI_MAX_TX_QUEUE_COUNT HW_QUEUE_ENTRY 345 346 struct rtw_tx_ring { 347 unsigned char qid; 348 #ifdef CONFIG_TRX_BD_ARCH 349 struct tx_buf_desc *buf_desc; 350 #else 351 struct tx_desc *desc; 352 #endif 353 dma_addr_t dma; 354 unsigned int idx; 355 unsigned int entries; 356 _queue queue; 357 u32 qlen; 358 #ifdef CONFIG_TRX_BD_ARCH 359 u16 hw_rp_cache; 360 #endif 361 }; 362 363 #ifdef DBG_TXBD_DESC_DUMP 364 365 #define TX_BAK_FRMAE_CNT 10 366 #define TX_BAK_DESC_LEN 48 /* byte */ 367 #define TX_BAK_DATA_LEN 30 /* byte */ 368 369 struct rtw_tx_desc_backup { 370 int tx_bak_rp; 371 int tx_bak_wp; 372 u8 tx_bak_desc[TX_BAK_DESC_LEN]; 373 u8 tx_bak_data_hdr[TX_BAK_DATA_LEN]; 374 u8 tx_desc_size; 375 }; 376 #endif 377 #endif 378 379 struct hw_xmit { 380 /* _lock xmit_lock; */ 381 /* _list pending; */ 382 _queue *sta_queue; 383 /* struct hw_txqueue *phwtxqueue; */ 384 /* sint txcmdcnt; */ 385 int accnt; 386 }; 387 388 struct pkt_attrib { 389 u8 type; 390 u8 subtype; 391 u8 bswenc; 392 u8 dhcp_pkt; 393 u16 ether_type; 394 u16 seqnum; 395 u8 hw_ssn_sel; /* for HW_SEQ0,1,2,3 */ 396 u16 pkt_hdrlen; /* the original 802.3 pkt header len */ 397 u16 hdrlen; /* the WLAN Header Len */ 398 u32 pktlen; /* the original 802.3 pkt raw_data len (not include ether_hdr data) */ 399 u32 last_txcmdsz; 400 u8 nr_frags; 401 u8 encrypt; /* when 0 indicate no encrypt. when non-zero, indicate the encrypt algorith */ 402 u8 bmc_camid; 403 u8 iv_len; 404 u8 icv_len; 405 u8 iv[18]; 406 u8 icv[16]; 407 u8 priority; 408 u8 ack_policy; 409 u8 mac_id; 410 u8 vcs_mode; /* virtual carrier sense method */ 411 u8 dst[ETH_ALEN]; 412 u8 src[ETH_ALEN]; 413 u8 ta[ETH_ALEN]; 414 u8 ra[ETH_ALEN]; 415 #ifdef CONFIG_RTW_WDS 416 u8 wds; 417 #endif 418 #ifdef CONFIG_RTW_MESH 419 u8 mda[ETH_ALEN]; /* mesh da */ 420 u8 msa[ETH_ALEN]; /* mesh sa */ 421 u8 meshctrl_len; /* Length of Mesh Control field */ 422 u8 mesh_frame_mode; 423 #if CONFIG_RTW_MESH_DATA_BMC_TO_UC 424 u8 mb2u; 425 #endif 426 u8 mfwd_ttl; 427 u32 mseq; 428 #endif 429 #ifdef CONFIG_TCP_CSUM_OFFLOAD_TX 430 u8 hw_csum; 431 #endif 432 u8 key_idx; 433 u8 qos_en; 434 u8 ht_en; 435 u8 raid;/* rate adpative id */ 436 u8 bwmode; 437 u8 ch_offset;/* PRIME_CHNL_OFFSET */ 438 u8 sgi;/* short GI */ 439 u8 ampdu_en;/* tx ampdu enable */ 440 u8 ampdu_spacing; /* ampdu_min_spacing for peer sta's rx */ 441 u8 amsdu; 442 u8 amsdu_ampdu_en;/* tx amsdu in ampdu enable */ 443 u8 mdata;/* more data bit */ 444 u8 pctrl;/* per packet txdesc control enable */ 445 u8 triggered;/* for ap mode handling Power Saving sta */ 446 u8 qsel; 447 u8 order;/* order bit */ 448 u8 eosp; 449 u8 rate; 450 u8 intel_proxim; 451 u8 retry_ctrl; 452 u8 mbssid; 453 u8 ldpc; 454 u8 stbc; 455 #ifdef CONFIG_WMMPS_STA 456 u8 trigger_frame; 457 #endif /* CONFIG_WMMPS_STA */ 458 459 struct sta_info *psta; 460 461 u8 rtsen; 462 u8 cts2self; 463 union Keytype dot11tkiptxmickey; 464 /* union Keytype dot11tkiprxmickey; */ 465 union Keytype dot118021x_UncstKey; 466 467 #ifdef CONFIG_TDLS 468 u8 direct_link; 469 struct sta_info *ptdls_sta; 470 #endif /* CONFIG_TDLS */ 471 u8 key_type; 472 473 u8 icmp_pkt; 474 u8 hipriority_pkt; /* high priority packet */ 475 476 #ifdef CONFIG_BEAMFORMING 477 u16 txbf_p_aid;/*beamforming Partial_AID*/ 478 u16 txbf_g_id;/*beamforming Group ID*/ 479 480 /* 481 * 2'b00: Unicast NDPA 482 * 2'b01: Broadcast NDPA 483 * 2'b10: Beamforming Report Poll 484 * 2'b11: Final Beamforming Report Poll 485 */ 486 u8 bf_pkt_type; 487 #endif 488 489 #ifdef CONFIG_RTW_MGMT_QUEUE 490 u8 ps_dontq; /* 1: this frame can't be queued at PS state */ 491 #endif 492 }; 493 494 #ifdef CONFIG_RTW_WDS 495 #define XATTRIB_GET_WDS(xattrib) ((xattrib)->wds) 496 #else 497 #define XATTRIB_GET_WDS(xattrib) 0 498 #endif 499 500 #ifdef CONFIG_RTW_MESH 501 #define XATTRIB_GET_MCTRL_LEN(xattrib) ((xattrib)->meshctrl_len) 502 #else 503 #define XATTRIB_GET_MCTRL_LEN(xattrib) 0 504 #endif 505 506 #ifdef CONFIG_TX_AMSDU 507 enum { 508 RTW_AMSDU_TIMER_UNSET = 0, 509 RTW_AMSDU_TIMER_SETTING, 510 RTW_AMSDU_TIMER_TIMEOUT, 511 }; 512 #endif 513 514 #define WLANHDR_OFFSET 64 515 516 #define NULL_FRAMETAG (0x0) 517 #define DATA_FRAMETAG 0x01 518 #define L2_FRAMETAG 0x02 519 #define MGNT_FRAMETAG 0x03 520 #define AMSDU_FRAMETAG 0x04 521 522 #define EII_FRAMETAG 0x05 523 #define IEEE8023_FRAMETAG 0x06 524 525 #define MP_FRAMETAG 0x07 526 527 #define TXAGG_FRAMETAG 0x08 528 529 enum { 530 XMITBUF_DATA = 0, 531 XMITBUF_MGNT = 1, 532 XMITBUF_CMD = 2, 533 }; 534 535 bool rtw_xmit_ac_blocked(_adapter *adapter); 536 537 struct submit_ctx { 538 systime submit_time; /* */ 539 u32 timeout_ms; /* <0: not synchronous, 0: wait forever, >0: up to ms waiting */ 540 int status; /* status for operation */ 541 #ifdef PLATFORM_LINUX 542 struct completion done; 543 #endif 544 }; 545 546 enum { 547 RTW_SCTX_SUBMITTED = -1, 548 RTW_SCTX_DONE_SUCCESS = 0, 549 RTW_SCTX_DONE_UNKNOWN, 550 RTW_SCTX_DONE_TIMEOUT, 551 RTW_SCTX_DONE_BUF_ALLOC, 552 RTW_SCTX_DONE_BUF_FREE, 553 RTW_SCTX_DONE_WRITE_PORT_ERR, 554 RTW_SCTX_DONE_TX_DESC_NA, 555 RTW_SCTX_DONE_TX_DENY, 556 RTW_SCTX_DONE_CCX_PKT_FAIL, 557 RTW_SCTX_DONE_DRV_STOP, 558 RTW_SCTX_DONE_DEV_REMOVE, 559 RTW_SCTX_DONE_CMD_ERROR, 560 RTW_SCTX_DONE_CMD_DROP, 561 RTX_SCTX_CSTR_WAIT_RPT2, 562 }; 563 564 565 void rtw_sctx_init(struct submit_ctx *sctx, int timeout_ms); 566 int rtw_sctx_wait(struct submit_ctx *sctx, const char *msg); 567 void rtw_sctx_done_err(struct submit_ctx **sctx, int status); 568 void rtw_sctx_done(struct submit_ctx **sctx); 569 570 struct xmit_buf { 571 _list list; 572 573 _adapter *padapter; 574 575 u8 *pallocated_buf; 576 577 u8 *pbuf; 578 579 void *priv_data; 580 581 u16 buf_tag; /* 0: Normal xmitbuf, 1: extension xmitbuf, 2:cmd xmitbuf */ 582 u16 flags; 583 u32 alloc_sz; 584 585 u32 len; 586 587 struct submit_ctx *sctx; 588 589 #ifdef CONFIG_USB_HCI 590 591 /* u32 sz[8]; */ 592 u32 ff_hwaddr; 593 #ifdef RTW_HALMAC 594 u8 bulkout_id; /* for halmac */ 595 #endif /* RTW_HALMAC */ 596 597 PURB pxmit_urb[8]; 598 dma_addr_t dma_transfer_addr; /* (in) dma addr for transfer_buffer */ 599 600 u8 bpending[8]; 601 602 sint last[8]; 603 604 #endif 605 606 #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) 607 u8 *phead; 608 u8 *pdata; 609 u8 *ptail; 610 u8 *pend; 611 u32 ff_hwaddr; 612 u8 pg_num; 613 u8 agg_num; 614 #endif 615 616 #ifdef CONFIG_PCI_HCI 617 #ifdef CONFIG_TRX_BD_ARCH 618 /*struct tx_buf_desc *buf_desc;*/ 619 #else 620 struct tx_desc *desc; 621 #endif 622 #endif 623 624 #if defined(DBG_XMIT_BUF) || defined(DBG_XMIT_BUF_EXT) 625 u8 no; 626 #endif 627 628 }; 629 630 631 struct xmit_frame { 632 _list list; 633 634 struct pkt_attrib attrib; 635 636 u16 os_qid; 637 _pkt *pkt; 638 639 int frame_tag; 640 641 _adapter *padapter; 642 643 u8 *buf_addr; 644 645 struct xmit_buf *pxmitbuf; 646 647 #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) 648 u8 pg_num; 649 u8 agg_num; 650 #endif 651 652 #ifdef CONFIG_USB_HCI 653 #ifdef CONFIG_USB_TX_AGGREGATION 654 u8 agg_num; 655 #endif 656 s8 pkt_offset; 657 #endif 658 659 #ifdef CONFIG_XMIT_ACK 660 u8 ack_report; 661 #endif 662 663 u8 *alloc_addr; /* the actual address this xmitframe allocated */ 664 u8 ext_tag; /* 0:data, 1:mgmt */ 665 666 }; 667 668 struct tx_servq { 669 _list tx_pending; 670 _queue sta_pending; 671 int qcnt; 672 }; 673 674 675 struct sta_xmit_priv { 676 _lock lock; 677 sint option; 678 sint apsd_setting; /* When bit mask is on, the associated edca queue supports APSD. */ 679 680 681 /* struct tx_servq blk_q[MAX_NUMBLKS]; */ 682 struct tx_servq be_q; /* priority == 0,3 */ 683 struct tx_servq bk_q; /* priority == 1,2 */ 684 struct tx_servq vi_q; /* priority == 4,5 */ 685 struct tx_servq vo_q; /* priority == 6,7 */ 686 #ifdef CONFIG_RTW_MGMT_QUEUE 687 struct tx_servq mgmt_q; 688 #endif 689 690 _list legacy_dz; 691 _list apsd; 692 693 u16 txseq_tid[16]; 694 695 /* uint sta_tx_bytes; */ 696 /* u64 sta_tx_pkts; */ 697 /* uint sta_tx_fail; */ 698 699 700 }; 701 702 703 struct hw_txqueue { 704 volatile sint head; 705 volatile sint tail; 706 volatile sint free_sz; /* in units of 64 bytes */ 707 volatile sint free_cmdsz; 708 volatile sint txsz[8]; 709 uint ff_hwaddr; 710 uint cmd_hwaddr; 711 sint ac_tag; 712 }; 713 714 struct agg_pkt_info { 715 u16 offset; 716 u16 pkt_len; 717 }; 718 719 enum cmdbuf_type { 720 CMDBUF_BEACON = 0x00, 721 CMDBUF_RSVD, 722 CMDBUF_MAX 723 }; 724 725 u8 rtw_get_hwseq_no(_adapter *padapter); 726 727 struct xmit_priv { 728 729 _lock lock; 730 731 _sema xmit_sema; 732 733 /* _queue blk_strms[MAX_NUMBLKS]; */ 734 _queue be_pending; 735 _queue bk_pending; 736 _queue vi_pending; 737 _queue vo_pending; 738 _queue mgmt_pending; 739 740 /* _queue legacy_dz_queue; */ 741 /* _queue apsd_queue; */ 742 743 u8 *pallocated_frame_buf; 744 u8 *pxmit_frame_buf; 745 uint free_xmitframe_cnt; 746 _queue free_xmit_queue; 747 748 /* uint mapping_addr; */ 749 /* uint pkt_sz; */ 750 751 u8 *xframe_ext_alloc_addr; 752 u8 *xframe_ext; 753 uint free_xframe_ext_cnt; 754 _queue free_xframe_ext_queue; 755 756 /* struct hw_txqueue be_txqueue; */ 757 /* struct hw_txqueue bk_txqueue; */ 758 /* struct hw_txqueue vi_txqueue; */ 759 /* struct hw_txqueue vo_txqueue; */ 760 /* struct hw_txqueue bmc_txqueue; */ 761 762 uint frag_len; 763 764 _adapter *adapter; 765 766 u8 vcs_setting; 767 u8 vcs; 768 u8 vcs_type; 769 /* u16 rts_thresh; */ 770 771 u64 tx_bytes; 772 u64 tx_pkts; 773 u64 tx_drop; 774 u64 last_tx_pkts; 775 776 struct hw_xmit *hwxmits; 777 u8 hwxmit_entry; 778 779 u8 wmm_para_seq[4];/* sequence for wmm ac parameter strength from large to small. it's value is 0->vo, 1->vi, 2->be, 3->bk. */ 780 781 #ifdef CONFIG_USB_HCI 782 _sema tx_retevt;/* all tx return event; */ 783 u8 txirp_cnt; 784 785 _tasklet xmit_tasklet; 786 787 /* per AC pending irp */ 788 int beq_cnt; 789 int bkq_cnt; 790 int viq_cnt; 791 int voq_cnt; 792 793 #endif 794 795 #ifdef CONFIG_PCI_HCI 796 /* Tx */ 797 struct rtw_tx_ring tx_ring[PCI_MAX_TX_QUEUE_COUNT]; 798 int txringcount[PCI_MAX_TX_QUEUE_COUNT]; 799 u8 beaconDMAing; /* flag of indicating beacon is transmiting to HW by DMA */ 800 _tasklet xmit_tasklet; 801 #endif 802 803 #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) 804 #ifdef CONFIG_SDIO_TX_TASKLET 805 _tasklet xmit_tasklet; 806 #else 807 _thread_hdl_ SdioXmitThread; 808 _sema SdioXmitSema; 809 #ifdef SDIO_FREE_XMIT_BUF_SEMA 810 _sema sdio_free_xmitbuf_sema; 811 #endif 812 #endif /* CONFIG_SDIO_TX_TASKLET */ 813 #endif /* CONFIG_SDIO_HCI */ 814 815 _queue free_xmitbuf_queue; 816 _queue pending_xmitbuf_queue; 817 u8 *pallocated_xmitbuf; 818 u8 *pxmitbuf; 819 uint free_xmitbuf_cnt; 820 821 _queue free_xmit_extbuf_queue; 822 u8 *pallocated_xmit_extbuf; 823 u8 *pxmit_extbuf; 824 uint free_xmit_extbuf_cnt; 825 826 struct xmit_buf pcmd_xmitbuf[CMDBUF_MAX]; 827 u8 hw_ssn_seq_no;/* mapping to REG_HW_SEQ 0,1,2,3 */ 828 u16 nqos_ssn; 829 #ifdef CONFIG_TX_EARLY_MODE 830 831 #ifdef CONFIG_SDIO_HCI 832 #define MAX_AGG_PKT_NUM 20 833 #else 834 #define MAX_AGG_PKT_NUM 256 /* Max tx ampdu coounts */ 835 #endif 836 837 struct agg_pkt_info agg_pkt[MAX_AGG_PKT_NUM]; 838 #endif 839 840 #ifdef CONFIG_XMIT_ACK 841 int ack_tx; 842 _mutex ack_tx_mutex; 843 struct submit_ctx ack_tx_ops; 844 u8 seq_no; 845 #ifdef CONFIG_REMOVE_DUP_TX_STATE 846 u8 retry_count; 847 #endif 848 #endif 849 850 #ifdef CONFIG_TX_AMSDU 851 _timer amsdu_vo_timer; 852 u8 amsdu_vo_timeout; 853 854 _timer amsdu_vi_timer; 855 u8 amsdu_vi_timeout; 856 857 _timer amsdu_be_timer; 858 u8 amsdu_be_timeout; 859 860 _timer amsdu_bk_timer; 861 u8 amsdu_bk_timeout; 862 863 u32 amsdu_debug_set_timer; 864 u32 amsdu_debug_timeout; 865 u32 amsdu_debug_coalesce_one; 866 u32 amsdu_debug_coalesce_two; 867 868 #endif 869 #ifdef DBG_TXBD_DESC_DUMP 870 BOOLEAN dump_txbd_desc; 871 #endif 872 #ifdef CONFIG_PCI_TX_POLLING 873 _timer tx_poll_timer; 874 #endif 875 #ifdef CONFIG_LAYER2_ROAMING 876 _queue rpkt_queue; 877 #endif 878 _lock lock_sctx; 879 880 }; 881 882 extern struct xmit_frame *__rtw_alloc_cmdxmitframe(struct xmit_priv *pxmitpriv, 883 enum cmdbuf_type buf_type); 884 #define rtw_alloc_cmdxmitframe(p) __rtw_alloc_cmdxmitframe(p, CMDBUF_RSVD) 885 #if defined(CONFIG_RTL8192E) && defined(CONFIG_PCI_HCI) 886 extern struct xmit_frame *__rtw_alloc_cmdxmitframe_8192ee(struct xmit_priv *pxmitpriv, 887 enum cmdbuf_type buf_type); 888 #define rtw_alloc_bcnxmitframe(p) __rtw_alloc_cmdxmitframe_8192ee(p, CMDBUF_BEACON) 889 #elif defined(CONFIG_RTL8822B) && defined(CONFIG_PCI_HCI) 890 extern struct xmit_frame *__rtw_alloc_cmdxmitframe_8822be(struct xmit_priv *pxmitpriv, 891 enum cmdbuf_type buf_type); 892 #define rtw_alloc_bcnxmitframe(p) __rtw_alloc_cmdxmitframe_8822be(p, CMDBUF_BEACON) 893 #elif defined(CONFIG_RTL8822C) && defined(CONFIG_PCI_HCI) 894 extern struct xmit_frame *__rtw_alloc_cmdxmitframe_8822ce(struct xmit_priv *pxmitpriv, 895 enum cmdbuf_type buf_type); 896 #define rtw_alloc_bcnxmitframe(p) __rtw_alloc_cmdxmitframe_8822ce(p, CMDBUF_BEACON) 897 #elif defined(CONFIG_RTL8821C) && defined(CONFIG_PCI_HCI) 898 extern struct xmit_frame *__rtw_alloc_cmdxmitframe_8821ce(struct xmit_priv *pxmitpriv, 899 enum cmdbuf_type buf_type); 900 #define rtw_alloc_bcnxmitframe(p) __rtw_alloc_cmdxmitframe_8821ce(p, CMDBUF_BEACON) 901 #elif defined(CONFIG_RTL8192F) && defined(CONFIG_PCI_HCI) 902 extern struct xmit_frame *__rtw_alloc_cmdxmitframe_8192fe(struct xmit_priv *pxmitpriv, 903 enum cmdbuf_type buf_type); 904 #define rtw_alloc_bcnxmitframe(p) __rtw_alloc_cmdxmitframe_8192fe(p, CMDBUF_BEACON) 905 #elif defined(CONFIG_RTL8812A) && defined(CONFIG_PCI_HCI) 906 extern struct xmit_frame *__rtw_alloc_cmdxmitframe_8812ae(struct xmit_priv *pxmitpriv, 907 enum cmdbuf_type buf_type); 908 #define rtw_alloc_bcnxmitframe(p) __rtw_alloc_cmdxmitframe_8812ae(p, CMDBUF_BEACON) 909 #elif defined(CONFIG_RTL8723D) && defined(CONFIG_PCI_HCI) 910 extern struct xmit_frame *__rtw_alloc_cmdxmitframe_8723de(struct xmit_priv *pxmitpriv, 911 enum cmdbuf_type buf_type); 912 #define rtw_alloc_bcnxmitframe(p) __rtw_alloc_cmdxmitframe_8723de(p, CMDBUF_BEACON) 913 #elif defined(CONFIG_RTL8723B) && defined(CONFIG_PCI_HCI) 914 extern struct xmit_frame *__rtw_alloc_cmdxmitframe_8723be(struct xmit_priv *pxmitpriv, 915 enum cmdbuf_type buf_type); 916 #define rtw_alloc_bcnxmitframe(p) __rtw_alloc_cmdxmitframe_8723be(p, CMDBUF_BEACON) 917 #elif defined(CONFIG_RTL8814A) && defined(CONFIG_PCI_HCI) 918 extern struct xmit_frame *__rtw_alloc_cmdxmitframe_8814ae(struct xmit_priv *pxmitpriv, 919 enum cmdbuf_type buf_type); 920 #define rtw_alloc_bcnxmitframe(p) __rtw_alloc_cmdxmitframe_8814ae(p, CMDBUF_BEACON) 921 #elif defined(CONFIG_RTL8814B) && defined(CONFIG_PCI_HCI) 922 extern struct xmit_frame *__rtw_alloc_cmdxmitframe_8814be(struct xmit_priv *pxmitpriv, 923 enum cmdbuf_type buf_type); 924 #define rtw_alloc_bcnxmitframe(p) __rtw_alloc_cmdxmitframe_8814be(p, CMDBUF_BEACON) 925 #else 926 #define rtw_alloc_bcnxmitframe(p) __rtw_alloc_cmdxmitframe(p, CMDBUF_BEACON) 927 #endif 928 929 extern struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv); 930 extern s32 rtw_free_xmitbuf_ext(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf); 931 932 extern struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv); 933 extern s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf); 934 935 void rtw_count_tx_stats(_adapter *padapter, struct xmit_frame *pxmitframe, int sz); 936 extern void rtw_update_protection(_adapter *padapter, u8 *ie, uint ie_len); 937 938 extern s32 rtw_make_wlanhdr(_adapter *padapter, u8 *hdr, struct pkt_attrib *pattrib); 939 extern s32 rtw_put_snap(u8 *data, u16 h_proto); 940 941 extern struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv, u16 os_qid); 942 struct xmit_frame *rtw_alloc_xmitframe_ext(struct xmit_priv *pxmitpriv); 943 struct xmit_frame *rtw_alloc_xmitframe_once(struct xmit_priv *pxmitpriv); 944 extern s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitframe); 945 extern void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, _queue *pframequeue); 946 struct tx_servq *rtw_get_sta_pending(_adapter *padapter, struct sta_info *psta, sint up, u8 *ac); 947 extern s32 rtw_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe); 948 949 #ifdef CONFIG_RTW_MGMT_QUEUE 950 void rtw_free_mgmt_xmitframe_queue(struct xmit_priv *pxmitpriv, _queue *mgmt_queue); 951 u8 rtw_mgmt_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe); 952 struct xmit_frame *rtw_dequeue_mgmt_xframe(struct xmit_priv *pxmitpriv); 953 #endif /* CONFIG_RTW_MGMT_QUEUE */ 954 955 extern struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i, sint entry); 956 957 extern s32 rtw_xmit_classifier(_adapter *padapter, struct xmit_frame *pxmitframe); 958 extern u32 rtw_calculate_wlan_pkt_size_by_attribue(struct pkt_attrib *pattrib); 959 #define rtw_wlan_pkt_size(f) rtw_calculate_wlan_pkt_size_by_attribue(&f->attrib) 960 extern s32 rtw_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxmitframe); 961 #if defined(CONFIG_IEEE80211W) || defined(CONFIG_RTW_MESH) 962 extern s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxmitframe); 963 #endif 964 #ifdef CONFIG_TDLS 965 extern struct tdls_txmgmt *ptxmgmt; 966 s32 rtw_xmit_tdls_coalesce(_adapter *padapter, struct xmit_frame *pxmitframe, struct tdls_txmgmt *ptxmgmt); 967 s32 update_tdls_attrib(_adapter *padapter, struct pkt_attrib *pattrib); 968 #endif 969 s32 _rtw_init_hw_txqueue(struct hw_txqueue *phw_txqueue, u8 ac_tag); 970 void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv); 971 972 973 s32 rtw_txframes_pending(_adapter *padapter); 974 s32 rtw_txframes_sta_ac_pending(_adapter *padapter, struct pkt_attrib *pattrib); 975 void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry); 976 977 978 s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter); 979 void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv); 980 981 982 void rtw_alloc_hwxmits(_adapter *padapter); 983 void rtw_free_hwxmits(_adapter *padapter); 984 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)) 985 s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev); 986 #endif 987 void rtw_xmit_dequeue_callback(_workitem *work); 988 void rtw_xmit_queue_set(struct sta_info *sta); 989 void rtw_xmit_queue_clear(struct sta_info *sta); 990 s32 rtw_xmit_posthandle(_adapter *padapter, struct xmit_frame *pxmitframe, _pkt *pkt); 991 s32 rtw_xmit(_adapter *padapter, _pkt **pkt, u16 os_qid); 992 bool xmitframe_hiq_filter(struct xmit_frame *xmitframe); 993 #if defined(CONFIG_AP_MODE) || defined(CONFIG_TDLS) 994 #ifdef CONFIG_RTW_MGMT_QUEUE 995 u8 mgmt_xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *pxmitframe); 996 #endif 997 sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *pxmitframe); 998 void stop_sta_xmit(_adapter *padapter, struct sta_info *psta); 999 void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta, u8 dequeue_type); 1000 void xmit_delivery_enabled_frames(_adapter *padapter, struct sta_info *psta); 1001 #endif 1002 1003 u8 rtw_get_tx_bw_mode(_adapter *adapter, struct sta_info *sta); 1004 1005 void rtw_update_tx_rate_bmp(struct dvobj_priv *dvobj); 1006 u8 rtw_get_tx_bw_bmp_of_ht_rate(struct dvobj_priv *dvobj, u8 rate, u8 max_bw); 1007 u8 rtw_get_tx_bw_bmp_of_vht_rate(struct dvobj_priv *dvobj, u8 rate, u8 max_bw); 1008 s16 rtw_adapter_get_oper_txpwr_max_mbm(_adapter *adapter, bool eirp); 1009 s16 rtw_rfctl_get_oper_txpwr_max_mbm(struct rf_ctl_t *rfctl, u8 ch, u8 bw, u8 offset, u8 ifbmp_mod, u8 if_op, bool eirp); 1010 s16 rtw_get_oper_txpwr_max_mbm(struct dvobj_priv *dvobj, bool erip); 1011 s16 rtw_rfctl_get_reg_max_txpwr_mbm(struct rf_ctl_t *rfctl, u8 ch, u8 bw, u8 offset, bool eirp); 1012 1013 u8 query_ra_short_GI(struct sta_info *psta, u8 bw); 1014 1015 u8 qos_acm(u8 acm_mask, u8 priority); 1016 1017 #ifdef CONFIG_XMIT_THREAD_MODE 1018 void enqueue_pending_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf); 1019 void enqueue_pending_xmitbuf_to_head(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf); 1020 struct xmit_buf *dequeue_pending_xmitbuf(struct xmit_priv *pxmitpriv); 1021 struct xmit_buf *select_and_dequeue_pending_xmitbuf(_adapter *padapter); 1022 sint check_pending_xmitbuf(struct xmit_priv *pxmitpriv); 1023 thread_return rtw_xmit_thread(thread_context context); 1024 #endif 1025 1026 #ifdef CONFIG_TX_AMSDU 1027 extern void rtw_amsdu_vo_timeout_handler(void *FunctionContext); 1028 extern void rtw_amsdu_vi_timeout_handler(void *FunctionContext); 1029 extern void rtw_amsdu_be_timeout_handler(void *FunctionContext); 1030 extern void rtw_amsdu_bk_timeout_handler(void *FunctionContext); 1031 1032 extern u8 rtw_amsdu_get_timer_status(_adapter *padapter, u8 priority); 1033 extern void rtw_amsdu_set_timer_status(_adapter *padapter, u8 priority, u8 status); 1034 extern void rtw_amsdu_set_timer(_adapter *padapter, u8 priority); 1035 extern void rtw_amsdu_cancel_timer(_adapter *padapter, u8 priority); 1036 1037 extern s32 rtw_xmitframe_coalesce_amsdu(_adapter *padapter, struct xmit_frame *pxmitframe, struct xmit_frame *pxmitframe_queue); 1038 extern s32 check_amsdu(struct xmit_frame *pxmitframe); 1039 extern s32 check_amsdu_tx_support(_adapter *padapter); 1040 extern struct xmit_frame *rtw_get_xframe(struct xmit_priv *pxmitpriv, int *num_frame); 1041 #endif 1042 1043 #ifdef DBG_TXBD_DESC_DUMP 1044 void rtw_tx_desc_backup(_adapter *padapter, struct xmit_frame *pxmitframe, u8 desc_size, u8 hwq); 1045 void rtw_tx_desc_backup_reset(void); 1046 u8 rtw_get_tx_desc_backup(_adapter *padapter, u8 hwq, struct rtw_tx_desc_backup **pbak); 1047 #endif 1048 1049 #ifdef CONFIG_PCI_TX_POLLING 1050 void rtw_tx_poll_init(_adapter *padapter); 1051 void rtw_tx_poll_timeout_handler(void *FunctionContext); 1052 void rtw_tx_poll_timer_set(_adapter *padapter, u32 delay); 1053 void rtw_tx_poll_timer_cancel(_adapter *padapter); 1054 #endif 1055 1056 u32 rtw_get_ff_hwaddr(struct xmit_frame *pxmitframe); 1057 1058 #ifdef CONFIG_XMIT_ACK 1059 int rtw_ack_tx_wait(struct xmit_priv *pxmitpriv, u32 timeout_ms); 1060 void rtw_ack_tx_done(struct xmit_priv *pxmitpriv, int status); 1061 #endif /* CONFIG_XMIT_ACK */ 1062 1063 enum XMIT_BLOCK_REASON { 1064 XMIT_BLOCK_NONE = 0, 1065 XMIT_BLOCK_REDLMEM = BIT0, /*LPS-PG*/ 1066 XMIT_BLOCK_SUSPEND = BIT1, /*WOW*/ 1067 XMIT_BLOCK_MAX = 0xFF, 1068 }; 1069 void rtw_init_xmit_block(_adapter *padapter); 1070 void rtw_deinit_xmit_block(_adapter *padapter); 1071 1072 #ifdef DBG_XMIT_BLOCK 1073 void dump_xmit_block(void *sel, _adapter *padapter); 1074 #endif 1075 void rtw_set_xmit_block(_adapter *padapter, enum XMIT_BLOCK_REASON reason); 1076 void rtw_clr_xmit_block(_adapter *padapter, enum XMIT_BLOCK_REASON reason); 1077 bool rtw_is_xmit_blocked(_adapter *padapter); 1078 void rtw_hci_flush(_adapter *padapter); 1079 1080 /* include after declaring struct xmit_buf, in order to avoid warning */ 1081 #include <xmit_osdep.h> 1082 1083 #endif /* _RTL871X_XMIT_H_ */ 1084