diff options
author | Javier Cardona <javier@cozybit.com> | 2008-11-06 18:28:49 -0800 |
---|---|---|
committer | Deepak Saxena <dsaxena@laptop.org> | 2008-11-11 12:10:29 -0800 |
commit | fc9cfc450ad1d65c112599ebfd108bd76369457f (patch) | |
tree | 810b1d33dcb7d26a6e64ef03d0ec251912a9dd1e | |
parent | 969595c572b62276d95397186f58c7dc99e34a94 (diff) | |
download | lwn-fc9cfc450ad1d65c112599ebfd108bd76369457f.tar.gz lwn-fc9cfc450ad1d65c112599ebfd108bd76369457f.zip |
libertas: Avoid redundant commands to clear WPA keys.
Signed-off-by: Javier Cardona <javier@cozybit.com>
-rw-r--r-- | drivers/net/wireless/libertas/wext.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c index e2bbc64c7809..62abd0c666c4 100644 --- a/drivers/net/wireless/libertas/wext.c +++ b/drivers/net/wireless/libertas/wext.c @@ -1523,9 +1523,15 @@ static int lbs_set_encodeext(struct net_device *dev, if ((alg == IW_ENCODE_ALG_NONE) || (dwrq->flags & IW_ENCODE_DISABLED)) { disable_wep (assoc_req); - memset(&priv->wpa_mcast_key, 0, sizeof(struct enc_key)); - memset(&priv->wpa_unicast_key, 0, sizeof(struct enc_key)); - lbs_schedule_wpa_key_work(priv); + if ((priv->wpa_mcast_key.flags & KEY_INFO_WPA_ENABLED) || + (priv->wpa_unicast_key.flags & KEY_INFO_WPA_ENABLED)) { + /* clear keys and KEY_INFO_WPA_INSTALLED flag so keys + * are pushed to the hardware. */ + memset(&priv->wpa_mcast_key, 0, sizeof(struct enc_key)); + memset(&priv->wpa_unicast_key, 0, + sizeof(struct enc_key)); + lbs_schedule_wpa_key_work(priv); + } } else if (alg == IW_ENCODE_ALG_WEP) { u16 is_default = 0, index, set_tx_key = 0; |