[OpenWrt-Devel] [RFC][PATCH] broadcom-wl: read channel using wlc on detect

2013-04-18 Thread Rafał Miłecki
Hardcoding channel number to 11 is a bad idea, it may be even not
available on some devices. If there are two single-band radios, the
one for 5GHz doesn't have 11 channel.

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
 package/broadcom-wl/files/lib/wifi/broadcom.sh |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/package/broadcom-wl/files/lib/wifi/broadcom.sh 
b/package/broadcom-wl/files/lib/wifi/broadcom.sh
index 57e11e4..7d23af2 100644
--- a/package/broadcom-wl/files/lib/wifi/broadcom.sh
+++ b/package/broadcom-wl/files/lib/wifi/broadcom.sh
@@ -370,12 +370,15 @@ detect_broadcom() {
local i=-1
 
while grep -qs ^ *wl$((++i)): /proc/net/dev; do
+   local channel
+
config_get type wl${i} type
[ $type = broadcom ]  continue
+   channel=`wlc ifname wl${i} channel`
cat EOF
 config wifi-device  wl${i}
option type broadcom
-   option channel  11
+   option channel  ${channel}
 
# REMOVE THIS LINE TO ENABLE WIFI:
option disabled 1
-- 
1.7.10.4

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


[OpenWrt-Devel] [PATCH] [toolchain] uClibc: fix uClibc implementation of eventfd arch, specific flag

2013-04-18 Thread Hiroaki KAWAI
uClibc eventfd system calls does not work properly if flags specified
on mips chip for example atheros.
Patch is already submitted to the upstream project:
 http://lists.uclibc.org/pipermail/uclibc/2013-April/047734.html

Signed-off-by: Hiroaki KAWAI ka...@stratosphere.co.jp
---
 .../501-eventfd-arch-specific-flag.patch   | 208
+
 1 file changed, 208 insertions(+)
 create mode 100644
toolchain/uClibc/patches-0.9.33.2/501-eventfd-arch-specific-flag.patch

diff --git
a/toolchain/uClibc/patches-0.9.33.2/501-eventfd-arch-specific-flag.patch
b/toolchain/uClibc/patches-0.9.33.2/501-eventfd-arch-specific-flag.patch
new file mode 100644
index 000..4f10337
--- /dev/null
+++ b/toolchain/uClibc/patches-0.9.33.2/501-eventfd-arch-specific-flag.patch
@@ -0,0 +1,208 @@
+From f430eb323d614aeba0a34f3c27954edbaff9d9c3 Mon Sep 17 00:00:00 2001
+From: Hiroaki KAWAI ka...@stratosphere.co.jp
+Date: Thu, 18 Apr 2013 10:44:33 +0900
+Subject: [PATCH] eventfd.h: Use new bits/ scheme for arch-specific flags
+
+As in timerfd.h, eventfd.h needs arch-specific definition files.
+alpha, mips and sparc needs separate file, all the other arch
+will use common definition.
+
+This problem is already fixed in glibc.
+
+Signed-off-by: Hiroaki KAWAI ka...@stratosphere.co.jp
+---
+ libc/sysdeps/linux/alpha/bits/eventfd.h  |   32
++
+ libc/sysdeps/linux/common/bits/eventfd.h |   32
++
+ libc/sysdeps/linux/common/sys/eventfd.h  |   14 +---
+ libc/sysdeps/linux/mips/bits/eventfd.h   |   32
++
+ libc/sysdeps/linux/sparc/bits/eventfd.h  |   32
++
+ 5 files changed, 130 insertions(+), 12 deletions(-)
+ create mode 100644 libc/sysdeps/linux/alpha/bits/eventfd.h
+ create mode 100644 libc/sysdeps/linux/common/bits/eventfd.h
+ create mode 100644 libc/sysdeps/linux/mips/bits/eventfd.h
+ create mode 100644 libc/sysdeps/linux/sparc/bits/eventfd.h
+
+diff --git a/libc/sysdeps/linux/alpha/bits/eventfd.h
b/libc/sysdeps/linux/alpha/bits/eventfd.h
+new file mode 100644
+index 000..999f925
+--- /dev/null
 b/libc/sysdeps/linux/alpha/bits/eventfd.h
+@@ -0,0 +1,32 @@
++/* Copyright (C) 2008-2012 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   http://www.gnu.org/licenses/.  */
++
++#ifndef   _SYS_EVENTFD_H
++# error Never use bits/eventfd.h directly; include sys/eventfd.h
instead.
++#endif
++
++/* Flags for `eventfd'.  */
++enum
++  {
++EFD_SEMAPHORE = 1,
++#define EFD_SEMAPHORE EFD_SEMAPHORE
++EFD_CLOEXEC = 01000,
++#define EFD_CLOEXEC EFD_CLOEXEC
++EFD_NONBLOCK = 4
++#define EFD_NONBLOCK EFD_NONBLOCK
++  };
++
+diff --git a/libc/sysdeps/linux/common/bits/eventfd.h
b/libc/sysdeps/linux/common/bits/eventfd.h
+new file mode 100644
+index 000..5f034bb
+--- /dev/null
 b/libc/sysdeps/linux/common/bits/eventfd.h
+@@ -0,0 +1,32 @@
++/* Copyright (C) 2008-2012 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   http://www.gnu.org/licenses/.  */
++
++#ifndef   _SYS_EVENTFD_H
++# error Never use bits/eventfd.h directly; include sys/eventfd.h
instead.
++#endif
++
++/* Flags for `eventfd'.  */
++enum
++  {
++EFD_SEMAPHORE = 1,
++#define EFD_SEMAPHORE EFD_SEMAPHORE
++EFD_CLOEXEC = 0200,
++#define EFD_CLOEXEC EFD_CLOEXEC
++EFD_NONBLOCK = 04000
++#define EFD_NONBLOCK EFD_NONBLOCK
++  };
++
+diff --git a/libc/sysdeps/linux/common/sys/eventfd.h
b/libc/sysdeps/linux/common/sys/eventfd.h
+index 311f803..a57dbc9 100644
+--- a/libc/sysdeps/linux/common/sys/eventfd.h
 

[OpenWrt-Devel] JFFS2 First read slow

2013-04-18 Thread Pietro Paolini
Hello all,
I am reading some documents regard the JFFS2 filesystem (best 
one)[http://linux-mtd.infradead.org/~dwmw2/jffs2.pdf] and I don't understand
why JFFS2 suffers speed down on the first ls command (maybe should better say 
read command) and don't on the second.

After the mount process ended all the structures needed (according to the 3.5 
of that pdf) are loaded in RAM then why is it soo slow ?

BR
Pietro.

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


[OpenWrt-Devel] [PATCH][ramips] set preinit interface to eth0 by default.

2013-04-18 Thread Álvaro Fernández Rojas
This makes any ramips device accessible via ethernet in failsafe mode.

Based on: https://dev.openwrt.org/changeset/36322

Signed-off-by: Álvaro Fernández Rojas nolt...@gmail.com
---
diff --git 
a/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips 
b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
new file mode 100644
index 000..c8b7f2a
--- /dev/null
+++ b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+
+. /lib/ramips.sh
+
+ramips_set_preinit_iface() {
+   ifname=eth0
+}
+
+boot_hook_add preinit_main ramips_set_preinit_iface
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC] Driver for RTL8192SU wifi family chips.

2013-04-18 Thread José Vázquez Fernández
A month ago found a cfg80211 driver for the RTL8192SU family. There are
some information about the r92su driver in linuxwireless
(http://linuxwireless.org/en/users/Drivers/rtl819x) and the more in the
developer's repository: https://github.com/chunkeey/rtl8192su
The developer added support for big endian cpus and i've tested hardly
in an ar5381u with success, so, at least in bcm63xx target, the
stability seems to be very good for a WIP driver.
In this moment the supported modes are managed, monitor (without frame
injection) and IBSS (with some issues); the TCP checksum offload
firmware feature is not safe, but can be enabled if someone want to test
it.
In the forum there are information about some tests i've done:
https://forum.openwrt.org/viewtopic.php?pid=197935
Of course the new features and improvements that are being added to
openwrt, and the switch to dts in some platforms implies that nobody can
maintain a some kind of experimental driver in openwrt, so, i could be
added as the r92su driver maintainer.
Forgot to mention that, if this driver is added in trunk, must be marked
as broken.

Regards:

José Vázquez Fernández

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


[OpenWrt-Devel] [PATCH] [toolchain] uClibc: fix uClibc implementation of eventfd arch specific flag

2013-04-18 Thread Hiroaki KAWAI
uClibc eventfd system calls does not work properly if flags specified
on mips chip for example atheros.
Patch is already submitted to the upstream project:
 http://lists.uclibc.org/pipermail/uclibc/2013-April/047734.html

Signed-off-by: Hiroaki KAWAI ka...@stratosphere.co.jp
---
 .../501-eventfd-arch-specific-flag.patch   | 208 +
 1 file changed, 208 insertions(+)
 create mode 100644 
toolchain/uClibc/patches-0.9.33.2/501-eventfd-arch-specific-flag.patch

diff --git 
a/toolchain/uClibc/patches-0.9.33.2/501-eventfd-arch-specific-flag.patch 
b/toolchain/uClibc/patches-0.9.33.2/501-eventfd-arch-specific-flag.patch
new file mode 100644
index 000..4f10337
--- /dev/null
+++ b/toolchain/uClibc/patches-0.9.33.2/501-eventfd-arch-specific-flag.patch
@@ -0,0 +1,208 @@
+From f430eb323d614aeba0a34f3c27954edbaff9d9c3 Mon Sep 17 00:00:00 2001
+From: Hiroaki KAWAI ka...@stratosphere.co.jp
+Date: Thu, 18 Apr 2013 10:44:33 +0900
+Subject: [PATCH] eventfd.h: Use new bits/ scheme for arch-specific flags
+
+As in timerfd.h, eventfd.h needs arch-specific definition files.
+alpha, mips and sparc needs separate file, all the other arch
+will use common definition.
+
+This problem is already fixed in glibc.
+
+Signed-off-by: Hiroaki KAWAI ka...@stratosphere.co.jp
+---
+ libc/sysdeps/linux/alpha/bits/eventfd.h  |   32 ++
+ libc/sysdeps/linux/common/bits/eventfd.h |   32 ++
+ libc/sysdeps/linux/common/sys/eventfd.h  |   14 +---
+ libc/sysdeps/linux/mips/bits/eventfd.h   |   32 ++
+ libc/sysdeps/linux/sparc/bits/eventfd.h  |   32 ++
+ 5 files changed, 130 insertions(+), 12 deletions(-)
+ create mode 100644 libc/sysdeps/linux/alpha/bits/eventfd.h
+ create mode 100644 libc/sysdeps/linux/common/bits/eventfd.h
+ create mode 100644 libc/sysdeps/linux/mips/bits/eventfd.h
+ create mode 100644 libc/sysdeps/linux/sparc/bits/eventfd.h
+
+diff --git a/libc/sysdeps/linux/alpha/bits/eventfd.h 
b/libc/sysdeps/linux/alpha/bits/eventfd.h
+new file mode 100644
+index 000..999f925
+--- /dev/null
 b/libc/sysdeps/linux/alpha/bits/eventfd.h
+@@ -0,0 +1,32 @@
++/* Copyright (C) 2008-2012 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   http://www.gnu.org/licenses/.  */
++
++#ifndef   _SYS_EVENTFD_H
++# error Never use bits/eventfd.h directly; include sys/eventfd.h 
instead.
++#endif
++
++/* Flags for `eventfd'.  */
++enum
++  {
++EFD_SEMAPHORE = 1,
++#define EFD_SEMAPHORE EFD_SEMAPHORE
++EFD_CLOEXEC = 01000,
++#define EFD_CLOEXEC EFD_CLOEXEC
++EFD_NONBLOCK = 4
++#define EFD_NONBLOCK EFD_NONBLOCK
++  };
++
+diff --git a/libc/sysdeps/linux/common/bits/eventfd.h 
b/libc/sysdeps/linux/common/bits/eventfd.h
+new file mode 100644
+index 000..5f034bb
+--- /dev/null
 b/libc/sysdeps/linux/common/bits/eventfd.h
+@@ -0,0 +1,32 @@
++/* Copyright (C) 2008-2012 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   http://www.gnu.org/licenses/.  */
++
++#ifndef   _SYS_EVENTFD_H
++# error Never use bits/eventfd.h directly; include sys/eventfd.h 
instead.
++#endif
++
++/* Flags for `eventfd'.  */
++enum
++  {
++EFD_SEMAPHORE = 1,
++#define EFD_SEMAPHORE EFD_SEMAPHORE
++EFD_CLOEXEC = 0200,
++#define EFD_CLOEXEC EFD_CLOEXEC
++EFD_NONBLOCK = 04000
++#define EFD_NONBLOCK EFD_NONBLOCK
++  };
++
+diff --git a/libc/sysdeps/linux/common/sys/eventfd.h 
b/libc/sysdeps/linux/common/sys/eventfd.h
+index 311f803..a57dbc9 100644
+--- a/libc/sysdeps/linux/common/sys/eventfd.h