Re: [OpenWrt-Devel] [PATCH 1/3] b53: add b53_mac_array_to_u64() utility function
So, on a powerpc system this works. static inline u64 b53_mac_array_to_u64(const u8 *u8_arr) { u64 mac = 0; u8 *cmac = (u8 *)&mac; memcpy(&cmac[2], u8_arr, 6); return mac; } I've done this approach initially, but there were some concerns afterwards regarding endianness. On my x86_64 system it looks ok, but I'm hoping you'd validate that this is endian-correct and would work on little endian targets. And then I'll move this in the port mirroring patch. Thanks On Fri, Feb 27, 2015 at 8:36 PM, Jonas Gorski wrote: > Hi, > > On Mon, Feb 23, 2015 at 3:41 PM, Alexandru Ardelean > wrote: > > From: Alexandru Ardelean > > > > Converts an MAC array of u8 to a u64 value. > > > > Signed-off-by: Alexandru Ardelean > > --- > > target/linux/generic/files/drivers/net/phy/b53/b53_regs.h | 10 > ++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h > b/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h > > index ba50915..4379c58 100644 > > --- a/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h > > +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h > > @@ -20,6 +20,16 @@ > > #ifndef __B53_REGS_H > > #define __B53_REGS_H > > > > +/* Utility function for converting u8 arrays into u64 values to be > written with b53_write */ > > You only use this in b53_common.c, so why not just have it in there? > And maybe merge it into the patch atually adding a user. > > > +static inline u64 b53_mac_array_to_u64(const u8 *u8_arr) { > > + u64 mac = (*(const u64 *)u8_arr); > > Also this will likely produce alignment issues on e.g. mips, which > doesn't allow unaligned accesses. > > > +#ifdef __BIG_ENDIAN > > + return (mac >> 16); > > +#else > > + return (mac << 16); > > +#endif > > +} > > + > > /* Management Port (SMP) Page offsets */ > > #define B53_CTRL_PAGE 0x00 /* Control */ > > #define B53_STAT_PAGE 0x01 /* Status */ > > -- > > Jonas > ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] ICONV & ICONV_SET_TRANSLITERATE issue in trying to port suricata to openwrt
I'm working on porting suricata to openwrt and have run into an issue with iconv. It seems that there are different ways to invoke the ICONV libraries. Those porting suricata to freebsd had the same problem and error. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196720 From their patch it looks like they were able to invoke iconv with iconv:translit vs its default method Is there a similar configuration method for openwrt Makefiles? THe following is the error message I get while compiling. htp_transcoder.c: In function 'htp_transcode_params': htp_transcoder.c:68:5: warning: implicit declaration of function 'iconvctl' [-Wimplicit-function-declaration] iconvctl(cd, ICONV_SET_TRANSLITERATE, &iconv_param); ^ htp_transcoder.c:68:18: error: 'ICONV_SET_TRANSLITERATE' undeclared (first use in this function) iconvctl(cd, ICONV_SET_TRANSLITERATE, &iconv_param); ^ htp_transcoder.c:68:18: note: each undeclared identifier is reported only once for each function it appears in htp_transcoder.c:70:18: error: 'ICONV_SET_DISCARD_ILSEQ' undeclared (first use in this function) iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, &iconv_param); ^ make[7]: *** [htp_transcoder.lo] Error 1 Relevant section of my Makefile # # Copyright (C) 2007-2011 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # compiler need libyaml-dev include $(TOPDIR)/rules.mk PKG_NAME:=suricata PKG_VERSION:=2.0.6 PKG_RELEASE:=1 PKG_MAINTAINER:=Derek W PKG_LICENSE:=GPLv2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz # PKG_SOURCE:= http://www.openinfosecfoundation.org/download/suricata-2.0.6.tar.gz #PKG_SOURCE_URL:=http://www.openinfosecfoundation.org/download/ #PKG_MD5SUM:=14bfb3adc184d4da321c93ed9abae500 PKG_SOURCE_URL:=../suricata-2.0.6.tar.gz PKG_MD5SUM:=fd0ade58b6f5d25c7446e1f1d07d1edf PKG_INSTALL:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/nls.mk define Package/suricata SECTION:=net CATEGORY:=Network SUBMENU:=Web Servers/Proxies TITLE:=Suricata URL:=http://www.openinfosecfoundation.org DEPENDS:=+libpcre +pcre +libtool +libnetfilter-queue +libpcap +libnet +libyaml +zlib +libcap +libnids +libnet0 +libopenssl +libnfnetlink $(ICONV_DEPENDS) $(INTL_DEPENDS) +libintl-full +libmagic +libcap MENU:=1 endef TARGET_CPPFLAGS += \ -I$(STAGING_DIR)/usr/lib/ \ -I$(STAGING_DIR)/usr/include \ -I$(ICONV_PREFIX)/include \ -I$(INTL_PREFIX)/include \ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \ #-I$(ICONV_PREFIX)/include \ #-I$(INTL_PREFIX)/include \ TARGET_LDFLAGS += \ -L$(STAGING_DIR)/usr/lib/ \ -L$(ICONV_PREFIX)/lib \ -L$(INTL_PREFIX)/lib \ #-L$(ICONV_PREFIX)/lib \ #-L$(INTL_PREFIX)/lib \ #TARGET_CFLAGS += $(FPIC) "-D_DEFAULT_SOURCE" \ TARGET_CFLAGS += $(FPIC) \ MAKE_FLAGS +=\ CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \ ICONV_LIBS="-liconv $(if $(INTL_FULL),-lintl)" \ #ICONV_LIBS="-liconv" \ MAKE_VARS +=\ PREFIX="$(STAGING_DIR)/usr" \ ICONV_PREFIX="$(ICONV_PREFIX)" \ INTL_PREFIX="$(INTL_PREFIX)" \ CONFIGURE_ARGS += \ --enable-nfqueue \ $(if $(ICONV_FULL),--with-libiconv=gnu) \ #INTL_PREFIX="$(INTL_PREFIX)" \ #define Build/Configure #$(call Build/Configure/Default, \ #--enable-nfqueue \ #CPPFLAGS="$(TARGET_CPPFLAGS)" \ #CXXFLAGS="$(TARGET_CFLAGS)" \ #LDFLAGS="$(TARGET_LDFLAGS)" \ #) #endef #define Build/Compile #$(MAKE) -C $(PKG_BUILD_DIR) \ #LDFLAGS="$(TARGET_LDFLAGS)" \ #all install #endef define Package/suricata/install $(INSTALL_DIR) $(1)/usr/sbin endef $(eval $(call BuildPackage,suricata)) ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] lantiq: fix netdev setup in ltq-ptm-vdsl
The initial fix for 3.18 in r44346 wrongly treated the newly added parameter of alloc_netdev to be another function pointer, causing ether_config to be skipped during ptm netdev init. Fix this by partially reverting r44346 and properly setting the newly added macro parameter. (Tested on VRX200 board) A similar change might be needed for ltq-ptm-adsl as well. Signed-off-by: Daniel Golle --- package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c index 9c25c15..b328261 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c @@ -66,7 +66,7 @@ unsigned long cgu_get_pp32_clock(void) return rate; } -static void ptm_setup(struct net_device *); +static void ptm_setup(struct net_device *, int); static struct net_device_stats *ptm_get_stats(struct net_device *); static int ptm_open(struct net_device *); static int ptm_stop(struct net_device *); @@ -134,9 +134,8 @@ unsigned int ifx_ptm_dbg_enable = DBG_ENABLE_MASK_ERR; * */ -static void ptm_setup(struct net_device *dev) +static void ptm_setup(struct net_device *dev, int ndev) { -int ndev = 0; dev->netdev_ops = &g_ptm_netdev_ops; netif_napi_add(dev, &g_ptm_priv_data.itf[ndev].napi, ptm_napi_poll, 16); dev->watchdog_timeo = ETH_WATCHDOG_TIMEOUT; @@ -952,9 +951,10 @@ static int ifx_ptm_init(void) } for ( i = 0; i < ARRAY_SIZE(g_net_dev); i++ ) { -g_net_dev[i] = alloc_netdev(0, g_net_dev_name[i], ether_setup, ptm_setup); +g_net_dev[i] = alloc_netdev(0, g_net_dev_name[i], NET_NAME_UNKNOWN, ether_setup); if ( g_net_dev[i] == NULL ) goto ALLOC_NETDEV_FAIL; +ptm_setup(g_net_dev[i], i); } for ( i = 0; i < ARRAY_SIZE(g_net_dev); i++ ) { -- 2.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH][RFT] omap: switch kernel to 3.18
On 28.02.2015 16:01, Rafał Miłecki wrote: > Signed-off-by: Rafał Miłecki > --- > Hey guys, > > My previous request (posted half a year ago) was completely ignored: > [PATCH][RFT] omap: switch kernel to 3.14 > https://lists.openwrt.org/pipermail/openwrt-devel/2014-September/027845.html > > I'll really appreciate if someone can try this patch. 3.13 is really an > old kernel and all OpenWrt targets dropped it already. I really hope we > can do the same for omap and drop 3.13 from generic. > --- > target/linux/omap/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/target/linux/omap/Makefile b/target/linux/omap/Makefile > index 03a2c24..20f7517 100644 > --- a/target/linux/omap/Makefile > +++ b/target/linux/omap/Makefile > @@ -13,7 +13,7 @@ FEATURES:=usb usbgadget ext4 targz fpu audio display nand > ubifs > CPU_TYPE:=cortex-a9 > CPU_SUBTYPE:=vfpv3 > > -KERNEL_PATCHVER:=3.13 > +KERNEL_PATCHVER:=3.18 > > MAINTAINER:=Imre Kaloz > > +1 for pushing 3.13 build on buildbots is broken anyway because of some missing/wrong Kernel symbols and versions with iptables or stuff in include/netfilter.mk I successfully booted 3.18-rcX a while ago on my (EBV) Beagleboard C4. My bootlog of 3.18.7: http://paste.debian.net/159227/ using ext3 rootfs Not tested yet: USB, USB-OTG, HDMI, Audio, ubifs on sdcard There are some boot/documentation issues depending on the uBoot version installed in NAND and if the USR button is pressed or not (and corresponding values of uboot variables/scripts) that are related to log entries with ** Unable to read "boot.scr" from mmc 0:1 ** or ** Unable to read file user.txt ** ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] lantiq: vr9-vdsl-fw: update w921v firmware version
Signed-off-by: Daniel Golle --- package/kernel/lantiq/ltq-vdsl-fw/src/vdsl_fw_install.sh | 8 package/kernel/lantiq/ltq-vdsl-fw/src/w921v_fw_cutter.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package/kernel/lantiq/ltq-vdsl-fw/src/vdsl_fw_install.sh b/package/kernel/lantiq/ltq-vdsl-fw/src/vdsl_fw_install.sh index 8349505..c55ac41 100755 --- a/package/kernel/lantiq/ltq-vdsl-fw/src/vdsl_fw_install.sh +++ b/package/kernel/lantiq/ltq-vdsl-fw/src/vdsl_fw_install.sh @@ -1,13 +1,13 @@ #!/bin/sh . /lib/functions.sh -FW="/tmp/Firmware_Speedport_W921V_1.20.000.bin" -URL="http://hilfe.telekom.de/dlp/eki/downloads/Speedport/Speedport%20W%20921V/Firmware_Speedport_W921V_1.20.000.bin"; +FW="/tmp/Firmware_Speedport_W921V_1.36.000.bin" +URL="http://hilfe.telekom.de/dlp/eki/downloads/Speedport/Speedport%20W%20921V/Firmware_Speedport_W921V_1.36.000.bin"; FW_TAPI="vr9_tapi_fw.bin" FW_DSL="vr9_dsl_fw_annex_b.bin" -MD5_FW="4d812f2c3476dadd738b022c4767c491" +MD5_FW="8f155d5d3f963e9fe207817280d541f9" MD5_TAPI="06b6ab3481b8d3eb7e8bf6131f7f6b7f" -MD5_DSL="59dd9dc81195c6854433c691b163f757" +MD5_DSL="96465516993771e5a192ab94813f404d" [ -f /lib/firmware/vdsl.bin ] && exit 0 diff --git a/package/kernel/lantiq/ltq-vdsl-fw/src/w921v_fw_cutter.c b/package/kernel/lantiq/ltq-vdsl-fw/src/w921v_fw_cutter.c index ad2e018..96aff77 100644 --- a/package/kernel/lantiq/ltq-vdsl-fw/src/w921v_fw_cutter.c +++ b/package/kernel/lantiq/ltq-vdsl-fw/src/w921v_fw_cutter.c @@ -26,7 +26,7 @@ #include "LzmaWrapper.h" -#define FW_NAME"/tmp/Firmware_Speedport_W921V_1.20.000.bin" +#define FW_NAME"/tmp/Firmware_Speedport_W921V_1.36.000.bin" #define MAGIC 0x50 #define MAGIC_SZ 0x3FFC00 @@ -78,7 +78,7 @@ int main(int argc, char **argv) if (stat(FW_NAME, &s) != 0) { printf("Failed to find %s\n", FW_NAME); - printf("Ask Google or try http://hilfe.telekom.de/dlp/eki/downloads/Speedport/Speedport%20W%20921V/Firmware_Speedport_W921V_1.20.000.bin\n";); + printf("Ask Google or try http://hilfe.telekom.de/dlp/eki/downloads/Speedport/Speedport%20W%20921V/Firmware_Speedport_W921V_1.36.000.bin\n";); return -1; } -- 2.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq: vr9-vdsl-fw: update w921v firmware version
Hi Felix! On Tue, Mar 03, 2015 at 07:04:25AM +1300, Felix Fietkau wrote: > > Signed-off-by: Daniel Golle > Did you test this properly? Not really tested, yet. w921v_fw_cutter does recognize all the magics and the file header and tail looks very much like the firmware I'm currently using on a VDSL2 line with PTM on a VRX200 using kernel 3.18 with the patch posted just before the w921v_fw_cutter bump. Noticable changes since the previous version are that vectoring was added (->changelog on T-Com download site), so it's a good question if user-space also had to be adjusted for that or if the API remained compatible... I'll be able to try replacing my current vdsl.bin with the blob extracted from the w921v download somewhen later tonight I hope (right now the device is in "productive use", I'll have to wait for everyone to go to sleep before making them unhappy...) Cheers Daniel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] lantiq: vr9-vdsl-fw: update w921v firmware version
On 02/03/2015 19:16, Daniel Golle wrote: > Hi Felix! > > On Tue, Mar 03, 2015 at 07:04:25AM +1300, Felix Fietkau wrote: >>> Signed-off-by: Daniel Golle >> Did you test this properly? > Not really tested, yet. w921v_fw_cutter does recognize all the > magics and the file header and tail looks very much like the > firmware I'm currently using on a VDSL2 line with PTM on a VRX200 > using kernel 3.18 with the patch posted just before the > w921v_fw_cutter bump. > > Noticable changes since the previous version are that vectoring > was added (->changelog on T-Com download site), so it's a good > question if user-space also had to be adjusted for that or if the > API remained compatible... > > I'll be able to try replacing my current vdsl.bin with the blob > extracted from the w921v download somewhen later tonight I hope > (right now the device is in "productive use", I'll have to wait for > everyone to go to sleep before making them unhappy...) > i tried this before and it did not work ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] What's happened to buildbot?
Hi, openwrt's buildbot has been down for several days now, someone in the forum says that it does not build anything since 26th of February. https://forum.openwrt.org/viewtopic.php?id=56052 https://dev.openwrt.org/ticket/19078 Both threads are without any feedback as of now. Any idea when it will be back online? Regards, Gergely ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel