提交 ab644b0b 编写于 作者: Z Zhu Yi 提交者: John W. Linville

[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: NBill Moss <bmoss@clemson.edu>
Signed-off-by: NZhu Yi <yi.zhu@intel.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 c580f67f
...@@ -8837,28 +8837,23 @@ static int ipw_wx_set_essid(struct net_device *dev, ...@@ -8837,28 +8837,23 @@ static int ipw_wx_set_essid(struct net_device *dev,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
struct ipw_priv *priv = ieee80211_priv(dev); struct ipw_priv *priv = ieee80211_priv(dev);
char *essid = ""; /* ANY */ char *essid;
int length = 0; int length;
mutex_lock(&priv->mutex);
if (wrqu->essid.flags && wrqu->essid.length) { mutex_lock(&priv->mutex);
length = wrqu->essid.length - 1;
essid = extra; if (!wrqu->essid.flags)
} {
if (length == 0) { IPW_DEBUG_WX("Setting ESSID to ANY\n");
IPW_DEBUG_WX("Setting ESSID to ANY\n"); ipw_disassociate(priv);
if ((priv->config & CFG_STATIC_ESSID) && priv->config &= ~CFG_STATIC_ESSID;
!(priv->status & (STATUS_ASSOCIATED | ipw_associate(priv);
STATUS_ASSOCIATING))) { mutex_unlock(&priv->mutex);
IPW_DEBUG_ASSOC("Attempting to associate with new " return 0;
"parameters.\n"); }
priv->config &= ~CFG_STATIC_ESSID;
ipw_associate(priv);
}
mutex_unlock(&priv->mutex);
return 0;
}
length = min(length, IW_ESSID_MAX_SIZE); length = min(wrqu->essid.length, IW_ESSID_MAX_SIZE);
essid = extra;
priv->config |= CFG_STATIC_ESSID; priv->config |= CFG_STATIC_ESSID;
...@@ -8868,7 +8863,7 @@ static int ipw_wx_set_essid(struct net_device *dev, ...@@ -8868,7 +8863,7 @@ static int ipw_wx_set_essid(struct net_device *dev,
return 0; return 0;
} }
IPW_DEBUG_WX("Setting ESSID: '%s' (%d)\n", escape_essid(essid, length), IPW_DEBUG_WX("Setting ESSID: '%s' (%d)\n", escape_essid(extra, length),
length); length);
priv->essid_len = length; priv->essid_len = length;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册