Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /******************************************************************************
0003  * rtl8712_io.c
0004  *
0005  * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved.
0006  * Linux device driver for RTL8192SU
0007  *
0008  * Modifications for inclusion into the Linux staging tree are
0009  * Copyright(c) 2010 Larry Finger. All rights reserved.
0010  *
0011  * Contact information:
0012  * WLAN FAE <wlanfae@realtek.com>.
0013  * Larry Finger <Larry.Finger@lwfinger.net>
0014  *
0015  ******************************************************************************/
0016 
0017 #define _RTL8712_IO_C_
0018 
0019 #include "osdep_service.h"
0020 #include "drv_types.h"
0021 #include "rtl871x_io.h"
0022 #include "osdep_intf.h"
0023 #include "usb_ops.h"
0024 
0025 u8 r8712_read8(struct _adapter *adapter, u32 addr)
0026 {
0027     struct intf_hdl *hdl = &adapter->pio_queue->intf;
0028 
0029     return hdl->io_ops._read8(hdl, addr);
0030 }
0031 
0032 u16 r8712_read16(struct _adapter *adapter, u32 addr)
0033 {
0034     struct intf_hdl *hdl = &adapter->pio_queue->intf;
0035 
0036     return hdl->io_ops._read16(hdl, addr);
0037 }
0038 
0039 u32 r8712_read32(struct _adapter *adapter, u32 addr)
0040 {
0041     struct intf_hdl *hdl = &adapter->pio_queue->intf;
0042 
0043     return hdl->io_ops._read32(hdl, addr);
0044 }
0045 
0046 void r8712_write8(struct _adapter *adapter, u32 addr, u8 val)
0047 {
0048     struct intf_hdl *hdl = &adapter->pio_queue->intf;
0049 
0050     hdl->io_ops._write8(hdl, addr, val);
0051 }
0052 
0053 void r8712_write16(struct _adapter *adapter, u32 addr, u16 val)
0054 {
0055     struct intf_hdl *hdl = &adapter->pio_queue->intf;
0056 
0057     hdl->io_ops._write16(hdl, addr, val);
0058 }
0059 
0060 void r8712_write32(struct _adapter *adapter, u32 addr, u32 val)
0061 {
0062     struct intf_hdl *hdl = &adapter->pio_queue->intf;
0063 
0064     hdl->io_ops._write32(hdl, addr, val);
0065 }
0066 
0067 void r8712_read_mem(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
0068 {
0069     struct intf_hdl *hdl = &adapter->pio_queue->intf;
0070 
0071     if (adapter->driver_stopped || adapter->surprise_removed)
0072         return;
0073 
0074     hdl->io_ops._read_mem(hdl, addr, cnt, pmem);
0075 }
0076 
0077 void r8712_write_mem(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
0078 {
0079     struct intf_hdl *hdl = &adapter->pio_queue->intf;
0080 
0081     hdl->io_ops._write_mem(hdl, addr, cnt, pmem);
0082 }
0083 
0084 void r8712_read_port(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
0085 {
0086     struct intf_hdl *hdl = &adapter->pio_queue->intf;
0087 
0088     if (adapter->driver_stopped || adapter->surprise_removed)
0089         return;
0090 
0091     hdl->io_ops._read_port(hdl, addr, cnt, pmem);
0092 }
0093 
0094 void r8712_write_port(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
0095 {
0096     struct intf_hdl *hdl = &adapter->pio_queue->intf;
0097 
0098     hdl->io_ops._write_port(hdl, addr, cnt, pmem);
0099 }