mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-22 04:23:39 +00:00
rtl8188eu: Fix checkpatch errors in os_dep/xmit_linux.c
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
aa6edf1619
commit
49ab4b6c4f
1 changed files with 38 additions and 60 deletions
|
@ -33,7 +33,8 @@
|
|||
|
||||
uint rtw_remainder_len(struct pkt_file *pfile)
|
||||
{
|
||||
return (pfile->buf_len - ((size_t)(pfile->cur_addr) - (size_t)(pfile->buf_start)));
|
||||
return pfile->buf_len - ((size_t)(pfile->cur_addr) -
|
||||
(size_t)(pfile->buf_start));
|
||||
}
|
||||
|
||||
void _rtw_open_pktfile(struct sk_buff *pktptr, struct pkt_file *pfile)
|
||||
|
@ -41,8 +42,10 @@ void _rtw_open_pktfile (struct sk_buff *pktptr, struct pkt_file *pfile)
|
|||
_func_enter_;
|
||||
|
||||
pfile->pkt = pktptr;
|
||||
pfile->cur_addr = pfile->buf_start = pktptr->data;
|
||||
pfile->pkt_len = pfile->buf_len = pktptr->len;
|
||||
pfile->cur_addr = pktptr->data;
|
||||
pfile->buf_start = pktptr->data;
|
||||
pfile->pkt_len = pktptr->len;
|
||||
pfile->buf_len = pktptr->len;
|
||||
|
||||
pfile->cur_buffer = pfile->buf_start;
|
||||
|
||||
|
@ -95,9 +98,7 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb
|
|||
|
||||
pxmitbuf->pallocated_buf = rtw_zmalloc(alloc_sz);
|
||||
if (pxmitbuf->pallocated_buf == NULL)
|
||||
{
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((size_t)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ);
|
||||
pxmitbuf->dma_transfer_addr = 0;
|
||||
|
@ -112,7 +113,8 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb
|
|||
return _SUCCESS;
|
||||
}
|
||||
|
||||
void rtw_os_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf,u32 free_sz)
|
||||
void rtw_os_xmit_resource_free(struct adapter *padapter,
|
||||
struct xmit_buf *pxmitbuf, u32 free_sz)
|
||||
{
|
||||
int i;
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
|
||||
|
@ -120,13 +122,7 @@ void rtw_os_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitb
|
|||
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
if (pxmitbuf->pxmit_urb[i])
|
||||
{
|
||||
//usb_kill_urb(pxmitbuf->pxmit_urb[i]);
|
||||
usb_free_urb(pxmitbuf->pxmit_urb[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (pxmitbuf->pallocated_buf)
|
||||
rtw_mfree(pxmitbuf->pallocated_buf, free_sz);
|
||||
|
@ -144,9 +140,7 @@ void rtw_os_pkt_complete(struct adapter *padapter, struct sk_buff *pkt)
|
|||
if (padapter->registrypriv.wifi_spec) {
|
||||
if (__netif_subqueue_stopped(padapter->pnetdev, queue) &&
|
||||
(pxmitpriv->hwxmits[queue].accnt < WMM_XMIT_THRESHOLD))
|
||||
{
|
||||
netif_wake_subqueue(padapter->pnetdev, queue);
|
||||
}
|
||||
} else {
|
||||
if (__netif_subqueue_stopped(padapter->pnetdev, queue))
|
||||
netif_wake_subqueue(padapter->pnetdev, queue);
|
||||
|
@ -162,14 +156,7 @@ void rtw_os_pkt_complete(struct adapter *padapter, struct sk_buff *pkt)
|
|||
void rtw_os_xmit_complete(struct adapter *padapter, struct xmit_frame *pxframe)
|
||||
{
|
||||
if (pxframe->pkt)
|
||||
{
|
||||
//RT_TRACE(_module_xmit_osdep_c_,_drv_err_,("linux : rtw_os_xmit_complete, dev_kfree_skb()\n"));
|
||||
|
||||
//dev_kfree_skb_any(pxframe->pkt);
|
||||
rtw_os_pkt_complete(padapter, pxframe->pkt);
|
||||
|
||||
}
|
||||
|
||||
pxframe->pkt = NULL;
|
||||
}
|
||||
|
||||
|
@ -202,10 +189,8 @@ static void rtw_check_xmit_resource(struct adapter *padapter, struct sk_buff *pk
|
|||
queue = skb_get_queue_mapping(pkt);
|
||||
if (padapter->registrypriv.wifi_spec) {
|
||||
/* No free space for Tx, tx_worker is too slow */
|
||||
if (pxmitpriv->hwxmits[queue].accnt > WMM_XMIT_THRESHOLD) {
|
||||
//DBG_88E("%s(): stop netif_subqueue[%d]\n", __func__, queue);
|
||||
if (pxmitpriv->hwxmits[queue].accnt > WMM_XMIT_THRESHOLD)
|
||||
netif_stop_subqueue(padapter->pnetdev, queue);
|
||||
}
|
||||
} else {
|
||||
if (pxmitpriv->free_xmitframe_cnt <= 4) {
|
||||
if (!netif_tx_queue_stopped(netdev_get_tx_queue(padapter->pnetdev, queue)))
|
||||
|
@ -213,8 +198,7 @@ static void rtw_check_xmit_resource(struct adapter *padapter, struct sk_buff *pk
|
|||
}
|
||||
}
|
||||
#else
|
||||
if (pxmitpriv->free_xmitframe_cnt<=4)
|
||||
{
|
||||
if (pxmitpriv->free_xmitframe_cnt <= 4) {
|
||||
if (!rtw_netif_queue_stopped(padapter->pnetdev))
|
||||
rtw_netif_stop_queue(padapter->pnetdev);
|
||||
}
|
||||
|
@ -235,9 +219,8 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
|
|||
phead = &pstapriv->asoc_list;
|
||||
plist = get_next(phead);
|
||||
|
||||
//free sta asoc_queue
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == false)
|
||||
{
|
||||
/* free sta asoc_queue */
|
||||
while (!rtw_end_of_queue_search(phead, plist)) {
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
|
||||
|
||||
plist = get_next(plist);
|
||||
|
@ -255,15 +238,15 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
|
|||
DBG_88E("%s()-%d: rtw_xmit() return error!\n", __func__, __LINE__);
|
||||
pxmitpriv->tx_drop++;
|
||||
dev_kfree_skb_any(newskb);
|
||||
} else
|
||||
} else {
|
||||
pxmitpriv->tx_pkts++;
|
||||
}
|
||||
} else {
|
||||
DBG_88E("%s-%d: skb_copy() failed!\n", __func__, __LINE__);
|
||||
pxmitpriv->tx_drop++;
|
||||
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
//dev_kfree_skb_any(skb);
|
||||
return false; // Caller shall tx this multicast frame via normal way.
|
||||
return false; /* Caller shall tx this multicast frame via normal way. */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -294,20 +277,15 @@ _func_enter_;
|
|||
|
||||
rtw_check_xmit_resource(padapter, pkt);
|
||||
|
||||
if ( !rtw_mc2u_disable
|
||||
&& check_fwstate(pmlmepriv, WIFI_AP_STATE) == true
|
||||
&& ( IP_MCAST_MAC(pkt->data)
|
||||
|| ICMPV6_MCAST_MAC(pkt->data) )
|
||||
&& (padapter->registrypriv.wifi_spec == 0)
|
||||
)
|
||||
{
|
||||
if (!rtw_mc2u_disable && check_fwstate(pmlmepriv, WIFI_AP_STATE) &&
|
||||
(IP_MCAST_MAC(pkt->data) || ICMPV6_MCAST_MAC(pkt->data)) &&
|
||||
(padapter->registrypriv.wifi_spec == 0)) {
|
||||
if (pxmitpriv->free_xmitframe_cnt > (NR_XMITFRAME/4)) {
|
||||
res = rtw_mlcst2unicst(padapter, pkt);
|
||||
if (res == true) {
|
||||
if (res)
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
res = rtw_xmit(padapter, &pkt);
|
||||
if (res < 0)
|
||||
|
|
Loading…
Reference in a new issue