Jean Tourrilhes | 3 Oct 00:26
Picon
Favicon

Re: Fw: wpa supplicant/ipw3945, ESSID last char missing

On Mon, Oct 02, 2006 at 10:28:57PM +0200, Norbert Preining wrote:
> Dear Jean!
> 
> On Mon, 02 Okt 2006, Jean Tourrilhes wrote:
> > 	The driver is an out-of-tree driver. This driver has not yet
> > been upgraded to the WE-21 changes. Drivers out of the kernel tree
> > will always lag a bit compared to in-kernel drivers, that's the nature
> > of the game.
> > 	I already sent patches for the ipw2100 and ipw2200 to the
> > Intel guys, and they are trivial to adapt to the ipw3945. I expect
> > those to appear in Intel's tree sometime.
> 
> Can you send me the patches, too? I would check whether they work for
> ipw3945.
> 
> Best wishes
> 
> Norbert

	Sorry for the delay, we have a pretty nice flame war going on,
and I've got my wife on the other line as usual ;-)
	I quickly hacked my patch into the ipw3945 driver. This patch
include the backward compatibility, which is needed for out-of-tree
drivers. Not tested, not compiled, so it may or may not work, but at
least should point you in the overall direction.
	Have fun...

	Jean

----------------------------------------------------

--- ipw3945-1.1.0/ipw3945.20.c	2006-10-02 15:15:42.000000000 -0700
+++ ipw3945-1.1.0/ipw3945.c	2006-10-02 15:17:55.000000000 -0700
@@ -12082,6 +12082,14 @@ static int ipw_wx_get_wap(struct net_dev
 	return 0;
 }

+#if WIRELESS_EXT > 20
+#define IW_ESSID_FIX	0
+#else
+#define IW_ESSID_FIX	1
+#define IW_RETRY_LONG IW_RETRY_MAX
+#define IW_RETRY_SHORT IW_RETRY_MIN
+#endif
+
 static int ipw_wx_set_essid(struct net_device *dev,
 			    struct iw_request_info *info,
 			    union iwreq_data *wrqu, char *extra)
@@ -12095,7 +12103,7 @@ static int ipw_wx_set_essid(struct net_d

 	mutex_lock(&priv->mutex);
 	if (wrqu->essid.flags && wrqu->essid.length) {
-		length = wrqu->essid.length - 1;
+		length = wrqu->essid.length - IW_ESSID_FIX;
 		essid = extra;
 	}

@@ -12147,7 +12155,7 @@ static int ipw_wx_get_essid(struct net_d
 		IPW_DEBUG_WX("Getting essid: '%s'\n",
 			     escape_essid(priv->essid, priv->essid_len));
 		memcpy(extra, priv->essid, priv->essid_len);
-		wrqu->essid.length = priv->essid_len;
+		wrqu->essid.length = priv->essid_len + IW_ESSID_FIX;
 		wrqu->essid.flags = 1;	/* active */
 	} else {
 		IPW_DEBUG_WX("Getting essid: ANY\n");
@@ -12184,7 +12192,7 @@ static int ipw_wx_get_nick(struct net_de

 	IPW_DEBUG_WX("Getting nick\n");
 	mutex_lock(&priv->mutex);
-	wrqu->data.length = strlen(priv->nick) + 1;
+	wrqu->data.length = strlen(priv->nick) + IW_ESSID_FIX;
 	memcpy(extra, priv->nick, wrqu->data.length);
 	wrqu->data.flags = 1;	/* active */
 	mutex_unlock(&priv->mutex);

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

Gmane