OSDN Git Service

rtl8723au: Remove trailing white space in header files
[android-x86/external-modules-rtl8723au.git] / include / rtw_xmit.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2011 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  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17  *
18  *
19  ******************************************************************************/
20 #ifndef _RTW_XMIT_H_
21 #define _RTW_XMIT_H_
22
23 #include <drv_conf.h>
24 #include <osdep_service.h>
25 #include <drv_types.h>
26 #ifdef PLATFORM_FREEBSD
27 #include <if_ether.h>
28 #endif //PLATFORM_FREEBSD
29
30 #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
31 //#define MAX_XMITBUF_SZ (30720)//      (2048)
32 #ifdef CONFIG_TX_AGGREGATION
33 #define MAX_XMITBUF_SZ  (20480) // 20k
34 #else
35 #define MAX_XMITBUF_SZ (12288)  //12k 1536*8
36 #endif
37
38 #if defined CONFIG_SDIO_HCI
39 #define NR_XMITBUFF     (16)
40 #endif
41 #if defined(CONFIG_GSPI_HCI)
42 #define NR_XMITBUFF     (128)
43 #endif
44
45 #elif defined (CONFIG_USB_HCI)
46
47 #ifdef CONFIG_USB_TX_AGGREGATION
48 #ifdef CONFIG_PLATFORM_ARM_SUNxI
49 #define MAX_XMITBUF_SZ (12288)  //12k 1536*8
50         #elif defined (CONFIG_PLATFORM_MSTAR_TITANIA12)
51                 #define MAX_XMITBUF_SZ  7680    // 7.5k
52 #else
53 #define MAX_XMITBUF_SZ  (20480) // 20k
54 #endif
55 #else
56 #define MAX_XMITBUF_SZ  (2048)
57 #endif
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 #define MAX_XMITBUF_SZ  (1664)
65 #define NR_XMITBUFF     (128)
66 #endif
67
68 #ifdef PLATFORM_OS_CE
69 #define XMITBUF_ALIGN_SZ 4
70 #else
71 #ifdef CONFIG_PCI_HCI
72 #define XMITBUF_ALIGN_SZ 4
73 #else
74 #define XMITBUF_ALIGN_SZ 512
75 #endif
76 #endif
77
78 // xmit extension buff defination
79 #define MAX_XMIT_EXTBUF_SZ      (1536)
80 #define NR_XMIT_EXTBUFF (32)
81
82 #define MAX_NUMBLKS             (1)
83
84 #define XMIT_VO_QUEUE (0)
85 #define XMIT_VI_QUEUE (1)
86 #define XMIT_BE_QUEUE (2)
87 #define XMIT_BK_QUEUE (3)
88
89 #define VO_QUEUE_INX            0
90 #define VI_QUEUE_INX            1
91 #define BE_QUEUE_INX            2
92 #define BK_QUEUE_INX            3
93 #define BCN_QUEUE_INX           4
94 #define MGT_QUEUE_INX           5
95 #define HIGH_QUEUE_INX          6
96 #define TXCMD_QUEUE_INX 7
97
98 #define HW_QUEUE_ENTRY  8
99
100 #ifdef CONFIG_PCI_HCI
101 //#define TXDESC_NUM                                            64
102 #define TXDESC_NUM                                              128
103 #define TXDESC_NUM_BE_QUEUE                     128
104 #endif
105
106 #define WEP_IV(pattrib_iv, dot11txpn, keyidx)\
107 do{\
108         pattrib_iv[0] = dot11txpn._byte_.TSC0;\
109         pattrib_iv[1] = dot11txpn._byte_.TSC1;\
110         pattrib_iv[2] = dot11txpn._byte_.TSC2;\
111         pattrib_iv[3] = ((keyidx & 0x3)<<6);\
112         dot11txpn.val = (dot11txpn.val == 0xffffff) ? 0: (dot11txpn.val+1);\
113 }while(0)
114
115
116 #define TKIP_IV(pattrib_iv, dot11txpn, keyidx)\
117 do{\
118         pattrib_iv[0] = dot11txpn._byte_.TSC1;\
119         pattrib_iv[1] = (dot11txpn._byte_.TSC1 | 0x20) & 0x7f;\
120         pattrib_iv[2] = dot11txpn._byte_.TSC0;\
121         pattrib_iv[3] = BIT(5) | ((keyidx & 0x3)<<6);\
122         pattrib_iv[4] = dot11txpn._byte_.TSC2;\
123         pattrib_iv[5] = dot11txpn._byte_.TSC3;\
124         pattrib_iv[6] = dot11txpn._byte_.TSC4;\
125         pattrib_iv[7] = dot11txpn._byte_.TSC5;\
126         dot11txpn.val = dot11txpn.val == 0xffffffffffffULL ? 0: (dot11txpn.val+1);\
127 }while(0)
128
129 #define AES_IV(pattrib_iv, dot11txpn, keyidx)\
130 do{\
131         pattrib_iv[0] = dot11txpn._byte_.TSC0;\
132         pattrib_iv[1] = dot11txpn._byte_.TSC1;\
133         pattrib_iv[2] = 0;\
134         pattrib_iv[3] = BIT(5) | ((keyidx & 0x3)<<6);\
135         pattrib_iv[4] = dot11txpn._byte_.TSC2;\
136         pattrib_iv[5] = dot11txpn._byte_.TSC3;\
137         pattrib_iv[6] = dot11txpn._byte_.TSC4;\
138         pattrib_iv[7] = dot11txpn._byte_.TSC5;\
139         dot11txpn.val = dot11txpn.val == 0xffffffffffffULL ? 0: (dot11txpn.val+1);\
140 }while(0)
141
142
143 #define HWXMIT_ENTRY    4
144
145
146 #define TXDESC_SIZE 32
147
148 #ifdef CONFIG_TX_EARLY_MODE
149 #define EARLY_MODE_INFO_SIZE    8
150 #endif
151
152
153 #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
154 #define TXDESC_OFFSET TXDESC_SIZE
155
156 #endif
157
158 #ifdef CONFIG_USB_HCI
159 #define PACKET_OFFSET_SZ (8)
160 #define TXDESC_OFFSET (TXDESC_SIZE + PACKET_OFFSET_SZ)
161 #endif
162
163 #ifdef CONFIG_PCI_HCI
164 #define TXDESC_OFFSET 0
165 #define TX_DESC_NEXT_DESC_OFFSET        40
166 #endif
167
168
169
170 struct tx_desc{
171
172         //DWORD 0
173         unsigned int txdw0;
174
175         unsigned int txdw1;
176
177         unsigned int txdw2;
178
179         unsigned int txdw3;
180
181         unsigned int txdw4;
182
183         unsigned int txdw5;
184
185         unsigned int txdw6;
186
187         unsigned int txdw7;
188 #ifdef CONFIG_PCI_HCI
189         unsigned int txdw8;
190
191         unsigned int txdw9;
192
193         unsigned int txdw10;
194
195         unsigned int txdw11;
196
197         // 2008/05/15 MH Because PCIE HW memory R/W 4K limit. And now,  our descriptor
198         // size is 40 bytes. If you use more than 102 descriptor( 103*40>4096), HW will execute
199         // memoryR/W CRC error. And then all DMA fetch will fail. We must decrease descriptor
200         // number or enlarge descriptor size as 64 bytes.
201         unsigned int txdw12;
202
203         unsigned int txdw13;
204
205         unsigned int txdw14;
206
207         unsigned int txdw15;
208 #endif
209 };
210
211
212 union txdesc {
213         struct tx_desc txdesc;
214         unsigned int value[TXDESC_SIZE>>2];
215 };
216
217 #ifdef CONFIG_PCI_HCI
218 #define PCI_MAX_TX_QUEUE_COUNT  8
219
220 struct rtw_tx_ring {
221         struct tx_desc  *desc;
222         dma_addr_t              dma;
223         unsigned int            idx;
224         unsigned int            entries;
225         _queue                  queue;
226         u32                             qlen;
227 };
228 #endif
229
230 struct  hw_xmit {
231         //_lock xmit_lock;
232         //_list pending;
233         _queue *sta_queue;
234         //struct hw_txqueue *phwtxqueue;
235         //sint  txcmdcnt;
236         int     accnt;
237 };
238
239 #if 0
240 struct pkt_attrib
241 {
242         u8      type;
243         u8      subtype;
244         u8      bswenc;
245         u8      dhcp_pkt;
246         u16     ether_type;
247         int     pktlen;         //the original 802.3 pkt raw_data len (not include ether_hdr data)
248         int     pkt_hdrlen;     //the original 802.3 pkt header len
249         int     hdrlen;         //the WLAN Header Len
250         int     nr_frags;
251         int     last_txcmdsz;
252         int     encrypt;        //when 0 indicate no encrypt. when non-zero, indicate the encrypt algorith
253         u8      iv[8];
254         int     iv_len;
255         u8      icv[8];
256         int     icv_len;
257         int     priority;
258         int     ack_policy;
259         int     mac_id;
260         int     vcs_mode;       //virtual carrier sense method
261
262         u8      dst[ETH_ALEN];
263         u8      src[ETH_ALEN];
264         u8      ta[ETH_ALEN];
265         u8      ra[ETH_ALEN];
266
267         u8      key_idx;
268
269         u8      qos_en;
270         u8      ht_en;
271         u8      raid;//rate adpative id
272         u8      bwmode;
273         u8      ch_offset;//PRIME_CHNL_OFFSET
274         u8      sgi;//short GI
275         u8      ampdu_en;//tx ampdu enable
276         u8      mdata;//more data bit
277         u8      eosp;
278
279         u8      pctrl;//per packet txdesc control enable
280         u8      triggered;//for ap mode handling Power Saving sta
281
282         u32     qsel;
283         u16     seqnum;
284
285         struct sta_info * psta;
286 #ifdef CONFIG_TCP_CSUM_OFFLOAD_TX
287         u8      hw_tcp_csum;
288 #endif
289 };
290 #else
291 //reduce size
292 struct pkt_attrib
293 {
294         u8      type;
295         u8      subtype;
296         u8      bswenc;
297         u8      dhcp_pkt;
298         u16     ether_type;
299         u16     seqnum;
300         u16     pkt_hdrlen;     //the original 802.3 pkt header len
301         u16     hdrlen;         //the WLAN Header Len
302         u32     pktlen;         //the original 802.3 pkt raw_data len (not include ether_hdr data)
303         u32     last_txcmdsz;
304         u8      nr_frags;
305         u8      encrypt;        //when 0 indicate no encrypt. when non-zero, indicate the encrypt algorith
306         u8      iv_len;
307         u8      icv_len;
308         u8      iv[18];
309         u8      icv[16];
310         u8      priority;
311         u8      ack_policy;
312         u8      mac_id;
313         u8      vcs_mode;       //virtual carrier sense method
314         u8      dst[ETH_ALEN];
315         u8      src[ETH_ALEN];
316         u8      ta[ETH_ALEN];
317         u8      ra[ETH_ALEN];
318         u8      key_idx;
319         u8      qos_en;
320         u8      ht_en;
321         u8      raid;//rate adpative id
322         u8      bwmode;
323         u8      ch_offset;//PRIME_CHNL_OFFSET
324         u8      sgi;//short GI
325         u8      ampdu_en;//tx ampdu enable
326         u8      mdata;//more data bit
327         u8      pctrl;//per packet txdesc control enable
328         u8      triggered;//for ap mode handling Power Saving sta
329         u8      qsel;
330         u8      eosp;
331         u8      rate;
332         u8      intel_proxim;
333         u8      retry_ctrl;
334         struct sta_info * psta;
335 #ifdef CONFIG_TCP_CSUM_OFFLOAD_TX
336         u8      hw_tcp_csum;
337 #endif
338 };
339 #endif
340
341 #ifdef PLATFORM_FREEBSD
342 #define ETH_ALEN        6               /* Octets in one ethernet addr   */
343 #define ETH_HLEN        14              /* Total octets in header.       */
344 #define ETH_P_IP        0x0800          /* Internet Protocol packet     */
345
346 /*struct rtw_ieee80211_hdr {
347         uint16_t frame_control;
348         uint16_t duration_id;
349         u8 addr1[6];
350         u8 addr2[6];
351         u8 addr3[6];
352         uint16_t seq_ctrl;
353         u8 addr4[6];
354 } ;*/
355 #endif //PLATFORM_FREEBSD
356
357 #define WLANHDR_OFFSET  64
358
359 #define NULL_FRAMETAG           (0x0)
360 #define DATA_FRAMETAG           0x01
361 #define L2_FRAMETAG             0x02
362 #define MGNT_FRAMETAG           0x03
363 #define AMSDU_FRAMETAG  0x04
364
365 #define EII_FRAMETAG            0x05
366 #define IEEE8023_FRAMETAG  0x06
367
368 #define MP_FRAMETAG             0x07
369
370 #define TXAGG_FRAMETAG  0x08
371
372 struct  submit_ctx{
373         u32 submit_time; /* */
374         u32 timeout_ms; /* <0: not synchronous, 0: wait forever, >0: up to ms waiting */
375         int status; /* status for operation */
376 #ifdef PLATFORM_LINUX
377         struct completion done;
378 #endif
379 };
380
381 enum {
382         RTW_SCTX_SUBMITTED = -1,
383         RTW_SCTX_DONE_SUCCESS = 0,
384         RTW_SCTX_DONE_UNKNOWN,
385         RTW_SCTX_DONE_TIMEOUT,
386         RTW_SCTX_DONE_BUF_ALLOC,
387         RTW_SCTX_DONE_BUF_FREE,
388         RTW_SCTX_DONE_WRITE_PORT_ERR,
389         RTW_SCTX_DONE_TX_DESC_NA,
390         RTW_SCTX_DONE_TX_DENY,
391         RTW_SCTX_DONE_CCX_PKT_FAIL,
392         RTW_SCTX_DONE_DRV_STOP,
393         RTW_SCTX_DONE_DEV_REMOVE,
394 };
395
396
397 void rtw_sctx_init(struct submit_ctx *sctx, int timeout_ms);
398 int rtw_sctx_wait(struct submit_ctx *sctx);
399 void rtw_sctx_done_err(struct submit_ctx **sctx, int status);
400 void rtw_sctx_done(struct submit_ctx **sctx);
401
402 struct xmit_buf
403 {
404         _list   list;
405
406         _adapter *padapter;
407
408         u8 *pallocated_buf;
409
410         u8 *pbuf;
411
412         void *priv_data;
413
414         u16 ext_tag; // 0: Normal xmitbuf, 1: extension xmitbuf.
415         u16 flags;
416         u32 alloc_sz;
417
418         u32  len;
419
420         struct submit_ctx *sctx;
421
422 #ifdef CONFIG_USB_HCI
423
424         //u32 sz[8];
425         u32     ff_hwaddr;
426
427 #if defined(PLATFORM_OS_XP)||defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD)
428         PURB    pxmit_urb[8];
429         dma_addr_t dma_transfer_addr;   /* (in) dma addr for transfer_buffer */
430 #endif
431
432 #ifdef PLATFORM_OS_XP
433         PIRP            pxmit_irp[8];
434 #endif
435
436 #ifdef PLATFORM_OS_CE
437         USB_TRANSFER    usb_transfer_write_port;
438 #endif
439
440         u8 bpending[8];
441
442         sint last[8];
443
444 #endif
445
446 #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
447         u8 *phead;
448         u8 *pdata;
449         u8 *ptail;
450         u8 *pend;
451         u32 ff_hwaddr;
452         u8      pg_num;
453         u8      agg_num;
454 #ifdef PLATFORM_OS_XP
455         PMDL pxmitbuf_mdl;
456         PIRP  pxmitbuf_irp;
457         PSDBUS_REQUEST_PACKET pxmitbuf_sdrp;
458 #endif
459 #endif
460
461 #if defined(DBG_XMIT_BUF )|| defined(DBG_XMIT_BUF_EXT)
462         u8 no;
463 #endif
464
465 };
466
467
468 struct xmit_frame
469 {
470         _list   list;
471
472         struct pkt_attrib attrib;
473
474         _pkt *pkt;
475
476         int     frame_tag;
477
478         _adapter *padapter;
479
480         u8      *buf_addr;
481
482         struct xmit_buf *pxmitbuf;
483
484 #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
485         u8      pg_num;
486         u8      agg_num;
487 #endif
488
489 #ifdef CONFIG_USB_HCI
490 #ifdef CONFIG_USB_TX_AGGREGATION
491         u8      agg_num;
492 #endif
493         s8      pkt_offset;
494 #ifdef CONFIG_RTL8192D
495         u8      EMPktNum;
496         u16     EMPktLen[5];//The max value by HW
497 #endif
498 #endif
499
500 #ifdef CONFIG_XMIT_ACK
501         u8 ack_report;
502 #endif
503
504         u8 *alloc_addr; /* the actual address this xmitframe allocated */
505         u8 ext_tag; /* 0:data, 1:mgmt */
506
507 };
508
509 struct tx_servq {
510         _list   tx_pending;
511         _queue  sta_pending;
512         int qcnt;
513 };
514
515
516 struct sta_xmit_priv
517 {
518         _lock   lock;
519         sint    option;
520         sint    apsd_setting;   //When bit mask is on, the associated edca queue supports APSD.
521
522
523         //struct tx_servq blk_q[MAX_NUMBLKS];
524         struct tx_servq be_q;                   //priority == 0,3
525         struct tx_servq bk_q;                   //priority == 1,2
526         struct tx_servq vi_q;                   //priority == 4,5
527         struct tx_servq vo_q;                   //priority == 6,7
528         _list   legacy_dz;
529         _list  apsd;
530
531         u16 txseq_tid[16];
532
533         //uint  sta_tx_bytes;
534         //u64   sta_tx_pkts;
535         //uint  sta_tx_fail;
536
537
538 };
539
540
541 struct  hw_txqueue      {
542         volatile sint   head;
543         volatile sint   tail;
544         volatile sint   free_sz;        //in units of 64 bytes
545         volatile sint      free_cmdsz;
546         volatile sint    txsz[8];
547         uint    ff_hwaddr;
548         uint    cmd_hwaddr;
549         sint    ac_tag;
550 };
551
552 struct agg_pkt_info{
553         u16 offset;
554         u16 pkt_len;
555 };
556
557 struct  xmit_priv       {
558
559         _lock   lock;
560
561         _sema   xmit_sema;
562         _sema   terminate_xmitthread_sema;
563
564         //_queue        blk_strms[MAX_NUMBLKS];
565         _queue  be_pending;
566         _queue  bk_pending;
567         _queue  vi_pending;
568         _queue  vo_pending;
569         _queue  bm_pending;
570
571         //_queue        legacy_dz_queue;
572         //_queue        apsd_queue;
573
574         u8 *pallocated_frame_buf;
575         u8 *pxmit_frame_buf;
576         uint free_xmitframe_cnt;
577         _queue  free_xmit_queue;
578
579         //uint mapping_addr;
580         //uint pkt_sz;
581
582         u8 *xframe_ext_alloc_addr;
583         u8 *xframe_ext;
584         uint free_xframe_ext_cnt;
585         _queue free_xframe_ext_queue;
586
587         //struct        hw_txqueue      be_txqueue;
588         //struct        hw_txqueue      bk_txqueue;
589         //struct        hw_txqueue      vi_txqueue;
590         //struct        hw_txqueue      vo_txqueue;
591         //struct        hw_txqueue      bmc_txqueue;
592
593         uint    frag_len;
594
595         _adapter        *adapter;
596
597         u8   vcs_setting;
598         u8      vcs;
599         u8      vcs_type;
600         //u16  rts_thresh;
601
602         u64     tx_bytes;
603         u64     tx_pkts;
604         u64     tx_drop;
605         u64     last_tx_bytes;
606         u64     last_tx_pkts;
607
608         struct hw_xmit *hwxmits;
609         u8      hwxmit_entry;
610
611         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.
612
613 #ifdef CONFIG_USB_HCI
614         _sema   tx_retevt;//all tx return event;
615         u8              txirp_cnt;//
616
617 #ifdef PLATFORM_OS_CE
618         USB_TRANSFER    usb_transfer_write_port;
619 //      USB_TRANSFER    usb_transfer_write_mem;
620 #endif
621 #ifdef PLATFORM_LINUX
622         struct tasklet_struct xmit_tasklet;
623 #endif
624 #ifdef PLATFORM_FREEBSD
625         struct task xmit_tasklet;
626 #endif
627         //per AC pending irp
628         int beq_cnt;
629         int bkq_cnt;
630         int viq_cnt;
631         int voq_cnt;
632
633 #endif
634
635 #ifdef CONFIG_PCI_HCI
636         // Tx
637         struct rtw_tx_ring      tx_ring[PCI_MAX_TX_QUEUE_COUNT];
638         int     txringcount[PCI_MAX_TX_QUEUE_COUNT];
639         u8      beaconDMAing;           //flag of indicating beacon is transmiting to HW by DMA
640 #ifdef PLATFORM_LINUX
641         struct tasklet_struct xmit_tasklet;
642 #endif
643 #endif
644
645 #ifdef CONFIG_SDIO_HCI
646 #ifdef CONFIG_SDIO_TX_TASKLET
647 #ifdef PLATFORM_LINUX
648         struct tasklet_struct xmit_tasklet;
649 #endif
650 #endif
651 #endif
652
653         _queue free_xmitbuf_queue;
654         _queue pending_xmitbuf_queue;
655         u8 *pallocated_xmitbuf;
656         u8 *pxmitbuf;
657         uint free_xmitbuf_cnt;
658
659         _queue free_xmit_extbuf_queue;
660         u8 *pallocated_xmit_extbuf;
661         u8 *pxmit_extbuf;
662         uint free_xmit_extbuf_cnt;
663
664         u16     nqos_ssn;
665         #ifdef CONFIG_TX_EARLY_MODE
666
667         #ifdef CONFIG_SDIO_HCI
668         #define MAX_AGG_PKT_NUM 20
669         #else
670         #define MAX_AGG_PKT_NUM 256 //Max tx ampdu coounts
671         #endif
672
673         struct agg_pkt_info agg_pkt[MAX_AGG_PKT_NUM];
674         #endif
675
676 #ifdef CONFIG_XMIT_ACK
677         int     ack_tx;
678         _mutex ack_tx_mutex;
679         struct submit_ctx ack_tx_ops;
680 #endif
681         _lock lock_sctx;
682 };
683
684 extern struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv);
685 extern s32 rtw_free_xmitbuf_ext(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf);
686
687 extern struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv);
688 extern s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf);
689
690 void rtw_count_tx_stats(_adapter *padapter, struct xmit_frame *pxmitframe, int sz);
691 extern void rtw_update_protection(_adapter *padapter, u8 *ie, uint ie_len);
692 extern s32 rtw_make_wlanhdr(_adapter *padapter, u8 *hdr, struct pkt_attrib *pattrib);
693 extern s32 rtw_put_snap(u8 *data, u16 h_proto);
694
695 extern struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv);
696 struct xmit_frame *rtw_alloc_xmitframe_ext(struct xmit_priv *pxmitpriv);
697 struct xmit_frame *rtw_alloc_xmitframe_once(struct xmit_priv *pxmitpriv);
698 extern s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitframe);
699 extern void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, _queue *pframequeue);
700 struct tx_servq *rtw_get_sta_pending(_adapter *padapter, struct sta_info *psta, sint up, u8 *ac);
701 extern s32 rtw_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe);
702 extern struct xmit_frame* rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i, sint entry);
703
704 extern s32 rtw_xmit_classifier(_adapter *padapter, struct xmit_frame *pxmitframe);
705 extern u32 rtw_calculate_wlan_pkt_size_by_attribue(struct pkt_attrib *pattrib);
706 #define rtw_wlan_pkt_size(f) rtw_calculate_wlan_pkt_size_by_attribue(&f->attrib)
707 extern s32 rtw_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxmitframe);
708 #ifdef CONFIG_TDLS
709 s32 rtw_xmit_tdls_coalesce(_adapter *padapter, struct xmit_frame *pxmitframe, u8 action);
710 #endif
711 s32 _rtw_init_hw_txqueue(struct hw_txqueue* phw_txqueue, u8 ac_tag);
712 void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv);
713
714
715 s32 rtw_txframes_pending(_adapter *padapter);
716 s32 rtw_txframes_sta_ac_pending(_adapter *padapter, struct pkt_attrib *pattrib);
717 void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry);
718
719
720 s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter);
721 void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv);
722
723
724 void rtw_alloc_hwxmits(_adapter *padapter);
725 void rtw_free_hwxmits(_adapter *padapter);
726
727
728 s32 rtw_xmit(_adapter *padapter, _pkt **pkt);
729
730 #if defined(CONFIG_AP_MODE) || defined(CONFIG_TDLS)
731 sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *pxmitframe);
732 void stop_sta_xmit(_adapter *padapter, struct sta_info *psta);
733 void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta);
734 void xmit_delivery_enabled_frames(_adapter *padapter, struct sta_info *psta);
735 #endif
736
737 u8      qos_acm(u8 acm_mask, u8 priority);
738
739 #ifdef CONFIG_XMIT_THREAD_MODE
740 void    enqueue_pending_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf);
741 struct xmit_buf*        dequeue_pending_xmitbuf(struct xmit_priv *pxmitpriv);
742 struct xmit_buf*        dequeue_pending_xmitbuf_under_survey(struct xmit_priv *pxmitpriv);
743 sint    check_pending_xmitbuf(struct xmit_priv *pxmitpriv);
744 thread_return   rtw_xmit_thread(thread_context context);
745 #endif
746
747 u32     rtw_get_ff_hwaddr(struct xmit_frame     *pxmitframe);
748
749 #ifdef CONFIG_XMIT_ACK
750 int rtw_ack_tx_wait(struct xmit_priv *pxmitpriv, u32 timeout_ms);
751 void rtw_ack_tx_done(struct xmit_priv *pxmitpriv, int status);
752 #endif //CONFIG_XMIT_ACK
753
754
755 //include after declaring struct xmit_buf, in order to avoid warning
756 #include <xmit_osdep.h>
757
758 #endif  //_RTL871X_XMIT_H_