aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-08-09 15:08:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-08-09 15:08:10 -0400
commitfa5978447cb0144411df3a588e3d01459c12d855 (patch)
tree998e58c515def864c8cd87511625d1e7184a7a21 /include/net
parent2437f3c5d6bc07252c6d7d24448755e0c35ed91c (diff)
parent73da7d5bab79ad7e16ff44d67c3fe8b9c0b33e5b (diff)
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Diffstat (limited to 'include/net')
-rw-r--r--include/net/cfg80211.h33
-rw-r--r--include/net/mac80211.h37
2 files changed, 70 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index aeaf6dff6e05..b7495c72061c 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -666,6 +666,30 @@ struct cfg80211_ap_settings {
666}; 666};
667 667
668/** 668/**
669 * struct cfg80211_csa_settings - channel switch settings
670 *
671 * Used for channel switch
672 *
673 * @chandef: defines the channel to use after the switch
674 * @beacon_csa: beacon data while performing the switch
675 * @counter_offset_beacon: offset for the counter within the beacon (tail)
676 * @counter_offset_presp: offset for the counter within the probe response
677 * @beacon_after: beacon data to be used on the new channel
678 * @radar_required: whether radar detection is required on the new channel
679 * @block_tx: whether transmissions should be blocked while changing
680 * @count: number of beacons until switch
681 */
682struct cfg80211_csa_settings {
683 struct cfg80211_chan_def chandef;
684 struct cfg80211_beacon_data beacon_csa;
685 u16 counter_offset_beacon, counter_offset_presp;
686 struct cfg80211_beacon_data beacon_after;
687 bool radar_required;
688 bool block_tx;
689 u8 count;
690};
691
692/**
669 * enum station_parameters_apply_mask - station parameter values to apply 693 * enum station_parameters_apply_mask - station parameter values to apply
670 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp) 694 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp)
671 * @STATION_PARAM_APPLY_CAPABILITY: apply new capability 695 * @STATION_PARAM_APPLY_CAPABILITY: apply new capability
@@ -2139,6 +2163,8 @@ struct cfg80211_update_ft_ies_params {
2139 * @crit_proto_stop: Indicates critical protocol no longer needs increased link 2163 * @crit_proto_stop: Indicates critical protocol no longer needs increased link
2140 * reliability. This operation can not fail. 2164 * reliability. This operation can not fail.
2141 * @set_coalesce: Set coalesce parameters. 2165 * @set_coalesce: Set coalesce parameters.
2166 *
2167 * @channel_switch: initiate channel-switch procedure (with CSA)
2142 */ 2168 */
2143struct cfg80211_ops { 2169struct cfg80211_ops {
2144 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 2170 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2376,6 +2402,10 @@ struct cfg80211_ops {
2376 struct wireless_dev *wdev); 2402 struct wireless_dev *wdev);
2377 int (*set_coalesce)(struct wiphy *wiphy, 2403 int (*set_coalesce)(struct wiphy *wiphy,
2378 struct cfg80211_coalesce *coalesce); 2404 struct cfg80211_coalesce *coalesce);
2405
2406 int (*channel_switch)(struct wiphy *wiphy,
2407 struct net_device *dev,
2408 struct cfg80211_csa_settings *params);
2379}; 2409};
2380 2410
2381/* 2411/*
@@ -2441,6 +2471,8 @@ struct cfg80211_ops {
2441 * @WIPHY_FLAG_OFFCHAN_TX: Device supports direct off-channel TX. 2471 * @WIPHY_FLAG_OFFCHAN_TX: Device supports direct off-channel TX.
2442 * @WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL: Device supports remain-on-channel call. 2472 * @WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL: Device supports remain-on-channel call.
2443 * @WIPHY_FLAG_SUPPORTS_5_10_MHZ: Device supports 5 MHz and 10 MHz channels. 2473 * @WIPHY_FLAG_SUPPORTS_5_10_MHZ: Device supports 5 MHz and 10 MHz channels.
2474 * @WIPHY_FLAG_HAS_CHANNEL_SWITCH: Device supports channel switch in
2475 * beaconing mode (AP, IBSS, Mesh, ...).
2444 */ 2476 */
2445enum wiphy_flags { 2477enum wiphy_flags {
2446 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 2478 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
@@ -2465,6 +2497,7 @@ enum wiphy_flags {
2465 WIPHY_FLAG_OFFCHAN_TX = BIT(20), 2497 WIPHY_FLAG_OFFCHAN_TX = BIT(20),
2466 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(21), 2498 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(21),
2467 WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22), 2499 WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22),
2500 WIPHY_FLAG_HAS_CHANNEL_SWITCH = BIT(23),
2468}; 2501};
2469 2502
2470/** 2503/**
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 3124036285eb..9cda3728c2cb 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -152,11 +152,14 @@ struct ieee80211_low_level_stats {
152 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed 152 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed
153 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed 153 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed
154 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed 154 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed
155 * @IEEE80211_CHANCTX_CHANGE_CHANNEL: switched to another operating channel,
156 * this is used only with channel switching with CSA
155 */ 157 */
156enum ieee80211_chanctx_change { 158enum ieee80211_chanctx_change {
157 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), 159 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0),
158 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), 160 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1),
159 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2), 161 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2),
162 IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3),
160}; 163};
161 164
162/** 165/**
@@ -1084,6 +1087,7 @@ enum ieee80211_vif_flags {
1084 * @addr: address of this interface 1087 * @addr: address of this interface
1085 * @p2p: indicates whether this AP or STA interface is a p2p 1088 * @p2p: indicates whether this AP or STA interface is a p2p
1086 * interface, i.e. a GO or p2p-sta respectively 1089 * interface, i.e. a GO or p2p-sta respectively
1090 * @csa_active: marks whether a channel switch is going on
1087 * @driver_flags: flags/capabilities the driver has for this interface, 1091 * @driver_flags: flags/capabilities the driver has for this interface,
1088 * these need to be set (or cleared) when the interface is added 1092 * these need to be set (or cleared) when the interface is added
1089 * or, if supported by the driver, the interface type is changed 1093 * or, if supported by the driver, the interface type is changed
@@ -1106,6 +1110,7 @@ struct ieee80211_vif {
1106 struct ieee80211_bss_conf bss_conf; 1110 struct ieee80211_bss_conf bss_conf;
1107 u8 addr[ETH_ALEN]; 1111 u8 addr[ETH_ALEN];
1108 bool p2p; 1112 bool p2p;
1113 bool csa_active;
1109 1114
1110 u8 cab_queue; 1115 u8 cab_queue;
1111 u8 hw_queue[IEEE80211_NUM_ACS]; 1116 u8 hw_queue[IEEE80211_NUM_ACS];
@@ -2637,6 +2642,16 @@ enum ieee80211_roc_type {
2637 * @ipv6_addr_change: IPv6 address assignment on the given interface changed. 2642 * @ipv6_addr_change: IPv6 address assignment on the given interface changed.
2638 * Currently, this is only called for managed or P2P client interfaces. 2643 * Currently, this is only called for managed or P2P client interfaces.
2639 * This callback is optional; it must not sleep. 2644 * This callback is optional; it must not sleep.
2645 *
2646 * @channel_switch_beacon: Starts a channel switch to a new channel.
2647 * Beacons are modified to include CSA or ECSA IEs before calling this
2648 * function. The corresponding count fields in these IEs must be
2649 * decremented, and when they reach zero the driver must call
2650 * ieee80211_csa_finish(). Drivers which use ieee80211_beacon_get()
2651 * get the csa counter decremented by mac80211, but must check if it is
2652 * zero using ieee80211_csa_is_complete() after the beacon has been
2653 * transmitted and then call ieee80211_csa_finish().
2654 *
2640 */ 2655 */
2641struct ieee80211_ops { 2656struct ieee80211_ops {
2642 void (*tx)(struct ieee80211_hw *hw, 2657 void (*tx)(struct ieee80211_hw *hw,
@@ -2824,6 +2839,9 @@ struct ieee80211_ops {
2824 struct ieee80211_vif *vif, 2839 struct ieee80211_vif *vif,
2825 struct inet6_dev *idev); 2840 struct inet6_dev *idev);
2826#endif 2841#endif
2842 void (*channel_switch_beacon)(struct ieee80211_hw *hw,
2843 struct ieee80211_vif *vif,
2844 struct cfg80211_chan_def *chandef);
2827}; 2845};
2828 2846
2829/** 2847/**
@@ -3319,6 +3337,25 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
3319} 3337}
3320 3338
3321/** 3339/**
3340 * ieee80211_csa_finish - notify mac80211 about channel switch
3341 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3342 *
3343 * After a channel switch announcement was scheduled and the counter in this
3344 * announcement hit zero, this function must be called by the driver to
3345 * notify mac80211 that the channel can be changed.
3346 */
3347void ieee80211_csa_finish(struct ieee80211_vif *vif);
3348
3349/**
3350 * ieee80211_csa_is_complete - find out if counters reached zero
3351 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3352 *
3353 * This function returns whether the channel switch counters reached zero.
3354 */
3355bool ieee80211_csa_is_complete(struct ieee80211_vif *vif);
3356
3357
3358/**
3322 * ieee80211_proberesp_get - retrieve a Probe Response template 3359 * ieee80211_proberesp_get - retrieve a Probe Response template
3323 * @hw: pointer obtained from ieee80211_alloc_hw(). 3360 * @hw: pointer obtained from ieee80211_alloc_hw().
3324 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3361 * @vif: &struct ieee80211_vif pointer from the add_interface callback.