Skip to contentSkip to conversation

WE-21 for ipw2200

PATCH In review Jean Tourrilhes 2 participants 4 messages Aug 30, 2006 – Sep 12, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 WE-21 for ipw2200

        Hi,

        WE-21 for IPW2200 driver...

        Jean

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

drivers/net/wireless/ipw2200.c renamed from drivers/net/wireless/ipw2200.20.c +8 -8
diff -u -p linux/drivers/net/wireless/ipw2200.20.c linux/drivers/net/wireless/ipw2200.c
@@ -8861,7 +8861,7 @@ static int ipw_wx_set_essid(struct net_d
 	int length = 0;
 	mutex_lock(&priv->mutex);
 	if (wrqu->essid.flags && wrqu->essid.length) {
-		length = wrqu->essid.length - 1;
+		length = wrqu->essid.length;
 		essid = extra;
 	}
 	if (length == 0) {
@@ -8954,7 +8954,7 @@ static int ipw_wx_get_nick(struct net_de
 	struct ipw_priv *priv = ieee80211_priv(dev);
 	IPW_DEBUG_WX("Getting nick\n");
 	mutex_lock(&priv->mutex);
-	wrqu->data.length = strlen(priv->nick) + 1;
+	wrqu->data.length = strlen(priv->nick);
 	memcpy(extra, priv->nick, wrqu->data.length);
 	wrqu->data.flags = 1;	/* active */
 	mutex_unlock(&priv->mutex);
@@ -9277,9 +9277,9 @@ static int ipw_wx_set_retry(struct net_d
 		return -EINVAL;
 
 	mutex_lock(&priv->mutex);
-	if (wrqu->retry.flags & IW_RETRY_MIN)
+	if (wrqu->retry.flags & IW_RETRY_SHORT)
 		priv->short_retry_limit = (u8) wrqu->retry.value;
-	else if (wrqu->retry.flags & IW_RETRY_MAX)
+	else if (wrqu->retry.flags & IW_RETRY_LONG)
 		priv->long_retry_limit = (u8) wrqu->retry.value;
 	else {
 		priv->short_retry_limit = (u8) wrqu->retry.value;
@@ -9308,11 +9308,11 @@ static int ipw_wx_get_retry(struct net_d
 		return -EINVAL;
 	}
 
-	if (wrqu->retry.flags & IW_RETRY_MAX) {
-		wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_MAX;
+	if (wrqu->retry.flags & IW_RETRY_LONG) {
+		wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_LONG;
 		wrqu->retry.value = priv->long_retry_limit;
-	} else if (wrqu->retry.flags & IW_RETRY_MIN) {
-		wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_MIN;
+	} else if (wrqu->retry.flags & IW_RETRY_SHORT) {
+		wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_SHORT;
 		wrqu->retry.value = priv->short_retry_limit;
 	} else {
 		wrqu->retry.flags = IW_RETRY_LIMIT;
#1 lore raw
Quoted 14 lines · Jean Tourrilhes
        Hi,

        WE-21 for IPW2200 driver...

        Jean

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

diff -u -p linux/drivers/net/wireless/ipw2200.20.c linux/drivers/net/wireless/ipw2200.c

drivers/net/wireless/ipw2200.c static int ipw_wx_set_essid(struct net_d · line 8867

Quoted 8 lines
drivers/net/wireless/ipw2200.c renamed from drivers/net/wireless/ipw2200.20.c +1 -1
@@ -8861,7 +8861,7 @@ static int ipw_wx_set_essid(struct net_d
 	int length = 0;
 	mutex_lock(&priv->mutex);
 	if (wrqu->essid.flags && wrqu->essid.length) {
-		length = wrqu->essid.length - 1;
+		length = wrqu->essid.length;
 		essid = extra;
 	}
 	if (length == 0) {

This hunk doesn't apply to the upstream branch of wireless-2.6. I propose this one instead:

@@ -8875,8 +8875,6 @@ static int ipw_wx_set_essid(struct net_d

         }

length = min((int)wrqu->essid.length, IW_ESSID_MAX_SIZE);
- if (!extra[length - 1])
- length--;

priv->config |= CFG_STATIC_ESSID;

Everything else stays the same...OK?

John

Signature · 2 lines
John W. Linville
[email protected]
#2 lore raw
Quoted 12 lines · John W. Linville

drivers/net/wireless/ipw2200.c static int ipw_wx_set_essid(struct net_d · line 8867

Quoted 9 lines · Jean Tourrilhes
drivers/net/wireless/ipw2200.c renamed from drivers/net/wireless/ipw2200.20.c +1 -1
@@ -8861,7 +8861,7 @@ static int ipw_wx_set_essid(struct net_d
 	int length = 0;
 	mutex_lock(&priv->mutex);
 	if (wrqu->essid.flags && wrqu->essid.length) {
-		length = wrqu->essid.length - 1;
+		length = wrqu->essid.length;
 		essid = extra;
 	}
 	if (length == 0) {

This hunk doesn't apply to the upstream branch of wireless-2.6.

It did apply to your branch the day I sent the patches. Sorry
about that.

Quoted 11 lines

I propose this one instead:

(quoted diff) +0 -2
@@ -8875,8 +8875,6 @@ static int ipw_wx_set_essid(struct net_d
         }
 
 	length = min((int)wrqu->essid.length, IW_ESSID_MAX_SIZE);
-	if (!extra[length - 1])
-		length--;
 
 	priv->config |= CFG_STATIC_ESSID;
 
Quoted 1 line

Everything else stays the same...OK?

It looks good. I will double check the code, and redo the
out-of-tree patch for the IPW people. GIT through our HTTP proxy is quite slow, so bear with me :-(

Quoted 1 line

John

Jean

#3 lore raw
In reply to John W. Linville
Quoted 14 lines · John W. Linville

On Tue, Aug 29, 2006 at 06:01:40PM -0700, Jean Tourrilhes wrote:

This hunk doesn't apply to the upstream branch of wireless-2.6. I propose this one instead:

(quoted diff) +0 -2
@@ -8875,8 +8875,6 @@ static int ipw_wx_set_essid(struct net_d
         }
 
 	length = min((int)wrqu->essid.length, IW_ESSID_MAX_SIZE);
-	if (!extra[length - 1])
-		length--;
 
 	priv->config |= CFG_STATIC_ESSID;
 
Quoted 1 line

Everything else stays the same...OK?

Double checked, that seems to be allright.

Quoted 1 line

John

James & Zhu : the patch for the out-of-tree driver is
attached, diffed against the driver in GIT. It should work for both pre-WE21 and post-WE-21.

	Have fun...

	Jean
drivers/net/wireless/ipw2200.c renamed from drivers/net/wireless/ipw2200.20.c +18 -11
diff -u -p linux/drivers/net/wireless/ipw2200.20.c linux/drivers/net/wireless/ipw2200.c
@@ -8855,6 +8855,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)
@@ -8874,9 +8882,8 @@ static int ipw_wx_set_essid(struct net_d
                 return 0;
         }
 
-	length = min((int)wrqu->essid.length, IW_ESSID_MAX_SIZE);
-	if (!extra[length - 1])
-		length--;
+	length = min((int) (wrqu->essid.length - IW_ESSID_FIX),
+		     IW_ESSID_MAX_SIZE);
 
 	priv->config |= CFG_STATIC_ESSID;
 
@@ -8916,7 +8923,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");
@@ -8953,7 +8960,7 @@ static int ipw_wx_get_nick(struct net_de
 	struct ipw_priv *priv = ieee80211_priv(dev);
 	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);
@@ -9276,9 +9283,9 @@ static int ipw_wx_set_retry(struct net_d
 		return -EINVAL;
 
 	mutex_lock(&priv->mutex);
-	if (wrqu->retry.flags & IW_RETRY_MIN)
+	if (wrqu->retry.flags & IW_RETRY_SHORT)
 		priv->short_retry_limit = (u8) wrqu->retry.value;
-	else if (wrqu->retry.flags & IW_RETRY_MAX)
+	else if (wrqu->retry.flags & IW_RETRY_LONG)
 		priv->long_retry_limit = (u8) wrqu->retry.value;
 	else {
 		priv->short_retry_limit = (u8) wrqu->retry.value;
@@ -9307,11 +9314,11 @@ static int ipw_wx_get_retry(struct net_d
 		return -EINVAL;
 	}
 
-	if (wrqu->retry.flags & IW_RETRY_MAX) {
-		wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_MAX;
+	if (wrqu->retry.flags & IW_RETRY_LONG) {
+		wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_LONG;
 		wrqu->retry.value = priv->long_retry_limit;
-	} else if (wrqu->retry.flags & IW_RETRY_MIN) {
-		wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_MIN;
+	} else if (wrqu->retry.flags & IW_RETRY_SHORT) {
+		wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_SHORT;
 		wrqu->retry.value = priv->short_retry_limit;
 	} else {
 		wrqu->retry.flags = IW_RETRY_LIMIT;