Skip to content

Commit

Permalink
build: support for all platforms with ath9k / reghack-patch 5/5
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastian Bittorf committed Aug 2, 2013
1 parent 828e884 commit 8d0167f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
2 changes: 2 additions & 0 deletions TODO.txt
@@ -1,3 +1,5 @@
# boltenhagendh: /sys/block/zram0/num_writes -gt 1? reboot

# webcam: dont add files to movie when hash already was used before

# before reboot: scan -> file on flash with "mac: lastseen/signal"
Expand Down
15 changes: 13 additions & 2 deletions openwrt-addons/usr/sbin/cron.rrd
Expand Up @@ -70,8 +70,8 @@ rrd_update()
# logger "up: $up_packets/$up_bytes down: $down_packets/$down_bytes stations: $stations users: $users conn-tcp/udp: $tcp/$udp"

# upscale, so we can see it in graph (fixme! use CDEF-expression)
stations=$(( stations * 100000 ))
users=$(( $users * 1000 ))
stations=$(( stations * 100000 )) # 5 station = at 500k/s traffic-level
users=$(( $users * 10000 )) # 200 user = at 2 MB/s traffic-level
tcp=$(( $tcp * 1000 ))
udp=$(( $udp * 1000 ))

Expand All @@ -91,6 +91,17 @@ rrd_show()
local label="bytes/sec & users/stations (1 = 100k) & TCP/UDP-conntrack (1000 = 1M)" # Y-axis
local location="$( _weblogin metadata_locationname )"
local alpha="44"

#ff0085 = pink
#fc7713 = orange
#5b6104 = forestgreen
#a1a600 = lightgreen
#d20000 = red
#312221 = darkgrey
#ffb900 = yellow
#004fc2 = blue
#00bea0 = cyan

local color1="#ff0000" # upload_packets
local color2="#0000ff${alpha}" # upload_bytes
local color3="#ccdd00" # download_packets
Expand Down
7 changes: 2 additions & 5 deletions openwrt-build/mybuild.sh
Expand Up @@ -463,7 +463,6 @@ build_kalua_update_tarball()
cd openwrt-addons

if [ "$option" = "full" ]; then
cp -pv ../openwrt-patches/regulatory.bin etc/init.d/apply_profile.regulatory.bin
cp -pv ../openwrt-build/apply_profile* etc/init.d

private_settings="../../apply_profile.code.definitions"
Expand Down Expand Up @@ -754,17 +753,15 @@ applymystuff()
cp "$file" "$base/etc/init.d"
fi

file="kalua/openwrt-patches/regulatory.bin"
log "copy $( basename "$file" ) - easy bird grilling included ($( filesize "$file" ) bytes)"
cp "$file" "$base/etc/init.d/apply_profile.regulatory.bin"

file="kalua/package/mac80211/patches/900-regulatory-test.patch"
[ -e "$file" ] && {
grep -q "CONFIG_PACKAGE_kmod-ath9k=y" ".config" && {
COMPAT_WIRELESS="2013-06-27"
log "patching ath9k/compat-wireless $COMPAT_WIRELESS for using all channels ('birdkiller-mode')"
cp -v "$file" "package/kernel/mac80211/patches"
sed -i "s/YYYY-MM-DD/${COMPAT_WIRELESS}/g" "package/kernel/mac80211/patches/$( basename "$file" )"
log "using another regdb"
cp -v "kalua/openwrt-patches/regulatory.db.txt" "package/kernel/mac80211/files/regdb.txt"
}
}

Expand Down
8 changes: 4 additions & 4 deletions openwrt-patches/regulatory.db.txt
@@ -1,8 +1,8 @@
country 00:
(2400 - 2494 @ 40), (N/A, 35)
(4910 - 5895 @ 40), (N/A, 35)
(2400 - 2494 @ 40), (N/A, 30)
(4910 - 5895 @ 40), (N/A, 30)

country US:
(2400 - 2494 @ 40), (N/A, 35)
(4910 - 5895 @ 40), (N/A, 35)
(2400 - 2494 @ 40), (N/A, 30)
(4910 - 5895 @ 40), (N/A, 30)

5 changes: 2 additions & 3 deletions package/mac80211/patches/900-regulatory-test.patch
Expand Up @@ -9,13 +9,13 @@ Index: compat-wireless-YYYY-MM-DD/drivers/net/wireless/ath/regd.c
-#define ATH9K_2GHZ_ALL ATH9K_2GHZ_CH01_11, \
- ATH9K_2GHZ_CH12_13, \
- ATH9K_2GHZ_CH14
+#define ATH9K_2GHZ_ALL REG_RULE(2400, 2483, 40, 0, 30, 0)
+#define ATH9K_2GHZ_ALL REG_RULE(2400, 2494, 40, 0, 30, 0)
+
+

-#define ATH9K_5GHZ_ALL ATH9K_5GHZ_5150_5350, \
- ATH9K_5GHZ_5470_5850
+#define ATH9K_5GHZ_ALL REG_RULE(5140, 5860, 40, 0, 30, 0)
+#define ATH9K_5GHZ_ALL REG_RULE(4910, 5895, 40, 0, 30, 0)

/* This one skips what we call "mid band" */
#define ATH9K_5GHZ_NO_MIDBAND ATH9K_5GHZ_5150_5350, \
Expand Down Expand Up @@ -66,7 +66,6 @@ Index: compat-wireless-YYYY-MM-DD/drivers/net/wireless/ath/regd.c
static bool ath_is_radar_freq(u16 center_freq)
{
- return (center_freq >= 5260 && center_freq <= 5700);
+ printk(KERN_DEBUG "ath: reghack-patched, no DFS");
+ return false;
}

Expand Down

0 comments on commit 8d0167f

Please sign in to comment.