#include <osdep_service.h>
#include <drv_types.h>
-#include <if_ether.h>
+#include <linux/if_ether.h>
#include <ip.h>
#include <wifi.h>
#include <mlme_osdep.h>
uint rtw_remainder_len(struct pkt_file *pfile)
{
- return (pfile->buf_len - ((SIZE_PTR)(pfile->cur_addr) - (SIZE_PTR)(pfile->buf_start)));
+ return (pfile->buf_len - ((unsigned long)(pfile->cur_addr) - (unsigned long)(pfile->buf_start)));
}
void _rtw_open_pktfile (_pkt *pktptr, struct pkt_file *pfile)
return len;
}
-sint rtw_endofpktfile(struct pkt_file *pfile)
+int rtw_endofpktfile(struct pkt_file *pfile)
{
_func_enter_;
int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf,u32 alloc_sz)
{
-#ifdef CONFIG_USB_HCI
int i;
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
struct usb_device *pusbd = pdvobjpriv->pusbdev;
return _FAIL;
#else // CONFIG_USE_USB_BUFFER_ALLOC_TX
- pxmitbuf->pallocated_buf = rtw_zmalloc(alloc_sz);
- if (pxmitbuf->pallocated_buf == NULL)
- {
+ pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL);
+ if (pxmitbuf->pallocated_buf == NULL) {
return _FAIL;
}
- pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ);
+ pxmitbuf->pbuf = PTR_ALIGN(pxmitbuf->pallocated_buf, XMITBUF_ALIGN_SZ);
pxmitbuf->dma_transfer_addr = 0;
#endif // CONFIG_USE_USB_BUFFER_ALLOC_TX
}
}
-#endif
-#if defined(CONFIG_PCI_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
- pxmitbuf->pallocated_buf = rtw_zmalloc(alloc_sz);
- if (pxmitbuf->pallocated_buf == NULL)
- {
- return _FAIL;
- }
-
- pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ);
-#endif
-
return _SUCCESS;
}
void rtw_os_xmit_resource_free(_adapter *padapter, struct xmit_buf *pxmitbuf,u32 free_sz)
{
-#ifdef CONFIG_USB_HCI
int i;
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
struct usb_device *pusbd = pdvobjpriv->pusbdev;
-
for(i=0; i<8; i++)
{
if(pxmitbuf->pxmit_urb[i])
pxmitbuf->dma_transfer_addr = 0;
#else // CONFIG_USE_USB_BUFFER_ALLOC_TX
if(pxmitbuf->pallocated_buf)
- rtw_mfree(pxmitbuf->pallocated_buf, free_sz);
+ kfree(pxmitbuf->pallocated_buf);
#endif // CONFIG_USE_USB_BUFFER_ALLOC_TX
-#endif
-#if defined(CONFIG_PCI_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
- if(pxmitbuf->pallocated_buf)
- rtw_mfree(pxmitbuf->pallocated_buf, free_sz);
-#endif
}
#define WMM_XMIT_THRESHOLD (NR_XMITFRAME*2/5)
void rtw_os_xmit_schedule(_adapter *padapter)
{
_adapter *pri_adapter = padapter;
-
-#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
- if(!padapter)
- return;
-
-#ifdef CONFIG_CONCURRENT_MODE
- if(padapter->adapter_type > PRIMARY_ADAPTER)
- pri_adapter = padapter->pbuddy_adapter;
-#endif
-
- if (_rtw_queue_empty(&pri_adapter->xmitpriv.pending_xmitbuf_queue) == _FALSE)
- _rtw_up_sema(&pri_adapter->xmitpriv.xmit_sema);
-
-
-#else
_irqL irqL;
struct xmit_priv *pxmitpriv;
pxmitpriv = &padapter->xmitpriv;
- _enter_critical_bh(&pxmitpriv->lock, &irqL);
+ spin_lock_bh(&pxmitpriv->lock);
if(rtw_txframes_pending(padapter))
{
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
}
- _exit_critical_bh(&pxmitpriv->lock, &irqL);
-#endif
+ spin_unlock_bh(&pxmitpriv->lock);
}
static void rtw_check_xmit_resource(_adapter *padapter, _pkt *pkt)
int i;
s32 res;
- _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
+ spin_lock_bh(&pstapriv->asoc_list_lock);
phead = &pstapriv->asoc_list;
plist = get_next(phead);
chk_alive_list[chk_alive_num++] = stainfo_offset;
}
}
- _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
+ spin_unlock_bh(&pstapriv->asoc_list_lock);
for (i = 0; i < chk_alive_num; i++) {
psta = rtw_get_stainfo_by_offset(pstapriv, chk_alive_list[i]);
continue;
/* avoid come from STA1 and send back STA1 */
- if (_rtw_memcmp(psta->hwaddr, &skb->data[6], 6) == _TRUE
- || _rtw_memcmp(psta->hwaddr, null_addr, 6) == _TRUE
- || _rtw_memcmp(psta->hwaddr, bc_addr, 6) == _TRUE
- )
+ if (!memcmp(psta->hwaddr, &skb->data[6], 6) ||
+ !memcmp(psta->hwaddr, null_addr, 6) ||
+ !memcmp(psta->hwaddr, bc_addr, 6))
continue;
newskb = skb_copy(skb, GFP_ATOMIC);
if (newskb) {
- _rtw_memcpy(newskb->data, psta->hwaddr, 6);
+ memcpy(newskb->data, psta->hwaddr, 6);
res = rtw_xmit(padapter, &newskb);
if (res < 0) {
DBG_8723A("%s()-%d: rtw_xmit() return error!\n", __FUNCTION__, __LINE__);