1
0
Fork 0

staging: rtl8723au: Fold some resource allocation abstraction into their callers

Fold rtw_os_recvbuf_resource_alloc23a() and
rtw_os_recvbuf_resource_free23a() into the functions calling them.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wifi-calibration
Jes Sorensen 2014-04-15 19:44:42 +02:00 committed by Greg Kroah-Hartman
parent 09ae6d750c
commit f466c400e7
3 changed files with 7 additions and 35 deletions

View File

@ -65,8 +65,8 @@ int rtl8723au_init_recv_priv(struct rtw_adapter *padapter)
for (i = 0; i < NR_RECVBUFF; i++) {
INIT_LIST_HEAD(&precvbuf->list);
res = rtw_os_recvbuf_resource_alloc23a(padapter, precvbuf);
if (res == _FAIL)
precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL);
if (!precvbuf->purb)
break;
precvbuf->adapter = padapter;
@ -109,7 +109,11 @@ void rtl8723au_free_recv_priv(struct rtw_adapter *padapter)
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
for (i = 0; i < NR_RECVBUFF; i++) {
rtw_os_recvbuf_resource_free23a(padapter, precvbuf);
usb_free_urb(precvbuf->purb);
if (precvbuf->pskb)
dev_kfree_skb_any(precvbuf->pskb);
precvbuf++;
}

View File

@ -33,9 +33,6 @@ void rtw_free_recv_priv (struct recv_priv *precvpriv);
int rtw_os_recv_resource_init(struct recv_priv *precvpriv, struct rtw_adapter *padapter);
int rtw_os_recvbuf_resource_alloc23a(struct rtw_adapter *padapter, struct recv_buf *precvbuf);
int rtw_os_recvbuf_resource_free23a(struct rtw_adapter *padapter, struct recv_buf *precvbuf);
void rtw_init_recv_timer23a(struct recv_reorder_ctrl *preorder_ctrl);
#endif

View File

@ -24,35 +24,6 @@
#include <usb_ops.h>
/* alloc os related resource in struct recv_buf */
int rtw_os_recvbuf_resource_alloc23a(struct rtw_adapter *padapter,
struct recv_buf *precvbuf)
{
int res = _SUCCESS;
precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL);
if (precvbuf->purb == NULL)
res = _FAIL;
precvbuf->pskb = NULL;
return res;
}
/* free os related resource in struct recv_buf */
int rtw_os_recvbuf_resource_free23a(struct rtw_adapter *padapter,
struct recv_buf *precvbuf)
{
int ret = _SUCCESS;
usb_free_urb(precvbuf->purb);
if (precvbuf->pskb)
dev_kfree_skb_any(precvbuf->pskb);
return ret;
}
void rtw_handle_tkip_mic_err23a(struct rtw_adapter *padapter, u8 bgroup)
{
enum nl80211_key_type key_type = 0;