staging: r8188eu: migrate os_dep/xmit_linux.c
cover staging: r8188eu: migrate os_dep/xmit_linux.c
This series moves the functions, or their functionality, from os_dep/xmit_linux.c to the core/* part of the driver and finally removes os_dep/xmit_linux.c and the xmit_osdep.h header.
Tested on x86_64 with Inter-Tech DMG-02.
Please apply this on top of:
[PATCH] staging: r8188eu: remove rtw_endofpktfile()
Thanks,
Michael
Michael Straube (19):
staging: r8188eu: make rtw_remainder_len() static
staging: r8188eu: make rtw_os_xmit_schedule() static
staging: r8188eu: rename rtw_os_xmit_schedule()
staging: r8188eu: make rtw_os_xmit_resource_alloc() static
staging: r8188eu: rename rtw_os_xmit_resource_alloc()
staging: r8188eu: make rtw_os_xmit_resource_free() static
staging: r8188eu: rename rtw_os_xmit_resource_free()
staging: r8188eu: make _rtw_open_pktfile() static
staging: r8188eu: rename _rtw_open_pktfile()
staging: r8188eu: make _rtw_pktfile_read() static
staging: r8188eu: rename _rtw_pktfile_read()
staging: r8188eu: remove unnecessary initialization to zero
staging: r8188eu: move struct pkt_file to rtw_xmit.h
staging: r8188eu: move rtw_os_xmit_complete() to rtw_xmit.c
staging: r8188eu: rename rtw_os_xmit_complete()
staging: r8188eu: make rtw_os_pkt_complete() static
staging: r8188eu: rename rtw_os_pkt_complete()
staging: r8188eu: remove os_dep/xmit_linux.c
staging: r8188eu: remove xmit_osdep.h
drivers/staging/r8188eu/Makefile | 1 - drivers/staging/r8188eu/core/rtw_mlme.c | 23 +- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 2 +- drivers/staging/r8188eu/core/rtw_sta_mgt.c | 1 - drivers/staging/r8188eu/core/rtw_xmit.c | 232 +++++++++++++++++-- drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 4 +- drivers/staging/r8188eu/include/rtw_xmit.h | 16 +- drivers/staging/r8188eu/include/xmit_osdep.h | 48 ---- drivers/staging/r8188eu/os_dep/os_intfs.c | 7 +- drivers/staging/r8188eu/os_dep/usb_intf.c | 1 - drivers/staging/r8188eu/os_dep/xmit_linux.c | 226 ------------------ 11 files changed, 251 insertions(+), 310 deletions(-) delete mode 100644 drivers/staging/r8188eu/include/xmit_osdep.h delete mode 100644 drivers/staging/r8188eu/os_dep/xmit_linux.c
Signature · 1 line
2.37.2
PATCH 1/19 staging: r8188eu: make rtw_remainder_len() static
The function rtw_remainder_len() is only used in xmit_linux.c. Make it static.
--- drivers/staging/r8188eu/include/xmit_osdep.h | 1 - drivers/staging/r8188eu/os_dep/xmit_linux.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/staging/r8188eu/include/xmit_osdep.h +0 -1
@@ -37,7 +37,6 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter,void rtw_os_xmit_resource_free (struct adapter *padapter,struct xmit_buf *pxmitbuf,u32 free_sz); -uint rtw_remainder_len (struct pkt_file *pfile);void _rtw_open_pktfile (struct sk_buff *pkt,struct pkt_file *pfile);uint _rtw_pktfile_read (struct pkt_file *pfile,u8 *rmem,uint rlen);
drivers/staging/r8188eu/os_dep/xmit_linux.c +1 -1
@@ -11,7 +11,7 @@#include "../include/osdep_intf.h" #include "../include/usb_osintf.h" -uint rtw_remainder_len (struct pkt_file *pfile) +static uint rtw_remainder_len (struct pkt_file *pfile) {return pfile->buf_len - ((size_t )(pfile->cur_addr) - (size_t )(pfile->buf_start));
Signature · 1 line
2.37.2
Re: [PATCH 01/19] staging: r8188eu: make rtw_remainder_len() static
Quoted 26 lines · Michael Straube
The function
rtw_remainder_len()is only used inxmit_linux.c. Make it static.Signed-off-by Michael Straube <[email protected]>--- drivers/staging/r8188eu/include/xmit_osdep.h | 1 - drivers/staging/r8188eu/os_dep/xmit_linux.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)drivers/staging/r8188eu/include/xmit_osdep.h +0
-1@@ -37,7 +37,6 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter,void rtw_os_xmit_resource_free (struct adapter *padapter,struct xmit_buf *pxmitbuf,u32 free_sz); -uint rtw_remainder_len (struct pkt_file *pfile);void _rtw_open_pktfile (struct sk_buff *pkt,struct pkt_file *pfile);uint _rtw_pktfile_read (struct pkt_file *pfile,u8 *rmem,uint rlen);drivers/staging/r8188eu/os_dep/xmit_linux.c +0
-0
drivers/staging/r8188eu/os_dep/xmit_linux.c line 17
Quoted 8 lines
drivers/staging/r8188eu/os_dep/xmit_linux.c +1
-1@@ -11,7 +11,7 @@#include "../include/osdep_intf.h" #include "../include/usb_osintf.h" -uint rtw_remainder_len (struct pkt_file *pfile) +static uint rtw_remainder_len (struct pkt_file *pfile) {return pfile->buf_len - ((size_t )(pfile->cur_addr) - (size_t )(pfile->buf_start));
Hi Michael,
cannot apply your patch on top of the patch series(11), [PATCH] staging: r8188eu: remove ODM_ConfigRFWithHeaderFile()
cat ~/Downloads/\[PATCH\ 01_19\]\ staging\ r8188eu\ make\ rtw_remainder_len\(\)\ static.eml | git am
Applying: staging: r8188eu: make rtw_remainder_len() static
error: patch failed: drivers/staging/r8188eu/include/xmit_osdep.h:37
error: drivers/staging/r8188eu/include/xmit_osdep.h: patch does not apply
Patch failed at 0001 staging: r8188eu: make rtw_remainder_len() static
It looks like it should fit but it does not. Have you changed something manual in the patch?
Thanks for your support.
Bye Philipp
Re: [PATCH 01/19] staging: r8188eu: make rtw_remainder_len() static
Quoted 45 lines · Philipp Hortmann
Quoted 30 lines · Michael Straube
The function
rtw_remainder_len()is only used inxmit_linux.c. Make it static.Signed-off-by Michael Straube <[email protected]>---
drivers/staging/r8188eu/include/xmit_osdep.h| 1 - drivers/staging/r8188eu/os_dep/xmit_linux.c | 2 +-2 files changed, 1 insertion(+), 2 deletions(-)drivers/staging/r8188eu/include/xmit_osdep.h +0
-1@@ -37,7 +37,6 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, void rtw_os_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 free_sz); -uint rtw_remainder_len (struct pkt_file *pfile); void _rtw_open_pktfile(struct sk_buff *pkt, struct pkt_file *pfile); uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen);drivers/staging/r8188eu/os_dep/xmit_linux.c +1
-1@@ -11,7 +11,7 @@ #include "../include/osdep_intf.h" #include "../include/usb_osintf.h" -uint rtw_remainder_len (struct pkt_file *pfile) +static uint rtw_remainder_len (struct pkt_file *pfile) {Quoted 2 lines
return
pfile->buf_len- ((size_t)(pfile->cur_addr) - (size_t)(pfile->buf_start));Hi Michael,
cannot apply your patch on top of the patch series(11), [PATCH] staging: r8188eu: remove
ODM_ConfigRFWithHeaderFile()cat ~/Downloads/\[PATCH\ 01_19\]\ staging\ r8188eu\ make\ rtw_remainder_len\(\)\ static.eml | git am
Applying: staging: r8188eu: makertw_remainder_len()static
error: patch failed:drivers/staging/r8188eu/include/xmit_osdep.h:37
error:drivers/staging/r8188eu/include/xmit_osdep.h: patch does not apply
Patch failed at 0001 staging: r8188eu: makertw_remainder_len()static
Quoted 6 lines
It looks like it should fit but it does not. Have you changed something manual in the patch?
Thanks for your support.
Bye Philipp
Hi Philipp,
looks like you didn't apply
[PATCH] staging: r8188eu: remove rtw_endofpktfile()
first. On top of that it should work.
I mentioned that in the cover letter. ;)
thanks,
Michael
PATCH 2/19 staging: r8188eu: make rtw_os_xmit_schedule() static
In reply to Michael StraubeThe function rtw_os_xmit_schedule() is only used in rtw_mlme.c. Make it static.
--- drivers/staging/r8188eu/core/rtw_mlme.c | 17 +++++++++++++++++ drivers/staging/r8188eu/include/xmit_osdep.h | 2 -- drivers/staging/r8188eu/os_dep/xmit_linux.c | 17 ----------------- 3 files changed, 17 insertions(+), 19 deletions(-)
drivers/staging/r8188eu/core/rtw_mlme.c +17 -0
@@ -641,6 +641,23 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf)spin_unlock_bh (&pmlmepriv->lock); } +static void rtw_os_xmit_schedule (struct adapter *padapter) +{ +struct xmit_priv *pxmitpriv; + +if (!padapter) +return ; + + pxmitpriv = &padapter->xmitpriv; + +spin_lock_bh (&pxmitpriv->lock); + +if (rtw_txframes_pending (padapter)) +tasklet_hi_schedule (&pxmitpriv->xmit_tasklet); + +spin_unlock_bh (&pxmitpriv->lock); +} +void rtw_surveydone_event_callback (struct adapter *adapter,u8 *pbuf) {struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
drivers/staging/r8188eu/include/xmit_osdep.h +0 -2
@@ -30,8 +30,6 @@ struct xmit_buf;int rtw_xmit_entry (struct sk_buff *pkt,struct net_device *pnetdev); -void rtw_os_xmit_schedule (struct adapter *padapter); -int rtw_os_xmit_resource_alloc (struct adapter *padapter,struct xmit_buf *pxmitbuf,u32 alloc_sz); void rtw_os_xmit_resource_free(struct adapter *padapter,
drivers/staging/r8188eu/os_dep/xmit_linux.c +0 -17
@@ -105,23 +105,6 @@ void rtw_os_xmit_complete(struct adapter *padapter, struct xmit_frame *pxframe) pxframe->pkt =NULL ; } -void rtw_os_xmit_schedule (struct adapter *padapter) -{ -struct xmit_priv *pxmitpriv; - -if (!padapter) -return ; - - pxmitpriv = &padapter->xmitpriv; - -spin_lock_bh (&pxmitpriv->lock); - -if (rtw_txframes_pending (padapter)) -tasklet_hi_schedule (&pxmitpriv->xmit_tasklet); - -spin_unlock_bh (&pxmitpriv->lock); -} -static void rtw_check_xmit_resource (struct adapter *padapter,struct sk_buff *pkt) {struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
Signature · 1 line
2.37.2
PATCH 3/19 staging: r8188eu: rename rtw_os_xmit_schedule()
In reply to Michael StraubeThe function rtw_os_xmit_schedule() was moved from the os_dep directory. It looks like the driver was originaly written to support different operating systems. Obviously we do not need an extra 'os' in the function name that indicates that the function is operating system specific. Rename it to rtw_xmit_schedule().
--- drivers/staging/r8188eu/core/rtw_mlme.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/staging/r8188eu/core/rtw_mlme.c +3 -4
@@ -641,7 +641,7 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf)spin_unlock_bh (&pmlmepriv->lock); } -static void rtw_os_xmit_schedule (struct adapter *padapter) +static void rtw_xmit_schedule (struct adapter *padapter) {struct xmit_priv *pxmitpriv;
@@ -736,7 +736,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)if (check_fwstate (pmlmepriv, _FW_LINKED))p2p_ps_wk_cmd (adapter,P2P_PS_SCAN_DONE ,0 ); -rtw_os_xmit_schedule (adapter); +rtw_xmit_schedule (adapter); }static void free_scanqueue (struct mlme_priv *pmlmepriv)
@@ -1134,8 +1134,7 @@ void rtw_joinbss_event_callback(struct adapter *adapter, u8 *pbuf)mlmeext_joinbss_event_callback (adapter, pnetwork->join_res); -rtw_os_xmit_schedule (adapter); - +rtw_xmit_schedule (adapter); }void rtw_set_max_rpt_macid (struct adapter *adapter,u8 macid)
Signature · 1 line
2.37.2
PATCH 4/19 staging: r8188eu: make rtw_os_xmit_resource_alloc() static
In reply to Michael StraubeThe function rtw_os_xmit_resource_alloc() is only used in rtw_xmit.c. Make it static.
--- drivers/staging/r8188eu/core/rtw_xmit.c | 17 +++++++++++++++++ drivers/staging/r8188eu/include/xmit_osdep.h | 2 -- drivers/staging/r8188eu/os_dep/xmit_linux.c | 16 ---------------- 3 files changed, 17 insertions(+), 18 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +17 -0
@@ -33,6 +33,23 @@ void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv)INIT_LIST_HEAD (&psta_xmitpriv->apsd); } +static int rtw_os_xmit_resource_alloc (struct adapter *padapter,struct xmit_buf *pxmitbuf, +u32 alloc_sz) +{ + pxmitbuf->pallocated_buf =kzalloc (alloc_sz,GFP_KERNEL ); +if (!pxmitbuf->pallocated_buf) +return _FAIL; + + pxmitbuf->pbuf = (u8 *)ALIGN ((size_t )(pxmitbuf->pallocated_buf),XMITBUF_ALIGN_SZ ); + pxmitbuf->dma_transfer_addr =0 ; + + pxmitbuf->pxmit_urb =usb_alloc_urb (0 ,GFP_KERNEL ); +if (!pxmitbuf->pxmit_urb) +return _FAIL; + +return _SUCCESS; +} +s32 _rtw_init_xmit_priv (struct xmit_priv *pxmitpriv,struct adapter *padapter) {int i;
drivers/staging/r8188eu/include/xmit_osdep.h +0 -2
@@ -30,8 +30,6 @@ struct xmit_buf;int rtw_xmit_entry (struct sk_buff *pkt,struct net_device *pnetdev); -int rtw_os_xmit_resource_alloc (struct adapter *padapter, -struct xmit_buf *pxmitbuf,u32 alloc_sz);void rtw_os_xmit_resource_free (struct adapter *padapter,struct xmit_buf *pxmitbuf,u32 free_sz);
drivers/staging/r8188eu/os_dep/xmit_linux.c +0 -16
@@ -54,22 +54,6 @@ uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen)return len; } -int rtw_os_xmit_resource_alloc (struct adapter *padapter,struct xmit_buf *pxmitbuf,u32 alloc_sz) -{ - pxmitbuf->pallocated_buf =kzalloc (alloc_sz,GFP_KERNEL ); -if (!pxmitbuf->pallocated_buf) -return _FAIL; - - pxmitbuf->pbuf = (u8 *)ALIGN ((size_t )(pxmitbuf->pallocated_buf),XMITBUF_ALIGN_SZ ); - pxmitbuf->dma_transfer_addr =0 ; - - pxmitbuf->pxmit_urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (!pxmitbuf->pxmit_urb) -return _FAIL; - -return _SUCCESS; -} -void rtw_os_xmit_resource_free (struct adapter *padapter,struct xmit_buf *pxmitbuf,u32 free_sz) {
Signature · 1 line
2.37.2
PATCH 5/19 staging: r8188eu: rename rtw_os_xmit_resource_alloc()
In reply to Michael StraubeThe function rtw_os_xmit_resource_alloc() was moved from the os_dep directory. It looks like the driver was originaly written to support different operating systems. Obviously we do not need an extra 'os' in the function name that indicates that the function is operating system specific. Rename it to rtw_xmit_resource_alloc().
--- drivers/staging/r8188eu/core/rtw_xmit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +5 -5
@@ -33,8 +33,8 @@ void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv)INIT_LIST_HEAD (&psta_xmitpriv->apsd); } -static int rtw_os_xmit_resource_alloc (struct adapter *padapter,struct xmit_buf *pxmitbuf, -u32 alloc_sz) +static int rtw_xmit_resource_alloc (struct adapter *padapter,struct xmit_buf *pxmitbuf, +u32 alloc_sz) { pxmitbuf->pallocated_buf =kzalloc (alloc_sz,GFP_KERNEL );if (!pxmitbuf->pallocated_buf)
@@ -142,10 +142,10 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitbuf->ext_tag = false;/* Tx buf allocation may fail sometimes, so sleep and retry. */ - res =rtw_os_xmit_resource_alloc (padapter, pxmitbuf, (MAX_XMITBUF_SZ +XMITBUF_ALIGN_SZ )); + res =rtw_xmit_resource_alloc (padapter, pxmitbuf, (MAX_XMITBUF_SZ +XMITBUF_ALIGN_SZ ));if (res == _FAIL) {msleep (10 ); - res =rtw_os_xmit_resource_alloc (padapter, pxmitbuf, (MAX_XMITBUF_SZ +XMITBUF_ALIGN_SZ )); + res =rtw_xmit_resource_alloc (padapter, pxmitbuf, (MAX_XMITBUF_SZ +XMITBUF_ALIGN_SZ ));if (res == _FAIL) goto exit; }
@@ -179,7 +179,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitbuf->padapter = padapter; pxmitbuf->ext_tag = true; - res =rtw_os_xmit_resource_alloc (padapter, pxmitbuf, max_xmit_extbuf_size +XMITBUF_ALIGN_SZ ); + res =rtw_xmit_resource_alloc (padapter, pxmitbuf, max_xmit_extbuf_size +XMITBUF_ALIGN_SZ );if (res == _FAIL) { res = _FAIL; goto exit;
Signature · 1 line
2.37.2
PATCH 6/19 staging: r8188eu: make rtw_os_xmit_resource_free() static
In reply to Michael StraubeThe function rtw_os_xmit_resource_free() is only used in rtw_xmit.c. Make it static.
--- drivers/staging/r8188eu/core/rtw_xmit.c | 7 +++++++ drivers/staging/r8188eu/include/xmit_osdep.h | 3 --- drivers/staging/r8188eu/os_dep/xmit_linux.c | 8 -------- 3 files changed, 7 insertions(+), 11 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +7 -0
@@ -50,6 +50,13 @@ static int rtw_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxreturn _SUCCESS; } +static void rtw_os_xmit_resource_free (struct adapter *padapter,struct xmit_buf *pxmitbuf, +u32 free_sz) +{ +usb_free_urb (pxmitbuf->pxmit_urb); +kfree (pxmitbuf->pallocated_buf); +} +s32 _rtw_init_xmit_priv (struct xmit_priv *pxmitpriv,struct adapter *padapter) {int i;
drivers/staging/r8188eu/include/xmit_osdep.h +0 -3
@@ -30,9 +30,6 @@ struct xmit_buf;int rtw_xmit_entry (struct sk_buff *pkt,struct net_device *pnetdev); -void rtw_os_xmit_resource_free (struct adapter *padapter, -struct xmit_buf *pxmitbuf,u32 free_sz); -void _rtw_open_pktfile (struct sk_buff *pkt,struct pkt_file *pfile);uint _rtw_pktfile_read (struct pkt_file *pfile,u8 *rmem,uint rlen);
drivers/staging/r8188eu/os_dep/xmit_linux.c +0 -8
@@ -54,14 +54,6 @@ uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen)return len; } -void rtw_os_xmit_resource_free (struct adapter *padapter, -struct xmit_buf *pxmitbuf,u32 free_sz) -{ -usb_free_urb (pxmitbuf->pxmit_urb); - -kfree (pxmitbuf->pallocated_buf); -} -#define WMM_XMIT_THRESHOLD (NR_XMITFRAME * 2 / 5)void rtw_os_pkt_complete (struct adapter *padapter,struct sk_buff *pkt)
Signature · 1 line
2.37.2
PATCH 7/19 staging: r8188eu: rename rtw_os_xmit_resource_free()
In reply to Michael StraubeThe function rtw_os_xmit_resource_free() was moved from the os_dep directory. It looks like the driver was originaly written to support different operating systems. Obviously we do not need an extra 'os' in the function name that indicates that the function is operating system specific. Rename it to rtw_xmit_resource_free().
--- drivers/staging/r8188eu/core/rtw_xmit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +4 -4
@@ -50,8 +50,8 @@ static int rtw_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxreturn _SUCCESS; } -static void rtw_os_xmit_resource_free (struct adapter *padapter,struct xmit_buf *pxmitbuf, -u32 free_sz) +static void rtw_xmit_resource_free (struct adapter *padapter,struct xmit_buf *pxmitbuf, +u32 free_sz) {usb_free_urb (pxmitbuf->pxmit_urb);kfree (pxmitbuf->pallocated_buf);
@@ -248,7 +248,7 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) }for (i =0 ; i <NR_XMITBUFF ; i++) { -rtw_os_xmit_resource_free (padapter, pxmitbuf, (MAX_XMITBUF_SZ +XMITBUF_ALIGN_SZ )); +rtw_xmit_resource_free (padapter, pxmitbuf, (MAX_XMITBUF_SZ +XMITBUF_ALIGN_SZ )); pxmitbuf++; }
@@ -258,7 +258,7 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf;for (i =0 ; i < num_xmit_extbuf; i++) { -rtw_os_xmit_resource_free (padapter, pxmitbuf, (max_xmit_extbuf_size +XMITBUF_ALIGN_SZ )); +rtw_xmit_resource_free (padapter, pxmitbuf, (max_xmit_extbuf_size +XMITBUF_ALIGN_SZ )); pxmitbuf++; }
Signature · 1 line
2.37.2
PATCH 8/19 staging: r8188eu: make _rtw_open_pktfile() static
In reply to Michael StraubeThe function _rtw_open_pktfile() is only used in rtw_xmit.c. Make it static.
--- drivers/staging/r8188eu/core/rtw_xmit.c | 19 ++++++++++++++++++ drivers/staging/r8188eu/include/xmit_osdep.h | 1 - drivers/staging/r8188eu/os_dep/xmit_linux.c | 21 -------------------- 3 files changed, 19 insertions(+), 22 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +19 -0
@@ -402,6 +402,25 @@ u8 qos_acm(u8 acm_mask, u8 priority)return change_priority; } +static void _rtw_open_pktfile (struct sk_buff *pktptr,struct pkt_file *pfile) +{ +if (!pktptr) { +pr_err ("8188eu: pktptr is NULL\n" ); +return ; + } +if (!pfile) { +pr_err ("8188eu: pfile is NULL\n" ); +return ; + } + pfile->pkt = pktptr; + pfile->cur_addr = pktptr->data; + pfile->buf_start = pktptr->data; + pfile->pkt_len = pktptr->len; + pfile->buf_len = pktptr->len; + + pfile->cur_buffer = pfile->buf_start; +} +static void set_qos (struct pkt_file *ppktfile,struct pkt_attrib *pattrib) {struct ethhdr etherhdr;
drivers/staging/r8188eu/include/xmit_osdep.h +0 -1
@@ -30,7 +30,6 @@ struct xmit_buf;int rtw_xmit_entry (struct sk_buff *pkt,struct net_device *pnetdev); -void _rtw_open_pktfile (struct sk_buff *pkt,struct pkt_file *pfile);uint _rtw_pktfile_read (struct pkt_file *pfile,u8 *rmem,uint rlen);void rtw_os_pkt_complete (struct adapter *padapter,struct sk_buff *pkt);
drivers/staging/r8188eu/os_dep/xmit_linux.c +0 -21
@@ -17,27 +17,6 @@ static uint rtw_remainder_len(struct pkt_file *pfile) (size_t)(pfile->buf_start)); } -void _rtw_open_pktfile (struct sk_buff *pktptr,struct pkt_file *pfile) -{ - -if (!pktptr) { -pr_err ("8188eu: pktptr is NULL\n" ); -return ; - } -if (!pfile) { -pr_err ("8188eu: pfile is NULL\n" ); -return ; - } - pfile->pkt = pktptr; - pfile->cur_addr = pktptr->data; - pfile->buf_start = pktptr->data; - pfile->pkt_len = pktptr->len; - pfile->buf_len = pktptr->len; - - pfile->cur_buffer = pfile->buf_start; - -} -uint _rtw_pktfile_read (struct pkt_file *pfile,u8 *rmem,uint rlen) {uint len =0 ;
Signature · 1 line
2.37.2
PATCH 9/19 staging: r8188eu: rename _rtw_open_pktfile()
In reply to Michael StraubeThere is no need to prefix the function name of _rtw_open_pktfile() with an underscore. Rename it to rtw_open_pktfile().
--- drivers/staging/r8188eu/core/rtw_xmit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +4 -4
@@ -402,7 +402,7 @@ u8 qos_acm(u8 acm_mask, u8 priority)return change_priority; } -static void _rtw_open_pktfile (struct sk_buff *pktptr,struct pkt_file *pfile) +static void rtw_open_pktfile (struct sk_buff *pktptr,struct pkt_file *pfile) {if (!pktptr) {pr_err ("8188eu: pktptr is NULL\n" );
@@ -427,7 +427,7 @@ static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib)struct iphdr ip_hdr;s32 user_prio =0 ; -_rtw_open_pktfile (ppktfile->pkt, ppktfile); +rtw_open_pktfile (ppktfile->pkt, ppktfile);_rtw_pktfile_read (ppktfile, (unsigned char *)ðerhdr,ETH_HLEN );/* get user_prio from IP hdr */
@@ -461,7 +461,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p -_rtw_open_pktfile (pkt, &pktfile); +rtw_open_pktfile (pkt, &pktfile);_rtw_pktfile_read (&pktfile, (u8 *)ðerhdr,ETH_HLEN ); pattrib->ether_type =ntohs (etherhdr.h_proto);
@@ -940,7 +940,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct goto exit; } -_rtw_open_pktfile (pkt, &pktfile); +rtw_open_pktfile (pkt, &pktfile);_rtw_pktfile_read (&pktfile,NULL , pattrib->pkt_hdrlen); frg_inx =0 ;
Signature · 1 line
2.37.2
PATCH 10/19 staging: r8188eu: make _rtw_pktfile_read() static
In reply to Michael StraubeThe function _rtw_pktfile_read() is only used in rtw_xmit.c. Make it static.
--- drivers/staging/r8188eu/core/rtw_xmit.c | 22 ++++++++++++++++++++ drivers/staging/r8188eu/include/xmit_osdep.h | 2 -- drivers/staging/r8188eu/os_dep/xmit_linux.c | 22 -------------------- 3 files changed, 22 insertions(+), 24 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +22 -0
@@ -421,6 +421,28 @@ static void rtw_open_pktfile(struct sk_buff *pktptr, struct pkt_file *pfile) pfile->cur_buffer = pfile->buf_start; } +static uint rtw_remainder_len (struct pkt_file *pfile) +{ +return pfile->buf_len - ((size_t )(pfile->cur_addr) - + (size_t )(pfile->buf_start)); +} + +static uint _rtw_pktfile_read (struct pkt_file *pfile,u8 *rmem,uint rlen) +{ +uint len =0 ; + + len =rtw_remainder_len (pfile); + 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; + +return len; +} +static void set_qos (struct pkt_file *ppktfile,struct pkt_attrib *pattrib) {struct ethhdr etherhdr;
drivers/staging/r8188eu/include/xmit_osdep.h +0 -2
@@ -30,8 +30,6 @@ struct xmit_buf;int rtw_xmit_entry (struct sk_buff *pkt,struct net_device *pnetdev); -uint _rtw_pktfile_read (struct pkt_file *pfile,u8 *rmem,uint rlen); -void rtw_os_pkt_complete (struct adapter *padapter,struct sk_buff *pkt);void rtw_os_xmit_complete (struct adapter *padapter,struct xmit_frame *pxframe);
drivers/staging/r8188eu/os_dep/xmit_linux.c +0 -22
@@ -11,28 +11,6 @@#include "../include/osdep_intf.h" #include "../include/usb_osintf.h" -static uint rtw_remainder_len (struct pkt_file *pfile) -{ -return pfile->buf_len - ((size_t )(pfile->cur_addr) - - (size_t )(pfile->buf_start)); -} - -uint _rtw_pktfile_read (struct pkt_file *pfile,u8 *rmem,uint rlen) -{ -uint len =0 ; - - len =rtw_remainder_len (pfile); - 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; - -return len; -} -#define WMM_XMIT_THRESHOLD (NR_XMITFRAME * 2 / 5)void rtw_os_pkt_complete (struct adapter *padapter,struct sk_buff *pkt)
Signature · 1 line
2.37.2
PATCH 11/19 staging: r8188eu: rename _rtw_pktfile_read()
In reply to Michael StraubeThere is no need to prefix the function name of _rtw_pktfile_read() with an underscore. Rename it to rtw_pktfile_read().
--- drivers/staging/r8188eu/core/rtw_xmit.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +8 -8
@@ -427,7 +427,7 @@ static uint rtw_remainder_len(struct pkt_file *pfile) (size_t)(pfile->buf_start)); } -static uint _rtw_pktfile_read (struct pkt_file *pfile,u8 *rmem,uint rlen) +static uint rtw_pktfile_read (struct pkt_file *pfile,u8 *rmem,uint rlen) {uint len =0 ;
@@ -450,11 +450,11 @@ static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib)s32 user_prio =0 ;rtw_open_pktfile (ppktfile->pkt, ppktfile); -_rtw_pktfile_read (ppktfile, (unsigned char *)ðerhdr,ETH_HLEN ); +rtw_pktfile_read (ppktfile, (unsigned char *)ðerhdr,ETH_HLEN );/* get user_prio from IP hdr */ if (pattrib->ether_type ==0x0800 ) { -_rtw_pktfile_read (ppktfile, (u8 *)&ip_hdr,sizeof (ip_hdr)); +rtw_pktfile_read (ppktfile, (u8 *)&ip_hdr,sizeof (ip_hdr));/* user_prio = (ntohs(ip_hdr.tos) >> 5) & 0x3; */ user_prio = ip_hdr.tos >>5 ; }else if (pattrib->ether_type ==0x888e ) {
@@ -484,7 +484,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct prtw_open_pktfile (pkt, &pktfile); -_rtw_pktfile_read (&pktfile, (u8 *)ðerhdr,ETH_HLEN ); +rtw_pktfile_read (&pktfile, (u8 *)ðerhdr,ETH_HLEN ); pattrib->ether_type =ntohs (etherhdr.h_proto);
@@ -512,7 +512,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p/* to prevent DHCP protocol fail */ u8 tmp[24 ]; -_rtw_pktfile_read (&pktfile, &tmp[0 ],24 ); +rtw_pktfile_read (&pktfile, &tmp[0 ],24 ); pattrib->dhcp_pkt =0 ;if (pktfile.pkt_len >282 ) {/* MINIMUM_DHCP_PACKET_SIZE) { */ if (((tmp[21] == 68) && (tmp[23] == 67)) ||
@@ -963,7 +963,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct }rtw_open_pktfile (pkt, &pktfile); -_rtw_pktfile_read (&pktfile,NULL , pattrib->pkt_hdrlen); +rtw_pktfile_read (&pktfile,NULL , pattrib->pkt_hdrlen); frg_inx =0 ; frg_len = pxmitpriv->frag_len -4 ;/* 2346-4 = 2342 */
@@ -1021,9 +1021,9 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, structif (bmcst) {/* don't do fragment to broadcast/multicast packets */ - mem_sz =_rtw_pktfile_read (&pktfile, pframe, pattrib->pktlen); + mem_sz =rtw_pktfile_read (&pktfile, pframe, pattrib->pktlen); }else { - mem_sz =_rtw_pktfile_read (&pktfile, pframe, mpdu_len); + mem_sz =rtw_pktfile_read (&pktfile, pframe, mpdu_len); } pframe += mem_sz;
Signature · 1 line
2.37.2
PATCH 12/19 staging: r8188eu: remove unnecessary initialization to zero
In reply to Michael StraubeThe initialization to zero of the variable 'len' in rtw_pktfile_read() is not needed. It is immediately set to another value. Remove the initialization to zero. While at it, remove an extra space.
--- drivers/staging/r8188eu/core/rtw_xmit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +2 -2
@@ -429,9 +429,9 @@ static uint rtw_remainder_len(struct pkt_file *pfile)static uint rtw_pktfile_read (struct pkt_file *pfile,u8 *rmem,uint rlen) { -uint len =0 ; +uint len; - len =rtw_remainder_len (pfile); + len =rtw_remainder_len (pfile); len = (rlen > len) ? len : rlen;if (rmem)
Signature · 1 line
2.37.2
PATCH 13/19 staging: r8188eu: move struct pkt_file to rtw_xmit.h
In reply to Michael StraubeThe code that uses struct pkt_file has been moved to rtw_xmit.c. Move the structure definition to rtw_xmit.h.
--- drivers/staging/r8188eu/include/rtw_xmit.h | 9 +++++++++ drivers/staging/r8188eu/include/xmit_osdep.h | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/r8188eu/include/rtw_xmit.h +9 -0
@@ -304,6 +304,15 @@ struct xmit_priv {struct submit_ctx ack_tx_ops; }; +struct pkt_file { +struct sk_buff *pkt; +size_t pkt_len;/* the remainder length of the open_file */ +unsigned char *cur_buffer; +u8 *buf_start; +u8 *cur_addr; +size_t buf_len; +}; +struct xmit_buf *rtw_alloc_xmitbuf_ext (struct xmit_priv *pxmitpriv);s32 rtw_free_xmitbuf_ext (struct xmit_priv *pxmitpriv,struct xmit_buf *pxmitbuf);
drivers/staging/r8188eu/include/xmit_osdep.h +0 -9
@@ -7,15 +7,6 @@#include "osdep_service.h" #include "drv_types.h" -struct pkt_file { -struct sk_buff *pkt; -size_t pkt_len;/* the remainder length of the open_file */ -unsigned char *cur_buffer; -u8 *buf_start; -u8 *cur_addr; -size_t buf_len; -}; -extern int rtw_ht_enable;extern int rtw_cbw40_enable;extern int rtw_ampdu_enable;/* for enable tx_ampdu */
Signature · 1 line
2.37.2
PATCH 14/19 staging: r8188eu: move rtw_os_xmit_complete() to rtw_xmit.c
In reply to Michael StraubeMove the function rtw_os_xmit_complete() from the os_dep/xmit_linux.c to core/rtw_xmit.c. The goal is to get rid of os_dep/xmit_linux.c in follow up patches.
--- drivers/staging/r8188eu/core/rtw_xmit.c | 7 +++++++ drivers/staging/r8188eu/include/rtw_xmit.h | 2 ++ drivers/staging/r8188eu/include/xmit_osdep.h | 2 -- drivers/staging/r8188eu/os_dep/xmit_linux.c | 7 ------- 4 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +7 -0
@@ -229,6 +229,13 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)return res; } +void rtw_os_xmit_complete (struct adapter *padapter,struct xmit_frame *pxframe) +{ +if (pxframe->pkt) +rtw_os_pkt_complete (padapter, pxframe->pkt); + pxframe->pkt =NULL ; +} +void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv) {int i;
drivers/staging/r8188eu/include/rtw_xmit.h +2 -0
@@ -364,6 +364,8 @@ u32 rtw_get_ff_hwaddr(struct xmit_frame *pxmitframe);int rtw_ack_tx_wait (struct xmit_priv *pxmitpriv,u32 timeout_ms);void rtw_ack_tx_done (struct xmit_priv *pxmitpriv,int status); +void rtw_os_xmit_complete (struct adapter *padapter,struct xmit_frame *pxframe); +/* include after declaring struct xmit_buf, in order to avoid warning */ #include "xmit_osdep.h"
drivers/staging/r8188eu/include/xmit_osdep.h +0 -2
@@ -22,7 +22,5 @@ struct xmit_buf;int rtw_xmit_entry (struct sk_buff *pkt,struct net_device *pnetdev);void rtw_os_pkt_complete (struct adapter *padapter,struct sk_buff *pkt); -void rtw_os_xmit_complete (struct adapter *padapter, -struct xmit_frame *pxframe);#endif /* __XMIT_OSDEP_H_ */
drivers/staging/r8188eu/os_dep/xmit_linux.c +0 -7
@@ -31,13 +31,6 @@ void rtw_os_pkt_complete(struct adapter *padapter, struct sk_buff *pkt)dev_kfree_skb_any (pkt); } -void rtw_os_xmit_complete (struct adapter *padapter,struct xmit_frame *pxframe) -{ -if (pxframe->pkt) -rtw_os_pkt_complete (padapter, pxframe->pkt); - pxframe->pkt =NULL ; -} -static void rtw_check_xmit_resource (struct adapter *padapter,struct sk_buff *pkt) {struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
Signature · 1 line
2.37.2
PATCH 15/19 staging: r8188eu: rename rtw_os_xmit_complete()
In reply to Michael StraubeThe function rtw_os_xmit_complete() was moved from the os_dep directory. It looks like the driver was originaly written to support different operating systems. Obviously we do not need an extra 'os' in the function name that indicates that the function is operating system specific. Rename it to rtw_xmit_complete().
--- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 2 +- drivers/staging/r8188eu/core/rtw_xmit.c | 10 +++++----- drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 4 ++-- drivers/staging/r8188eu/include/rtw_xmit.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/r8188eu/core/rtw_mlme_ext.c +1 -1
@@ -7876,7 +7876,7 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf)spin_unlock_bh (&psta_bmc->sleep_q.lock);if (rtl8188eu_hal_xmit (padapter, pxmitframe)) -rtw_os_xmit_complete (padapter, pxmitframe); +rtw_xmit_complete (padapter, pxmitframe);spin_lock_bh (&psta_bmc->sleep_q.lock); }spin_unlock_bh (&psta_bmc->sleep_q.lock);
drivers/staging/r8188eu/core/rtw_xmit.c +5 -5
@@ -229,7 +229,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)return res; } -void rtw_os_xmit_complete (struct adapter *padapter,struct xmit_frame *pxframe) +void rtw_xmit_complete (struct adapter *padapter,struct xmit_frame *pxframe) {if (pxframe->pkt)rtw_os_pkt_complete (padapter, pxframe->pkt);
@@ -249,7 +249,7 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)return ;for (i =0 ; i <NR_XMITFRAME ; i++) { -rtw_os_xmit_complete (padapter, pxmitframe); +rtw_xmit_complete (padapter, pxmitframe); pxmitframe++; }
@@ -2017,7 +2017,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)spin_unlock_bh (&psta->sleep_q.lock);if (rtl8188eu_hal_xmit (padapter, pxmitframe)) -rtw_os_xmit_complete (padapter, pxmitframe); +rtw_xmit_complete (padapter, pxmitframe);spin_lock_bh (&psta->sleep_q.lock); }
@@ -2067,7 +2067,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)spin_unlock_bh (&psta_bmc->sleep_q.lock);if (rtl8188eu_hal_xmit (padapter, pxmitframe)) -rtw_os_xmit_complete (padapter, pxmitframe); +rtw_xmit_complete (padapter, pxmitframe);spin_lock_bh (&psta_bmc->sleep_q.lock); }
@@ -2141,7 +2141,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst pxmitframe->attrib.triggered =1 ;if (rtl8188eu_hal_xmit (padapter, pxmitframe)) -rtw_os_xmit_complete (padapter, pxmitframe); +rtw_xmit_complete (padapter, pxmitframe);if ((psta->sleepq_ac_len ==0 ) && (!psta->has_legacy_ac) && (wmmps_ac)) { pstapriv->tim_bitmap &= ~BIT (psta->aid);
drivers/staging/r8188eu/hal/rtl8188eu_xmit.c +2 -2
@@ -431,7 +431,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitrtw_xmitframe_coalesce (adapt, pxmitframe->pkt, pxmitframe);/* always return ndis_packet after rtw_xmitframe_coalesce */ -rtw_os_xmit_complete (adapt, pxmitframe); +rtw_xmit_complete (adapt, pxmitframe);/* 3 2. aggregate same priority and same DA(AP or STA) frames */ pfirstframe = pxmitframe;
@@ -501,7 +501,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitrtw_xmitframe_coalesce (adapt, pxmitframe->pkt, pxmitframe);/* always return ndis_packet after rtw_xmitframe_coalesce */ -rtw_os_xmit_complete (adapt, pxmitframe); +rtw_xmit_complete (adapt, pxmitframe);/* (len - TXDESC_SIZE) == pxmitframe->attrib.last_txcmdsz */ update_txdesc (pxmitframe, pxmitframe->buf_addr, pxmitframe->attrib.last_txcmdsz, true);
drivers/staging/r8188eu/include/rtw_xmit.h +1 -1
@@ -364,7 +364,7 @@ u32 rtw_get_ff_hwaddr(struct xmit_frame *pxmitframe);int rtw_ack_tx_wait (struct xmit_priv *pxmitpriv,u32 timeout_ms);void rtw_ack_tx_done (struct xmit_priv *pxmitpriv,int status); -void rtw_os_xmit_complete (struct adapter *padapter,struct xmit_frame *pxframe); +void rtw_xmit_complete (struct adapter *padapter,struct xmit_frame *pxframe);/* include after declaring struct xmit_buf, in order to avoid warning */ #include "xmit_osdep.h"
Signature · 1 line
2.37.2
PATCH 16/19 staging: r8188eu: make rtw_os_pkt_complete() static
In reply to Michael StraubeThe function rtw_os_pkt_complete() is only used in rtw_xmit.c. Make it static.
--- drivers/staging/r8188eu/core/rtw_xmit.c | 18 ++++++++++++++++++ drivers/staging/r8188eu/include/rtw_xmit.h | 3 +++ drivers/staging/r8188eu/include/xmit_osdep.h | 4 ---- drivers/staging/r8188eu/os_dep/xmit_linux.c | 20 -------------------- 4 files changed, 21 insertions(+), 24 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +18 -0
@@ -229,6 +229,24 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)return res; } +static void rtw_os_pkt_complete (struct adapter *padapter,struct sk_buff *pkt) +{ +u16 queue; +struct xmit_priv *pxmitpriv = &padapter->xmitpriv; + + queue =skb_get_queue_mapping (pkt); +if (padapter->registrypriv.wifi_spec) { +if (__netif_subqueue_stopped (padapter->pnetdev, queue) && + (pxmitpriv->hwxmits[queue].accnt <WMM_XMIT_THRESHOLD )) +netif_wake_subqueue (padapter->pnetdev, queue); + }else { +if (__netif_subqueue_stopped (padapter->pnetdev, queue)) +netif_wake_subqueue (padapter->pnetdev, queue); + } + +dev_kfree_skb_any (pkt); +} +void rtw_xmit_complete (struct adapter *padapter,struct xmit_frame *pxframe) {if (pxframe->pkt)
drivers/staging/r8188eu/include/rtw_xmit.h +3 -0
@@ -7,6 +7,9 @@#include "osdep_service.h" #include "drv_types.h" +#define NR_XMITFRAME 256 +#define WMM_XMIT_THRESHOLD (NR_XMITFRAME * 2 / 5) +#define MAX_XMITBUF_SZ (20480)/* 20k */ #define NR_XMITBUFF (4)
drivers/staging/r8188eu/include/xmit_osdep.h +0 -4
@@ -11,8 +11,6 @@ extern int rtw_ht_enable;extern int rtw_cbw40_enable;extern int rtw_ampdu_enable;/* for enable tx_ampdu */ -#define NR_XMITFRAME 256 -struct xmit_priv ;struct pkt_attrib ;struct sta_xmit_priv ;
@@ -21,6 +19,4 @@ struct xmit_buf;int rtw_xmit_entry (struct sk_buff *pkt,struct net_device *pnetdev); -void rtw_os_pkt_complete (struct adapter *padapter,struct sk_buff *pkt); -#endif /* __XMIT_OSDEP_H_ */
drivers/staging/r8188eu/os_dep/xmit_linux.c +0 -20
@@ -11,26 +11,6 @@#include "../include/osdep_intf.h" #include "../include/usb_osintf.h" -#define WMM_XMIT_THRESHOLD (NR_XMITFRAME * 2 / 5) - -void rtw_os_pkt_complete (struct adapter *padapter,struct sk_buff *pkt) -{ -u16 queue; -struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - - queue =skb_get_queue_mapping (pkt); -if (padapter->registrypriv.wifi_spec) { -if (__netif_subqueue_stopped (padapter->pnetdev, queue) && - (pxmitpriv->hwxmits[queue].accnt <WMM_XMIT_THRESHOLD )) -netif_wake_subqueue (padapter->pnetdev, queue); - }else { -if (__netif_subqueue_stopped (padapter->pnetdev, queue)) -netif_wake_subqueue (padapter->pnetdev, queue); - } - -dev_kfree_skb_any (pkt); -} -static void rtw_check_xmit_resource (struct adapter *padapter,struct sk_buff *pkt) {struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
Signature · 1 line
2.37.2
PATCH 17/19 staging: r8188eu: rename rtw_os_pkt_complete()
In reply to Michael StraubeThe function rtw_os_pkt_complete() was moved from the os_dep directory. It looks like the driver was originaly written to support different operating systems. Obviously we do not need an extra 'os' in the function name that indicates that the function is operating system specific. Rename it to rtw_pkt_complete().
--- drivers/staging/r8188eu/core/rtw_xmit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/r8188eu/core/rtw_xmit.c +3 -3
@@ -229,7 +229,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)return res; } -static void rtw_os_pkt_complete (struct adapter *padapter,struct sk_buff *pkt) +static void rtw_pkt_complete (struct adapter *padapter,struct sk_buff *pkt) {u16 queue;struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
@@ -250,7 +250,7 @@ static void rtw_os_pkt_complete(struct adapter *padapter, struct sk_buff *pkt)void rtw_xmit_complete (struct adapter *padapter,struct xmit_frame *pxframe) {if (pxframe->pkt) -rtw_os_pkt_complete (padapter, pxframe->pkt); +rtw_pkt_complete (padapter, pxframe->pkt); pxframe->pkt =NULL ; }
@@ -1376,7 +1376,7 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitframspin_unlock_bh (&pfree_xmit_queue->lock);if (pndis_pkt) -rtw_os_pkt_complete (padapter, pndis_pkt); +rtw_pkt_complete (padapter, pndis_pkt); exit:
Signature · 1 line
2.37.2
PATCH 18/19 staging: r8188eu: remove os_dep/xmit_linux.c
In reply to Michael StraubeMove the last remaining function rtw_xmit_entry(), and the static functions it calls, from os_dep/xmit_linux.c to core/rtw_xmit.c and remove the now empty file os_dep/xmit_linux.c.
--- drivers/staging/r8188eu/Makefile | 1 - drivers/staging/r8188eu/core/rtw_xmit.c | 102 ++++++++++++++++ drivers/staging/r8188eu/include/rtw_xmit.h | 1 + drivers/staging/r8188eu/include/xmit_osdep.h | 2 - drivers/staging/r8188eu/os_dep/xmit_linux.c | 115 ------------------- 5 files changed, 103 insertions(+), 118 deletions(-) delete mode 100644 drivers/staging/r8188eu/os_dep/xmit_linux.c
drivers/staging/r8188eu/Makefile +0 -1
@@ -27,7 +27,6 @@ r8188eu-y = \ os_dep/osdep_service.o \ os_dep/usb_intf.o \ os_dep/usb_ops_linux.o \ - os_dep/xmit_linux.o \ core/rtw_ap.o \ core/rtw_br_ext.o \ core/rtw_cmd.o \
drivers/staging/r8188eu/core/rtw_xmit.c +102 -0
105 lines not on this page · raw message
drivers/staging/r8188eu/include/rtw_xmit.h +1 -0
@@ -368,6 +368,7 @@ int rtw_ack_tx_wait(struct xmit_priv *pxmitpriv, u32 timeout_ms);void rtw_ack_tx_done (struct xmit_priv *pxmitpriv,int status);void rtw_xmit_complete (struct adapter *padapter,struct xmit_frame *pxframe); +int rtw_xmit_entry (struct sk_buff *pkt,struct net_device *pnetdev);/* include after declaring struct xmit_buf, in order to avoid warning */ #include "xmit_osdep.h"
drivers/staging/r8188eu/include/xmit_osdep.h +0 -2
@@ -17,6 +17,4 @@ struct sta_xmit_priv;struct xmit_frame ;struct xmit_buf ; -int rtw_xmit_entry (struct sk_buff *pkt,struct net_device *pnetdev); -#endif /* __XMIT_OSDEP_H_ */
drivers/staging/r8188eu/os_dep/xmit_linux.c deleted +0 -115
115 lines not on this page · raw message
Signature · 1 line
2.37.2
PATCH 19/19 staging: r8188eu: remove xmit_osdep.h
In reply to Michael StraubeAfter previous cleanups the header xmit_osdep.h only contains some structure forward declarations and extern declarations for some module parameters. The forward declarations are not needed. We can make the module parameters static in os_dep/os_intf.c and remove xmit_osdep.h.
--- drivers/staging/r8188eu/core/rtw_mlme.c | 1 - drivers/staging/r8188eu/core/rtw_sta_mgt.c | 1 - drivers/staging/r8188eu/include/rtw_xmit.h | 3 --- drivers/staging/r8188eu/include/xmit_osdep.h | 20 -------------------- drivers/staging/r8188eu/os_dep/os_intfs.c | 7 +++---- drivers/staging/r8188eu/os_dep/usb_intf.c | 1 - 6 files changed, 3 insertions(+), 30 deletions(-) delete mode 100644 drivers/staging/r8188eu/include/xmit_osdep.h
drivers/staging/r8188eu/core/rtw_mlme.c +0 -1
@@ -6,7 +6,6 @@#include "../include/osdep_service.h" #include "../include/drv_types.h" #include "../include/recv_osdep.h" -#include "../include/xmit_osdep.h" #include "../include/hal_intf.h" #include "../include/mlme_osdep.h" #include "../include/sta_info.h"
drivers/staging/r8188eu/core/rtw_sta_mgt.c +0 -1
@@ -6,7 +6,6 @@#include "../include/osdep_service.h" #include "../include/drv_types.h" #include "../include/recv_osdep.h" -#include "../include/xmit_osdep.h" #include "../include/mlme_osdep.h" #include "../include/sta_info.h"
drivers/staging/r8188eu/include/rtw_xmit.h +0 -3
@@ -370,7 +370,4 @@ void rtw_ack_tx_done(struct xmit_priv *pxmitpriv, int status);void rtw_xmit_complete (struct adapter *padapter,struct xmit_frame *pxframe);int rtw_xmit_entry (struct sk_buff *pkt,struct net_device *pnetdev); -/* include after declaring struct xmit_buf, in order to avoid warning */ -#include "xmit_osdep.h" -#endif /* _RTL871X_XMIT_H_ */
drivers/staging/r8188eu/include/xmit_osdep.h deleted +0 -20
@@ -1,20 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ -/* Copyright(c) 2007 - 2011 Realtek Corporation. */ - -#ifndef __XMIT_OSDEP_H_ -#define __XMIT_OSDEP_H_ - -#include "osdep_service.h" -#include "drv_types.h" - -extern int rtw_ht_enable; -extern int rtw_cbw40_enable; -extern int rtw_ampdu_enable;/* for enable tx_ampdu */ - -struct xmit_priv ; -struct pkt_attrib ; -struct sta_xmit_priv ; -struct xmit_frame ; -struct xmit_buf ; - -#endif /* __XMIT_OSDEP_H_ */
drivers/staging/r8188eu/os_dep/os_intfs.c +3 -4
@@ -5,7 +5,6 @@#include "../include/osdep_service.h" #include "../include/drv_types.h" -#include "../include/xmit_osdep.h" #include "../include/recv_osdep.h" #include "../include/hal_intf.h" #include "../include/rtw_ioctl.h"
@@ -66,9 +65,9 @@ static int rtw_uapsd_acvo_en;static int rtw_led_enable =1 ; -int rtw_ht_enable =1 ; -int rtw_cbw40_enable =3 ;/* 0 :disable, bit(0): enable 2.4g, bit(1): enable 5g */ -int rtw_ampdu_enable =1 ;/* for enable tx_ampdu */ +static int rtw_ht_enable =1 ; +static int rtw_cbw40_enable =3 ;/* 0 :disable, bit(0): enable 2.4g, bit(1): enable 5g */ +static int rtw_ampdu_enable =1 ;/* for enable tx_ampdu */ static int rtw_rx_stbc =1 ;/* 0: disable, bit(0):enable 2.4g, bit(1):enable 5g, default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ */ static int rtw_ampdu_amsdu;/* 0: disabled, 1:enabled, 2:auto */
drivers/staging/r8188eu/os_dep/usb_intf.c +0 -1
@@ -5,7 +5,6 @@#include "../include/osdep_service.h" #include "../include/drv_types.h" #include "../include/recv_osdep.h" -#include "../include/xmit_osdep.h" #include "../include/hal_intf.h" #include "../include/osdep_intf.h" #include "../include/usb_ops.h"
Signature · 1 line
2.37.2
Quoted 45 lines · Michael Straube
This series moves the functions, or their functionality, from
os_dep/xmit_linux.cto the core/* part of the driver and finally removesos_dep/xmit_linux.cand thexmit_osdep.hheader.Tested on
x86_64with Inter-Tech DMG-02.Please apply this on top of:
[PATCH] staging: r8188eu: removertw_endofpktfile()Thanks,
MichaelMichael Straube (19):
staging: r8188eu: makertw_remainder_len()static
staging: r8188eu: makertw_os_xmit_schedule()static
staging: r8188eu: renamertw_os_xmit_schedule()
staging: r8188eu: makertw_os_xmit_resource_alloc()static
staging: r8188eu: renamertw_os_xmit_resource_alloc()
staging: r8188eu: makertw_os_xmit_resource_free()static
staging: r8188eu: renamertw_os_xmit_resource_free()
staging: r8188eu: make_rtw_open_pktfile()static
staging: r8188eu: rename_rtw_open_pktfile()
staging: r8188eu: make_rtw_pktfile_read()static
staging: r8188eu: rename_rtw_pktfile_read()
staging: r8188eu: remove unnecessary initialization to zero
staging: r8188eu: move structpkt_filetortw_xmit.h
staging: r8188eu: movertw_os_xmit_complete()tortw_xmit.c
staging: r8188eu: renamertw_os_xmit_complete()
staging: r8188eu: makertw_os_pkt_complete()static
staging: r8188eu: renamertw_os_pkt_complete()
staging: r8188eu: removeos_dep/xmit_linux.c
staging: r8188eu: removexmit_osdep.hdrivers/staging/r8188eu/Makefile | 1 - drivers/staging/r8188eu/core/rtw_mlme.c | 23 +- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 2 +- drivers/staging/r8188eu/core/rtw_sta_mgt.c | 1 - drivers/staging/r8188eu/core/rtw_xmit.c | 232 +++++++++++++++++-- drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 4 +- drivers/staging/r8188eu/include/rtw_xmit.h | 16 +- drivers/staging/r8188eu/include/xmit_osdep.h | 48 ---- drivers/staging/r8188eu/os_dep/os_intfs.c | 7 +- drivers/staging/r8188eu/os_dep/usb_intf.c | 1 - drivers/staging/r8188eu/os_dep/xmit_linux.c | 226 ------------------ 11 files changed, 251 insertions(+), 310 deletions(-)
Quoted 3 lines
delete mode 100644
drivers/staging/r8188eu/include/xmit_osdep.hdelete mode 100644drivers/staging/r8188eu/os_dep/xmit_linux.c