linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/20] staging: r8188eu: io cleanup
@ 2023-01-11 19:56 Martin Kaiser
  2023-01-11 19:56 ` [PATCH 01/20] staging: r8188eu: remove struct io_priv Martin Kaiser
                   ` (20 more replies)
  0 siblings, 21 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

Clean up structs and function prototypes related to hardware access.

There's a number of definitions which are not used for usb devices such as
the r8188eu.

As usual, this is based on all the previous patches I sent. (I promise to
send no more patches until the pending ones are merged ;-)

Martin Kaiser (20):
  staging: r8188eu: remove struct io_priv
  staging: r8188eu: remove io function prototypes
  staging: r8188eu: remove ioreq function prototypes
  staging: r8188eu: remove async read function prototypes
  staging: r8188eu: remove async write function prototypes
  staging: r8188eu: remove struct io_queue
  staging: r8188eu: remove attrib function prototypes
  staging: r8188eu: remove rtw_write_scsi function prototype
  staging: r8188eu: remove dev_power_down function prototype
  staging: r8188eu: remove struct reg_protocol_rd
  staging: r8188eu: remove struct reg_protocol_wt
  staging: r8188eu: remove interface handler prototypes
  staging: r8188eu: remove readmem and writemem prototypes
  staging: r8188eu: remove IO defines
  staging: r8188eu: remove struct io_req
  staging: r8188eu: remove usb buffer macros
  staging: r8188eu: pass struct adapter to usb_read
  staging: r8188eu: pass struct adapter to usb_write
  staging: r8188eu: remove struct intf_hdl
  staging: r8188eu: remove struct intf_priv

 drivers/staging/r8188eu/hal/usb_ops_linux.c  |  34 +--
 drivers/staging/r8188eu/include/drv_types.h  |   1 -
 drivers/staging/r8188eu/include/osdep_intf.h |  32 ---
 drivers/staging/r8188eu/include/rtw_io.h     | 255 -------------------
 drivers/staging/r8188eu/os_dep/usb_intf.c    |   9 -
 5 files changed, 9 insertions(+), 322 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 01/20] staging: r8188eu: remove struct io_priv
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 02/20] staging: r8188eu: remove io function prototypes Martin Kaiser
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

struct io_priv has only one member (and a pointer to the enclosing struct
adapter). We can remove struct io_priv and move its member directly into
struct adapter.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/usb_ops_linux.c | 21 +++++++--------------
 drivers/staging/r8188eu/include/drv_types.h |  2 +-
 drivers/staging/r8188eu/include/rtw_io.h    |  5 -----
 drivers/staging/r8188eu/os_dep/usb_intf.c   |  5 +----
 4 files changed, 9 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c
index a238d29a3a46..0deaa5c24ab2 100644
--- a/drivers/staging/r8188eu/hal/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c
@@ -95,8 +95,7 @@ static int usb_write(struct intf_hdl *intf, u16 value, void *data, u8 size)
 
 int __must_check rtw_read8(struct adapter *adapter, u32 addr, u8 *data)
 {
-	struct io_priv *io_priv = &adapter->iopriv;
-	struct intf_hdl *intf = &io_priv->intf;
+	struct intf_hdl *intf = &adapter->intf;
 	u16 value = addr & 0xffff;
 
 	return usb_read(intf, value, data, 1);
@@ -104,8 +103,7 @@ int __must_check rtw_read8(struct adapter *adapter, u32 addr, u8 *data)
 
 int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data)
 {
-	struct io_priv *io_priv = &adapter->iopriv;
-	struct intf_hdl *intf = &io_priv->intf;
+	struct intf_hdl *intf = &adapter->intf;
 	u16 value = addr & 0xffff;
 	__le16 le_data;
 	int res;
@@ -121,8 +119,7 @@ int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data)
 
 int __must_check rtw_read32(struct adapter *adapter, u32 addr, u32 *data)
 {
-	struct io_priv *io_priv = &adapter->iopriv;
-	struct intf_hdl *intf = &io_priv->intf;
+	struct intf_hdl *intf = &adapter->intf;
 	u16 value = addr & 0xffff;
 	__le32 le_data;
 	int res;
@@ -138,8 +135,7 @@ int __must_check rtw_read32(struct adapter *adapter, u32 addr, u32 *data)
 
 int rtw_write8(struct adapter *adapter, u32 addr, u8 val)
 {
-	struct io_priv *io_priv = &adapter->iopriv;
-	struct intf_hdl *intf = &io_priv->intf;
+	struct intf_hdl *intf = &adapter->intf;
 	u16 value = addr & 0xffff;
 	int ret;
 
@@ -150,8 +146,7 @@ int rtw_write8(struct adapter *adapter, u32 addr, u8 val)
 
 int rtw_write16(struct adapter *adapter, u32 addr, u16 val)
 {
-	struct io_priv *io_priv = &adapter->iopriv;
-	struct intf_hdl *intf = &io_priv->intf;
+	struct intf_hdl *intf = &adapter->intf;
 	u16 value = addr & 0xffff;
 	__le16 data = cpu_to_le16(val);
 	int ret;
@@ -163,8 +158,7 @@ int rtw_write16(struct adapter *adapter, u32 addr, u16 val)
 
 int rtw_write32(struct adapter *adapter, u32 addr, u32 val)
 {
-	struct io_priv *io_priv = &adapter->iopriv;
-	struct intf_hdl *intf = &io_priv->intf;
+	struct intf_hdl *intf = &adapter->intf;
 	u16 value = addr & 0xffff;
 	__le32 data = cpu_to_le32(val);
 	int ret;
@@ -176,8 +170,7 @@ int rtw_write32(struct adapter *adapter, u32 addr, u32 val)
 
 int rtw_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *data)
 {
-	struct io_priv *io_priv = &adapter->iopriv;
-	struct intf_hdl *intf = &io_priv->intf;
+	struct intf_hdl *intf = &adapter->intf;
 	u16 value = addr & 0xffff;
 	int ret;
 
diff --git a/drivers/staging/r8188eu/include/drv_types.h b/drivers/staging/r8188eu/include/drv_types.h
index 4803d0c77d70..614673902377 100644
--- a/drivers/staging/r8188eu/include/drv_types.h
+++ b/drivers/staging/r8188eu/include/drv_types.h
@@ -152,7 +152,7 @@ struct adapter {
 	struct	mlme_ext_priv mlmeextpriv;
 	struct	cmd_priv	cmdpriv;
 	struct	evt_priv	evtpriv;
-	struct	io_priv	iopriv;
+	struct	intf_hdl	intf;
 	struct	xmit_priv	xmitpriv;
 	struct	recv_priv	recvpriv;
 	struct	sta_priv	stapriv;
diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index e9744694204b..c15b2e873fd5 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -203,11 +203,6 @@ struct io_queue {
 	struct	intf_hdl	intf;
 };
 
-struct io_priv {
-	struct adapter *padapter;
-	struct intf_hdl intf;
-};
-
 uint ioreq_flush(struct adapter *adapter, struct io_queue *ioqueue);
 void sync_ioreq_enqueue(struct io_req *preq, struct io_queue *ioqueue);
 uint sync_ioreq_flush(struct adapter *adapter, struct io_queue *ioqueue);
diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index 5fbfbcd95de2..1f70e5fee1b2 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -290,7 +290,6 @@ static int rtw_usb_if1_init(struct dvobj_priv *dvobj, struct usb_interface *pusb
 {
 	struct adapter *padapter = NULL;
 	struct net_device *pnetdev = NULL;
-	struct io_priv *piopriv;
 	struct intf_hdl *pintf;
 	int ret;
 
@@ -319,9 +318,7 @@ static int rtw_usb_if1_init(struct dvobj_priv *dvobj, struct usb_interface *pusb
 	padapter->intf_stop = &usb_intf_stop;
 
 	/* step init_io_priv */
-	piopriv = &padapter->iopriv;
-	pintf = &piopriv->intf;
-	piopriv->padapter = padapter;
+	pintf = &padapter->intf;
 	pintf->padapter = padapter;
 	pintf->pintf_dev = adapter_to_dvobj(padapter);
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 02/20] staging: r8188eu: remove io function prototypes
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
  2023-01-11 19:56 ` [PATCH 01/20] staging: r8188eu: remove struct io_priv Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 03/20] staging: r8188eu: remove ioreq " Martin Kaiser
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

Remove some prototypes for io functions which are not present in the
r8188eu driver.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_io.h | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index c15b2e873fd5..18e95bccda49 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -203,12 +203,6 @@ struct io_queue {
 	struct	intf_hdl	intf;
 };
 
-uint ioreq_flush(struct adapter *adapter, struct io_queue *ioqueue);
-void sync_ioreq_enqueue(struct io_req *preq, struct io_queue *ioqueue);
-uint sync_ioreq_flush(struct adapter *adapter, struct io_queue *ioqueue);
-uint free_ioreq(struct io_req *preq, struct io_queue *pio_queue);
-struct io_req *alloc_ioreq(struct io_queue *pio_q);
-
 uint register_intf_hdl(u8 *dev, struct intf_hdl *pintfhdl);
 void unregister_intf_hdl(struct intf_hdl *pintfhdl);
 
@@ -273,11 +267,6 @@ void async_write32(struct adapter *adapter, u32 addr, u32 val,
 void async_write_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
 void async_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
 
-uint alloc_io_queue(struct adapter *adapter);
-void free_io_queue(struct adapter *adapter);
-void async_bus_io(struct io_queue *pio_q);
-void bus_sync_io(struct io_queue *pio_q);
-u32 _ioreq2rwmem(struct io_queue *pio_q);
 void dev_power_down(struct adapter *Adapter, u8 bpwrup);
 
 #endif	/* _RTL8711_IO_H_ */
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 03/20] staging: r8188eu: remove ioreq function prototypes
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
  2023-01-11 19:56 ` [PATCH 01/20] staging: r8188eu: remove struct io_priv Martin Kaiser
  2023-01-11 19:56 ` [PATCH 02/20] staging: r8188eu: remove io function prototypes Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 04/20] staging: r8188eu: remove async read " Martin Kaiser
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

Remove some prototypes for ioreq functions which are not present in the
r8188eu driver.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_io.h | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index 18e95bccda49..1d65c60cbe27 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -227,14 +227,6 @@ void rtw_write_port_cancel(struct adapter *adapter);
 
 void rtw_write_scsi(struct adapter *adapter, u32 cnt, u8 *pmem);
 
-/* ioreq */
-void ioreq_read8(struct adapter *adapter, u32 addr, u8 *pval);
-void ioreq_read16(struct adapter *adapter, u32 addr, u16 *pval);
-void ioreq_read32(struct adapter *adapter, u32 addr, u32 *pval);
-void ioreq_write8(struct adapter *adapter, u32 addr, u8 val);
-void ioreq_write16(struct adapter *adapter, u32 addr, u16 val);
-void ioreq_write32(struct adapter *adapter, u32 addr, u32 val);
-
 uint async_read8(struct adapter *adapter, u32 addr, u8 *pbuff,
 		 void (*_async_io_callback)(struct adapter *padater,
 					    struct io_req *pio_req,
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 04/20] staging: r8188eu: remove async read function prototypes
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (2 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 03/20] staging: r8188eu: remove ioreq " Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 05/20] staging: r8188eu: remove async write " Martin Kaiser
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

Remove some prototypes for async read functions which are not present in
the r8188eu driver.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_io.h | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index 1d65c60cbe27..f9394329b674 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -227,22 +227,6 @@ void rtw_write_port_cancel(struct adapter *adapter);
 
 void rtw_write_scsi(struct adapter *adapter, u32 cnt, u8 *pmem);
 
-uint async_read8(struct adapter *adapter, u32 addr, u8 *pbuff,
-		 void (*_async_io_callback)(struct adapter *padater,
-					    struct io_req *pio_req,
-					    u8 *cnxt), u8 *cnxt);
-uint async_read16(struct adapter *adapter, u32 addr,  u8 *pbuff,
-		  void (*_async_io_callback)(struct adapter *padater,
-					     struct io_req *pio_req,
-					     u8 *cnxt), u8 *cnxt);
-uint async_read32(struct adapter *adapter, u32 addr,  u8 *pbuff,
-		  void (*_async_io_callback)(struct adapter *padater,
-					     struct io_req *pio_req,
-					     u8 *cnxt), u8 *cnxt);
-
-void async_read_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
-void async_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
-
 void async_write8(struct adapter *adapter, u32 addr, u8 val,
 		  void (*_async_io_callback)(struct adapter *padater,
 					     struct io_req *pio_req,
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 05/20] staging: r8188eu: remove async write function prototypes
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (3 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 04/20] staging: r8188eu: remove async read " Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 06/20] staging: r8188eu: remove struct io_queue Martin Kaiser
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

Remove some prototypes for async write functions which are not present in
the r8188eu driver.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_io.h | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index f9394329b674..6ce099e91e20 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -227,22 +227,6 @@ void rtw_write_port_cancel(struct adapter *adapter);
 
 void rtw_write_scsi(struct adapter *adapter, u32 cnt, u8 *pmem);
 
-void async_write8(struct adapter *adapter, u32 addr, u8 val,
-		  void (*_async_io_callback)(struct adapter *padater,
-					     struct io_req *pio_req,
-					     u8 *cnxt), u8 *cnxt);
-void async_write16(struct adapter *adapter, u32 addr, u16 val,
-		   void (*_async_io_callback)(struct adapter *padater,
-					      struct io_req *pio_req,
-					      u8 *cnxt), u8 *cnxt);
-void async_write32(struct adapter *adapter, u32 addr, u32 val,
-		   void (*_async_io_callback)(struct adapter *padater,
-					      struct io_req *pio_req,
-					      u8 *cnxt), u8 *cnxt);
-
-void async_write_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
-void async_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
-
 void dev_power_down(struct adapter *Adapter, u8 bpwrup);
 
 #endif	/* _RTL8711_IO_H_ */
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 06/20] staging: r8188eu: remove struct io_queue
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (4 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 05/20] staging: r8188eu: remove async write " Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 07/20] staging: r8188eu: remove attrib function prototypes Martin Kaiser
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

struct io_queue is not used in the r8188eu driver. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_io.h | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index 6ce099e91e20..7d1f3cc20b57 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -82,7 +82,6 @@
 
 struct intf_priv;
 struct intf_hdl;
-struct io_queue;
 
 struct io_req {
 	struct list_head list;
@@ -188,21 +187,6 @@ struct reg_protocol_wt {
 #endif
 };
 
-/*
-Below is the data structure used by _io_handler
-*/
-
-struct io_queue {
-	spinlock_t lock;
-	struct list_head free_ioreqs;
-	struct list_head pending;	/* The io_req list that will be served
-					 * in the single protocol read/write.*/
-	struct list_head processing;
-	u8	*free_ioreqs_buf; /*  4-byte aligned */
-	u8	*pallocated_free_ioreqs_buf;
-	struct	intf_hdl	intf;
-};
-
 uint register_intf_hdl(u8 *dev, struct intf_hdl *pintfhdl);
 void unregister_intf_hdl(struct intf_hdl *pintfhdl);
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 07/20] staging: r8188eu: remove attrib function prototypes
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (5 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 06/20] staging: r8188eu: remove struct io_queue Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 08/20] staging: r8188eu: remove rtw_write_scsi function prototype Martin Kaiser
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

Remove the prototypes for attrib read and write functions which are not
present in the r8188eu driver.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_io.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index 7d1f3cc20b57..9cf4f233ae60 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -190,9 +190,6 @@ struct reg_protocol_wt {
 uint register_intf_hdl(u8 *dev, struct intf_hdl *pintfhdl);
 void unregister_intf_hdl(struct intf_hdl *pintfhdl);
 
-void _rtw_attrib_read(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
-void _rtw_attrib_write(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
-
 int __must_check rtw_read8(struct adapter *adapter, u32 addr, u8 *data);
 int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data);
 int __must_check rtw_read32(struct adapter *adapter, u32 addr, u32 *data);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 08/20] staging: r8188eu: remove rtw_write_scsi function prototype
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (6 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 07/20] staging: r8188eu: remove attrib function prototypes Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 09/20] staging: r8188eu: remove dev_power_down " Martin Kaiser
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

The rtw_write_scsi function is not present in the r8188eu driver. Remove
its prototype.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_io.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index 9cf4f233ae60..7c4fe273cc0d 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -206,8 +206,6 @@ void _rtw_write_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
 u32 rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
 void rtw_write_port_cancel(struct adapter *adapter);
 
-void rtw_write_scsi(struct adapter *adapter, u32 cnt, u8 *pmem);
-
 void dev_power_down(struct adapter *Adapter, u8 bpwrup);
 
 #endif	/* _RTL8711_IO_H_ */
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 09/20] staging: r8188eu: remove dev_power_down function prototype
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (7 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 08/20] staging: r8188eu: remove rtw_write_scsi function prototype Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 10/20] staging: r8188eu: remove struct reg_protocol_rd Martin Kaiser
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

The dev_power_down function is not present in the r8188eu driver. Remove
its prototype.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_io.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index 7c4fe273cc0d..4800c8249721 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -206,6 +206,4 @@ void _rtw_write_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
 u32 rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
 void rtw_write_port_cancel(struct adapter *adapter);
 
-void dev_power_down(struct adapter *Adapter, u8 bpwrup);
-
 #endif	/* _RTL8711_IO_H_ */
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 10/20] staging: r8188eu: remove struct reg_protocol_rd
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (8 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 09/20] staging: r8188eu: remove dev_power_down " Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 11/20] staging: r8188eu: remove struct reg_protocol_wt Martin Kaiser
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

Remove struct reg_protocol_rd. It's not used in the r8188eu driver.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_io.h | 43 ------------------------
 1 file changed, 43 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index 4800c8249721..858fd9cbb57a 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -102,49 +102,6 @@ struct	intf_hdl {
 	struct dvobj_priv *pintf_dev;
 };
 
-struct reg_protocol_rd {
-#ifdef __LITTLE_ENDIAN
-	/* DW1 */
-	u32		NumOfTrans:4;
-	u32		Reserved1:4;
-	u32		Reserved2:24;
-	/* DW2 */
-	u32		ByteCount:7;
-	u32		WriteEnable:1;		/* 0:read, 1:write */
-	u32		FixOrContinuous:1;	/* 0:continuous, 1: Fix */
-	u32		BurstMode:1;
-	u32		Byte1Access:1;
-	u32		Byte2Access:1;
-	u32		Byte4Access:1;
-	u32		Reserved3:3;
-	u32		Reserved4:16;
-	/* DW3 */
-	u32		BusAddress;
-	/* DW4 */
-	/* u32		Value; */
-#else
-/* DW1 */
-	u32 Reserved1:4;
-	u32 NumOfTrans:4;
-	u32 Reserved2:24;
-	/* DW2 */
-	u32 WriteEnable:1;
-	u32 ByteCount:7;
-	u32 Reserved3:3;
-	u32 Byte4Access:1;
-
-	u32 Byte2Access:1;
-	u32 Byte1Access:1;
-	u32 BurstMode:1;
-	u32 FixOrContinuous:1;
-	u32 Reserved4:16;
-	/* DW3 */
-	u32	BusAddress;
-
-	/* DW4 */
-#endif
-};
-
 struct reg_protocol_wt {
 #ifdef __LITTLE_ENDIAN
 	/* DW1 */
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 11/20] staging: r8188eu: remove struct reg_protocol_wt
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (9 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 10/20] staging: r8188eu: remove struct reg_protocol_rd Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 12/20] staging: r8188eu: remove interface handler prototypes Martin Kaiser
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

Remove struct reg_protocol_wt. It's not used in the r8188eu driver.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_io.h | 42 ------------------------
 1 file changed, 42 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index 858fd9cbb57a..ae290a18e593 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -102,48 +102,6 @@ struct	intf_hdl {
 	struct dvobj_priv *pintf_dev;
 };
 
-struct reg_protocol_wt {
-#ifdef __LITTLE_ENDIAN
-	/* DW1 */
-	u32	NumOfTrans:4;
-	u32	Reserved1:4;
-	u32	Reserved2:24;
-	/* DW2 */
-	u32	ByteCount:7;
-	u32	WriteEnable:1;		/* 0:read, 1:write */
-	u32	FixOrContinuous:1;	/* 0:continuous, 1: Fix */
-	u32	BurstMode:1;
-	u32	Byte1Access:1;
-	u32	Byte2Access:1;
-	u32	Byte4Access:1;
-	u32	Reserved3:3;
-	u32	Reserved4:16;
-	/* DW3 */
-	u32	BusAddress;
-	/* DW4 */
-	u32	Value;
-#else
-	/* DW1 */
-	u32 Reserved1 :4;
-	u32 NumOfTrans:4;
-	u32 Reserved2:24;
-	/* DW2 */
-	u32 WriteEnable:1;
-	u32 ByteCount:7;
-	u32 Reserved3:3;
-	u32 Byte4Access:1;
-	u32 Byte2Access:1;
-	u32 Byte1Access:1;
-	u32 BurstMode:1;
-	u32 FixOrContinuous:1;
-	u32 Reserved4:16;
-	/* DW3 */
-	u32	BusAddress;
-	/* DW4 */
-	u32	Value;
-#endif
-};
-
 uint register_intf_hdl(u8 *dev, struct intf_hdl *pintfhdl);
 void unregister_intf_hdl(struct intf_hdl *pintfhdl);
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 12/20] staging: r8188eu: remove interface handler prototypes
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (10 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 11/20] staging: r8188eu: remove struct reg_protocol_wt Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 13/20] staging: r8188eu: remove readmem and writemem prototypes Martin Kaiser
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

Remove prototypes for interface handler functions. They are not used by
the r8188eu driver.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_io.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index ae290a18e593..c9ddba66d852 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -102,9 +102,6 @@ struct	intf_hdl {
 	struct dvobj_priv *pintf_dev;
 };
 
-uint register_intf_hdl(u8 *dev, struct intf_hdl *pintfhdl);
-void unregister_intf_hdl(struct intf_hdl *pintfhdl);
-
 int __must_check rtw_read8(struct adapter *adapter, u32 addr, u8 *data);
 int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data);
 int __must_check rtw_read32(struct adapter *adapter, u32 addr, u32 *data);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 13/20] staging: r8188eu: remove readmem and writemem prototypes
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (11 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 12/20] staging: r8188eu: remove interface handler prototypes Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 14/20] staging: r8188eu: remove IO defines Martin Kaiser
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

Remove the prototypes for the unused _rtw_read_mem and _rtw_write_mem
functions.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_io.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index c9ddba66d852..95dd66c0be82 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -105,7 +105,6 @@ struct	intf_hdl {
 int __must_check rtw_read8(struct adapter *adapter, u32 addr, u8 *data);
 int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data);
 int __must_check rtw_read32(struct adapter *adapter, u32 addr, u32 *data);
-void _rtw_read_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
 u32 rtw_read_port(struct adapter *adapter, u8 *pmem);
 void rtw_read_port_cancel(struct adapter *adapter);
 
@@ -114,7 +113,6 @@ int rtw_write16(struct adapter *adapter, u32 addr, u16 val);
 int rtw_write32(struct adapter *adapter, u32 addr, u32 val);
 int rtw_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *pdata);
 
-void _rtw_write_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
 u32 rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
 void rtw_write_port_cancel(struct adapter *adapter);
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 14/20] staging: r8188eu: remove IO defines
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (12 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 13/20] staging: r8188eu: remove readmem and writemem prototypes Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 15/20] staging: r8188eu: remove struct io_req Martin Kaiser
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

Remove a couple of IO related defines which are not used in the r8188eu
driver.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_io.h | 58 ------------------------
 1 file changed, 58 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index 95dd66c0be82..749bb1d0eeed 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -22,64 +22,6 @@
 #define rtw_usb_buffer_free(dev, size, addr, dma)			\
 	usb_free_coherent((dev), (size), (addr), (dma))
 
-#define NUM_IOREQ		8
-
-#define MAX_PROT_SZ	(64-16)
-
-#define _IOREADY		0
-#define _IO_WAIT_COMPLETE	1
-#define _IO_WAIT_RSP		2
-
-/*  IO COMMAND TYPE */
-#define _IOSZ_MASK_		(0x7F)
-#define _IO_WRITE_		BIT(7)
-#define _IO_FIXED_		BIT(8)
-#define _IO_BURST_		BIT(9)
-#define _IO_BYTE_		BIT(10)
-#define _IO_HW_			BIT(11)
-#define _IO_WORD_		BIT(12)
-#define _IO_SYNC_		BIT(13)
-#define _IO_CMDMASK_		(0x1F80)
-
-/*
-	For prompt mode accessing, caller shall free io_req
-	Otherwise, io_handler will free io_req
-*/
-
-/*  IO STATUS TYPE */
-#define _IO_ERR_		BIT(2)
-#define _IO_SUCCESS_		BIT(1)
-#define _IO_DONE_		BIT(0)
-
-#define IO_RD32			(_IO_SYNC_ | _IO_WORD_)
-#define IO_RD16			(_IO_SYNC_ | _IO_HW_)
-#define IO_RD8			(_IO_SYNC_ | _IO_BYTE_)
-
-#define IO_RD32_ASYNC		(_IO_WORD_)
-#define IO_RD16_ASYNC		(_IO_HW_)
-#define IO_RD8_ASYNC		(_IO_BYTE_)
-
-#define IO_WR32			(_IO_WRITE_ | _IO_SYNC_ | _IO_WORD_)
-#define IO_WR16			(_IO_WRITE_ | _IO_SYNC_ | _IO_HW_)
-#define IO_WR8			(_IO_WRITE_ | _IO_SYNC_ | _IO_BYTE_)
-
-#define IO_WR32_ASYNC		(_IO_WRITE_ | _IO_WORD_)
-#define IO_WR16_ASYNC		(_IO_WRITE_ | _IO_HW_)
-#define IO_WR8_ASYNC		(_IO_WRITE_ | _IO_BYTE_)
-
-/*
-	Only Sync. burst accessing is provided.
-*/
-
-#define IO_WR_BURST(x)						\
-	(_IO_WRITE_ | _IO_SYNC_ | _IO_BURST_ | ((x) & _IOSZ_MASK_))
-#define IO_RD_BURST(x)						\
-	(_IO_SYNC_ | _IO_BURST_ | ((x) & _IOSZ_MASK_))
-
-/* below is for the intf_option bit defition... */
-
-#define _INTF_ASYNC_	BIT(0)	/* support async io */
-
 struct intf_priv;
 struct intf_hdl;
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 15/20] staging: r8188eu: remove struct io_req
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (13 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 14/20] staging: r8188eu: remove IO defines Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 16/20] staging: r8188eu: remove usb buffer macros Martin Kaiser
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

struct io_req is not needed in the r8188eu driver. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_io.h | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index 749bb1d0eeed..900ed2c648d4 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -25,20 +25,6 @@
 struct intf_priv;
 struct intf_hdl;
 
-struct io_req {
-	struct list_head list;
-	u32	addr;
-	u32	val;
-	u32	command;
-	u32	status;
-	u8	*pbuf;
-	struct semaphore sema;
-
-	void (*_async_io_callback)(struct adapter *padater,
-				   struct io_req *pio_req, u8 *cnxt);
-	u8 *cnxt;
-};
-
 struct	intf_hdl {
 	struct adapter *padapter;
 	struct dvobj_priv *pintf_dev;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 16/20] staging: r8188eu: remove usb buffer macros
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (14 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 15/20] staging: r8188eu: remove struct io_req Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 17/20] staging: r8188eu: pass struct adapter to usb_read Martin Kaiser
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

Remove two unused macros that allocate and free usb buffers.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_io.h | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index 900ed2c648d4..0d2aa432f88d 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -16,12 +16,6 @@
 #include <linux/usb.h>
 #include <linux/usb/ch9.h>
 
-#define rtw_usb_buffer_alloc(dev, size, dma)				\
-	usb_alloc_coherent((dev), (size), (in_interrupt() ?		\
-			   GFP_ATOMIC : GFP_KERNEL), (dma))
-#define rtw_usb_buffer_free(dev, size, addr, dma)			\
-	usb_free_coherent((dev), (size), (addr), (dma))
-
 struct intf_priv;
 struct intf_hdl;
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 17/20] staging: r8188eu: pass struct adapter to usb_read
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (15 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 16/20] staging: r8188eu: remove usb buffer macros Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 18/20] staging: r8188eu: pass struct adapter to usb_write Martin Kaiser
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

The usb_read function takes a struct intf_hdl only to extract the struct
adapter from it. We can pass struct adapter directly.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/usb_ops_linux.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c
index 0deaa5c24ab2..f8900b51d750 100644
--- a/drivers/staging/r8188eu/hal/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c
@@ -7,9 +7,8 @@
 #include "../include/usb_ops.h"
 #include "../include/rtl8188e_hal.h"
 
-static int usb_read(struct intf_hdl *intf, u16 value, void *data, u8 size)
+static int usb_read(struct adapter *adapt, u16 value, void *data, u8 size)
 {
-	struct adapter *adapt = intf->padapter;
 	struct dvobj_priv *dvobjpriv = adapter_to_dvobj(adapt);
 	struct usb_device *udev = dvobjpriv->pusbdev;
 	int status;
@@ -95,20 +94,18 @@ static int usb_write(struct intf_hdl *intf, u16 value, void *data, u8 size)
 
 int __must_check rtw_read8(struct adapter *adapter, u32 addr, u8 *data)
 {
-	struct intf_hdl *intf = &adapter->intf;
 	u16 value = addr & 0xffff;
 
-	return usb_read(intf, value, data, 1);
+	return usb_read(adapter, value, data, 1);
 }
 
 int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data)
 {
-	struct intf_hdl *intf = &adapter->intf;
 	u16 value = addr & 0xffff;
 	__le16 le_data;
 	int res;
 
-	res = usb_read(intf, value, &le_data, 2);
+	res = usb_read(adapter, value, &le_data, 2);
 	if (res)
 		return res;
 
@@ -119,12 +116,11 @@ int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data)
 
 int __must_check rtw_read32(struct adapter *adapter, u32 addr, u32 *data)
 {
-	struct intf_hdl *intf = &adapter->intf;
 	u16 value = addr & 0xffff;
 	__le32 le_data;
 	int res;
 
-	res = usb_read(intf, value, &le_data, 4);
+	res = usb_read(adapter, value, &le_data, 4);
 	if (res)
 		return res;
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 18/20] staging: r8188eu: pass struct adapter to usb_write
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (16 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 17/20] staging: r8188eu: pass struct adapter to usb_read Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-17 18:38   ` Greg Kroah-Hartman
  2023-01-11 19:56 ` [PATCH 19/20] staging: r8188eu: remove struct intf_hdl Martin Kaiser
                   ` (2 subsequent siblings)
  20 siblings, 1 reply; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

The usb_write function takes a struct intf_hdl only to extract the struct
adapter from it. We can pass struct adapter directly.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/usb_ops_linux.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c
index f8900b51d750..2784fc69f7d9 100644
--- a/drivers/staging/r8188eu/hal/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c
@@ -49,9 +49,8 @@ static int usb_read(struct adapter *adapt, u16 value, void *data, u8 size)
 	return status;
 }
 
-static int usb_write(struct intf_hdl *intf, u16 value, void *data, u8 size)
+static int usb_write(struct adapter *adapt, u16 value, void *data, u8 size)
 {
-	struct adapter *adapt = intf->padapter;
 	struct dvobj_priv *dvobjpriv = adapter_to_dvobj(adapt);
 	struct usb_device *udev = dvobjpriv->pusbdev;
 	int status;
@@ -131,49 +130,45 @@ int __must_check rtw_read32(struct adapter *adapter, u32 addr, u32 *data)
 
 int rtw_write8(struct adapter *adapter, u32 addr, u8 val)
 {
-	struct intf_hdl *intf = &adapter->intf;
 	u16 value = addr & 0xffff;
 	int ret;
 
-	ret = usb_write(intf, value, &val, 1);
+	ret = usb_write(adapter, value, &val, 1);
 
 	return RTW_STATUS_CODE(ret);
 }
 
 int rtw_write16(struct adapter *adapter, u32 addr, u16 val)
 {
-	struct intf_hdl *intf = &adapter->intf;
 	u16 value = addr & 0xffff;
 	__le16 data = cpu_to_le16(val);
 	int ret;
 
-	ret = usb_write(intf, value, &data, 2);
+	ret = usb_write(adapter, value, &data, 2);
 
 	return RTW_STATUS_CODE(ret);
 }
 
 int rtw_write32(struct adapter *adapter, u32 addr, u32 val)
 {
-	struct intf_hdl *intf = &adapter->intf;
 	u16 value = addr & 0xffff;
 	__le32 data = cpu_to_le32(val);
 	int ret;
 
-	ret = usb_write(intf, value, &data, 4);
+	ret = usb_write(adapter, value, &data, 4);
 
 	return RTW_STATUS_CODE(ret);
 }
 
 int rtw_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *data)
 {
-	struct intf_hdl *intf = &adapter->intf;
 	u16 value = addr & 0xffff;
 	int ret;
 
 	if (length > VENDOR_CMD_MAX_DATA_LEN)
 		return _FAIL;
 
-	ret = usb_write(intf, value, data, length);
+	ret = usb_write(adapter, value, data, length);
 
 	return RTW_STATUS_CODE(ret);
 }
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 19/20] staging: r8188eu: remove struct intf_hdl
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (17 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 18/20] staging: r8188eu: pass struct adapter to usb_write Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 19:56 ` [PATCH 20/20] staging: r8188eu: remove struct intf_priv Martin Kaiser
  2023-01-11 22:10 ` [PATCH 00/20] staging: r8188eu: io cleanup Philipp Hortmann
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

There are no more users of struct intf_hdl in the r8188eu driver. We can
now remove this struct.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/drv_types.h | 1 -
 drivers/staging/r8188eu/include/rtw_io.h    | 6 ------
 drivers/staging/r8188eu/os_dep/usb_intf.c   | 6 ------
 3 files changed, 13 deletions(-)

diff --git a/drivers/staging/r8188eu/include/drv_types.h b/drivers/staging/r8188eu/include/drv_types.h
index 614673902377..7b170eed66b3 100644
--- a/drivers/staging/r8188eu/include/drv_types.h
+++ b/drivers/staging/r8188eu/include/drv_types.h
@@ -152,7 +152,6 @@ struct adapter {
 	struct	mlme_ext_priv mlmeextpriv;
 	struct	cmd_priv	cmdpriv;
 	struct	evt_priv	evtpriv;
-	struct	intf_hdl	intf;
 	struct	xmit_priv	xmitpriv;
 	struct	recv_priv	recvpriv;
 	struct	sta_priv	stapriv;
diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index 0d2aa432f88d..033ea7146861 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -17,12 +17,6 @@
 #include <linux/usb/ch9.h>
 
 struct intf_priv;
-struct intf_hdl;
-
-struct	intf_hdl {
-	struct adapter *padapter;
-	struct dvobj_priv *pintf_dev;
-};
 
 int __must_check rtw_read8(struct adapter *adapter, u32 addr, u8 *data);
 int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data);
diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index 1f70e5fee1b2..1f114b1fc4d5 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -290,7 +290,6 @@ static int rtw_usb_if1_init(struct dvobj_priv *dvobj, struct usb_interface *pusb
 {
 	struct adapter *padapter = NULL;
 	struct net_device *pnetdev = NULL;
-	struct intf_hdl *pintf;
 	int ret;
 
 	padapter = vzalloc(sizeof(*padapter));
@@ -317,11 +316,6 @@ static int rtw_usb_if1_init(struct dvobj_priv *dvobj, struct usb_interface *pusb
 	padapter->intf_start = &usb_intf_start;
 	padapter->intf_stop = &usb_intf_stop;
 
-	/* step init_io_priv */
-	pintf = &padapter->intf;
-	pintf->padapter = padapter;
-	pintf->pintf_dev = adapter_to_dvobj(padapter);
-
 	/* step read_chip_version */
 	rtl8188e_read_chip_version(padapter);
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 20/20] staging: r8188eu: remove struct intf_priv
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (18 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 19/20] staging: r8188eu: remove struct intf_hdl Martin Kaiser
@ 2023-01-11 19:56 ` Martin Kaiser
  2023-01-11 22:10 ` [PATCH 00/20] staging: r8188eu: io cleanup Philipp Hortmann
  20 siblings, 0 replies; 23+ messages in thread
From: Martin Kaiser @ 2023-01-11 19:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

struct intf_priv is not used in the r8188eu driver. It can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/osdep_intf.h | 32 --------------------
 drivers/staging/r8188eu/include/rtw_io.h     |  2 --
 2 files changed, 34 deletions(-)

diff --git a/drivers/staging/r8188eu/include/osdep_intf.h b/drivers/staging/r8188eu/include/osdep_intf.h
index 6d66cb57225e..457fb3852a19 100644
--- a/drivers/staging/r8188eu/include/osdep_intf.h
+++ b/drivers/staging/r8188eu/include/osdep_intf.h
@@ -7,38 +7,6 @@
 #include "osdep_service.h"
 #include "drv_types.h"
 
-struct intf_priv {
-	u8 *intf_dev;
-	u32	max_iosz;	/* USB2.0: 128, USB1.1: 64, SDIO:64 */
-	u32	max_xmitsz; /* USB2.0: unlimited, SDIO:512 */
-	u32	max_recvsz; /* USB2.0: unlimited, SDIO:512 */
-
-	u8 *io_rwmem;
-	u8 *allocated_io_rwmem;
-	u32	io_wsz; /* unit: 4bytes */
-	u32	io_rsz;/* unit: 4bytes */
-	u8 intf_status;
-
-	void (*_bus_io)(u8 *priv);
-
-/*
-Under Sync. IRP (SDIO/USB)
-A protection mechanism is necessary for the io_rwmem(read/write protocol)
-
-Under Async. IRP (SDIO/USB)
-The protection mechanism is through the pending queue.
-*/
-	struct mutex ioctl_mutex;
-	/*  when in USB, IO is through interrupt in/out endpoints */
-	struct usb_device	*udev;
-	struct urb *piorw_urb;
-	u8 io_irp_cnt;
-	u8 bio_irp_pending;
-	struct timer_list io_timer;
-	u8 bio_irp_timeout;
-	u8 bio_timer_cancel;
-};
-
 int netdev_open(struct net_device *pnetdev);
 int netdev_close(struct net_device *pnetdev);
 
diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h
index 033ea7146861..090555f562f2 100644
--- a/drivers/staging/r8188eu/include/rtw_io.h
+++ b/drivers/staging/r8188eu/include/rtw_io.h
@@ -16,8 +16,6 @@
 #include <linux/usb.h>
 #include <linux/usb/ch9.h>
 
-struct intf_priv;
-
 int __must_check rtw_read8(struct adapter *adapter, u32 addr, u8 *data);
 int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data);
 int __must_check rtw_read32(struct adapter *adapter, u32 addr, u32 *data);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH 00/20] staging: r8188eu: io cleanup
  2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
                   ` (19 preceding siblings ...)
  2023-01-11 19:56 ` [PATCH 20/20] staging: r8188eu: remove struct intf_priv Martin Kaiser
@ 2023-01-11 22:10 ` Philipp Hortmann
  20 siblings, 0 replies; 23+ messages in thread
From: Philipp Hortmann @ 2023-01-11 22:10 UTC (permalink / raw)
  To: Martin Kaiser, Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel

On 1/11/23 20:56, Martin Kaiser wrote:
> Clean up structs and function prototypes related to hardware access.
> 
> There's a number of definitions which are not used for usb devices such as
> the r8188eu.
> 
> As usual, this is based on all the previous patches I sent. (I promise to
> send no more patches until the pending ones are merged ;-)
> 
> Martin Kaiser (20):
>    staging: r8188eu: remove struct io_priv
>    staging: r8188eu: remove io function prototypes
>    staging: r8188eu: remove ioreq function prototypes
>    staging: r8188eu: remove async read function prototypes
>    staging: r8188eu: remove async write function prototypes
>    staging: r8188eu: remove struct io_queue
>    staging: r8188eu: remove attrib function prototypes
>    staging: r8188eu: remove rtw_write_scsi function prototype
>    staging: r8188eu: remove dev_power_down function prototype
>    staging: r8188eu: remove struct reg_protocol_rd
>    staging: r8188eu: remove struct reg_protocol_wt
>    staging: r8188eu: remove interface handler prototypes
>    staging: r8188eu: remove readmem and writemem prototypes
>    staging: r8188eu: remove IO defines
>    staging: r8188eu: remove struct io_req
>    staging: r8188eu: remove usb buffer macros
>    staging: r8188eu: pass struct adapter to usb_read
>    staging: r8188eu: pass struct adapter to usb_write
>    staging: r8188eu: remove struct intf_hdl
>    staging: r8188eu: remove struct intf_priv
> 
>   drivers/staging/r8188eu/hal/usb_ops_linux.c  |  34 +--
>   drivers/staging/r8188eu/include/drv_types.h  |   1 -
>   drivers/staging/r8188eu/include/osdep_intf.h |  32 ---
>   drivers/staging/r8188eu/include/rtw_io.h     | 255 -------------------
>   drivers/staging/r8188eu/os_dep/usb_intf.c    |   9 -
>   5 files changed, 9 insertions(+), 322 deletions(-)
> 

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 18/20] staging: r8188eu: pass struct adapter to usb_write
  2023-01-11 19:56 ` [PATCH 18/20] staging: r8188eu: pass struct adapter to usb_write Martin Kaiser
@ 2023-01-17 18:38   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 23+ messages in thread
From: Greg Kroah-Hartman @ 2023-01-17 18:38 UTC (permalink / raw)
  To: Martin Kaiser
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel

On Wed, Jan 11, 2023 at 08:56:38PM +0100, Martin Kaiser wrote:
> The usb_write function takes a struct intf_hdl only to extract the struct
> adapter from it. We can pass struct adapter directly.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
>  drivers/staging/r8188eu/hal/usb_ops_linux.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)

This commit did not apply to my tree so I stopped here in the series.

Please rebase and resubmit the remaining ones.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2023-01-17 19:40 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-11 19:56 [PATCH 00/20] staging: r8188eu: io cleanup Martin Kaiser
2023-01-11 19:56 ` [PATCH 01/20] staging: r8188eu: remove struct io_priv Martin Kaiser
2023-01-11 19:56 ` [PATCH 02/20] staging: r8188eu: remove io function prototypes Martin Kaiser
2023-01-11 19:56 ` [PATCH 03/20] staging: r8188eu: remove ioreq " Martin Kaiser
2023-01-11 19:56 ` [PATCH 04/20] staging: r8188eu: remove async read " Martin Kaiser
2023-01-11 19:56 ` [PATCH 05/20] staging: r8188eu: remove async write " Martin Kaiser
2023-01-11 19:56 ` [PATCH 06/20] staging: r8188eu: remove struct io_queue Martin Kaiser
2023-01-11 19:56 ` [PATCH 07/20] staging: r8188eu: remove attrib function prototypes Martin Kaiser
2023-01-11 19:56 ` [PATCH 08/20] staging: r8188eu: remove rtw_write_scsi function prototype Martin Kaiser
2023-01-11 19:56 ` [PATCH 09/20] staging: r8188eu: remove dev_power_down " Martin Kaiser
2023-01-11 19:56 ` [PATCH 10/20] staging: r8188eu: remove struct reg_protocol_rd Martin Kaiser
2023-01-11 19:56 ` [PATCH 11/20] staging: r8188eu: remove struct reg_protocol_wt Martin Kaiser
2023-01-11 19:56 ` [PATCH 12/20] staging: r8188eu: remove interface handler prototypes Martin Kaiser
2023-01-11 19:56 ` [PATCH 13/20] staging: r8188eu: remove readmem and writemem prototypes Martin Kaiser
2023-01-11 19:56 ` [PATCH 14/20] staging: r8188eu: remove IO defines Martin Kaiser
2023-01-11 19:56 ` [PATCH 15/20] staging: r8188eu: remove struct io_req Martin Kaiser
2023-01-11 19:56 ` [PATCH 16/20] staging: r8188eu: remove usb buffer macros Martin Kaiser
2023-01-11 19:56 ` [PATCH 17/20] staging: r8188eu: pass struct adapter to usb_read Martin Kaiser
2023-01-11 19:56 ` [PATCH 18/20] staging: r8188eu: pass struct adapter to usb_write Martin Kaiser
2023-01-17 18:38   ` Greg Kroah-Hartman
2023-01-11 19:56 ` [PATCH 19/20] staging: r8188eu: remove struct intf_hdl Martin Kaiser
2023-01-11 19:56 ` [PATCH 20/20] staging: r8188eu: remove struct intf_priv Martin Kaiser
2023-01-11 22:10 ` [PATCH 00/20] staging: r8188eu: io cleanup Philipp Hortmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).