[PATCH] fix for ESSID setting on FW AP cards

Pavel Roskin proski
Mon Nov 11 17:44:23 PST 2002


Hello!

The CVS version of HostAP doesn't try to set Own SSID if setting Desired
SSID has failed.  Cards with AP firmware don't support Desired SSID, so
their Own SSID is not set.

Sorry, I had to break that single "if" statement into pieces, so the patch
seems more complicated than it is.  When functions return 0 for success,
logic operations on them look confusing even for me.

The return value of local->func->reset_port() seems to be suitable for
returning as is.

The patch has been tested both on AP and non-AP cards.  The card with AP
firmware sends beacons with the new ESSID and allows association.  
Unfortunately, ping doesn't work yet, but I hope to fix it.  I believe
that HostAP doesn't work with firmware AP yet.

================================
--- driver/modules/hostap_ioctl.c
+++ driver/modules/hostap_ioctl.c
@@ -752,6 +752,7 @@ static int prism2_ioctl_siwessid(struct 
 				 struct iw_request_info *info,
 				 struct iw_point *data, char *ssid)
 {
+	int ret = 0;
 	local_info_t *local = (local_info_t *) dev->priv;
 
 	if (data->flags == 0)
@@ -768,12 +769,17 @@ static int prism2_ioctl_siwessid(struct 
 	memcpy(local->essid, ssid, IW_ESSID_MAX_SIZE);
 	local->essid[MAX_SSID_LEN] = '\0';
 
-	if (hostap_set_string(dev, HFA384X_RID_CNFDESIREDSSID, local->essid) ||
-	    hostap_set_string(dev, HFA384X_RID_CNFOWNSSID, local->essid) ||
-	    local->func->reset_port(dev))
+	/* Don't even try this with AP firmware */
+	if (!local->fw_ap)
+		ret = hostap_set_string(dev, HFA384X_RID_CNFDESIREDSSID,
+					  local->essid);
+
+
+	if (ret &&
+	    hostap_set_string(dev, HFA384X_RID_CNFOWNSSID, local->essid))
 		return -EINVAL;
 
-	return 0;
+	return local->func->reset_port(dev);
 }
 
 static int prism2_ioctl_giwessid(struct net_device *dev,
================================

-- 
Regards,
Pavel Roskin





More information about the Hostap mailing list