diff options
author | Javier Cardona <javier@cozybit.com> | 2008-09-16 21:08:39 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-24 16:18:01 -0400 |
commit | 9c40fc510a3df3a74731f5f251b9481feffc0ed5 (patch) | |
tree | d1789e5ab403b975c80dbb30a00414fc479ae923 | |
parent | 84e463fa0786a105c39281b90f8e3b6fe1444a05 (diff) |
libertas: Reduce the WPA key installation time (fixups)
This patch addresses comments from Dan Williams about the patch
committed as "libertas: Reduce the WPA key installation time."
Signed-off-by: Javier Cardona <javier@cozybit.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/libertas/dev.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/wext.c | 26 |
2 files changed, 24 insertions, 3 deletions
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index acb889e25900..f6f3753da303 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h | |||
@@ -58,6 +58,7 @@ struct lbs_802_11_security { | |||
58 | u8 WPA2enabled; | 58 | u8 WPA2enabled; |
59 | u8 wep_enabled; | 59 | u8 wep_enabled; |
60 | u8 auth_mode; | 60 | u8 auth_mode; |
61 | u32 key_mgmt; | ||
61 | }; | 62 | }; |
62 | 63 | ||
63 | /** Current Basic Service Set State Structure */ | 64 | /** Current Basic Service Set State Structure */ |
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c index 11297dcf9fc3..6ebdd7f161f1 100644 --- a/drivers/net/wireless/libertas/wext.c +++ b/drivers/net/wireless/libertas/wext.c | |||
@@ -1598,8 +1598,20 @@ static int lbs_set_encodeext(struct net_device *dev, | |||
1598 | } | 1598 | } |
1599 | 1599 | ||
1600 | out: | 1600 | out: |
1601 | if (ret == 0) { /* key installation is time critical: postpone not! */ | 1601 | if (ret == 0) { |
1602 | lbs_do_association_work(priv); | 1602 | /* 802.1x and WPA rekeying must happen as quickly as possible, |
1603 | * especially during the 4-way handshake; thus if in | ||
1604 | * infrastructure mode, and either (a) 802.1x is enabled or | ||
1605 | * (b) WPA is being used, set the key right away. | ||
1606 | */ | ||
1607 | if (assoc_req->mode == IW_MODE_INFRA && | ||
1608 | ((assoc_req->secinfo.key_mgmt & IW_AUTH_KEY_MGMT_802_1X) || | ||
1609 | (assoc_req->secinfo.key_mgmt & IW_AUTH_KEY_MGMT_PSK) || | ||
1610 | assoc_req->secinfo.WPAenabled || | ||
1611 | assoc_req->secinfo.WPA2enabled)) { | ||
1612 | lbs_do_association_work(priv); | ||
1613 | } else | ||
1614 | lbs_postpone_association_work(priv); | ||
1603 | } else { | 1615 | } else { |
1604 | lbs_cancel_association_work(priv); | 1616 | lbs_cancel_association_work(priv); |
1605 | } | 1617 | } |
@@ -1707,13 +1719,17 @@ static int lbs_set_auth(struct net_device *dev, | |||
1707 | case IW_AUTH_TKIP_COUNTERMEASURES: | 1719 | case IW_AUTH_TKIP_COUNTERMEASURES: |
1708 | case IW_AUTH_CIPHER_PAIRWISE: | 1720 | case IW_AUTH_CIPHER_PAIRWISE: |
1709 | case IW_AUTH_CIPHER_GROUP: | 1721 | case IW_AUTH_CIPHER_GROUP: |
1710 | case IW_AUTH_KEY_MGMT: | ||
1711 | case IW_AUTH_DROP_UNENCRYPTED: | 1722 | case IW_AUTH_DROP_UNENCRYPTED: |
1712 | /* | 1723 | /* |
1713 | * libertas does not use these parameters | 1724 | * libertas does not use these parameters |
1714 | */ | 1725 | */ |
1715 | break; | 1726 | break; |
1716 | 1727 | ||
1728 | case IW_AUTH_KEY_MGMT: | ||
1729 | assoc_req->secinfo.key_mgmt = dwrq->value; | ||
1730 | updated = 1; | ||
1731 | break; | ||
1732 | |||
1717 | case IW_AUTH_WPA_VERSION: | 1733 | case IW_AUTH_WPA_VERSION: |
1718 | if (dwrq->value & IW_AUTH_WPA_VERSION_DISABLED) { | 1734 | if (dwrq->value & IW_AUTH_WPA_VERSION_DISABLED) { |
1719 | assoc_req->secinfo.WPAenabled = 0; | 1735 | assoc_req->secinfo.WPAenabled = 0; |
@@ -1793,6 +1809,10 @@ static int lbs_get_auth(struct net_device *dev, | |||
1793 | lbs_deb_enter(LBS_DEB_WEXT); | 1809 | lbs_deb_enter(LBS_DEB_WEXT); |
1794 | 1810 | ||
1795 | switch (dwrq->flags & IW_AUTH_INDEX) { | 1811 | switch (dwrq->flags & IW_AUTH_INDEX) { |
1812 | case IW_AUTH_KEY_MGMT: | ||
1813 | dwrq->value = priv->secinfo.key_mgmt; | ||
1814 | break; | ||
1815 | |||
1796 | case IW_AUTH_WPA_VERSION: | 1816 | case IW_AUTH_WPA_VERSION: |
1797 | dwrq->value = 0; | 1817 | dwrq->value = 0; |
1798 | if (priv->secinfo.WPAenabled) | 1818 | if (priv->secinfo.WPAenabled) |