1 // SPDX-License-Identifier: GPL-2.0
2 /******************************************************************************
5 * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved.
6 * Linux device driver for RTL8192SU
8 * Modifications for inclusion into the Linux staging tree are
9 * Copyright(c) 2010 Larry Finger. All rights reserved.
11 * Contact information:
15 ******************************************************************************/
17 #define _RTL8712_IO_C_
19 #include "osdep_service.h"
20 #include "drv_types.h"
21 #include "rtl871x_io.h"
22 #include "osdep_intf.h"
25 u8 r8712_read8(struct _adapter *adapter, u32 addr)
27 struct intf_hdl *hdl = &adapter->pio_queue->intf;
29 return hdl->io_ops._read8(hdl, addr);
32 u16 r8712_read16(struct _adapter *adapter, u32 addr)
34 struct intf_hdl *hdl = &adapter->pio_queue->intf;
36 return hdl->io_ops._read16(hdl, addr);
39 u32 r8712_read32(struct _adapter *adapter, u32 addr)
41 struct intf_hdl *hdl = &adapter->pio_queue->intf;
43 return hdl->io_ops._read32(hdl, addr);
46 void r8712_write8(struct _adapter *adapter, u32 addr, u8 val)
48 struct intf_hdl *hdl = &adapter->pio_queue->intf;
50 hdl->io_ops._write8(hdl, addr, val);
53 void r8712_write16(struct _adapter *adapter, u32 addr, u16 val)
55 struct intf_hdl *hdl = &adapter->pio_queue->intf;
57 hdl->io_ops._write16(hdl, addr, val);
60 void r8712_write32(struct _adapter *adapter, u32 addr, u32 val)
62 struct intf_hdl *hdl = &adapter->pio_queue->intf;
64 hdl->io_ops._write32(hdl, addr, val);
67 void r8712_read_mem(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
69 struct intf_hdl *hdl = &adapter->pio_queue->intf;
71 if (adapter->driver_stopped || adapter->surprise_removed)
74 hdl->io_ops._read_mem(hdl, addr, cnt, pmem);
77 void r8712_write_mem(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
79 struct intf_hdl *hdl = &adapter->pio_queue->intf;
81 hdl->io_ops._write_mem(hdl, addr, cnt, pmem);
84 void r8712_read_port(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
86 struct intf_hdl *hdl = &adapter->pio_queue->intf;
88 if (adapter->driver_stopped || adapter->surprise_removed)
91 hdl->io_ops._read_port(hdl, addr, cnt, pmem);
94 void r8712_write_port(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
96 struct intf_hdl *hdl = &adapter->pio_queue->intf;
98 hdl->io_ops._write_port(hdl, addr, cnt, pmem);