diff options
Diffstat (limited to 'drivers/staging/r8188eu/core/rtw_xmit.c')
-rw-r--r-- | drivers/staging/r8188eu/core/rtw_xmit.c | 99 |
1 files changed, 22 insertions, 77 deletions
diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 8503059edc46..c2a550e7250e 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -133,9 +133,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) if (res == _FAIL) { msleep(10); res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ)); - if (res == _FAIL) { + if (res == _FAIL) goto exit; - } } pxmitbuf->flags = XMIT_VO_QUEUE; @@ -372,7 +371,6 @@ u8 qos_acm(u8 acm_mask, u8 priority) change_priority = 5; break; default: - DBG_88E("qos_acm(): invalid pattrib->priority: %d!!!\n", priority); break; } @@ -460,8 +458,6 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p } } } - } else if (0x888e == pattrib->ether_type) { - netdev_dbg(padapter->pnetdev, "send eapol packet\n"); } if ((pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1)) @@ -489,7 +485,6 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p if (psta) { pattrib->mac_id = psta->mac_id; - /* DBG_88E("%s ==> mac_id(%d)\n", __func__, pattrib->mac_id); */ pattrib->psta = psta; } else { /* if we cannot get psta => drop the pkt */ @@ -711,15 +706,12 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr struct sta_info *psta; - if (pattrib->psta) { + if (pattrib->psta) psta = pattrib->psta; - } else { - if (is_multicast_ether_addr(pattrib->ra)) { - psta = rtw_get_bcmc_stainfo(padapter); - } else { - psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra); - } - } + else if (is_multicast_ether_addr(pattrib->ra)) + psta = rtw_get_bcmc_stainfo(padapter); + else + psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra); memset(hdr, 0, WLANHDR_OFFSET); @@ -894,10 +886,8 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct if (!psta) return _FAIL; - if (!pxmitframe->buf_addr) { - DBG_88E("==> %s buf_addr == NULL\n", __func__); + if (!pxmitframe->buf_addr) return _FAIL; - } pbuf_start = pxmitframe->buf_addr; @@ -906,7 +896,6 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct mem_start = pbuf_start + hw_hdr_offset; if (rtw_make_wlanhdr(padapter, mem_start, pattrib) == _FAIL) { - DBG_88E("rtw_xmitframe_coalesce: rtw_make_wlanhdr fail; drop pkt\n"); res = _FAIL; goto exit; } @@ -1003,7 +992,6 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct } if (xmitframe_addmic(padapter, pxmitframe) == _FAIL) { - DBG_88E("xmitframe_addmic(padapter, pxmitframe) == _FAIL\n"); res = _FAIL; goto exit; } @@ -1133,10 +1121,8 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv) pxmitbuf->priv_data = NULL; /* pxmitbuf->ext_tag = true; */ - if (pxmitbuf->sctx) { - DBG_88E("%s pxmitbuf->sctx is not NULL\n", __func__); + if (pxmitbuf->sctx) rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC); - } } spin_unlock_irqrestore(&pfree_queue->lock, flags); @@ -1171,8 +1157,6 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv) struct __queue *pfree_xmitbuf_queue = &pxmitpriv->free_xmitbuf_queue; unsigned long flags; - /* DBG_88E("+rtw_alloc_xmitbuf\n"); */ - spin_lock_irqsave(&pfree_xmitbuf_queue->lock, flags); if (list_empty(&pfree_xmitbuf_queue->queue)) { @@ -1190,10 +1174,8 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv) if (pxmitbuf) { pxmitpriv->free_xmitbuf_cnt--; pxmitbuf->priv_data = NULL; - if (pxmitbuf->sctx) { - DBG_88E("%s pxmitbuf->sctx is not NULL\n", __func__); + if (pxmitbuf->sctx) rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC); - } } spin_unlock_irqrestore(&pfree_xmitbuf_queue->lock, flags); @@ -1208,10 +1190,8 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) if (!pxmitbuf) return _FAIL; - if (pxmitbuf->sctx) { - DBG_88E("%s pxmitbuf->sctx is not NULL\n", __func__); + if (pxmitbuf->sctx) rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_FREE); - } if (pxmitbuf->ext_tag) { rtw_free_xmitbuf_ext(pxmitpriv, pxmitbuf); @@ -1471,15 +1451,13 @@ s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe) struct hw_xmit *phwxmits = padapter->xmitpriv.hwxmits; int res = _SUCCESS; - if (pattrib->psta) { + if (pattrib->psta) psta = pattrib->psta; - } else { + else psta = rtw_get_stainfo(pstapriv, pattrib->ra); - } if (!psta) { res = _FAIL; - DBG_88E("rtw_xmit_classifier: psta == NULL\n"); goto exit; } @@ -1605,10 +1583,8 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) } newskb = skb_copy(skb, GFP_ATOMIC); - if (!newskb) { - DEBUG_ERR("TX DROP: skb_copy fail!\n"); + if (!newskb) return -1; - } dev_kfree_skb_any(skb); *pskb = skb = newskb; @@ -1620,21 +1596,15 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) } } - if (skb_is_nonlinear(skb)) - DEBUG_ERR("%s(): skb_is_nonlinear!!\n", __func__); - res = skb_linearize(skb); - if (res < 0) { - DEBUG_ERR("TX DROP: skb_linearize fail!\n"); - return -1; - } + if (res < 0) + return -1; res = nat25_db_handle(padapter, skb, NAT25_INSERT); if (res < 0) { - if (res == -2) { - DEBUG_ERR("TX DROP: nat25_db_handle fail!\n"); + if (res == -2) return -1; - } + return 0; } } @@ -1653,11 +1623,9 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) } /* check if SA is equal to our MAC */ - if (memcmp(skb->data + ETH_ALEN, GET_MY_HWADDR(padapter), ETH_ALEN)) { - DEBUG_ERR("TX DROP: untransformed frame SA:%02X%02X%02X%02X%02X%02X!\n", - skb->data[6], skb->data[7], skb->data[8], skb->data[9], skb->data[10], skb->data[11]); + if (memcmp(skb->data + ETH_ALEN, GET_MY_HWADDR(padapter), ETH_ALEN)) return -1; - } + return 0; } @@ -1724,10 +1692,8 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt) s32 res; pxmitframe = rtw_alloc_xmitframe(pxmitpriv); - if (!pxmitframe) { - DBG_88E("DBG_TX_DROP_FRAME %s no more pxmitframe\n", __func__); + if (!pxmitframe) return -1; - } rcu_read_lock(); br_port = rcu_dereference(padapter->pnetdev->rx_handler_data); @@ -2147,13 +2113,11 @@ int rtw_sctx_wait(struct submit_ctx *sctx) int status = 0; expire = sctx->timeout_ms ? msecs_to_jiffies(sctx->timeout_ms) : MAX_SCHEDULE_TIMEOUT; - if (!wait_for_completion_timeout(&sctx->done, expire)) { + if (!wait_for_completion_timeout(&sctx->done, expire)) /* timeout, do something?? */ status = RTW_SCTX_DONE_TIMEOUT; - DBG_88E("%s timeout\n", __func__); - } else { + else status = sctx->status; - } if (status == RTW_SCTX_DONE_SUCCESS) ret = _SUCCESS; @@ -2161,26 +2125,9 @@ int rtw_sctx_wait(struct submit_ctx *sctx) return ret; } -static bool rtw_sctx_chk_waring_status(int status) -{ - switch (status) { - case RTW_SCTX_DONE_UNKNOWN: - case RTW_SCTX_DONE_BUF_ALLOC: - case RTW_SCTX_DONE_BUF_FREE: - - case RTW_SCTX_DONE_DRV_STOP: - case RTW_SCTX_DONE_DEV_REMOVE: - return true; - default: - return false; - } -} - void rtw_sctx_done_err(struct submit_ctx **sctx, int status) { if (*sctx) { - if (rtw_sctx_chk_waring_status(status)) - DBG_88E("%s status:%d\n", __func__, status); (*sctx)->status = status; complete(&((*sctx)->done)); *sctx = NULL; @@ -2204,6 +2151,4 @@ void rtw_ack_tx_done(struct xmit_priv *pxmitpriv, int status) if (pxmitpriv->ack_tx) rtw_sctx_done_err(&pack_tx_ops, status); - else - DBG_88E("%s ack_tx not set\n", __func__); } |