* [PATCH 2.6.18] WE-21 for ipw2200
@ 2006-08-30 1:01 Jean Tourrilhes
2006-09-12 18:02 ` John W. Linville
0 siblings, 1 reply; 4+ messages in thread
From: Jean Tourrilhes @ 2006-08-30 1:01 UTC (permalink / raw)
To: John W. Linville, netdev, James P. Ketrenos, Zhu Yi
Hi,
WE-21 for IPW2200 driver...
Jean
Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
-----------------------------------------------------------
diff -u -p linux/drivers/net/wireless/ipw2200.20.c linux/drivers/net/wireless/ipw2200.c
--- linux/drivers/net/wireless/ipw2200.20.c 2006-08-28 17:35:29.000000000 -0700
+++ linux/drivers/net/wireless/ipw2200.c 2006-08-28 17:36:09.000000000 -0700
@@ -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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2.6.18] WE-21 for ipw2200
2006-08-30 1:01 [PATCH 2.6.18] WE-21 for ipw2200 Jean Tourrilhes
@ 2006-09-12 18:02 ` John W. Linville
2006-09-12 18:17 ` Jean Tourrilhes
2006-09-12 21:33 ` Jean Tourrilhes
0 siblings, 2 replies; 4+ messages in thread
From: John W. Linville @ 2006-09-12 18:02 UTC (permalink / raw)
To: Jean Tourrilhes; +Cc: netdev, James P. Ketrenos, Zhu Yi
On Tue, Aug 29, 2006 at 06:01:40PM -0700, Jean Tourrilhes wrote:
> Hi,
>
> WE-21 for IPW2200 driver...
>
> Jean
>
> Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
>
> -----------------------------------------------------------
>
> diff -u -p linux/drivers/net/wireless/ipw2200.20.c linux/drivers/net/wireless/ipw2200.c
> --- linux/drivers/net/wireless/ipw2200.20.c 2006-08-28 17:35:29.000000000 -0700
> +++ linux/drivers/net/wireless/ipw2200.c 2006-08-28 17:36:09.000000000 -0700
> @@ -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
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2.6.18] WE-21 for ipw2200
2006-09-12 18:02 ` John W. Linville
@ 2006-09-12 18:17 ` Jean Tourrilhes
2006-09-12 21:33 ` Jean Tourrilhes
1 sibling, 0 replies; 4+ messages in thread
From: Jean Tourrilhes @ 2006-09-12 18:17 UTC (permalink / raw)
To: John W. Linville; +Cc: netdev, James P. Ketrenos, Zhu Yi
On Tue, Sep 12, 2006 at 02:02:59PM -0400, John W. Linville wrote:
> On Tue, Aug 29, 2006 at 06:01:40PM -0700, Jean Tourrilhes wrote:
> > @@ -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.
> 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?
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 :-(
> John
Jean
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2.6.18] WE-21 for ipw2200
2006-09-12 18:02 ` John W. Linville
2006-09-12 18:17 ` Jean Tourrilhes
@ 2006-09-12 21:33 ` Jean Tourrilhes
1 sibling, 0 replies; 4+ messages in thread
From: Jean Tourrilhes @ 2006-09-12 21:33 UTC (permalink / raw)
To: John W. Linville; +Cc: netdev, James P. Ketrenos, Zhu Yi
[-- Attachment #1: Type: text/plain, Size: 729 bytes --]
On Tue, Sep 12, 2006 at 02:02:59PM -0400, John W. Linville wrote:
> 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:
>
> @@ -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?
Double checked, that seems to be allright.
> 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
[-- Attachment #2: iw268e_we21-ipw2200-2.diff --]
[-- Type: text/plain, Size: 2826 bytes --]
diff -u -p linux/drivers/net/wireless/ipw2200.20.c linux/drivers/net/wireless/ipw2200.c
--- linux/drivers/net/wireless/ipw2200.20.c 2006-09-12 14:24:09.000000000 -0700
+++ linux/drivers/net/wireless/ipw2200.c 2006-09-12 14:29:09.000000000 -0700
@@ -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;
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-09-12 21:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-30 1:01 [PATCH 2.6.18] WE-21 for ipw2200 Jean Tourrilhes
2006-09-12 18:02 ` John W. Linville
2006-09-12 18:17 ` Jean Tourrilhes
2006-09-12 21:33 ` Jean Tourrilhes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).