Re: [OpenWrt-Devel] [PATCH 2/7] [package] mac80211: Default second radio to 5g if it does 5g and is US or CA regulatory domain

2012-11-13 Thread Daniel Dickinson
FYI.  I've had some suggestion on how to better handle it, but really
the problem is that this is a check I implemented because Jay requested
the default radio.  It really needs to be fixed properly (but I had
forgotten about), and won't work for EU as it is.

Regards,

Daniel

On 10/11/2012 8:33 AM, Felix Fietkau wrote:
 On 2012-11-09 11:10 PM, Daniel Dickinson wrote:
 ---
  package/mac80211/files/lib/wifi/mac80211.sh |6 ++
  1 file changed, 6 insertions(+)

 diff --git a/package/mac80211/files/lib/wifi/mac80211.sh 
 b/package/mac80211/files/lib/wifi/mac80211.sh
 index 4ecb419..ad5845b 100644
 --- a/package/mac80211/files/lib/wifi/mac80211.sh
 +++ b/package/mac80211/files/lib/wifi/mac80211.sh
 @@ -611,6 +611,12 @@ detect_mac80211() {
  dev_id=option macaddr  $(cat 
 /sys/class/ieee80211/${dev}/macaddress)
  fi
  
 +if [ $mode_band = g ]; then
 +( iw reg get | grep -q US: || iw reg get | grep -q CA: 
 )  {
 +iw phy $dev info | grep -q '5180 MHz'  { 
 mode_band=a; channel=36 ; }
 +}
 +fi
 +
  cat EOF
  config wifi-device  radio$devidx
  option type mac80211
 Why? The country code based thing makes no sense to me, please be a bit
 more verbose in your patch descriptions ;)
 
 - Felix
 


-- 
Daniel Dickinson PowerCloud Systems, Palo Alto, CA Senior Firmware Engineer (In 
Canada: Senior Firmware Analyst)



signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/7] [package] mac80211: Default second radio to 5g if it does 5g and is US or CA regulatory domain

2012-11-09 Thread Daniel Dickinson
---
 package/mac80211/files/lib/wifi/mac80211.sh |6 ++
 1 file changed, 6 insertions(+)

diff --git a/package/mac80211/files/lib/wifi/mac80211.sh 
b/package/mac80211/files/lib/wifi/mac80211.sh
index 4ecb419..ad5845b 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -611,6 +611,12 @@ detect_mac80211() {
dev_id=option macaddr  $(cat 
/sys/class/ieee80211/${dev}/macaddress)
fi
 
+   if [ $mode_band = g ]; then
+   ( iw reg get | grep -q US: || iw reg get | grep -q CA: 
)  {
+   iw phy $dev info | grep -q '5180 MHz'  { 
mode_band=a; channel=36 ; }
+   }
+   fi
+
cat EOF
 config wifi-device  radio$devidx
option type mac80211
-- 
1.7.9.5

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