mac80211: fix iwlist wlanX retry behavior
PATCH 2/5 mac80211: fix iwlist wlanX retry behavior
Signed-off-by Hong Liu <[email protected]>
---
net/mac80211/ieee80211_ioctl.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-)
bd08dec1012d17f66af6fd0170dce870cce34ab6
net/mac80211/ieee80211_ioctl.c +9 -7
@@ -2176,16 +2176,18 @@ static int ieee80211_ioctl_giwretry(strustruct 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 ;
Signature · 1 line
1.3.3
Quoted 1 line · Hong Liu
Signed-off-by Hong Liu <[email protected]>
Please add a description what the patch does.
Thanks,
Jiri
Signature · 2 lines
Jiri Benc SUSE Labs
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 <[email protected]>
---
net/mac80211/ieee80211_ioctl.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-)
bd08dec1012d17f66af6fd0170dce870cce34ab6
(quoted diff) +0 -0
b/net/mac80211/ieee80211_ioctl.c
index aa8b789..f57e48f 100644
net/mac80211/ieee80211_ioctl.c +9 -7
@@ -2176,16 +2176,18 @@ static int ieee80211_ioctl_giwretry(strustruct 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
Quoted 9 lines · Jiri Benc
Quoted 1 line · Hong Liu
Signed-off-by Hong Liu <[email protected]>Please add a description what the patch does.
Thanks,
Jiri