/******************************************************************************
*
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
pfile->pkt_len = pfile->buf_len = pktptr->len;
pfile->cur_buffer = pfile->buf_start ;
-
+
_func_exit_;
}
uint _rtw_pktfile_read (struct pkt_file *pfile, u8 *rmem, uint rlen)
-{
+{
uint len = 0;
-
+
_func_enter_;
len = rtw_remainder_len(pfile);
- len = (rlen > len)? len: rlen;
+ len = (rlen > len)? len: rlen;
if(rmem)
skb_copy_bits(pfile->pkt, pfile->buf_len-pfile->pkt_len, rmem, len);
pfile->cur_addr += len;
pfile->pkt_len -= len;
-
-_func_exit_;
- return len;
+_func_exit_;
+
+ return len;
}
sint rtw_endofpktfile(struct pkt_file *pfile)
#ifdef CONFIG_TCP_CSUM_OFFLOAD_TX
struct sk_buff *skb = (struct sk_buff *)pkt;
pattrib->hw_tcp_csum = 0;
-
+
if (skb->ip_summed == CHECKSUM_PARTIAL) {
if (skb_shinfo(skb)->nr_frags == 0)
- {
+ {
const struct iphdr *ip = ip_hdr(skb);
if (ip->protocol == IPPROTO_TCP) {
// TCP checksum offload by HW
//skb_checksum_help(skb);
} else if (ip->protocol == IPPROTO_UDP) {
//DBG_8723A("CHECKSUM_PARTIAL UDP\n");
-#if 1
+#if 1
skb_checksum_help(skb);
#else
// Set UDP checksum = 0 to skip checksum check
}
else { // IP fragmentation case
DBG_8723A("%s-%d nr_frags != 0, using skb_checksum_help(skb);!!\n", __FUNCTION__, __LINE__);
- skb_checksum_help(skb);
- }
+ skb_checksum_help(skb);
+ }
}
-#endif
-
+#endif
+
}
int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf,u32 alloc_sz)
if(pxmitbuf->pallocated_buf == NULL)
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;
}
#endif // CONFIG_USE_USB_BUFFER_ALLOC_TX
for(i=0; i<8; i++)
- {
- pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
- if(pxmitbuf->pxmit_urb[i] == NULL)
- {
- DBG_8723A("pxmitbuf->pxmit_urb[i]==NULL");
- return _FAIL;
- }
-
- }
+ {
+ pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
+ if(pxmitbuf->pxmit_urb[i] == NULL)
+ {
+ DBG_8723A("pxmitbuf->pxmit_urb[i]==NULL");
+ return _FAIL;
+ }
+
+ }
#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)
- {
+ pxmitbuf->pallocated_buf = kzalloc(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;
+ return _SUCCESS;
}
void rtw_os_xmit_resource_free(_adapter *padapter, struct xmit_buf *pxmitbuf,u32 free_sz)
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);
+ kfree(pxmitbuf->pallocated_buf);
#endif
}
{
if(pxframe->pkt)
{
- //RT_TRACE(_module_xmit_osdep_c_,_drv_err_,("linux : rtw_os_xmit_complete, dev_kfree_skb()\n"));
+ //RT_TRACE(_module_xmit_osdep_c_,_drv_err_,("linux : rtw_os_xmit_complete, dev_kfree_skb()\n"));
- //dev_kfree_skb_any(pxframe->pkt);
+ //dev_kfree_skb_any(pxframe->pkt);
rtw_os_pkt_complete(padapter, pxframe->pkt);
-
- }
+
+ }
pxframe->pkt = NULL;
}
#endif
if (_rtw_queue_empty(&pri_adapter->xmitpriv.pending_xmitbuf_queue) == _FALSE)
- _rtw_up_sema(&pri_adapter->xmitpriv.xmit_sema);
+ up(&pri_adapter->xmitpriv.xmit_sema);
#else
pxmitpriv = &padapter->xmitpriv;
- _enter_critical_bh(&pxmitpriv->lock, &irqL);
+ spin_lock_bh(&pxmitpriv->lock);
- if(rtw_txframes_pending(padapter))
+ if(rtw_txframes_pending(padapter))
{
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
}
- _exit_critical_bh(&pxmitpriv->lock, &irqL);
+ spin_unlock_bh(&pxmitpriv->lock);
#endif
}
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);
-
+
//free sta asoc_queue
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) {
int stainfo_offset;
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]);
if(!(psta->state &_FW_LINKED))
- 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
- )
+ continue;
+
+ /* avoid come from STA1 and send back STA1 */
+ 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__);
pxmitpriv->tx_drop++;
- dev_kfree_skb_any(newskb);
+ dev_kfree_skb_any(newskb);
} else
pxmitpriv->tx_pkts++;
} else {
#ifdef CONFIG_TX_MCAST2UNI
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
extern int rtw_mc2u_disable;
-#endif // CONFIG_TX_MCAST2UNI
+#endif // CONFIG_TX_MCAST2UNI
s32 res = 0;
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
u16 queue;
//DBG_8723A("Stop M2U(%d, %d)! ", pxmitpriv->free_xmitframe_cnt, pxmitpriv->free_xmitbuf_cnt);
//DBG_8723A("!m2u );
}
- }
-#endif // CONFIG_TX_MCAST2UNI
+ }
+#endif // CONFIG_TX_MCAST2UNI
res = rtw_xmit(padapter, &pkt);
if (res < 0) {
return 0;
}
-