29 #define _RTL871X_XMIT_C_
44 static void _init_txservq(
struct tx_servq *ptxservq)
53 memset((
unsigned char *)psta_xmitpriv, 0,
56 _init_txservq(&psta_xmitpriv->
be_q);
57 _init_txservq(&psta_xmitpriv->
bk_q);
58 _init_txservq(&psta_xmitpriv->
vi_q);
59 _init_txservq(&psta_xmitpriv->
vo_q);
60 _init_listhead(&psta_xmitpriv->
legacy_dz);
61 _init_listhead(&psta_xmitpriv->
apsd);
100 _init_listhead(&(pxframe->
list));
106 list_insert_tail(&(pxframe->
list),
137 _init_listhead(&pxmitbuf->
list);
146 list_insert_tail(&pxmitbuf->
list,
152 alloc_hwxmits(padapter);
156 (
unsigned long)padapter);
181 free_hwxmits(padapter);
213 _cancel_timer(&(pmlmepriv->
dhcp_timer), &
bool);
232 }
else if (check_fwstate(pmlmepriv,
WIFI_MP_STATE) ==
true) {
255 if (((tmp[21] == 68) && (tmp[23] == 67)) ||
256 ((tmp[21] == 67) && (tmp[23] == 68))) {
265 bmcast = IS_MCAST(pattrib->
ra);
273 get_bssid(pmlmepriv));
287 pattrib->
psta = psta;
358 sint bmcst = IS_MCAST(pattrib->
ra);
361 stainfo = pattrib->
psta;
367 if (stainfo !=
NULL) {
368 u8 null_key[16] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
369 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
381 XGrptxmickey[psecuritypriv->
411 priority[0] = (
u8)pxmitframe->
415 for (curfragnum = 0; curfragnum < pattrib->
nr_frags;
418 payload = payload+pattrib->
420 if ((curfragnum + 1) == pattrib->
nr_frags) {
436 payload = payload + length +
443 memcpy(payload, &(mic[0]), 8);
451 static sint xmitframe_swencrypt(
struct _adapter *padapter,
494 }
else if ((check_fwstate(pmlmepriv,
WIFI_AP_STATE) ==
true)) {
508 }
else if (check_fwstate(pmlmepriv,
WIFI_MP_STATE) ==
true) {
519 qc = (
unsigned short *)(hdr + pattrib->
hdrlen - 2);
529 sint bmcst = IS_MCAST(pattrib->
ra);
531 psta = pattrib->
psta;
563 if (h_proto == 0x8137 || h_proto == 0x80f3)
567 snap->
oui[0] = oui[0];
568 snap->
oui[1] = oui[1];
569 snap->
oui[2] = oui[2];
588 sint frg_len, mpdu_len, llc_sz;
599 sint bmcst = IS_MCAST(pattrib->
ra);
603 psta = pattrib->
psta;
607 ptxdesc = pbuf_start;
609 if (make_wlanhdr(padapter, mem_start, pattrib) ==
_FAIL)
628 pframe += pattrib->
hdrlen;
629 mpdu_len -= pattrib->
hdrlen;
662 pframe += pattrib->
iv_len;
663 mpdu_len -= pattrib->
iv_len;
666 llc_sz = r8712_put_snap(pframe, pattrib->
ether_type);
691 pattrib->
icv_len : 0) + mem_sz;
697 memcpy(mem_start, pbuf_start + TXDESC_OFFSET, pattrib->
hdrlen);
700 if (xmitframe_addmic(padapter, pxmitframe) ==
_FAIL)
702 xmitframe_swencrypt(padapter, pxmitframe);
726 protection = (*(perp + 2)) &
BIT(1);
747 if (_queue_empty(pfree_xmitbuf_queue) ==
true)
750 phead = get_list_head(pfree_xmitbuf_queue);
753 list_delete(&(pxmitbuf->
list));
755 if (pxmitbuf !=
NULL)
757 spin_unlock_irqrestore(&pfree_xmitbuf_queue->
lock, irqL);
766 if (pxmitbuf ==
NULL)
769 list_delete(&pxmitbuf->
list);
770 list_insert_tail(&(pxmitbuf->
list), get_list_head(pfree_xmitbuf_queue));
772 spin_unlock_irqrestore(&pfree_xmitbuf_queue->
lock, irqL);
801 if (_queue_empty(pfree_xmit_queue) ==
true)
804 phead = get_list_head(pfree_xmit_queue);
807 list_delete(&(pxframe->
list));
809 if (pxframe !=
NULL) {
816 spin_unlock_irqrestore(&pfree_xmit_queue->
lock, irqL);
828 if (pxmitframe ==
NULL)
831 list_delete(&pxmitframe->
list);
832 if (pxmitframe->
pkt) {
833 pndis_pkt = pxmitframe->
pkt;
836 list_insert_tail(&pxmitframe->
list, get_list_head(pfree_xmit_queue));
838 spin_unlock_irqrestore(&pfree_xmit_queue->
lock, irqL);
839 if (netif_queue_stopped(padapter->
pnetdev))
840 netif_wake_queue(padapter->
pnetdev);
846 if (pxmitframe ==
NULL)
860 phead = get_list_head(pframequeue);
862 while (end_of_queue_search(phead, plist) ==
false) {
867 spin_unlock_irqrestore(&(pframequeue->
lock), irqL);
882 *ppstapending = &padapter->
xmitpriv.bk_pending;
883 (phwxmits+3)->
accnt++;
888 *ppstapending = &padapter->
xmitpriv.vi_pending;
889 (phwxmits+1)->
accnt++;
894 *ppstapending = &padapter->
xmitpriv.vo_pending;
895 (phwxmits+0)->
accnt++;
901 *ppstapending = &padapter->
xmitpriv.be_pending;
902 (phwxmits + 2)->
accnt++;
922 sint bmcst = IS_MCAST(pattrib->
ra);
925 psta = pattrib->
psta;
932 get_bssid(pmlmepriv));
939 ptxservq = get_sta_pending(padapter, &pstapending,
944 get_list_head(pstapending));
945 list_insert_tail(&pxmitframe->
list,
948 spin_unlock_irqrestore(&pstapending->
lock, irqL0);
952 static void alloc_hwxmits(
struct _adapter *padapter)
995 static void free_hwxmits(
struct _adapter *padapter)
1006 for (i = 0; i <
entry; i++, phwxmit++) {
1008 _init_listhead(&phwxmit->
pending);
1047 spin_unlock_irqrestore(&pxmitpriv->
lock, irqL);
1051 if (pxmitbuf ==
NULL) {
1054 spin_unlock_irqrestore(&pxmitpriv->
lock, irqL);
1056 spin_unlock_irqrestore(&pxmitpriv->
lock, irqL);