diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c --- a/sys/net80211/ieee80211_crypto.c +++ b/sys/net80211/ieee80211_crypto.c @@ -397,6 +397,21 @@ __func__, cip->ic_name); flags |= IEEE80211_KEY_SWCRYPT; } + /* + * Check if the software cipher is available; if not then + * fail it early. + * + * Some devices do not support all ciphers in software + * (for example they don't support a "raw" data path.) + */ + if ((flags & IEEE80211_KEY_SWCRYPT) && + (ic->ic_sw_cryptocaps & (1<ic_name); + vap->iv_stats.is_crypto_swcipherfail++; + return (0); + } /* * Hardware TKIP with software MIC is an important * combination; we handle it by flagging each key, diff --git a/sys/net80211/ieee80211_ioctl.h b/sys/net80211/ieee80211_ioctl.h --- a/sys/net80211/ieee80211_ioctl.h +++ b/sys/net80211/ieee80211_ioctl.h @@ -259,6 +259,7 @@ uint32_t is_rx_gcmpmic; /* rx MIC check failed (GCMP) */ uint32_t is_crypto_gcmp_nomem; /* gcmp crypto failed; no mem */ uint32_t is_crypto_gcmp_nospc; /* gcmp crypto failed; no mbuf space */ + uint32_t is_crypto_swcipherfail; /* no support for SW cipher */ uint32_t is_spare[5]; };