Teemu Paasikivi | 521a5b2 | 2010-02-18 13:25:54 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of wl1271 |
| 3 | * |
| 4 | * Copyright (C) 1998-2009 Texas Instruments. All rights reserved. |
| 5 | * Copyright (C) 2008-2010 Nokia Corporation |
| 6 | * |
| 7 | * Contact: Luciano Coelho <luciano.coelho@nokia.com> |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License |
| 11 | * version 2 as published by the Free Software Foundation. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, but |
| 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 | * General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
| 21 | * 02110-1301 USA |
| 22 | * |
| 23 | */ |
| 24 | |
| 25 | #ifndef __WL1271_IO_H__ |
| 26 | #define __WL1271_IO_H__ |
| 27 | |
| 28 | struct wl1271; |
| 29 | |
Teemu Paasikivi | 54f7e50 | 2010-02-22 08:38:22 +0200 | [diff] [blame^] | 30 | void wl1271_disable_interrupts(struct wl1271 *wl); |
| 31 | void wl1271_enable_interrupts(struct wl1271 *wl); |
| 32 | |
Teemu Paasikivi | 9b28072 | 2010-02-18 13:25:56 +0200 | [diff] [blame] | 33 | void wl1271_io_reset(struct wl1271 *wl); |
| 34 | void wl1271_io_init(struct wl1271 *wl); |
Teemu Paasikivi | 521a5b2 | 2010-02-18 13:25:54 +0200 | [diff] [blame] | 35 | |
| 36 | /* Raw target IO, address is not translated */ |
| 37 | void wl1271_raw_write(struct wl1271 *wl, int addr, void *buf, |
| 38 | size_t len, bool fixed); |
| 39 | void wl1271_raw_read(struct wl1271 *wl, int addr, void *buf, |
| 40 | size_t len, bool fixed); |
| 41 | |
Teemu Paasikivi | 7b048c5 | 2010-02-18 13:25:55 +0200 | [diff] [blame] | 42 | /* Translated target IO */ |
| 43 | void wl1271_read(struct wl1271 *wl, int addr, void *buf, size_t len, |
| 44 | bool fixed); |
| 45 | void wl1271_write(struct wl1271 *wl, int addr, void *buf, size_t len, |
| 46 | bool fixed); |
| 47 | u32 wl1271_read32(struct wl1271 *wl, int addr); |
| 48 | void wl1271_write32(struct wl1271 *wl, int addr, u32 val); |
| 49 | |
| 50 | /* Top Register IO */ |
| 51 | void wl1271_top_reg_write(struct wl1271 *wl, int addr, u16 val); |
| 52 | u16 wl1271_top_reg_read(struct wl1271 *wl, int addr); |
| 53 | |
| 54 | int wl1271_set_partition(struct wl1271 *wl, |
| 55 | struct wl1271_partition_set *p); |
| 56 | |
| 57 | static inline u32 wl1271_raw_read32(struct wl1271 *wl, int addr) |
| 58 | { |
| 59 | wl1271_raw_read(wl, addr, &wl->buffer_32, |
| 60 | sizeof(wl->buffer_32), false); |
| 61 | |
| 62 | return wl->buffer_32; |
| 63 | } |
| 64 | |
| 65 | static inline void wl1271_raw_write32(struct wl1271 *wl, int addr, u32 val) |
| 66 | { |
| 67 | wl->buffer_32 = val; |
| 68 | wl1271_raw_write(wl, addr, &wl->buffer_32, |
| 69 | sizeof(wl->buffer_32), false); |
| 70 | } |
Teemu Paasikivi | 2d5e82b | 2010-02-22 08:38:21 +0200 | [diff] [blame] | 71 | |
| 72 | /* Functions from wl1271_main.c */ |
| 73 | |
| 74 | int wl1271_register_hw(struct wl1271 *wl); |
| 75 | int wl1271_init_ieee80211(struct wl1271 *wl); |
| 76 | struct ieee80211_hw *wl1271_alloc_hw(void); |
| 77 | int wl1271_free_hw(struct wl1271 *wl); |
| 78 | |
Teemu Paasikivi | 521a5b2 | 2010-02-18 13:25:54 +0200 | [diff] [blame] | 79 | #endif |