summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorRoman Yeryomin <roman@advem.lv>2013-07-08 12:49:50 +0300
committerRoman Yeryomin <roman@advem.lv>2013-07-08 12:49:59 +0300
commitb929e332549ff2910aa24438e9628145cf432af2 (patch)
tree07b990d9df6fd69d11c3d3881182ee4ae2c99fcc /target
parent0540aa9b736221755dcdb717bc96b3aedf89ec2e (diff)
Set wireless mac from /etc/config/wireless if it's defined. References #23.
Signed-off-by: Roman Yeryomin <roman@advem.lv>
Diffstat (limited to 'target')
-rwxr-xr-xtarget/linux/realtek/base-files/lib/wifi/realtek.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/target/linux/realtek/base-files/lib/wifi/realtek.sh b/target/linux/realtek/base-files/lib/wifi/realtek.sh
index 1dd1b90d1..27ba1f1e2 100755
--- a/target/linux/realtek/base-files/lib/wifi/realtek.sh
+++ b/target/linux/realtek/base-files/lib/wifi/realtek.sh
@@ -193,6 +193,11 @@ enable_realtek() {
# dirty workaround for wlan0 not appearing when router is started
bridge="br-lan"
+ # set mac address from /etc/config/wireless
+ local macaddr
+ config_get macaddr "$device" macaddr
+ [ -z "$macaddr" ] || ifconfig "$device" hw ether "$macaddr"
+
# set led to link/tx/rx (data,management) mode
# have to be here because router will lock in wlan0 will be up durig this
iwpriv "$ifname" set_mib led_type=11
@@ -216,6 +221,7 @@ enable_realtek() {
start_hostapd=1
[ -n "$start_hostapd" ] || {
+ local htmode
config_get htmode "$device" htmode
case "$htmode" in
*HT40-*)