[OpenWrt-Devel] [PATCH 1/1] ntpd: trivial fix for eglibc builds

2012-08-27 Thread Philip Prindeville
When building against eglibc, libc doesn't include librt therefore it must be 
explicitly included.

Signed-off-by: Philip Prindeville 

Index: trunk/feeds/packages/net/ntpd/Makefile
===
--- trunk/feeds/packages/net/ntpd/Makefile  (revision 33271)
+++ trunk/feeds/packages/net/ntpd/Makefile  (working copy)
@@ -30,7 +30,7 @@
   TITLE:=ISC ntp
   MAINTAINER:=Peter Wagner 
   URL:=http://www.ntp.org/
-  DEPENDS:=+libcap
+  DEPENDS:=+libcap +USE_EGLIBC:librt
 endef
 
 define Package/ntpd/Default/description
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ramips: Power down phy on disabled switch ports

2012-08-27 Thread Tobias Diedrich
John Crispin wrote:
> On 27/08/12 23:58, Tobias Diedrich wrote:
> > Tobias Diedrich wrote:
> >> Power down phy on disabled switch ports.
> >>
> >> Haven't measured this myself yet, but according to this
> >> http://www.8devices.com/community/viewtopic.php?f=6&t=156
> >> it can save about 300mW of power.
> > Ok, I did some measurements now on the Carambola:
> >
> > Measured on the 12V rail, with WiFi off, LAN cable on port 0:
> >
> > Phy in PDOWN Current (mA)   Power (mW)
> > 0-4   65 780
> > 1-4   881056
> > 2-4  1141368
> > 3-4  1191428
> > 41241488
> > none 1301560
> > 01051260
> > 0-1   80 960
> > 0-2   75 900
> > 0-3   70 840
> > 0-4   65 780
> >
> > So this saves about 5mA per completely unconnected port
> > and about 25mA per port with a transceiver.
> >
> > So disabling the unconnected 3 ports by default would save about 180mW.
> > On a device with an external switch all 5 ports could be powered
> > down, which should save about 300mW.
> 
> you will notice that a rt305x will also drop in temperature if all
> floating ports are powered down ... i recall doing this for a customer
> 1-2 years ago...
> 
> if you have a thermometer it would be nice to extend the table with
> those values

Well, the temperature should be mostly linear to the power consumption
in mW, and will of course depend on case, heat sink etc. :)

A part of the power for the two main ports might is the two LEDs
though, which are probably 20mA on the 3.3V rail unless they are low
power LEDs.

-- 
Tobias  PGP: http://8ef7ddba.uguu.de
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/1] diffutils: trivial fix for eglibc builds

2012-08-27 Thread Philip Prindeville
When building against eglibc, libc doesn't include librt therefore it must be 
explicitly included.

Signed-off-by: Philip Prindeville 
Index: trunk/feeds/packages/devel/diffutils/Makefile
===
--- trunk/feeds/packages/devel/diffutils/Makefile   (revision 33271)
+++ trunk/feeds/packages/devel/diffutils/Makefile   (working copy)
@@ -22,6 +22,7 @@
 define Package/diffutils
   SECTION:=devel
   CATEGORY:=Development
+  DEPENDS:=+USE_EGLIBC:librt
   TITLE:=diffutils
   URL:=http://www.gnu.org/software/diffutils/
 endef
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Finding author of 019-fix-boot.patch (later 119-fix-boot.patch)

2012-08-27 Thread Hauke Mehrtens
On 08/27/2012 10:46 PM, Rafał Miłecki wrote:
> 2012/8/27 Rafał Miłecki :
>> Can you tell me, how I can find author of [01]19-fix-boot.patch?
>>
>> I really wish this patch to be mainlined, but I don't understand that
>> ".fill 0x400". I wish someone who wrote this code to send it mainline.
>> Personally I just case about
>> select BOOT_RAW
>> which is needed for WNDR4500 to boot from flash.
> 
> Paul let me know about "git log -S" which is just great. It pointed to the:
> 
> commit 2a29cc5f9fca8b22073b7c706184d2a3dfc5e15e
> Author: hauke 
> Date:   Thu Apr 7 21:38:41 2011 +
> 
> brcm47xx: add initial support for kernel 2.6.38
> 
> 
> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26524
> 3c298f89-4303-0410-b956-a3cf2f4a3e73
> 
> 
> Hauke: is that your patch?
> 
> I got info from Paul that this BOOT_RAW is machine specific, and can't
> be just enabled by default. Is that right? :/
> 
Hi,

this patch is based on an other patch which was in generic till kernel
version 2.6.36 [0]. I have too less knowledge about mips in general and
do not know why this patch is needed, that's the reason it is not
upstream yet.

Hauke

[0]:
https://dev.openwrt.org/browser/trunk/target/linux/generic/patches-2.6.36/011-mips_boot.patch?rev=30179
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ramips: Add support for 8devices Carambola dev board.

2012-08-27 Thread Tobias Diedrich
Petr Štetiar wrote:
> Tobias Diedrich  [2012-08-27 03:47:03]:
> 
> > Add support for 8devices Carambola dev board.
> 
> Hi,
> 
> 8D's stock kernel seems to have some more additions, like this ethernet[1]
> fix and gpiolib support[2]. Don't know what issue is that ethernet patch
> trying to fix, since there's no description of that issue. Having gpiolib+IRQ
> support would be nice (I haven't had time to test it myself yet, but according
> to their forums it's used quite heavily so it should be ok).

I wrote this patch first and looked at their git tree afterwards and
since I thought their patch had some unnecessary stuff[1], I used mine.
It's intentionally kept as minimal as possible. :)

Improving the gpio stuff would be nice though, it would be great if
you could load the platform I2C/SPI/... driver and it would switch the pins
into the right mode, so you can use them as GPIO by default but also
for I2C/SPI/... if you want to.

[1] Like adding a separate target and using their own partition
definitions instead of the generic support.

-- 
Tobias  PGP: http://8ef7ddba.uguu.de
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ramips: Power down phy on disabled switch ports

2012-08-27 Thread John Crispin
On 27/08/12 23:58, Tobias Diedrich wrote:
> Tobias Diedrich wrote:
>> Power down phy on disabled switch ports.
>>
>> Haven't measured this myself yet, but according to this
>> http://www.8devices.com/community/viewtopic.php?f=6&t=156
>> it can save about 300mW of power.
> Ok, I did some measurements now on the Carambola:
>
> Measured on the 12V rail, with WiFi off, LAN cable on port 0:
>
> Phy in PDOWN Current (mA)   Power (mW)
> 0-4   65 780
> 1-4   881056
> 2-4  1141368
> 3-4  1191428
> 41241488
> none 1301560
> 01051260
> 0-1   80 960
> 0-2   75 900
> 0-3   70 840
> 0-4   65 780
>
> So this saves about 5mA per completely unconnected port
> and about 25mA per port with a transceiver.
>
> So disabling the unconnected 3 ports by default would save about 180mW.
> On a device with an external switch all 5 ports could be powered
> down, which should save about 300mW.

you will notice that a rt305x will also drop in temperature if all
floating ports are powered down ... i recall doing this for a customer
1-2 years ago...

if you have a thermometer it would be nice to extend the table with
those values

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


Re: [OpenWrt-Devel] [PATCH] ramips: Power down phy on disabled switch ports

2012-08-27 Thread Tobias Diedrich
Tobias Diedrich wrote:
> Power down phy on disabled switch ports.
> 
> Haven't measured this myself yet, but according to this
> http://www.8devices.com/community/viewtopic.php?f=6&t=156
> it can save about 300mW of power.

Ok, I did some measurements now on the Carambola:

Measured on the 12V rail, with WiFi off, LAN cable on port 0:

Phy in PDOWN Current (mA)   Power (mW)
0-4   65 780
1-4   881056
2-4  1141368
3-4  1191428
41241488
none 1301560
01051260
0-1   80 960
0-2   75 900
0-3   70 840
0-4   65 780

So this saves about 5mA per completely unconnected port
and about 25mA per port with a transceiver.

So disabling the unconnected 3 ports by default would save about 180mW.
On a device with an external switch all 5 ports could be powered
down, which should save about 300mW.

-- 
Tobias  PGP: http://8ef7ddba.uguu.de
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [packages] new package: stm32flash - tool for flashing STM32 controllers

2012-08-27 Thread Michael Heimpold

Signed-off-by: Michael Heimpold 
---
 utils/stm32flash/Makefile |   40 
 1 file changed, 40 insertions(+)
 create mode 100644 utils/stm32flash/Makefile

diff --git a/utils/stm32flash/Makefile b/utils/stm32flash/Makefile
new file mode 100644
index 000..4779def
--- /dev/null
+++ b/utils/stm32flash/Makefile
@@ -0,0 +1,40 @@
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=stm32flash
+PKG_REV:=61
+PKG_VERSION:=r$(PKG_REV)
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://stm32flash.googlecode.com/svn/trunk
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=$(PKG_REV)
+PKG_SOURCE_PROTO:=svn
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/stm32flash
+  SECTION:=utils
+  CATEGORY:=Utilities
+  URL:=http://code.google.com/p/stm32flash/
+  TITLE:=Firmware flash tool for STM32's serial bootloader
+endef
+
+define Package/stm32flash/description
+  This tool can be used to burn firmware images to STM32 ARM processors
+  using the built-in serial bootloader.
+endef
+
+define Package/stm32flash/install
+   $(INSTALL_DIR) $(1)/usr/bin
+   $(INSTALL_BIN) $(PKG_BUILD_DIR)/stm32flash $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,stm32flash))
-- 
1.7.9.5


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


Re: [OpenWrt-Devel] [PATCH] [packages] openssl: Allow user to enable or disable Elliptic Curve Cryptography

2012-08-27 Thread Oliver
On Monday 27 August 2012 12:21:16 Pun Lo wrote:
> From: Iurii Zaikin  
> 
> The patch enables user to select via menuconfig whether to build openssl
> with ec or without.

This is a nice addition; with this the OpenSSH package could also come with an 
option for enabling ecdsa and altering the initscript appropriately to 
generate ECDSA keys.

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


Re: [OpenWrt-Devel] Finding author of 019-fix-boot.patch (later 119-fix-boot.patch)

2012-08-27 Thread Rafał Miłecki
2012/8/27 Rafał Miłecki :
> Can you tell me, how I can find author of [01]19-fix-boot.patch?
>
> I really wish this patch to be mainlined, but I don't understand that
> ".fill 0x400". I wish someone who wrote this code to send it mainline.
> Personally I just case about
> select BOOT_RAW
> which is needed for WNDR4500 to boot from flash.

Paul let me know about "git log -S" which is just great. It pointed to the:

commit 2a29cc5f9fca8b22073b7c706184d2a3dfc5e15e
Author: hauke 
Date:   Thu Apr 7 21:38:41 2011 +

brcm47xx: add initial support for kernel 2.6.38


git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26524
3c298f89-4303-0410-b956-a3cf2f4a3e73


Hauke: is that your patch?

I got info from Paul that this BOOT_RAW is machine specific, and can't
be just enabled by default. Is that right? :/

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


Re: [OpenWrt-Devel] Finding author of 019-fix-boot.patch (later 119-fix-boot.patch)

2012-08-27 Thread Rafał Miłecki
2012/8/27 Rafał Miłecki :
> Can you tell me, how I can find author of [01]19-fix-boot.patch?
>
> I really wish this patch to be mainlined, but I don't understand that
> ".fill 0x400". I wish someone who wrote this code to send it mainline.
> Personally I just case about
> select BOOT_RAW
> which is needed for WNDR4500 to boot from flash.

The oldest log of this file I was able to find:

commit a8ee8b6876798e9522663839a74c55d6c0584cd8
Author: hauke 
Date:   Fri Jul 22 18:41:24 2011 +

brcm47xx: remove old kernel versions


git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27724
3c298f89-4303-0410-b956-a3cf2f4a3e73

(target/linux/brcm47xx/patches-2.6.38/019-fix-boot.patch). But there
must be sth even older.

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


[OpenWrt-Devel] Finding author of 019-fix-boot.patch (later 119-fix-boot.patch)

2012-08-27 Thread Rafał Miłecki
Can you tell me, how I can find author of [01]19-fix-boot.patch?

I really wish this patch to be mainlined, but I don't understand that
".fill 0x400". I wish someone who wrote this code to send it mainline.
Personally I just case about
select BOOT_RAW
which is needed for WNDR4500 to boot from flash.

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


[OpenWrt-Devel] [PATCH] [packages] openssl: Allow user to enable or disable Elliptic Curve Cryptography

2012-08-27 Thread Pun Lo
From: Iurii Zaikin  

The patch enables user to select via menuconfig whether to build openssl with 
ec or without.

Signed-off-by: Iurii Zaikin 

---
Index: package/openssl/Config.in
===
--- package/openssl/Config.in(revision 33288)
+++ package/openssl/Config.in(working copy)
@@ -10,4 +10,8 @@
 depends OPENSSL_ENGINE_CRYPTO
 prompt "Digests acceleration support"
 
+config OPENSSL_ELLIPTIC_CURVE
+bool
+prompt "Elliptic curve cryptography support"
+
 endmenu
Index: package/openssl/Makefile
===
--- package/openssl/Makefile(revision 33288)
+++ package/openssl/Makefile(working copy)
@@ -74,8 +74,14 @@
 
 OPENSSL_NO_CIPHERS:= no-idea no-md2 no-mdc2 no-rc5 no-sha0 no-smime \
 no-rmd160 no-aes192 no-ripemd no-camellia no-ans1 no-krb5
-OPENSSL_OPTIONS:= shared no-ec no-err no-hw no-threads zlib-dynamic no-sse2
+OPENSSL_OPTIONS:= shared no-err no-hw no-threads zlib-dynamic no-sse2
 
+ifdef CONFIG_OPENSSL_ELLIPTIC_CURVE
+  OPENSSL_OPTIONS += enable-ec
+else
+  OPENSSL_OPTIONS += no-ec
+endif
+
 ifdef CONFIG_OPENSSL_ENGINE_CRYPTO
   OPENSSL_OPTIONS += -DHAVE_CRYPTODEV
   ifdef CONFIG_OPENSSL_ENGINE_DIGEST

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


Re: [OpenWrt-Devel] [PATCH] Add leds back after migration to sysfs

2012-08-27 Thread Ben West
Along with Jonathan's Engenius ECB-3500 and my Open Mesh OM1P, I think
there is a very good chance this changeset will also affect FONera
2100, Engenius EOC-1650, Engenius EOC-2610, and maybe Engenius EOC
2611.

What are next steps for supporting multiple board configs on atheros
target?  I.e. is this wiki page still reasonably up to date?
http://wiki.openwrt.org/doc/devel/add.new.device

On Mon, Aug 27, 2012 at 8:24 AM, Karl Palsson  wrote:
>
> I think this really just means that the Atheros platform needs to be broken 
> up into separate boards,
> like ar71xx and other newer platforms.  Currently a Atheros targets get 
> the same init code, and
> clearly your board needs different init code to mine :)
>
> Cheers,
> Karl P
>
> On Sun, Aug 26, 2012 at 10:13:33PM -0500, Ben West wrote:
>> This changeset on trunk appears to prevent booting up on a OM1P
>> (Atheros AR2315).  That is, freshly compiled r32884 boots fine on
>> OM1P, but flashing the device with r32885+ leads to unresponsive eth0
>> interface on OM1P.  I am lacking a TTL/serial cable, so I can't share
>> more information.
>>
>> https://dev.openwrt.org/changeset/32885/trunk
>>
>> Removing the line CONFIG_LEDS_GPIO=y from
>> target/linux/atheros/config-3.3 and recompiling leads to booting
>> firmware again.
>>
>> Since this is related to kernel GPIO LED control, I posted a bug
>> earlier this summer about a compile problem witnessed with
>> kmod-leds-gpio package for ath5k, but I had no patch to offer.
>> Perhaps, these problems are related?
>>
>> https://dev.openwrt.org/ticket/11797
>>
>> If not related, I do see CONFIG_LEDS_GPIO being unset in this
>> changeset from several years ago, with the comment specifically
>> referring to flash access errors.  Is changeset r32885 a regression
>> then?
>>
>> https://dev.openwrt.org/changeset/16765/
>>
>> On Fri, Jul 6, 2012 at 7:32 AM, Karl Palsson  wrote:
>> > From: Karl Palsson 
>> >
>> > atheros trunk moved to full sysfs gpiolib, but the leds were forgotten.
>> > This restores the wlan led that was missing after switching from backfire
>> > to trunk.
>> >
>> > Signed-off-by: Karl Palsson 
>> > ---
>> >  .../linux/atheros/base-files/etc/uci-defaults/leds |   11 +++
>> >  target/linux/atheros/config-3.3|1 +
>> >  2 files changed, 12 insertions(+), 0 deletions(-)
>> >  create mode 100644 target/linux/atheros/base-files/etc/uci-defaults/leds
>> >
>> > diff --git a/target/linux/atheros/base-files/etc/uci-defaults/leds 
>> > b/target/linux/atheros/base-files/etc/uci-defaults/leds
>> > new file mode 100644
>> > index 000..076a04b
>> > --- /dev/null
>> > +++ b/target/linux/atheros/base-files/etc/uci-defaults/leds
>> > @@ -0,0 +1,11 @@
>> > +#!/bin/sh
>> > +# Copyright 2012 OpenWrt.org
>> > +#
>> > +
>> > +. /lib/functions/uci-defaults.sh
>> > +
>> > +ucidef_set_led_netdev "wlan" "wlan" "wlan" "wlan0"
>> > +
>> > +ucidef_commit_leds
>> > +
>> > +exit 0
>> > diff --git a/target/linux/atheros/config-3.3 
>> > b/target/linux/atheros/config-3.3
>> > index be0c74a..c3713b3 100644
>> > --- a/target/linux/atheros/config-3.3
>> > +++ b/target/linux/atheros/config-3.3
>> > @@ -70,6 +70,7 @@ CONFIG_INITRAMFS_SOURCE=""
>> >  CONFIG_IP17XX_PHY=y
>> >  CONFIG_IRQ_CPU=y
>> >  CONFIG_IRQ_FORCED_THREADING=y
>> > +CONFIG_LEDS_GPIO=y
>> >  CONFIG_MDIO_BOARDINFO=y
>> >  CONFIG_MIPS=y
>> >  CONFIG_MIPS_L1_CACHE_SHIFT=5
>> > --
>> > 1.7.2.5
>> >
>> > ___
>> > openwrt-devel mailing list
>> > openwrt-devel@lists.openwrt.org
>> > https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>>
>>
>>
>> --
>> Ben West
>> http://gowasabi.net
>> b...@gowasabi.net
>> ___
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel



-- 
Ben West
http://gowasabi.net
b...@gowasabi.net
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] New package tgt, iscsi target

2012-08-27 Thread Maxim Storchak
iSCSI target 

This patch adds a user space iscsi implementation. It provides a daemon tgtd,
a control tool tgtadm, init script and an example uci config.

It has been tested with Scientific Linux 6 
iscsi-initiator-utils-6.2.0.872-34.el6.x86_64,
also worked with Microsoft iSCSI initiator and Global SAN 4 on Mac OS X.
The best performance was observed with an image file located on a local 
filesystem.
Raw device was much slower for some reason. Also, direct mode didn't work well 
for me -
I could not mount filesystem after creating it.
"Image indirect" mode worked perfectly.

Signed-off-by: Maxim Storchak 

 net/tgt/Makefile   |  57 +
 net/tgt/files/etc/config/tgt   |  38 +++
 net/tgt/files/etc/init.d/tgt   | 111 +
 net/tgt/patches/010-fallocate.patch|  14 +
 net/tgt/patches/020-usr_Makefile.patch |  26 
 net/tgt/patches/030-Makefile.patch |  11 
 6 files changed, 257 insertions(+)

diff --git a/net/tgt/Makefile b/net/tgt/Makefile
new file mode 100644
index 000..1e87be2
--- /dev/null
+++ b/net/tgt/Makefile
@@ -0,0 +1,57 @@
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=tgt
+PKG_VERSION:=1.0.30
+PKG_RELEASE:=2
+GIT_SHORT_REV:=9dc30be
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/fujita/tgt/tarball/v$(PKG_VERSION)
+
+#PKG_MD5SUM:=
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/fujita-$(PKG_NAME)-$(GIT_SHORT_REV)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/tgt
+  SECTION:=net
+  CATEGORY:=Network
+  URL:=http://stgt.sourceforge.net/
+  TITLE:=userspace iSCSI target
+  DEPENDS:=+libpthread
+endef
+
+define Package/tgt/description
+Linux SCSI target framework (tgt) aims to simplify various SCSI target driver 
(iSCSI, Fibre Channel, SRP, etc) creation and maintenance.
+Key goals of the project are the clean integration into the scsi-mid layer and 
implementing a great portion of tgt in user space.
+Tgt consists of kernel-space and user-space code. The kernel-space component 
is included in upstream as of 2.6.20.
+Note that if you are interested in only iSCSI (probably you are), you need 
only the user-space code (any kernel version is fine).
+endef
+
+define Build/Compile
+   CC=$(TARGET_CC) $(MAKE) -C $(PKG_BUILD_DIR) \
+   DESTDIR="$(PKG_INSTALL_DIR)" \
+   LD="$(TARGET_CC)" \
+   install-programs
+endef
+
+define Package/tgt/conffiles
+   /etc/config/tgt
+endef
+
+define Package/tgt/install
+   $(INSTALL_DIR) $(1)/
+   $(INSTALL_DIR) $(1)/usr/sbin
+   $(CP) ./files/* $(1)/
+   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tgtd $(1)/usr/sbin/
+   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tgtadm $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,tgt))
diff --git a/net/tgt/files/etc/config/tgt b/net/tgt/files/etc/config/tgt
new file mode 100644
index 000..250d12d
--- /dev/null
+++ b/net/tgt/files/etc/config/tgt
@@ -0,0 +1,38 @@
+config target 1
+   option name 'iqn.2012-06.org.openwrt:target1'
+   option allow ALL
+
+#config target 2
+#  option name 'iqn.2012-06.org.openwrt:t2'
+#  option allow 192.168.1.0/24
+
+
+# all options are set to default, except for the device
+# for all type and bstype values see tgtd(8)
+# lun "name" is constructed as TGTID_LUN
+#config lun1_1
+#  option readonly 0
+#  option device /dev/sda
+#  option type disk
+#  option bstype rdwr
+#  option sync 0
+#  option direct 0
+
+
+#config lun 2_1
+#  option readonly 0
+#  option device /mnt/iscsi.img
+
+#config lun 2_2
+#  option device /dev/sdc
+
+#config account
+#  option target 1
+#  option user "username1"
+#  option password "pass1"
+
+#config account
+#  option target 2
+#  option user "user2"
+#  option password "pwd2"
+#  option outgoing 1
diff --git a/net/tgt/files/etc/init.d/tgt b/net/tgt/files/etc/init.d/tgt
new file mode 100644
index 000..06496b1
--- /dev/null
+++ b/net/tgt/files/etc/init.d/tgt
@@ -0,0 +1,111 @@
+#!/bin/sh /etc/rc.common
+START=91
+STOP=10
+
+SERVICE_SIG_STOP=INT
+
+EXTRA_COMMANDS="show status"
+EXTRA_HELP="   showShow current configuration of tgtd
+   status  Check of tgtd is running"
+
+NAME=tgt
+EXEC=/usr/sbin/${NAME}d
+
+tgtadm="/usr/sbin/tgtadm --lld iscsi"
+
+handle_lun() {
+   local tgt_lun=$1
+   local tgtid=$2
+   local ro device type bstype sync direct
+   local my_tgtid=${tgt_lun%_*}
+   local lun=${tgt_lun#*_}
+   [ $my_tgtid -eq $tgtid ] || return 0
+
+   config_get device $1 device ""
+   [ "$device" ] || return 1
+
+   config_get type $1 type disk
+   config_get bstype $1 bstype rdwr
+   config_get_bool readonly $1 readonly 0
+   config_get_bool sync $1 sync 0
+   c

Re: [OpenWrt-Devel] [PATCH] Add leds back after migration to sysfs

2012-08-27 Thread Jonathan Bither
I can confirm that this issue effects EnGenius ECB-3500 as well.

On 08/27/2012 09:24 AM, Karl Palsson wrote:
> 
> I think this really just means that the Atheros platform needs to be broken 
> up into separate boards,
> like ar71xx and other newer platforms.  Currently a Atheros targets get 
> the same init code, and
> clearly your board needs different init code to mine :)
> 
> Cheers,
> Karl P
> 
> On Sun, Aug 26, 2012 at 10:13:33PM -0500, Ben West wrote:
>> This changeset on trunk appears to prevent booting up on a OM1P
>> (Atheros AR2315).  That is, freshly compiled r32884 boots fine on
>> OM1P, but flashing the device with r32885+ leads to unresponsive eth0
>> interface on OM1P.  I am lacking a TTL/serial cable, so I can't share
>> more information.
>>
>> https://dev.openwrt.org/changeset/32885/trunk
>>
>> Removing the line CONFIG_LEDS_GPIO=y from
>> target/linux/atheros/config-3.3 and recompiling leads to booting
>> firmware again.
>>
>> Since this is related to kernel GPIO LED control, I posted a bug
>> earlier this summer about a compile problem witnessed with
>> kmod-leds-gpio package for ath5k, but I had no patch to offer.
>> Perhaps, these problems are related?
>>
>> https://dev.openwrt.org/ticket/11797
>>
>> If not related, I do see CONFIG_LEDS_GPIO being unset in this
>> changeset from several years ago, with the comment specifically
>> referring to flash access errors.  Is changeset r32885 a regression
>> then?
>>
>> https://dev.openwrt.org/changeset/16765/
>>
>> On Fri, Jul 6, 2012 at 7:32 AM, Karl Palsson  wrote:
>>> From: Karl Palsson 
>>>
>>> atheros trunk moved to full sysfs gpiolib, but the leds were forgotten.
>>> This restores the wlan led that was missing after switching from backfire
>>> to trunk.
>>>
>>> Signed-off-by: Karl Palsson 
>>> ---
>>>  .../linux/atheros/base-files/etc/uci-defaults/leds |   11 +++
>>>  target/linux/atheros/config-3.3|1 +
>>>  2 files changed, 12 insertions(+), 0 deletions(-)
>>>  create mode 100644 target/linux/atheros/base-files/etc/uci-defaults/leds
>>>
>>> diff --git a/target/linux/atheros/base-files/etc/uci-defaults/leds 
>>> b/target/linux/atheros/base-files/etc/uci-defaults/leds
>>> new file mode 100644
>>> index 000..076a04b
>>> --- /dev/null
>>> +++ b/target/linux/atheros/base-files/etc/uci-defaults/leds
>>> @@ -0,0 +1,11 @@
>>> +#!/bin/sh
>>> +# Copyright 2012 OpenWrt.org
>>> +#
>>> +
>>> +. /lib/functions/uci-defaults.sh
>>> +
>>> +ucidef_set_led_netdev "wlan" "wlan" "wlan" "wlan0"
>>> +
>>> +ucidef_commit_leds
>>> +
>>> +exit 0
>>> diff --git a/target/linux/atheros/config-3.3 
>>> b/target/linux/atheros/config-3.3
>>> index be0c74a..c3713b3 100644
>>> --- a/target/linux/atheros/config-3.3
>>> +++ b/target/linux/atheros/config-3.3
>>> @@ -70,6 +70,7 @@ CONFIG_INITRAMFS_SOURCE=""
>>>  CONFIG_IP17XX_PHY=y
>>>  CONFIG_IRQ_CPU=y
>>>  CONFIG_IRQ_FORCED_THREADING=y
>>> +CONFIG_LEDS_GPIO=y
>>>  CONFIG_MDIO_BOARDINFO=y
>>>  CONFIG_MIPS=y
>>>  CONFIG_MIPS_L1_CACHE_SHIFT=5
>>> --
>>> 1.7.2.5
>>>
>>> ___
>>> openwrt-devel mailing list
>>> openwrt-devel@lists.openwrt.org
>>> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>>
>>
>>
>> -- 
>> Ben West
>> http://gowasabi.net
>> b...@gowasabi.net
>> ___
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] ag71xx: making the link state drop

2012-08-27 Thread Mark Mentovai
Gabor Juhos wrote:
> The problem is that PHYLIB in Linux does not fully stops the PHY device when a
> driver issues a phy_stop call.
> 
> Copy the attached patches into 'target/linux/ar71xx/patches-3.3', then do a
> 'make target/linux/clean world'. With these patches, the PHY of the WAN port
> will be powered down after 'ifconfig eth1 down' (on the WNDR3700 at least).

This works perfectly. Thanks so much, Gabor!
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Add leds back after migration to sysfs

2012-08-27 Thread Karl Palsson

I think this really just means that the Atheros platform needs to be broken up 
into separate boards,
like ar71xx and other newer platforms.  Currently a Atheros targets get the 
same init code, and
clearly your board needs different init code to mine :)

Cheers,
Karl P

On Sun, Aug 26, 2012 at 10:13:33PM -0500, Ben West wrote:
> This changeset on trunk appears to prevent booting up on a OM1P
> (Atheros AR2315).  That is, freshly compiled r32884 boots fine on
> OM1P, but flashing the device with r32885+ leads to unresponsive eth0
> interface on OM1P.  I am lacking a TTL/serial cable, so I can't share
> more information.
> 
> https://dev.openwrt.org/changeset/32885/trunk
> 
> Removing the line CONFIG_LEDS_GPIO=y from
> target/linux/atheros/config-3.3 and recompiling leads to booting
> firmware again.
> 
> Since this is related to kernel GPIO LED control, I posted a bug
> earlier this summer about a compile problem witnessed with
> kmod-leds-gpio package for ath5k, but I had no patch to offer.
> Perhaps, these problems are related?
> 
> https://dev.openwrt.org/ticket/11797
> 
> If not related, I do see CONFIG_LEDS_GPIO being unset in this
> changeset from several years ago, with the comment specifically
> referring to flash access errors.  Is changeset r32885 a regression
> then?
> 
> https://dev.openwrt.org/changeset/16765/
> 
> On Fri, Jul 6, 2012 at 7:32 AM, Karl Palsson  wrote:
> > From: Karl Palsson 
> >
> > atheros trunk moved to full sysfs gpiolib, but the leds were forgotten.
> > This restores the wlan led that was missing after switching from backfire
> > to trunk.
> >
> > Signed-off-by: Karl Palsson 
> > ---
> >  .../linux/atheros/base-files/etc/uci-defaults/leds |   11 +++
> >  target/linux/atheros/config-3.3|1 +
> >  2 files changed, 12 insertions(+), 0 deletions(-)
> >  create mode 100644 target/linux/atheros/base-files/etc/uci-defaults/leds
> >
> > diff --git a/target/linux/atheros/base-files/etc/uci-defaults/leds 
> > b/target/linux/atheros/base-files/etc/uci-defaults/leds
> > new file mode 100644
> > index 000..076a04b
> > --- /dev/null
> > +++ b/target/linux/atheros/base-files/etc/uci-defaults/leds
> > @@ -0,0 +1,11 @@
> > +#!/bin/sh
> > +# Copyright 2012 OpenWrt.org
> > +#
> > +
> > +. /lib/functions/uci-defaults.sh
> > +
> > +ucidef_set_led_netdev "wlan" "wlan" "wlan" "wlan0"
> > +
> > +ucidef_commit_leds
> > +
> > +exit 0
> > diff --git a/target/linux/atheros/config-3.3 
> > b/target/linux/atheros/config-3.3
> > index be0c74a..c3713b3 100644
> > --- a/target/linux/atheros/config-3.3
> > +++ b/target/linux/atheros/config-3.3
> > @@ -70,6 +70,7 @@ CONFIG_INITRAMFS_SOURCE=""
> >  CONFIG_IP17XX_PHY=y
> >  CONFIG_IRQ_CPU=y
> >  CONFIG_IRQ_FORCED_THREADING=y
> > +CONFIG_LEDS_GPIO=y
> >  CONFIG_MDIO_BOARDINFO=y
> >  CONFIG_MIPS=y
> >  CONFIG_MIPS_L1_CACHE_SHIFT=5
> > --
> > 1.7.2.5
> >
> > ___
> > openwrt-devel mailing list
> > openwrt-devel@lists.openwrt.org
> > https://lists.openwrt.org/mailman/listinfo/openwrt-devel
> 
> 
> 
> -- 
> Ben West
> http://gowasabi.net
> b...@gowasabi.net
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] avahi: Makefile fix to honor configuration changes

2012-08-27 Thread Mike Brady
This patch is to fix a long-standing problem with avahi builds:
if you change the configuration, sometimes the relevant packages are not
correctly rebuilt; see, for example, ticket #0.

Background: avahi can be built in two modes: with or without D-BUS support.
If you switch builds from one mode to the other and then back again, the 
packages will not
always be rebuilt as required. For example, if you choose to build avahi (1) 
without D-BUS support,
then (2) with D-BUS support and then (3) without D-BUS support, the packages 
will not
be rebuilt the third time, and you'll be left with the packages
from the second build -- packages that require D-BUS support.

The patch works by deleting the ".build" file belonging to the mode not 
currently chosen, so
that if that mode is chosen again in the future, its packages will always be 
rebuilt.

A few small corrections to the explanatory text are included.

Signed-off-by 

Index: libs/avahi/Makefile
===
--- libs/avahi/Makefile (revision 33271)
+++ libs/avahi/Makefile (working copy)
@@ -8,15 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 ifeq ($(BUILD_VARIANT),dbus)
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-dbus/$(PKG_NAME)-$(PKG_VERSION)
+   PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)/dbus/$(PKG_NAME)-$(PKG_VERSION)
+   PKG_ALT_DIR=$(BUILD_DIR)/$(PKG_NAME)/nodbus/$(PKG_NAME)-$(PKG_VERSION)
 else
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-nodbus/$(PKG_NAME)-$(PKG_VERSION)
+   PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)/nodbus/$(PKG_NAME)-$(PKG_VERSION)
+   PKG_ALT_DIR=$(BUILD_DIR)/$(PKG_NAME)/dbus/$(PKG_NAME)-$(PKG_VERSION)
 endif
 
 
 PKG_NAME:=avahi
 PKG_VERSION:=0.6.31
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@@ -68,8 +70,8 @@
  The libavahi package contains the mDNS/DNS-SD shared libraries,
  used by other programs. Specifically, it provides
  libavahi-core and libavahi-common libraries.
- By default, it is compiled without D-Bus support,
- i.e. the --disable-dbus compilation flag is set.
+ By default, it is built without D-Bus support,
+ i.e. the --disable-dbus configuration flag is set.
  To enable D-Bus support, select the package
  libavahi-dbus-support.
 endef
@@ -142,10 +144,10 @@
 $(call Package/libavahi/description)
  .
  The libavahi-dbus-support package enables
- D-Bus support in libavahi, needed to support
+ D-Bus support in avahi, needed to support
  the libavahi-client library and avahi-utils.
- Selecting this package modifies the contents of the
- libavahi package by setting the --enable-dbus compilation flag;
+ Selecting this package modifies the build configuration
+ so that avahi packages are built with support for D-BUS enabled;
  it does not generate a separate binary of its own.
  It also automatically adds the D-Bus package to the build.
  libavahi-dbus-support is selected automatically if you select
@@ -249,16 +251,20 @@
 endef
 
 define Package/libavahi-dbus-support/install
-   $(INSTALL_DIR) $(1)/usr/lib
+   $(INSTALL_DIR) $(1)/etc/dbus-1/system.d
+   $(CP) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d
 endef
 
 define Package/libavahi/install
+   # The next line removes the ".build" file from the "other" build.
+   # The effect is that, if the other build is re-selected in the future,
+   # the build system will be forced to replace all the code in the
+   # installer packages, removing anything from the current build.
+   # "Other" means this: if the current build is "dbus", the other is 
"nodebus",
+   # and if the current build is "nodbus", the other is "dbus".
+   $(RM) -f $(PKG_ALT_DIR)/.built
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* 
$(1)/usr/lib/
-ifeq ($(BUILD_VARIANT),dbus)
-   $(INSTALL_DIR) $(1)/etc/dbus-1/system.d
-   $(CP) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d
-endif
 endef
 
 define Package/libavahi-client/install

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


Re: [OpenWrt-Devel] [PATCH] ramips: Add support for 8devices Carambola dev board.

2012-08-27 Thread John Crispin
On 27/08/12 14:12, Petr Štetiar wrote:
> Tobias Diedrich  [2012-08-27 03:47:03]:
> 
>> Add support for 8devices Carambola dev board.
> 
> Hi,
> 
> 8D's stock kernel seems to have some more additions, like this ethernet[1]
> fix and gpiolib support[2]. Don't know what issue is that ethernet patch
> trying to fix, since there's no description of that issue. Having gpiolib+IRQ
> support would be nice (I haven't had time to test it myself yet, but according
> to their forums it's used quite heavily so it should be ok).
> 
> 1. 
> https://github.com/ynezz/openwrt/commit/634c66132b21b33eb9852818b3958c49c47ced8a
> 2. 
> https://github.com/ynezz/openwrt/commit/948f58e0774c6da6236fb43be304884ed79b2f09
> 
> -- ynezz

Hi,

Thanks for the pointers... its a real shame that 8D does not contribute
such changes back to the community on its own ...

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


Re: [OpenWrt-Devel] [PATCH] ramips: Add support for 8devices Carambola dev board.

2012-08-27 Thread Petr Štetiar
Tobias Diedrich  [2012-08-27 03:47:03]:

> Add support for 8devices Carambola dev board.

Hi,

8D's stock kernel seems to have some more additions, like this ethernet[1]
fix and gpiolib support[2]. Don't know what issue is that ethernet patch
trying to fix, since there's no description of that issue. Having gpiolib+IRQ
support would be nice (I haven't had time to test it myself yet, but according
to their forums it's used quite heavily so it should be ok).

1. 
https://github.com/ynezz/openwrt/commit/634c66132b21b33eb9852818b3958c49c47ced8a
2. 
https://github.com/ynezz/openwrt/commit/948f58e0774c6da6236fb43be304884ed79b2f09

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


Re: [OpenWrt-Devel] ag71xx: making the link state drop

2012-08-27 Thread Gabor Juhos
2012.08.25. 16:51 keltezéssel, Mark Mentovai írta:
> Is there a way to make the link state drop on an ag71xx interface, so that 
> it appears to whatever equipment is connected to the port that the cable 
> has been disconnected?
> 
> I've got a WNDR3700-family device and I need to make it appear to the 
> equipment connected to its eth1 interface that the cable has been 
> disconnected. "ifconfig eth1 down" doesn't alter the link state at all. 
> It'd be OK if the state just dropped momentarily and then returned. So 
> far, the best I've been able to do is reboot the entire WNDR3700. That's a 
> more drastic approach than I'd like to use, as there are other things 
> happening on the system that I'd rather not interrupt.
> 
> I'm very open to the possibility of ag71xx driver changes to make this 
> work (either as a local change or something for wider distribution) but I 
> haven't found any data sheets for this device, so I'd basically be 
> starting by stabbing around in the dark.
> 
> Does anyone have any pointers?
> 

The problem is that PHYLIB in Linux does not fully stops the PHY device when a
driver issues a phy_stop call.

Copy the attached patches into 'target/linux/ar71xx/patches-3.3', then do a
'make target/linux/clean world'. With these patches, the PHY of the WAN port
will be powered down after 'ifconfig eth1 down' (on the WNDR3700 at least).

Regards,
Gabor
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -510,6 +510,18 @@ static inline int phy_read_status(struct
 	return phydev->drv->read_status(phydev);
 }
 
+static inline void phy_suspend(struct phy_device *phydev)
+{
+	if (phydev->drv->suspend)
+		phydev->drv->suspend(phydev);
+}
+
+static inline void phy_resume(struct phy_device *phydev)
+{
+	if (phydev->drv->resume)
+		phydev->drv->resume(phydev);
+}
+
 int genphy_restart_aneg(struct phy_device *phydev);
 int genphy_config_aneg(struct phy_device *phydev);
 int genphy_update_link(struct phy_device *phydev);
--- a/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
+++ b/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
@@ -47,6 +47,7 @@ void ag71xx_phy_start(struct ag71xx *ag)
 	struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
 
 	if (ag->phy_dev) {
+		phy_resume(ag->phy_dev);
 		phy_start(ag->phy_dev);
 	} else if (pdata->switch_data) {
 		ag71xx_ar7240_start(ag);
@@ -61,10 +62,12 @@ void ag71xx_phy_stop(struct ag71xx *ag)
 	struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
 	unsigned long flags;
 
-	if (ag->phy_dev)
+	if (ag->phy_dev) {
 		phy_stop(ag->phy_dev);
-	else if (pdata->switch_data)
+		phy_suspend(ag->phy_dev);
+	} else if (pdata->switch_data) {
 		ag71xx_ar7240_stop(ag);
+	}
 
 	spin_lock_irqsave(&ag->lock, flags);
 	if (ag->link) {
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel