* [PATCH 2/5] mac80211: fix iwlist wlanX retry behavior
@ 2007-03-16 3:28 Hong Liu
2007-03-23 18:11 ` Jiri Benc
0 siblings, 1 reply; 3+ messages in thread
From: Hong Liu @ 2007-03-16 3:28 UTC (permalink / raw)
To: Jiri Benc, John W. Linville; +Cc: linux-wireless
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
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 2/5] mac80211: fix iwlist wlanX retry behavior
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
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Benc @ 2007-03-23 18:11 UTC (permalink / raw)
To: Hong Liu; +Cc: John W. Linville, linux-wireless
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
--
Jiri Benc
SUSE Labs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/5] mac80211: fix iwlist wlanX retry behavior
2007-03-23 18:11 ` Jiri Benc
@ 2007-03-27 2:07 ` Hong Liu
0 siblings, 0 replies; 3+ messages in thread
From: Hong Liu @ 2007-03-27 2:07 UTC (permalink / raw)
To: Jiri Benc; +Cc: John W. Linville, linux-wireless
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
>
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-03-27 2:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).