mac80211: Re-fix accounting of the tailroom-needed counter
authorIdo Yariv <ido@wizery.com>
Tue, 6 Jan 2015 13:39:02 +0000 (08:39 -0500)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 7 Jan 2015 13:39:32 +0000 (14:39 +0100)
When hw acceleration is enabled, the GENERATE_IV or PUT_IV_SPACE flags
only require headroom space. Therefore, the tailroom-needed counter can
safely be decremented for most drivers.

The older incarnation of this patch (ca34e3b5) assumed that the above
holds true for all drivers. As reported by Christopher Chavez and
researched by Christian Lamparter and Larry Finger, this isn't a valid
assumption for p54 and cw1200.

Drivers that still require tailroom for ICV/MIC even when HW encryption
is enabled can use IEEE80211_KEY_FLAG_RESERVE_TAILROOM to indicate it.

Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Cc: Christopher Chavez <chrischavez@gmx.us>
Cc: Christian Lamparter <chunkeey@googlemail.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/cw1200/sta.c
drivers/net/wireless/p54/main.c
include/net/mac80211.h
net/mac80211/key.c

index a1e3237..4a47c7f 100644 (file)
@@ -709,7 +709,8 @@ int cw1200_set_key(struct ieee80211_hw *dev, enum set_key_cmd cmd,
                if (sta)
                        peer_addr = sta->addr;
 
-               key->flags |= IEEE80211_KEY_FLAG_PUT_IV_SPACE;
+               key->flags |= IEEE80211_KEY_FLAG_PUT_IV_SPACE |
+                             IEEE80211_KEY_FLAG_RESERVE_TAILROOM;
 
                switch (key->cipher) {
                case WLAN_CIPHER_SUITE_WEP40:
Simple merge
Simple merge
Simple merge