Commit 7c7332d5 authored by oni's avatar oni

Merge branch 'experimental' into beta

parents 88203f0f 00b3544e
......@@ -131,8 +131,8 @@ GLUON_$(1)_MODELS :=
endef
define GluonModel
GLUON_$(1)_MODELS += $(2)
GLUON_$(1)_MODEL_$(2) := $(3)
GLUON_$(1)_MODELS += $(3)
GLUON_$(1)_MODEL_$(3) := $(2)
endef
......@@ -339,11 +339,11 @@ image: FORCE
PROFILE="$(PROFILE)" KDIR="$(PROFILE_KDIR)" TARGET_DIR="$(TARGET_DIR)" BIN_DIR="$(BIN_DIR)" TMP_DIR="$(TMP_DIR)"
$(foreach model,$(GLUON_$(PROFILE)_MODELS), \
rm -f $(GLUON_IMAGEDIR)/factory/gluon-*-$(GLUON_$(PROFILE)_MODEL_$(model)).bin && \
rm -f $(GLUON_IMAGEDIR)/sysupgrade/gluon-*-$(GLUON_$(PROFILE)_MODEL_$(model))-sysupgrade.bin && \
rm -f $(GLUON_IMAGEDIR)/factory/gluon-*-$(model).bin && \
rm -f $(GLUON_IMAGEDIR)/sysupgrade/gluon-*-$(model)-sysupgrade.bin && \
\
cp $(BIN_DIR)/gluon-$(model)-factory.bin $(GLUON_IMAGEDIR)/factory/$(IMAGE_PREFIX)-$(GLUON_$(PROFILE)_MODEL_$(model)).bin && \
cp $(BIN_DIR)/gluon-$(model)-sysupgrade.bin $(GLUON_IMAGEDIR)/sysupgrade/$(IMAGE_PREFIX)-$(GLUON_$(PROFILE)_MODEL_$(model))-sysupgrade.bin && \
cp $(BIN_DIR)/gluon-$(GLUON_$(PROFILE)_MODEL_$(model))-factory.bin $(GLUON_IMAGEDIR)/factory/$(IMAGE_PREFIX)-$(model).bin && \
cp $(BIN_DIR)/gluon-$(GLUON_$(PROFILE)_MODEL_$(model))-sysupgrade.bin $(GLUON_IMAGEDIR)/sysupgrade/$(IMAGE_PREFIX)-$(model)-sysupgrade.bin && \
) :
image/%: $(gluon_prepared_stamp)
......@@ -363,10 +363,10 @@ manifest: FORCE
echo && \
($(foreach profile,$(PROFILES), \
$(foreach model,$(GLUON_$(profile)_MODELS), \
for file in gluon-*-'$(GLUON_$(profile)_MODEL_$(model))-sysupgrade.bin'; do \
for file in gluon-*-'$(model)-sysupgrade.bin'; do \
[ -e "$$file" ] && echo \
'$(GLUON_$(profile)_MODEL_$(model))' \
"$$(echo "$$file" | sed -n -r -e 's/^gluon-$(call regex-escape,$(GLUON_SITE_CODE))-(.*)-$(call regex-escape,$(GLUON_$(profile)_MODEL_$(model)))-sysupgrade\.bin$$/\1/p')" \
'$(model)' \
"$$(echo "$$file" | sed -n -r -e 's/^gluon-$(call regex-escape,$(GLUON_SITE_CODE))-(.*)-$(call regex-escape,$(model))-sysupgrade\.bin$$/\1/p')" \
"$$($(SHA512SUM) "$$file")" \
"$$file" && break; \
done; \
......
......@@ -3,6 +3,18 @@
if [ $# -eq 0 -o "-h" = "$1" -o "-help" = "$1" -o "--help" = "$1" ]; then
cat <<EOHELP
Usage: $0 <secret> <manifest>
sign.sh adds lines to a manifest to indicate the approval
of the integrity of the firmware as required for automated
updates. The first argument <secret> references a file harboring
the private key of a public-private key pair of a developer
that referenced by its public key in the site configuration.
The script may be performed multiple times to the same document
to indicate an approval by multiple developers.
See also
* edcsautils on https://github.com/tcatm/ecdsautils
EOHELP
exit 1
fi
......
Config Mode
===========
As of 2014.4 `gluon-config-mode` consists of several modules.
gluon-config-mode-core
This modules provides the core functionality for the config mode.
All modules must depend on it.
gluon-config-mode-hostname
Provides a hostname field.
gluon-config-mode-autoupdater
Informs whether the autoupdater is enabled.
gluon-config-mode-mesh-vpn
Allows toggling of mesh-vpn-fastd and setting a bandwidth limit.
gluon-config-mode-geo-location
Enables the user to set the geographical location of the node.
gluon-config-mode-contact-info
Adds a field where the user can provide contact information.
In order to get a config mode close to the one found in 2014.3.x you may add
these modules to your `site.mk`:
gluon-config-mode-hostname,
gluon-config-mode-autoupdater,
gluon-config-mode-mesh-vpn,
gluon-config-mode-geo-location,
gluon-config-mode-contact-info
Writing Config Mode Modules
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Config mode modules are located at `/lib/gluon/config-mode/wizard` and
`/lib/gluon/config-mode/reboot`. Modules are named like `0000-name.lua` and
are executed in lexical order. If you take the standard set of modules, the
order is, for wizard modules:
- 0050-autoupdater-info
- 0100-hostname
- 0300-mesh-vpn
- 0400-geo-location
- 0500-contact-info
While for reboot modules it is:
- 0100-mesh-vpn
- 0900-msg-reboot
Wizards
-------
Wizard modules return a UCI section. A simple module capable of changing the
hostname might look like this::
local cbi = require "luci.cbi"
local uci = luci.model.uci.cursor()
local M = {}
function M.section(form)
local s = form:section(cbi.SimpleSection, nil, nil)
local o = s:option(cbi.Value, "_hostname", "Hostname")
o.value = uci:get_first("system", "system", "hostname")
o.rmempty = false
o.datatype = "hostname"
end
function M.handle(data)
uci:set("system", uci:get_first("system", "system"), "hostname", data._hostname)
uci:save("system")
uci:commit("system")
end
return M
Reboot page
-----------
Reboot modules return a function that will be called when the page is to be
rendered or nil (i.e. the module is skipped)::
if no_hello_world_today then
return nil
else
return function ()
luci.template.render_string("Hello World!")
end
end
......@@ -45,7 +45,7 @@ The final image name must be the same that is returned by the following command.
lua -e 'print(require("platform_info").get_image_name())'
This is so the autoupdater can work. On targets which aren't supported by the autoupdater,
This is just for the autoupdater can work. The command has to be executed _on_ the target (eg. the hardware router with a flashed image). So you'll first have to build an image with a guessed name, and afterwards build a new, correctly named image. On targets which aren't supported by the autoupdater,
``require("platform_info").get_image_name()`` will just return ``nil`` and the final image name
may be defined arbitrarily.
......
......@@ -36,26 +36,49 @@ Developer Documentation
dev/basics
dev/hardware
dev/configmode
Supported Devices
-----------------
* Buffalo
- WZR-HP-AG300H / WZR-600DHP
- WZR-HP-G450H
* D-Link
- DIR-825 (B1)
* Linksys
- WRT160NL
* TP-Link
- CPE210 (v1)
- CPE220 (v1)
- CPE510 (v1)
- CPE520 (v1)
- TL-MR3020 (v1)
- TL-MR3040 (v1, v2)
- TL-MR3220 (v1)
- TL-MR3420 (v1, v2)
- TL-WA750RE (v1)
- TL-WA801N/ND (v2)
- TL-WA850RE (v1)
- TL-WA901N/ND (v2)
- TL-WDR3500 (v1)
- TL-WDR3600 (v1)
- TL-WDR4300 (v1)
- TL-WR1043N/ND (v1, v2)
- TL-WR703N (v1)
- TL-WR710N (v1)
- TL-WR740N (v1, v3, v4)
- TL-WR741N/ND (v1, v2, v4)
- TL-WR841N/ND (v3, v5, v7, v8, v9)
- TL-WR842N/ND (v1, v2)
- TL-WR941N/ND (v2, v3, v4)
- TL-WR1043N/ND (v1, v2)
- TL-WDR3500 (v1)
- TL-WDR3600 (v1)
- TL-WDR4300 (v1)
- TL-WA901N/ND (v2)
- TL-MR3020 (v1)
- TL-MR3040 (v1)
- TL-MR3220 (v1)
- TL-MR3420 (v1, v2)
* Ubiquiti
......@@ -65,14 +88,6 @@ Supported Devices
- UniFi AP
- UniFi AP Outdoor
* D-Link
- DIR-615 (E1)
- DIR-825 (B1)
* Linksys
- WRT160NL
Releases
--------
......
Gluon 2014.4 (In development)
=============================
Gluon 2014.4
============
Added (and removed) hardware support
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Buffalo
- WZR-HP-AG300H / WZR-600DHP
- WZR-HP-G450H
* D-Link
- DIR-615 (E1) support had to be dropped
* TP-LINK
- CPE210/220/510/520 (v1)
- TL-MR3040 (v2
- TL-WA750RE (v1)
- TL-WA801N/ND (v2)
- TL-WA850RE (v1)
- TL-WR703N (v1)
- TL-WR710N (v1)
- TL-WR1043N/ND (v2)
New hardware support
~~~~~~~~~~~~~~~~~~~~
* TP-Link TL-WR1043N/ND v2
New features
~~~~~~~~~~~~
OpenWrt Barrier Breaker
-----------------------
Switching to the new OpenWrt release 14.09 ("Barrier Breaker") has yielded
lots of updates for both the kernel and most packages. Besides better
performance, this has also greatly improved stability (far less out-of-memory
issues!).
Modular config mode
-------------------
The old ``gluon-config-mode`` package has been split into five
small packages, each providing a single section of the config
mode form. This simplifies removing or replacing parts of the wizard.
See the *Site changes* section for details.
Experimental support for batman-adv compat 15
---------------------------------------------
As batman-adv has broken compatiblity starting with batman-adv 2014.0
(bumping the "compat level" to 15), Gluon users must decide which
batman-adv version to use. The package for the old batman-adv version
``gluon-mesh-batman-adv`` has been renamed to ``gluon-mesh-batman-adv-14``,
the new version can be used with ``gluon-mesh-batman-adv-15``.
Please note that batman-adv compat 15 still isn't tested very well
(and there are known bugs in the current release 2014.3), so for now
we still recommend using compat 14 in "production" environments.
fastd v16
---------
Besides other new features and bugfixes, fastd v16 support the new
authentication method "UMAC". We recommend switching from the old
``salsa2012+gmac`` and ``null+salsa2012+gmac`` methods to the new
``salsa2012+umac`` and ``null+salsa2012+umac`` as UMAC is
much faster and even more secure than GMAC.
Private WLAN
------------
The new package ``gluon-luci-private-wifi`` allows to configure a private WLAN
with WPA-PSK in the expert mode which is bridged with the WAN uplink.
Embedding SSH keys
------------------
Using ``gluon-authorized-keys`` it is possible to embed predefined SSH
public keys to firmware images. If ``gluon-config-mode-*`` is left out
images will be ready to mesh after the first boot with SSH running for
further configuration.
Status page resolves nodenames
------------------------------
The tools ``gluon-announced`` and ``gluon-neighbour-info`` are now
available. Using them enables the status page to resolve hostnames and
IPs of a nodes' neighbours.
This will also work on devices with multiple wireless interfaces.
Bugfixes
~~~~~~~~
* Expert Mode: Fixed all SSH keys being removed when a password was set
* ``gluon-mesh-vpn-fastd``: Fixed VPN peers removed from the ``site.conf`` not being removed from ``/etc/config/fastd``
* TL-LINK TL-WDR3600/4300: Added workaround for reboot issues
* Improved stability (due to switch to OpenWrt Barrier Breaker)
Site changes
~~~~~~~~~~~~
* ``site.conf``
* ``site.mk``
- Obsolete packages:
......@@ -32,8 +107,46 @@ Site changes
+ ``gluon-config-mode-mesh-vpn``
+ ``gluon-config-mode-geo-location``
+ ``gluon-config-mode-contact-info``
+ ``gluon-mesh-batman-adv-14`` or ``gluon-mesh-batman-adv-15`` (specify this before all other packages in the list)
+ ``gluon-mesh-batman-adv-14`` (specify this before all other packages in the ``site.mk``!)
Internals
~~~~~~~~~
* We're on Barrier Breaker now!
The switch to Barrier Breaker has led to a multitude of changes all over Gluon:
* The config mode/setup mode is now started by an own set of init scripts in ``/lib/gluon/setup-mode/rc.d`` run by procd
* Many tools and services used by Gluon have been replaced by our own implementations to reduce the size of the images:
- ethtool has been replaced by our minimal Lua library *lua-ethtool-stats*
- tc has been replaced by our minimal implementation *gluon-simple-tc*
- radvd has been replaced by our minimal implementation *gluon-radvd*
Known Issues
~~~~~~~~~~~~
Alfred crashes
--------------
https://github.com/freifunk-gluon/gluon/issues/177
Alfred may still crash unconditionally. Some measures have been taken
to aid but the core problem hasn't been analyzed yet.
Out of memory / batman-adv memory leaks
---------------------------------------
https://github.com/freifunk-gluon/gluon/issues/216
In some (hopefully rare!) cases batman-adv may still leak memory
associated with global TT entries. This may result in kernel panics or
out-of-memory conditions.
Ignored tx-power offset on Ubiquiti AirMax devices
--------------------------------------------------
https://github.com/freifunk-gluon/gluon/issues/94
There is still no OpenWRT support for determining the transmission
power offsets on Ubiquiti AirMax devices (Bullet M2, Picostation
M2, Nanostation (loco) M2, ...). Use Gluon with caution on these
devices! Manual adjustment may be required.
## gluon site modules example
# this file allows to define additional
# package feeds to be used.
# packages from this feeds can then be included
# via site.mk
## GLUON_SITE_FEEDS
# feeds to include, note that this is not called
# GLUON_FEEDS as in the Gluon modules file.
# This file allows specifying additional repositories to use
# when building gluon.
#
# for each feed name given, there have to be
# two variables given in the following.
GLUON_SITE_FEEDS='ffhh_packages'
# In most cases, it is not required so don't add it.
## GLUON_SITE_FEEDS
# for each feed name given, add the corresponding PACKAGES_* lines
# documented below
#GLUON_SITE_FEEDS='my_own_packages'
## PACKAGES_$feedname_REPO
# the git repository from where to clone the package feed
PACKAGES_FFHH_PACKAGES_REPO=git://github.com/freifunkhamburg/ffhh-packages.git
#PACKAGES_MY_OWN_PACKAGES_REPO=https://github.com/.../my-own-packages.git
## PACKAGES_$feedname_COMMIT
# the version/commit of the git repository to clone
#PACKAGES_MY_OWN_PACKAGES_COMMIT=123456789aabcda1a69b04278e4d38f2a3f57e49
PACKAGES_FFHH_PACKAGES_COMMIT=0fc9d44e95000c61a69b04278e4d38f2a3f57e49
## PACKAGES_$feedname_BRANCH
# the branch to check out
#PACKAGES_MY_OWN_PACKAGES_BRANCH=my_branch
This diff is collapsed.
......@@ -5,7 +5,7 @@
# The gluon-mesh-batman-adv-* package must come first because of the dependency resolution
GLUON_SITE_PACKAGES := \
gluon-mesh-batman-adv-15 \
gluon-mesh-batman-adv-14 \
gluon-alfred \
gluon-announced \
gluon-autoupdater \
......
......@@ -213,12 +213,17 @@ This is a non-exhaustive list of site-repos from various communities:
* `site-ffbs <https://github.com/ffbs/site-ffbs>`_ (Braunschweig)
* `site-ffhb <https://github.com/FreifunkBremen/gluon-site-ffhb>`_ (Bremen)
* `site-ffda <https://github.com/freifunk-darmstadt/site-ffda>`_ (Darmstadt)
* `site-ffhh <https://github.com/freifunkhamburg/site-ffhh>`_ (Hamburg)
* `site-ffhgw <https://github.com/lorenzo-greifswald/site-ffhgw>`_ (Greifswald)
* `site-ffhl <https://github.com/freifunk-gluon/site-ffhl>`_ (Lübeck)
* `site-ffmd <https://github.com/FreifunkMD/site-ffmd>`_ (Magdeburg)
* `site-ffmz <https://github.com/freifunk-mwu/site-ffmz>`_ (Mainz, Wiesbaden & Umgebung)
* `site-ffm <https://github.com/freifunkMUC/site-ffm>`_ (München)
* `site-ffms <https://github.com/FreiFunkMuenster/site-ffms>`_ (Münster)
* `site-ffnw <https://git.freifunk-ol.de/root/siteconf.git>`_ (Nordwest)
* `site-ffpb <https://git.c3pb.de/freifunk-pb/site-ffpb>`_ (Paderborn)
* `site-ffka <https://github.com/ffka/site-ffka>`_ (Karlsruhe)
* `site-ffrl <https://github.com/ffrl/sites-ffrl>`_ (Rheinland)
* `site-ffrg <https://github.com/ffruhr/site-ffruhr>`_ (Ruhrgebiet)
* `site-ffs <https://github.com/freifunk-stuttgart/site-ffs>`_ (Stuttgart)
GLUON_FEEDS='openwrt gluon routing luci'
OPENWRT_REPO=git://git.openwrt.org/14.07/openwrt.git
OPENWRT_COMMIT=22808d019dc6d2afd8946036740ea3caf84e5f5b
OPENWRT_COMMIT=678b8b53a3a79da8f0a7ee5da8f3918cbc00ac78
PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git
PACKAGES_OPENWRT_COMMIT=d83d5f680683c9266be8302e27e49e649ad871d9
PACKAGES_OPENWRT_COMMIT=ad7c25a87faa72eef0ea23f19615a4651e0f3cb1
PACKAGES_OPENWRT_BRANCH=for-14.07
PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git
PACKAGES_GLUON_COMMIT=8a349f41313b5b3b5e0f6738082c77e5d931459b
PACKAGES_GLUON_COMMIT=9330e21bf0d5dd901f5447c0a101505eca13ddc9
PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git
PACKAGES_ROUTING_COMMIT=c08fe48bcd3a38d47387eb6dd8474770847e3b66
PACKAGES_ROUTING_BRANCH=for-14.07
PACKAGES_LUCI_REPO=git://git.openwrt.org/project/luci.git
PACKAGES_LUCI_COMMIT=108a146a38f3facc9bdfe1542e6144dc49a67317
PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git
PACKAGES_LUCI_COMMIT=f81be49ae756dab82e1758a6c9de145f0d36960e
......@@ -3,10 +3,10 @@ Date: Sat, 26 Jul 2014 06:10:23 +0200
Subject: tools/Makefile: fix host tools build dependencies
diff --git a/tools/Makefile b/tools/Makefile
index 9595d62..b8eef3f 100644
index 13bb028..137ad61 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -96,10 +96,16 @@ define PrepareStaging
@@ -97,10 +97,16 @@ define PrepareStaging
endef
# preparatory work
......@@ -23,7 +23,7 @@ index 9595d62..b8eef3f 100644
$(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
$(call PrepareStaging,$(STAGING_DIR_HOST))
@@ -111,7 +117,7 @@ $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
@@ -112,7 +118,7 @@ $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
define PrepareCommand
......@@ -32,7 +32,7 @@ index 9595d62..b8eef3f 100644
@mkdir -p "$$(dir $$@)"; rm -f "$$@"
@export FILE="$$$$(which $(2) 2>/dev/null | grep -v 'not found' | head -n1)"; [ -n "$$$$FILE" ] || { \
echo "Command $(1) not found."; false; \
@@ -120,7 +126,7 @@ $(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR)/.prepared
@@ -121,7 +127,7 @@ $(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR)/.prepared
endef
endif
......@@ -41,7 +41,7 @@ index 9595d62..b8eef3f 100644
@rm -f $@
@if stat --version > /dev/null 2>&1; then \
ln -s `which stat` $@; \
@@ -144,8 +150,8 @@ $(eval $(call PrepareCommand,tar,gtar tar))
@@ -145,8 +151,8 @@ $(eval $(call PrepareCommand,tar,gtar tar))
$(eval $(call PrepareCommand,diff,gdiff diff))
$(curdir)/cmddeps = $(patsubst %,$(STAGING_DIR_HOST)/bin/%,md5sum cp stat seq python awk getopt grep tar diff)
......
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 13 Nov 2014 01:17:24 +0100
Subject: odhcp6c: always accept RDNSS, independent of the default router lifetime
diff --git a/package/network/ipv6/odhcp6c/patches/001-always_accept_rdnss.patch b/package/network/ipv6/odhcp6c/patches/001-always_accept_rdnss.patch
new file mode 100644
index 0000000..ae4e18d
--- /dev/null
+++ b/package/network/ipv6/odhcp6c/patches/001-always_accept_rdnss.patch
@@ -0,0 +1,16 @@
+--- a/src/ra.c
++++ b/src/ra.c
+@@ -409,13 +409,6 @@ bool ra_process(void)
+ }
+ }
+ }
+-
+- size_t ra_dns_len;
+- struct odhcp6c_entry *entry = odhcp6c_get_state(STATE_RA_DNS, &ra_dns_len);
+- for (size_t i = 0; i < ra_dns_len / sizeof(*entry); ++i)
+- if (IN6_ARE_ADDR_EQUAL(&entry[i].router, &from.sin6_addr) &&
+- entry[i].valid > router_valid)
+- entry[i].valid = router_valid;
+ }
+
+ if (found)
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 26 Nov 2014 23:20:33 +0100
Subject: ar71xx: refactor ubnt xw board setup
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
diff --git a/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch b/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch
index ed2fd24..9413bd8 100644
--- a/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch
+++ b/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch
@@ -1,6 +1,8 @@
---- a/arch/mips/ath79/mach-ubnt-xm.c
-+++ b/arch/mips/ath79/mach-ubnt-xm.c
-@@ -332,3 +332,60 @@ static void __init ubnt_uap_pro_setup(vo
+Index: linux-3.10.49/arch/mips/ath79/mach-ubnt-xm.c
+===================================================================
+--- linux-3.10.49.orig/arch/mips/ath79/mach-ubnt-xm.c 2014-08-15 22:55:37.890080659 +0200
++++ linux-3.10.49/arch/mips/ath79/mach-ubnt-xm.c 2014-08-15 22:58:31.061570912 +0200
+@@ -332,3 +332,67 @@
MIPS_MACHINE(ATH79_MACH_UBNT_UAP_PRO, "UAP-PRO", "Ubiquiti UniFi AP Pro",
ubnt_uap_pro_setup);
@@ -29,7 +31,7 @@
+ },
+};
+
-+static void __init ubnt_nano_m_xw_setup(void)
++static void __init ubnt_xw_init(void)
+{
+ u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
+
@@ -44,26 +46,36 @@
+ ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
+ ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
+
-+ ath79_register_mdio(0, ~(BIT(0) | BIT(1) | BIT(5)));
+
+ ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_MII_GMAC0 | AR934X_ETH_CFG_MII_GMAC0_SLAVE);
+ ath79_init_mac(ath79_eth0_data.mac_addr,
+ eeprom + UAP_PRO_MAC0_OFFSET, 0);
+
-+ /* GMAC0 is connected to an AR8326 switch */
+ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++}
++
++static void __init ubnt_nano_m_xw_setup(void)
++{
++ ubnt_xw_init();
++
++ /* GMAC0 is connected to an AR8326 switch */
++ ath79_register_mdio(0, ~(BIT(0) | BIT(1) | BIT(5)));
+ ath79_eth0_data.phy_mask = (BIT(0) | BIT(1) | BIT(5));
+ ath79_eth0_data.speed = SPEED_100;
+ ath79_eth0_data.duplex = DUPLEX_FULL;
-+ ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
+ ath79_register_eth(0);
+}
+
+MIPS_MACHINE(ATH79_MACH_UBNT_NANO_M_XW, "UBNT-NM-XW", "Ubiquiti Nanostation M XW",
+ ubnt_nano_m_xw_setup);
++
--- a/arch/mips/ath79/machtypes.h
+++ b/arch/mips/ath79/machtypes.h
-@@ -124,6 +124,7 @@ enum ath79_mach_type {
+@@ -121,9 +121,10 @@ enum ath79_mach_type {
+ ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */
+ ATH79_MACH_UBNT_AIRROUTER, /* Ubiquiti AirRouter */
+ ATH79_MACH_UBNT_BULLET_M, /* Ubiquiti Bullet M */
ATH79_MACH_UBNT_LSSR71, /* Ubiquiti LS-SR71 */
ATH79_MACH_UBNT_LSX, /* Ubiquiti LSX */
ATH79_MACH_UBNT_NANO_M, /* Ubiquiti NanoStation M */
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 26 Nov 2014 23:20:46 +0100
Subject: ar71xx: add board support for ubnt loco m xw
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 4b510dd..6e63343 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -34,7 +34,7 @@ get_status_led() {
aw-nr580)
status_led="aw-nr580:green:ready"
;;
- bullet-m | rocket-m | nano-m | nanostation-m | nanostation-m-xw)
+ bullet-m | rocket-m | nano-m | nanostation-m | nanostation-m-xw | loco-m-xw)
status_led="ubnt:green:link4"
;;
bxu2000n-2-a1)
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index fb8df40..8f845a0 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -38,7 +38,8 @@ ap113)
bullet-m | \
nanostation-m | \
rocket-m | \
-nanostation-m-xw)
+nanostation-m-xw | \
+loco-m-xw)
ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100" "0" "13"
ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:orange:link2" "wlan0" "26" "100" "-25" "13"