diff mbox

[OpenWrt-Devel] ar71xx: add support for the UniFi AP Outdoor Plus

Message ID 87b1713d5176c2d2a7e805d6e550f8cdc2a3b2ac.1419908481.git.mschiffer@universe-factory.net
State Accepted
Headers show

Commit Message

Matthias Schiffer Dec. 30, 2014, 3:01 a.m. UTC
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
---
 target/linux/ar71xx/base-files/etc/diag.sh         |  3 ++
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |  3 ++
 .../ar71xx/base-files/lib/upgrade/platform.sh      |  2 +
 target/linux/ar71xx/image/Makefile                 |  3 +-
 .../610-MIPS-ath79-openwrt-machines.patch          |  3 +-
 .../patches-3.14/616-MIPS-ath79-ubnt-xw.patch      | 61 +++++++++++++++++++++-
 6 files changed, 72 insertions(+), 3 deletions(-)

Comments

Davey Hutchison Dec. 30, 2014, 4:42 a.m. UTC | #1
Does the new kernel / ath9k address the RF Filter on this board? I
came up with an old patch for this board, but whenever I changed the
channel inside OpenWRT the signal would just disappear. The RF Filter
has to be toggled somehow ( I assume it's a GPIO of some sort ). I am
just curious on how it was fixed, or if it's still an issue.

-- Davey

On Mon, Dec 29, 2014 at 8:01 PM, Matthias Schiffer
<mschiffer@universe-factory.net> wrote:
> Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
> ---
>  target/linux/ar71xx/base-files/etc/diag.sh         |  3 ++
>  target/linux/ar71xx/base-files/lib/ar71xx.sh       |  3 ++
>  .../ar71xx/base-files/lib/upgrade/platform.sh      |  2 +
>  target/linux/ar71xx/image/Makefile                 |  3 +-
>  .../610-MIPS-ath79-openwrt-machines.patch          |  3 +-
>  .../patches-3.14/616-MIPS-ath79-ubnt-xw.patch      | 61 +++++++++++++++++++++-
>  6 files changed, 72 insertions(+), 3 deletions(-)
>
> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
> index 06b96a3..30e4aeb 100755
> --- a/target/linux/ar71xx/base-files/etc/diag.sh
> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
> @@ -254,6 +254,9 @@ get_status_led() {
>         uap-pro)
>                 status_led="ubnt:white:dome"
>                 ;;
> +       unifi-outdoor-plus)
> +               status_led="ubnt:white:front"
> +               ;;
>         airgateway)
>                 status_led="ubnt:white:status"
>                 ;;
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index 9b056e9..a12101a 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -732,6 +732,9 @@ ar71xx_board_detect() {
>         *"UniFiAP Outdoor")
>                 name="unifi-outdoor"
>                 ;;
> +       *"UniFiAP Outdoor+")
> +               name="unifi-outdoor-plus"
> +               ;;
>         *WP543)
>                 name="wp543"
>                 ;;
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> index 6dabf4e..2752729 100755
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -368,6 +368,7 @@ platform_check_image() {
>                 return 1
>                 ;;
>
> +       unifi-outdoor-plus | \
>         uap-pro)
>                 [ "$magic_long" != "19852003" ] && {
>                         echo "Invalid image type."
> @@ -483,6 +484,7 @@ platform_do_upgrade() {
>         om5p)
>                 platform_do_upgrade_openmesh "$ARGV"
>                 ;;
> +       unifi-outdoor-plus | \
>         uap-pro)
>                 MTD_CONFIG_ARGS="-s 0x180000"
>                 default_do_upgrade "$ARGV"
> diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
> index 18c9637..3eb2f07 100644
> --- a/target/linux/ar71xx/image/Makefile
> +++ b/target/linux/ar71xx/image/Makefile
> @@ -1333,6 +1333,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,SMART-300,smart-300,SMART-300,tty
>  $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,OOLITE,oolite,GS-OOLITE,ttyATH0,115200,0x3C000101,1,16Mlzma))
>
>  $(eval $(call SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x))
> +$(eval $(call SingleProfile,UAPPRO,64k,UBNTUNIFIOUTDOORPLUS,ubnt-unifi-outdoor-plus,UBNT-UOP,ttyS0,115200,BZ,BZ,ar7240))
>
>  $(eval $(call SingleProfile,UBDEV,64kraw,UBDEV01,ubdev01,UBNT-UF,ttyS0,115200,XM,XM,ar7240))
>
> @@ -1396,7 +1397,7 @@ $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4 TLWR941NV6))
>  $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2))
>  $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1))
>  $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
> -$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UAPPRO UBNTAIRGW))
> +$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW))
>  $(eval $(call MultiProfile,WNDR3700,WNDR3700V1 WNDR3700V2 WNDR3800 WNDR3800CH WNDRMAC WNDRMACV2))
>  $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
>  $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))
> diff --git a/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
> index 4ce9268..b01c5de 100644
> --- a/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
> +++ b/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
> @@ -1,6 +1,6 @@
>  --- a/arch/mips/ath79/machtypes.h
>  +++ b/arch/mips/ath79/machtypes.h
> -@@ -16,22 +16,145 @@
> +@@ -16,22 +16,146 @@
>
>   enum ath79_mach_type {
>         ATH79_MACH_GENERIC = 0,
> @@ -119,6 +119,7 @@
>         ATH79_MACH_UBNT_UAP_PRO,        /* Ubiquiti UniFi AP Pro */
>         ATH79_MACH_UBNT_UNIFI,          /* Ubiquiti Unifi */
>         ATH79_MACH_UBNT_UNIFI_OUTDOOR,  /* Ubiquiti UnifiAP Outdoor */
> ++      ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, /* Ubiquiti UnifiAP Outdoor+ */
>         ATH79_MACH_UBNT_XM,             /* Ubiquiti Networks XM board rev 1.0 */
>  +      ATH79_MACH_WHR_G301N,           /* Buffalo WHR-G301N */
>  +      ATH79_MACH_WHR_HP_G300N,        /* Buffalo WHR-HP-G300N */
> diff --git a/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch b/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
> index 3675518..8e16697 100644
> --- a/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
> +++ b/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
> @@ -1,6 +1,65 @@
>  --- a/arch/mips/ath79/mach-ubnt-xm.c
>  +++ b/arch/mips/ath79/mach-ubnt-xm.c
> -@@ -332,3 +332,78 @@ static void __init ubnt_uap_pro_setup(vo
> +@@ -186,6 +186,19 @@ static struct gpio_led ubnt_unifi_outdoo
> +       }
> + };
> +
> ++static struct gpio_led ubnt_unifi_outdoor_plus_leds_gpio[] __initdata = {
> ++      {
> ++              .name           = "ubnt:white:front",
> ++              .gpio           = 1,
> ++              .active_low     = 0,
> ++      }, {
> ++              .name           = "ubnt:blue:front",
> ++              .gpio           = 0,
> ++              .active_low     = 0,
> ++      }
> ++};
> ++
> ++
> + static void __init ubnt_unifi_setup(void)
> + {
> +       u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);
> +@@ -245,6 +258,38 @@ MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDO
> +            "Ubiquiti UniFiAP Outdoor",
> +            ubnt_unifi_outdoor_setup);
> +
> ++
> ++static void __init ubnt_unifi_outdoor_plus_setup(void)
> ++{
> ++      u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
> ++      u8 *mac2 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
> ++      u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
> ++
> ++      ath79_register_m25p80(NULL);
> ++
> ++      ath79_register_mdio(0, ~(UBNT_UNIFIOD_PRI_PHYMASK |
> ++                               UBNT_UNIFIOD_2ND_PHYMASK));
> ++
> ++      ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
> ++      ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0);
> ++      ath79_register_eth(0);
> ++      ath79_register_eth(1);
> ++
> ++      ap91_pci_init(ee, NULL);
> ++
> ++      ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifi_outdoor_plus_leds_gpio),
> ++                               ubnt_unifi_outdoor_plus_leds_gpio);
> ++
> ++      ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
> ++                                        ARRAY_SIZE(ubnt_xm_gpio_keys),
> ++                                        ubnt_xm_gpio_keys);
> ++}
> ++
> ++MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, "UBNT-UOP",
> ++           "Ubiquiti UniFiAP Outdoor+",
> ++           ubnt_unifi_outdoor_plus_setup);
> ++
> ++
> + static struct gpio_led ubnt_uap_pro_gpio_leds[] __initdata = {
> +       {
> +               .name           = "ubnt:white:dome",
> +@@ -332,3 +377,78 @@ static void __init ubnt_uap_pro_setup(vo
>   MIPS_MACHINE(ATH79_MACH_UBNT_UAP_PRO, "UAP-PRO", "Ubiquiti UniFi AP Pro",
>              ubnt_uap_pro_setup);
>
> --
> 2.2.1
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Matthias Schiffer Dec. 30, 2014, 5:01 a.m. UTC | #2
I had read the mails regarding the issue and I've asked about it in
#openwrt-devel (but didn't get an answer yet). I didn't try changing the
channel though as I'm in a very noisy environment (WLAN-wise) at the
moment, so I can't really do any proper testing.

If it's only a GPIO issue, I could look at it, but I don't know enough
about ath9k to do more complex fixes. Unfortunately, I don't have the
device anymore, so I can't perform further tests myself.


On 12/30/2014 05:42 AM, David Hutchison wrote:
> Does the new kernel / ath9k address the RF Filter on this board? I
> came up with an old patch for this board, but whenever I changed the
> channel inside OpenWRT the signal would just disappear. The RF Filter
> has to be toggled somehow ( I assume it's a GPIO of some sort ). I am
> just curious on how it was fixed, or if it's still an issue.
> 
> -- Davey
> 
> On Mon, Dec 29, 2014 at 8:01 PM, Matthias Schiffer
> <mschiffer@universe-factory.net> wrote:
>> Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
>> ---
>>  target/linux/ar71xx/base-files/etc/diag.sh         |  3 ++
>>  target/linux/ar71xx/base-files/lib/ar71xx.sh       |  3 ++
>>  .../ar71xx/base-files/lib/upgrade/platform.sh      |  2 +
>>  target/linux/ar71xx/image/Makefile                 |  3 +-
>>  .../610-MIPS-ath79-openwrt-machines.patch          |  3 +-
>>  .../patches-3.14/616-MIPS-ath79-ubnt-xw.patch      | 61 +++++++++++++++++++++-
>>  6 files changed, 72 insertions(+), 3 deletions(-)
>>
>> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
>> index 06b96a3..30e4aeb 100755
>> --- a/target/linux/ar71xx/base-files/etc/diag.sh
>> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
>> @@ -254,6 +254,9 @@ get_status_led() {
>>         uap-pro)
>>                 status_led="ubnt:white:dome"
>>                 ;;
>> +       unifi-outdoor-plus)
>> +               status_led="ubnt:white:front"
>> +               ;;
>>         airgateway)
>>                 status_led="ubnt:white:status"
>>                 ;;
>> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> index 9b056e9..a12101a 100755
>> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> @@ -732,6 +732,9 @@ ar71xx_board_detect() {
>>         *"UniFiAP Outdoor")
>>                 name="unifi-outdoor"
>>                 ;;
>> +       *"UniFiAP Outdoor+")
>> +               name="unifi-outdoor-plus"
>> +               ;;
>>         *WP543)
>>                 name="wp543"
>>                 ;;
>> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> index 6dabf4e..2752729 100755
>> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> @@ -368,6 +368,7 @@ platform_check_image() {
>>                 return 1
>>                 ;;
>>
>> +       unifi-outdoor-plus | \
>>         uap-pro)
>>                 [ "$magic_long" != "19852003" ] && {
>>                         echo "Invalid image type."
>> @@ -483,6 +484,7 @@ platform_do_upgrade() {
>>         om5p)
>>                 platform_do_upgrade_openmesh "$ARGV"
>>                 ;;
>> +       unifi-outdoor-plus | \
>>         uap-pro)
>>                 MTD_CONFIG_ARGS="-s 0x180000"
>>                 default_do_upgrade "$ARGV"
>> diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
>> index 18c9637..3eb2f07 100644
>> --- a/target/linux/ar71xx/image/Makefile
>> +++ b/target/linux/ar71xx/image/Makefile
>> @@ -1333,6 +1333,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,SMART-300,smart-300,SMART-300,tty
>>  $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,OOLITE,oolite,GS-OOLITE,ttyATH0,115200,0x3C000101,1,16Mlzma))
>>
>>  $(eval $(call SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x))
>> +$(eval $(call SingleProfile,UAPPRO,64k,UBNTUNIFIOUTDOORPLUS,ubnt-unifi-outdoor-plus,UBNT-UOP,ttyS0,115200,BZ,BZ,ar7240))
>>
>>  $(eval $(call SingleProfile,UBDEV,64kraw,UBDEV01,ubdev01,UBNT-UF,ttyS0,115200,XM,XM,ar7240))
>>
>> @@ -1396,7 +1397,7 @@ $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4 TLWR941NV6))
>>  $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2))
>>  $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1))
>>  $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
>> -$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UAPPRO UBNTAIRGW))
>> +$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW))
>>  $(eval $(call MultiProfile,WNDR3700,WNDR3700V1 WNDR3700V2 WNDR3800 WNDR3800CH WNDRMAC WNDRMACV2))
>>  $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
>>  $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))
>> diff --git a/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
>> index 4ce9268..b01c5de 100644
>> --- a/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
>> +++ b/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
>> @@ -1,6 +1,6 @@
>>  --- a/arch/mips/ath79/machtypes.h
>>  +++ b/arch/mips/ath79/machtypes.h
>> -@@ -16,22 +16,145 @@
>> +@@ -16,22 +16,146 @@
>>
>>   enum ath79_mach_type {
>>         ATH79_MACH_GENERIC = 0,
>> @@ -119,6 +119,7 @@
>>         ATH79_MACH_UBNT_UAP_PRO,        /* Ubiquiti UniFi AP Pro */
>>         ATH79_MACH_UBNT_UNIFI,          /* Ubiquiti Unifi */
>>         ATH79_MACH_UBNT_UNIFI_OUTDOOR,  /* Ubiquiti UnifiAP Outdoor */
>> ++      ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, /* Ubiquiti UnifiAP Outdoor+ */
>>         ATH79_MACH_UBNT_XM,             /* Ubiquiti Networks XM board rev 1.0 */
>>  +      ATH79_MACH_WHR_G301N,           /* Buffalo WHR-G301N */
>>  +      ATH79_MACH_WHR_HP_G300N,        /* Buffalo WHR-HP-G300N */
>> diff --git a/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch b/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
>> index 3675518..8e16697 100644
>> --- a/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
>> +++ b/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
>> @@ -1,6 +1,65 @@
>>  --- a/arch/mips/ath79/mach-ubnt-xm.c
>>  +++ b/arch/mips/ath79/mach-ubnt-xm.c
>> -@@ -332,3 +332,78 @@ static void __init ubnt_uap_pro_setup(vo
>> +@@ -186,6 +186,19 @@ static struct gpio_led ubnt_unifi_outdoo
>> +       }
>> + };
>> +
>> ++static struct gpio_led ubnt_unifi_outdoor_plus_leds_gpio[] __initdata = {
>> ++      {
>> ++              .name           = "ubnt:white:front",
>> ++              .gpio           = 1,
>> ++              .active_low     = 0,
>> ++      }, {
>> ++              .name           = "ubnt:blue:front",
>> ++              .gpio           = 0,
>> ++              .active_low     = 0,
>> ++      }
>> ++};
>> ++
>> ++
>> + static void __init ubnt_unifi_setup(void)
>> + {
>> +       u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);
>> +@@ -245,6 +258,38 @@ MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDO
>> +            "Ubiquiti UniFiAP Outdoor",
>> +            ubnt_unifi_outdoor_setup);
>> +
>> ++
>> ++static void __init ubnt_unifi_outdoor_plus_setup(void)
>> ++{
>> ++      u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
>> ++      u8 *mac2 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
>> ++      u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
>> ++
>> ++      ath79_register_m25p80(NULL);
>> ++
>> ++      ath79_register_mdio(0, ~(UBNT_UNIFIOD_PRI_PHYMASK |
>> ++                               UBNT_UNIFIOD_2ND_PHYMASK));
>> ++
>> ++      ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
>> ++      ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0);
>> ++      ath79_register_eth(0);
>> ++      ath79_register_eth(1);
>> ++
>> ++      ap91_pci_init(ee, NULL);
>> ++
>> ++      ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifi_outdoor_plus_leds_gpio),
>> ++                               ubnt_unifi_outdoor_plus_leds_gpio);
>> ++
>> ++      ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
>> ++                                        ARRAY_SIZE(ubnt_xm_gpio_keys),
>> ++                                        ubnt_xm_gpio_keys);
>> ++}
>> ++
>> ++MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, "UBNT-UOP",
>> ++           "Ubiquiti UniFiAP Outdoor+",
>> ++           ubnt_unifi_outdoor_plus_setup);
>> ++
>> ++
>> + static struct gpio_led ubnt_uap_pro_gpio_leds[] __initdata = {
>> +       {
>> +               .name           = "ubnt:white:dome",
>> +@@ -332,3 +377,78 @@ static void __init ubnt_uap_pro_setup(vo
>>   MIPS_MACHINE(ATH79_MACH_UBNT_UAP_PRO, "UAP-PRO", "Ubiquiti UniFi AP Pro",
>>              ubnt_uap_pro_setup);
>>
>> --
>> 2.2.1
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
John Crispin Jan. 18, 2015, 6:54 a.m. UTC | #3
On 30/12/2014 06:01, Matthias Schiffer wrote:
> I had read the mails regarding the issue and I've asked about it
> in #openwrt-devel (but didn't get an answer yet). I didn't try
> changing the channel though as I'm in a very noisy environment
> (WLAN-wise) at the moment, so I can't really do any proper
> testing.
> 
> If it's only a GPIO issue, I could look at it, but I don't know
> enough about ath9k to do more complex fixes. Unfortunately, I don't
> have the device anymore, so I can't perform further tests myself.
> 

can this wrong / missing GPIO cause permanent damage the SoC/wmac ?








> 
> On 12/30/2014 05:42 AM, David Hutchison wrote:
>> Does the new kernel / ath9k address the RF Filter on this board?
>> I came up with an old patch for this board, but whenever I
>> changed the channel inside OpenWRT the signal would just
>> disappear. The RF Filter has to be toggled somehow ( I assume
>> it's a GPIO of some sort ). I am just curious on how it was
>> fixed, or if it's still an issue.
>> 
>> -- Davey
>> 
>> On Mon, Dec 29, 2014 at 8:01 PM, Matthias Schiffer 
>> <mschiffer@universe-factory.net> wrote:
>>> Signed-off-by: Matthias Schiffer
>>> <mschiffer@universe-factory.net> --- 
>>> target/linux/ar71xx/base-files/etc/diag.sh         |  3 ++ 
>>> target/linux/ar71xx/base-files/lib/ar71xx.sh       |  3 ++ 
>>> .../ar71xx/base-files/lib/upgrade/platform.sh      |  2 + 
>>> target/linux/ar71xx/image/Makefile                 |  3 +- 
>>> .../610-MIPS-ath79-openwrt-machines.patch          |  3 +- 
>>> .../patches-3.14/616-MIPS-ath79-ubnt-xw.patch      | 61
>>> +++++++++++++++++++++- 6 files changed, 72 insertions(+), 3
>>> deletions(-)
>>> 
>>> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
>>> b/target/linux/ar71xx/base-files/etc/diag.sh index
>>> 06b96a3..30e4aeb 100755 ---
>>> a/target/linux/ar71xx/base-files/etc/diag.sh +++
>>> b/target/linux/ar71xx/base-files/etc/diag.sh @@ -254,6 +254,9
>>> @@ get_status_led() { uap-pro) status_led="ubnt:white:dome" ;; 
>>> +       unifi-outdoor-plus) +
>>> status_led="ubnt:white:front" +               ;; airgateway) 
>>> status_led="ubnt:white:status" ;; diff --git
>>> a/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>> b/target/linux/ar71xx/base-files/lib/ar71xx.sh index
>>> 9b056e9..a12101a 100755 ---
>>> a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++
>>> b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -732,6 +732,9
>>> @@ ar71xx_board_detect() { *"UniFiAP Outdoor") 
>>> name="unifi-outdoor" ;; +       *"UniFiAP Outdoor+") +
>>> name="unifi-outdoor-plus" +               ;; *WP543) 
>>> name="wp543" ;; diff --git
>>> a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>>> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index
>>> 6dabf4e..2752729 100755 ---
>>> a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++
>>> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@
>>> -368,6 +368,7 @@ platform_check_image() { return 1 ;;
>>> 
>>> +       unifi-outdoor-plus | \ uap-pro) [ "$magic_long" !=
>>> "19852003" ] && { echo "Invalid image type." @@ -483,6 +484,7
>>> @@ platform_do_upgrade() { om5p) platform_do_upgrade_openmesh
>>> "$ARGV" ;; +       unifi-outdoor-plus | \ uap-pro) 
>>> MTD_CONFIG_ARGS="-s 0x180000" default_do_upgrade "$ARGV" diff
>>> --git a/target/linux/ar71xx/image/Makefile
>>> b/target/linux/ar71xx/image/Makefile index 18c9637..3eb2f07
>>> 100644 --- a/target/linux/ar71xx/image/Makefile +++
>>> b/target/linux/ar71xx/image/Makefile @@ -1333,6 +1333,7 @@
>>> $(eval $(call
>>> SingleProfile,TPLINK-LZMA,64kraw,SMART-300,smart-300,SMART-300,tty
>>>
>>> 
$(eval $(call
SingleProfile,TPLINK-LZMA,64kraw,OOLITE,oolite,GS-OOLITE,ttyATH0,115200,0x3C000101,1,16Mlzma))
>>> 
>>> $(eval $(call
>>> SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x))
>>>
>>> 
+$(eval $(call
SingleProfile,UAPPRO,64k,UBNTUNIFIOUTDOORPLUS,ubnt-unifi-outdoor-plus,UBNT-UOP,ttyS0,115200,BZ,BZ,ar7240))
>>> 
>>> $(eval $(call
>>> SingleProfile,UBDEV,64kraw,UBDEV01,ubdev01,UBNT-UF,ttyS0,115200,XM,XM,ar7240))
>>>
>>>
>>> 
@@ -1396,7 +1397,7 @@ $(eval $(call MultiProfile,TLWR941,TLWR941NV2
TLWR941NV3 TLWR941NV4 TLWR941NV6))
>>> $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2)) 
>>> $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1
>>> TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1)) $(eval $(call
>>> MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M)) -$(eval $(call
>>> MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71
>>> UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW
>>> UBNTUNIFI UBNTUNIFIOUTDOOR UAPPRO UBNTAIRGW)) +$(eval $(call
>>> MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71
>>> UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW
>>> UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO
>>> UBNTAIRGW)) $(eval $(call MultiProfile,WNDR3700,WNDR3700V1
>>> WNDR3700V2 WNDR3800 WNDR3800CH WNDRMAC WNDRMACV2)) $(eval
>>> $(call MultiProfile,WNR612V2,REALWNR612V2 N150R)) $(eval $(call
>>> MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M)) diff
>>> --git
>>> a/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
>>> b/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
>>>
>>> 
index 4ce9268..b01c5de 100644
>>> ---
>>> a/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
>>>
>>> 
+++ b/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
>>> @@ -1,6 +1,6 @@ --- a/arch/mips/ath79/machtypes.h +++
>>> b/arch/mips/ath79/machtypes.h -@@ -16,22 +16,145 @@ +@@ -16,22
>>> +16,146 @@
>>> 
>>> enum ath79_mach_type { ATH79_MACH_GENERIC = 0, @@ -119,6 +119,7
>>> @@ ATH79_MACH_UBNT_UAP_PRO,        /* Ubiquiti UniFi AP Pro */ 
>>> ATH79_MACH_UBNT_UNIFI,          /* Ubiquiti Unifi */ 
>>> ATH79_MACH_UBNT_UNIFI_OUTDOOR,  /* Ubiquiti UnifiAP Outdoor */ 
>>> ++      ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, /* Ubiquiti UnifiAP
>>> Outdoor+ */ ATH79_MACH_UBNT_XM,             /* Ubiquiti
>>> Networks XM board rev 1.0 */ +      ATH79_MACH_WHR_G301N,
>>> /* Buffalo WHR-G301N */ +      ATH79_MACH_WHR_HP_G300N,
>>> /* Buffalo WHR-HP-G300N */ diff --git
>>> a/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
>>> b/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
>>>
>>> 
index 3675518..8e16697 100644
>>> ---
>>> a/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
>>>
>>> 
+++ b/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
>>> @@ -1,6 +1,65 @@ --- a/arch/mips/ath79/mach-ubnt-xm.c +++
>>> b/arch/mips/ath79/mach-ubnt-xm.c -@@ -332,3 +332,78 @@ static
>>> void __init ubnt_uap_pro_setup(vo +@@ -186,6 +186,19 @@ static
>>> struct gpio_led ubnt_unifi_outdoo +       } + }; + ++static
>>> struct gpio_led ubnt_unifi_outdoor_plus_leds_gpio[] __initdata
>>> = { ++      { ++              .name           =
>>> "ubnt:white:front", ++              .gpio           = 1, ++
>>> .active_low     = 0, ++      }, { ++              .name
>>> = "ubnt:blue:front", ++              .gpio           = 0, ++
>>> .active_low     = 0, ++      } ++}; ++ ++ + static void __init
>>> ubnt_unifi_setup(void) + { +       u8 *mac = (u8 *)
>>> KSEG1ADDR(0x1fff0000); +@@ -245,6 +258,38 @@
>>> MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDO +            "Ubiquiti
>>> UniFiAP Outdoor", +            ubnt_unifi_outdoor_setup); + ++ 
>>> ++static void __init ubnt_unifi_outdoor_plus_setup(void) ++{ ++
>>> u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000); ++      u8 *mac2 = (u8
>>> *) KSEG1ADDR(0x1fff0000 + ETH_ALEN); ++      u8 *ee = (u8 *)
>>> KSEG1ADDR(0x1fff1000); ++ ++      ath79_register_m25p80(NULL); 
>>> ++ ++      ath79_register_mdio(0, ~(UBNT_UNIFIOD_PRI_PHYMASK | 
>>> ++                               UBNT_UNIFIOD_2ND_PHYMASK)); 
>>> ++ ++      ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0); 
>>> ++      ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0); ++
>>> ath79_register_eth(0); ++      ath79_register_eth(1); ++ ++
>>> ap91_pci_init(ee, NULL); ++ ++
>>> ath79_register_leds_gpio(-1,
>>> ARRAY_SIZE(ubnt_unifi_outdoor_plus_leds_gpio), ++
>>> ubnt_unifi_outdoor_plus_leds_gpio); ++ ++
>>> ath79_register_gpio_keys_polled(-1,
>>> UBNT_XM_KEYS_POLL_INTERVAL, ++
>>> ARRAY_SIZE(ubnt_xm_gpio_keys), ++
>>> ubnt_xm_gpio_keys); ++} ++ 
>>> ++MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, "UBNT-UOP", 
>>> ++           "Ubiquiti UniFiAP Outdoor+", ++
>>> ubnt_unifi_outdoor_plus_setup); ++ ++ + static struct gpio_led
>>> ubnt_uap_pro_gpio_leds[] __initdata = { +       { +
>>> .name           = "ubnt:white:dome", +@@ -332,3 +377,78 @@
>>> static void __init ubnt_uap_pro_setup(vo 
>>> MIPS_MACHINE(ATH79_MACH_UBNT_UAP_PRO, "UAP-PRO", "Ubiquiti
>>> UniFi AP Pro", ubnt_uap_pro_setup);
>>> 
>>> -- 2.2.1 _______________________________________________ 
>>> openwrt-devel mailing list openwrt-devel@lists.openwrt.org 
>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
>>> 
> 
> 
> 
> _______________________________________________ openwrt-devel
> mailing list openwrt-devel@lists.openwrt.org 
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
Shvedov Yury March 11, 2015, 8:54 a.m. UTC | #4
Hi,

does your patch fix this problem: 
https://lists.openwrt.org/pipermail/openwrt-devel/2014-September/028103.html 
?
As I checked, it doesn't, so what exactly your patch do? Does it only 
make the leds to work properly?

Kind regards
Yury Shvedov

On 12/30/2014 06:01 AM, Matthias Schiffer wrote:
> Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
> ---
>   target/linux/ar71xx/base-files/etc/diag.sh         |  3 ++
>   target/linux/ar71xx/base-files/lib/ar71xx.sh       |  3 ++
>   .../ar71xx/base-files/lib/upgrade/platform.sh      |  2 +
>   target/linux/ar71xx/image/Makefile                 |  3 +-
>   .../610-MIPS-ath79-openwrt-machines.patch          |  3 +-
>   .../patches-3.14/616-MIPS-ath79-ubnt-xw.patch      | 61 +++++++++++++++++++++-
>   6 files changed, 72 insertions(+), 3 deletions(-)
>
> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
> index 06b96a3..30e4aeb 100755
> --- a/target/linux/ar71xx/base-files/etc/diag.sh
> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
> @@ -254,6 +254,9 @@ get_status_led() {
>   	uap-pro)
>   		status_led="ubnt:white:dome"
>   		;;
> +	unifi-outdoor-plus)
> +		status_led="ubnt:white:front"
> +		;;
>   	airgateway)
>   		status_led="ubnt:white:status"
>   		;;
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index 9b056e9..a12101a 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -732,6 +732,9 @@ ar71xx_board_detect() {
>   	*"UniFiAP Outdoor")
>   		name="unifi-outdoor"
>   		;;
> +	*"UniFiAP Outdoor+")
> +		name="unifi-outdoor-plus"
> +		;;
>   	*WP543)
>   		name="wp543"
>   		;;
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> index 6dabf4e..2752729 100755
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -368,6 +368,7 @@ platform_check_image() {
>   		return 1
>   		;;
>   
> +	unifi-outdoor-plus | \
>   	uap-pro)
>   		[ "$magic_long" != "19852003" ] && {
>   			echo "Invalid image type."
> @@ -483,6 +484,7 @@ platform_do_upgrade() {
>   	om5p)
>   		platform_do_upgrade_openmesh "$ARGV"
>   		;;
> +	unifi-outdoor-plus | \
>   	uap-pro)
>   		MTD_CONFIG_ARGS="-s 0x180000"
>   		default_do_upgrade "$ARGV"
> diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
> index 18c9637..3eb2f07 100644
> --- a/target/linux/ar71xx/image/Makefile
> +++ b/target/linux/ar71xx/image/Makefile
> @@ -1333,6 +1333,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,SMART-300,smart-300,SMART-300,tty
>   $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,OOLITE,oolite,GS-OOLITE,ttyATH0,115200,0x3C000101,1,16Mlzma))
>   
>   $(eval $(call SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x))
> +$(eval $(call SingleProfile,UAPPRO,64k,UBNTUNIFIOUTDOORPLUS,ubnt-unifi-outdoor-plus,UBNT-UOP,ttyS0,115200,BZ,BZ,ar7240))
>   
>   $(eval $(call SingleProfile,UBDEV,64kraw,UBDEV01,ubdev01,UBNT-UF,ttyS0,115200,XM,XM,ar7240))
>   
> @@ -1396,7 +1397,7 @@ $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4 TLWR941NV6))
>   $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2))
>   $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1))
>   $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
> -$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UAPPRO UBNTAIRGW))
> +$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW))
>   $(eval $(call MultiProfile,WNDR3700,WNDR3700V1 WNDR3700V2 WNDR3800 WNDR3800CH WNDRMAC WNDRMACV2))
>   $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
>   $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))
> diff --git a/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
> index 4ce9268..b01c5de 100644
> --- a/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
> +++ b/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
> @@ -1,6 +1,6 @@
>   --- a/arch/mips/ath79/machtypes.h
>   +++ b/arch/mips/ath79/machtypes.h
> -@@ -16,22 +16,145 @@
> +@@ -16,22 +16,146 @@
>    
>    enum ath79_mach_type {
>    	ATH79_MACH_GENERIC = 0,
> @@ -119,6 +119,7 @@
>    	ATH79_MACH_UBNT_UAP_PRO,	/* Ubiquiti UniFi AP Pro */
>    	ATH79_MACH_UBNT_UNIFI, 		/* Ubiquiti Unifi */
>    	ATH79_MACH_UBNT_UNIFI_OUTDOOR,	/* Ubiquiti UnifiAP Outdoor */
> ++	ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, /* Ubiquiti UnifiAP Outdoor+ */
>    	ATH79_MACH_UBNT_XM,		/* Ubiquiti Networks XM board rev 1.0 */
>   +	ATH79_MACH_WHR_G301N,		/* Buffalo WHR-G301N */
>   +	ATH79_MACH_WHR_HP_G300N,	/* Buffalo WHR-HP-G300N */
> diff --git a/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch b/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
> index 3675518..8e16697 100644
> --- a/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
> +++ b/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
> @@ -1,6 +1,65 @@
>   --- a/arch/mips/ath79/mach-ubnt-xm.c
>   +++ b/arch/mips/ath79/mach-ubnt-xm.c
> -@@ -332,3 +332,78 @@ static void __init ubnt_uap_pro_setup(vo
> +@@ -186,6 +186,19 @@ static struct gpio_led ubnt_unifi_outdoo
> + 	}
> + };
> +
> ++static struct gpio_led ubnt_unifi_outdoor_plus_leds_gpio[] __initdata = {
> ++	{
> ++		.name		= "ubnt:white:front",
> ++		.gpio		= 1,
> ++		.active_low	= 0,
> ++	}, {
> ++		.name		= "ubnt:blue:front",
> ++		.gpio		= 0,
> ++		.active_low	= 0,
> ++	}
> ++};
> ++
> ++
> + static void __init ubnt_unifi_setup(void)
> + {
> + 	u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);
> +@@ -245,6 +258,38 @@ MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDO
> + 	     "Ubiquiti UniFiAP Outdoor",
> + 	     ubnt_unifi_outdoor_setup);
> +
> ++
> ++static void __init ubnt_unifi_outdoor_plus_setup(void)
> ++{
> ++	u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
> ++	u8 *mac2 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
> ++	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
> ++
> ++	ath79_register_m25p80(NULL);
> ++
> ++	ath79_register_mdio(0, ~(UBNT_UNIFIOD_PRI_PHYMASK |
> ++				 UBNT_UNIFIOD_2ND_PHYMASK));
> ++
> ++	ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
> ++	ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0);
> ++	ath79_register_eth(0);
> ++	ath79_register_eth(1);
> ++
> ++	ap91_pci_init(ee, NULL);
> ++
> ++	ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifi_outdoor_plus_leds_gpio),
> ++				 ubnt_unifi_outdoor_plus_leds_gpio);
> ++
> ++	ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
> ++                                        ARRAY_SIZE(ubnt_xm_gpio_keys),
> ++                                        ubnt_xm_gpio_keys);
> ++}
> ++
> ++MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, "UBNT-UOP",
> ++	     "Ubiquiti UniFiAP Outdoor+",
> ++	     ubnt_unifi_outdoor_plus_setup);
> ++
> ++
> + static struct gpio_led ubnt_uap_pro_gpio_leds[] __initdata = {
> + 	{
> + 		.name		= "ubnt:white:dome",
> +@@ -332,3 +377,78 @@ static void __init ubnt_uap_pro_setup(vo
>    MIPS_MACHINE(ATH79_MACH_UBNT_UAP_PRO, "UAP-PRO", "Ubiquiti UniFi AP Pro",
>    	     ubnt_uap_pro_setup);
>
Matthias Schiffer March 11, 2015, 10:46 a.m. UTC | #5
No, unfortunately, the WLAN problem still exists.

My patch made OpenWrt generate images which can be flashed the usual way
from the stock firmware. In addition, it added support to the OpenWrt
kernel and userspace, so that
- the device is identified correctly in /proc/cpuinfo and /tmp/sysinfo
- LEDs work correctly
- sysupgrade works

I can't really say much about the WLAN problem. I have a test device
here, but I currently don't have much spare time for extensive
experiments (and if it is a WLAN driver issue, I probably can't help much).

Regards,
Matthias


On 03/11/2015 09:54 AM, Shvedov Yury wrote:
> Hi,
> 
> does your patch fix this problem:
> https://lists.openwrt.org/pipermail/openwrt-devel/2014-September/028103.html
> ?
> As I checked, it doesn't, so what exactly your patch do? Does it only
> make the leds to work properly?
> 
> Kind regards
> Yury Shvedov
> 
> On 12/30/2014 06:01 AM, Matthias Schiffer wrote:
>> Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
>> ---
>>   target/linux/ar71xx/base-files/etc/diag.sh         |  3 ++
>>   target/linux/ar71xx/base-files/lib/ar71xx.sh       |  3 ++
>>   .../ar71xx/base-files/lib/upgrade/platform.sh      |  2 +
>>   target/linux/ar71xx/image/Makefile                 |  3 +-
>>   .../610-MIPS-ath79-openwrt-machines.patch          |  3 +-
>>   .../patches-3.14/616-MIPS-ath79-ubnt-xw.patch      | 61
>> +++++++++++++++++++++-
>>   6 files changed, 72 insertions(+), 3 deletions(-)
>>
>> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
>> b/target/linux/ar71xx/base-files/etc/diag.sh
>> index 06b96a3..30e4aeb 100755
>> --- a/target/linux/ar71xx/base-files/etc/diag.sh
>> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
>> @@ -254,6 +254,9 @@ get_status_led() {
>>       uap-pro)
>>           status_led="ubnt:white:dome"
>>           ;;
>> +    unifi-outdoor-plus)
>> +        status_led="ubnt:white:front"
>> +        ;;
>>       airgateway)
>>           status_led="ubnt:white:status"
>>           ;;
>> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> index 9b056e9..a12101a 100755
>> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> @@ -732,6 +732,9 @@ ar71xx_board_detect() {
>>       *"UniFiAP Outdoor")
>>           name="unifi-outdoor"
>>           ;;
>> +    *"UniFiAP Outdoor+")
>> +        name="unifi-outdoor-plus"
>> +        ;;
>>       *WP543)
>>           name="wp543"
>>           ;;
>> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> index 6dabf4e..2752729 100755
>> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> @@ -368,6 +368,7 @@ platform_check_image() {
>>           return 1
>>           ;;
>>   +    unifi-outdoor-plus | \
>>       uap-pro)
>>           [ "$magic_long" != "19852003" ] && {
>>               echo "Invalid image type."
>> @@ -483,6 +484,7 @@ platform_do_upgrade() {
>>       om5p)
>>           platform_do_upgrade_openmesh "$ARGV"
>>           ;;
>> +    unifi-outdoor-plus | \
>>       uap-pro)
>>           MTD_CONFIG_ARGS="-s 0x180000"
>>           default_do_upgrade "$ARGV"
>> diff --git a/target/linux/ar71xx/image/Makefile
>> b/target/linux/ar71xx/image/Makefile
>> index 18c9637..3eb2f07 100644
>> --- a/target/linux/ar71xx/image/Makefile
>> +++ b/target/linux/ar71xx/image/Makefile
>> @@ -1333,6 +1333,7 @@ $(eval $(call
>> SingleProfile,TPLINK-LZMA,64kraw,SMART-300,smart-300,SMART-300,tty
>>   $(eval $(call
>> SingleProfile,TPLINK-LZMA,64kraw,OOLITE,oolite,GS-OOLITE,ttyATH0,115200,0x3C000101,1,16Mlzma))
>>
>>     $(eval $(call
>> SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x))
>>
>> +$(eval $(call
>> SingleProfile,UAPPRO,64k,UBNTUNIFIOUTDOORPLUS,ubnt-unifi-outdoor-plus,UBNT-UOP,ttyS0,115200,BZ,BZ,ar7240))
>>
>>     $(eval $(call
>> SingleProfile,UBDEV,64kraw,UBDEV01,ubdev01,UBNT-UF,ttyS0,115200,XM,XM,ar7240))
>>
>>   @@ -1396,7 +1397,7 @@ $(eval $(call MultiProfile,TLWR941,TLWR941NV2
>> TLWR941NV3 TLWR941NV4 TLWR941NV6))
>>   $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2))
>>   $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1
>> TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1))
>>   $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
>> -$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO
>> UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW
>> UBNTUNIFI UBNTUNIFIOUTDOOR UAPPRO UBNTAIRGW))
>> +$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO
>> UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW
>> UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW))
>>   $(eval $(call MultiProfile,WNDR3700,WNDR3700V1 WNDR3700V2 WNDR3800
>> WNDR3800CH WNDRMAC WNDRMACV2))
>>   $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
>>   $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))
>> diff --git
>> a/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
>> b/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
>> index 4ce9268..b01c5de 100644
>> ---
>> a/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
>> +++
>> b/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
>> @@ -1,6 +1,6 @@
>>   --- a/arch/mips/ath79/machtypes.h
>>   +++ b/arch/mips/ath79/machtypes.h
>> -@@ -16,22 +16,145 @@
>> +@@ -16,22 +16,146 @@
>>       enum ath79_mach_type {
>>        ATH79_MACH_GENERIC = 0,
>> @@ -119,6 +119,7 @@
>>        ATH79_MACH_UBNT_UAP_PRO,    /* Ubiquiti UniFi AP Pro */
>>        ATH79_MACH_UBNT_UNIFI,         /* Ubiquiti Unifi */
>>        ATH79_MACH_UBNT_UNIFI_OUTDOOR,    /* Ubiquiti UnifiAP Outdoor */
>> ++    ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, /* Ubiquiti UnifiAP Outdoor+ */
>>        ATH79_MACH_UBNT_XM,        /* Ubiquiti Networks XM board rev
>> 1.0 */
>>   +    ATH79_MACH_WHR_G301N,        /* Buffalo WHR-G301N */
>>   +    ATH79_MACH_WHR_HP_G300N,    /* Buffalo WHR-HP-G300N */
>> diff --git
>> a/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
>> b/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
>> index 3675518..8e16697 100644
>> --- a/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
>> +++ b/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
>> @@ -1,6 +1,65 @@
>>   --- a/arch/mips/ath79/mach-ubnt-xm.c
>>   +++ b/arch/mips/ath79/mach-ubnt-xm.c
>> -@@ -332,3 +332,78 @@ static void __init ubnt_uap_pro_setup(vo
>> +@@ -186,6 +186,19 @@ static struct gpio_led ubnt_unifi_outdoo
>> +     }
>> + };
>> +
>> ++static struct gpio_led ubnt_unifi_outdoor_plus_leds_gpio[]
>> __initdata = {
>> ++    {
>> ++        .name        = "ubnt:white:front",
>> ++        .gpio        = 1,
>> ++        .active_low    = 0,
>> ++    }, {
>> ++        .name        = "ubnt:blue:front",
>> ++        .gpio        = 0,
>> ++        .active_low    = 0,
>> ++    }
>> ++};
>> ++
>> ++
>> + static void __init ubnt_unifi_setup(void)
>> + {
>> +     u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);
>> +@@ -245,6 +258,38 @@ MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDO
>> +          "Ubiquiti UniFiAP Outdoor",
>> +          ubnt_unifi_outdoor_setup);
>> +
>> ++
>> ++static void __init ubnt_unifi_outdoor_plus_setup(void)
>> ++{
>> ++    u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
>> ++    u8 *mac2 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
>> ++    u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
>> ++
>> ++    ath79_register_m25p80(NULL);
>> ++
>> ++    ath79_register_mdio(0, ~(UBNT_UNIFIOD_PRI_PHYMASK |
>> ++                 UBNT_UNIFIOD_2ND_PHYMASK));
>> ++
>> ++    ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
>> ++    ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0);
>> ++    ath79_register_eth(0);
>> ++    ath79_register_eth(1);
>> ++
>> ++    ap91_pci_init(ee, NULL);
>> ++
>> ++    ath79_register_leds_gpio(-1,
>> ARRAY_SIZE(ubnt_unifi_outdoor_plus_leds_gpio),
>> ++                 ubnt_unifi_outdoor_plus_leds_gpio);
>> ++
>> ++    ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
>> ++                                        ARRAY_SIZE(ubnt_xm_gpio_keys),
>> ++                                        ubnt_xm_gpio_keys);
>> ++}
>> ++
>> ++MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, "UBNT-UOP",
>> ++         "Ubiquiti UniFiAP Outdoor+",
>> ++         ubnt_unifi_outdoor_plus_setup);
>> ++
>> ++
>> + static struct gpio_led ubnt_uap_pro_gpio_leds[] __initdata = {
>> +     {
>> +         .name        = "ubnt:white:dome",
>> +@@ -332,3 +377,78 @@ static void __init ubnt_uap_pro_setup(vo
>>    MIPS_MACHINE(ATH79_MACH_UBNT_UAP_PRO, "UAP-PRO", "Ubiquiti UniFi AP
>> Pro",
>>             ubnt_uap_pro_setup);
>>    
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Shvedov Yury March 11, 2015, 2:14 p.m. UTC | #6
Thank you for your answer. We will try to solve this issue with our own 
forces.

Kind regards
Yury Shvedov

On 03/11/2015 01:46 PM, Matthias Schiffer wrote:
> No, unfortunately, the WLAN problem still exists.
>
> My patch made OpenWrt generate images which can be flashed the usual way
> from the stock firmware. In addition, it added support to the OpenWrt
> kernel and userspace, so that
> - the device is identified correctly in /proc/cpuinfo and /tmp/sysinfo
> - LEDs work correctly
> - sysupgrade works
>
> I can't really say much about the WLAN problem. I have a test device
> here, but I currently don't have much spare time for extensive
> experiments (and if it is a WLAN driver issue, I probably can't help much).
>
> Regards,
> Matthias
>
>
> On 03/11/2015 09:54 AM, Shvedov Yury wrote:
>> Hi,
>>
>> does your patch fix this problem:
>> https://lists.openwrt.org/pipermail/openwrt-devel/2014-September/028103.html
>> ?
>> As I checked, it doesn't, so what exactly your patch do? Does it only
>> make the leds to work properly?
>>
>> Kind regards
>> Yury Shvedov
>>
>> On 12/30/2014 06:01 AM, Matthias Schiffer wrote:
>>> Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
>>> ---
>>>    target/linux/ar71xx/base-files/etc/diag.sh         |  3 ++
>>>    target/linux/ar71xx/base-files/lib/ar71xx.sh       |  3 ++
>>>    .../ar71xx/base-files/lib/upgrade/platform.sh      |  2 +
>>>    target/linux/ar71xx/image/Makefile                 |  3 +-
>>>    .../610-MIPS-ath79-openwrt-machines.patch          |  3 +-
>>>    .../patches-3.14/616-MIPS-ath79-ubnt-xw.patch      | 61
>>> +++++++++++++++++++++-
>>>    6 files changed, 72 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
>>> b/target/linux/ar71xx/base-files/etc/diag.sh
>>> index 06b96a3..30e4aeb 100755
>>> --- a/target/linux/ar71xx/base-files/etc/diag.sh
>>> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
>>> @@ -254,6 +254,9 @@ get_status_led() {
>>>        uap-pro)
>>>            status_led="ubnt:white:dome"
>>>            ;;
>>> +    unifi-outdoor-plus)
>>> +        status_led="ubnt:white:front"
>>> +        ;;
>>>        airgateway)
>>>            status_led="ubnt:white:status"
>>>            ;;
>>> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>> index 9b056e9..a12101a 100755
>>> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>> @@ -732,6 +732,9 @@ ar71xx_board_detect() {
>>>        *"UniFiAP Outdoor")
>>>            name="unifi-outdoor"
>>>            ;;
>>> +    *"UniFiAP Outdoor+")
>>> +        name="unifi-outdoor-plus"
>>> +        ;;
>>>        *WP543)
>>>            name="wp543"
>>>            ;;
>>> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>>> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>>> index 6dabf4e..2752729 100755
>>> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>>> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>>> @@ -368,6 +368,7 @@ platform_check_image() {
>>>            return 1
>>>            ;;
>>>    +    unifi-outdoor-plus | \
>>>        uap-pro)
>>>            [ "$magic_long" != "19852003" ] && {
>>>                echo "Invalid image type."
>>> @@ -483,6 +484,7 @@ platform_do_upgrade() {
>>>        om5p)
>>>            platform_do_upgrade_openmesh "$ARGV"
>>>            ;;
>>> +    unifi-outdoor-plus | \
>>>        uap-pro)
>>>            MTD_CONFIG_ARGS="-s 0x180000"
>>>            default_do_upgrade "$ARGV"
>>> diff --git a/target/linux/ar71xx/image/Makefile
>>> b/target/linux/ar71xx/image/Makefile
>>> index 18c9637..3eb2f07 100644
>>> --- a/target/linux/ar71xx/image/Makefile
>>> +++ b/target/linux/ar71xx/image/Makefile
>>> @@ -1333,6 +1333,7 @@ $(eval $(call
>>> SingleProfile,TPLINK-LZMA,64kraw,SMART-300,smart-300,SMART-300,tty
>>>    $(eval $(call
>>> SingleProfile,TPLINK-LZMA,64kraw,OOLITE,oolite,GS-OOLITE,ttyATH0,115200,0x3C000101,1,16Mlzma))
>>>
>>>      $(eval $(call
>>> SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x))
>>>
>>> +$(eval $(call
>>> SingleProfile,UAPPRO,64k,UBNTUNIFIOUTDOORPLUS,ubnt-unifi-outdoor-plus,UBNT-UOP,ttyS0,115200,BZ,BZ,ar7240))
>>>
>>>      $(eval $(call
>>> SingleProfile,UBDEV,64kraw,UBDEV01,ubdev01,UBNT-UF,ttyS0,115200,XM,XM,ar7240))
>>>
>>>    @@ -1396,7 +1397,7 @@ $(eval $(call MultiProfile,TLWR941,TLWR941NV2
>>> TLWR941NV3 TLWR941NV4 TLWR941NV6))
>>>    $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2))
>>>    $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1
>>> TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1))
>>>    $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
>>> -$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO
>>> UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW
>>> UBNTUNIFI UBNTUNIFIOUTDOOR UAPPRO UBNTAIRGW))
>>> +$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO
>>> UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW
>>> UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW))
>>>    $(eval $(call MultiProfile,WNDR3700,WNDR3700V1 WNDR3700V2 WNDR3800
>>> WNDR3800CH WNDRMAC WNDRMACV2))
>>>    $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
>>>    $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))
>>> diff --git
>>> a/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
>>> b/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
>>> index 4ce9268..b01c5de 100644
>>> ---
>>> a/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
>>> +++
>>> b/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
>>> @@ -1,6 +1,6 @@
>>>    --- a/arch/mips/ath79/machtypes.h
>>>    +++ b/arch/mips/ath79/machtypes.h
>>> -@@ -16,22 +16,145 @@
>>> +@@ -16,22 +16,146 @@
>>>        enum ath79_mach_type {
>>>         ATH79_MACH_GENERIC = 0,
>>> @@ -119,6 +119,7 @@
>>>         ATH79_MACH_UBNT_UAP_PRO,    /* Ubiquiti UniFi AP Pro */
>>>         ATH79_MACH_UBNT_UNIFI,         /* Ubiquiti Unifi */
>>>         ATH79_MACH_UBNT_UNIFI_OUTDOOR,    /* Ubiquiti UnifiAP Outdoor */
>>> ++    ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, /* Ubiquiti UnifiAP Outdoor+ */
>>>         ATH79_MACH_UBNT_XM,        /* Ubiquiti Networks XM board rev
>>> 1.0 */
>>>    +    ATH79_MACH_WHR_G301N,        /* Buffalo WHR-G301N */
>>>    +    ATH79_MACH_WHR_HP_G300N,    /* Buffalo WHR-HP-G300N */
>>> diff --git
>>> a/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
>>> b/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
>>> index 3675518..8e16697 100644
>>> --- a/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
>>> +++ b/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
>>> @@ -1,6 +1,65 @@
>>>    --- a/arch/mips/ath79/mach-ubnt-xm.c
>>>    +++ b/arch/mips/ath79/mach-ubnt-xm.c
>>> -@@ -332,3 +332,78 @@ static void __init ubnt_uap_pro_setup(vo
>>> +@@ -186,6 +186,19 @@ static struct gpio_led ubnt_unifi_outdoo
>>> +     }
>>> + };
>>> +
>>> ++static struct gpio_led ubnt_unifi_outdoor_plus_leds_gpio[]
>>> __initdata = {
>>> ++    {
>>> ++        .name        = "ubnt:white:front",
>>> ++        .gpio        = 1,
>>> ++        .active_low    = 0,
>>> ++    }, {
>>> ++        .name        = "ubnt:blue:front",
>>> ++        .gpio        = 0,
>>> ++        .active_low    = 0,
>>> ++    }
>>> ++};
>>> ++
>>> ++
>>> + static void __init ubnt_unifi_setup(void)
>>> + {
>>> +     u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);
>>> +@@ -245,6 +258,38 @@ MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDO
>>> +          "Ubiquiti UniFiAP Outdoor",
>>> +          ubnt_unifi_outdoor_setup);
>>> +
>>> ++
>>> ++static void __init ubnt_unifi_outdoor_plus_setup(void)
>>> ++{
>>> ++    u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
>>> ++    u8 *mac2 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
>>> ++    u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
>>> ++
>>> ++    ath79_register_m25p80(NULL);
>>> ++
>>> ++    ath79_register_mdio(0, ~(UBNT_UNIFIOD_PRI_PHYMASK |
>>> ++                 UBNT_UNIFIOD_2ND_PHYMASK));
>>> ++
>>> ++    ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
>>> ++    ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0);
>>> ++    ath79_register_eth(0);
>>> ++    ath79_register_eth(1);
>>> ++
>>> ++    ap91_pci_init(ee, NULL);
>>> ++
>>> ++    ath79_register_leds_gpio(-1,
>>> ARRAY_SIZE(ubnt_unifi_outdoor_plus_leds_gpio),
>>> ++                 ubnt_unifi_outdoor_plus_leds_gpio);
>>> ++
>>> ++    ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
>>> ++                                        ARRAY_SIZE(ubnt_xm_gpio_keys),
>>> ++                                        ubnt_xm_gpio_keys);
>>> ++}
>>> ++
>>> ++MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, "UBNT-UOP",
>>> ++         "Ubiquiti UniFiAP Outdoor+",
>>> ++         ubnt_unifi_outdoor_plus_setup);
>>> ++
>>> ++
>>> + static struct gpio_led ubnt_uap_pro_gpio_leds[] __initdata = {
>>> +     {
>>> +         .name        = "ubnt:white:dome",
>>> +@@ -332,3 +377,78 @@ static void __init ubnt_uap_pro_setup(vo
>>>     MIPS_MACHINE(ATH79_MACH_UBNT_UAP_PRO, "UAP-PRO", "Ubiquiti UniFi AP
>>> Pro",
>>>              ubnt_uap_pro_setup);
>>>     
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
Stefan Rompf March 16, 2015, 8:36 p.m. UTC | #7
Hi,

On Mittwoch, 11. März 2015 15:14:21 Shvedov Yury wrote:

> Thank you for your answer. We will try to solve this issue with our own
> forces.

any progress on this? I have one of these access points available right now 
for hacking (as long as I do not brick it). The last hours I made those 
findings:

The libc of UBNT 3.2.7 seems to be compatible to tools of the old kamikaze 
release (http://downloads.openwrt.org/kamikaze/8.09/ar71xx/packages/). So far 
I've tested io for looking at the gpio ports and strace.

It seems that the filter it not statically connected to gpio. By adressing 
AR71XX_GPIO_REG_SET and AR71XX_GPIO_REG_CLEAR, I could switch the blue and 
white leds as expected:

/tmp/io -4  -w 0x18040010 1  # blue off
/tmp/io -4  -w 0x1804000c 2  # white on

Ten GPIO lines seem to be configured as output:

/tmp/io -4 -r 0x18040000
18040000:  00000cff

However, independant of the channel selected the ports are always set to 
0x00081405 (or 0x00081404 or 0x00081406 depending on the LED setting):

BZ.v3.2.7# /tmp/io -4 -r 0x18040004
18040004:  00081405

If anyone has ideas where else to look, please share. Meanwhile let's see what 
I can do with strace ;-)

Stefan
Sergey Ryazanov March 17, 2015, 12:37 a.m. UTC | #8
Hello Stefan,

2015-03-16 23:36 GMT+03:00 Stefan Rompf <stefan@loplof.de>:
> However, independant of the channel selected the ports are always set to
> 0x00081405 (or 0x00081404 or 0x00081406 depending on the LED setting):
>
> BZ.v3.2.7# /tmp/io -4 -r 0x18040004
> 18040004:  00081405
>
> If anyone has ideas where else to look, please share. Meanwhile let's see what
> I can do with strace ;-)
>
If they built SPIoverGPIO or I2CoverGPIO or some other serial bus over
GPIO, then you do not see any changes between channel switches. Or
they could use some non GPIO interface to communicate with external
filter (embedded SPI, I2C or even USB or PCI of SoC).

Possibly, you could see some changes during change. Try check GPIO
pins with oscillograph during channel change.

Or you could put device in continuous scan (e.g. use STA mode and
enter some not available SSID to put device for infinite AP search)
and then read GPIO register state in circle. That trick does not
reveal actual protocol, but shows GPIO lines in use, if any.
Davey Hutchison March 17, 2015, 4:39 a.m. UTC | #9
Hello,

It's probably driven by a GPIO on the radio itself. Possibly monitor
/sys/kernel/debug/ieee80211/phy[0-9]/ath9k/regidx and
/sys/kernel/debug/ieee80211/phy[0-9]/ath9k/regval. Perhaps someone
with a datasheet might be able to tell you which register(s) it
*could* be tied to, then take Sergey's strategy and watch changes to
those registers.

* Just a thought, I could be completely wrong :) *

-- Davey

On Mon, Mar 16, 2015 at 6:37 PM, Sergey Ryazanov <ryazanov.s.a@gmail.com> wrote:
> Hello Stefan,
>
> 2015-03-16 23:36 GMT+03:00 Stefan Rompf <stefan@loplof.de>:
>> However, independant of the channel selected the ports are always set to
>> 0x00081405 (or 0x00081404 or 0x00081406 depending on the LED setting):
>>
>> BZ.v3.2.7# /tmp/io -4 -r 0x18040004
>> 18040004:  00081405
>>
>> If anyone has ideas where else to look, please share. Meanwhile let's see what
>> I can do with strace ;-)
>>
> If they built SPIoverGPIO or I2CoverGPIO or some other serial bus over
> GPIO, then you do not see any changes between channel switches. Or
> they could use some non GPIO interface to communicate with external
> filter (embedded SPI, I2C or even USB or PCI of SoC).
>
> Possibly, you could see some changes during change. Try check GPIO
> pins with oscillograph during channel change.
>
> Or you could put device in continuous scan (e.g. use STA mode and
> enter some not available SSID to put device for infinite AP search)
> and then read GPIO register state in circle. That trick does not
> reveal actual protocol, but shows GPIO lines in use, if any.
>
> --
> Sergey
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Stefan Rompf March 17, 2015, 8:15 p.m. UTC | #10
Hi Sergey,

> If they built SPIoverGPIO or I2CoverGPIO or some other serial bus over
> GPIO, then you do not see any changes between channel switches. Or
> they could use some non GPIO interface to communicate with external
> filter (embedded SPI, I2C or even USB or PCI of SoC).

well, GPIO has been the starting point, but it does not seem to be that easy 
;-) Neither GPIO pins of the CPU nor the wifi chip change their static values 
based on the channel. I haven't yet compiled a tool to poll these memory 
locations fast enough to detect a protocol.

> Possibly, you could see some changes during change. Try check GPIO
> pins with oscillograph during channel change.

Unfortunately opening the case is not an option.

> Or you could put device in continuous scan (e.g. use STA mode and
> enter some not available SSID to put device for infinite AP search)

Interesting enough: When stopping all wifi related software on the device and 
creating a monitor interface, the RF filter seems to follow "iwconfig channel" 
commands (yes it is the madwifi driver). So the magic happens in iwconfig or 
the driver, not in some userspace daemon.

Stefan
Sergey Ryazanov March 17, 2015, 10:24 p.m. UTC | #11
2015-03-17 23:15 GMT+03:00 Stefan Rompf <stefan@loplof.de>:
>> Possibly, you could see some changes during change. Try check GPIO
>> pins with oscillograph during channel change.
>
> Unfortunately opening the case is not an option.
>
You should be a wizard to reveal hw protocol without touching hw :)

>> Or you could put device in continuous scan (e.g. use STA mode and
>> enter some not available SSID to put device for infinite AP search)
>
> Interesting enough: When stopping all wifi related software on the device and
> creating a monitor interface, the RF filter seems to follow "iwconfig channel"
> commands (yes it is the madwifi driver).

How do you realized that RF filter follows "iwconfig channel" command?

> So the magic happens in iwconfig or the driver, not in some userspace
> daemon.

Unlikely that iwconfig changes something directly, I would bet on the driver.
Stefan Rompf March 18, 2015, 6:57 p.m. UTC | #12
On Dienstag, 17. März 2015 23:24:26 Sergey Ryazanov wrote:

> > Interesting enough: When stopping all wifi related software on the device
> > and creating a monitor interface, the RF filter seems to follow
> > "iwconfig channel" commands (yes it is the madwifi driver).
> 
> How do you realized that RF filter follows "iwconfig channel" command?

When I create a monitor interface and change from channel 1 to 13; tcpdump 
really sees channel 13 traffic. When I change back, tcpdump sees traffic from 
channel 1 again. If the filter had not followed, I would have expected the 
device to be as deaf as with current OpenWRT.

Another interesting effect is that the access point is totally non responsable 
for 0.2 seconds after a channel change. This effect multiplies if you create a 
STA interface and do an "iwlist scan". Ping replies get delayed for seconds 
while the wifi is scanning and massively changing channels during the process.

I cannot remember this effect when I used madwifi the last time ages ago. May 
be this is the RF filter code busy waiting somewhere in ath_set_channel() or 
below.

Let's see if it can be found.

Stefan
Stefan Rompf March 21, 2015, 9:16 a.m. UTC | #13
Hi Sergey,

> You should be a wizard to reveal hw protocol without touching hw :)

I cannot say 'Mischief managed!' by now, but it's slowly making progress ;-)

> Unlikely that iwconfig changes something directly, I would bet on the
> driver.

Indeed. So far

-The RF filter is controlled by the GPIO pins on the AR928x wifi chip via some 
kind of serial protocol.
-The functions responsible for the filter are ath_hal_hsr_init(), called once 
on initialisation, ath_hal_hsr_disable() and ath_hal_hsr_enable() on channel 
change. There is an ath_hal_hsr_get_lock_status() that does not seem to be 
used.
-There seems to be no filter tuning after it has been setup on channel change.

Reverse engineering this unreadable MIPS assembly mess will take some time... 
anyone willing to help? Does it make sense to open a ticket to track the issue 
or is this mailing list ok?

Stefan
Sergey Ryazanov March 21, 2015, 9:52 p.m. UTC | #14
2015-03-21 12:16 GMT+03:00 Stefan Rompf <stefan@loplof.de>:
> -The RF filter is controlled by the GPIO pins on the AR928x wifi chip via some
> kind of serial protocol.
> -The functions responsible for the filter are ath_hal_hsr_init(), called once
> on initialisation, ath_hal_hsr_disable() and ath_hal_hsr_enable() on channel
> change. There is an ath_hal_hsr_get_lock_status() that does not seem to be
> used.
> -There seems to be no filter tuning after it has been setup on channel change.
>

Wow, impressive.

> Reverse engineering this unreadable MIPS assembly mess will take some time...
> anyone willing to help?

What kind of help do you need?

> Does it make sense to open a ticket to track the issue
> or is this mailing list ok?
>
Matthias Schiffer May 11, 2015, 5:18 p.m. UTC | #15
On 03/21/2015 10:16 AM, Stefan Rompf wrote:
> Hi Sergey,
> 
>> You should be a wizard to reveal hw protocol without touching hw :)
> 
> I cannot say 'Mischief managed!' by now, but it's slowly making progress ;-)
> 
>> Unlikely that iwconfig changes something directly, I would bet on the
>> driver.
> 
> Indeed. So far
> 
> -The RF filter is controlled by the GPIO pins on the AR928x wifi chip via some 
> kind of serial protocol.
> -The functions responsible for the filter are ath_hal_hsr_init(), called once 
> on initialisation, ath_hal_hsr_disable() and ath_hal_hsr_enable() on channel 
> change. There is an ath_hal_hsr_get_lock_status() that does not seem to be 
> used.
> -There seems to be no filter tuning after it has been setup on channel change.
> 
> Reverse engineering this unreadable MIPS assembly mess will take some time... 
> anyone willing to help? Does it make sense to open a ticket to track the issue 
> or is this mailing list ok?
> 
> Stefan

Any news here? I know a lot of people who are eager to run OpenWrt on
their UAP Outdoor+ ...

If you don't have time to do further work on this, I'd be glad to
continue where you left off. Have you found out anything substantial
that might help?

Regards,
Matthias
Stefan Rompf May 17, 2015, 6:20 p.m. UTC | #16
Hi Matthias,

> Any news here? I know a lot of people who are eager to run OpenWrt on
> their UAP Outdoor+ ...

oh well so nearly two months have passed....

I must admit no news. I am/was planning to run the code in ARMSim to analyze 
what is sent to the filter and from where.

Still want to do this, may be we can work in parallel.

Stefan
Kirill Berezin May 19, 2015, 1:15 p.m. UTC | #17
Hello,

I succeed to recover a disable command (I followed tips from the 
Stefan's post).
A simple user space configuration utility is in the attachment. Compile 
it then run the following before a setup of an interface

./hsr 98

What'll be available : scan shows channels 1 and 11; clients on channels 
1 and 11 can connect and transmit data; n mode works.

I think that they tune an external receiver via some sort of SPI bus 
(GPIO pins are 5,6,7,8). Write procedure is quite simple, but I can't 
still get how enable works (for sure it sends a disable); it is quite 
possible that we need to read from a device before sending a command.


Kirill.

P.S. Sorry for duplicate from the different address.
diff mbox

Patch

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 06b96a3..30e4aeb 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -254,6 +254,9 @@  get_status_led() {
 	uap-pro)
 		status_led="ubnt:white:dome"
 		;;
+	unifi-outdoor-plus)
+		status_led="ubnt:white:front"
+		;;
 	airgateway)
 		status_led="ubnt:white:status"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 9b056e9..a12101a 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -732,6 +732,9 @@  ar71xx_board_detect() {
 	*"UniFiAP Outdoor")
 		name="unifi-outdoor"
 		;;
+	*"UniFiAP Outdoor+")
+		name="unifi-outdoor-plus"
+		;;
 	*WP543)
 		name="wp543"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 6dabf4e..2752729 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -368,6 +368,7 @@  platform_check_image() {
 		return 1
 		;;
 
+	unifi-outdoor-plus | \
 	uap-pro)
 		[ "$magic_long" != "19852003" ] && {
 			echo "Invalid image type."
@@ -483,6 +484,7 @@  platform_do_upgrade() {
 	om5p)
 		platform_do_upgrade_openmesh "$ARGV"
 		;;
+	unifi-outdoor-plus | \
 	uap-pro)
 		MTD_CONFIG_ARGS="-s 0x180000"
 		default_do_upgrade "$ARGV"
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 18c9637..3eb2f07 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1333,6 +1333,7 @@  $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,SMART-300,smart-300,SMART-300,tty
 $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,OOLITE,oolite,GS-OOLITE,ttyATH0,115200,0x3C000101,1,16Mlzma))
 
 $(eval $(call SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x))
+$(eval $(call SingleProfile,UAPPRO,64k,UBNTUNIFIOUTDOORPLUS,ubnt-unifi-outdoor-plus,UBNT-UOP,ttyS0,115200,BZ,BZ,ar7240))
 
 $(eval $(call SingleProfile,UBDEV,64kraw,UBDEV01,ubdev01,UBNT-UF,ttyS0,115200,XM,XM,ar7240))
 
@@ -1396,7 +1397,7 @@  $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4 TLWR941NV6))
 $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2))
 $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1))
 $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
-$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UAPPRO UBNTAIRGW))
+$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW))
 $(eval $(call MultiProfile,WNDR3700,WNDR3700V1 WNDR3700V2 WNDR3800 WNDR3800CH WNDRMAC WNDRMACV2))
 $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
 $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))
diff --git a/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
index 4ce9268..b01c5de 100644
--- a/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
+++ b/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
@@ -1,6 +1,6 @@ 
 --- a/arch/mips/ath79/machtypes.h
 +++ b/arch/mips/ath79/machtypes.h
-@@ -16,22 +16,145 @@
+@@ -16,22 +16,146 @@
  
  enum ath79_mach_type {
  	ATH79_MACH_GENERIC = 0,
@@ -119,6 +119,7 @@ 
  	ATH79_MACH_UBNT_UAP_PRO,	/* Ubiquiti UniFi AP Pro */
  	ATH79_MACH_UBNT_UNIFI, 		/* Ubiquiti Unifi */
  	ATH79_MACH_UBNT_UNIFI_OUTDOOR,	/* Ubiquiti UnifiAP Outdoor */
++	ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, /* Ubiquiti UnifiAP Outdoor+ */
  	ATH79_MACH_UBNT_XM,		/* Ubiquiti Networks XM board rev 1.0 */
 +	ATH79_MACH_WHR_G301N,		/* Buffalo WHR-G301N */
 +	ATH79_MACH_WHR_HP_G300N,	/* Buffalo WHR-HP-G300N */
diff --git a/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch b/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
index 3675518..8e16697 100644
--- a/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
+++ b/target/linux/ar71xx/patches-3.14/616-MIPS-ath79-ubnt-xw.patch
@@ -1,6 +1,65 @@ 
 --- a/arch/mips/ath79/mach-ubnt-xm.c
 +++ b/arch/mips/ath79/mach-ubnt-xm.c
-@@ -332,3 +332,78 @@ static void __init ubnt_uap_pro_setup(vo
+@@ -186,6 +186,19 @@ static struct gpio_led ubnt_unifi_outdoo
+ 	}
+ };
+ 
++static struct gpio_led ubnt_unifi_outdoor_plus_leds_gpio[] __initdata = {
++	{
++		.name		= "ubnt:white:front",
++		.gpio		= 1,
++		.active_low	= 0,
++	}, {
++		.name		= "ubnt:blue:front",
++		.gpio		= 0,
++		.active_low	= 0,
++	}
++};
++
++
+ static void __init ubnt_unifi_setup(void)
+ {
+ 	u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);
+@@ -245,6 +258,38 @@ MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDO
+ 	     "Ubiquiti UniFiAP Outdoor",
+ 	     ubnt_unifi_outdoor_setup);
+ 
++
++static void __init ubnt_unifi_outdoor_plus_setup(void)
++{
++	u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
++	u8 *mac2 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
++	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_mdio(0, ~(UBNT_UNIFIOD_PRI_PHYMASK |
++				 UBNT_UNIFIOD_2ND_PHYMASK));
++
++	ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
++	ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0);
++	ath79_register_eth(0);
++	ath79_register_eth(1);
++
++	ap91_pci_init(ee, NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifi_outdoor_plus_leds_gpio),
++				 ubnt_unifi_outdoor_plus_leds_gpio);
++
++	ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
++                                        ARRAY_SIZE(ubnt_xm_gpio_keys),
++                                        ubnt_xm_gpio_keys);
++}
++
++MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, "UBNT-UOP",
++	     "Ubiquiti UniFiAP Outdoor+",
++	     ubnt_unifi_outdoor_plus_setup);
++
++
+ static struct gpio_led ubnt_uap_pro_gpio_leds[] __initdata = {
+ 	{
+ 		.name		= "ubnt:white:dome",
+@@ -332,3 +377,78 @@ static void __init ubnt_uap_pro_setup(vo
  MIPS_MACHINE(ATH79_MACH_UBNT_UAP_PRO, "UAP-PRO", "Ubiquiti UniFi AP Pro",
  	     ubnt_uap_pro_setup);