Here's another set of xmit cleanups, based on my previous patches.
Martin Kaiser (13):
staging: r8188eu: beq_cnt is write-only
staging: r8188eu: bkq_cnt is write-only
staging: r8188eu: viq_cnt is write-only
staging: r8188eu: voq_cnt is write-only
staging: r8188eu: replace switch with if
staging: r8188eu: make rtl8188eu_inirp_init a void function
staging: r8188eu: dir_dev is unused
staging: r8188eu: remove unused hal_xmit_handler define
staging: r8188eu: txirp_cnt is write-only
staging: r8188eu: remove unused QSLT defines
staging: r8188eu: xmit_priv's vcs_type is not used
staging: r8188eu: xmit_priv's vcs is not used
staging: r8188eu: xmit_priv's vcs_setting is not used
drivers/staging/r8188eu/core/rtw_mlme.c | 5 ---
drivers/staging/r8188eu/core/rtw_xmit.c | 42 -------------------
drivers/staging/r8188eu/hal/usb_halinit.c | 14 ++-----
drivers/staging/r8188eu/include/drv_types.h | 1 -
drivers/staging/r8188eu/include/hal_intf.h | 2 +-
.../staging/r8188eu/include/rtl8188e_xmit.h | 11 -----
drivers/staging/r8188eu/include/rtw_xmit.h | 10 -----
drivers/staging/r8188eu/os_dep/os_intfs.c | 3 --
.../staging/r8188eu/os_dep/usb_ops_linux.c | 23 +---------
9 files changed, 5 insertions(+), 106 deletions(-)
--
2.30.2
viq_cnt in struct xmit_priv is initialised, incremented and decremented
but never read. Remove viq_cnt and resulting dead code.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/core/rtw_xmit.c | 1 -
drivers/staging/r8188eu/include/rtw_xmit.h | 1 -
drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 4 ----
3 files changed, 6 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index 875675656d11..1319a7fce8b3 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -195,7 +195,6 @@ int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
pxmitpriv->txirp_cnt = 1;
/* per AC pending irp */
- pxmitpriv->viq_cnt = 0;
pxmitpriv->voq_cnt = 0;
pxmitpriv->ack_tx = false;
diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h
index 3d56c3afaf7d..71a7fb33b0d0 100644
--- a/drivers/staging/r8188eu/include/rtw_xmit.h
+++ b/drivers/staging/r8188eu/include/rtw_xmit.h
@@ -282,7 +282,6 @@ struct xmit_priv {
u8 txirp_cnt;/* */
struct tasklet_struct xmit_tasklet;
/* per AC pending irp */
- int viq_cnt;
int voq_cnt;
struct __queue free_xmitbuf_queue;
struct __queue pending_xmitbuf_queue;
diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
index 5ae09edf9174..7929b7d5e89e 100644
--- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
@@ -45,9 +45,6 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
case VO_QUEUE_INX:
pxmitpriv->voq_cnt--;
break;
- case VI_QUEUE_INX:
- pxmitpriv->viq_cnt--;
- break;
case HIGH_QUEUE_INX:
rtw_chk_hi_queue_cmd(padapter);
break;
@@ -113,7 +110,6 @@ u32 rtw_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem)
pxmitbuf->flags = VO_QUEUE_INX;
break;
case VI_QUEUE_INX:
- pxmitpriv->viq_cnt++;
pxmitbuf->flags = VI_QUEUE_INX;
break;
case BE_QUEUE_INX:
--
2.30.2
voq_cnt in struct xmit_priv is initialised, incremented and decremented
but never read. Remove voq_cnt and resulting dead code.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/core/rtw_xmit.c | 3 ---
drivers/staging/r8188eu/include/rtw_xmit.h | 2 --
drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 4 ----
3 files changed, 9 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index 1319a7fce8b3..8211b858573f 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -194,9 +194,6 @@ int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
pxmitpriv->txirp_cnt = 1;
- /* per AC pending irp */
- pxmitpriv->voq_cnt = 0;
-
pxmitpriv->ack_tx = false;
mutex_init(&pxmitpriv->ack_tx_mutex);
rtw_sctx_init(&pxmitpriv->ack_tx_ops, 0);
diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h
index 71a7fb33b0d0..7e6cf745d913 100644
--- a/drivers/staging/r8188eu/include/rtw_xmit.h
+++ b/drivers/staging/r8188eu/include/rtw_xmit.h
@@ -281,8 +281,6 @@ struct xmit_priv {
* 1->vi, 2->be, 3->bk. */
u8 txirp_cnt;/* */
struct tasklet_struct xmit_tasklet;
- /* per AC pending irp */
- int voq_cnt;
struct __queue free_xmitbuf_queue;
struct __queue pending_xmitbuf_queue;
u8 *pallocated_xmitbuf;
diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
index 7929b7d5e89e..6fe5a4230291 100644
--- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
@@ -42,9 +42,6 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
switch (pxmitbuf->flags) {
- case VO_QUEUE_INX:
- pxmitpriv->voq_cnt--;
- break;
case HIGH_QUEUE_INX:
rtw_chk_hi_queue_cmd(padapter);
break;
@@ -106,7 +103,6 @@ u32 rtw_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem)
switch (addr) {
case VO_QUEUE_INX:
- pxmitpriv->voq_cnt++;
pxmitbuf->flags = VO_QUEUE_INX;
break;
case VI_QUEUE_INX:
--
2.30.2
The vcs_type component of struct xmit_priv is not used. Remove it.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/include/rtw_xmit.h | 1 -
drivers/staging/r8188eu/os_dep/os_intfs.c | 1 -
2 files changed, 2 deletions(-)
diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h
index 50d9311d3e40..77d79c43209f 100644
--- a/drivers/staging/r8188eu/include/rtw_xmit.h
+++ b/drivers/staging/r8188eu/include/rtw_xmit.h
@@ -269,7 +269,6 @@ struct xmit_priv {
struct adapter *adapter;
u8 vcs_setting;
u8 vcs;
- u8 vcs_type;
u64 tx_bytes;
u64 tx_pkts;
u64 tx_drop;
diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
index 2f59bb994796..ae03d39de092 100644
--- a/drivers/staging/r8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
@@ -394,7 +394,6 @@ static void rtw_init_default_value(struct adapter *padapter)
/* xmit_priv */
pxmitpriv->vcs_setting = pregistrypriv->vrtl_carrier_sense;
pxmitpriv->vcs = pregistrypriv->vcs_type;
- pxmitpriv->vcs_type = pregistrypriv->vcs_type;
pxmitpriv->frag_len = pregistrypriv->frag_thresh;
/* mlme_priv */
--
2.30.2
dir_dev in struct adapter is not used by the r8188eu driver. It can be
removed.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/include/drv_types.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/r8188eu/include/drv_types.h b/drivers/staging/r8188eu/include/drv_types.h
index 8fef5759c36a..4803d0c77d70 100644
--- a/drivers/staging/r8188eu/include/drv_types.h
+++ b/drivers/staging/r8188eu/include/drv_types.h
@@ -187,7 +187,6 @@ struct adapter {
int bup;
struct net_device_stats stats;
struct iw_statistics iwstats;
- struct proc_dir_entry *dir_dev;/* for proc directory */
int net_closed;
u8 bFWReady;
--
2.30.2
The vcs component in struct xmit_priv is set but not used. We can remove
vcs and the rtw_update_protection function, whose only job is to set vcs.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/core/rtw_mlme.c | 5 ----
drivers/staging/r8188eu/core/rtw_xmit.c | 34 ----------------------
drivers/staging/r8188eu/include/rtw_xmit.h | 2 --
drivers/staging/r8188eu/os_dep/os_intfs.c | 1 -
4 files changed, 42 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c
index b272123626ac..fb7d0e161fdd 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme.c
@@ -444,8 +444,6 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex
if (check_fwstate(pmlmepriv, _FW_LINKED) &&
is_same_network(&pmlmepriv->cur_network.network, pnetwork)) {
update_network(&pmlmepriv->cur_network.network, pnetwork, adapter, true);
- rtw_update_protection(adapter, (pmlmepriv->cur_network.network.IEs) + sizeof(struct ndis_802_11_fixed_ie),
- pmlmepriv->cur_network.network.IELength);
}
}
@@ -1027,9 +1025,6 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
break;
}
- rtw_update_protection(padapter, (cur_network->network.IEs) +
- sizeof(struct ndis_802_11_fixed_ie),
- (cur_network->network.IELength));
rtw_update_ht_cap(padapter, cur_network->network.IEs, cur_network->network.IELength);
}
diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index 1cd560630de3..8b055e3fbfa5 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -1099,40 +1099,6 @@ s32 rtw_put_snap(u8 *data, u16 h_proto)
return SNAP_SIZE + sizeof(u16);
}
-void rtw_update_protection(struct adapter *padapter, u8 *ie, uint ie_len)
-{
- uint protection;
- u8 *perp;
- int erp_len;
- struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
- struct registry_priv *pregistrypriv = &padapter->registrypriv;
-
- switch (pxmitpriv->vcs_setting) {
- case DISABLE_VCS:
- pxmitpriv->vcs = NONE_VCS;
- break;
- case ENABLE_VCS:
- break;
- case AUTO_VCS:
- default:
- perp = rtw_get_ie(ie, _ERPINFO_IE_, &erp_len, ie_len);
- if (!perp) {
- pxmitpriv->vcs = NONE_VCS;
- } else {
- protection = (*(perp + 2)) & BIT(1);
- if (protection) {
- if (pregistrypriv->vcs_type == RTS_CTS)
- pxmitpriv->vcs = RTS_CTS;
- else
- pxmitpriv->vcs = CTS_TO_SELF;
- } else {
- pxmitpriv->vcs = NONE_VCS;
- }
- }
- break;
- }
-}
-
void rtw_count_tx_stats(struct adapter *padapter, struct xmit_frame *pxmitframe, int sz)
{
struct sta_info *psta = NULL;
diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h
index 77d79c43209f..abac0103b53a 100644
--- a/drivers/staging/r8188eu/include/rtw_xmit.h
+++ b/drivers/staging/r8188eu/include/rtw_xmit.h
@@ -268,7 +268,6 @@ struct xmit_priv {
uint frag_len;
struct adapter *adapter;
u8 vcs_setting;
- u8 vcs;
u64 tx_bytes;
u64 tx_pkts;
u64 tx_drop;
@@ -311,7 +310,6 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv,
struct xmit_buf *pxmitbuf);
void rtw_count_tx_stats(struct adapter *padapter,
struct xmit_frame *pxmitframe, int sz);
-void rtw_update_protection(struct adapter *padapter, u8 *ie, uint ie_len);
s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr,
struct pkt_attrib *pattrib);
s32 rtw_put_snap(u8 *data, u16 h_proto);
diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
index ae03d39de092..f022f6b1cf3e 100644
--- a/drivers/staging/r8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
@@ -393,7 +393,6 @@ static void rtw_init_default_value(struct adapter *padapter)
/* xmit_priv */
pxmitpriv->vcs_setting = pregistrypriv->vrtl_carrier_sense;
- pxmitpriv->vcs = pregistrypriv->vcs_type;
pxmitpriv->frag_len = pregistrypriv->frag_thresh;
/* mlme_priv */
--
2.30.2
hal_xmit_handler is not used by the r8188eu driver. Remove it.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/include/rtl8188e_xmit.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/r8188eu/include/rtl8188e_xmit.h b/drivers/staging/r8188eu/include/rtl8188e_xmit.h
index 82439f52b0c8..230ea191d256 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_xmit.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_xmit.h
@@ -134,7 +134,6 @@ void rtl8188e_fill_fake_txdesc(struct adapter *padapter, u8 *pDesc,
s32 rtl8188eu_hal_xmit(struct adapter *padapter, struct xmit_frame *frame);
s32 rtl8188eu_mgnt_xmit(struct adapter *padapter, struct xmit_frame *frame);
s32 rtl8188eu_xmit_buf_handler(struct adapter *padapter);
-#define hal_xmit_handler rtl8188eu_xmit_buf_handler
void rtl8188eu_xmit_tasklet(unsigned long priv);
bool rtl8188eu_xmitframe_complete(struct adapter *padapter,
struct xmit_priv *pxmitpriv);
--
2.30.2
The switch statement in usb_write_port_complete has only one single case.
Replace it with an if statement.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
index 6fe5a4230291..257bcf496012 100644
--- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
@@ -41,13 +41,8 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
struct adapter *padapter = pxmitbuf->padapter;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
- switch (pxmitbuf->flags) {
- case HIGH_QUEUE_INX:
+ if (pxmitbuf->flags == HIGH_QUEUE_INX)
rtw_chk_hi_queue_cmd(padapter);
- break;
- default:
- break;
- }
if (padapter->bSurpriseRemoved || padapter->bDriverStopped ||
padapter->bWritePortCancel)
--
2.30.2
bkq_cnt in struct xmit_priv is initialised, incremented and decremented
but never read. Remove bkq_cnt and resulting dead code.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/core/rtw_xmit.c | 1 -
drivers/staging/r8188eu/include/rtw_xmit.h | 1 -
drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 4 ----
3 files changed, 6 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index e5ac49441337..875675656d11 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -195,7 +195,6 @@ int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
pxmitpriv->txirp_cnt = 1;
/* per AC pending irp */
- pxmitpriv->bkq_cnt = 0;
pxmitpriv->viq_cnt = 0;
pxmitpriv->voq_cnt = 0;
diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h
index c84f73f2cc59..3d56c3afaf7d 100644
--- a/drivers/staging/r8188eu/include/rtw_xmit.h
+++ b/drivers/staging/r8188eu/include/rtw_xmit.h
@@ -282,7 +282,6 @@ struct xmit_priv {
u8 txirp_cnt;/* */
struct tasklet_struct xmit_tasklet;
/* per AC pending irp */
- int bkq_cnt;
int viq_cnt;
int voq_cnt;
struct __queue free_xmitbuf_queue;
diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
index 067b7def2bde..5ae09edf9174 100644
--- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
@@ -48,9 +48,6 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
case VI_QUEUE_INX:
pxmitpriv->viq_cnt--;
break;
- case BK_QUEUE_INX:
- pxmitpriv->bkq_cnt--;
- break;
case HIGH_QUEUE_INX:
rtw_chk_hi_queue_cmd(padapter);
break;
@@ -123,7 +120,6 @@ u32 rtw_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem)
pxmitbuf->flags = BE_QUEUE_INX;
break;
case BK_QUEUE_INX:
- pxmitpriv->bkq_cnt++;
pxmitbuf->flags = BK_QUEUE_INX;
break;
case HIGH_QUEUE_INX:
--
2.30.2
rtl8188eu_inirp_init's return value is not checked by its caller. Make
rtl8188eu_inirp_init a void function.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/hal/usb_halinit.c | 14 +++-----------
drivers/staging/r8188eu/include/hal_intf.h | 2 +-
2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index d28b4dc2a767..afa24a59fbb3 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -851,29 +851,21 @@ u32 rtl8188eu_hal_deinit(struct adapter *Adapter)
return _SUCCESS;
}
-unsigned int rtl8188eu_inirp_init(struct adapter *Adapter)
+void rtl8188eu_inirp_init(struct adapter *Adapter)
{
u8 i;
struct recv_buf *precvbuf;
- uint status;
struct recv_priv *precvpriv = &Adapter->recvpriv;
- status = _SUCCESS;
-
/* issue Rx irp to receive data */
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
for (i = 0; i < NR_RECVBUFF; i++) {
- if (!rtw_read_port(Adapter, (unsigned char *)precvbuf)) {
- status = _FAIL;
- goto exit;
- }
+ if (!rtw_read_port(Adapter, (unsigned char *)precvbuf))
+ return;
precvbuf++;
precvpriv->free_recv_buf_queue_cnt--;
}
-
-exit:
- return status;
}
/* */
diff --git a/drivers/staging/r8188eu/include/hal_intf.h b/drivers/staging/r8188eu/include/hal_intf.h
index ac6e3f95c5b7..767f97c5f85d 100644
--- a/drivers/staging/r8188eu/include/hal_intf.h
+++ b/drivers/staging/r8188eu/include/hal_intf.h
@@ -26,7 +26,7 @@ void UpdateHalRAMask8188EUsb(struct adapter *adapt, u32 mac_id, u8 rssi_level);
int rtl8188e_IOL_exec_cmds_sync(struct adapter *adapter,
struct xmit_frame *xmit_frame, u32 max_wating_ms, u32 bndy_cnt);
-unsigned int rtl8188eu_inirp_init(struct adapter *Adapter);
+void rtl8188eu_inirp_init(struct adapter *Adapter);
uint rtw_hal_init(struct adapter *padapter);
uint rtw_hal_deinit(struct adapter *padapter);
--
2.30.2
vcs_setting in struct xmit_priv is not used any more. We can remove it.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/include/rtw_xmit.h | 1 -
drivers/staging/r8188eu/os_dep/os_intfs.c | 1 -
2 files changed, 2 deletions(-)
diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h
index abac0103b53a..cc32167fb4dc 100644
--- a/drivers/staging/r8188eu/include/rtw_xmit.h
+++ b/drivers/staging/r8188eu/include/rtw_xmit.h
@@ -267,7 +267,6 @@ struct xmit_priv {
struct __queue free_xmit_queue;
uint frag_len;
struct adapter *adapter;
- u8 vcs_setting;
u64 tx_bytes;
u64 tx_pkts;
u64 tx_drop;
diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
index f022f6b1cf3e..cfc24420e70c 100644
--- a/drivers/staging/r8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
@@ -392,7 +392,6 @@ static void rtw_init_default_value(struct adapter *padapter)
struct security_priv *psecuritypriv = &padapter->securitypriv;
/* xmit_priv */
- pxmitpriv->vcs_setting = pregistrypriv->vrtl_carrier_sense;
pxmitpriv->frag_len = pregistrypriv->frag_thresh;
/* mlme_priv */
--
2.30.2
beq_cnt in struct xmit_priv is initialised, incremented and decremented
but never read. Remove beq_cnt and resulting dead code.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/core/rtw_xmit.c | 1 -
drivers/staging/r8188eu/include/rtw_xmit.h | 1 -
drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 4 ----
3 files changed, 6 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index d224785a747b..e5ac49441337 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -195,7 +195,6 @@ int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
pxmitpriv->txirp_cnt = 1;
/* per AC pending irp */
- pxmitpriv->beq_cnt = 0;
pxmitpriv->bkq_cnt = 0;
pxmitpriv->viq_cnt = 0;
pxmitpriv->voq_cnt = 0;
diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h
index f8f10c67b764..c84f73f2cc59 100644
--- a/drivers/staging/r8188eu/include/rtw_xmit.h
+++ b/drivers/staging/r8188eu/include/rtw_xmit.h
@@ -282,7 +282,6 @@ struct xmit_priv {
u8 txirp_cnt;/* */
struct tasklet_struct xmit_tasklet;
/* per AC pending irp */
- int beq_cnt;
int bkq_cnt;
int viq_cnt;
int voq_cnt;
diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
index 220e592b757c..067b7def2bde 100644
--- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
@@ -48,9 +48,6 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
case VI_QUEUE_INX:
pxmitpriv->viq_cnt--;
break;
- case BE_QUEUE_INX:
- pxmitpriv->beq_cnt--;
- break;
case BK_QUEUE_INX:
pxmitpriv->bkq_cnt--;
break;
@@ -123,7 +120,6 @@ u32 rtw_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem)
pxmitbuf->flags = VI_QUEUE_INX;
break;
case BE_QUEUE_INX:
- pxmitpriv->beq_cnt++;
pxmitbuf->flags = BE_QUEUE_INX;
break;
case BK_QUEUE_INX:
--
2.30.2
Remove unused defines for Queue Select Value in TxDesc.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/include/rtl8188e_xmit.h | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/drivers/staging/r8188eu/include/rtl8188e_xmit.h b/drivers/staging/r8188eu/include/rtl8188e_xmit.h
index 230ea191d256..e6d343ffc148 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_xmit.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_xmit.h
@@ -5,17 +5,7 @@
#define __RTL8188E_XMIT_H__
#define MAX_TX_AGG_PACKET_NUMBER 0xFF
-/* */
-/* Queue Select Value in TxDesc */
-/* */
-#define QSLT_BK 0x2/* 0x01 */
-#define QSLT_BE 0x0
-#define QSLT_VI 0x5/* 0x4 */
-#define QSLT_VO 0x7/* 0x6 */
-#define QSLT_BEACON 0x10
-#define QSLT_HIGH 0x11
#define QSLT_MGNT 0x12
-#define QSLT_CMD 0x13
/* For 88e early mode */
#define SET_EARLYMODE_PKTNUM(__paddr, __value) \
--
2.30.2
txirp_cnt in struct xmit_priv is initialised but never read. Remove it.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/core/rtw_xmit.c | 2 --
drivers/staging/r8188eu/include/rtw_xmit.h | 1 -
2 files changed, 3 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index 8211b858573f..1cd560630de3 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -192,8 +192,6 @@ int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
for (i = 0; i < 4; i++)
pxmitpriv->wmm_para_seq[i] = i;
- pxmitpriv->txirp_cnt = 1;
-
pxmitpriv->ack_tx = false;
mutex_init(&pxmitpriv->ack_tx_mutex);
rtw_sctx_init(&pxmitpriv->ack_tx_ops, 0);
diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h
index 7e6cf745d913..50d9311d3e40 100644
--- a/drivers/staging/r8188eu/include/rtw_xmit.h
+++ b/drivers/staging/r8188eu/include/rtw_xmit.h
@@ -279,7 +279,6 @@ struct xmit_priv {
u8 wmm_para_seq[4];/* sequence for wmm ac parameter strength
* from large to small. it's value is 0->vo,
* 1->vi, 2->be, 3->bk. */
- u8 txirp_cnt;/* */
struct tasklet_struct xmit_tasklet;
struct __queue free_xmitbuf_queue;
struct __queue pending_xmitbuf_queue;
--
2.30.2
Hi Martin,
Martin Kaiser <[email protected]> says:
> rtl8188eu_inirp_init's return value is not checked by its caller. Make
> rtl8188eu_inirp_init a void function.
>
> Signed-off-by: Martin Kaiser <[email protected]>
> ---
> drivers/staging/r8188eu/hal/usb_halinit.c | 14 +++-----------
> drivers/staging/r8188eu/include/hal_intf.h | 2 +-
> 2 files changed, 4 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
> index d28b4dc2a767..afa24a59fbb3 100644
> --- a/drivers/staging/r8188eu/hal/usb_halinit.c
> +++ b/drivers/staging/r8188eu/hal/usb_halinit.c
> @@ -851,29 +851,21 @@ u32 rtl8188eu_hal_deinit(struct adapter *Adapter)
> return _SUCCESS;
> }
>
> -unsigned int rtl8188eu_inirp_init(struct adapter *Adapter)
> +void rtl8188eu_inirp_init(struct adapter *Adapter)
Hm, shouldn't we actually check return value on caller side?
This thing is called from netdev_open and issues urbs to read data from
the device. So let's imagine that we fail on 1st iteration (for some
reason): netdev_open() says all is OK, but driver does not communicate
with the device.
Maybe these urbs are not that important, tho..
With regards,
Pavel Skripkin
On 1/8/23 19:57, Martin Kaiser wrote:
> Here's another set of xmit cleanups, based on my previous patches.
>
> Martin Kaiser (13):
> staging: r8188eu: beq_cnt is write-only
> staging: r8188eu: bkq_cnt is write-only
> staging: r8188eu: viq_cnt is write-only
> staging: r8188eu: voq_cnt is write-only
> staging: r8188eu: replace switch with if
> staging: r8188eu: make rtl8188eu_inirp_init a void function
> staging: r8188eu: dir_dev is unused
> staging: r8188eu: remove unused hal_xmit_handler define
> staging: r8188eu: txirp_cnt is write-only
> staging: r8188eu: remove unused QSLT defines
> staging: r8188eu: xmit_priv's vcs_type is not used
> staging: r8188eu: xmit_priv's vcs is not used
> staging: r8188eu: xmit_priv's vcs_setting is not used
>
> drivers/staging/r8188eu/core/rtw_mlme.c | 5 ---
> drivers/staging/r8188eu/core/rtw_xmit.c | 42 -------------------
> drivers/staging/r8188eu/hal/usb_halinit.c | 14 ++-----
> drivers/staging/r8188eu/include/drv_types.h | 1 -
> drivers/staging/r8188eu/include/hal_intf.h | 2 +-
> .../staging/r8188eu/include/rtl8188e_xmit.h | 11 -----
> drivers/staging/r8188eu/include/rtw_xmit.h | 10 -----
> drivers/staging/r8188eu/os_dep/os_intfs.c | 3 --
> .../staging/r8188eu/os_dep/usb_ops_linux.c | 23 +---------
> 9 files changed, 5 insertions(+), 106 deletions(-)
>
When applying first the 4 patche series and then the 20 patche series
this series is working.
Tested-by: Philipp Hortmann <[email protected]> # Edimax N150
Hi Pavel,
Thus wrote Pavel Skripkin ([email protected]):
> Martin Kaiser <[email protected]> says:
> > rtl8188eu_inirp_init's return value is not checked by its caller. Make
> > rtl8188eu_inirp_init a void function.
> Hm, shouldn't we actually check return value on caller side?
> This thing is called from netdev_open and issues urbs to read data from the
> device. So let's imagine that we fail on 1st iteration (for some reason):
> netdev_open() says all is OK, but driver does not communicate with the
> device.
your're right. It makes sense to relay the return value to _netdev_open.
We'd have to update/remove the intf_start pointer and usb_intf_start.
I'll resend the series without this patch and submit new patches for
relaying the error code.
Thanks & best regards,
Martin
Here's another set of xmit cleanups, based on my previous patches.
changes in v2:
- drop "make rtl8188eu_inirp_init a void function" patch
(we should relay the return value instead of discarding it)
Martin Kaiser (12):
staging: r8188eu: beq_cnt is write-only
staging: r8188eu: bkq_cnt is write-only
staging: r8188eu: viq_cnt is write-only
staging: r8188eu: voq_cnt is write-only
staging: r8188eu: replace switch with if
staging: r8188eu: dir_dev is unused
staging: r8188eu: remove unused hal_xmit_handler define
staging: r8188eu: txirp_cnt is write-only
staging: r8188eu: remove unused QSLT defines
staging: r8188eu: xmit_priv's vcs_type is not used
staging: r8188eu: xmit_priv's vcs is not used
staging: r8188eu: xmit_priv's vcs_setting is not used
drivers/staging/r8188eu/core/rtw_mlme.c | 5 ---
drivers/staging/r8188eu/core/rtw_xmit.c | 42 -------------------
drivers/staging/r8188eu/include/drv_types.h | 1 -
.../staging/r8188eu/include/rtl8188e_xmit.h | 11 -----
drivers/staging/r8188eu/include/rtw_xmit.h | 10 -----
drivers/staging/r8188eu/os_dep/os_intfs.c | 3 --
.../staging/r8188eu/os_dep/usb_ops_linux.c | 23 +---------
7 files changed, 1 insertion(+), 94 deletions(-)
--
2.30.2
viq_cnt in struct xmit_priv is initialised, incremented and decremented
but never read. Remove viq_cnt and resulting dead code.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/core/rtw_xmit.c | 1 -
drivers/staging/r8188eu/include/rtw_xmit.h | 1 -
drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 4 ----
3 files changed, 6 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index 875675656d11..1319a7fce8b3 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -195,7 +195,6 @@ int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
pxmitpriv->txirp_cnt = 1;
/* per AC pending irp */
- pxmitpriv->viq_cnt = 0;
pxmitpriv->voq_cnt = 0;
pxmitpriv->ack_tx = false;
diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h
index 3d56c3afaf7d..71a7fb33b0d0 100644
--- a/drivers/staging/r8188eu/include/rtw_xmit.h
+++ b/drivers/staging/r8188eu/include/rtw_xmit.h
@@ -282,7 +282,6 @@ struct xmit_priv {
u8 txirp_cnt;/* */
struct tasklet_struct xmit_tasklet;
/* per AC pending irp */
- int viq_cnt;
int voq_cnt;
struct __queue free_xmitbuf_queue;
struct __queue pending_xmitbuf_queue;
diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
index 5ae09edf9174..7929b7d5e89e 100644
--- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
@@ -45,9 +45,6 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
case VO_QUEUE_INX:
pxmitpriv->voq_cnt--;
break;
- case VI_QUEUE_INX:
- pxmitpriv->viq_cnt--;
- break;
case HIGH_QUEUE_INX:
rtw_chk_hi_queue_cmd(padapter);
break;
@@ -113,7 +110,6 @@ u32 rtw_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem)
pxmitbuf->flags = VO_QUEUE_INX;
break;
case VI_QUEUE_INX:
- pxmitpriv->viq_cnt++;
pxmitbuf->flags = VI_QUEUE_INX;
break;
case BE_QUEUE_INX:
--
2.30.2
hal_xmit_handler is not used by the r8188eu driver. Remove it.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/include/rtl8188e_xmit.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/r8188eu/include/rtl8188e_xmit.h b/drivers/staging/r8188eu/include/rtl8188e_xmit.h
index 82439f52b0c8..230ea191d256 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_xmit.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_xmit.h
@@ -134,7 +134,6 @@ void rtl8188e_fill_fake_txdesc(struct adapter *padapter, u8 *pDesc,
s32 rtl8188eu_hal_xmit(struct adapter *padapter, struct xmit_frame *frame);
s32 rtl8188eu_mgnt_xmit(struct adapter *padapter, struct xmit_frame *frame);
s32 rtl8188eu_xmit_buf_handler(struct adapter *padapter);
-#define hal_xmit_handler rtl8188eu_xmit_buf_handler
void rtl8188eu_xmit_tasklet(unsigned long priv);
bool rtl8188eu_xmitframe_complete(struct adapter *padapter,
struct xmit_priv *pxmitpriv);
--
2.30.2
The vcs_type component of struct xmit_priv is not used. Remove it.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/include/rtw_xmit.h | 1 -
drivers/staging/r8188eu/os_dep/os_intfs.c | 1 -
2 files changed, 2 deletions(-)
diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h
index 50d9311d3e40..77d79c43209f 100644
--- a/drivers/staging/r8188eu/include/rtw_xmit.h
+++ b/drivers/staging/r8188eu/include/rtw_xmit.h
@@ -269,7 +269,6 @@ struct xmit_priv {
struct adapter *adapter;
u8 vcs_setting;
u8 vcs;
- u8 vcs_type;
u64 tx_bytes;
u64 tx_pkts;
u64 tx_drop;
diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
index 2f59bb994796..ae03d39de092 100644
--- a/drivers/staging/r8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
@@ -394,7 +394,6 @@ static void rtw_init_default_value(struct adapter *padapter)
/* xmit_priv */
pxmitpriv->vcs_setting = pregistrypriv->vrtl_carrier_sense;
pxmitpriv->vcs = pregistrypriv->vcs_type;
- pxmitpriv->vcs_type = pregistrypriv->vcs_type;
pxmitpriv->frag_len = pregistrypriv->frag_thresh;
/* mlme_priv */
--
2.30.2
On 1/9/23 22:28, Martin Kaiser wrote:
> Here's another set of xmit cleanups, based on my previous patches.
>
> changes in v2:
> - drop "make rtl8188eu_inirp_init a void function" patch
> (we should relay the return value instead of discarding it)
>
> Martin Kaiser (12):
> staging: r8188eu: beq_cnt is write-only
> staging: r8188eu: bkq_cnt is write-only
> staging: r8188eu: viq_cnt is write-only
> staging: r8188eu: voq_cnt is write-only
> staging: r8188eu: replace switch with if
> staging: r8188eu: dir_dev is unused
> staging: r8188eu: remove unused hal_xmit_handler define
> staging: r8188eu: txirp_cnt is write-only
> staging: r8188eu: remove unused QSLT defines
> staging: r8188eu: xmit_priv's vcs_type is not used
> staging: r8188eu: xmit_priv's vcs is not used
> staging: r8188eu: xmit_priv's vcs_setting is not used
>
> drivers/staging/r8188eu/core/rtw_mlme.c | 5 ---
> drivers/staging/r8188eu/core/rtw_xmit.c | 42 -------------------
> drivers/staging/r8188eu/include/drv_types.h | 1 -
> .../staging/r8188eu/include/rtl8188e_xmit.h | 11 -----
> drivers/staging/r8188eu/include/rtw_xmit.h | 10 -----
> drivers/staging/r8188eu/os_dep/os_intfs.c | 3 --
> .../staging/r8188eu/os_dep/usb_ops_linux.c | 23 +---------
> 7 files changed, 1 insertion(+), 94 deletions(-)
>
When applying first the 4 patch series and then the 20 patch series this
series is working.
Tested-by: Philipp Hortmann <[email protected]> # Edimax N150
Hi Martin,
Martin Kaiser <[email protected]> says:
> Here's another set of xmit cleanups, based on my previous patches.
>
> changes in v2:
> - drop "make rtl8188eu_inirp_init a void function" patch
> (we should relay the return value instead of discarding it)
>
> Martin Kaiser (12):
> staging: r8188eu: beq_cnt is write-only
> staging: r8188eu: bkq_cnt is write-only
> staging: r8188eu: viq_cnt is write-only
> staging: r8188eu: voq_cnt is write-only
> staging: r8188eu: replace switch with if
> staging: r8188eu: dir_dev is unused
> staging: r8188eu: remove unused hal_xmit_handler define
> staging: r8188eu: txirp_cnt is write-only
> staging: r8188eu: remove unused QSLT defines
> staging: r8188eu: xmit_priv's vcs_type is not used
> staging: r8188eu: xmit_priv's vcs is not used
> staging: r8188eu: xmit_priv's vcs_setting is not used
>
> drivers/staging/r8188eu/core/rtw_mlme.c | 5 ---
> drivers/staging/r8188eu/core/rtw_xmit.c | 42 -------------------
> drivers/staging/r8188eu/include/drv_types.h | 1 -
> .../staging/r8188eu/include/rtl8188e_xmit.h | 11 -----
> drivers/staging/r8188eu/include/rtw_xmit.h | 10 -----
> drivers/staging/r8188eu/os_dep/os_intfs.c | 3 --
> .../staging/r8188eu/os_dep/usb_ops_linux.c | 23 +---------
> 7 files changed, 1 insertion(+), 94 deletions(-)
>
Acked-by: Pavel Skripkin <[email protected]>
Thanks for the update!
With regards,
Pavel Skripkin