Ivo van Doorn | 95ea362 | 2007-09-25 17:57:13 -0700 | [diff] [blame] | 1 | /* |
| 2 | Copyright (C) 2004 - 2007 rt2x00 SourceForge Project |
| 3 | <http://rt2x00.serialmonkey.com> |
| 4 | |
| 5 | This program is free software; you can redistribute it and/or modify |
| 6 | it under the terms of the GNU General Public License as published by |
| 7 | the Free Software Foundation; either version 2 of the License, or |
| 8 | (at your option) any later version. |
| 9 | |
| 10 | This program is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | GNU General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU General Public License |
| 16 | along with this program; if not, write to the |
| 17 | Free Software Foundation, Inc., |
| 18 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 19 | */ |
| 20 | |
| 21 | /* |
| 22 | Module: rt2x00lib |
| 23 | Abstract: Data structures and definitions for the rt2x00lib module. |
| 24 | */ |
| 25 | |
| 26 | #ifndef RT2X00LIB_H |
| 27 | #define RT2X00LIB_H |
| 28 | |
| 29 | /* |
| 30 | * Interval defines |
Ivo van Doorn | 81873e9 | 2007-10-06 14:14:06 +0200 | [diff] [blame] | 31 | * Both the link tuner as the rfkill will be called once per second. |
Ivo van Doorn | 95ea362 | 2007-09-25 17:57:13 -0700 | [diff] [blame] | 32 | */ |
Anton Blanchard | b239bd7 | 2007-10-15 00:40:34 -0500 | [diff] [blame] | 33 | #define LINK_TUNE_INTERVAL ( round_jiffies_relative(HZ) ) |
Ivo van Doorn | 81873e9 | 2007-10-06 14:14:06 +0200 | [diff] [blame] | 34 | #define RFKILL_POLL_INTERVAL ( 1000 ) |
Ivo van Doorn | 95ea362 | 2007-09-25 17:57:13 -0700 | [diff] [blame] | 35 | |
| 36 | /* |
| 37 | * Radio control handlers. |
| 38 | */ |
| 39 | int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev); |
| 40 | void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev); |
Ivo van Doorn | 5cbf830 | 2007-10-06 14:16:09 +0200 | [diff] [blame] | 41 | void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, enum dev_state state); |
Ivo van Doorn | 95ea362 | 2007-09-25 17:57:13 -0700 | [diff] [blame] | 42 | void rt2x00lib_reset_link_tuner(struct rt2x00_dev *rt2x00dev); |
| 43 | |
| 44 | /* |
| 45 | * Initialization handlers. |
| 46 | */ |
Ivo van Doorn | e37ea21 | 2008-01-06 23:40:07 +0100 | [diff] [blame] | 47 | int rt2x00lib_start(struct rt2x00_dev *rt2x00dev); |
| 48 | void rt2x00lib_stop(struct rt2x00_dev *rt2x00dev); |
Ivo van Doorn | 95ea362 | 2007-09-25 17:57:13 -0700 | [diff] [blame] | 49 | |
| 50 | /* |
| 51 | * Configuration handlers. |
| 52 | */ |
| 53 | void rt2x00lib_config_mac_addr(struct rt2x00_dev *rt2x00dev, u8 *mac); |
| 54 | void rt2x00lib_config_bssid(struct rt2x00_dev *rt2x00dev, u8 *bssid); |
Ivo van Doorn | feb2469 | 2007-10-06 14:14:29 +0200 | [diff] [blame] | 55 | void rt2x00lib_config_type(struct rt2x00_dev *rt2x00dev, const int type); |
Ivo van Doorn | 69f81a2 | 2007-10-13 16:26:36 +0200 | [diff] [blame] | 56 | void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev, |
| 57 | enum antenna rx, enum antenna tx); |
Ivo van Doorn | 066cb63 | 2007-09-25 20:55:39 +0200 | [diff] [blame] | 58 | void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, |
| 59 | struct ieee80211_conf *conf, const int force_config); |
Ivo van Doorn | 95ea362 | 2007-09-25 17:57:13 -0700 | [diff] [blame] | 60 | |
| 61 | /* |
| 62 | * Firmware handlers. |
| 63 | */ |
| 64 | #ifdef CONFIG_RT2X00_LIB_FIRMWARE |
| 65 | int rt2x00lib_load_firmware(struct rt2x00_dev *rt2x00dev); |
| 66 | void rt2x00lib_free_firmware(struct rt2x00_dev *rt2x00dev); |
| 67 | #else |
| 68 | static inline int rt2x00lib_load_firmware(struct rt2x00_dev *rt2x00dev) |
| 69 | { |
| 70 | return 0; |
| 71 | } |
| 72 | static inline void rt2x00lib_free_firmware(struct rt2x00_dev *rt2x00dev) |
| 73 | { |
| 74 | } |
| 75 | #endif /* CONFIG_RT2X00_LIB_FIRMWARE */ |
| 76 | |
| 77 | /* |
| 78 | * Debugfs handlers. |
| 79 | */ |
| 80 | #ifdef CONFIG_RT2X00_LIB_DEBUGFS |
| 81 | void rt2x00debug_register(struct rt2x00_dev *rt2x00dev); |
| 82 | void rt2x00debug_deregister(struct rt2x00_dev *rt2x00dev); |
Ivo van Doorn | 4d8dd66 | 2007-11-27 21:49:29 +0100 | [diff] [blame] | 83 | void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb); |
Ivo van Doorn | 95ea362 | 2007-09-25 17:57:13 -0700 | [diff] [blame] | 84 | #else |
| 85 | static inline void rt2x00debug_register(struct rt2x00_dev *rt2x00dev) |
| 86 | { |
| 87 | } |
| 88 | |
| 89 | static inline void rt2x00debug_deregister(struct rt2x00_dev *rt2x00dev) |
| 90 | { |
| 91 | } |
Ivo van Doorn | 4d8dd66 | 2007-11-27 21:49:29 +0100 | [diff] [blame] | 92 | |
| 93 | static inline void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev, |
John W. Linville | 2b1ea59 | 2007-12-04 17:24:35 -0500 | [diff] [blame] | 94 | struct sk_buff *skb) |
Ivo van Doorn | 4d8dd66 | 2007-11-27 21:49:29 +0100 | [diff] [blame] | 95 | { |
| 96 | } |
Ivo van Doorn | 95ea362 | 2007-09-25 17:57:13 -0700 | [diff] [blame] | 97 | #endif /* CONFIG_RT2X00_LIB_DEBUGFS */ |
| 98 | |
| 99 | /* |
| 100 | * RFkill handlers. |
| 101 | */ |
| 102 | #ifdef CONFIG_RT2X00_LIB_RFKILL |
Ivo van Doorn | 1682fe6 | 2008-03-13 15:38:03 +0100 | [diff] [blame^] | 103 | void rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev); |
Ivo van Doorn | 95ea362 | 2007-09-25 17:57:13 -0700 | [diff] [blame] | 104 | void rt2x00rfkill_unregister(struct rt2x00_dev *rt2x00dev); |
Ivo van Doorn | 1682fe6 | 2008-03-13 15:38:03 +0100 | [diff] [blame^] | 105 | void rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev); |
Ivo van Doorn | 95ea362 | 2007-09-25 17:57:13 -0700 | [diff] [blame] | 106 | void rt2x00rfkill_free(struct rt2x00_dev *rt2x00dev); |
Ivo van Doorn | 1682fe6 | 2008-03-13 15:38:03 +0100 | [diff] [blame^] | 107 | void rt2x00rfkill_suspend(struct rt2x00_dev *rt2x00dev); |
| 108 | void rt2x00rfkill_resume(struct rt2x00_dev *rt2x00dev); |
Ivo van Doorn | 95ea362 | 2007-09-25 17:57:13 -0700 | [diff] [blame] | 109 | #else |
Ivo van Doorn | 1682fe6 | 2008-03-13 15:38:03 +0100 | [diff] [blame^] | 110 | static inline void rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev) |
Ivo van Doorn | 95ea362 | 2007-09-25 17:57:13 -0700 | [diff] [blame] | 111 | { |
Ivo van Doorn | 95ea362 | 2007-09-25 17:57:13 -0700 | [diff] [blame] | 112 | } |
| 113 | |
| 114 | static inline void rt2x00rfkill_unregister(struct rt2x00_dev *rt2x00dev) |
| 115 | { |
| 116 | } |
| 117 | |
Ivo van Doorn | 1682fe6 | 2008-03-13 15:38:03 +0100 | [diff] [blame^] | 118 | static inline void rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev) |
Ivo van Doorn | 95ea362 | 2007-09-25 17:57:13 -0700 | [diff] [blame] | 119 | { |
Ivo van Doorn | 95ea362 | 2007-09-25 17:57:13 -0700 | [diff] [blame] | 120 | } |
| 121 | |
| 122 | static inline void rt2x00rfkill_free(struct rt2x00_dev *rt2x00dev) |
| 123 | { |
| 124 | } |
Ivo van Doorn | 1682fe6 | 2008-03-13 15:38:03 +0100 | [diff] [blame^] | 125 | |
| 126 | static inline void rt2x00rfkill_suspend(struct rt2x00_dev *rt2x00dev) |
| 127 | { |
| 128 | } |
| 129 | |
| 130 | static inline void rt2x00rfkill_resume(struct rt2x00_dev *rt2x00dev) |
| 131 | { |
| 132 | } |
Ivo van Doorn | 95ea362 | 2007-09-25 17:57:13 -0700 | [diff] [blame] | 133 | #endif /* CONFIG_RT2X00_LIB_RFKILL */ |
| 134 | |
| 135 | #endif /* RT2X00LIB_H */ |