1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-25 14:44:09 +00:00

Remove typedef for _pkt and replace with correct struct

This commit is contained in:
kimocoder 2019-03-14 12:06:17 +01:00
parent f523905d7a
commit dd687defb0
10 changed files with 56 additions and 61 deletions

View File

@ -1285,7 +1285,7 @@ inline u8 rtw_get_hwseq_no(_adapter *padapter)
#endif /* CONFIG_CONCURRENT_MODE */
return hwseq_num;
}
static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattrib)
static s32 update_attrib(_adapter *padapter, struct sk_buff *pkt, struct pkt_attrib *pattrib)
{
uint i;
struct pkt_file pktfile;
@ -2305,11 +2305,11 @@ s32 rtw_xmitframe_coalesce_amsdu(_adapter *padapter, struct xmit_frame *pxmitfra
struct pkt_file pktfile;
struct pkt_attrib *pattrib;
_pkt *pkt;
struct sk_buff *pkt;
struct pkt_file pktfile_queue;
struct pkt_attrib *pattrib_queue;
_pkt *pkt_queue;
struct sk_buff *pkt_queue;
s32 llc_sz, mem_sz;
@ -2480,7 +2480,7 @@ This sub-routine will perform all the following:
6. apply sw-encrypt, if necessary.
*/
s32 rtw_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxmitframe)
s32 rtw_xmitframe_coalesce(_adapter *padapter, struct sk_buff *pkt, struct xmit_frame *pxmitframe)
{
struct pkt_file pktfile;
@ -2677,7 +2677,7 @@ exit:
#ifdef CONFIG_IEEE80211W
/* broadcast or multicast management pkt use BIP, unicast management pkt use CCMP encryption */
s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxmitframe)
s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, struct sk_buff *pkt, struct xmit_frame *pxmitframe)
{
struct pkt_file pktfile;
s32 frg_inx, frg_len, mpdu_len, llc_sz, mem_sz;
@ -3427,7 +3427,7 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram
_irqL irqL;
_queue *queue = NULL;
_adapter *padapter = pxmitpriv->adapter;
_pkt *pndis_pkt = NULL;
struct sk_buff *pndis_pkt = NULL;
if (pxmitframe == NULL) {
@ -4411,7 +4411,7 @@ fail:
* 0 success, hardware will handle this xmit frame(packet)
* <0 fail
*/
s32 rtw_xmit(_adapter *padapter, _pkt **ppkt)
s32 rtw_xmit(_adapter *padapter, struct sk_buff **ppkt)
{
static systime start = 0;
static u32 drop_cnt = 0;

View File

@ -351,7 +351,7 @@ struct hal_ops {
void (*write_rfreg)(_adapter *padapter, enum rf_path eRFPath, u32 RegAddr, u32 BitMask, u32 Data);
#ifdef CONFIG_HOSTAPD_MLME
s32(*hostap_mgnt_xmit_entry)(_adapter *padapter, _pkt *pkt);
s32(*hostap_mgnt_xmit_entry)(_adapter *padapter, struct sk_buff *pkt);
#endif
void (*EfusePowerSwitch)(_adapter *padapter, u8 bWrite, u8 PwrState);
@ -693,7 +693,7 @@ void rtw_hal_set_tx_power_level(_adapter *padapter, u8 channel);
void rtw_hal_get_tx_power_level(_adapter *padapter, s32 *powerlevel);
#ifdef CONFIG_HOSTAPD_MLME
s32 rtw_hal_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt);
s32 rtw_hal_hostap_mgnt_xmit_entry(_adapter *padapter, struct sk_buff *pkt);
#endif
#ifdef DBG_CONFIG_ERROR_DETECT

View File

@ -283,9 +283,9 @@ void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_a
extern void *rtw_malloc2d(int h, int w, size_t size);
extern void rtw_mfree2d(void *pbuf, int h, int w, int size);
void rtw_os_pkt_free(_pkt *pkt);
void *rtw_os_pkt_data(_pkt *pkt);
u32 rtw_os_pkt_len(_pkt *pkt);
void rtw_os_pkt_free(struct sk_buff *pkt);
void *rtw_os_pkt_data(struct sk_buff *pkt);
u32 rtw_os_pkt_len(struct sk_buff *pkt);
extern void _rtw_memcpy(void *dec, const void *sour, u32 sz);
extern void _rtw_memmove(void *dst, const void *src, u32 sz);

View File

@ -22,7 +22,7 @@ extern void _rtw_free_recv_priv(struct recv_priv *precvpriv);
extern s32 rtw_recv_entry(union recv_frame *precv_frame);
extern int rtw_recv_indicatepkt(_adapter *adapter, union recv_frame *precv_frame);
extern void rtw_recv_returnpacket(struct net_device *cnxt, _pkt *preturnedpkt);
extern void rtw_recv_returnpacket(struct net_device *cnxt, struct sk_buff *preturnedpkt);
extern int rtw_recv_monitor(_adapter *padapter, union recv_frame *precv_frame);
@ -39,16 +39,16 @@ int rtw_os_recv_resource_alloc(_adapter *padapter, union recv_frame *precvframe)
void rtw_os_recv_resource_free(struct recv_priv *precvpriv);
int rtw_os_alloc_recvframe(_adapter *padapter, union recv_frame *precvframe, u8 *pdata, _pkt *pskb);
int rtw_os_recvframe_duplicate_skb(_adapter *padapter, union recv_frame *pcloneframe, _pkt *pskb);
int rtw_os_alloc_recvframe(_adapter *padapter, union recv_frame *precvframe, u8 *pdata, struct sk_buff *pskb);
int rtw_os_recvframe_duplicate_skb(_adapter *padapter, union recv_frame *pcloneframe, struct sk_buff *pskb);
void rtw_os_free_recvframe(union recv_frame *precvframe);
int rtw_os_recvbuf_resource_alloc(_adapter *padapter, struct recv_buf *precvbuf);
int rtw_os_recvbuf_resource_free(_adapter *padapter, struct recv_buf *precvbuf);
_pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata);
void rtw_os_recv_indicate_pkt(_adapter *padapter, _pkt *pkt, union recv_frame *rframe);
struct sk_buff *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata);
void rtw_os_recv_indicate_pkt(_adapter *padapter, struct sk_buff *pkt, union recv_frame *rframe);
void rtw_os_read_port(_adapter *padapter, struct recv_buf *precvbuf);

View File

@ -535,7 +535,7 @@ struct recv_buf {
#endif
#if defined(PLATFORM_LINUX)
_pkt *pskb;
struct sk_buff *pskb;
#elif defined(PLATFORM_FREEBSD) /* skb solution */
struct sk_buff *pskb;
#endif
@ -559,7 +559,7 @@ struct recv_buf {
*/
struct recv_frame_hdr {
_list list;
_pkt *pkt;
struct sk_buff *pkt;
_adapter *adapter;
@ -802,7 +802,7 @@ __inline static union recv_frame *rxmem_to_recvframe(u8 *rxmem)
}
__inline static union recv_frame *pkt_to_recvframe(_pkt *pkt)
__inline static union recv_frame *pkt_to_recvframe(struct sk_buff *pkt)
{
u8 *buf_star;
@ -819,7 +819,7 @@ __inline static union recv_frame *pkt_to_recvframe(_pkt *pkt)
return precv_frame;
}
__inline static u8 *pkt_to_recvmem(_pkt *pkt)
__inline static u8 *pkt_to_recvmem(struct sk_buff *pkt)
{
/* return the rx_head */
@ -829,7 +829,7 @@ __inline static u8 *pkt_to_recvmem(_pkt *pkt)
}
__inline static u8 *pkt_to_recvdata(_pkt *pkt)
__inline static u8 *pkt_to_recvdata(struct sk_buff *pkt)
{
/* return the rx_data */

View File

@ -632,15 +632,10 @@ struct xmit_frame {
_list list;
struct pkt_attrib attrib;
_pkt *pkt;
struct sk_buff *pkt;
int frame_tag;
_adapter *padapter;
u8 *buf_addr;
struct xmit_buf *pxmitbuf;
#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
@ -923,9 +918,9 @@ extern struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct
extern s32 rtw_xmit_classifier(_adapter *padapter, struct xmit_frame *pxmitframe);
extern u32 rtw_calculate_wlan_pkt_size_by_attribue(struct pkt_attrib *pattrib);
#define rtw_wlan_pkt_size(f) rtw_calculate_wlan_pkt_size_by_attribue(&f->attrib)
extern s32 rtw_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxmitframe);
extern s32 rtw_xmitframe_coalesce(_adapter *padapter, struct sk_buff *pkt, struct xmit_frame *pxmitframe);
#ifdef CONFIG_IEEE80211W
extern s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxmitframe);
extern s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, struct sk_buff *pkt, struct xmit_frame *pxmitframe);
#endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_TDLS
extern struct tdls_txmgmt *ptxmgmt;
@ -950,7 +945,7 @@ void rtw_free_hwxmits(_adapter *padapter);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24))
s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev);
#endif
s32 rtw_xmit(_adapter *padapter, _pkt **pkt);
s32 rtw_xmit(_adapter *padapter, struct sk_buff **pkt);
bool xmitframe_hiq_filter(struct xmit_frame *xmitframe);
#if defined(CONFIG_AP_MODE) || defined(CONFIG_TDLS)
sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *pxmitframe);

View File

@ -17,7 +17,7 @@
struct pkt_file {
_pkt *pkt;
struct sk_buff *pkt;
SIZE_T pkt_len; /* the remainder length of the open_file */
_buffer *cur_buffer;
u8 *buf_start;
@ -53,7 +53,7 @@ extern NDIS_STATUS rtw_xmit_entry(
#ifdef PLATFORM_FREEBSD
#define NR_XMITFRAME 256
extern int rtw_xmit_entry(_pkt *pkt, struct net_device *pnetdev);
extern int rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev);
extern void rtw_xmit_entry_wrap(struct ifnet *pifp);
#endif /* PLATFORM_FREEBSD */
@ -67,8 +67,8 @@ struct sta_xmit_priv;
struct xmit_frame;
struct xmit_buf;
extern int _rtw_xmit_entry(_pkt *pkt, struct net_device *pnetdev);
extern int rtw_xmit_entry(_pkt *pkt, struct net_device *pnetdev);
extern int _rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev);
extern int rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev);
#endif /* PLATFORM_LINUX */
@ -77,14 +77,14 @@ void rtw_os_xmit_schedule(_adapter *padapter);
int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz, u8 flag);
void rtw_os_xmit_resource_free(_adapter *padapter, struct xmit_buf *pxmitbuf, u32 free_sz, u8 flag);
extern void rtw_set_tx_chksum_offload(_pkt *pkt, struct pkt_attrib *pattrib);
extern void rtw_set_tx_chksum_offload(struct sk_buff *pkt, struct pkt_attrib *pattrib);
extern uint rtw_remainder_len(struct pkt_file *pfile);
extern void _rtw_open_pktfile(_pkt *pkt, struct pkt_file *pfile);
extern void _rtw_open_pktfile(struct sk_buff *pkt, struct pkt_file *pfile);
extern uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen);
extern sint rtw_endofpktfile(struct pkt_file *pfile);
extern void rtw_os_pkt_complete(_adapter *padapter, _pkt *pkt);
extern void rtw_os_pkt_complete(_adapter *padapter, struct sk_buff *pkt);
extern void rtw_os_xmit_complete(_adapter *padapter, struct xmit_frame *pxframe);
void rtw_os_wake_queue_at_free_stainfo(_adapter *padapter, int *qcnt_freed);

View File

@ -16,10 +16,10 @@
#include <drv_types.h>
int rtw_os_recvframe_duplicate_skb(_adapter *padapter, union recv_frame *pcloneframe, _pkt *pskb)
int rtw_os_recvframe_duplicate_skb(_adapter *padapter, union recv_frame *pcloneframe, struct sk_buff *pskb)
{
int res = _SUCCESS;
_pkt *pkt_copy = NULL;
struct sk_buff *pkt_copy = NULL;
struct rx_pkt_attrib *pattrib = &pcloneframe->u.hdr.attrib;
if (pskb == NULL) {
@ -53,12 +53,12 @@ int rtw_os_recvframe_duplicate_skb(_adapter *padapter, union recv_frame *pclonef
return res;
}
int rtw_os_alloc_recvframe(_adapter *padapter, union recv_frame *precvframe, u8 *pdata, _pkt *pskb)
int rtw_os_alloc_recvframe(_adapter *padapter, union recv_frame *precvframe, u8 *pdata, struct sk_buff *pskb)
{
int res = _SUCCESS;
u8 shift_sz = 0;
u32 skb_len, alloc_sz;
_pkt *pkt_copy = NULL;
struct sk_buff *pkt_copy = NULL;
struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib;
@ -281,11 +281,11 @@ int rtw_os_recvbuf_resource_free(_adapter *padapter, struct recv_buf *precvbuf)
}
_pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata)
struct sk_buff *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata)
{
u16 eth_type;
u8 *data_ptr;
_pkt *sub_skb;
struct sk_buff *sub_skb;
struct rx_pkt_attrib *pattrib;
pattrib = &prframe->u.hdr.attrib;
@ -335,7 +335,7 @@ _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8
#ifdef CONFIG_RTW_NAPI
static int napi_recv(_adapter *padapter, int budget)
{
_pkt *pskb;
struct sk_buff *pskb;
struct recv_priv *precvpriv = &padapter->recvpriv;
int work_done = 0;
struct registry_priv *pregistrypriv = &padapter->registrypriv;
@ -391,7 +391,7 @@ int rtw_recv_napi_poll(struct napi_struct *napi, int budget)
}
#endif /* CONFIG_RTW_NAPI */
void rtw_os_recv_indicate_pkt(_adapter *padapter, _pkt *pkt, union recv_frame *rframe)
void rtw_os_recv_indicate_pkt(_adapter *padapter, struct sk_buff *pkt, union recv_frame *rframe)
{
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct recv_priv *precvpriv = &(padapter->recvpriv);
@ -408,7 +408,7 @@ void rtw_os_recv_indicate_pkt(_adapter *padapter, _pkt *pkt, union recv_frame *r
DBG_COUNTER(padapter->rx_logs.os_indicate);
if (MLME_IS_AP(padapter)) {
_pkt *pskb2 = NULL;
struct sk_buff *pskb2 = NULL;
struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv;
int bmcast = IS_MCAST(ehdr->h_dest);
@ -562,7 +562,7 @@ void rtw_handle_tkip_mic_err(_adapter *padapter, struct sta_info *sta, u8 bgroup
#ifdef CONFIG_HOSTAPD_MLME
void rtw_hostapd_mlme_rx(_adapter *padapter, union recv_frame *precv_frame)
{
_pkt *skb;
struct sk_buff *skb;
struct hostapd_priv *phostapdpriv = padapter->phostapdpriv;
struct net_device *pmgnt_netdev = phostapdpriv->pmgnt_netdev;
@ -604,7 +604,7 @@ int rtw_recv_monitor(_adapter *padapter, union recv_frame *precv_frame)
int ret = _FAIL;
struct recv_priv *precvpriv;
_queue *pfree_recv_queue;
_pkt *skb;
struct sk_buff *skb;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct rx_pkt_attrib *pattrib;
@ -649,7 +649,7 @@ int rtw_recv_indicatepkt(_adapter *padapter, union recv_frame *precv_frame)
{
struct recv_priv *precvpriv;
_queue *pfree_recv_queue;
_pkt *skb;
struct sk_buff *skb;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
precvpriv = &(padapter->recvpriv);

View File

@ -866,7 +866,7 @@ u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
void usb_recv_tasklet(void *priv)
{
_pkt *pskb;
struct sk_buff *pskb;
_adapter *padapter = (_adapter *)priv;
struct recv_priv *precvpriv = &padapter->recvpriv;
struct recv_buf *precvbuf = NULL;
@ -1151,14 +1151,14 @@ int recvbuf2recvframe(PADAPTER padapter, void *ptr)
struct PHY_DM_STRUCT *p_dm = adapter_to_phydm(padapter);
struct recv_priv *precvpriv = &padapter->recvpriv;
_queue *pfree_recv_queue = &precvpriv->free_recv_queue;
_pkt *pskb;
struct sk_buff *pskb;
#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX
pskb = NULL;
transfer_len = (s32)((struct recv_buf *)ptr)->transfer_len;
pbuf = ((struct recv_buf *)ptr)->pbuf;
#else
pskb = (_pkt *)ptr;
pskb = (struct sk_buff *)ptr;
transfer_len = (s32)pskb->len;
pbuf = pskb->data;
#endif/* CONFIG_USE_USB_BUFFER_ALLOC_RX */

View File

@ -23,7 +23,7 @@ uint rtw_remainder_len(struct pkt_file *pfile)
return pfile->buf_len - ((SIZE_PTR)(pfile->cur_addr) - (SIZE_PTR)(pfile->buf_start));
}
void _rtw_open_pktfile(_pkt *pktptr, struct pkt_file *pfile)
void _rtw_open_pktfile(struct sk_buff *pktptr, struct pkt_file *pfile)
{
pfile->pkt = pktptr;
@ -63,7 +63,7 @@ sint rtw_endofpktfile(struct pkt_file *pfile)
return _FALSE;
}
void rtw_set_tx_chksum_offload(_pkt *pkt, struct pkt_attrib *pattrib)
void rtw_set_tx_chksum_offload(struct sk_buff *pkt, struct pkt_attrib *pattrib)
{
#ifdef CONFIG_TCP_CSUM_OFFLOAD_TX
@ -243,7 +243,7 @@ static inline bool rtw_os_need_stop_queue(_adapter *padapter, u16 qidx)
return _FALSE;
}
void rtw_os_pkt_complete(_adapter *padapter, _pkt *pkt)
void rtw_os_pkt_complete(_adapter *padapter, struct sk_buff *pkt)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
u16 qidx;
@ -300,17 +300,17 @@ void rtw_os_xmit_schedule(_adapter *padapter)
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
_exit_critical_bh(&pxmitpriv->lock, &irqL);
#if defined(CONFIG_PCI_HCI) && defined(CONFIG_XMIT_THREAD_MODE)
if (_rtw_queue_empty(&padapter->xmitpriv.pending_xmitbuf_queue) == _FALSE)
_rtw_up_sema(&padapter->xmitpriv.xmit_sema);
#endif
#endif
}
static bool rtw_check_xmit_resource(_adapter *padapter, _pkt *pkt)
static bool rtw_check_xmit_resource(_adapter *padapter, struct sk_buff *pkt)
{
bool busy = _FALSE;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
@ -440,7 +440,7 @@ int rtw_mlcst2unicst(_adapter *padapter, struct sk_buff *skb)
#endif /* CONFIG_TX_MCAST2UNI */
int _rtw_xmit_entry(_pkt *pkt, struct net_device *pnetdev)
int _rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev)
{
_adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev);
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
@ -513,7 +513,7 @@ exit:
return 0;
}
int rtw_xmit_entry(_pkt *pkt, struct net_device *pnetdev)
int rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev)
{
_adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);