aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ipw2200.c
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2006-08-20 23:37:13 -0400
committerJohn W. Linville <linville@tuxdriver.com>2006-08-29 17:06:31 -0400
commitab644b0b51bf3170b398c087b7a34be6d3c7b7ba (patch)
tree00dc1725331833e7f7d04aab9e855803500d4634 /drivers/net/wireless/ipw2200.c
parentc580f67fd7fa9deee1f4cf6b86c694b880534a82 (diff)
[PATCH] ipw2200: ipw_wx_set_essid fix
This patch cleanups the ipw_wx_set_essid code and forces a reassociation when setting the essid to "any". I have tested this patch with iwconfig. It makes ipw2200 compliant with all the cases mentioned in the iwconfig man page. The commands iwconfig iface essid any iwconfig iface essid -- any iwconfig iface essid off iwconfig iface essid on all seemed to work correctly. None of this worked before the patch. Note, this patch treats iwconfig iface essid iwconfig iface essid "" The same. It produces an error message: essid: Unknown host. Since an essid of "" is not mentioned in the iwconfig man page. Signed-off-by: Bill Moss <bmoss@clemson.edu> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ipw2200.c')
-rw-r--r--drivers/net/wireless/ipw2200.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 0b2c774f5ee7..27e87d1b9f44 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -8837,28 +8837,23 @@ static int ipw_wx_set_essid(struct net_device *dev,
8837 union iwreq_data *wrqu, char *extra) 8837 union iwreq_data *wrqu, char *extra)
8838{ 8838{
8839 struct ipw_priv *priv = ieee80211_priv(dev); 8839 struct ipw_priv *priv = ieee80211_priv(dev);
8840 char *essid = ""; /* ANY */ 8840 char *essid;
8841 int length = 0; 8841 int length;
8842 mutex_lock(&priv->mutex); 8842
8843 if (wrqu->essid.flags && wrqu->essid.length) { 8843 mutex_lock(&priv->mutex);
8844 length = wrqu->essid.length - 1; 8844
8845 essid = extra; 8845 if (!wrqu->essid.flags)
8846 } 8846 {
8847 if (length == 0) { 8847 IPW_DEBUG_WX("Setting ESSID to ANY\n");
8848 IPW_DEBUG_WX("Setting ESSID to ANY\n"); 8848 ipw_disassociate(priv);
8849 if ((priv->config & CFG_STATIC_ESSID) && 8849 priv->config &= ~CFG_STATIC_ESSID;
8850 !(priv->status & (STATUS_ASSOCIATED | 8850 ipw_associate(priv);
8851 STATUS_ASSOCIATING))) { 8851 mutex_unlock(&priv->mutex);
8852 IPW_DEBUG_ASSOC("Attempting to associate with new " 8852 return 0;
8853 "parameters.\n"); 8853 }
8854 priv->config &= ~CFG_STATIC_ESSID;
8855 ipw_associate(priv);
8856 }
8857 mutex_unlock(&priv->mutex);
8858 return 0;
8859 }
8860 8854
8861 length = min(length, IW_ESSID_MAX_SIZE); 8855 length = min(wrqu->essid.length, IW_ESSID_MAX_SIZE);
8856 essid = extra;
8862 8857
8863 priv->config |= CFG_STATIC_ESSID; 8858 priv->config |= CFG_STATIC_ESSID;
8864 8859
@@ -8868,7 +8863,7 @@ static int ipw_wx_set_essid(struct net_device *dev,
8868 return 0; 8863 return 0;
8869 } 8864 }
8870 8865
8871 IPW_DEBUG_WX("Setting ESSID: '%s' (%d)\n", escape_essid(essid, length), 8866 IPW_DEBUG_WX("Setting ESSID: '%s' (%d)\n", escape_essid(extra, length),
8872 length); 8867 length);
8873 8868
8874 priv->essid_len = length; 8869 priv->essid_len = length;