diff options
author | Dan Williams <dcbw@redhat.com> | 2007-05-28 23:54:55 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-06-11 14:28:46 -0400 |
commit | d8efea254887128d710cc1475505514da004932c (patch) | |
tree | 450ce4f6bbc1fca6468de784c1ce7b6d34b2059e /drivers/net/wireless/libertas/wext.c | |
parent | 785e8f2679ce9ae703f1c737aa4d48b315d511ca (diff) |
[PATCH] libertas: remove structure WLAN_802_11_SSID and libertas_escape_essid
Replace WLAN_802_11_SSID with direct 'ssid' and 'ssid_len' members
like ieee80211. In the process, remove private libertas_escape_essid
and depend on the ieee80211 implementation of escape_essid instead.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/wext.c')
-rw-r--r-- | drivers/net/wireless/libertas/wext.c | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c index 5b7e5f257d62..8939251a2f4c 100644 --- a/drivers/net/wireless/libertas/wext.c +++ b/drivers/net/wireless/libertas/wext.c | |||
@@ -2163,12 +2163,12 @@ static int wlan_get_essid(struct net_device *dev, struct iw_request_info *info, | |||
2163 | * Get the current SSID | 2163 | * Get the current SSID |
2164 | */ | 2164 | */ |
2165 | if (adapter->connect_status == libertas_connected) { | 2165 | if (adapter->connect_status == libertas_connected) { |
2166 | memcpy(extra, adapter->curbssparams.ssid.ssid, | 2166 | memcpy(extra, adapter->curbssparams.ssid, |
2167 | adapter->curbssparams.ssid.ssidlength); | 2167 | adapter->curbssparams.ssid_len); |
2168 | extra[adapter->curbssparams.ssid.ssidlength] = '\0'; | 2168 | extra[adapter->curbssparams.ssid_len] = '\0'; |
2169 | } else { | 2169 | } else { |
2170 | memset(extra, 0, 32); | 2170 | memset(extra, 0, 32); |
2171 | extra[adapter->curbssparams.ssid.ssidlength] = '\0'; | 2171 | extra[adapter->curbssparams.ssid_len] = '\0'; |
2172 | } | 2172 | } |
2173 | /* | 2173 | /* |
2174 | * If none, we may want to get the one that was set | 2174 | * If none, we may want to get the one that was set |
@@ -2176,10 +2176,10 @@ static int wlan_get_essid(struct net_device *dev, struct iw_request_info *info, | |||
2176 | 2176 | ||
2177 | /* To make the driver backward compatible with WPA supplicant v0.2.4 */ | 2177 | /* To make the driver backward compatible with WPA supplicant v0.2.4 */ |
2178 | if (dwrq->length == 32) /* check with WPA supplicant buffer size */ | 2178 | if (dwrq->length == 32) /* check with WPA supplicant buffer size */ |
2179 | dwrq->length = min_t(size_t, adapter->curbssparams.ssid.ssidlength, | 2179 | dwrq->length = min_t(size_t, adapter->curbssparams.ssid_len, |
2180 | IW_ESSID_MAX_SIZE); | 2180 | IW_ESSID_MAX_SIZE); |
2181 | else | 2181 | else |
2182 | dwrq->length = adapter->curbssparams.ssid.ssidlength + 1; | 2182 | dwrq->length = adapter->curbssparams.ssid_len + 1; |
2183 | 2183 | ||
2184 | dwrq->flags = 1; /* active */ | 2184 | dwrq->flags = 1; /* active */ |
2185 | 2185 | ||
@@ -2193,9 +2193,10 @@ static int wlan_set_essid(struct net_device *dev, struct iw_request_info *info, | |||
2193 | wlan_private *priv = dev->priv; | 2193 | wlan_private *priv = dev->priv; |
2194 | wlan_adapter *adapter = priv->adapter; | 2194 | wlan_adapter *adapter = priv->adapter; |
2195 | int ret = 0; | 2195 | int ret = 0; |
2196 | struct WLAN_802_11_SSID ssid; | 2196 | u8 ssid[IW_ESSID_MAX_SIZE]; |
2197 | u8 ssid_len = 0; | ||
2197 | struct assoc_request * assoc_req; | 2198 | struct assoc_request * assoc_req; |
2198 | int ssid_len = dwrq->length; | 2199 | int in_ssid_len = dwrq->length; |
2199 | 2200 | ||
2200 | lbs_deb_enter(LBS_DEB_WEXT); | 2201 | lbs_deb_enter(LBS_DEB_WEXT); |
2201 | 2202 | ||
@@ -2204,27 +2205,31 @@ static int wlan_set_essid(struct net_device *dev, struct iw_request_info *info, | |||
2204 | * SSID length so it can be used like a string. WE-21 and later don't, | 2205 | * SSID length so it can be used like a string. WE-21 and later don't, |
2205 | * but some userspace tools aren't able to cope with the change. | 2206 | * but some userspace tools aren't able to cope with the change. |
2206 | */ | 2207 | */ |
2207 | if ((ssid_len > 0) && (extra[ssid_len - 1] == '\0')) | 2208 | if ((in_ssid_len > 0) && (extra[in_ssid_len - 1] == '\0')) |
2208 | ssid_len--; | 2209 | in_ssid_len--; |
2209 | 2210 | ||
2210 | /* Check the size of the string */ | 2211 | /* Check the size of the string */ |
2211 | if (ssid_len > IW_ESSID_MAX_SIZE) { | 2212 | if (in_ssid_len > IW_ESSID_MAX_SIZE) { |
2212 | ret = -E2BIG; | 2213 | ret = -E2BIG; |
2213 | goto out; | 2214 | goto out; |
2214 | } | 2215 | } |
2215 | 2216 | ||
2216 | memset(&ssid, 0, sizeof(struct WLAN_802_11_SSID)); | 2217 | memset(&ssid, 0, sizeof(ssid)); |
2217 | 2218 | ||
2218 | if (!dwrq->flags || !ssid_len) { | 2219 | if (!dwrq->flags || !in_ssid_len) { |
2219 | /* "any" SSID requested; leave SSID blank */ | 2220 | /* "any" SSID requested; leave SSID blank */ |
2220 | } else { | 2221 | } else { |
2221 | /* Specific SSID requested */ | 2222 | /* Specific SSID requested */ |
2222 | memcpy(&ssid.ssid, extra, ssid_len); | 2223 | memcpy(&ssid, extra, in_ssid_len); |
2223 | ssid.ssidlength = ssid_len; | 2224 | ssid_len = in_ssid_len; |
2224 | } | 2225 | } |
2225 | 2226 | ||
2226 | lbs_deb_wext("requested new SSID '%s'\n", | 2227 | if (!ssid_len) { |
2227 | (ssid.ssidlength > 0) ? (char *)ssid.ssid : "any"); | 2228 | lbs_deb_wext("requested any SSID\n"); |
2229 | } else { | ||
2230 | lbs_deb_wext("requested SSID '%s'\n", | ||
2231 | escape_essid(ssid, ssid_len)); | ||
2232 | } | ||
2228 | 2233 | ||
2229 | out: | 2234 | out: |
2230 | mutex_lock(&adapter->lock); | 2235 | mutex_lock(&adapter->lock); |
@@ -2235,7 +2240,8 @@ out: | |||
2235 | ret = -ENOMEM; | 2240 | ret = -ENOMEM; |
2236 | } else { | 2241 | } else { |
2237 | /* Copy the SSID to the association request */ | 2242 | /* Copy the SSID to the association request */ |
2238 | memcpy(&assoc_req->ssid, &ssid, sizeof(struct WLAN_802_11_SSID)); | 2243 | memcpy(&assoc_req->ssid, &ssid, IW_ESSID_MAX_SIZE); |
2244 | assoc_req->ssid_len = ssid_len; | ||
2239 | set_bit(ASSOC_FLAG_SSID, &assoc_req->flags); | 2245 | set_bit(ASSOC_FLAG_SSID, &assoc_req->flags); |
2240 | wlan_postpone_association_work(priv); | 2246 | wlan_postpone_association_work(priv); |
2241 | } | 2247 | } |