diff options
author | Jouni Malinen <jouni.malinen@atheros.com> | 2010-02-15 05:53:10 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-02-15 16:14:15 -0500 |
commit | 026331c4d9b526561ea96f95fac4bfc52b69e316 (patch) | |
tree | a82b0a92a7f03a1d151a9db123320689c73d98c7 /include/net/cfg80211.h | |
parent | 8404080568613d93ad7cf0a16dfb68459b42a264 (diff) |
cfg80211/mac80211: allow registering for and sending action frames
This implements a new command to register for action frames
that userspace wants to handle instead of the in-kernel
rejection. It is then responsible for rejecting ones that
it decided not to handle. There is no unregistration, but
the socket can be closed for that.
Frames that are not registered for will not be forwarded
to userspace and will be rejected by the kernel, the
cfg80211 API helps implementing that.
Additionally, this patch adds a new command that allows
doing action frame transmission from userspace. It can be
used either to exchange action frames on the current
operational channel (e.g., with the AP with which we are
currently associated) or to exchange off-channel Public
Action frames with the remain-on-channel command.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/cfg80211.h')
-rw-r--r-- | include/net/cfg80211.h | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 5b3569b2a74c..7188934b64d3 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -3,7 +3,7 @@ | |||
3 | /* | 3 | /* |
4 | * 802.11 device and configuration interface | 4 | * 802.11 device and configuration interface |
5 | * | 5 | * |
6 | * Copyright 2006-2009 Johannes Berg <johannes@sipsolutions.net> | 6 | * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 2 as | 9 | * it under the terms of the GNU General Public License version 2 as |
@@ -998,6 +998,7 @@ struct cfg80211_pmksa { | |||
998 | * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. | 998 | * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. |
999 | * This allows the operation to be terminated prior to timeout based on | 999 | * This allows the operation to be terminated prior to timeout based on |
1000 | * the duration value. | 1000 | * the duration value. |
1001 | * @action: Transmit an action frame | ||
1001 | * | 1002 | * |
1002 | * @testmode_cmd: run a test mode command | 1003 | * @testmode_cmd: run a test mode command |
1003 | * | 1004 | * |
@@ -1144,6 +1145,11 @@ struct cfg80211_ops { | |||
1144 | struct net_device *dev, | 1145 | struct net_device *dev, |
1145 | u64 cookie); | 1146 | u64 cookie); |
1146 | 1147 | ||
1148 | int (*action)(struct wiphy *wiphy, struct net_device *dev, | ||
1149 | struct ieee80211_channel *chan, | ||
1150 | enum nl80211_channel_type channel_type, | ||
1151 | const u8 *buf, size_t len, u64 *cookie); | ||
1152 | |||
1147 | /* some temporary stuff to finish wext */ | 1153 | /* some temporary stuff to finish wext */ |
1148 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, | 1154 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, |
1149 | bool enabled, int timeout); | 1155 | bool enabled, int timeout); |
@@ -1445,6 +1451,8 @@ struct cfg80211_cached_keys; | |||
1445 | * set by driver (if supported) on add_interface BEFORE registering the | 1451 | * set by driver (if supported) on add_interface BEFORE registering the |
1446 | * netdev and may otherwise be used by driver read-only, will be update | 1452 | * netdev and may otherwise be used by driver read-only, will be update |
1447 | * by cfg80211 on change_interface | 1453 | * by cfg80211 on change_interface |
1454 | * @action_registrations: list of registrations for action frames | ||
1455 | * @action_registrations_lock: lock for the list | ||
1448 | */ | 1456 | */ |
1449 | struct wireless_dev { | 1457 | struct wireless_dev { |
1450 | struct wiphy *wiphy; | 1458 | struct wiphy *wiphy; |
@@ -1454,6 +1462,9 @@ struct wireless_dev { | |||
1454 | struct list_head list; | 1462 | struct list_head list; |
1455 | struct net_device *netdev; | 1463 | struct net_device *netdev; |
1456 | 1464 | ||
1465 | struct list_head action_registrations; | ||
1466 | spinlock_t action_registrations_lock; | ||
1467 | |||
1457 | struct mutex mtx; | 1468 | struct mutex mtx; |
1458 | 1469 | ||
1459 | struct work_struct cleanup_work; | 1470 | struct work_struct cleanup_work; |
@@ -2291,4 +2302,38 @@ void cfg80211_remain_on_channel_expired(struct net_device *dev, | |||
2291 | void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr, | 2302 | void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr, |
2292 | struct station_info *sinfo, gfp_t gfp); | 2303 | struct station_info *sinfo, gfp_t gfp); |
2293 | 2304 | ||
2305 | /** | ||
2306 | * cfg80211_rx_action - notification of received, unprocessed Action frame | ||
2307 | * @dev: network device | ||
2308 | * @freq: Frequency on which the frame was received in MHz | ||
2309 | * @buf: Action frame (header + body) | ||
2310 | * @len: length of the frame data | ||
2311 | * @gfp: context flags | ||
2312 | * Returns %true if a user space application is responsible for rejecting the | ||
2313 | * unrecognized Action frame; %false if no such application is registered | ||
2314 | * (i.e., the driver is responsible for rejecting the unrecognized Action | ||
2315 | * frame) | ||
2316 | * | ||
2317 | * This function is called whenever an Action frame is received for a station | ||
2318 | * mode interface, but is not processed in kernel. | ||
2319 | */ | ||
2320 | bool cfg80211_rx_action(struct net_device *dev, int freq, const u8 *buf, | ||
2321 | size_t len, gfp_t gfp); | ||
2322 | |||
2323 | /** | ||
2324 | * cfg80211_action_tx_status - notification of TX status for Action frame | ||
2325 | * @dev: network device | ||
2326 | * @cookie: Cookie returned by cfg80211_ops::action() | ||
2327 | * @buf: Action frame (header + body) | ||
2328 | * @len: length of the frame data | ||
2329 | * @ack: Whether frame was acknowledged | ||
2330 | * @gfp: context flags | ||
2331 | * | ||
2332 | * This function is called whenever an Action frame was requested to be | ||
2333 | * transmitted with cfg80211_ops::action() to report the TX status of the | ||
2334 | * transmission attempt. | ||
2335 | */ | ||
2336 | void cfg80211_action_tx_status(struct net_device *dev, u64 cookie, | ||
2337 | const u8 *buf, size_t len, bool ack, gfp_t gfp); | ||
2338 | |||
2294 | #endif /* __NET_CFG80211_H */ | 2339 | #endif /* __NET_CFG80211_H */ |