[OpenWrt-Devel] webcam driver issue

2012-04-25 Thread Sebastian Musat
Hello Team, 


Please give me an advice regarding this problem I have.
I have an ASUS WL-500G and few old pc webcams. I got their vendor_id and 
prod_id from windows device manager and looked for their bridge model here 
http://mxhaard.free.fr/spca5xx.html.
Only one I could successfuly use in a streamer and that is Trust webcam with 
chipser Sonix sn9c201 with driver packet  
kmod-video-gspca-sn9c20x_2.6.32.27-1_brcm47xx.ipk and i got a /dev/video0 .

The question is how can I get drivers for other chipset model used in the other 
webcams.
For example:
Webcam Chicony with sn9c101 chipset doesn't work with any of the drivers 
related to sonix on 
http://downloads.openwrt.org/backfire/10.03.1-rc6/brcm47xx/packages/.
The same happens with webcams which uses Vimicro vc0305 or vimicro zc0301PL. 
The packets looks quite like the chipset model but they are not completely 
matching so i can not rise a /dev/video0 on router. Can I find these drivers 
other way? can I build my own drivers and how?Is it possible for the camera to 
work with neighbor series driver with something modified inside it?

Brgds, 

Seb
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] A couple of other (inconsequential) BCMA patches

2012-04-25 Thread Nathan Hintz
On Wed, 2012-04-25 at 00:28 +0200, Hauke Mehrtens wrote:
 Hi Nathan,
 
 On 03/30/2012 06:54 AM, Nathan Hintz wrote:
  Noticed these while reviewing the code.
  
  Signed-off-by: Nathan Hintz nlhi...@hotmail.com
  
 
 This was committed in 31471.
 
 This patch should go upstream into the linux mainline kernel like some
 of your other patches. Would you like to rebase these patches against
 wireless-testing and send then for inclusion into wireless-testing. If
 you need any help with that, just ask me.
 
 Hauke
 
I took a cut at sending the patches that were accepted upstream,
following the instructions at linuxwireless.org.  We'll see how
successful I was tomorrow.

Nathan

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


Re: [OpenWrt-Devel] valgrind on x86 target: PATCH

2012-04-25 Thread Christoph Thielecke
Hello,

 I tried to run valgrind (3.3.1) on x86 target running. The package was
 build and installed fine (just adapted the /usr/lib/valgrind/uclibc.supp to
 ld-uClibc-0.9.29.so). But running valgrind gives:

 root@OpenWrt:/tmp# valgrind -d
 --5329:1:debuglog DebugLog system started by Stage 1, level 1 logging
 requested
 --5329:1:launcher no tool requested, defaulting to 'memcheck'
 --5329:1:launcher no client specified, defaulting platform to 'x86-linux'
 --5329:1:launcher launching /usr/lib/valgrind/x86-linux/memcheck
 valgrind: failed to start tool 'memcheck' for platform 'x86-linux': No such
 file or directory


 What could be wrong? I tried to set VALGRIND_LIB, LD_LIBRARY_PATH and so on
 but memcheck work start :(

 I'm lucky forward to any useful hints.

After some resarch I found the reason:

Valgrind was compiled with wrong flags:

$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
DESTDIR=$(PKG_INSTALL_DIR) \
CFLAGS=$(TARGET_CFLAGS) \
AM_CFLAGS_X86_LINUX=$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/coregrind \ 
AM_CFLAGS_AMD64_LINUX=$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/coregrind \         
      
AM_CFLAGS_PPC32_LINUX=$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/coregrind \
AM_CFLAGS_PPC64_LINUX=$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/coregrind \
TOOL_LDADD_COMMON=$(LIBGCC_A) $(PKG_BUILD_DIR)/abort.a
all install

I changed it to:
$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
DESTDIR=$(PKG_INSTALL_DIR) \
CFLAGS=$(TARGET_CFLAGS) -m32 -mpreferred-stack-boundary=2 -O -g 
-Wmissing-prototypes -Winline -Wall -Wshadow -Wpointer-arith-Wstrict-proto 
\
all install


Now it works (I had to symlink /usr/lib/valgrind/x86-linux/uclibc.supp 
to /usr/lib/valgrind/x86-linux/default.supp):
root@OpenWrt:~# valgrind ls
==4369== Memcheck, a memory error detector.
==4369== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==4369== Using LibVEX rev 1854, a library for dynamic binary translation.
==4369== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==4369== Using valgrind-3.3.1, a dynamic binary instrumentation framework.
==4369== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==4369== For more details, rerun with: -v
==4369==
==4369==
==4369== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==4369== malloc/free: in use at exit: 0 bytes in 0 blocks.
==4369== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==4369== For counts of detected errors, rerun with: -v
==4369== All heap blocks were freed -- no leaks are possible.

The resulting patch is attached. It contains the flags change, support for 3.x 
kernel on host and the missing symlink to default.supp

Happy memchecking ;)


With best regards

Christoph
-- 
Linux User Group Wernigerode
http://www.lug-wr.de/
diff -burN openwrt-package-feeds/utils/valgrind/files/uclibc.supp valgrind/files/uclibc.supp
--- openwrt-package-feeds/utils/valgrind/files/uclibc.supp	2009-04-03 09:56:58.0 +0200
+++ valgrind/files/uclibc.supp	2012-04-25 09:58:35.0 +0200
@@ -201,12 +201,12 @@
 {
insert a suppression name here
Memcheck:Addr2
-   obj:/lib/ld-uClibc-0.9.28.so
+   obj:/lib/ld-uClibc-0.9.29.so
fun:*
 }
 {
insert a suppression name here
Memcheck:Addr4
-   obj:/lib/ld-uClibc-0.9.28.so
+   obj:/lib/ld-uClibc-0.9.29.so
fun:*
 }
diff -burN openwrt-package-feeds/utils/valgrind/Makefile valgrind/Makefile
--- openwrt-package-feeds/utils/valgrind/Makefile	2012-04-25 09:57:21.003173253 +0200
+++ valgrind/Makefile	2012-04-25 10:25:39.315217728 +0200
@@ -52,12 +52,7 @@
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		$(TARGET_CONFIGURE_OPTS) \
 		DESTDIR=$(PKG_INSTALL_DIR) \
-		CFLAGS=$(TARGET_CFLAGS) \
-		AM_CFLAGS_X86_LINUX=$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/coregrind \
-		AM_CFLAGS_AMD64_LINUX=$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/coregrind \
-		AM_CFLAGS_PPC32_LINUX=$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/coregrind \
-		AM_CFLAGS_PPC64_LINUX=$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/coregrind \
-		TOOL_LDADD_COMMON=$(LIBGCC_A) $(PKG_BUILD_DIR)/abort.a \
+		CFLAGS=$(TARGET_CFLAGS) -m32 -mpreferred-stack-boundary=2 -O -g -Wmissing-prototypes -Winline -Wall -Wshadow -Wpointer-arith-Wstrict-proto \
 		all install
 endef
 
@@ -66,8 +61,10 @@
 	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
 	$(INSTALL_BIN) ./files/valgrind.sh $(1)/usr/bin/
 	$(INSTALL_DIR) $(1)/usr/lib/valgrind
-	$(CP) ./files/uclibc.supp $(1)/usr/lib/valgrind/
 	$(CP) $(PKG_INSTALL_DIR)/usr/lib/valgrind/*-linux $(1)/usr/lib/valgrind/
+	$(CP) ./files/uclibc.supp $(1)/usr/lib/valgrind/
+	cd $(1)/usr/lib/valgrind/  ln -s uclibc.supp default.supp
+
 endef
 
 $(eval $(call BuildPackage,valgrind))
diff -burN openwrt-package-feeds/utils/valgrind/patches/000-kernel_3.x.patch valgrind/patches/000-kernel_3.x.patch
--- openwrt-package-feeds/utils/valgrind/patches/000-kernel_3.x.patch	1970-01-01 01:00:00.0 +0100
+++ valgrind/patches/000-kernel_3.x.patch	2012-04-16 19:06:38.0 +0200
@@ -0,0 +1,51 @@
+--- /dev/null
 

[OpenWrt-Devel] new buildslave ready for use

2012-04-25 Thread Daniel Golle
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi everybody!

To improve the buildbot situation, Allnet decided to sponsor a host running
buildslave for the OpenWrt community.
It's basically just a small hosted box with a Intel(R) Celeron(R) 220 CPU @
1.20GHz, 2GB of RAM and 1TB HDD running CentOS 6.2.
(Linux 3.2.13-grsec--grs-ipv6-64 #1 x86_64 GNU/Linux)
Anyway, if this setup turns out to be insufficient, it's easy to migrate to a
more powerfull machine (just a matter of a few minutes)
To find that out, it's currently building OpenWrt r31477 for ramips/rt305x
with all packages of all feeds enabled, just to see if that generally works
and how long it takes.
I'll report back once the machine went all the way through :)

I under stood that
 buildslave create-slave [options] basedir master name passwd

which contains unknown parameters master, name and passwd.

It would be great to create a tasks to build ramips rt305x and rt3883
subarchs, as we need recent builds for these architectures ourselves and there
currently are no builds task providing snapshots.

A copy of the task of another architecture (e.g. ar71xx) would be good point
to start and when things are smooth, I'd want to migrate it to the buildbot
running on buildbot.openwrt.org.
Maybe the build scripts should be available on the repo anyway, that would be
helpful for developers aiming to have a setup as similar as possible to the
buildbot environment.


Looking forward to hear from you!


Cheers


Daniel
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)

iQIcBAEBAgAGBQJPmEaKAAoJEDy9cKN/1Et0JPUQAL5VqUtL99rhy5a9fwTSIXaM
HJrZNDIhOLqzsDPq725f/31IL8evVSXgdTDKNhycsgM3fy+YPjekj2epEPf8r6Nt
6ZkIzZVZzOEF94WKjMmO8JYIcgfw2ZdTzb2HUloqVKWByA4NINFhjKNPjGuCvlYq
gHluc1STFvtuaAjiJBc+9lTHMv5Fwgyx0ctYKlnuvGvB8FMBNjwpdV+0HgiBJcjj
4a5KeWaruSfKQaNHXHZYFFLMzd6IvzvnaCbVLj3e4NI/UX4eeS4RQ0b11HS5TqOK
EQcRMlreJo3bAb/FyzLLZHbIyuVOjNlKDIcwjfHAMqvG1qVcxzDa9Q7YEBW8FC8z
ZTyLVFRFbwOP0wdggn9eqbadjJdJBxPMCnc+09SnIktoEvixESKIKGl5MURUvGWJ
5S3XTvP8CCMLtShaqtj4U407sAKPnWtq8ixVY5GNYJuJnzpxObzyqZC+IrZFQ1RI
YtnvvWkIOG+pCPEPCSRLNh1dVe/lobEUBBjwpKDnFHxkBoIeqh+9GqCiEx6Yc2Wn
+xHeq+HWNEn87r5nGQ3iuokzcsex8bSoFDz5Q7DJKRXNMzGlB2rl4S8KTc5xOjVT
PDaN5Nfz1Q7X5yxLKwdvlazQhrDlKxtrBooFC8BjTtUBnwMyum2xHfnpyCA3Srz/
v526NhLxX0MiopaEUMyW
=4QP6
-END PGP SIGNATURE-
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [Patch v4] BCMA - Enable use of IRQ6

2012-04-25 Thread Hauke Mehrtens
Hi Nathan,

On 04/25/2012 06:12 AM, Nathan Hintz wrote:
 Hi Hauke:
 
 On Wed, 2012-04-25 at 00:15 +0200, Hauke Mehrtens wrote:
 Hi Nathan,

 It would make reviewing the patches a loot easier if you just but one
 thing into one patch. This patch changes a loot of different things that
 do not have many thing to do with each other. some part like
 bcma_core_irq() I understand and would like to apply and some other
 parts I do not understand.
 I can split out the code related to bcma_fix_i2s_irqflag into a
 separate patch, and maybe the calls to bcma_core_mips_set_irq(core,
 0) for the CC and I2S cores; but the remaining seems relevant to me.
 If it's more than that, can you provide additional feedback?  Do you
 want the patch files posted independently to the mailing list, even
 though there may be order dependencies?

Making two patches out of this would be enough. Sending them in separate
mails makes it easier for me.

 On 04/10/2012 05:56 AM, Nathan Hintz wrote:
 Changes since v3: Fixed two references to bcma_core_mips_irq in 
 driver_pci_host.c

 Signed-off-by: Nathan Hintz nlhi...@hotmail.com

 --- /dev/null   2012-04-07 22:03:23.120698218 -0700
 +++ target/linux/brcm47xx/patches-3.2/235-bcma-dont-expose-mips-irq.patch   
 2012-04-09 20:18:16.988877496 -0700
 @@ -0,0 +1,95 @@
 +--- a/include/linux/bcma/bcma.h
  b/include/linux/bcma/bcma.h
 +@@ -295,6 +295,7 @@ extern struct bcma_device *bcma_find_cor
 + extern bool bcma_core_is_enabled(struct bcma_device *core);
 + extern void bcma_core_disable(struct bcma_device *core, u32 flags);
 + extern int bcma_core_enable(struct bcma_device *core, u32 flags);
 ++extern unsigned int bcma_core_irq(struct bcma_device *core);
 + extern void bcma_core_set_clockmode(struct bcma_device *core,
 +   enum bcma_clkmode clkmode);
 + extern void bcma_core_pll_ctl(struct bcma_device *core, u32 req, u32 
 status,
 +--- a/include/linux/bcma/bcma_driver_mips.h
  b/include/linux/bcma/bcma_driver_mips.h
 +@@ -46,6 +46,4 @@ static inline void bcma_core_mips_init(s
 + 
 + extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore);
 + 
 +-extern unsigned int bcma_core_mips_irq(struct bcma_device *dev);
 +-
 + #endif /* LINUX_BCMA_DRIVER_MIPS_H_ */
 +--- a/arch/mips/bcm47xx/gpio.c
  b/arch/mips/bcm47xx/gpio.c
 +@@ -94,7 +94,7 @@ int gpio_to_irq(unsigned gpio)
 + #endif
 + #ifdef CONFIG_BCM47XX_BCMA
 +   case BCM47XX_BUS_TYPE_BCMA:
 +-  return bcma_core_mips_irq(bcm47xx_bus.bcma.bus.drv_cc.core) + 2;
 ++  return bcma_core_irq(bcm47xx_bus.bcma.bus.drv_cc.core);
 + #endif
 +   }
 +   return -EINVAL;
 +--- a/arch/mips/bcm47xx/serial.c
  b/arch/mips/bcm47xx/serial.c
 +@@ -62,7 +62,7 @@ static int __init uart8250_init_bcma(voi
 + 
 +   p-mapbase = (unsigned int) bcma_port-regs;
 +   p-membase = (void *) bcma_port-regs;
 +-  p-irq = bcma_port-irq + 2;
 ++  p-irq = bcma_port-irq;
 +   p-uartclk = bcma_port-baud_base;
 +   p-regshift = bcma_port-reg_shift;
 +   p-iotype = UPIO_MEM;
 +--- a/drivers/bcma/driver_chipcommon.c
  b/drivers/bcma/driver_chipcommon.c
 +@@ -147,7 +147,7 @@ void bcma_chipco_serial_init(struct bcma
 +   return;
 +   }
 + 
 +-  irq = bcma_core_mips_irq(cc-core);
 ++  irq = bcma_core_irq(cc-core);
 + 
 +   /* Determine the registers of the UARTs */
 +   cc-nr_serial_ports = (cc-capabilities  BCMA_CC_CAP_NRUART);
 +--- a/drivers/bcma/driver_mips.c
  b/drivers/bcma/driver_mips.c
 +@@ -81,7 +81,7 @@ static u32 bcma_core_mips_irqflag(struct
 + /* Get the MIPS IRQ assignment for a specified device.
 +  * If unassigned, 0 is returned.
 +  */
 +-unsigned int bcma_core_mips_irq(struct bcma_device *dev)
 ++static unsigned int bcma_core_mips_irq(struct bcma_device *dev)
 + {
 +   struct bcma_device *mdev = dev-bus-drv_mips.core;
 +   u32 irqflag;
 +@@ -96,7 +96,11 @@ unsigned int bcma_core_mips_irq(struct b
 + 
 +   return 0;
 + }
 +-EXPORT_SYMBOL(bcma_core_mips_irq);
 ++
 ++unsigned int bcma_core_irq(struct bcma_device *dev) {
 ++  return bcma_core_mips_irq(dev) + 2;
 ++}
 ++EXPORT_SYMBOL(bcma_core_irq);
 + 
 + static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int 
 irq)
 + {
 +--- a/drivers/bcma/driver_pci_host.c
  b/drivers/bcma/driver_pci_host.c
 +@@ -565,7 +565,7 @@
 +   pr_info(PCI: Fixing up device %s\n, pci_name(dev));
 + 
 +   /* Fix up interrupt lines */
 +-  dev-irq = bcma_core_mips_irq(pc_host-pdev-core) + 2;
 ++  dev-irq = bcma_core_irq(pc_host-pdev-core);
 +   pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev-irq);
 + 
 +   return 0;
 +@@ -584,6 +584,6 @@
 + 
 +   pc_host = container_of(dev-bus-ops, struct bcma_drv_pci_host,
 +  pci_ops);
 +-  return bcma_core_mips_irq(pc_host-pdev-core) + 2;
 ++  return bcma_core_irq(pc_host-pdev-core);
 + }
 + EXPORT_SYMBOL(bcma_core_pci_pcibios_map_irq);
 --- /dev/null   2012-03-21 21:16:41.055325718 -0700
 +++ 

Re: [OpenWrt-Devel] BCMA - Modified PCI CFG space access

2012-04-25 Thread Hauke Mehrtens
Hi Nathan,

On 04/25/2012 04:15 AM, Nathan Hintz wrote:
 Hi Hauke:
 
   Comments are in line.
 On Tue, 2012-04-24 at 23:52 +0200, Hauke Mehrtens wrote:
 Hi Nathan,

 On 04/11/2012 09:06 AM, Nathan Hintz wrote:
 In the absence of the attached patch, my device (Linksys E3000) does not 
 consistently boot.  Roughly 25% of the time following a power cycle (and
 occasionally on reboot), it will hang just after completion of pre-init.
 There is no stack trace when this occurs.  I'm guessing it is occurring
 when the brcm-wl module is loaded.  At first I thought there may be some
 extended config space access of 1 or 2 bytes (instead of always being 4
 bytes), but when I added logging to detect them, none were ever encountered.
 I have never seen this with my bcm4718 based device. Do you also have
 these problems when not loading brcm-wl, but b43?
 I have never tried B43 to date, but will try both of your suggestions
 and report back.

brcm-wl is just connected with a more or less hackish code to ssb and
bcma and we are unable to look into the code and see what it does. 5GHz
and 802.11n speed will not work with b43, but it is a good place to
debug things.

 The existing code (prior to the patch) does an ioremap_nocache on a
 subset of a memory region that I think has already been mapped, and then
 un-maps that smaller region when it is finished.  Could the un-mapping of
 the smaller region affect adversely the mapping of the larger region?
 Yes I also saw that, but I do not know if it is a biǵ problem, but it
 should get fixed.

 Any thoughts on how I might go about isolating the problem further if the
 un-mapping of the smaller region is not the cause?
 How far do you exactly get? Have yu tried without loading brcm-wl and
 some other modules?
 I'll reproduce on a clean build and post console output for the failure.
That will be nice.

Thanks for the patch and the clarification on some parts of the patch.
It was committed in r31481.

Hauke
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Add support for Huawei E970

2012-04-25 Thread Hauke Mehrtens
Hi Mathias,

sorry for answering so late. I haven't seen this patch since now.

On 12/17/2011 09:46 PM, Mathias Adam wrote:
 This patch adds support for Huawei E970 wireless gateway devices.
 It has been tested on an E970 labelled as T-Mobile web'n'walk Box IV.
 E960/B970 should work too, from what I know it's basically the same hardware.
 
 The device has a Broadcom BCM5354 SoC and a built-in 3G USB modem.
 For reference, it has already been addressed in this open ticket:
 https://dev.openwrt.org/ticket/2711
 
 The device has a hardware watchdog which needs GPIO-7 to be toggled at least
 every 1-2 seconds. Therefore a timer is being setup early in the boot process
 in order to take care of this  (see arch/mips/bcm47xx/time.c).
 
 Tested and works:  3G wan,  wlan+LED,  VLAN config,  failsafe using reset
 button,   image to be used for upgrade from OEM firmware's web interface
 
 Link to the wiki page I've created:  http://wiki.openwrt.org/toh/huawei/e970
 
 Issues:
 
 * lzma-loader crashes, so gzipped kernel is used. Presumably due to watchdog
   reset during kernel decompress.
 * b43 wireless driver crashes after loading firmware, use proprietary module
   (wl) instead. Perhaps due to watchdog, too.
 
 (kernel patch below)
 
 Signed-off-by: Mathias Adam m.adam--open...@adamis.de
 
 ---
 
 Index: target/linux/brcm47xx/image/Makefile
 ===
 --- target/linux/brcm47xx/image/Makefile  (Revision 29557)
 +++ target/linux/brcm47xx/image/Makefile  (Arbeitskopie)
 @@ -13,6 +13,7 @@
  
  define Image/Prepare
   cat $(KDIR)/vmlinux | $(STAGING_DIR_HOST)/bin/lzma e -si -so -eos -lc1 
 -lp2 -pb2  $(KDIR)/vmlinux.lzma
 + gzip -nc9 $(KDIR)/vmlinux  $(KDIR)/vmlinux.gz
   rm -f $(KDIR)/loader.gz
   $(MAKE) -C lzma-loader \
   BUILD_DIR=$(KDIR) \
 @@ -51,6 +52,11 @@
   $(STAGING_DIR_HOST)/bin/trx2edips $(BIN_DIR)/$(IMG_PREFIX)-$(1).trx 
 $(BIN_DIR)/openwrt-$(2)-$(3).bin
  endef
  
 +define Image/Build/Huawei
 + cp ./huawei-e970-padding $(BIN_DIR)/openwrt-$(2)-$(3)-gz.bin
where is huawei-e970-padding ?

cp: cannot stat `./huawei-e970-padding': No such file or directory

 + cat $(BIN_DIR)/$(IMG_PREFIX)-$(1)-gz.trx  
 $(BIN_DIR)/openwrt-$(2)-$(3)-gz.bin
 +endef
 +
  define trxalign/jffs2-128k
  -a 0x2 -f $(KDIR)/root.$(1)
  endef
 @@ -107,9 +113,13 @@
   $(STAGING_DIR_HOST)/bin/trx -o $(BIN_DIR)/$(IMG_PREFIX)-$(1).trx \
   -f $(KDIR)/loader.gz -f $(KDIR)/vmlinux.lzma \
   $(call trxalign/$(1),$(1))
 + $(STAGING_DIR_HOST)/bin/trx -o $(BIN_DIR)/$(IMG_PREFIX)-$(1)-gz.trx \
 + -f $(KDIR)/vmlinux.gz \
 + $(call trxalign/$(1),$(1))
   $(call Image/Build/$(1),$(1))
   $(call Image/Build/Motorola,$(1),wr850g,1,$(1))
   $(call Image/Build/USR,$(1),usr5461,$(1))
 + $(call Image/Build/Huawei,$(1),e970,$(1))
   $(call Image/Build/Chk,$(1),wnr834b_v2,U12H081T00_NETGEAR,2,$(patsubst 
 jffs2-%,jffs2,$(1)))
  #$(call Image/Build/Chk,$(1),wndr3400_v1,U12H155T00_NETGEAR,2,$(patsubst 
 jffs2-%,jffs2,$(1)))
  #$(call Image/Build/Chk,$(1),wgr614_v8,U12H072T00_NETGEAR,2,$(patsubst 
 jffs2-%,jffs2,$(1)))
 Index: package/broadcom-diag/src/diag.c
 ===
 --- package/broadcom-diag/src/diag.c  (Revision 29557)
 +++ package/broadcom-diag/src/diag.c  (Arbeitskopie)
 @@ -142,6 +142,9 @@
  
   /* Edimax */
   PS1208MFG,
 +
 + /* Huawei */
 + HUAWEI_E970,
  };
  
  static void __init bcm4780_init(void) {
 @@ -921,6 +924,16 @@
   { .name = wlan,   .gpio = 1  0, .polarity = 
 NORMAL },
   },
   },
 + /* Huawei */
 + [HUAWEI_E970] = {
 + .name   = Huawei E970,
 + .buttons= {
 + { .name = reset,  .gpio = 1  6 },
 + },
 + .leds = {
 + { .name = wlan,   .gpio = 1  0, .polarity = 
 NORMAL },
 + },
 + },
  };
  
  static struct platform_t __init *platform_detect(void)
 @@ -1155,6 +1168,9 @@
   !strcmp(getvar(status_gpio), 1)) /* gpio based detection */
   return platforms[PS1208MFG];
  
 + if (!strcmp(boardnum, 0x5347)  !strcmp(boardtype, 0x048e))  /* 
 Huawei E970 */
 + return platforms[HUAWEI_E970];
 +
   /* not found */
   return NULL;
  }
 
 
 ---
 
 following patch has to be applied to kernel (3.0):
 
 
 diff -Nur a/arch/mips/bcm47xx/time.c b/arch/mips/bcm47xx/time.c
 --- a/arch/mips/bcm47xx/time.c2011-11-29 16:51:22.0 +0100
 +++ b/arch/mips/bcm47xx/time.c2011-12-17 18:13:32.0 +0100
 @@ -25,9 +25,75 @@
  
  #include linux/init.h
  #include linux/ssb/ssb.h
 +#include linux/gpio.h
  #include asm/time.h
 +#include asm/mach-bcm47xx/nvram.h
  #include bcm47xx.h
  
 +#define ROUTER_HUAWEI_E970   1
 +
 +#define E970_GPIO_WDT_INTERVAL

Re: [OpenWrt-Devel] [PATCH 2/2] Comprehensive ipv4 and ipv6 unaligned access patch for ar71xx

2012-04-25 Thread David Woodhouse
On Sun, 2012-04-22 at 14:48 -0700, Dave Täht wrote:
 +--- a/net/ipv6/netfilter/ip6t_LOG.c
  b/net/ipv6/netfilter/ip6t_LOG.c
 +@@ -64,9 +64,9 @@ static void dump_packet(struct sbuff *m,
 +   /* Max length: 44 LEN=65535 TC=255 HOPLIMIT=255 FLOWLBL=F  */
 +   sb_add(m, LEN=%Zu TC=%u HOPLIMIT=%u FLOWLBL=%u ,
 +  ntohs(ih-payload_len) + sizeof(struct ipv6hdr),
 +- (ntohl(*(__be32 *)ih)  0x0ff0)  20,
 ++ (ntohl(__get_unaligned_cpu32((__be32 *)ih))  0x0ff0)  
 20,
 +  ih-hop_limit,
 +- (ntohl(*(__be32 *)ih)  0x000f));
 ++ (ntohl(__get_unaligned_cpu32((__be32 *)ih))  0x000f));


Surely that should be get_unaligned_be32()?

-- 
dwmw2


smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/2] __packed can leak from the kernel headers into iptables so define

2012-04-25 Thread David Woodhouse
On Tue, 2012-04-24 at 07:53 -0700, Dave Taht wrote:
 
 Hmm. OK. Well, it happened, so perhaps something in openwrt is doing
 it wrong, or some pattern of mine while doing a build broke it.

/me looks... yes, openwrt is doing it wrong. It's pointing iptables at
the actual kernel source, rather than the exported headers.

This should fix it. We do already export the headers for the toolchain,
but I think not the very latest headers, and iptables probably wants
those?

From 99445ea27f5d241ced131b86ae70c2d3c26d943b Mon Sep 17 00:00:00 2001
From: David Woodhouse david.woodho...@intel.com
Date: Thu, 26 Apr 2012 00:32:31 +0100
Subject: [PATCH] Fix iptables abuse of kernel header files. Use exported
 headers instead.

Signed-off-by: David Woodhouse david.woodho...@intel.com
---
 include/kernel-defaults.mk |1 +
 package/iptables/Makefile  |8 
 .../generic/patches-3.3/030-export-xt_layer7.h |   10 ++
 3 files changed, 15 insertions(+), 4 deletions(-)
 create mode 100644 target/linux/generic/patches-3.3/030-export-xt_layer7.h

diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index 6864793..993ffd6 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -109,6 +109,7 @@ define Kernel/Configure/Default
$(call Kernel/SetInitramfs)
-$(_SINGLE)$(MAKE) $(KERNEL_MAKEOPTS) oldconfig prepare scripts
rm -rf $(KERNEL_BUILD_DIR)/modules
+   $(MAKE) $(KERNEL_MAKEOPTS) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers 
headers_install
$(SH_FUNC) grep '=[ym]' $(LINUX_DIR)/.config | LC_ALL=C sort | md5s  
$(LINUX_DIR)/.vermagic
 endef
 
diff --git a/package/iptables/Makefile b/package/iptables/Makefile
index 026df26..ff7d428 100644
--- a/package/iptables/Makefile
+++ b/package/iptables/Makefile
@@ -343,26 +343,26 @@ endef
 
 TARGET_CPPFLAGS := \
-I$(PKG_BUILD_DIR)/include \
-   -I$(LINUX_DIR)/arch/$(LINUX_KARCH)/include \
+   -I$(LINUX_DIR)/user_headers/include \
$(TARGET_CPPFLAGS)
 
 TARGET_CFLAGS += \
-I$(PKG_BUILD_DIR)/include \
-   -I$(LINUX_DIR)/arch/$(LINUX_KARCH)/include
+   -I$(LINUX_DIR)/user_headers/include
 
 CONFIGURE_ARGS += \
--enable-shared \
--enable-devel \
$(if $(CONFIG_IPV6),--enable-ipv6,--disable-ipv6) \
--enable-libipq \
-   --with-kernel=$(LINUX_DIR) \
+   --with-kernel=$(LINUX_DIR)/user_headers \
--with-xtlibdir=/usr/lib/iptables \
--enable-static
 
 MAKE_FLAGS := \
$(TARGET_CONFIGURE_OPTS) \
COPT_FLAGS=$(TARGET_CFLAGS) \
-   KERNEL_DIR=$(LINUX_DIR) PREFIX=/usr \
+   KERNEL_DIR=$(LINUX_DIR)/user_headers/ PREFIX=/usr \
KBUILD_OUTPUT=$(LINUX_DIR) \
BUILTIN_MODULES=$(patsubst ipt_%,%,$(patsubst xt_%,%,$(IPT_BUILTIN) 
$(IPT_CONNTRACK-m) $(IPT_NAT-m)))
 
diff --git a/target/linux/generic/patches-3.3/030-export-xt_layer7.h 
b/target/linux/generic/patches-3.3/030-export-xt_layer7.h
new file mode 100644
index 000..7d78a84
--- /dev/null
+++ b/target/linux/generic/patches-3.3/030-export-xt_layer7.h
@@ -0,0 +1,10 @@
+--- linux-3.3.3/include/linux/netfilter/Kbuild.orig2012-04-26 
00:24:57.581217964 +0100
 linux-3.3.3/include/linux/netfilter/Kbuild 2012-04-26 00:25:34.301606804 
+0100
+@@ -49,6 +49,7 @@ header-y += xt_hashlimit.h
+ header-y += xt_helper.h
+ header-y += xt_iprange.h
+ header-y += xt_ipvs.h
++header-y += xt_layer7.h
+ header-y += xt_length.h
+ header-y += xt_limit.h
+ header-y += xt_mac.h
-- 
1.7.7.6


-- 
dwmw2


smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [GIT PULL] OpenConnect and L2TP fixes, use properly exported kernel headers for iptables build.

2012-04-25 Thread David Woodhouse
Each git:// repository is browseable in gitweb by changing git:// to
http://. My collection of patches to openwrt/packages/luci is
accumulating...

===

git://git.infradead.org/users/dwmw2/openwrt.git

David Woodhouse (3):
  Add ppp-mod-pppol2tp subpackage to ppp
  Fix iptables abuse of kernel header files. Use exported headers instead.
  Fix pptp handling of routes to server.

 include/kernel-defaults.mk |1 +
 package/iptables/Makefile  |8 +++---
 package/ppp/Makefile   |   19 +++-
 package/ppp/files.old/etc/ppp/ip-down  |2 +-
 package/ppp/files.old/etc/ppp/ip-up|2 +-
 .../ppp/patches/400-simplify_kernel_checks.patch   |   16 +
 package/pptp/Makefile  |2 +-
 package/pptp/files/pptp.sh |   24 +--
 .../generic/patches-3.3/030-export-xt_layer7.h |   10 
 9 files changed, 63 insertions(+), 21 deletions(-)

===

git://git.infradead.org/users/dwmw2/openwrt-packages.git

David Woodhouse (5):
  Add vpnc-scripts package with up-to-date script
  Add openconnect protocol support to network scripts
  Remove local copy of pppol2tp PPP module from openl2tp
  Update and fix x2ltpd, add connect script
  Update openconnect to 3.18

 net/openconnect/Makefile  |   12 +-
 net/openconnect/files/openconnect.sh  |   39 ++
 net/openconnect/files/run-openconnect |   86 
 net/openl2tp/Makefile |7 +-
 net/vpnc-scripts/Makefile |   56 +++
 net/vpnc-scripts/files/etc/vpnc/connect.d/ifstate |7 +
 net/vpnc/Makefile |6 +-
 net/xl2tpd/Makefile   |   13 +-
 net/xl2tpd/files/l2tp.sh  |  124 ++
 net/xl2tpd/files/xl2tpd.conf  |   34 +-
 net/xl2tpd/patches/120-kernel-mode-l2tp.patch |  436 +
 net/xl2tpd/patches/130-no-kill-ipparam.patch  |   11 +
 12 files changed, 797 insertions(+), 34 deletions(-)


===

git://git.infradead.org/users/dwmw2/luci.git

David Woodhouse (2):
  Add openconnect support to luci
  Add L2TP support

 contrib/package/luci/Makefile  |1 +
 protocols/openconnect/Makefile |2 +
 .../model/cbi/admin_network/proto_openconnect.lua  |   62 +++
 .../luasrc/model/network/proto_openconnect.lua |   63 
 .../luasrc/model/cbi/admin_network/proto_l2tp.lua  |   57 ++
 protocols/ppp/luasrc/model/network/proto_ppp.lua   |6 ++-
 6 files changed, 190 insertions(+), 1 deletions(-)


-- 
dwmw2


smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [GIT PULL] OpenConnect and L2TP fixes, use properly exported kernel headers for iptables build.

2012-04-25 Thread David Woodhouse
On Thu, 2012-04-26 at 02:35 +0100, David Woodhouse wrote:
   Fix pptp handling of routes to server. 

That one probably does want sending as a patch, for review.

I was going to ignore this brokenness, but it ended up actually doing
stupid things on my setup because it was adding a broken route to the
server. So I fixed it anyway...

If there's a way to do this right with the legacy ifconfig tool rather
than ip, that would be interesting. But I don't think there is, and
having to use modern tools if you want pptp or l2tp support isn't *such*
an imposition...

From ad1b90974f249ff50c8de690022a33b8848b2308 Mon Sep 17 00:00:00 2001
From: David Woodhouse david.woodho...@intel.com
Date: Thu, 26 Apr 2012 02:13:12 +0100
Subject: [PATCH] Fix pptp handling of routes to server.

The existing code is fairly broken. It assumes you're using Legacy IP, and
it assumes that the server is reachable via your default route. Via the
first default route in the 'route -n' output, in fact, regardless of metric.

Fix all those problems by using 'ip route get' to really find the *current*
route to the server, and install a host-specific route to match.

Signed-off-by: David Woodhouse david.woodho...@intel.com
---
 package/pptp/Makefile  |2 +-
 package/pptp/files/pptp.sh |   24 +++-
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/package/pptp/Makefile b/package/pptp/Makefile
index a6d213d..748abde 100644
--- a/package/pptp/Makefile
+++ b/package/pptp/Makefile
@@ -23,7 +23,7 @@ define Package/pptp
   TITLE:=PPTP client
   MAINTAINER:=Jo-Philipp Wich x...@subsignal.org
   URL:=http://pptpclient.sourceforge.net/
-  DEPENDS:=+ppp +kmod-gre +resolveip
+  DEPENDS:=+ppp +kmod-gre +resolveip +ip
 endef
 
 define Package/pptp/description
diff --git a/package/pptp/files/pptp.sh b/package/pptp/files/pptp.sh
index 19023e7..b898769 100644
--- a/package/pptp/files/pptp.sh
+++ b/package/pptp/files/pptp.sh
@@ -1,5 +1,6 @@
-find_gw() {
-   route -n | awk '$1 == 0.0.0.0 { print $2; exit }'
+find_route() {
+   ip route get $1 | sed -e 's/ /\n/g' | \
+sed -ne '1p;/via/{N;p};/dev/{N;p};/src/{N;p};/mtu/{N;p}'
 }
 
 scan_pptp() {
@@ -9,7 +10,7 @@ scan_pptp() {
 stop_interface_pptp() {
stop_interface_ppp $1
for ip in $(uci_get_state network $1 serv_addrs); do
-   route del -host $ip 2/dev/null
+   ip route del $ip 2/dev/null
done
 }
 
@@ -36,16 +37,13 @@ setup_interface_pptp() {
done
sleep 1
 
-   local gw=$(find_gw)
-   [ -n $gw ]  {
-   local serv_addrs=
-   for ip in $(resolveip -4 -t 3 $server); do
-   append serv_addrs $ip
-   route delete -host $ip 2/dev/null
-   route add -host $ip gw $gw
-   done
-   uci_toggle_state network $config serv_addrs $serv_addrs
-   }
+   local serv_addrs=
+   for ip in $(resolveip -t 3 ${server}); do
+   append serv_addrs $ip
+   ip route replace $(find_route $ip)
+   done
+   uci_toggle_state network $config serv_addrs $serv_addrs
+}
 
# fix up the netmask
config_get netmask $config netmask
-- 
1.7.7.6


-- 
dwmw2


smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel