aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-06-07 07:24:21 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-07 07:24:21 -0400
commitb1bc81a0ef86b86fa410dd303d84c8c7bd09a64d (patch)
treea0d2e6dd179e5d057776edd0ed865bc744dfa54d /include
parenta93958ac980f0ce594ad90657ecbc595ff157a40 (diff)
parent0c0c9e7076b69f93678e4ec711e2bf237398e623 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/errno.h2
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/ieee80211.h1
-rw-r--r--include/linux/notifier.h1
-rw-r--r--include/linux/rfkill.h381
-rw-r--r--include/net/cfg80211.h51
-rw-r--r--include/net/mac80211.h26
-rw-r--r--include/net/wimax.h8
8 files changed, 376 insertions, 95 deletions
diff --git a/include/asm-generic/errno.h b/include/asm-generic/errno.h
index e8852c092fea..28cc03bf19e6 100644
--- a/include/asm-generic/errno.h
+++ b/include/asm-generic/errno.h
@@ -106,4 +106,6 @@
106#define EOWNERDEAD 130 /* Owner died */ 106#define EOWNERDEAD 130 /* Owner died */
107#define ENOTRECOVERABLE 131 /* State not recoverable */ 107#define ENOTRECOVERABLE 131 /* State not recoverable */
108 108
109#define ERFKILL 132 /* Operation not possible due to RF-kill */
110
109#endif 111#endif
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 3f0eaa397ef5..7e09c5c1ed02 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -311,6 +311,7 @@ unifdef-y += ptrace.h
311unifdef-y += qnx4_fs.h 311unifdef-y += qnx4_fs.h
312unifdef-y += quota.h 312unifdef-y += quota.h
313unifdef-y += random.h 313unifdef-y += random.h
314unifdef-y += rfkill.h
314unifdef-y += irqnr.h 315unifdef-y += irqnr.h
315unifdef-y += reboot.h 316unifdef-y += reboot.h
316unifdef-y += reiserfs_fs.h 317unifdef-y += reiserfs_fs.h
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 34de8b21f6d4..a9173d5434d1 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1092,6 +1092,7 @@ enum ieee80211_key_len {
1092 WLAN_KEY_LEN_WEP104 = 13, 1092 WLAN_KEY_LEN_WEP104 = 13,
1093 WLAN_KEY_LEN_CCMP = 16, 1093 WLAN_KEY_LEN_CCMP = 16,
1094 WLAN_KEY_LEN_TKIP = 32, 1094 WLAN_KEY_LEN_TKIP = 32,
1095 WLAN_KEY_LEN_AES_CMAC = 16,
1095}; 1096};
1096 1097
1097/* 1098/*
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index b86fa2ffca0c..81bc252dc8ac 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -198,6 +198,7 @@ static inline int notifier_to_errno(int ret)
198#define NETDEV_CHANGENAME 0x000A 198#define NETDEV_CHANGENAME 0x000A
199#define NETDEV_FEAT_CHANGE 0x000B 199#define NETDEV_FEAT_CHANGE 0x000B
200#define NETDEV_BONDING_FAILOVER 0x000C 200#define NETDEV_BONDING_FAILOVER 0x000C
201#define NETDEV_PRE_UP 0x000D
201 202
202#define SYS_DOWN 0x0001 /* Notify of system down */ 203#define SYS_DOWN 0x0001 /* Notify of system down */
203#define SYS_RESTART SYS_DOWN 204#define SYS_RESTART SYS_DOWN
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index de18ef227e00..ee3eddea8568 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -4,6 +4,7 @@
4/* 4/*
5 * Copyright (C) 2006 - 2007 Ivo van Doorn 5 * Copyright (C) 2006 - 2007 Ivo van Doorn
6 * Copyright (C) 2007 Dmitry Torokhov 6 * Copyright (C) 2007 Dmitry Torokhov
7 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
7 * 8 *
8 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 10 * it under the terms of the GNU General Public License as published by
@@ -22,117 +23,341 @@
22 */ 23 */
23 24
24#include <linux/types.h> 25#include <linux/types.h>
25#include <linux/kernel.h> 26
26#include <linux/list.h> 27/* define userspace visible states */
27#include <linux/mutex.h> 28#define RFKILL_STATE_SOFT_BLOCKED 0
28#include <linux/device.h> 29#define RFKILL_STATE_UNBLOCKED 1
29#include <linux/leds.h> 30#define RFKILL_STATE_HARD_BLOCKED 2
30 31
31/** 32/**
32 * enum rfkill_type - type of rfkill switch. 33 * enum rfkill_type - type of rfkill switch.
33 * RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device. 34 *
34 * RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device. 35 * @RFKILL_TYPE_ALL: toggles all switches (userspace only)
35 * RFKILL_TYPE_UWB: switch is on a ultra wideband device. 36 * @RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device.
36 * RFKILL_TYPE_WIMAX: switch is on a WiMAX device. 37 * @RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device.
37 * RFKILL_TYPE_WWAN: switch is on a wireless WAN device. 38 * @RFKILL_TYPE_UWB: switch is on a ultra wideband device.
39 * @RFKILL_TYPE_WIMAX: switch is on a WiMAX device.
40 * @RFKILL_TYPE_WWAN: switch is on a wireless WAN device.
41 * @NUM_RFKILL_TYPES: number of defined rfkill types
38 */ 42 */
39enum rfkill_type { 43enum rfkill_type {
40 RFKILL_TYPE_WLAN , 44 RFKILL_TYPE_ALL = 0,
45 RFKILL_TYPE_WLAN,
41 RFKILL_TYPE_BLUETOOTH, 46 RFKILL_TYPE_BLUETOOTH,
42 RFKILL_TYPE_UWB, 47 RFKILL_TYPE_UWB,
43 RFKILL_TYPE_WIMAX, 48 RFKILL_TYPE_WIMAX,
44 RFKILL_TYPE_WWAN, 49 RFKILL_TYPE_WWAN,
45 RFKILL_TYPE_MAX, 50 NUM_RFKILL_TYPES,
46}; 51};
47 52
48enum rfkill_state { 53/**
49 RFKILL_STATE_SOFT_BLOCKED = 0, /* Radio output blocked */ 54 * enum rfkill_operation - operation types
50 RFKILL_STATE_UNBLOCKED = 1, /* Radio output allowed */ 55 * @RFKILL_OP_ADD: a device was added
51 RFKILL_STATE_HARD_BLOCKED = 2, /* Output blocked, non-overrideable */ 56 * @RFKILL_OP_DEL: a device was removed
52 RFKILL_STATE_MAX, /* marker for last valid state */ 57 * @RFKILL_OP_CHANGE: a device's state changed -- userspace changes one device
58 * @RFKILL_OP_CHANGE_ALL: userspace changes all devices (of a type, or all)
59 */
60enum rfkill_operation {
61 RFKILL_OP_ADD = 0,
62 RFKILL_OP_DEL,
63 RFKILL_OP_CHANGE,
64 RFKILL_OP_CHANGE_ALL,
53}; 65};
54 66
55/** 67/**
56 * struct rfkill - rfkill control structure. 68 * struct rfkill_event - events for userspace on /dev/rfkill
57 * @name: Name of the switch. 69 * @idx: index of dev rfkill
58 * @type: Radio type which the button controls, the value stored 70 * @type: type of the rfkill struct
59 * here should be a value from enum rfkill_type. 71 * @op: operation code
60 * @state: State of the switch, "UNBLOCKED" means radio can operate. 72 * @hard: hard state (0/1)
61 * @mutex: Guards switch state transitions. It serializes callbacks 73 * @soft: soft state (0/1)
62 * and also protects the state. 74 *
63 * @data: Pointer to the RF button drivers private data which will be 75 * Structure used for userspace communication on /dev/rfkill,
64 * passed along when toggling radio state. 76 * used for events from the kernel and control to the kernel.
65 * @toggle_radio(): Mandatory handler to control state of the radio. 77 */
66 * only RFKILL_STATE_SOFT_BLOCKED and RFKILL_STATE_UNBLOCKED are 78struct rfkill_event {
67 * valid parameters. 79 __u32 idx;
68 * @get_state(): handler to read current radio state from hardware, 80 __u8 type;
69 * may be called from atomic context, should return 0 on success. 81 __u8 op;
70 * Either this handler OR judicious use of rfkill_force_state() is 82 __u8 soft, hard;
71 * MANDATORY for any driver capable of RFKILL_STATE_HARD_BLOCKED. 83} __packed;
72 * @led_trigger: A LED trigger for this button's LED.
73 * @dev: Device structure integrating the switch into device tree.
74 * @node: Used to place switch into list of all switches known to the
75 * the system.
76 *
77 * This structure represents a RF switch located on a network device.
78 */
79struct rfkill {
80 const char *name;
81 enum rfkill_type type;
82
83 /* the mutex serializes callbacks and also protects
84 * the state */
85 struct mutex mutex;
86 enum rfkill_state state;
87 void *data;
88 int (*toggle_radio)(void *data, enum rfkill_state state);
89 int (*get_state)(void *data, enum rfkill_state *state);
90 84
91#ifdef CONFIG_RFKILL_LEDS 85/* ioctl for turning off rfkill-input (if present) */
92 struct led_trigger led_trigger; 86#define RFKILL_IOC_MAGIC 'R'
93#endif 87#define RFKILL_IOC_NOINPUT 1
88#define RFKILL_IOCTL_NOINPUT _IO(RFKILL_IOC_MAGIC, RFKILL_IOC_NOINPUT)
94 89
95 struct device dev; 90/* and that's all userspace gets */
96 struct list_head node; 91#ifdef __KERNEL__
97 enum rfkill_state state_for_resume; 92/* don't allow anyone to use these in the kernel */
93enum rfkill_user_states {
94 RFKILL_USER_STATE_SOFT_BLOCKED = RFKILL_STATE_SOFT_BLOCKED,
95 RFKILL_USER_STATE_UNBLOCKED = RFKILL_STATE_UNBLOCKED,
96 RFKILL_USER_STATE_HARD_BLOCKED = RFKILL_STATE_HARD_BLOCKED,
98}; 97};
99#define to_rfkill(d) container_of(d, struct rfkill, dev) 98#undef RFKILL_STATE_SOFT_BLOCKED
99#undef RFKILL_STATE_UNBLOCKED
100#undef RFKILL_STATE_HARD_BLOCKED
101
102#include <linux/types.h>
103#include <linux/kernel.h>
104#include <linux/list.h>
105#include <linux/mutex.h>
106#include <linux/device.h>
107#include <linux/leds.h>
108
109/* this is opaque */
110struct rfkill;
111
112/**
113 * struct rfkill_ops - rfkill driver methods
114 *
115 * @poll: poll the rfkill block state(s) -- only assign this method
116 * when you need polling. When called, simply call one of the
117 * rfkill_set{,_hw,_sw}_state family of functions. If the hw
118 * is getting unblocked you need to take into account the return
119 * value of those functions to make sure the software block is
120 * properly used.
121 * @query: query the rfkill block state(s) and call exactly one of the
122 * rfkill_set{,_hw,_sw}_state family of functions. Assign this
123 * method if input events can cause hardware state changes to make
124 * the rfkill core query your driver before setting a requested
125 * block.
126 * @set_block: turn the transmitter on (blocked == false) or off
127 * (blocked == true) -- ignore and return 0 when hard blocked.
128 * This callback must be assigned.
129 */
130struct rfkill_ops {
131 void (*poll)(struct rfkill *rfkill, void *data);
132 void (*query)(struct rfkill *rfkill, void *data);
133 int (*set_block)(void *data, bool blocked);
134};
135
136#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE)
137/**
138 * rfkill_alloc - allocate rfkill structure
139 * @name: name of the struct -- the string is not copied internally
140 * @parent: device that has rf switch on it
141 * @type: type of the switch (RFKILL_TYPE_*)
142 * @ops: rfkill methods
143 * @ops_data: data passed to each method
144 *
145 * This function should be called by the transmitter driver to allocate an
146 * rfkill structure. Returns %NULL on failure.
147 */
148struct rfkill * __must_check rfkill_alloc(const char *name,
149 struct device *parent,
150 const enum rfkill_type type,
151 const struct rfkill_ops *ops,
152 void *ops_data);
100 153
101struct rfkill * __must_check rfkill_allocate(struct device *parent, 154/**
102 enum rfkill_type type); 155 * rfkill_register - Register a rfkill structure.
103void rfkill_free(struct rfkill *rfkill); 156 * @rfkill: rfkill structure to be registered
157 *
158 * This function should be called by the transmitter driver to register
159 * the rfkill structure needs to be registered. Before calling this function
160 * the driver needs to be ready to service method calls from rfkill.
161 */
104int __must_check rfkill_register(struct rfkill *rfkill); 162int __must_check rfkill_register(struct rfkill *rfkill);
163
164/**
165 * rfkill_pause_polling(struct rfkill *rfkill)
166 *
167 * Pause polling -- say transmitter is off for other reasons.
168 * NOTE: not necessary for suspend/resume -- in that case the
169 * core stops polling anyway
170 */
171void rfkill_pause_polling(struct rfkill *rfkill);
172
173/**
174 * rfkill_resume_polling(struct rfkill *rfkill)
175 *
176 * Pause polling -- say transmitter is off for other reasons.
177 * NOTE: not necessary for suspend/resume -- in that case the
178 * core stops polling anyway
179 */
180void rfkill_resume_polling(struct rfkill *rfkill);
181
182
183/**
184 * rfkill_unregister - Unregister a rfkill structure.
185 * @rfkill: rfkill structure to be unregistered
186 *
187 * This function should be called by the network driver during device
188 * teardown to destroy rfkill structure. Until it returns, the driver
189 * needs to be able to service method calls.
190 */
105void rfkill_unregister(struct rfkill *rfkill); 191void rfkill_unregister(struct rfkill *rfkill);
106 192
107int rfkill_force_state(struct rfkill *rfkill, enum rfkill_state state); 193/**
108int rfkill_set_default(enum rfkill_type type, enum rfkill_state state); 194 * rfkill_destroy - free rfkill structure
195 * @rfkill: rfkill structure to be destroyed
196 *
197 * Destroys the rfkill structure.
198 */
199void rfkill_destroy(struct rfkill *rfkill);
200
201/**
202 * rfkill_set_hw_state - Set the internal rfkill hardware block state
203 * @rfkill: pointer to the rfkill class to modify.
204 * @state: the current hardware block state to set
205 *
206 * rfkill drivers that get events when the hard-blocked state changes
207 * use this function to notify the rfkill core (and through that also
208 * userspace) of the current state -- they should also use this after
209 * resume if the state could have changed.
210 *
211 * You need not (but may) call this function if poll_state is assigned.
212 *
213 * This function can be called in any context, even from within rfkill
214 * callbacks.
215 *
216 * The function returns the combined block state (true if transmitter
217 * should be blocked) so that drivers need not keep track of the soft
218 * block state -- which they might not be able to.
219 */
220bool __must_check rfkill_set_hw_state(struct rfkill *rfkill, bool blocked);
221
222/**
223 * rfkill_set_sw_state - Set the internal rfkill software block state
224 * @rfkill: pointer to the rfkill class to modify.
225 * @state: the current software block state to set
226 *
227 * rfkill drivers that get events when the soft-blocked state changes
228 * (yes, some platforms directly act on input but allow changing again)
229 * use this function to notify the rfkill core (and through that also
230 * userspace) of the current state -- they should also use this after
231 * resume if the state could have changed.
232 *
233 * This function can be called in any context, even from within rfkill
234 * callbacks.
235 *
236 * The function returns the combined block state (true if transmitter
237 * should be blocked).
238 */
239bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked);
240
241/**
242 * rfkill_set_states - Set the internal rfkill block states
243 * @rfkill: pointer to the rfkill class to modify.
244 * @sw: the current software block state to set
245 * @hw: the current hardware block state to set
246 *
247 * This function can be called in any context, even from within rfkill
248 * callbacks.
249 */
250void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw);
109 251
110/** 252/**
111 * rfkill_state_complement - return complementar state 253 * rfkill_set_global_sw_state - set global sw block default
112 * @state: state to return the complement of 254 * @type: rfkill type to set default for
255 * @blocked: default to set
113 * 256 *
114 * Returns RFKILL_STATE_SOFT_BLOCKED if @state is RFKILL_STATE_UNBLOCKED, 257 * This function sets the global default -- use at boot if your platform has
115 * returns RFKILL_STATE_UNBLOCKED otherwise. 258 * an rfkill switch. If not early enough this call may be ignored.
259 *
260 * XXX: instead of ignoring -- how about just updating all currently
261 * registered drivers?
116 */ 262 */
117static inline enum rfkill_state rfkill_state_complement(enum rfkill_state state) 263void rfkill_set_global_sw_state(const enum rfkill_type type, bool blocked);
264
265/**
266 * rfkill_blocked - query rfkill block
267 *
268 * @rfkill: rfkill struct to query
269 */
270bool rfkill_blocked(struct rfkill *rfkill);
271#else /* !RFKILL */
272static inline struct rfkill * __must_check
273rfkill_alloc(const char *name,
274 struct device *parent,
275 const enum rfkill_type type,
276 const struct rfkill_ops *ops,
277 void *ops_data)
278{
279 return ERR_PTR(-ENODEV);
280}
281
282static inline int __must_check rfkill_register(struct rfkill *rfkill)
283{
284 if (rfkill == ERR_PTR(-ENODEV))
285 return 0;
286 return -EINVAL;
287}
288
289static inline void rfkill_pause_polling(struct rfkill *rfkill)
290{
291}
292
293static inline void rfkill_resume_polling(struct rfkill *rfkill)
294{
295}
296
297static inline void rfkill_unregister(struct rfkill *rfkill)
298{
299}
300
301static inline void rfkill_destroy(struct rfkill *rfkill)
302{
303}
304
305static inline bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked)
306{
307 return blocked;
308}
309
310static inline bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked)
311{
312 return blocked;
313}
314
315static inline void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw)
118{ 316{
119 return (state == RFKILL_STATE_UNBLOCKED) ?
120 RFKILL_STATE_SOFT_BLOCKED : RFKILL_STATE_UNBLOCKED;
121} 317}
122 318
319static inline void rfkill_set_global_sw_state(const enum rfkill_type type,
320 bool blocked)
321{
322}
323
324static inline bool rfkill_blocked(struct rfkill *rfkill)
325{
326 return false;
327}
328#endif /* RFKILL || RFKILL_MODULE */
329
330
331#ifdef CONFIG_RFKILL_LEDS
123/** 332/**
124 * rfkill_get_led_name - Get the LED trigger name for the button's LED. 333 * rfkill_get_led_trigger_name - Get the LED trigger name for the button's LED.
125 * This function might return a NULL pointer if registering of the 334 * This function might return a NULL pointer if registering of the
126 * LED trigger failed. 335 * LED trigger failed. Use this as "default_trigger" for the LED.
127 * Use this as "default_trigger" for the LED.
128 */ 336 */
129static inline char *rfkill_get_led_name(struct rfkill *rfkill) 337const char *rfkill_get_led_trigger_name(struct rfkill *rfkill);
130{ 338
131#ifdef CONFIG_RFKILL_LEDS 339/**
132 return (char *)(rfkill->led_trigger.name); 340 * rfkill_set_led_trigger_name -- set the LED trigger name
341 * @rfkill: rfkill struct
342 * @name: LED trigger name
343 *
344 * This function sets the LED trigger name of the radio LED
345 * trigger that rfkill creates. It is optional, but if called
346 * must be called before rfkill_register() to be effective.
347 */
348void rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name);
133#else 349#else
350static inline const char *rfkill_get_led_trigger_name(struct rfkill *rfkill)
351{
134 return NULL; 352 return NULL;
135#endif
136} 353}
137 354
355static inline void
356rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name)
357{
358}
359#endif
360
361#endif /* __KERNEL__ */
362
138#endif /* RFKILL_H */ 363#endif /* RFKILL_H */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index f20da7d63b1e..1a21895b732b 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -752,6 +752,19 @@ enum wiphy_params_flags {
752}; 752};
753 753
754/** 754/**
755 * enum tx_power_setting - TX power adjustment
756 *
757 * @TX_POWER_AUTOMATIC: the dbm parameter is ignored
758 * @TX_POWER_LIMITED: limit TX power by the dbm parameter
759 * @TX_POWER_FIXED: fix TX power to the dbm parameter
760 */
761enum tx_power_setting {
762 TX_POWER_AUTOMATIC,
763 TX_POWER_LIMITED,
764 TX_POWER_FIXED,
765};
766
767/**
755 * struct cfg80211_ops - backend description for wireless configuration 768 * struct cfg80211_ops - backend description for wireless configuration
756 * 769 *
757 * This struct is registered by fullmac card drivers and/or wireless stacks 770 * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -837,6 +850,13 @@ enum wiphy_params_flags {
837 * @changed bitfield (see &enum wiphy_params_flags) describes which values 850 * @changed bitfield (see &enum wiphy_params_flags) describes which values
838 * have changed. The actual parameter values are available in 851 * have changed. The actual parameter values are available in
839 * struct wiphy. If returning an error, no value should be changed. 852 * struct wiphy. If returning an error, no value should be changed.
853 *
854 * @set_tx_power: set the transmit power according to the parameters
855 * @get_tx_power: store the current TX power into the dbm variable;
856 * return 0 if successful
857 *
858 * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting
859 * functions to adjust rfkill hw state
840 */ 860 */
841struct cfg80211_ops { 861struct cfg80211_ops {
842 int (*suspend)(struct wiphy *wiphy); 862 int (*suspend)(struct wiphy *wiphy);
@@ -928,6 +948,12 @@ struct cfg80211_ops {
928 int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); 948 int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev);
929 949
930 int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); 950 int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed);
951
952 int (*set_tx_power)(struct wiphy *wiphy,
953 enum tx_power_setting type, int dbm);
954 int (*get_tx_power)(struct wiphy *wiphy, int *dbm);
955
956 void (*rfkill_poll)(struct wiphy *wiphy);
931}; 957};
932 958
933/* 959/*
@@ -1451,6 +1477,12 @@ int cfg80211_wext_siwencode(struct net_device *dev,
1451int cfg80211_wext_giwencode(struct net_device *dev, 1477int cfg80211_wext_giwencode(struct net_device *dev,
1452 struct iw_request_info *info, 1478 struct iw_request_info *info,
1453 struct iw_point *erq, char *keybuf); 1479 struct iw_point *erq, char *keybuf);
1480int cfg80211_wext_siwtxpower(struct net_device *dev,
1481 struct iw_request_info *info,
1482 union iwreq_data *data, char *keybuf);
1483int cfg80211_wext_giwtxpower(struct net_device *dev,
1484 struct iw_request_info *info,
1485 union iwreq_data *data, char *keybuf);
1454 1486
1455/* 1487/*
1456 * callbacks for asynchronous cfg80211 methods, notification 1488 * callbacks for asynchronous cfg80211 methods, notification
@@ -1636,4 +1668,23 @@ void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,
1636 */ 1668 */
1637void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp); 1669void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp);
1638 1670
1671/**
1672 * wiphy_rfkill_set_hw_state - notify cfg80211 about hw block state
1673 * @wiphy: the wiphy
1674 * @blocked: block status
1675 */
1676void wiphy_rfkill_set_hw_state(struct wiphy *wiphy, bool blocked);
1677
1678/**
1679 * wiphy_rfkill_start_polling - start polling rfkill
1680 * @wiphy: the wiphy
1681 */
1682void wiphy_rfkill_start_polling(struct wiphy *wiphy);
1683
1684/**
1685 * wiphy_rfkill_stop_polling - stop polling rfkill
1686 * @wiphy: the wiphy
1687 */
1688void wiphy_rfkill_stop_polling(struct wiphy *wiphy);
1689
1639#endif /* __NET_CFG80211_H */ 1690#endif /* __NET_CFG80211_H */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index d72346ff3247..17d61d19d912 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -526,8 +526,7 @@ enum ieee80211_conf_flags {
526/** 526/**
527 * enum ieee80211_conf_changed - denotes which configuration changed 527 * enum ieee80211_conf_changed - denotes which configuration changed
528 * 528 *
529 * @IEEE80211_CONF_CHANGE_RADIO_ENABLED: the value of radio_enabled changed 529 * @_IEEE80211_CONF_CHANGE_RADIO_ENABLED: DEPRECATED
530 * @_IEEE80211_CONF_CHANGE_BEACON_INTERVAL: DEPRECATED
531 * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed 530 * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed
532 * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed 531 * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed
533 * @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed 532 * @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed
@@ -537,8 +536,7 @@ enum ieee80211_conf_flags {
537 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed 536 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed
538 */ 537 */
539enum ieee80211_conf_changed { 538enum ieee80211_conf_changed {
540 IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0), 539 _IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0),
541 _IEEE80211_CONF_CHANGE_BEACON_INTERVAL = BIT(1),
542 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), 540 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2),
543 IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3), 541 IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3),
544 IEEE80211_CONF_CHANGE_PS = BIT(4), 542 IEEE80211_CONF_CHANGE_PS = BIT(4),
@@ -549,12 +547,12 @@ enum ieee80211_conf_changed {
549}; 547};
550 548
551static inline __deprecated enum ieee80211_conf_changed 549static inline __deprecated enum ieee80211_conf_changed
552__IEEE80211_CONF_CHANGE_BEACON_INTERVAL(void) 550__IEEE80211_CONF_CHANGE_RADIO_ENABLED(void)
553{ 551{
554 return _IEEE80211_CONF_CHANGE_BEACON_INTERVAL; 552 return _IEEE80211_CONF_CHANGE_RADIO_ENABLED;
555} 553}
556#define IEEE80211_CONF_CHANGE_BEACON_INTERVAL \ 554#define IEEE80211_CONF_CHANGE_RADIO_ENABLED \
557 __IEEE80211_CONF_CHANGE_BEACON_INTERVAL() 555 __IEEE80211_CONF_CHANGE_RADIO_ENABLED()
558 556
559/** 557/**
560 * struct ieee80211_conf - configuration of the device 558 * struct ieee80211_conf - configuration of the device
@@ -564,7 +562,7 @@ __IEEE80211_CONF_CHANGE_BEACON_INTERVAL(void)
564 * @flags: configuration flags defined above 562 * @flags: configuration flags defined above
565 * 563 *
566 * @radio_enabled: when zero, driver is required to switch off the radio. 564 * @radio_enabled: when zero, driver is required to switch off the radio.
567 * @beacon_int: beacon interval (TODO make interface config) 565 * @beacon_int: DEPRECATED, DO NOT USE
568 * 566 *
569 * @listen_interval: listen interval in units of beacon interval 567 * @listen_interval: listen interval in units of beacon interval
570 * @max_sleep_period: the maximum number of beacon intervals to sleep for 568 * @max_sleep_period: the maximum number of beacon intervals to sleep for
@@ -589,13 +587,13 @@ __IEEE80211_CONF_CHANGE_BEACON_INTERVAL(void)
589 * number of transmissions not the number of retries 587 * number of transmissions not the number of retries
590 */ 588 */
591struct ieee80211_conf { 589struct ieee80211_conf {
592 int beacon_int; 590 int __deprecated beacon_int;
593 u32 flags; 591 u32 flags;
594 int power_level, dynamic_ps_timeout; 592 int power_level, dynamic_ps_timeout;
595 int max_sleep_period; 593 int max_sleep_period;
596 594
597 u16 listen_interval; 595 u16 listen_interval;
598 bool radio_enabled; 596 bool __deprecated radio_enabled;
599 597
600 u8 long_frame_max_tx_count, short_frame_max_tx_count; 598 u8 long_frame_max_tx_count, short_frame_max_tx_count;
601 599
@@ -1406,6 +1404,10 @@ enum ieee80211_ampdu_mlme_action {
1406 * is the first frame we expect to perform the action on. Notice 1404 * is the first frame we expect to perform the action on. Notice
1407 * that TX/RX_STOP can pass NULL for this parameter. 1405 * that TX/RX_STOP can pass NULL for this parameter.
1408 * Returns a negative error code on failure. 1406 * Returns a negative error code on failure.
1407 *
1408 * @rfkill_poll: Poll rfkill hardware state. If you need this, you also
1409 * need to set wiphy->rfkill_poll to %true before registration,
1410 * and need to call wiphy_rfkill_set_hw_state() in the callback.
1409 */ 1411 */
1410struct ieee80211_ops { 1412struct ieee80211_ops {
1411 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 1413 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -1454,6 +1456,8 @@ struct ieee80211_ops {
1454 int (*ampdu_action)(struct ieee80211_hw *hw, 1456 int (*ampdu_action)(struct ieee80211_hw *hw,
1455 enum ieee80211_ampdu_mlme_action action, 1457 enum ieee80211_ampdu_mlme_action action,
1456 struct ieee80211_sta *sta, u16 tid, u16 *ssn); 1458 struct ieee80211_sta *sta, u16 tid, u16 *ssn);
1459
1460 void (*rfkill_poll)(struct ieee80211_hw *hw);
1457}; 1461};
1458 1462
1459/** 1463/**
diff --git a/include/net/wimax.h b/include/net/wimax.h
index 6b3824edb39e..2af7bf839f23 100644
--- a/include/net/wimax.h
+++ b/include/net/wimax.h
@@ -253,7 +253,6 @@
253struct net_device; 253struct net_device;
254struct genl_info; 254struct genl_info;
255struct wimax_dev; 255struct wimax_dev;
256struct input_dev;
257 256
258/** 257/**
259 * struct wimax_dev - Generic WiMAX device 258 * struct wimax_dev - Generic WiMAX device
@@ -293,8 +292,8 @@ struct input_dev;
293 * See wimax_reset()'s documentation. 292 * See wimax_reset()'s documentation.
294 * 293 *
295 * @name: [fill] A way to identify this device. We need to register a 294 * @name: [fill] A way to identify this device. We need to register a
296 * name with many subsystems (input for RFKILL, workqueue 295 * name with many subsystems (rfkill, workqueue creation, etc).
297 * creation, etc). We can't use the network device name as that 296 * We can't use the network device name as that
298 * might change and in some instances we don't know it yet (until 297 * might change and in some instances we don't know it yet (until
299 * we don't call register_netdev()). So we generate an unique one 298 * we don't call register_netdev()). So we generate an unique one
300 * using the driver name and device bus id, place it here and use 299 * using the driver name and device bus id, place it here and use
@@ -316,9 +315,6 @@ struct input_dev;
316 * 315 *
317 * @rfkill: [private] integration into the RF-Kill infrastructure. 316 * @rfkill: [private] integration into the RF-Kill infrastructure.
318 * 317 *
319 * @rfkill_input: [private] virtual input device to process the
320 * hardware RF Kill switches.
321 *
322 * @rf_sw: [private] State of the software radio switch (OFF/ON) 318 * @rf_sw: [private] State of the software radio switch (OFF/ON)
323 * 319 *
324 * @rf_hw: [private] State of the hardware radio switch (OFF/ON) 320 * @rf_hw: [private] State of the hardware radio switch (OFF/ON)