mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-06-23 16:44:20 +00:00
rtl8188eu: Convert C90 comments in os_dep
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
592c85f4e2
commit
34c3293686
10 changed files with 1412 additions and 1669 deletions
|
@ -30,7 +30,7 @@
|
|||
#include <ethernet.h>
|
||||
#include <usb_ops.h>
|
||||
|
||||
//init os related resource in struct recv_priv
|
||||
/* init os related resource in struct recv_priv */
|
||||
int rtw_os_recv_resource_init(struct recv_priv *precvpriv, struct adapter *padapter)
|
||||
{
|
||||
int res=_SUCCESS;
|
||||
|
@ -38,7 +38,7 @@ int rtw_os_recv_resource_init(struct recv_priv *precvpriv, struct adapter *padap
|
|||
return res;
|
||||
}
|
||||
|
||||
//alloc os related resource in union recv_frame
|
||||
/* alloc os related resource in union recv_frame */
|
||||
int rtw_os_recv_resource_alloc(struct adapter *padapter, union recv_frame *precvframe)
|
||||
{
|
||||
int res=_SUCCESS;
|
||||
|
@ -49,7 +49,7 @@ int rtw_os_recv_resource_alloc(struct adapter *padapter, union recv_frame *precv
|
|||
|
||||
}
|
||||
|
||||
//free os related resource in union recv_frame
|
||||
/* free os related resource in union recv_frame */
|
||||
void rtw_os_recv_resource_free(struct recv_priv *precvpriv)
|
||||
{
|
||||
sint i;
|
||||
|
@ -60,7 +60,7 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)
|
|||
{
|
||||
if(precvframe->u.hdr.pkt)
|
||||
{
|
||||
rtw_skb_free(precvframe->u.hdr.pkt);//free skb by driver
|
||||
rtw_skb_free(precvframe->u.hdr.pkt);/* free skb by driver */
|
||||
precvframe->u.hdr.pkt = NULL;
|
||||
}
|
||||
precvframe++;
|
||||
|
@ -69,7 +69,7 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)
|
|||
}
|
||||
|
||||
|
||||
//alloc os related resource in struct recv_buf
|
||||
/* alloc os related resource in struct recv_buf */
|
||||
int rtw_os_recvbuf_resource_alloc(struct adapter *padapter, struct recv_buf *precvbuf)
|
||||
{
|
||||
int res=_SUCCESS;
|
||||
|
@ -100,11 +100,11 @@ int rtw_os_recvbuf_resource_alloc(struct adapter *padapter, struct recv_buf *pre
|
|||
precvbuf->pbuf = precvbuf->pallocated_buf;
|
||||
if(precvbuf->pallocated_buf == NULL)
|
||||
return _FAIL;
|
||||
#endif //CONFIG_USE_USB_BUFFER_ALLOC_RX
|
||||
#endif /* CONFIG_USE_USB_BUFFER_ALLOC_RX */
|
||||
return res;
|
||||
}
|
||||
|
||||
//free os related resource in struct recv_buf
|
||||
/* free os related resource in struct recv_buf */
|
||||
int rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf)
|
||||
{
|
||||
int ret = _SUCCESS;
|
||||
|
@ -118,11 +118,11 @@ int rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *prec
|
|||
precvbuf->pallocated_buf = NULL;
|
||||
precvbuf->dma_transfer_addr = 0;
|
||||
|
||||
#endif //CONFIG_USE_USB_BUFFER_ALLOC_RX
|
||||
#endif /* CONFIG_USE_USB_BUFFER_ALLOC_RX */
|
||||
|
||||
if(precvbuf->purb)
|
||||
{
|
||||
//usb_kill_urb(precvbuf->purb);
|
||||
/* usb_kill_urb(precvbuf->purb); */
|
||||
usb_free_urb(precvbuf->purb);
|
||||
}
|
||||
if(precvbuf->pskb)
|
||||
|
@ -217,26 +217,26 @@ void rtw_hostapd_mlme_rx(struct adapter *padapter, union recv_frame *precv_frame
|
|||
skb->tail = precv_frame->u.hdr.rx_tail;
|
||||
skb->len = precv_frame->u.hdr.len;
|
||||
|
||||
//pskb_copy = rtw_skb_copy(skb);
|
||||
// if(skb == NULL) goto _exit;
|
||||
/* pskb_copy = rtw_skb_copy(skb); */
|
||||
/* if(skb == NULL) goto _exit; */
|
||||
|
||||
skb->dev = pmgnt_netdev;
|
||||
skb->ip_summed = CHECKSUM_NONE;
|
||||
skb->pkt_type = PACKET_OTHERHOST;
|
||||
//skb->protocol = __constant_htons(0x0019); /*ETH_P_80211_RAW*/
|
||||
/* skb->protocol = __constant_htons(0x0019); /*ETH_P_80211_RAW*/ */
|
||||
skb->protocol = __constant_htons(0x0003); /*ETH_P_80211_RAW*/
|
||||
|
||||
//DBG_871X("(1)data=0x%x, head=0x%x, tail=0x%x, mac_header=0x%x, len=%d\n", skb->data, skb->head, skb->tail, skb->mac_header, skb->len);
|
||||
/* DBG_871X("(1)data=0x%x, head=0x%x, tail=0x%x, mac_header=0x%x, len=%d\n", skb->data, skb->head, skb->tail, skb->mac_header, skb->len); */
|
||||
|
||||
//skb->mac.raw = skb->data;
|
||||
/* skb->mac.raw = skb->data; */
|
||||
skb_reset_mac_header(skb);
|
||||
|
||||
//skb_pull(skb, 24);
|
||||
/* skb_pull(skb, 24); */
|
||||
memset(skb->cb, 0, sizeof(skb->cb));
|
||||
|
||||
rtw_netif_rx(pmgnt_netdev, skb);
|
||||
|
||||
precv_frame->u.hdr.pkt = NULL; // set pointer to NULL before rtw_free_recvframe() if call rtw_netif_rx()
|
||||
precv_frame->u.hdr.pkt = NULL; /* set pointer to NULL before rtw_free_recvframe() if call rtw_netif_rx() */
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -301,11 +301,11 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
|
|||
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
|
||||
int bmcast = IS_MCAST(pattrib->dst);
|
||||
|
||||
//DBG_871X("bmcast=%d\n", bmcast);
|
||||
/* DBG_871X("bmcast=%d\n", bmcast); */
|
||||
|
||||
if(_rtw_memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN)==false)
|
||||
{
|
||||
//DBG_871X("not ap psta=%p, addr=%pM\n", psta, pattrib->dst);
|
||||
/* DBG_871X("not ap psta=%p, addr=%pM\n", psta, pattrib->dst); */
|
||||
|
||||
if(bmcast)
|
||||
{
|
||||
|
@ -319,9 +319,9 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
|
|||
{
|
||||
struct net_device *pnetdev= (struct net_device*)padapter->pnetdev;
|
||||
|
||||
//DBG_871X("directly forwarding to the rtw_xmit_entry\n");
|
||||
/* DBG_871X("directly forwarding to the rtw_xmit_entry\n"); */
|
||||
|
||||
//skb->ip_summed = CHECKSUM_NONE;
|
||||
/* skb->ip_summed = CHECKSUM_NONE; */
|
||||
skb->dev = pnetdev;
|
||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0))
|
||||
|
@ -330,7 +330,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
|
|||
skb_set_queue_mapping(skb, rtw_recv_select_queue(skb,
|
||||
NULL, NULL));
|
||||
#endif
|
||||
#endif //LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35)
|
||||
#endif /* LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35) */
|
||||
|
||||
_rtw_xmit_entry(skb, pnetdev);
|
||||
|
||||
|
@ -342,9 +342,9 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
|
|||
|
||||
|
||||
}
|
||||
else// to APself
|
||||
else/* to APself */
|
||||
{
|
||||
//DBG_871X("to APSelf\n");
|
||||
/* DBG_871X("to APSelf\n"); */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -353,37 +353,37 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
|
|||
|
||||
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
|
||||
br_port = padapter->pnetdev->br_port;
|
||||
#else // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
|
||||
#else /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
|
||||
rcu_read_lock();
|
||||
br_port = rcu_dereference(padapter->pnetdev->rx_handler_data);
|
||||
rcu_read_unlock();
|
||||
#endif // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
|
||||
#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
|
||||
|
||||
if( br_port && (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true) )
|
||||
{
|
||||
int nat25_handle_frame(struct adapter *priv, struct sk_buff *skb);
|
||||
if (nat25_handle_frame(padapter, skb) == -1) {
|
||||
//priv->ext_stats.rx_data_drops++;
|
||||
//DEBUG_ERR("RX DROP: nat25_handle_frame fail!\n");
|
||||
//return FAIL;
|
||||
/* priv->ext_stats.rx_data_drops++; */
|
||||
/* DEBUG_ERR("RX DROP: nat25_handle_frame fail!\n"); */
|
||||
/* return FAIL; */
|
||||
#if 1
|
||||
// bypass this frame to upper layer!!
|
||||
/* bypass this frame to upper layer!! */
|
||||
#else
|
||||
goto _recv_indicatepkt_drop;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif // CONFIG_BR_EXT
|
||||
#endif /* CONFIG_BR_EXT */
|
||||
|
||||
|
||||
#ifdef CONFIG_TCP_CSUM_OFFLOAD_RX
|
||||
if ( (pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1) ) {
|
||||
skb->ip_summed = CHECKSUM_UNNECESSARY;
|
||||
//DBG_871X("CHECKSUM_UNNECESSARY \n");
|
||||
/* DBG_871X("CHECKSUM_UNNECESSARY \n"); */
|
||||
} else {
|
||||
skb->ip_summed = CHECKSUM_NONE;
|
||||
//DBG_871X("CHECKSUM_NONE(%d, %d) \n", pattrib->tcpchk_valid, pattrib->tcp_chkrpt);
|
||||
/* DBG_871X("CHECKSUM_NONE(%d, %d) \n", pattrib->tcpchk_valid, pattrib->tcp_chkrpt); */
|
||||
}
|
||||
#else /* !CONFIG_TCP_CSUM_OFFLOAD_RX */
|
||||
|
||||
|
@ -439,7 +439,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
|
|||
|
||||
_recv_indicatepkt_end:
|
||||
|
||||
precv_frame->u.hdr.pkt = NULL; // pointers to NULL before rtw_free_recvframe()
|
||||
precv_frame->u.hdr.pkt = NULL; /* pointers to NULL before rtw_free_recvframe() */
|
||||
|
||||
rtw_free_recvframe(precv_frame, pfree_recv_queue);
|
||||
|
||||
|
@ -451,7 +451,7 @@ _recv_indicatepkt_end:
|
|||
|
||||
_recv_indicatepkt_drop:
|
||||
|
||||
//enqueue back to free_recv_queue
|
||||
/* enqueue back to free_recv_queue */
|
||||
if(precv_frame)
|
||||
rtw_free_recvframe(precv_frame, pfree_recv_queue);
|
||||
|
||||
|
@ -467,7 +467,7 @@ void rtw_os_read_port(struct adapter *padapter, struct recv_buf *precvbuf)
|
|||
|
||||
precvbuf->ref_cnt--;
|
||||
|
||||
//free skb in recv_buf
|
||||
/* free skb in recv_buf */
|
||||
rtw_skb_free(precvbuf->pskb);
|
||||
|
||||
precvbuf->pskb = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue