iwlwifi: mvm: fix TX crypto on 22560+ devices
authorJohannes Berg <johannes.berg@intel.com>
Wed, 6 Feb 2019 12:54:17 +0000 (13:54 +0100)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 22 Mar 2019 10:49:03 +0000 (12:49 +0200)
commit475c6bde7228e2d624153626941f290a314e4672
tree9cd3d14026b70183f34c3c8f090484cc8cb6e230
parent7dfc45e6282a7662279d168cc1219929456f8750
iwlwifi: mvm: fix TX crypto on 22560+ devices

In the old days, we could transmit with HW crypto with an arbitrary
key by filling it into TX_CMD. This was broken first with the advent
of CCMP/GCMP-256 keys which don't fit there.

This was broken *again* with the newer TX_CMD format on 22560+,
where we simply cannot pass key material anymore. However, we forgot
to update all the cases when we get a key from mac80211 and don't
program it into the hardware but still return 0 for HW crypto on TX.

In AP mode with WEP, we tried to fix this by programming the keys
separately for each station later, but this ultimately turns out to
be buggy, for example now it leaks memory when we have more than one
WEP key.

Fix this by simply using only SW crypto for WEP in newer devices by
returning -EOPNOTSUPP instead of trying to program WEP keys later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/sta.c
drivers/net/wireless/intel/iwlwifi/mvm/sta.h