diff options
Diffstat (limited to 'drivers/staging/rtl8723bs/core/rtw_xmit.c')
-rw-r--r-- | drivers/staging/rtl8723bs/core/rtw_xmit.c | 68 |
1 files changed, 23 insertions, 45 deletions
diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c index bd3acdd7d75f..79e4d7df1ef5 100644 --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _RTW_XMIT_C_ - #include <drv_types.h> #include <rtw_debug.h> @@ -323,15 +321,12 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) u8 query_ra_short_GI(struct sta_info *psta) { - u8 sgi = false, sgi_20m = false, sgi_40m = false, sgi_80m = false; + u8 sgi = false, sgi_20m = false, sgi_40m = false; sgi_20m = psta->htpriv.sgi_20m; sgi_40m = psta->htpriv.sgi_40m; switch (psta->bw_mode) { - case CHANNEL_WIDTH_80: - sgi = sgi_80m; - break; case CHANNEL_WIDTH_40: sgi = sgi_40m; break; @@ -647,7 +642,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p pattrib->pktlen = pktfile.pkt_len; - if (ETH_P_IP == pattrib->ether_type) { + if (pattrib->ether_type == ETH_P_IP) { /* The following is for DHCP and ARP packet, we use cck1M to tx these packets and let LPS awake some time */ /* to prevent DHCP protocol fail */ @@ -657,7 +652,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p pattrib->dhcp_pkt = 0; if (pktfile.pkt_len > 282) {/* MINIMUM_DHCP_PACKET_SIZE) { */ - if (ETH_P_IP == pattrib->ether_type) {/* IP header */ + if (pattrib->ether_type == ETH_P_IP) {/* IP header */ if (((tmp[21] == 68) && (tmp[23] == 67)) || ((tmp[21] == 67) && (tmp[23] == 68))) { /* 68 : UDP BOOTP client */ @@ -675,7 +670,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p if (piphdr->protocol == 0x1) /* protocol type in ip header 0x1 is ICMP */ pattrib->icmp_pkt = 1; } - } else if (0x888e == pattrib->ether_type) { + } else if (pattrib->ether_type == 0x888e) { netdev_dbg(padapter->pnetdev, "send eapol packet\n"); } @@ -1725,18 +1720,14 @@ exit: void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pframequeue) { - struct list_head *plist, *phead; + struct list_head *plist, *phead, *tmp; struct xmit_frame *pxmitframe; spin_lock_bh(&pframequeue->lock); phead = get_list_head(pframequeue); - plist = get_next(phead); - - while (phead != plist) { - pxmitframe = container_of(plist, struct xmit_frame, list); - - plist = get_next(plist); + list_for_each_safe(plist, tmp, phead) { + pxmitframe = list_entry(plist, struct xmit_frame, list); rtw_free_xmitframe(pxmitpriv, pxmitframe); } @@ -2128,7 +2119,7 @@ signed int xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct x static void dequeue_xmitframes_to_sleeping_queue(struct adapter *padapter, struct sta_info *psta, struct __queue *pframequeue) { signed int ret; - struct list_head *plist, *phead; + struct list_head *plist, *phead, *tmp; u8 ac_index; struct tx_servq *ptxservq; struct pkt_attrib *pattrib; @@ -2136,12 +2127,8 @@ static void dequeue_xmitframes_to_sleeping_queue(struct adapter *padapter, struc struct hw_xmit *phwxmits = padapter->xmitpriv.hwxmits; phead = get_list_head(pframequeue); - plist = get_next(phead); - - while (phead != plist) { - pxmitframe = container_of(plist, struct xmit_frame, list); - - plist = get_next(plist); + list_for_each_safe(plist, tmp, phead) { + pxmitframe = list_entry(plist, struct xmit_frame, list); pattrib = &pxmitframe->attrib; @@ -2201,7 +2188,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) { u8 update_mask = 0, wmmps_ac = 0; struct sta_info *psta_bmc; - struct list_head *xmitframe_plist, *xmitframe_phead; + struct list_head *xmitframe_plist, *xmitframe_phead, *tmp; struct xmit_frame *pxmitframe = NULL; struct sta_priv *pstapriv = &padapter->stapriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; @@ -2211,12 +2198,9 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) spin_lock_bh(&pxmitpriv->lock); xmitframe_phead = get_list_head(&psta->sleep_q); - xmitframe_plist = get_next(xmitframe_phead); - - while (xmitframe_phead != xmitframe_plist) { - pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); - - xmitframe_plist = get_next(xmitframe_plist); + list_for_each_safe(xmitframe_plist, tmp, xmitframe_phead) { + pxmitframe = list_entry(xmitframe_plist, struct xmit_frame, + list); list_del_init(&pxmitframe->list); @@ -2285,12 +2269,9 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) if ((pstapriv->sta_dz_bitmap&0xfffe) == 0x0) { /* no any sta in ps mode */ xmitframe_phead = get_list_head(&psta_bmc->sleep_q); - xmitframe_plist = get_next(xmitframe_phead); - - while (xmitframe_phead != xmitframe_plist) { - pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); - - xmitframe_plist = get_next(xmitframe_plist); + list_for_each_safe(xmitframe_plist, tmp, xmitframe_phead) { + pxmitframe = list_entry(xmitframe_plist, + struct xmit_frame, list); list_del_init(&pxmitframe->list); @@ -2324,7 +2305,7 @@ _exit: void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *psta) { u8 wmmps_ac = 0; - struct list_head *xmitframe_plist, *xmitframe_phead; + struct list_head *xmitframe_plist, *xmitframe_phead, *tmp; struct xmit_frame *pxmitframe = NULL; struct sta_priv *pstapriv = &padapter->stapriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; @@ -2332,12 +2313,9 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst spin_lock_bh(&pxmitpriv->lock); xmitframe_phead = get_list_head(&psta->sleep_q); - xmitframe_plist = get_next(xmitframe_phead); - - while (xmitframe_phead != xmitframe_plist) { - pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); - - xmitframe_plist = get_next(xmitframe_plist); + list_for_each_safe(xmitframe_plist, tmp, xmitframe_phead) { + pxmitframe = list_entry(xmitframe_plist, struct xmit_frame, + list); switch (pxmitframe->attrib.priority) { case 1: @@ -2524,7 +2502,7 @@ void rtw_sctx_init(struct submit_ctx *sctx, int timeout_ms) sctx->status = RTW_SCTX_SUBMITTED; } -int rtw_sctx_wait(struct submit_ctx *sctx, const char *msg) +int rtw_sctx_wait(struct submit_ctx *sctx) { int ret = _FAIL; unsigned long expire; @@ -2565,7 +2543,7 @@ int rtw_ack_tx_wait(struct xmit_priv *pxmitpriv, u32 timeout_ms) pack_tx_ops->timeout_ms = timeout_ms; pack_tx_ops->status = RTW_SCTX_SUBMITTED; - return rtw_sctx_wait(pack_tx_ops, __func__); + return rtw_sctx_wait(pack_tx_ops); } void rtw_ack_tx_done(struct xmit_priv *pxmitpriv, int status) |