Commit | Line | Data |
---|---|---|
2865d42c LF |
1 | /****************************************************************************** |
2 | * rtl8712_io.c | |
3 | * | |
4 | * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved. | |
5 | * Linux device driver for RTL8192SU | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or modify it | |
8 | * under the terms of version 2 of the GNU General Public License as | |
9 | * published by the Free Software Foundation. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, but WITHOUT | |
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
14 | * more details. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License along with | |
17 | * this program; if not, write to the Free Software Foundation, Inc., | |
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | |
19 | * | |
20 | * Modifications for inclusion into the Linux staging tree are | |
21 | * Copyright(c) 2010 Larry Finger. All rights reserved. | |
22 | * | |
23 | * Contact information: | |
24 | * WLAN FAE <wlanfae@realtek.com>. | |
25 | * Larry Finger <Larry.Finger@lwfinger.net> | |
26 | * | |
27 | ******************************************************************************/ | |
28 | ||
29 | #define _RTL8712_IO_C_ | |
30 | ||
31 | #include "osdep_service.h" | |
32 | #include "drv_types.h" | |
33 | #include "rtl871x_io.h" | |
34 | #include "osdep_intf.h" | |
35 | #include "usb_ops.h" | |
36 | ||
37 | u8 r8712_read8(struct _adapter *adapter, u32 addr) | |
38 | { | |
549d33d2 | 39 | struct intf_hdl *hdl = &adapter->pio_queue->intf; |
2865d42c | 40 | |
549d33d2 | 41 | return hdl->io_ops._read8(hdl, addr); |
2865d42c LF |
42 | } |
43 | ||
44 | u16 r8712_read16(struct _adapter *adapter, u32 addr) | |
45 | { | |
549d33d2 | 46 | struct intf_hdl *hdl = &adapter->pio_queue->intf; |
2865d42c | 47 | |
549d33d2 | 48 | return hdl->io_ops._read16(hdl, addr); |
2865d42c LF |
49 | } |
50 | ||
51 | u32 r8712_read32(struct _adapter *adapter, u32 addr) | |
52 | { | |
549d33d2 | 53 | struct intf_hdl *hdl = &adapter->pio_queue->intf; |
2865d42c | 54 | |
549d33d2 | 55 | return hdl->io_ops._read32(hdl, addr); |
2865d42c LF |
56 | } |
57 | ||
58 | void r8712_write8(struct _adapter *adapter, u32 addr, u8 val) | |
59 | { | |
549d33d2 | 60 | struct intf_hdl *hdl = &adapter->pio_queue->intf; |
2865d42c | 61 | |
549d33d2 | 62 | hdl->io_ops._write8(hdl, addr, val); |
2865d42c LF |
63 | } |
64 | ||
65 | void r8712_write16(struct _adapter *adapter, u32 addr, u16 val) | |
66 | { | |
549d33d2 | 67 | struct intf_hdl *hdl = &adapter->pio_queue->intf; |
02a29d2d | 68 | |
549d33d2 | 69 | hdl->io_ops._write16(hdl, addr, val); |
2865d42c LF |
70 | } |
71 | ||
72 | void r8712_write32(struct _adapter *adapter, u32 addr, u32 val) | |
73 | { | |
549d33d2 | 74 | struct intf_hdl *hdl = &adapter->pio_queue->intf; |
2865d42c | 75 | |
549d33d2 | 76 | hdl->io_ops._write32(hdl, addr, val); |
2865d42c LF |
77 | } |
78 | ||
79 | void r8712_read_mem(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem) | |
80 | { | |
549d33d2 | 81 | struct intf_hdl *hdl = &adapter->pio_queue->intf; |
2865d42c | 82 | |
1ca96884 | 83 | if (adapter->bDriverStopped || adapter->bSurpriseRemoved) |
2865d42c | 84 | return; |
549d33d2 MD |
85 | |
86 | hdl->io_ops._read_mem(hdl, addr, cnt, pmem); | |
2865d42c LF |
87 | } |
88 | ||
89 | void r8712_write_mem(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem) | |
90 | { | |
549d33d2 | 91 | struct intf_hdl *hdl = &adapter->pio_queue->intf; |
2865d42c | 92 | |
549d33d2 | 93 | hdl->io_ops._write_mem(hdl, addr, cnt, pmem); |
2865d42c LF |
94 | } |
95 | ||
96 | void r8712_read_port(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem) | |
97 | { | |
549d33d2 | 98 | struct intf_hdl *hdl = &adapter->pio_queue->intf; |
2865d42c | 99 | |
1ca96884 | 100 | if (adapter->bDriverStopped || adapter->bSurpriseRemoved) |
2865d42c | 101 | return; |
549d33d2 MD |
102 | |
103 | hdl->io_ops._read_port(hdl, addr, cnt, pmem); | |
2865d42c LF |
104 | } |
105 | ||
106 | void r8712_write_port(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem) | |
107 | { | |
549d33d2 | 108 | struct intf_hdl *hdl = &adapter->pio_queue->intf; |
2865d42c | 109 | |
549d33d2 | 110 | hdl->io_ops._write_port(hdl, addr, cnt, pmem); |
2865d42c | 111 | } |