mac80211: Optimize tailroom_needed update checks
Optimize/cleanup the delay tailroom checks and adds one missing tailroom update. Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Родитель
8dbb000ee7
Коммит
092c4098f2
|
@ -140,6 +140,12 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
|
||||||
* so clear that flag now to avoid trying to remove
|
* so clear that flag now to avoid trying to remove
|
||||||
* it again later.
|
* it again later.
|
||||||
*/
|
*/
|
||||||
|
if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE &&
|
||||||
|
!(key->conf.flags & (IEEE80211_KEY_FLAG_GENERATE_MMIC |
|
||||||
|
IEEE80211_KEY_FLAG_PUT_MIC_SPACE |
|
||||||
|
IEEE80211_KEY_FLAG_RESERVE_TAILROOM)))
|
||||||
|
increment_tailroom_need_count(sdata);
|
||||||
|
|
||||||
key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
|
key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -177,9 +183,9 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE;
|
key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE;
|
||||||
|
|
||||||
if (!((key->conf.flags & (IEEE80211_KEY_FLAG_GENERATE_MMIC |
|
if (!(key->conf.flags & (IEEE80211_KEY_FLAG_GENERATE_MMIC |
|
||||||
IEEE80211_KEY_FLAG_PUT_MIC_SPACE)) ||
|
IEEE80211_KEY_FLAG_PUT_MIC_SPACE |
|
||||||
(key->conf.flags & IEEE80211_KEY_FLAG_RESERVE_TAILROOM)))
|
IEEE80211_KEY_FLAG_RESERVE_TAILROOM)))
|
||||||
decrease_tailroom_need_count(sdata, 1);
|
decrease_tailroom_need_count(sdata, 1);
|
||||||
|
|
||||||
WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) &&
|
WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) &&
|
||||||
|
@ -243,9 +249,9 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key)
|
||||||
sta = key->sta;
|
sta = key->sta;
|
||||||
sdata = key->sdata;
|
sdata = key->sdata;
|
||||||
|
|
||||||
if (!((key->conf.flags & (IEEE80211_KEY_FLAG_GENERATE_MMIC |
|
if (!(key->conf.flags & (IEEE80211_KEY_FLAG_GENERATE_MMIC |
|
||||||
IEEE80211_KEY_FLAG_PUT_MIC_SPACE)) ||
|
IEEE80211_KEY_FLAG_PUT_MIC_SPACE |
|
||||||
(key->conf.flags & IEEE80211_KEY_FLAG_RESERVE_TAILROOM)))
|
IEEE80211_KEY_FLAG_RESERVE_TAILROOM)))
|
||||||
increment_tailroom_need_count(sdata);
|
increment_tailroom_need_count(sdata);
|
||||||
|
|
||||||
key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
|
key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
|
||||||
|
@ -1188,9 +1194,9 @@ void ieee80211_remove_key(struct ieee80211_key_conf *keyconf)
|
||||||
if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) {
|
if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) {
|
||||||
key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
|
key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
|
||||||
|
|
||||||
if (!((key->conf.flags & (IEEE80211_KEY_FLAG_GENERATE_MMIC |
|
if (!(key->conf.flags & (IEEE80211_KEY_FLAG_GENERATE_MMIC |
|
||||||
IEEE80211_KEY_FLAG_PUT_MIC_SPACE)) ||
|
IEEE80211_KEY_FLAG_PUT_MIC_SPACE |
|
||||||
(key->conf.flags & IEEE80211_KEY_FLAG_RESERVE_TAILROOM)))
|
IEEE80211_KEY_FLAG_RESERVE_TAILROOM)))
|
||||||
increment_tailroom_need_count(key->sdata);
|
increment_tailroom_need_count(key->sdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче