diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-08-12 09:38:38 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-24 16:27:56 -0400 |
commit | 2e161f78e5f63a7f9fd25a766bb7f816a01eb14a (patch) | |
tree | befd44feeb1f47da1f41e6fc310a223ad67030ff /include/net/cfg80211.h | |
parent | ac4c977d16d843f12901595c91773dddb65768a9 (diff) |
cfg80211/mac80211: extensible frame processing
Allow userspace to register for more than just
action frames by giving the frame subtype, and
make it possible to use this in various modes
as well.
With some tweaks and some added functionality
this will, in the future, also be usable in AP
mode and be able to replace the cooked monitor
interface currently used in that case.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/cfg80211.h')
-rw-r--r-- | include/net/cfg80211.h | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 2b403c7ee32e..6a98b1b3bfde 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -1020,7 +1020,7 @@ struct cfg80211_pmksa { | |||
1020 | * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. | 1020 | * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. |
1021 | * This allows the operation to be terminated prior to timeout based on | 1021 | * This allows the operation to be terminated prior to timeout based on |
1022 | * the duration value. | 1022 | * the duration value. |
1023 | * @action: Transmit an action frame | 1023 | * @mgmt_tx: Transmit a management frame |
1024 | * | 1024 | * |
1025 | * @testmode_cmd: run a test mode command | 1025 | * @testmode_cmd: run a test mode command |
1026 | * | 1026 | * |
@@ -1172,7 +1172,7 @@ struct cfg80211_ops { | |||
1172 | struct net_device *dev, | 1172 | struct net_device *dev, |
1173 | u64 cookie); | 1173 | u64 cookie); |
1174 | 1174 | ||
1175 | int (*action)(struct wiphy *wiphy, struct net_device *dev, | 1175 | int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev, |
1176 | struct ieee80211_channel *chan, | 1176 | struct ieee80211_channel *chan, |
1177 | enum nl80211_channel_type channel_type, | 1177 | enum nl80211_channel_type channel_type, |
1178 | bool channel_type_valid, | 1178 | bool channel_type_valid, |
@@ -1236,6 +1236,10 @@ struct mac_address { | |||
1236 | u8 addr[ETH_ALEN]; | 1236 | u8 addr[ETH_ALEN]; |
1237 | }; | 1237 | }; |
1238 | 1238 | ||
1239 | struct ieee80211_txrx_stypes { | ||
1240 | u16 tx, rx; | ||
1241 | }; | ||
1242 | |||
1239 | /** | 1243 | /** |
1240 | * struct wiphy - wireless hardware description | 1244 | * struct wiphy - wireless hardware description |
1241 | * @reg_notifier: the driver's regulatory notification callback | 1245 | * @reg_notifier: the driver's regulatory notification callback |
@@ -1286,6 +1290,10 @@ struct mac_address { | |||
1286 | * @privid: a pointer that drivers can use to identify if an arbitrary | 1290 | * @privid: a pointer that drivers can use to identify if an arbitrary |
1287 | * wiphy is theirs, e.g. in global notifiers | 1291 | * wiphy is theirs, e.g. in global notifiers |
1288 | * @bands: information about bands/channels supported by this device | 1292 | * @bands: information about bands/channels supported by this device |
1293 | * | ||
1294 | * @mgmt_stypes: bitmasks of frame subtypes that can be subscribed to or | ||
1295 | * transmitted through nl80211, points to an array indexed by interface | ||
1296 | * type | ||
1289 | */ | 1297 | */ |
1290 | struct wiphy { | 1298 | struct wiphy { |
1291 | /* assign these fields before you register the wiphy */ | 1299 | /* assign these fields before you register the wiphy */ |
@@ -1294,9 +1302,12 @@ struct wiphy { | |||
1294 | u8 perm_addr[ETH_ALEN]; | 1302 | u8 perm_addr[ETH_ALEN]; |
1295 | u8 addr_mask[ETH_ALEN]; | 1303 | u8 addr_mask[ETH_ALEN]; |
1296 | 1304 | ||
1297 | u16 n_addresses; | ||
1298 | struct mac_address *addresses; | 1305 | struct mac_address *addresses; |
1299 | 1306 | ||
1307 | const struct ieee80211_txrx_stypes *mgmt_stypes; | ||
1308 | |||
1309 | u16 n_addresses; | ||
1310 | |||
1300 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ | 1311 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ |
1301 | u16 interface_modes; | 1312 | u16 interface_modes; |
1302 | 1313 | ||
@@ -1492,8 +1503,8 @@ struct cfg80211_cached_keys; | |||
1492 | * set by driver (if supported) on add_interface BEFORE registering the | 1503 | * set by driver (if supported) on add_interface BEFORE registering the |
1493 | * netdev and may otherwise be used by driver read-only, will be update | 1504 | * netdev and may otherwise be used by driver read-only, will be update |
1494 | * by cfg80211 on change_interface | 1505 | * by cfg80211 on change_interface |
1495 | * @action_registrations: list of registrations for action frames | 1506 | * @mgmt_registrations: list of registrations for management frames |
1496 | * @action_registrations_lock: lock for the list | 1507 | * @mgmt_registrations_lock: lock for the list |
1497 | * @mtx: mutex used to lock data in this struct | 1508 | * @mtx: mutex used to lock data in this struct |
1498 | * @cleanup_work: work struct used for cleanup that can't be done directly | 1509 | * @cleanup_work: work struct used for cleanup that can't be done directly |
1499 | */ | 1510 | */ |
@@ -1505,8 +1516,8 @@ struct wireless_dev { | |||
1505 | struct list_head list; | 1516 | struct list_head list; |
1506 | struct net_device *netdev; | 1517 | struct net_device *netdev; |
1507 | 1518 | ||
1508 | struct list_head action_registrations; | 1519 | struct list_head mgmt_registrations; |
1509 | spinlock_t action_registrations_lock; | 1520 | spinlock_t mgmt_registrations_lock; |
1510 | 1521 | ||
1511 | struct mutex mtx; | 1522 | struct mutex mtx; |
1512 | 1523 | ||
@@ -2373,38 +2384,39 @@ void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr, | |||
2373 | struct station_info *sinfo, gfp_t gfp); | 2384 | struct station_info *sinfo, gfp_t gfp); |
2374 | 2385 | ||
2375 | /** | 2386 | /** |
2376 | * cfg80211_rx_action - notification of received, unprocessed Action frame | 2387 | * cfg80211_rx_mgmt - notification of received, unprocessed management frame |
2377 | * @dev: network device | 2388 | * @dev: network device |
2378 | * @freq: Frequency on which the frame was received in MHz | 2389 | * @freq: Frequency on which the frame was received in MHz |
2379 | * @buf: Action frame (header + body) | 2390 | * @buf: Management frame (header + body) |
2380 | * @len: length of the frame data | 2391 | * @len: length of the frame data |
2381 | * @gfp: context flags | 2392 | * @gfp: context flags |
2382 | * Returns %true if a user space application is responsible for rejecting the | 2393 | * |
2383 | * unrecognized Action frame; %false if no such application is registered | 2394 | * Returns %true if a user space application has registered for this frame. |
2384 | * (i.e., the driver is responsible for rejecting the unrecognized Action | 2395 | * For action frames, that makes it responsible for rejecting unrecognized |
2385 | * frame) | 2396 | * action frames; %false otherwise, in which case for action frames the |
2397 | * driver is responsible for rejecting the frame. | ||
2386 | * | 2398 | * |
2387 | * This function is called whenever an Action frame is received for a station | 2399 | * This function is called whenever an Action frame is received for a station |
2388 | * mode interface, but is not processed in kernel. | 2400 | * mode interface, but is not processed in kernel. |
2389 | */ | 2401 | */ |
2390 | bool cfg80211_rx_action(struct net_device *dev, int freq, const u8 *buf, | 2402 | bool cfg80211_rx_mgmt(struct net_device *dev, int freq, const u8 *buf, |
2391 | size_t len, gfp_t gfp); | 2403 | size_t len, gfp_t gfp); |
2392 | 2404 | ||
2393 | /** | 2405 | /** |
2394 | * cfg80211_action_tx_status - notification of TX status for Action frame | 2406 | * cfg80211_mgmt_tx_status - notification of TX status for management frame |
2395 | * @dev: network device | 2407 | * @dev: network device |
2396 | * @cookie: Cookie returned by cfg80211_ops::action() | 2408 | * @cookie: Cookie returned by cfg80211_ops::mgmt_tx() |
2397 | * @buf: Action frame (header + body) | 2409 | * @buf: Management frame (header + body) |
2398 | * @len: length of the frame data | 2410 | * @len: length of the frame data |
2399 | * @ack: Whether frame was acknowledged | 2411 | * @ack: Whether frame was acknowledged |
2400 | * @gfp: context flags | 2412 | * @gfp: context flags |
2401 | * | 2413 | * |
2402 | * This function is called whenever an Action frame was requested to be | 2414 | * This function is called whenever a management frame was requested to be |
2403 | * transmitted with cfg80211_ops::action() to report the TX status of the | 2415 | * transmitted with cfg80211_ops::mgmt_tx() to report the TX status of the |
2404 | * transmission attempt. | 2416 | * transmission attempt. |
2405 | */ | 2417 | */ |
2406 | void cfg80211_action_tx_status(struct net_device *dev, u64 cookie, | 2418 | void cfg80211_mgmt_tx_status(struct net_device *dev, u64 cookie, |
2407 | const u8 *buf, size_t len, bool ack, gfp_t gfp); | 2419 | const u8 *buf, size_t len, bool ack, gfp_t gfp); |
2408 | 2420 | ||
2409 | 2421 | ||
2410 | /** | 2422 | /** |