diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ipw2200.c | 39 |
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; |