aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-01-22 12:44:19 -0500
committerJohannes Berg <johannes.berg@intel.com>2015-01-22 16:01:01 -0500
commitfa7e1fbcb52cc9efab394526a566d80fb31529bb (patch)
tree3fe7b35805171a28a7f23389a2a40cee834e5381 /include/net
parent54330bf63b49683d006d8f3857d45722a8c0fbff (diff)
mac80211: allow drivers to control software crypto
Some drivers unfortunately cannot support software crypto, but mac80211 currently assumes that they do. This has the issue that if the hardware enabling fails for some reason, the software fallback is used, which won't work. This clearly isn't desirable, the error should be reported and the key setting refused. Support this in mac80211 by allowing drivers to set a new HW flag IEEE80211_HW_SW_CRYPTO_CONTROL, in which case mac80211 will only allow software fallback if the set_key() method returns 1. The driver will also need to advertise supported cipher suites so that mac80211 doesn't advertise any (future) software ciphers that the driver can't actually do. While at it, to make it easier to support this, refactor the ieee80211_init_cipher_suites() code. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/mac80211.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 275ee56152ad..33b87c50a4cf 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1634,6 +1634,12 @@ struct ieee80211_tx_control {
1634 * be created. It is expected user-space will create vifs as 1634 * be created. It is expected user-space will create vifs as
1635 * desired (and thus have them named as desired). 1635 * desired (and thus have them named as desired).
1636 * 1636 *
1637 * @IEEE80211_HW_SW_CRYPTO_CONTROL: The driver wants to control which of the
1638 * crypto algorithms can be done in software - so don't automatically
1639 * try to fall back to it if hardware crypto fails, but do so only if
1640 * the driver returns 1. This also forces the driver to advertise its
1641 * supported cipher suites.
1642 *
1637 * @IEEE80211_HW_QUEUE_CONTROL: The driver wants to control per-interface 1643 * @IEEE80211_HW_QUEUE_CONTROL: The driver wants to control per-interface
1638 * queue mapping in order to use different queues (not just one per AC) 1644 * queue mapping in order to use different queues (not just one per AC)
1639 * for different virtual interfaces. See the doc section on HW queue 1645 * for different virtual interfaces. See the doc section on HW queue
@@ -1681,6 +1687,7 @@ enum ieee80211_hw_flags {
1681 IEEE80211_HW_MFP_CAPABLE = 1<<13, 1687 IEEE80211_HW_MFP_CAPABLE = 1<<13,
1682 IEEE80211_HW_WANT_MONITOR_VIF = 1<<14, 1688 IEEE80211_HW_WANT_MONITOR_VIF = 1<<14,
1683 IEEE80211_HW_NO_AUTO_VIF = 1<<15, 1689 IEEE80211_HW_NO_AUTO_VIF = 1<<15,
1690 IEEE80211_HW_SW_CRYPTO_CONTROL = 1<<16,
1684 /* free slots */ 1691 /* free slots */
1685 IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, 1692 IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18,
1686 IEEE80211_HW_CONNECTION_MONITOR = 1<<19, 1693 IEEE80211_HW_CONNECTION_MONITOR = 1<<19,
@@ -1955,6 +1962,11 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
1955 * added; if you return 0 then hw_key_idx must be assigned to the 1962 * added; if you return 0 then hw_key_idx must be assigned to the
1956 * hardware key index, you are free to use the full u8 range. 1963 * hardware key index, you are free to use the full u8 range.
1957 * 1964 *
1965 * Note that in the case that the @IEEE80211_HW_SW_CRYPTO_CONTROL flag is
1966 * set, mac80211 will not automatically fall back to software crypto if
1967 * enabling hardware crypto failed. The set_key() call may also return the
1968 * value 1 to permit this specific key/algorithm to be done in software.
1969 *
1958 * When the cmd is %DISABLE_KEY then it must succeed. 1970 * When the cmd is %DISABLE_KEY then it must succeed.
1959 * 1971 *
1960 * Note that it is permissible to not decrypt a frame even if a key 1972 * Note that it is permissible to not decrypt a frame even if a key