aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2010-05-05 09:25:02 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-05-07 14:55:50 -0400
commitf444de05d20e27cdd960c13fcbcfca3099f03143 (patch)
treea7fbef60420d88dda5840e06094be21ee3eb1dc0 /include/net
parentac8dd506e40ee2c7fcc61654a44c32555a0a8d6c (diff)
cfg80211/mac80211: better channel handling
Currently (all tested with hwsim) you can do stupid things like setting up an AP on a certain channel, then adding another virtual interface and making that associate on another channel -- this will make the beaconing to move channel but obviously without the necessary IEs data update. In order to improve this situation, first make the configuration APIs (cfg80211 and nl80211) aware of multi-channel operation -- we'll eventually need that in the future anyway. There's one userland API change and one API addition. The API change is that now SET_WIPHY must be called with virtual interface index rather than only wiphy index in order to take effect for that interface -- luckily all current users (hostapd) do that. For monitor interfaces, the old setting is preserved, but monitors are always slaved to other devices anyway so no guarantees. The second userland API change is the introduction of a per virtual interface SET_CHANNEL command, that hostapd should use going forward to make it easier to understand what's going on (it can automatically detect a kernel with this command). Other than mac80211, no existing cfg80211 drivers are affected by this change because they only allow a single virtual interface. mac80211, however, now needs to be aware that the channel settings are per interface now, and needs to disallow (for now) real multi-channel operation, which is another important part of this patch. One of the immediate benefits is that you can now start hostapd to operate on a hardware that already has a connection on another virtual interface, as long as you specify the same channel. Note that two things are left unhandled (this is an improvement -- not a complete fix): * different HT/no-HT modes currently you could start an HT AP and then connect to a non-HT network on the same channel which would configure the hardware for no HT; that can be fixed fairly easily * CSA An AP we're connected to on a virtual interface might indicate switching channels, and in that case we would follow it, regardless of how many other interfaces are operating; this requires more effort to fix but is pretty rare after all Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/cfg80211.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 7d10c0182f53..b44a2e5321a3 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -966,7 +966,11 @@ struct cfg80211_pmksa {
966 * 966 *
967 * @set_txq_params: Set TX queue parameters 967 * @set_txq_params: Set TX queue parameters
968 * 968 *
969 * @set_channel: Set channel 969 * @set_channel: Set channel for a given wireless interface. Some devices
970 * may support multi-channel operation (by channel hopping) so cfg80211
971 * doesn't verify much. Note, however, that the passed netdev may be
972 * %NULL as well if the user requested changing the channel for the
973 * device itself, or for a monitor interface.
970 * 974 *
971 * @scan: Request to do a scan. If returning zero, the scan request is given 975 * @scan: Request to do a scan. If returning zero, the scan request is given
972 * the driver, and will be valid until passed to cfg80211_scan_done(). 976 * the driver, and will be valid until passed to cfg80211_scan_done().
@@ -1095,7 +1099,7 @@ struct cfg80211_ops {
1095 int (*set_txq_params)(struct wiphy *wiphy, 1099 int (*set_txq_params)(struct wiphy *wiphy,
1096 struct ieee80211_txq_params *params); 1100 struct ieee80211_txq_params *params);
1097 1101
1098 int (*set_channel)(struct wiphy *wiphy, 1102 int (*set_channel)(struct wiphy *wiphy, struct net_device *dev,
1099 struct ieee80211_channel *chan, 1103 struct ieee80211_channel *chan,
1100 enum nl80211_channel_type channel_type); 1104 enum nl80211_channel_type channel_type);
1101 1105
@@ -1461,6 +1465,8 @@ struct cfg80211_cached_keys;
1461 * @list: (private) Used to collect the interfaces 1465 * @list: (private) Used to collect the interfaces
1462 * @netdev: (private) Used to reference back to the netdev 1466 * @netdev: (private) Used to reference back to the netdev
1463 * @current_bss: (private) Used by the internal configuration code 1467 * @current_bss: (private) Used by the internal configuration code
1468 * @channel: (private) Used by the internal configuration code to track
1469 * user-set AP, monitor and WDS channels for wireless extensions
1464 * @bssid: (private) Used by the internal configuration code 1470 * @bssid: (private) Used by the internal configuration code
1465 * @ssid: (private) Used by the internal configuration code 1471 * @ssid: (private) Used by the internal configuration code
1466 * @ssid_len: (private) Used by the internal configuration code 1472 * @ssid_len: (private) Used by the internal configuration code
@@ -1507,6 +1513,7 @@ struct wireless_dev {
1507 struct cfg80211_internal_bss *authtry_bsses[MAX_AUTH_BSSES]; 1513 struct cfg80211_internal_bss *authtry_bsses[MAX_AUTH_BSSES];
1508 struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES]; 1514 struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES];
1509 struct cfg80211_internal_bss *current_bss; /* associated / joined */ 1515 struct cfg80211_internal_bss *current_bss; /* associated / joined */
1516 struct ieee80211_channel *channel;
1510 1517
1511 bool ps; 1518 bool ps;
1512 int ps_timeout; 1519 int ps_timeout;