When a crypto key is being removed, rt2x00mac should not
reset the key->hw_key_idx value because that will prevent
the driver from removing the correct key from the hardware.
Furthermore ffz() starts counting at 0 instead of 1, so we don't
need to substract 1 from the resulting value.
Signed-off-by: Stephen Blackheath <tramp.enshrine.stephen@blacksapphire.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
* provided but key 0 is not, then the key is not found
* by the hardware during RX).
*/
- key->hw_key_idx = 0;
+ if (cmd == SET_KEY)
+ key->hw_key_idx = 0;
if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE)
set_key = rt2x00dev->ops->lib->config_pairwise_key;
if (reg && reg == mask)
return -ENOSPC;
- key->hw_key_idx += reg ? (ffz(reg) - 1) : 0;
+ key->hw_key_idx += reg ? ffz(reg) : 0;
/*
* Upload key to hardware
return -ENOSPC;
}
- key->hw_key_idx += reg ? (ffz(reg) - 1) : 0;
+ key->hw_key_idx += reg ? ffz(reg) : 0;
/*
* Upload key to hardware
if (reg && reg == mask)
return -ENOSPC;
- key->hw_key_idx += reg ? (ffz(reg) - 1) : 0;
+ key->hw_key_idx += reg ? ffz(reg) : 0;
/*
* Upload key to hardware
return -ENOSPC;
}
- key->hw_key_idx += reg ? (ffz(reg) - 1) : 0;
+ key->hw_key_idx += reg ? ffz(reg) : 0;
/*
* Upload key to hardware