aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-06-15 08:33:17 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-07-09 08:51:46 -0400
commit89a54e48b9cbb44aed1bf6cd712e087b96b6ae65 (patch)
treef605a69704d49c5535adf2906b276ca2207a078f /include
parentf72b85b8eb6657fae95ac8f5cb20954b4d87a520 (diff)
nl80211: prepare for non-netdev wireless devs
In order to support a P2P device abstraction and Bluetooth high-speed AMPs, we need to have a way to identify virtual interfaces that don't have a netdev associated. Do this by adding a NL80211_ATTR_WDEV attribute to identify a wdev which may or may not also be a netdev. To simplify things, use a 64-bit value with the high 32 bits being the wiphy index for this new wdev identifier in the nl80211 API. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nl80211.h5
-rw-r--r--include/net/cfg80211.h22
2 files changed, 21 insertions, 6 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index db961a59247..e791487ead3 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -771,6 +771,9 @@ enum nl80211_commands {
771 * @NL80211_ATTR_IFNAME: network interface name 771 * @NL80211_ATTR_IFNAME: network interface name
772 * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype 772 * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
773 * 773 *
774 * @NL80211_ATTR_WDEV: wireless device identifier, used for pseudo-devices
775 * that don't have a netdev (u64)
776 *
774 * @NL80211_ATTR_MAC: MAC address (various uses) 777 * @NL80211_ATTR_MAC: MAC address (various uses)
775 * 778 *
776 * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of 779 * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of
@@ -1493,6 +1496,8 @@ enum nl80211_attrs {
1493 1496
1494 NL80211_ATTR_BG_SCAN_PERIOD, 1497 NL80211_ATTR_BG_SCAN_PERIOD,
1495 1498
1499 NL80211_ATTR_WDEV,
1500
1496 /* add attributes here, update the policy in nl80211.c */ 1501 /* add attributes here, update the policy in nl80211.c */
1497 1502
1498 __NL80211_ATTR_AFTER_LAST, 1503 __NL80211_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 51f67a9003a..a14e6a40668 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2341,17 +2341,25 @@ struct cfg80211_internal_bss;
2341struct cfg80211_cached_keys; 2341struct cfg80211_cached_keys;
2342 2342
2343/** 2343/**
2344 * struct wireless_dev - wireless per-netdev state 2344 * struct wireless_dev - wireless device state
2345 * 2345 *
2346 * This structure must be allocated by the driver/stack 2346 * For netdevs, this structure must be allocated by the driver
2347 * that uses the ieee80211_ptr field in struct net_device 2347 * that uses the ieee80211_ptr field in struct net_device (this
2348 * (this is intentional so it can be allocated along with 2348 * is intentional so it can be allocated along with the netdev.)
2349 * the netdev.) 2349 * It need not be registered then as netdev registration will
2350 * be intercepted by cfg80211 to see the new wireless device.
2351 *
2352 * For non-netdev uses, it must also be allocated by the driver
2353 * in response to the cfg80211 callbacks that require it, as
2354 * there's no netdev registration in that case it may not be
2355 * allocated outside of callback operations that return it.
2350 * 2356 *
2351 * @wiphy: pointer to hardware description 2357 * @wiphy: pointer to hardware description
2352 * @iftype: interface type 2358 * @iftype: interface type
2353 * @list: (private) Used to collect the interfaces 2359 * @list: (private) Used to collect the interfaces
2354 * @netdev: (private) Used to reference back to the netdev 2360 * @netdev: (private) Used to reference back to the netdev, may be %NULL
2361 * @identifier: (private) Identifier used in nl80211 to identify this
2362 * wireless device if it has no netdev
2355 * @current_bss: (private) Used by the internal configuration code 2363 * @current_bss: (private) Used by the internal configuration code
2356 * @channel: (private) Used by the internal configuration code to track 2364 * @channel: (private) Used by the internal configuration code to track
2357 * the user-set AP, monitor and WDS channel 2365 * the user-set AP, monitor and WDS channel
@@ -2383,6 +2391,8 @@ struct wireless_dev {
2383 struct list_head list; 2391 struct list_head list;
2384 struct net_device *netdev; 2392 struct net_device *netdev;
2385 2393
2394 u32 identifier;
2395
2386 struct list_head mgmt_registrations; 2396 struct list_head mgmt_registrations;
2387 spinlock_t mgmt_registrations_lock; 2397 spinlock_t mgmt_registrations_lock;
2388 2398