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

2015-05-27 Thread Kirill Berezin

Hi,

Well, this was my bad )) I accidentally chose cpu's gpio and realised 
that this is a mistake yesterday night.


So I made a patch for atheros driver and it works. A signal level on 
different frequencies is more or less equal and seems adequate (about 
-30 dbm if a client within a meter from ap).


The patch for bb 14.07 is in the attachment. It should be placed in 
package/kernel/mac80211/patches . The code generates a lot of messages, 
so it'll be easy to track what happens.



Kirill

On 05/26/2015 11:25 PM, Stefan Rompf wrote:


Until I found that I was accessing GPIO lines of the CPU (cat
/sys/devices/virtual/gpio/gpiochip0/label = ath79), not of the 928x wifi
chip. It seems that ath9k does not even export its pins to the GPIO subsystem.

Stefan



diff -urN old/drivers/net/wireless/ath/ath9k/hsr.c new/drivers/net/wireless/ath/ath9k/hsr.c
--- old/drivers/net/wireless/ath/ath9k/hsr.c	1970-01-01 03:00:00.0 +0300
+++ new/drivers/net/wireless/ath/ath9k/hsr.c	2015-05-27 12:47:43.0 +0300
@@ -0,0 +1,236 @@
+/*
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 Kirill Berezin
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the Software), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include linux/io.h
+#include linux/slab.h
+#include linux/module.h
+#include linux/time.h
+#include linux/bitops.h
+#include linux/etherdevice.h
+#include asm/unaligned.h
+
+#include hw.h
+#include hw-ops.h
+#include ar9003_mac.h
+#include ar9003_mci.h
+#include ar9003_phy.h
+#include ath9k.h
+
+#include hsr.h
+
+void hsr_init(struct ath_hw* ah) {
+
+	if ( NULL == ah) {
+		return;
+	}
+
+	ath9k_hw_cfg_gpio_input(ah, HSR_GPIO_DIN);
+	ath9k_hw_cfg_output(ah, HSR_GPIO_CSN, AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
+	ath9k_hw_cfg_output(ah, HSR_GPIO_CLK, AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
+	ath9k_hw_cfg_output(ah, HSR_GPIO_DOUT, AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
+
+	ath9k_hw_set_gpio(ah, HSR_GPIO_CSN, 1);
+	ath9k_hw_set_gpio(ah, HSR_GPIO_CLK, 0);
+	ath9k_hw_set_gpio(ah, HSR_GPIO_DOUT, 0);
+
+	udelay(HSR_DELAY_TRAILING);
+
+	printk(KERN_NOTICE hsr_init: done);
+
+}
+EXPORT_SYMBOL(hsr_init);
+
+static u32 hsr_write_byte(struct ath_hw* ah, int delay, u32 value){
+	int i;
+	u32 rval = 0;
+
+	udelay(delay);
+
+	ath9k_hw_set_gpio(ah, HSR_GPIO_CLK, 0);
+	udelay(HSR_DELAY_HALF_TICK);
+
+	ath9k_hw_set_gpio(ah, HSR_GPIO_CSN, 0);
+	udelay(HSR_DELAY_HALF_TICK);
+
+	for( i = 0; i  8; ++i) {
+		rval = rval  1;
+
+		// pattern is left to right, that is 7-th bit runs first
+		ath9k_hw_set_gpio(ah, HSR_GPIO_DOUT, (value  (7 - i))  0x1);
+		udelay(HSR_DELAY_HALF_TICK);
+
+		ath9k_hw_set_gpio(ah, HSR_GPIO_CLK, 1);
+		udelay(HSR_DELAY_HALF_TICK);
+
+		rval |= ath9k_hw_gpio_get(ah, HSR_GPIO_DIN);
+
+		ath9k_hw_set_gpio(ah, HSR_GPIO_CLK, 0);
+		udelay(HSR_DELAY_HALF_TICK);
+	}
+
+	ath9k_hw_set_gpio(ah, HSR_GPIO_CSN, 1);
+	udelay(HSR_DELAY_HALF_TICK);
+
+printk(KERN_NOTICE hsr_write_byte: write byte %d return value is %x %d %c \n, value, rval, rval, rval  32 ? rval : '-');
+   
+	return rval  0xff;
+}
+
+static int hsr_write_a_chain(struct ath_hw* ah, char* chain, int items) {
+	int i = 0, j;
+	int status = 0;
+	int loops = 0;
+	// a preabmle
+	hsr_write_byte(ah, HSR_DELAY_PRE_WRITE, 0);
+
+	status = hsr_write_byte(ah, HSR_DELAY_PRE_WRITE, 0);
+
+	if ( status) {
+		int loop = 2;
+		++ loops;
+		if ( loops  42) {
+printk(KERN_NOTICE hsr_write_a_chain: too many loops in preamble. giving up.\n);
+			return 0;
+		}
+		do {
+			status = hsr_write_byte(ah, HSR_DELAY_PRE_WRITE, 0);
+			loop = (loop + 1)  0x;
+			if ( loop  2) {
+continue;
+			} 
+		} while(status);
+	}
+
+for ( i =0; (i  items)  ( 0 != chain[i]); ++i) {
+		hsr_write_byte(ah, HSR_DELAY_PRE_WRITE, (u32)chain[i]);
+	}
+	hsr_write_byte(ah, HSR_DELAY_PRE_WRITE, 0);  
+	udelay(HSR_DELAY_FINAL);
+
+	memset(chain, 0, items);
+
+	for ( j = 0, i = 0; (i  7)  (j  (items - 1)) ; ++i) { 
+		u32 ret;
+		if ( 31  (ret = hsr_write_byte(ah, 

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

2015-05-26 Thread Stefan Rompf
Hi Kirill,

 Updated version is in the attachment. I tried it on a real device, but I
 can't say that the problem was solved, but something is definitely happens.

which OpenWrt image did you use? I flashed openwrt-15.05-rc1-ar71xx-generic-
ubnt-unifi-outdoor-plus-squashfs-factory.bin and did not get any response from 
the hsr using your tool.

Until I found that I was accessing GPIO lines of the CPU (cat 
/sys/devices/virtual/gpio/gpiochip0/label = ath79), not of the 928x wifi 
chip. It seems that ath9k does not even export its pins to the GPIO subsystem.

Stefan
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-05-26 Thread Stefan Rompf
Hi,

 It seems that ath9k does not even export its pins to the GPIO
 subsystem.

ok, here we go. For the brave ones who know their pci wifi chip is at 
0x1000 and don't mind bit banging io registers.

Surely still all usleep() timers wrong and full of unknown side effects.

But tunes the hsr on my device.

Stefan
#include stdlib.h
#include stdio.h
#include errno.h
#include stdint.h
#include string.h
#include unistd.h
#include sys/types.h
#include sys/stat.h
#include sys/mman.h
#include fcntl.h

// High Selectivity Receiver?? Huh ...

int mem_fd;
char *mem_page;
unsigned int *mem_gpio;


#define HSR_CSR 8
#define HSR_OUT 7
#define HSR_CLK 6
#define HSR_IN 5

int create_dev() {
  unsigned int *mem_dir;
  unsigned int dir_val;

  mem_fd = open(/dev/mem, O_RDWR);
  if (mem_fd == -1) return -1;

  mem_page = mmap(NULL, 4096, PROT_READ | PROT_WRITE, 
		  MAP_SHARED, mem_fd, 0x10004000);
  if (!mem_page) return -1;

  mem_gpio = (unsigned int *)(mem_page[0x48]);

  /* Setup direction */
  mem_dir = (unsigned int *)(mem_page[0x4c]);
  dir_val = *mem_dir | (3HSR_CSR*2) | (3HSR_OUT*2) | (3HSR_CLK*2);
  dir_val = ~(3HSR_IN*2);
  printf(%08x %08x\n, *mem_dir, dir_val);
  if (*mem_dir != dir_val) {
*mem_dir = dir_val;
  }
}


#define GPIO_SETBIT(x) do { *mem_gpio |= 1x ; __sync_synchronize(); } while(0)
#define GPIO_CLRBIT(x) do { *mem_gpio = ~(1x) ; __sync_synchronize(); } while(0)
#define GPIO_GETBIT(x) (*mem_gpio  (1x))


uint32_t hsr_write_byte(int delay, uint32_t value){
  int i;
  usleep(delay);
  uint32_t rval = 0;

  GPIO_CLRBIT(HSR_CSR);
  usleep(1000);

  for( i = 0; i  8; ++i) {
rval = rval  1;

// pattern is left to right, that is 7-th bit runs first
// (value  (7-i))0x1 will be equal to 
// seb v1,a1 -- mips32r2
// srl v0,v1,0x1f
// sll a1,v1,1 -- next to seb
if ((value  (7 - i))  0x1) {
  GPIO_SETBIT(HSR_OUT);
} else {
  GPIO_CLRBIT(HSR_OUT);
}

usleep(1000);
GPIO_SETBIT(HSR_CLK);

usleep(1000);
rval |= !!GPIO_GETBIT(HSR_IN);
GPIO_CLRBIT(HSR_CLK);

usleep(1000);
  }

  GPIO_SETBIT(HSR_CSR);
  usleep(1);

  printf(write byte %d return value is %x \n, value, rval);
  
  return rval  0xff;
}

void write_a_chain(uint8_t* chain, int items) {
		int i = 0;
int status = 0;
// a preabmle
hsr_write_byte(75, 0); 
status = hsr_write_byte(75, 0);

/*
if ( status) {
  int loop = 2;
  do {
   status = hsr_write_byte(d, 75, 0);
   loop = (loop + 1)  0x;
   if ( loop  2) {
continue;
   } 
  } while(status);
}
*/

for ( i =0; i  items; ++i) {
   	  hsr_write_byte(75, chain[i]);
}

for (i=0; i  6 ; ++i) {
  hsr_write_byte(75, 0);  
}

usleep(15);
}

// known good commands: disable 98

int main(int argc, char** argv) {
  int b = 40, cf = -1;

  if ( argc  2) {
printf(%s: bandwidth [center frequency kHz] \n, argv[0]);
return 1;
  } else if ( argc  3) {
		b = 40; //strtol(argv[1], NULL, 10);
		if ( (b != 10)  (b != 20)  (b != 40)) {
			printf(Incorrect bandwidth : valid values are 10, 20, 40 \n);
			return -1;
		}
		printf(Send a disable command \n);
	} else {
		b = strtol(argv[1], NULL, 10);
		cf = strtol(argv[2], NULL, 10);
		if ( (b != 10)  (b != 20)  (b != 40)) {
			printf(Incorrect bandwidth : valid values are 10, 20, 40 \n);
			return -1;
		}
		printf(Sent central freq %d and a bandwidth %d \n, cf, b);
	}

  if ( -1 != create_dev()) {
		uint8_t chain[10];
		uint8_t v1;

		// write bandwidth
		memset(chain, 0, sizeof(chain));
		chain[0] = 98;
		snprintf((char*)(chain + 1), 3, %02d, b);

		write_a_chain(chain, strlen((char*)chain));

		if ( -1 != cf ) {

			v1 = 120;
			write_a_chain(v1, 1);

			v1 = 109;
			write_a_chain(v1, 1);

			memset(chain, 0, sizeof(chain));
			chain[0] = 102;
			snprintf((char*)(chain + 1), 6, %05d, cf);

			write_a_chain(chain, strlen((char*)chain));
		}

  }

  return 0;
}
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-05-22 Thread Stefan Rompf
Hi,

 Updated version is in the attachment. I tried it on a real device, but I
 can't say that the problem was solved, but something is definitely happens.

related question: After installing OpenWRT on the access point, do you know 
whether I can revert using the instructions from:

https://community.ubnt.com/t5/UniFi-Troubleshooting/UniFi-TFTP-soft-recovery-for-bricked-access-point/ta-p/607605

?

Stefan
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-05-22 Thread David Hutchison
You can revert back to UniFi via TFTP,

I haven't been able to get the reset button on boot to work for UniFi.
I use UART to pull up the boot-loader. Then use urescue to tftp the
UniFi image back on.

-- Davey

On Fri, May 22, 2015 at 1:41 PM, Stefan Rompf ste...@loplof.de wrote:
 Hi,

 Updated version is in the attachment. I tried it on a real device, but I
 can't say that the problem was solved, but something is definitely happens.

 related question: After installing OpenWRT on the access point, do you know
 whether I can revert using the instructions from:

 https://community.ubnt.com/t5/UniFi-Troubleshooting/UniFi-TFTP-soft-recovery-for-bricked-access-point/ta-p/607605

 ?

 Stefan
 ___
 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


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

2015-05-22 Thread Kirill Berezin

Hi,

Updated version is in the attachment. I tried it on a real device, but I 
can't say that the problem was solved, but something is definitely happens.


Unfortunately I couldn't find where a bunch of zeros were generated, so 
I skipped this part ))) (I tried a version with zeros, but no luck).


I also found in the code new commands 115 (lock), 120, 109, and 102. It 
seems that commands 120 and 109 do not require arguments. And I think 
that arguments for commands 98 and 102 are sequences of ascii symbols, 
so the dump you sent can be interpreted as



  2 00 00 00 00 00 00 00 00
  1 00 01 01 00 00 00 01 00  (the 98 disable command) b(andwidth)
  1 00 00 01 01 00 00 01 00  50
  1 00 00 01 01 00 00 00 00  48 - 20
 10 00 00 00 00 00 00 00 00
  1 00 01 01 01 01 00 00 00  120 x
 10 00 00 00 00 00 00 00 00
  1 00 01 01 00 01 01 00 01  109 m
 10 00 00 00 00 00 00 00 00
  1 00 01 01 00 00 01 01 00  102 f(requency)
  1 00 00 01 01 00 00 00 00  48 0
  1 00 00 01 01 00 00 01 00  50 2
  1 00 00 01 01 00 01 00 00  52 4
  1 00 00 01 01 00 00 00 01  49 1
  1 00 00 01 01 00 01 01 01  55 7
  7 00 00 00 00 00 00 00 00
  1 00 00 00 00 00 00 00 00

However 2417 is a center for channel 2, but how knows ...

Kirill.


On 05/21/2015 01:09 AM, Stefan Rompf wrote:

Hi,


-Trapping ar5416GpioSet with some hand crafted assembly code that traces
calls and logs them somewhere


this works. I've trapped ar5416GpioSet, putting my code into space occupied by
the unused function ar5416GpioCfgInput. ar5416GpioGet is work to do. I can
send the code, but it will require adoption to your environment.

Tuning to channel 1 revealed the following commands sent via the SPI protocol
you discovered (first column is number of repetitions).

   2 00 00 00 00 00 00 00 00
   1 00 01 01 00 00 00 01 00  (the 98 disable command)
   1 00 00 01 01 00 00 01 00
   1 00 00 01 01 00 00 00 00
  10 00 00 00 00 00 00 00 00
   1 00 01 01 01 01 00 00 00
  10 00 00 00 00 00 00 00 00
   1 00 01 01 00 01 01 00 01
  10 00 00 00 00 00 00 00 00
   1 00 01 01 00 00 01 01 00
   1 00 00 01 01 00 00 00 00
   1 00 00 01 01 00 00 01 00
   1 00 00 01 01 00 01 00 00
   1 00 00 01 01 00 00 00 01
   1 00 00 01 01 00 01 01 01
   7 00 00 00 00 00 00 00 00
   1 00 00 00 00 00 00 00 00

I'll test repeated tuning, other channels and GpioGet next weekend, it's quite
in the late evening here by now ;-)

Stefan
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel




#include stdlib.h
#include stdio.h
#include errno.h
#include stdint.h
#include string.h
#include unistd.h
#include sys/types.h
#include sys/stat.h
#include fcntl.h

// High Selectivity Receiver?? Huh ...

// device seems to be a SPI bus
typedef struct {
  int csn; // Chip Select, active low 
  int clk;// clock
  int dout;   // data out
  int din;// data in
} hsr_dev_t;

void del_dev(hsr_dev_t* dev) {
  if ( NULL != dev) {
if ( -1 != dev-csn) {
  close(dev-csn);
}
if ( -1 != dev-clk) {
  close(dev-clk);
}
if ( -1 != dev-dout) {
  close(dev-dout);
}
if ( -1 != dev-din) {
  close(dev-din);
}
dev-csn = -1;
dev-clk = -1;
dev-dout = -1;
dev-din = -1;
  }
}

int create_pin(int edesc, int num, char* dir) {
  char cline[1024];
  int ret, ret1, err;
  int pin_flags;

  sprintf(cline, %d, num);
  write(edesc, cline, strlen(cline));

  sprintf(cline, /sys/class/gpio/gpio%d/direction, num);
  ret = open(cline, O_WRONLY);
  if ( -1 == ret) {
printf(Can't create pin #%d : %s\n, num, strerror(errno));
return -1;
  }

  ret1 =  write(ret, dir, strlen(dir));
  err = errno;
  close(ret);

  if ( -1 == ret1) {
printf(Can't configure pin #%d : %s\n, num, strerror(err));
return -1;
  }

  pin_flags = !strcmp(dir, out) ? O_WRONLY : O_RDONLY;
  sprintf(cline, /sys/class/gpio/gpio%d/value, num);

  if ( -1 == (ret = open(cline, pin_flags))) {
return -1;
  }

  return ret;
} 

int create_dev(hsr_dev_t*dev) {
  int ret = 0;
  int gpio_export;

  gpio_export = open(/sys/class/gpio/export, O_WRONLY);
  if ( -1 == gpio_export) {
printf(Can't open export : %s \n, strerror(errno));
return -1;
  }

  if ( -1 == (ret = create_pin(gpio_export, 8, out))) {
goto over;
  }
  dev-csn = ret;

  if ( -1 == (ret = create_pin(gpio_export, 6, out))) {
goto over;
  }
  dev-clk = ret;

  if ( -1 == (ret = create_pin(gpio_export, 7, out))) {
goto over;
  }
  dev-dout = ret;

  if ( -1 == (ret = create_pin(gpio_export, 5, in))) {
goto over;
  }
  dev-din = ret;


over:
  close(gpio_export);

  return ret;
}

int dev_write_value(int desc, uint8_t val) {
  char buf[5];
  sprintf(buf, %d, val%10); 
  int ret = write(desc, buf, strlen(buf));
  //printf(ret %d %s \n, ret, ret  0 ? strerror(errno) :  );
  

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

2015-05-22 Thread Stefan Rompf
Hi Kirill,

 Updated version is in the attachment. I tried it on a real device, but I
 can't say that the problem was solved, but something is definitely happens.
 
 Unfortunately I couldn't find where a bunch of zeros were generated, so
 I skipped this part ))) (I tried a version with zeros, but no luck).

I think the sequence looks like this:

00  00 b20 00  00  00  00  00  00  00  00
00  00 x 00  00  00  00  00  00  00  00
00  00 m 00  00  00  00  00  00  00  00
00  00 f02412 00  00  00  00  00  00  00  00

Two zeros preamble, the command, followed by 8 zeros. I haven't yet checked 
whether something is read while the commands are sent.

Given that issueing a channel change takes noticeable time, you could try 
adding an usleep(15) after the eight zero bytes have been sent. Just 
guessing, maybe hsr.c is simply running too fast.

 I also found in the code new commands 115 (lock), 120, 109, and 102.

Haven't seen 115 in my logs so far...

 However 2417 is a center for channel 2, but how knows ...

Maybe my fault. The very first ifconfig ath0 up after the interface has been 
created with athbox sends multiple sequences switching to different channels, 
ending with the selected channel.

From this point on, a channel change sends one of the sequences above with the 
center frequency of the selected channel.

Stefan
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-05-20 Thread Stefan Rompf
Hi Kirill,

On Dienstag, 19. Mai 2015 15:11:31 Kirill Berezin wrote:

 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.

impressive! How did you succeed?

I've started looking at two possibilities:

-ARMSim
-Trapping ar5416GpioSet with some hand crafted assembly code that traces calls 
and logs them somewhere (maybe an unused module like fuse could provide kernel 
space to scribble the logs ;-) Now that you decoded the init and disable 
sequences it should be possible to find a command in such a log.

Any hints?

Stefan
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-05-20 Thread Stefan Rompf
Hi,

 -Trapping ar5416GpioSet with some hand crafted assembly code that traces
 calls and logs them somewhere

this works. I've trapped ar5416GpioSet, putting my code into space occupied by 
the unused function ar5416GpioCfgInput. ar5416GpioGet is work to do. I can 
send the code, but it will require adoption to your environment.

Tuning to channel 1 revealed the following commands sent via the SPI protocol 
you discovered (first column is number of repetitions).

  2 00 00 00 00 00 00 00 00  
  1 00 01 01 00 00 00 01 00  (the 98 disable command)
  1 00 00 01 01 00 00 01 00  
  1 00 00 01 01 00 00 00 00  
 10 00 00 00 00 00 00 00 00  
  1 00 01 01 01 01 00 00 00  
 10 00 00 00 00 00 00 00 00  
  1 00 01 01 00 01 01 00 01  
 10 00 00 00 00 00 00 00 00  
  1 00 01 01 00 00 01 01 00  
  1 00 00 01 01 00 00 00 00  
  1 00 00 01 01 00 00 01 00  
  1 00 00 01 01 00 01 00 00  
  1 00 00 01 01 00 00 00 01  
  1 00 00 01 01 00 01 01 01  
  7 00 00 00 00 00 00 00 00  
  1 00 00 00 00 00 00 00 00 

I'll test repeated tuning, other channels and GpioGet next weekend, it's quite 
in the late evening here by now ;-)

Stefan
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-05-19 Thread Kirill Berezin



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.
/*
Copyright (c) 2015, Kirill Berezin
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.

*/

#include stdlib.h
#include stdio.h
#include errno.h
#include stdint.h
#include string.h
#include unistd.h
#include sys/types.h
#include sys/stat.h
#include fcntl.h

// High Selectitity Receiver?? Huh ...

// device seems to be a SPI bus
typedef struct {
  int csn; // Chip Select, active low 
  int clk;// clock
  int dout;   // data out
  int din;// data in
} hsr_dev_t;

void del_dev(hsr_dev_t* dev) {
  if ( NULL != dev) {
if ( -1 != dev-csn) {
  close(dev-csn);
}
if ( -1 != dev-clk) {
  close(dev-clk);
}
if ( -1 != dev-dout) {
  close(dev-dout);
}
if ( -1 != dev-din) {
  close(dev-din);
}
dev-csn = -1;
dev-clk = -1;
dev-dout = -1;
dev-din = -1;
  }
}

int create_pin(int edesc, int num, char* dir) {
  char cline[1024];
  int ret, ret1, err;
  int pin_flags;

  sprintf(cline, %d, num);
  write(edesc, cline, strlen(cline));

  sprintf(cline, /sys/class/gpio/gpio%d/direction, num);
  ret = open(cline, O_WRONLY);
  if ( -1 == ret) {
printf(Can't create pin #%d : %s\n, num, strerror(errno));
return -1;
  }

  ret1 =  write(ret, dir, strlen(dir));
  err = errno;
  close(ret);

  if ( -1 == ret1) {
printf(Can't configure pin #%d : %s\n, num, strerror(err));
return -1;
  }

  pin_flags = !strcmp(dir, out) ? O_WRONLY : O_RDONLY;
  sprintf(cline, /sys/class/gpio/gpio%d/value, num);

  if ( -1 == (ret = open(cline, pin_flags))) {
return -1;
  }

  return ret;
} 

int create_dev(hsr_dev_t*dev) {
  int ret = 0;
  int gpio_export;

  gpio_export = open(/sys/class/gpio/export, O_WRONLY);
  if ( -1 == gpio_export) {
printf(Can't open export : %s \n, strerror(errno));
return -1;
  }

  if ( -1 == (ret = create_pin(gpio_export, 8, out))) {
goto over;
  }
  dev-csn = ret;

  if ( -1 == (ret = create_pin(gpio_export, 6, out))) {
goto over;
  }
  dev-clk = ret;

  if ( -1 == (ret = create_pin(gpio_export, 7, out))) {
goto over;
  }
  dev-dout = ret;

  if ( -1 == (ret = create_pin(gpio_export, 5, in))) {
goto over;
  }
  dev-din = ret;


over:
  close(gpio_export);

  return ret;
}

int dev_write_value(int desc, uint8_t val) {
  char buf[5];
  sprintf(buf, %d, val%10); 
  return write(desc, buf, 1);
}

int dev_read_value(int desc) {
  char buf[32];
  long rval;

  if ( -1 == read(desc, buf, 32)) {
printf(can't read a value: %s \n, strerror(errno));
return 1;
  }

  rval = strtol(buf, NULL, 10);

  return (rval = 1) || (rval  0) ? 1 : 0;
}

void hsr_init(hsr_dev_t* dev) {
dev_write_value(dev-dout, 0);
dev_write_value(dev-clk, 0);
dev_write_value(dev-csn, 1);
}

uint32_t hsr_write_byte(hsr_dev_t *dev, int delay, uint32_t value){
  int i;
  usleep(delay);
  uint32_t rval = 0;

  

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

2015-05-17 Thread Stefan Rompf
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
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-05-11 Thread Matthias Schiffer
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



signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-03-21 Thread Stefan Rompf
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
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-03-21 Thread Sergey Ryazanov
2015-03-21 12:16 GMT+03:00 Stefan Rompf ste...@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?


-- 
Sergey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-03-18 Thread Stefan Rompf
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
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-03-17 Thread Sergey Ryazanov
2015-03-17 23:15 GMT+03:00 Stefan Rompf ste...@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.

-- 
Sergey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-03-17 Thread Stefan Rompf
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
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-03-16 Thread Stefan Rompf
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 0x1804
1804:  0cff

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
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-03-16 Thread Sergey Ryazanov
Hello Stefan,

2015-03-16 23:36 GMT+03:00 Stefan Rompf ste...@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


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

2015-03-16 Thread David Hutchison
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@gmail.com wrote:
 Hello Stefan,

 2015-03-16 23:36 GMT+03:00 Stefan Rompf ste...@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
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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

2015-03-11 Thread Matthias Schiffer
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 mschif...@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 0x18
   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
 

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

2015-03-11 Thread Shvedov Yury

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 mschif...@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 0x18
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 */

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

2015-03-11 Thread Shvedov Yury
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 mschif...@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 0x18
   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

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

2015-01-17 Thread John Crispin


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 
 mschif...@universe-factory.net wrote:
 Signed-off-by: Matthias Schiffer
 mschif...@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 0x18 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
 ---
 

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

2014-12-29 Thread Matthias Schiffer
Signed-off-by: Matthias Schiffer mschif...@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 0x18
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,   

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

2014-12-29 Thread David Hutchison
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
mschif...@universe-factory.net wrote:
 Signed-off-by: Matthias Schiffer mschif...@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 0x18
 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 @@

   

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

2014-12-29 Thread Matthias Schiffer
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
 mschif...@universe-factory.net wrote:
 Signed-off-by: Matthias Schiffer mschif...@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 0x18
 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