Re: [OpenWrt-Devel] [PATCH] mac82011: Fix auto channel selection for dual band cards

2013-05-16 Thread Bastian Bittorf
* Sujith Manoharan  [16.05.2013 14:13]:
> I wasn't aware of this, do you have a link to the earlier patch/discussion ?
> Since you seem to have a fix already, please go ahead and send your patch.

i will send a patch next week...

bye, bastian

PS:
http://www.intercity-vpn.de/files/openwrt/patches/refactoring-get_freq.patch
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] mac82011: Fix auto channel selection for dual band cards

2013-05-16 Thread Sujith Manoharan
Bastian Bittorf wrote:
> this patch does not work, please use an approach like this (attached),
> or i will send a patch 8-)
> 
> some time ago a send an approach like this just to get rid of
> the ill sed construct, but it was'nt accepted 8-) now there is
> a real/good reason.

I wasn't aware of this, do you have a link to the earlier patch/discussion ?
Since you seem to have a fix already, please go ahead and send your patch.

Sujith
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] mac82011: Fix auto channel selection for dual band cards

2013-05-16 Thread Bastian Bittorf
* Sujith Manoharan  [16.05.2013 10:42]:
> From: Sujith Manoharan 
> 
> Use the HW mode to determine which channel to choose
> when the card is dual-band, otherwise, a channel from
> the 2GHz band would be chosen when "hwmode" is set to "11a" or 11na".

this patch does not work, please use an approach like this (attached),
or i will send a patch 8-)

some time ago a send an approach like this just to get rid of
the ill sed construct, but it was'nt accepted 8-) now there is
a real/good reason.

bye, bastian


wifi_get_first_channel.sh
Description: Bourne shell script
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] mac82011: Fix auto channel selection for dual band cards

2013-05-16 Thread Bastian Bittorf
* Sujith Manoharan  [16.05.2013 10:42]:
> From: Sujith Manoharan 
> 
> Use the HW mode to determine which channel to choose
> when the card is dual-band, otherwise, a channel from
> the 2GHz band would be chosen when "hwmode" is set to "11a" or 11na".

this patch does not work, dont apply.
i dig into it, wait a hour...

bye, bastian
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] mac82011: Fix auto channel selection for dual band cards

2013-05-15 Thread Sujith Manoharan
From: Sujith Manoharan 

Use the HW mode to determine which channel to choose
when the card is dual-band, otherwise, a channel from
the 2GHz band would be chosen when "hwmode" is set to "11a" or 11na".

Signed-off-by: Sujith Manoharan 
---
 package/mac80211/files/lib/wifi/mac80211.sh | 20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/package/mac80211/files/lib/wifi/mac80211.sh 
b/package/mac80211/files/lib/wifi/mac80211.sh
index a052a1c..7a6f05c 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -19,12 +19,6 @@ mac80211_hostapd_setup_base() {
 
[ -n "$channel" -a -z "$hwmode" ] && wifi_fixup_hwmode "$device"
 
-   [ "$channel" = auto ] && {
-   channel=$(iw phy "$phy" info | \
-   sed -ne '/MHz/ { /disabled\|passive\|radar/d; s/.*\[//; 
s/\].*//; p; q }')
-   config_set "$device" channel "$channel"
-   }
-
[ -n "$hwmode" ] && {
config_get hwmode_11n "$device" hwmode_11n
[ -n "$hwmode_11n" ] && {
@@ -43,6 +37,20 @@ mac80211_hostapd_setup_base() {
}
}
 
+   [ "$channel" = auto ] && {
+   case "$hwmode" in
+   b|g)
+   channel=$(iw phy "$phy" info | \
+   sed -ne '/MHz/ { 
/^.*5.*\|disabled\|passive\|radar/d; s/.*\[//; s/\].*//; p; q }')
+   ;;
+   a)
+   channel=$(iw phy "$phy" info | \
+   sed -ne '/MHz/ { 
/^.*2.*\|disabled\|passive\|radar/d; s/.*\[//; s/\].*//; p; q }')
+   ;;
+   esac
+   config_set "$device" channel "$channel"
+   }
+
local country_ie=0
[ -n "$country" ] && country_ie=1
config_get_bool country_ie "$device" country_ie "$country_ie"
-- 
1.8.2.3

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel