Linux wireless drivers development
 help / color / mirror / Atom feed
From: Hong Liu <hong.liu@intel.com>
To: Jiri Benc <jbenc@suse.cz>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/5] mac80211: fix iwlist wlanX retry behavior
Date: Tue, 27 Mar 2007 10:07:20 +0800	[thread overview]
Message-ID: <1174961240.3664.18.camel@napa-sdv1> (raw)
In-Reply-To: <20070323191145.2b4475d6@griffin.suse.cz>

iwconfig relies on what mac80211 returned to display the retry info when
it sets retry->flag = 0.
So we can't just return -EINVAL when retry->flag == 0.


Signed-off-by: Hong Liu <hong.liu@intel.com>

---

 net/mac80211/ieee80211_ioctl.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

bd08dec1012d17f66af6fd0170dce870cce34ab6
diff --git a/net/mac80211/ieee80211_ioctl.c
b/net/mac80211/ieee80211_ioctl.c
index aa8b789..f57e48f 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -2176,16 +2176,18 @@ static int ieee80211_ioctl_giwretry(stru
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);

        retry->disabled = 0;
-       if ((retry->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT)
-               return -EINVAL;
-       if (retry->flags & IW_RETRY_MAX) {
-               retry->flags = IW_RETRY_LIMIT | IW_RETRY_MAX;
-               retry->value = local->long_retry_limit;
-       } else {
-               retry->flags = IW_RETRY_LIMIT;
+       if (retry->flags == 0 || retry->flags & IW_RETRY_MIN) {
+               /* first return min value, iwconfig will ask max value
+                * later if needed */
+               retry->flags |= IW_RETRY_LIMIT;
                retry->value = local->short_retry_limit;
                if (local->long_retry_limit != local->short_retry_limit)
                        retry->flags |= IW_RETRY_MIN;
+               return 0;
+       }
+       if (retry->flags & IW_RETRY_MAX) {
+               retry->flags = IW_RETRY_LIMIT | IW_RETRY_MAX;
+               retry->value = local->long_retry_limit;
        }

        return 0;
--
1.3.3

On Fri, 2007-03-23 at 19:11 +0100, Jiri Benc wrote:
> On Fri, 16 Mar 2007 11:28:29 +0800, Hong Liu wrote:
> > Signed-off-by: Hong Liu <hong.liu@intel.com>
> 
> Please add a description what the patch does.
> 
> Thanks,
> 
>  Jiri
> 

      reply	other threads:[~2007-03-27  2:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-16  3:28 [PATCH 2/5] mac80211: fix iwlist wlanX retry behavior Hong Liu
2007-03-23 18:11 ` Jiri Benc
2007-03-27  2:07   ` Hong Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1174961240.3664.18.camel@napa-sdv1 \
    --to=hong.liu@intel.com \
    --cc=jbenc@suse.cz \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox