[source] ramips: use rfkill for wps button on wlan only boards

LEDE Commits lede-commits at lists.infradead.org
Sat Oct 15 02:06:43 PDT 2016


mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/bcfbeae79f799cf1087d692e4869589eb20d2080

commit bcfbeae79f799cf1087d692e4869589eb20d2080
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Mon Sep 26 20:56:13 2016 +0200

    ramips: use rfkill for wps button on wlan only boards
    
    All of the touched boards don't have an ethernet port. Allow to use the
    wps button on these boards to enable the wireless radio after boot.
    
    The force enabled wireless for the DCH-M225 is removed. It is reckless
    to bring up an unencrypted wireless network by default these days.
    
    Using the wps button to bring up the radio seam to me the better
    approach.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 .../ramips/base-files/etc/uci-defaults/03_wireless  | 21 ---------------------
 target/linux/ramips/dts/DCH-M225.dts                |  2 +-
 target/linux/ramips/dts/F7C027.dts                  |  6 +++---
 target/linux/ramips/dts/MLW221.dts                  |  2 +-
 target/linux/ramips/dts/MLWG2.dts                   |  2 +-
 target/linux/ramips/dts/MZK-EX300NP.dts             |  2 +-
 target/linux/ramips/dts/MZK-EX750NP.dts             |  2 +-
 7 files changed, 8 insertions(+), 29 deletions(-)

diff --git a/target/linux/ramips/base-files/etc/uci-defaults/03_wireless b/target/linux/ramips/base-files/etc/uci-defaults/03_wireless
deleted file mode 100644
index bf8c009..0000000
--- a/target/linux/ramips/base-files/etc/uci-defaults/03_wireless
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2016 OpenWrt.org
-#
-
-[ ! -e /etc/config/wireless ] && exit 0
-
-. /lib/functions/system.sh
-. /lib/ramips.sh
-
-board=$(ramips_board_name)
-
-case "$board" in
-dch-m225)
-	uci set wireless. at wifi-device[0].disabled=0
-	;;
-esac
-
-uci commit wireless
-
-exit 0
diff --git a/target/linux/ramips/dts/DCH-M225.dts b/target/linux/ramips/dts/DCH-M225.dts
index 3c2de8d..c5a189b 100644
--- a/target/linux/ramips/dts/DCH-M225.dts
+++ b/target/linux/ramips/dts/DCH-M225.dts
@@ -15,7 +15,7 @@
 		wps {
 			label = "wps";
 			gpios = <&gpio0 11 1>;
-			linux,code = <0x211>;
+			linux,code = <0xf7>;
 		};
 
 		reset {
diff --git a/target/linux/ramips/dts/F7C027.dts b/target/linux/ramips/dts/F7C027.dts
index 6214c85..c8ed765 100644
--- a/target/linux/ramips/dts/F7C027.dts
+++ b/target/linux/ramips/dts/F7C027.dts
@@ -37,7 +37,7 @@
 		poll-interval = <20>;
 
 		top {
-			label = "top";
+			label = "restore";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
@@ -45,13 +45,13 @@
 		power {
 			label = "power";
 			gpios = <&gpio0 12 1>;
-			linux,code = <0x100>;
+			linux,code = <0xf7>;
 		};
 
 		sensor {
 			label = "sensor";
 			gpios = <&gpio0 14 1>;
-			linux,code = <0x101>;
+			linux,code = <0x100>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/MLW221.dts b/target/linux/ramips/dts/MLW221.dts
index 670a36a..3406280 100644
--- a/target/linux/ramips/dts/MLW221.dts
+++ b/target/linux/ramips/dts/MLW221.dts
@@ -35,7 +35,7 @@
 		system {
 			label = "system";
 			gpios = <&gpio0 2 1>;
-			linux,code = <0x211>;
+			linux,code = <0xf7>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/MLWG2.dts b/target/linux/ramips/dts/MLWG2.dts
index c9f61c7..aeedb46 100644
--- a/target/linux/ramips/dts/MLWG2.dts
+++ b/target/linux/ramips/dts/MLWG2.dts
@@ -35,7 +35,7 @@
 		system {
 			label = "system";
 			gpios = <&gpio0 2 1>;
-			linux,code = <0x211>;
+			linux,code = <0xf7>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/MZK-EX300NP.dts b/target/linux/ramips/dts/MZK-EX300NP.dts
index 05c79d3..4c87f90 100644
--- a/target/linux/ramips/dts/MZK-EX300NP.dts
+++ b/target/linux/ramips/dts/MZK-EX300NP.dts
@@ -55,7 +55,7 @@
 		wps {
 			label = "wps";
 			gpios = <&gpio1 3 0>;
-			linux,code = <0x211>;
+			linux,code = <0xf7>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/MZK-EX750NP.dts b/target/linux/ramips/dts/MZK-EX750NP.dts
index 565b435..74f72f0 100644
--- a/target/linux/ramips/dts/MZK-EX750NP.dts
+++ b/target/linux/ramips/dts/MZK-EX750NP.dts
@@ -60,7 +60,7 @@
 		wps {
 			label = "wps";
 			gpios = <&gpio0 13 0>;
-			linux,code = <0x211>;
+			linux,code = <0xf7>;
 		};
 	};
 };



More information about the lede-commits mailing list