Re: [OpenWrt-Devel] Read-only mirror https://github.com/openwrt/openwrt is stuck since 12 days ago
Hi, On Mar 7, 2016 2:52 AM, John Crispinwrote: > > > > On 07/03/2016 11:47, Álvaro Fernández Rojas wrote: > > I just want to add that openwrt-commits list is also affected, since last commit published there matches the last one in the read-only mirror. > > > > Regards, > > Álvaro. > > i noticed that one aswell, will investigate ... sorry for the > delay/inconvenience > > Not to pile on, but is there any way to have the commit hashes on github match those at openwrt.org (e.g., a true mirror)? > > > > >> El 6 mar 2016, a las 19:33, Hannu Nyman escribió: > >> > >> The read-only mirror for the main Openwrt sources at Github has been stuck since 12 days ago. > >> > >> https://github.com/openwrt/openwrt > >> > >> Both trunk and Chaos Calmer have got new commits since then... > >> > >> Apparently the mirror has not returned to automatic updates after the network/hardware troubles. > >> ___ > >> openwrt-devel mailing list > >> openwrt-devel@lists.openwrt.org > >> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel > > ___ > > openwrt-devel mailing list > > openwrt-devel@lists.openwrt.org > > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel > > > ___ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] base-files: fix generating network configuration
Hi: On Dec 30, 2015 4:01 AM, Yousong Zhouwrote: > > With the default /e/c/network present, board_detect won't create a new > config from board.json. Move this default configuration to > generate_static_network of config_generate instead. > > This should fix the issue on malta target and should not affect other > targets that provide its own default network config > > Signed-off-by: Yousong Zhou > --- > package/base-files/files/bin/config_generate | 8 > package/base-files/files/etc/config/network | 18 -- > 2 files changed, 8 insertions(+), 18 deletions(-) > delete mode 100644 package/base-files/files/etc/config/network > > diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate > index 9218788..39a0c60 100755 > --- a/package/base-files/files/bin/config_generate > +++ b/package/base-files/files/bin/config_generate > @@ -14,6 +14,14 @@ generate_static_network() { > set network.loopback.proto='static' > set network.loopback.ipaddr='127.0.0.1' > set network.loopback.netmask='255.0.0.0' > + delete network.lan > + network.lan=interface Should the syntax of these be "set network.lan..."? > + network.lan.type='bridge' > + network.lan.ifname='eth1' > + network.lan.proto='static' > + network.lan.ipaddr='192.168.1.1' > + network.lan.netmask='255.255.255.0' > + network.lan.ip6assign='60' > delete network.globals > set network.globals='globals' > set network.globals.ula_prefix='auto' > diff --git a/package/base-files/files/etc/config/network b/package/base-files/files/etc/config/network > deleted file mode 100644 > index d3cd3c6..000 > --- a/package/base-files/files/etc/config/network > +++ /dev/null > @@ -1,18 +0,0 @@ > -# Copyright (C) 2006 OpenWrt.org > - > -config interface loopback > - option ifname lo > - option proto static > - option ipaddr 127.0.0.1 > - option netmask 255.0.0.0 > - > -config interface lan > - option ifname eth0 > - option type bridge > - option proto static > - option ipaddr 192.168.1.1 > - option netmask 255.255.255.0 > - option ip6assign 60 > - > -config globals globals > - option ula_prefix auto > -- > 2.6.3 > ___ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] brcm47xx: explicitly select CPU_MIPS32_R2 and CPU_MIPSR2 for mips74k
The mips74k subtarget of brcm47xx configures gcc to compile for mips32r2; however, the generated kernel config for 3.14 and later kernels ends up with CPU_MIPS32_R1 and CPU_MIPSR1 selected. The generated kernel config for the 3.10 kernel (Barrier Breaker) properly selected CPU_MIPS32_R2 and CPU_MIPSR2. Modify the default kernel config for mips74k to explicitly select CPU_MIPS32_R2 and CPU_MIPSR2. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- target/linux/brcm47xx/mips74k/config-default | 4 1 file changed, 4 insertions(+) diff --git a/target/linux/brcm47xx/mips74k/config-default b/target/linux/brcm47xx/mips74k/config-default index 2b4497d..09ff5a9 100644 --- a/target/linux/brcm47xx/mips74k/config-default +++ b/target/linux/brcm47xx/mips74k/config-default @@ -2,6 +2,10 @@ # CONFIG_BCM47XX_SSB is not set CONFIG_BGMAC=y CONFIG_BOUNCE=y +# CONFIG_CPU_MIPS32_R1 is not set +# CONFIG_CPU_MIPSR1 is not set +CONFIG_CPU_MIPS32_R2=y +CONFIG_CPU_MIPSR2=y # CONFIG_FIXED_PHY is not set # CONFIG_GPIO_WDT is not set CONFIG_HIGHMEM=y -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] kirkwood: include kernel images and DTB in rootfs
Date: Sat, 24 Jan 2015 12:25:41 +0100 From: dan...@makrotopia.org To: openwrt-devel@lists.openwrt.org Subject: Re: [OpenWrt-Devel] [PATCH] kirkwood: include kernel images and DTB in rootfs Hi Nathan, I don't believe that files inside UBIFS rootfs is the right approach for kernel and dtb. Given that the bootloader already supports UBI, why not use use a UBI volume instead? While U-Boot does support reading files from UBIFS, squashfs inside UBI volumes are not supported (squashfs inside read-only UBI volume is desirable if you like having the features depending on ROM+overlay such as failsafe and factory restore similar to other hardware targets). The Kirkwood target is part of OpenWrt for a long while already, longer than proper UBI support is around and long before wasting any thoughts about rootfs_overlay on NAND. Our current state of the art is to have squashfs read-only rootfs, just like on NOR devices, using UBIFS as rootfs_overlay (instead of JFFS2 on NOR). For bootloaders supporting UBI it makes sense to store kernel (and DTB) in a UBI volume and load them from there. Take a look at SysupgradeNAND and UbinizeImage targets in image.mk for examples. Cheers Daniel Hi Daniel, What I've been working on lately is to get OpenWrt running on a GuruPlug Server Plus I have that has been mostly gathering dust up until now. I've updated to the latest uboot, patched for Guruplug in a similar fashion to the Dockstar/IConnect/PogoPlug patches that can be found in package/boot/uboot-kirkwood/patches (but w/o second_stage_uboot). All of those devices have been patched to load the kernel image and DTB from the rootfs (based on the default environment variables set up in the OpenWrt uboot), and I basically followed that model. What I don't understand is how any of those would work out of the box unless you were to specify to include the kernal image and DTB in the rootfs (which none of them do). I'm obviously missing something. Any ideas? The change you are suggesting would probably best be addressed by the target maintainer; but I may experiment with it a bit too. Thanks for the pointers! Nathan On Fri, Jan 23, 2015 at 08:57:57PM -0800, Nathan Hintz wrote: For SheevaPlug and GuruPlug devices. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- target/linux/kirkwood/profiles/120-plug.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/linux/kirkwood/profiles/120-plug.mk b/target/linux/kirkwood/profiles/120-plug.mk index dcbda71..473955d 100644 --- a/target/linux/kirkwood/profiles/120-plug.mk +++ b/target/linux/kirkwood/profiles/120-plug.mk @@ -7,6 +7,7 @@ define Profile/SHEEVAPLUG NAME:=Globalscale Technologies SheevaPlug + DEPENDS:=+@TARGET_ROOTFS_INCLUDE_KERNEL +@TARGET_ROOTFS_INCLUDE_ZIMAGE +@TARGET_ROOTFS_INCLUDE_DTB PACKAGES:= \ kmod-mmc kmod-mvsdio kmod-usb2 kmod-usb-storage \ kmod-of-i2c kmod-i2c-core kmod-i2c-mv64xxx \ @@ -24,6 +25,7 @@ $(eval $(call Profile,SHEEVAPLUG)) define Profile/SHEEVAPLUGSATA NAME:=Globalscale Technologies eSATA SheevaPlug + DEPENDS:=+@TARGET_ROOTFS_INCLUDE_KERNEL +@TARGET_ROOTFS_INCLUDE_ZIMAGE +@TARGET_ROOTFS_INCLUDE_DTB PACKAGES:= \ kmod-mmc kmod-mvsdio kmod-usb2 kmod-usb-storage \ kmod-of-i2c kmod-i2c-core kmod-i2c-mv64xxx \ @@ -42,6 +44,7 @@ $(eval $(call Profile,SHEEVAPLUGSATA)) define Profile/Guruplug-Server-Plus NAME:=Globalscale Technologies Guruplug Server Plus + DEPENDS:=+@TARGET_ROOTFS_INCLUDE_KERNEL +@TARGET_ROOTFS_INCLUDE_ZIMAGE +@TARGET_ROOTFS_INCLUDE_DTB PACKAGES:= \ kmod-mmc kmod-mvsdio kmod-usb2 kmod-usb-storage \ kmod-of-i2c kmod-i2c-core kmod-i2c-mv64xxx \ -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] procd: increase memory allocated for tmpfs on zram
Devices with = 32MB of ram get half of memory allocated to zram (up to 16MB). Devices with 32MB of ram get just 8MB of memory allocated to zram. Increase memory allocated to devices with 32MB ram to 16MB. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- initd/zram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/initd/zram.c b/initd/zram.c index 4dc1d2e..49480af 100644 --- a/initd/zram.c +++ b/initd/zram.c @@ -44,7 +44,7 @@ proc_meminfo(void) fclose(fp); if (val KB(32)) - val = KB(16); + val = KB(32); return val; } -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] kirkwood: modify guruplug profile name
This makes the naming pattern of the output rootfs and image files consistent with the naming of the DTB file. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- target/linux/kirkwood/image/Makefile | 4 ++-- target/linux/kirkwood/profiles/120-plug.mk | 10 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index ede7cb3..52fed2d 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -144,8 +144,8 @@ Image/InstallKernel/Template/SHEEVAPLUG=$(call Image/InstallKernel/Template,shee Image/BuildKernel/Template/SHEEVAPLUGSATA=$(call Image/BuildKernel/Template,sheevaplug-esata) Image/InstallKernel/Template/SHEEVAPLUGSATA=$(call Image/InstallKernel/Template,sheevaplug-esata) -Image/BuildKernel/Template/GuruplugServerPlus=$(call Image/BuildKernel/Template,guruplug-server-plus) -Image/InstallKernel/Template/GuruplugServerPlus=$(call Image/InstallKernel/Template,guruplug-server-plus) +Image/BuildKernel/Template/Guruplug-Server-Plus=$(call Image/BuildKernel/Template,guruplug-server-plus) +Image/InstallKernel/Template/Guruplug-Server-Plus=$(call Image/InstallKernel/Template,guruplug-server-plus) Image/BuildKernel/Template/Topkick1281P2=$(call Image/BuildKernel/Template,topkick) Image/InstallKernel/Template/Topkick1281P2=$(call Image/InstallKernel/Template,topkick) diff --git a/target/linux/kirkwood/profiles/120-plug.mk b/target/linux/kirkwood/profiles/120-plug.mk index cca703f..dcbda71 100644 --- a/target/linux/kirkwood/profiles/120-plug.mk +++ b/target/linux/kirkwood/profiles/120-plug.mk @@ -40,7 +40,7 @@ SHEEVAPLUGSATA_UBI_OPTS:=-m 2048 -p 128KiB -s 512 $(eval $(call Profile,SHEEVAPLUGSATA)) -define Profile/GuruplugServerPlus +define Profile/Guruplug-Server-Plus NAME:=Globalscale Technologies Guruplug Server Plus PACKAGES:= \ kmod-mmc kmod-mvsdio kmod-usb2 kmod-usb-storage \ @@ -50,14 +50,14 @@ define Profile/GuruplugServerPlus uboot-envtools endef -define Profile/GuruplugServerPlus/Description +define Profile/Guruplug-Server-Plus/Description Package set compatible with Globalscale Technologies Guruplug Server Plus board. endef -GuruplugServerPlus_UBIFS_OPTS:=-m 2048 -e 126KiB -c 4096 -GuruplugServerPlus_UBI_OPTS:=-m 2048 -p 128KiB -s 512 +Guruplug-Server-Plus_UBIFS_OPTS:=-m 2048 -e 126KiB -c 4096 +Guruplug-Server-Plus_UBI_OPTS:=-m 2048 -p 128KiB -s 512 -$(eval $(call Profile,GuruplugServerPlus)) +$(eval $(call Profile,Guruplug-Server-Plus)) define Profile/Topkick1281P2 NAME:=Univeral Scientific Industrial Co. Topkick-1281P2 -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] mac80211: fix fallback to macaddr
If '/sys/class/ieee80211/phyN' is not a symlink, the call to readlink produces either an empty path (if /sys/class/ieee80211/phyN/device doesn't exist) or a path that begins with '/sys/class/ieee80211' (which does not work with the subsequent line to strip '/sys/devices' from the beginning of the path). Modify the checks to detect these conditions, and fallback to using the macaddr. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/mac80211/files/lib/wifi/mac80211.sh | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh index 0b662eb..a7c4d2d 100644 --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh @@ -94,8 +94,12 @@ detect_mac80211() { [ -n $htmode ] append ht_capab option htmode $htmode $N - if [ -x /usr/bin/readlink ]; then + if [ -x /usr/bin/readlink -a -h /sys/class/ieee80211/${dev} ]; then path=$(readlink -f /sys/class/ieee80211/${dev}/device) + else + path= + fi + if [ -n $path ]; then path=${path##/sys/devices/} dev_id=option path '$path' else -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] mac80211: update libertas_sdio package name
Change the name of the package to match the module name so it matches the package name referenced by the Kirkwood (Guruplug) profile. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/mac80211/Makefile | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index df245d0..814eb1c 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -23,7 +23,7 @@ PKG_BUILD_PARALLEL:=1 PKG_MAINTAINER:=Felix Fietkau n...@openwrt.org PKG_DRIVERS = \ - adm8211 ath5k libertas-usb libertas-sd p54-common p54-pci p54-usb p54-spi \ + adm8211 ath5k libertas-usb libertas-sdio p54-common p54-pci p54-usb p54-spi \ rt2x00-lib rt2x00-pci rt2x00-usb rt2800-lib rt2400-pci rt2500-pci \ rt2500-usb rt61-pci rt73-usb rt2800-mmio rt2800-pci rt2800-usb rt2800-soc \ rtl8180 rtl8187 zd1211rw mac80211-hwsim carl9170 b43 b43legacy \ @@ -679,7 +679,7 @@ define KernelPackage/libertas-usb AUTOLOAD:=$(call AutoProbe,libertas usb8xxx) endef -define KernelPackage/libertas-sd +define KernelPackage/libertas-sdio $(call KernelPackage/mac80211/Default) DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +kmod-mmc +@DRIVER_WEXT_SUPPORT @!TARGET_uml TITLE:=Marvell 88W8686 Wireless Driver @@ -1606,7 +1606,7 @@ config-$(call config_package,net-hermes-pcmcia) += PCMCIA_HERMES config-y += HERMES_PRISM config-$(call config_package,adm8211) += ADM8211 -config-$(call config_package,libertas-sd) += LIBERTAS LIBERTAS_SDIO +config-$(call config_package,libertas-sdio) += LIBERTAS LIBERTAS_SDIO config-$(call config_package,libertas-usb) += LIBERTAS LIBERTAS_USB config-$(call config_package,mwl8k) += MWL8K config-$(call config_package,mwifiex-pcie) += MWIFIEX MWIFIEX_PCIE @@ -1721,7 +1721,7 @@ define KernelPackage/libertas-usb/install $(1)/lib/firmware/libertas/ endef -define KernelPackage/libertas-sd/install +define KernelPackage/libertas-sdio/install $(INSTALL_DIR) $(1)/lib/firmware/libertas $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8385_helper.bin \ @@ -1981,7 +1981,7 @@ $(eval $(call KernelPackage,adm8211)) $(eval $(call KernelPackage,ath5k)) $(eval $(call KernelPackage,lib80211)) $(eval $(call KernelPackage,libertas-usb)) -$(eval $(call KernelPackage,libertas-sd)) +$(eval $(call KernelPackage,libertas-sdio)) $(eval $(call KernelPackage,cfg80211)) $(eval $(call KernelPackage,mac80211)) $(eval $(call KernelPackage,p54-common)) -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] hostapd: add dependency to hostapd-common
'hostapd-common' is needed by all of the variants for wifi to function correctly (a number of the target profiles simply select 'wpad-mini'). Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/network/services/hostapd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 6bdf534..49bcb15 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -101,7 +101,7 @@ define Package/hostapd/Default CATEGORY:=Network TITLE:=IEEE 802.1x Authenticator URL:=http://hostap.epitest.fi/ - DEPENDS:=$(DRV_DEPENDS) +libubus + DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus endef define Package/hostapd @@ -142,13 +142,14 @@ define Package/wpad/Default SECTION:=net CATEGORY:=Network TITLE:=IEEE 802.1x Authenticator/Supplicant + DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus URL:=http://hostap.epitest.fi/ endef define Package/wpad $(call Package/wpad/Default) TITLE+= (full) - DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl +libubus + DEPENDS+=+WPA_SUPPLICANT_OPENSSL:libopenssl VARIANT:=wpad-full endef @@ -160,7 +161,6 @@ endef define Package/wpad-mini $(call Package/wpad/Default) TITLE+= (WPA-PSK only) - DEPENDS:=$(DRV_DEPENDS) +libubus VARIANT:=wpad-mini endef -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] libertas: configure sysfs symlinks
Update the libertas driver to configure symlinks in sysfs. This enables the driver to be handled correctly by the mac80211/netifd/hostapd scripts. With this patch, the wireless interface is functional on Guruplug Server Plus. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- .../801-libertas-configure-sysfs-links.patch| 21 + 1 file changed, 21 insertions(+) create mode 100644 package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch diff --git a/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch b/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch new file mode 100644 index 000..fe69568 --- /dev/null +++ b/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch @@ -0,0 +1,21 @@ +--- a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c +@@ -2084,6 +2084,8 @@ struct wireless_dev *lbs_cfg_alloc(struc + goto err_wiphy_new; + } + ++ set_wiphy_dev(wdev-wiphy, dev); ++ + lbs_deb_leave(LBS_DEB_CFG80211); + return wdev; + +--- a/drivers/net/wireless/libertas/main.c a/drivers/net/wireless/libertas/main.c +@@ -987,6 +987,7 @@ struct lbs_private *lbs_add_card(void *c + goto err_adapter; + } + ++ dev_net_set(dev, wiphy_net(wdev-wiphy)); + dev-ieee80211_ptr = wdev; + dev-ml_priv = priv; + SET_NETDEV_DEV(dev, dmdev); -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] libertas: set wireless macaddr
Update the wireless macaddr with the value retrieved from the H/W. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- .../mac80211/patches/802-libertas-set-wireless-macaddr.patch | 11 +++ 1 file changed, 11 insertions(+) create mode 100644 package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch diff --git a/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch b/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch new file mode 100644 index 000..3eaf416 --- /dev/null +++ b/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch @@ -0,0 +1,11 @@ +--- a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c +@@ -2172,6 +2172,8 @@ int lbs_cfg_register(struct lbs_private + wdev-wiphy-n_cipher_suites = ARRAY_SIZE(cipher_suites); + wdev-wiphy-reg_notifier = lbs_reg_notifier; + ++ memcpy(wdev-wiphy-perm_addr, priv-current_addr, ETH_ALEN); ++ + ret = wiphy_register(wdev-wiphy); + if (ret 0) + pr_err(cannot register wiphy device\n); -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] kirkwood: add wpad-mini to guruplug profile
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- target/linux/kirkwood/profiles/120-plug.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/kirkwood/profiles/120-plug.mk b/target/linux/kirkwood/profiles/120-plug.mk index 473955d..8b2a016 100644 --- a/target/linux/kirkwood/profiles/120-plug.mk +++ b/target/linux/kirkwood/profiles/120-plug.mk @@ -50,7 +50,7 @@ define Profile/Guruplug-Server-Plus kmod-of-i2c kmod-i2c-core kmod-i2c-mv64xxx \ kmod-ata-core kmod-ata-marvell-sata \ kmod-btmrvl kmod-btmrvl-sdio kmod-libertas kmod-libertas-sdio \ - uboot-envtools + uboot-envtools wpad-mini endef define Profile/Guruplug-Server-Plus/Description -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] modules: add lz4 compression support
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/linux/modules/lib.mk | 20 target/linux/generic/config-3.18 | 4 .../patches-3.18/262-compressor_kconfig_hack.patch | 16 ++-- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/package/kernel/linux/modules/lib.mk b/package/kernel/linux/modules/lib.mk index cd919ba..f230a99 100644 --- a/package/kernel/linux/modules/lib.mk +++ b/package/kernel/linux/modules/lib.mk @@ -117,6 +117,26 @@ endef $(eval $(call KernelPackage,lib-lzo)) +define KernelPackage/lib-lz4 + SUBMENU:=$(LIB_MENU) + DEPENDS:=@!(LINUX_3_3||LINUX_3_8||LINUX_3_10||LINUX_3_13||LINUX_3_14) + TITLE:=LZ4 support + KCONFIG:= \ + CONFIG_LZ4_COMPRESS \ + CONFIG_LZ4_DECOMPRESS + FILES:= \ + $(LINUX_DIR)/lib/lz4/lz4_compress.ko \ + $(LINUX_DIR)/lib/lz4/lz4_decompress.ko + AUTOLOAD:=$(call AutoProbe,lz4_compress lz4_decompress) +endef + +define KernelPackage/lib-lz4/description + Kernel module for LZ4 compression/decompression support +endef + +$(eval $(call KernelPackage,lib-lz4)) + + define KernelPackage/lib-raid6 SUBMENU:=$(LIB_MENU) TITLE:=RAID6 algorithm support diff --git a/target/linux/generic/config-3.18 b/target/linux/generic/config-3.18 index 1642b60..828c5b6 100644 --- a/target/linux/generic/config-3.18 +++ b/target/linux/generic/config-3.18 @@ -1876,6 +1876,9 @@ CONFIG_LZMA_COMPRESS=y CONFIG_LZMA_DECOMPRESS=y # CONFIG_LZO_COMPRESS is not set # CONFIG_LZO_DECOMPRESS is not set +# CONFIG_LZ4_COMPRESS is not set +# CONFIG_LZ4_DECOMPRESS is not set +# CONFIG_LZ4HC_COMPRESS is not set # CONFIG_M25PXX_PREFER_SMALL_SECTOR_ERASE is not set # CONFIG_MAC80211 is not set # CONFIG_MAC80211_MESSAGE_TRACING is not set @@ -4569,4 +4572,5 @@ CONFIG_XZ_DEC=y CONFIG_ZONE_DMA=y CONFIG_ZONE_DMA_FLAG=1 # CONFIG_ZRAM is not set +# CONFIG_ZRAM_LZ4_COMPRESS is not set # CONFIG_ZSMALLOC is not set diff --git a/target/linux/generic/patches-3.18/262-compressor_kconfig_hack.patch b/target/linux/generic/patches-3.18/262-compressor_kconfig_hack.patch index a24405d..51b4fc8 100644 --- a/target/linux/generic/patches-3.18/262-compressor_kconfig_hack.patch +++ b/target/linux/generic/patches-3.18/262-compressor_kconfig_hack.patch @@ -1,6 +1,6 @@ --- a/lib/Kconfig +++ b/lib/Kconfig -@@ -205,16 +205,16 @@ config RANDOM32_SELFTEST +@@ -205,25 +205,25 @@ config RANDOM32_SELFTEST # compression support is select'ed if needed # config ZLIB_INFLATE @@ -20,4 +20,16 @@ + tristate LZO decompress support config LZ4_COMPRESS - tristate +- tristate ++ tristate LZ4 compress support + + config LZ4HC_COMPRESS +- tristate ++ tristate LZ4HC compress support + + config LZ4_DECOMPRESS +- tristate ++ tristate LZ4 decompress support + + source lib/xz/Kconfig + -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] kirkwood: define ethernet aliases in the device tree
The aliases are needed for u-boot to update the ethernet mac addresses using the values from the u-boot environment. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- .../patches-3.14/180-kirkwood-ethernetn.patch | 33 ++ .../patches-3.18/180-kirkwood-ethernetn.patch | 17 +++ 2 files changed, 50 insertions(+) create mode 100644 target/linux/kirkwood/patches-3.14/180-kirkwood-ethernetn.patch create mode 100644 target/linux/kirkwood/patches-3.18/180-kirkwood-ethernetn.patch diff --git a/target/linux/kirkwood/patches-3.14/180-kirkwood-ethernetn.patch b/target/linux/kirkwood/patches-3.14/180-kirkwood-ethernetn.patch new file mode 100644 index 000..137fc98 --- /dev/null +++ b/target/linux/kirkwood/patches-3.14/180-kirkwood-ethernetn.patch @@ -0,0 +1,33 @@ +--- a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi +@@ -22,8 +22,10 @@ + }; + + aliases { +- gpio0 = gpio0; +- gpio1 = gpio1; ++ gpio0 = gpio0; ++ gpio1 = gpio1; ++ ethernet0 = eth0port; ++ ethernet1 = eth1port; + }; + + mbus { +@@ -242,7 +244,7 @@ + marvell,tx-checksum-limit = 1600; + status = disabled; + +- ethernet0-port@0 { ++ eth0port: ethernet0-port@0 { + compatible = marvell,kirkwood-eth-port; + reg = 0; + interrupts = 11; +@@ -273,7 +275,7 @@ + marvell,tx-checksum-limit = 1600; + status = disabled; + +- ethernet1-port@0 { ++ eth1port: ethernet1-port@0 { + compatible = marvell,kirkwood-eth-port; + reg = 0; + interrupts = 15; diff --git a/target/linux/kirkwood/patches-3.18/180-kirkwood-ethernetn.patch b/target/linux/kirkwood/patches-3.18/180-kirkwood-ethernetn.patch new file mode 100644 index 000..93608c4 --- /dev/null +++ b/target/linux/kirkwood/patches-3.18/180-kirkwood-ethernetn.patch @@ -0,0 +1,17 @@ +--- a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi +@@ -22,9 +22,11 @@ + }; + + aliases { +- gpio0 = gpio0; +- gpio1 = gpio1; +- i2c0 = i2c0; ++ gpio0 = gpio0; ++ gpio1 = gpio1; ++ i2c0 = i2c0; ++ ethernet0 = eth0port; ++ ethernet1 = eth1port; + }; + + mbus { -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] kirkwood: include kernel images and DTB in rootfs
For SheevaPlug and GuruPlug devices. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- target/linux/kirkwood/profiles/120-plug.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/linux/kirkwood/profiles/120-plug.mk b/target/linux/kirkwood/profiles/120-plug.mk index dcbda71..473955d 100644 --- a/target/linux/kirkwood/profiles/120-plug.mk +++ b/target/linux/kirkwood/profiles/120-plug.mk @@ -7,6 +7,7 @@ define Profile/SHEEVAPLUG NAME:=Globalscale Technologies SheevaPlug + DEPENDS:=+@TARGET_ROOTFS_INCLUDE_KERNEL +@TARGET_ROOTFS_INCLUDE_ZIMAGE +@TARGET_ROOTFS_INCLUDE_DTB PACKAGES:= \ kmod-mmc kmod-mvsdio kmod-usb2 kmod-usb-storage \ kmod-of-i2c kmod-i2c-core kmod-i2c-mv64xxx \ @@ -24,6 +25,7 @@ $(eval $(call Profile,SHEEVAPLUG)) define Profile/SHEEVAPLUGSATA NAME:=Globalscale Technologies eSATA SheevaPlug + DEPENDS:=+@TARGET_ROOTFS_INCLUDE_KERNEL +@TARGET_ROOTFS_INCLUDE_ZIMAGE +@TARGET_ROOTFS_INCLUDE_DTB PACKAGES:= \ kmod-mmc kmod-mvsdio kmod-usb2 kmod-usb-storage \ kmod-of-i2c kmod-i2c-core kmod-i2c-mv64xxx \ @@ -42,6 +44,7 @@ $(eval $(call Profile,SHEEVAPLUGSATA)) define Profile/Guruplug-Server-Plus NAME:=Globalscale Technologies Guruplug Server Plus + DEPENDS:=+@TARGET_ROOTFS_INCLUDE_KERNEL +@TARGET_ROOTFS_INCLUDE_ZIMAGE +@TARGET_ROOTFS_INCLUDE_DTB PACKAGES:= \ kmod-mmc kmod-mvsdio kmod-usb2 kmod-usb-storage \ kmod-of-i2c kmod-i2c-core kmod-i2c-mv64xxx \ -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] brcm47xx: move wrt610n_v2 and e3000_v1 to mips74k subtarget
Hi Rafał: Date: Sun, 19 Oct 2014 07:48:04 +0200 Subject: Re: [PATCH] brcm47xx: move wrt610n_v2 and e3000_v1 to mips74k subtarget From: zaj...@gmail.com To: nlhi...@hotmail.com CC: openwrt-devel@lists.openwrt.org; ha...@hauke-m.de On 19 October 2014 00:19, Nathan Hintz nlhi...@hotmail.com wrote: Neither are SSB Wifi They are. https://wikidevi.com/wiki/Linksys_WRT610N_v2 BCM4322 which is SSB based https://wikidevi.com/wiki/Linksys_E3000 BCM4322 which is SSB based I see your point; however, the E3000 and WRT610Nv2 are mips74k, and would get the same benefit from using the mips74k subtarget (mips32r2) as all of the others. The only difference that I can see is that the E3000 and WRT610nV2 are required to use the proprietary Broadcom wl driver (which is one of the supported profiles under the mips74k subtarget) in order to utilize the 5GHz radio; whereas, with at least some of the others, using the proprietary Broadcom wl driver is optional. I could modify the patch description to include this info and to keep the SSB Wifi comment if you think it is necessary. There are few devices we don't have perfect solution for. I'm aware that these 2 devices are MIPS 74K, but we're still bound to two solutions: 1) Use generic subtarget for E3000/WRT610Nv2 and make them suffer from less optimized code. That's what we do now. 2) Use mips74k subtarget for them, add ssb support to the mips74k, and make firmware bigger for dozens of other devices. There are no additional ssb bits that need to be added to the mips74k subtarget. The existing mips74k trx works out of the box on E3000 (and should work on WRT610nV2 as well). As you mentioned earlier, wl.ko doesn't require any of the in-kernel SSB parts, as it handles everything it needs internally. Simply build the mips74k target as it exists today; include the proprietary driver (or load it separately), and it all just works. The patch I've provided should be the only change that is needed (to build the device specific .bin files). In such situation we decided it's better option to make 2 devices suffer than dozens of other. We can't really afford running buildbot with dozens of subtargets. And no, forcing E3000/WRT610Nv2 to use closed source drivers, because we don't include ssb in a firmware is not an option. We are not DD-WRT :P Close source driver could be an *alternative*. Btw. b43 recently gained 5 GHz support for N-PHY cards (BCM4322), I'm not sure if it's available in BB stable, but should be in CC (shapshots) for sure. -- Rafał Nathan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] toolchain: fix binutils broken symlink
The Makefile for binutils creates a broken symlink to binutils-linaro in trunk/build_dir/toolchain-target_gcc-4.9-linaro_uClibc-0.9.33.2. Modify the Makefile to point the symlink to the correct directory. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- toolchain/binutils/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile index 567f88a..b88fbd8 100644 --- a/toolchain/binutils/Makefile +++ b/toolchain/binutils/Makefile @@ -63,7 +63,7 @@ endif define Host/Prepare $(call Host/Prepare/Default) - ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) + ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/ endef -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] brcm47xx: explicitly select CPU_MIPS32_R2 and CPU_MIPSR2 for mips74k
The mips74k subtarget of brcm47xx configures gcc to compile for mips32r2; however, the generated kernel config for the 3.14 kernel ends up with CPU_MIPS32_R1 and CPU_MIPSR1 selected. The generated kernel config for the 3.10 kernel properly selects CPU_MIPS32_R2 and CPU_MIPSR2. Modify the default kernel config for mips74k to explicitly select CPU_MIPS32_R2 and CPU_MIPSR2. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- target/linux/brcm47xx/mips74k/config-default | 4 1 file changed, 4 insertions(+) diff --git a/target/linux/brcm47xx/mips74k/config-default b/target/linux/brcm47xx/mips74k/config-default index 2b4497d..09ff5a9 100644 --- a/target/linux/brcm47xx/mips74k/config-default +++ b/target/linux/brcm47xx/mips74k/config-default @@ -2,6 +2,10 @@ # CONFIG_BCM47XX_SSB is not set CONFIG_BGMAC=y CONFIG_BOUNCE=y +# CONFIG_CPU_MIPS32_R1 is not set +# CONFIG_CPU_MIPSR1 is not set +CONFIG_CPU_MIPS32_R2=y +CONFIG_CPU_MIPSR2=y # CONFIG_FIXED_PHY is not set # CONFIG_GPIO_WDT is not set CONFIG_HIGHMEM=y -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] brcm47xx: move wrt610n_v2 and e3000_v1 to mips74k subtarget
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- target/linux/brcm47xx/image/Makefile | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/linux/brcm47xx/image/Makefile b/target/linux/brcm47xx/image/Makefile index 33a3c85..62f68c8 100644 --- a/target/linux/brcm47xx/image/Makefile +++ b/target/linux/brcm47xx/image/Makefile @@ -115,10 +115,6 @@ define Image/Build/generic/jffs2-64k $(call Image/Build/CyberTAN,$(1),wrt310n_v1,310N,1.0.10,$(patsubst jffs2-%,jffs2,$(1))) $(call Image/Build/CyberTAN,$(1),wrt350n_v1,EWCG,1.04.1,$(patsubst jffs2-%,jffs2,$(1))) $(call Image/Build/CyberTAN,$(1),wrt610n_v1,610N,1.0.1,$(patsubst jffs2-%,jffs2,$(1))) - - # BCMA SoC with SSB WiFi - $(call Image/Build/CyberTAN,$(1),wrt610n_v2,610N,2.0.0,$(patsubst jffs2-%,jffs2,$(1))) - $(call Image/Build/CyberTAN,$(1),e3000_v1,61XN,1.0.3,$(patsubst jffs2-%,jffs2,$(1))) endef # $(1): filesystem type. @@ -195,6 +191,7 @@ define Image/Build/mips74k/devices-with-64k-blocks $(call Image/Build/CyberTAN,$(1),wrt160n_v3,N150,3.0.3,$(patsubst jffs2-%,jffs2,$(1))) $(call Image/Build/CyberTAN,$(1),wrt310n_v2,310N,2.0.1,$(patsubst jffs2-%,jffs2,$(1))) $(call Image/Build/CyberTAN,$(1),wrt320n_v1,320N,1.0.5,$(patsubst jffs2-%,jffs2,$(1))) + $(call Image/Build/CyberTAN,$(1),wrt610n_v2,610N,2.0.0,$(patsubst jffs2-%,jffs2,$(1))) $(call Image/Build/CyberTAN,$(1),e900_v1,E900,1.0.4,$(patsubst jffs2-%,jffs2,$(1))) $(call Image/Build/CyberTAN,$(1),e1000_v1_v2,E100,1.1.2,$(patsubst jffs2-%,jffs2,$(1))) $(call Image/Build/CyberTAN,$(1),e1200_v1,E120,1.0.3,$(patsubst jffs2-%,jffs2,$(1))) @@ -203,6 +200,7 @@ define Image/Build/mips74k/devices-with-64k-blocks $(call Image/Build/CyberTAN,$(1),e1550_v1,1550,1.0.3,$(patsubst jffs2-%,jffs2,$(1))) $(call Image/Build/CyberTAN,$(1),e2000_v1,32XN,1.0.4,$(patsubst jffs2-%,jffs2,$(1))) $(call Image/Build/CyberTAN,$(1),e2500_v1_v2,E25X,1.0.7,$(patsubst jffs2-%,jffs2,$(1))) + $(call Image/Build/CyberTAN,$(1),e3000_v1,61XN,1.0.3,$(patsubst jffs2-%,jffs2,$(1))) $(call Image/Build/CyberTAN,$(1),e3200_v1,3200,1.0.1,$(patsubst jffs2-%,jffs2,$(1))) $(call Image/Build/CyberTAN,$(1),e4200_v1,4200,1.0.5,$(patsubst jffs2-%,jffs2,$(1))) endef -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH v4] brcm-wl: fix bash comparison error
Hi Alvaro: Date: Sat, 18 Oct 2014 13:55:39 +0200 From: nolt...@gmail.com To: openwrt-devel@lists.openwrt.org; ha...@hauke-m.de; blo...@openwrt.org; n...@openwrt.org Subject: [OpenWrt-Devel] [PATCH v4] brcm-wl: fix bash comparison error wlc returns a string number ending with \n, making it impossible to compare this value to a number. Signed-off-by: Álvaro Fernández Rojas nolt...@gmail.com --- v4: remove bashishm as suggested by Bastian Bittorf. v3: avoid using an extra variable. v2: use string comparison diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 69e3132..5994e26 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -209,7 +209,7 @@ enable_broadcom() { } local leddc=$(wlc ifname $device leddc) - [ $leddc -eq 0x ] || { + [ $leddc = '0x\n' ] || { leddc=0x005a000a; } Using the \n is not correct. I think the real problem is that the logic is reversed (should be instead of ||); although it might be better to eliminate the conditional entirely since leddc is always commanded to 0x when the interface is taken down. local leddc=$(wlc ifname $device leddc) [ $leddc = 0x ] { leddc=0x005a000a } Nathan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] broadcom_wl: eliminate compiler error with gcc-4.9-linaro
Attempting to build broadcom_wl (from trunk) with the linaro 4.9.x toolchain produces the following errors: .../wl_linux.c: In function 'wl_dump_ver': .../wl_linux.c:2302:3: error: macro __DATE__ might prevent reproducible builds [-Werror=date-time] __DATE__, __TIME__, EPI_VERSION_STR); ^ .../wl_linux.c:2302:13: error: macro __TIME__ might prevent reproducible builds [-Werror=date-time] __DATE__, __TIME__, EPI_VERSION_STR); ^ cc1: some warnings being treated as errors Remove the use of the __DATE__ and __TIME__ macros, as the info is not really useful. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- .../patches/914-eliminate-date-time-error.patch | 21 + 1 file changed, 21 insertions(+) create mode 100644 package/kernel/broadcom-wl/patches/914-eliminate-date-time-error.patch diff --git a/package/kernel/broadcom-wl/patches/914-eliminate-date-time-error.patch b/package/kernel/broadcom-wl/patches/914-eliminate-date-time-error.patch new file mode 100644 index 000..394a06d --- /dev/null +++ b/package/kernel/broadcom-wl/patches/914-eliminate-date-time-error.patch @@ -0,0 +1,21 @@ +--- a/driver/wl_linux.c b/driver/wl_linux.c +@@ -762,7 +762,7 @@ wl_attach(uint16 vendor, uint16 device, + dev-name, device); + + #ifdef BCMDBG +- printf( (Compiled in SRCBASE at __TIME__ on __DATE__ )); ++ printf( (Compiled in SRCBASE )); + #endif /* BCMDBG */ + printf(\n); + +@@ -2298,8 +2298,7 @@ wl_sendup(wl_info_t *wl, wl_if_t *wlif, + void + wl_dump_ver(wl_info_t *wl, struct bcmstrbuf *b) + { +- bcm_bprintf(b, wl%d: %s %s version %s\n, wl-pub-unit, +- __DATE__, __TIME__, EPI_VERSION_STR); ++ bcm_bprintf(b, wl%d: version %s\n, wl-pub-unit, EPI_VERSION_STR); + } + + #ifdef BCMDBG -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] brcm47xx: move wrt610n_v2 and e3000_v1 to mips74k subtarget
Hi Rafał: Date: Sat, 18 Oct 2014 21:28:29 +0200 Subject: Re: [PATCH] brcm47xx: move wrt610n_v2 and e3000_v1 to mips74k subtarget From: zaj...@gmail.com To: nlhi...@hotmail.com CC: openwrt-devel@lists.openwrt.org; ha...@hauke-m.de On 18 October 2014 21:08, Nathan Hintz nlhi...@hotmail.com wrote: - # BCMA SoC with SSB WiFi - $(call Image/Build/CyberTAN,$(1),wrt610n_v2,610N,2.0.0,$(patsubst jffs2-%,jffs2,$(1))) - $(call Image/Build/CyberTAN,$(1),e3000_v1,61XN,1.0.3,$(patsubst jffs2-%,jffs2,$(1))) They are there for a reason and there is even a comment for that! Can you be more explicit as to why they are an exception? Neither are SSB Wifi, and I have installed the mips74k trx with the broadcom_wl driver on my E3000 (basic trunk build from last night with just the patches listed below using GCC 4.9.x linaro), and it appears to me to be fully functional (I didn't test for many hours). http://patchwork.openwrt.org/patch/6504/ http://patchwork.openwrt.org/patch/6505/ http://patchwork.openwrt.org/patch/6506/ http://patchwork.openwrt.org/patch/6507/ Thanks, Nathan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH v4] brcm-wl: fix bash comparison error
Hi Bastian: Date: Sat, 18 Oct 2014 22:37:59 +0200 From: bitt...@bluebottle.com To: nlhi...@hotmail.com CC: nolt...@gmail.com; openwrt-devel@lists.openwrt.org; ha...@hauke-m.de Subject: Re: [OpenWrt-Devel] [PATCH v4] brcm-wl: fix bash comparison error * Nathan Hintz nlhi...@hotmail.com [18.10.2014 22:24]: Using the \n is not correct. I think the real problem is that the logic is reversed (should be instead of ||); although it might be better to eliminate the conditional entirely since leddc is always commanded to 0x when the interface is taken down. local leddc=$(wlc ifname $device leddc) [ $leddc = 0x ] { leddc=0x005a000a } what about: case $leddc in '0x'*) leddc='0x005a000a' ;; esac IMHO the approach from felix does not work: root@box:~ echo $((0x)) 65535 root@box:~ echo $((0x\n)) -ash: arithmetic syntax error the real would be the fix the output of 'wlc'. 'wlc' is not broken, a simple test case demonstrates it works as expected: root@e3000-1:~# wlc ifname wl0 leddc 0x005a000a root@e3000-1:~# wlc ifname wl0 leddc 0x root@e3000-1:~# wlc ifname wl0 leddc 0x root@e3000-1:~# leddc=$(wlc ifname wl0 leddc) root@e3000-1:~# [ $leddc = 0x ] echo yes yes root@e3000-1:~# wlc ifname wl0 leddc 0x005a000a root@e3000-1:~# wlc ifname wl0 leddc 0x005a000a root@e3000-1:~# leddc=$(wlc ifname wl0 leddc) root@e3000-1:~# [ $leddc = 0x ] echo yes root@e3000-1:~# Nathan bye bastian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] brcm47xx: move wrt610n_v2 and e3000_v1 to mips74k subtarget
Hi Rafał: Date: Sat, 18 Oct 2014 23:13:45 +0200 Subject: Re: [PATCH] brcm47xx: move wrt610n_v2 and e3000_v1 to mips74k subtarget From: zaj...@gmail.com To: nlhi...@hotmail.com CC: openwrt-devel@lists.openwrt.org; ha...@hauke-m.de On 18 October 2014 22:37, Nathan Hintz nlhi...@hotmail.com wrote: Hi Rafał: Date: Sat, 18 Oct 2014 21:28:29 +0200 Subject: Re: [PATCH] brcm47xx: move wrt610n_v2 and e3000_v1 to mips74k subtarget From: zaj...@gmail.com To: nlhi...@hotmail.com CC: openwrt-devel@lists.openwrt.org; ha...@hauke-m.de On 18 October 2014 21:08, Nathan Hintz nlhi...@hotmail.com wrote: - # BCMA SoC with SSB WiFi - $(call Image/Build/CyberTAN,$(1),wrt610n_v2,610N,2.0.0,$(patsubst jffs2-%,jffs2,$(1))) - $(call Image/Build/CyberTAN,$(1),e3000_v1,61XN,1.0.3,$(patsubst jffs2-%,jffs2,$(1))) They are there for a reason and there is even a comment for that! Can you be more explicit as to why they are an exception? Same to you about commit messages ;) I wasn't trying to be snarky; but that's OK. I'm just looking for info and to further the discussion. :-) Neither are SSB Wifi They are. https://wikidevi.com/wiki/Linksys_WRT610N_v2 BCM4322 which is SSB based https://wikidevi.com/wiki/Linksys_E3000 BCM4322 which is SSB based I see your point; however, the E3000 and WRT610Nv2 are mips74k, and would get the same benefit from using the mips74k subtarget (mips32r2) as all of the others. The only difference that I can see is that the E3000 and WRT610nV2 are required to use the proprietary Broadcom wl driver (which is one of the supported profiles under the mips74k subtarget) in order to utilize the 5GHz radio; whereas, with at least some of the others, using the proprietary Broadcom wl driver is optional. I could modify the patch description to include this info and to keep the SSB Wifi comment if you think it is necessary. and I have installed the mips74k trx with the broadcom_wl wl.ko doesn't use kernel ssb/bcma modules Nathan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/2,v2] ppp: fix o_special option printing
PPPD crashes (SEGV) when the 'dump' or 'dryrun' options are specified and an option defined internally as o_special with an option flag of OPT_A2STRVAL is used. The crash occurs because the option value is not saved when the parameter is processed, but is then referenced when printed. Additionally, the arg parameter is missing from the call to the printer utility. This was encountered using xl2tpd and the l2tp_ppp kernel module; the option PPPD crashes on is pppol2tp 8. Modify pppd to correctly save the option value, and to call the printer utility with the correct parameters. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- v2: Address comments from Yousong Zhou Please apply along with http://patchwork.openwrt.org/patch/5327/ package/network/services/ppp/Makefile | 2 +- .../services/ppp/patches/501-save-pppol2tp_fd_str.patch | 13 + .../network/services/ppp/patches/502-fix-printer-args.patch | 11 +++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 package/network/services/ppp/patches/501-save-pppol2tp_fd_str.patch create mode 100644 package/network/services/ppp/patches/502-fix-printer-args.patch diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index 4cee97a..724be30 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ppp PKG_VERSION:=2.4.6 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/ppp/ diff --git a/package/network/services/ppp/patches/501-save-pppol2tp_fd_str.patch b/package/network/services/ppp/patches/501-save-pppol2tp_fd_str.patch new file mode 100644 index 000..44d7fc5 --- /dev/null +++ b/package/network/services/ppp/patches/501-save-pppol2tp_fd_str.patch @@ -0,0 +1,13 @@ +--- a/pppd/plugins/pppol2tp/pppol2tp.c b/pppd/plugins/pppol2tp/pppol2tp.c +@@ -150,6 +150,10 @@ static int setdevname_pppol2tp(char **ar + fatal(PPPoL2TP kernel driver not installed); + } + ++ pppol2tp_fd_str = strdup(*argv); ++ if (pppol2tp_fd_str == NULL) ++ novm(PPPoL2TP FD); ++ + /* Setup option defaults. Compression options are disabled! */ + + modem = 0; diff --git a/package/network/services/ppp/patches/502-fix-printer-args.patch b/package/network/services/ppp/patches/502-fix-printer-args.patch new file mode 100644 index 000..e9201f3 --- /dev/null +++ b/package/network/services/ppp/patches/502-fix-printer-args.patch @@ -0,0 +1,11 @@ +--- a/pppd/options.c b/pppd/options.c +@@ -994,7 +994,7 @@ print_option(opt, mainopt, printer, arg) + p = (char *) opt-addr2; + if ((opt-flags OPT_STATIC) == 0) + p = *(char **)p; +- printer(%q, p); ++ printer(arg, %q, p); + } else if (opt-flags OPT_A2LIST) { + struct option_value *ovp; + -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 2/2] ppp: fix o_special option printing
Hi Yousong: ++ } ++ } else if (opt-flags OPT_A2LIST) { + struct option_value *ovp, *pp; + + ovp = malloc(sizeof(*ovp) + strlen(*argv)); +@@ -994,7 +1003,7 @@ print_option(opt, mainopt, printer, arg) + p = (char *) opt-addr2; + if ((opt-flags OPT_STATIC) == 0) + p = *(char **)p; +- printer(%q, p); ++ printer(arg, %q, p); + } else if (opt-flags OPT_A2LIST) { + struct option_value *ovp; + -- 1.9.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel From: yszhou4t...@gmail.com Date: Wed, 7 May 2014 14:40:20 +0800 Subject: Re: [OpenWrt-Devel] [PATCH 2/2] ppp: fix o_special option printing To: nlhi...@hotmail.com CC: openwrt-devel@lists.openwrt.org Hi, Nathan. On 7 May 2014 13:25, Nathan Hintz nlhi...@hotmail.com wrote: PPPD crashes (SEGV) when the 'dump' or 'dryrun' options are specified and an option defined internally as o_special with an option flag of OPT_A2STRVAL is used. The crash occurs because the option value is not saved when the parameter is processed, but is then referenced when printed. Additionally, the arg parameter is missing from the call to the printer utility. This was encountered using xl2tpd and the l2tp_ppp kernel module; the option PPPD crashes on is pppol2tp 8. I think the handling of OPT_A2STRVAL should be done in pppol2tp.c option handling function. Take `domain' option in options.c and `callback' option in cbcp.c as examples, the value of addr2 are set by handler of each. I got a chance to look at this this weekend, and I agree with your comment and will update the patch. I was contemplating a null pointer check in the print_option function in options.c to eliminate the possibility of crashing (if *(char **)addr2 was NULL); but that might not be necessary anymore. Thoughts? Modify pppd to correctly save the option value, and to call the printer utility with the correct parameters. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- Supersedes this patch: http://patchwork.openwrt.org/patch/3245/ package/network/services/ppp/Makefile | 2 +- .../501-fix-o_special-option-printing.patch | 29 ++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 package/network/services/ppp/patches/501-fix-o_special-option-printing.patch diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index 9bf9616..a707985 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ppp PKG_VERSION:=2.4.5 -PKG_RELEASE:=10 +PKG_RELEASE:=11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/ppp/ diff --git a/package/network/services/ppp/patches/501-fix-o_special-option-printing.patch b/package/network/services/ppp/patches/501-fix-o_special-option-printing.patch new file mode 100644 index 000..99b933f --- /dev/null +++ b/package/network/services/ppp/patches/501-fix-o_special-option-printing.patch @@ -0,0 +1,29 @@ +--- a/pppd/options.c b/pppd/options.c +@@ -809,7 +809,16 @@ process_option(opt, cmd, argv) + parser = (int (*) __P((char **))) opt-addr; + if (!(*parser)(argv)) + return 0; +- if (opt-flags OPT_A2LIST) { ++ if (opt-flags OPT_A2STRVAL) { ++ if (opt-flags OPT_STATIC) { ++ strlcpy((char *)(opt-addr2), *argv, opt-upper_limit); ++ } else { ++ sv = strdup(*argv); ++ if (sv == NULL) ++ novm(option argument); ++ *(char **)(opt-addr2) = sv; This reminds me of memory leak. :) This particular instance will be gone due to incorporation of your previous comment Regards. yousong Thanks for your input! Nathan ++ } ++ } else if (opt-flags OPT_A2LIST) { + struct option_value *ovp, *pp; + + ovp = malloc(sizeof(*ovp) + strlen(*argv)); +@@ -994,7 +1003,7 @@ print_option(opt, mainopt, printer, arg) + p = (char *) opt-addr2; + if ((opt-flags OPT_STATIC) == 0) + p = *(char **)p; +- printer(%q, p); ++ printer(arg, %q, p); + } else if (opt-flags OPT_A2LIST) { + struct option_value *ovp; + -- 1.9.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/2] ppp: fix printing of DNS/WINS addresses
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- Re-send of the following: http://patchwork.openwrt.org/patch/3246/ .../ppp/patches/502-fix-ms-dns-and-ms-wins-print.patch | 17 + 1 file changed, 17 insertions(+) create mode 100644 package/network/services/ppp/patches/502-fix-ms-dns-and-ms-wins-print.patch diff --git a/package/network/services/ppp/patches/502-fix-ms-dns-and-ms-wins-print.patch b/package/network/services/ppp/patches/502-fix-ms-dns-and-ms-wins-print.patch new file mode 100644 index 000..4a694e0 --- /dev/null +++ b/package/network/services/ppp/patches/502-fix-ms-dns-and-ms-wins-print.patch @@ -0,0 +1,17 @@ +--- a/pppd/ipcp.c b/pppd/ipcp.c +@@ -175,10 +175,10 @@ static option_t ipcp_option_list[] = { + { noipdefault, o_bool, disable_defaultip, + Don't use name for default IP adrs, 1 }, + +-{ ms-dns, 1, (void *)setdnsaddr, +- DNS address for the peer's use }, +-{ ms-wins, 1, (void *)setwinsaddr, +- Nameserver for SMB over TCP/IP for peer }, ++{ ms-dns, o_special, (void *)setdnsaddr, ++ DNS address for the peer's use, OPT_A2LIST }, ++{ ms-wins, o_special, (void *)setwinsaddr, ++ Nameserver for SMB over TCP/IP for peer, OPT_A2LIST }, + + { ipcp-restart, o_int, ipcp_fsm[0].timeouttime, + Set timeout for IPCP, OPT_PRIO }, -- 1.9.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/2] ppp: fix o_special option printing
PPPD crashes (SEGV) when the 'dump' or 'dryrun' options are specified and an option defined internally as o_special with an option flag of OPT_A2STRVAL is used. The crash occurs because the option value is not saved when the parameter is processed, but is then referenced when printed. Additionally, the arg parameter is missing from the call to the printer utility. This was encountered using xl2tpd and the l2tp_ppp kernel module; the option PPPD crashes on is pppol2tp 8. Modify pppd to correctly save the option value, and to call the printer utility with the correct parameters. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- Supersedes this patch: http://patchwork.openwrt.org/patch/3245/ package/network/services/ppp/Makefile | 2 +- .../501-fix-o_special-option-printing.patch| 29 ++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 package/network/services/ppp/patches/501-fix-o_special-option-printing.patch diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index 9bf9616..a707985 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ppp PKG_VERSION:=2.4.5 -PKG_RELEASE:=10 +PKG_RELEASE:=11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/ppp/ diff --git a/package/network/services/ppp/patches/501-fix-o_special-option-printing.patch b/package/network/services/ppp/patches/501-fix-o_special-option-printing.patch new file mode 100644 index 000..99b933f --- /dev/null +++ b/package/network/services/ppp/patches/501-fix-o_special-option-printing.patch @@ -0,0 +1,29 @@ +--- a/pppd/options.c b/pppd/options.c +@@ -809,7 +809,16 @@ process_option(opt, cmd, argv) + parser = (int (*) __P((char **))) opt-addr; + if (!(*parser)(argv)) + return 0; +- if (opt-flags OPT_A2LIST) { ++ if (opt-flags OPT_A2STRVAL) { ++ if (opt-flags OPT_STATIC) { ++ strlcpy((char *)(opt-addr2), *argv, opt-upper_limit); ++ } else { ++ sv = strdup(*argv); ++ if (sv == NULL) ++ novm(option argument); ++ *(char **)(opt-addr2) = sv; ++ } ++ } else if (opt-flags OPT_A2LIST) { + struct option_value *ovp, *pp; + + ovp = malloc(sizeof(*ovp) + strlen(*argv)); +@@ -994,7 +1003,7 @@ print_option(opt, mainopt, printer, arg) + p = (char *) opt-addr2; + if ((opt-flags OPT_STATIC) == 0) + p = *(char **)p; +- printer(%q, p); ++ printer(arg, %q, p); + } else if (opt-flags OPT_A2LIST) { + struct option_value *ovp; + -- 1.9.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] kernel: bgmac: rework patch checking packet length
Hi Rafał: From: zaj...@gmail.com To: ha...@hauke-m.de; openwrt-devel@lists.openwrt.org Date: Thu, 3 Apr 2014 19:26:48 +0200 Subject: [OpenWrt-Devel] [PATCH] kernel: bgmac: rework patch checking packet length This bgmac patch was an attempt to fix/workaround bug reported in https://dev.openwrt.org/ticket/7198 noticed on WNR3500L. Patch assumed length reported by the hardware was 0 and was trying to read it until getting a different value. This was actually the opposite. Lenghts were some invalid huge values that resulted in skb_over_panic. For example: skbuff: skb_over_panic: text:83b21074 len:57222 (...) skbuff: skb_over_panic: text:87af1024 len:43226 (...) skbuff: skb_over_panic: text:87af5024 len:8739 (...) So instead of that not-working patch checking for 0, write a new one checking for huge values. In case something like that happens, dump hardware state and drop the packet. It seems like it should be checking the returned flags in the dma header for an overflow error (the GPL sources for RT-N16 include such a check). Nathan Signed-off-by: Rafał Miłecki zaj...@gmail.com --- .../775-bgmac-check-length-of-received-frame.patch | 50 +++--- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/target/linux/generic/patches-3.10/775-bgmac-check-length-of-received-frame.patch b/target/linux/generic/patches-3.10/775-bgmac-check-length-of-received-frame.patch index f708e7d..c3d63b6 100644 --- a/target/linux/generic/patches-3.10/775-bgmac-check-length-of-received-frame.patch +++ b/target/linux/generic/patches-3.10/775-bgmac-check-length-of-received-frame.patch @@ -9,33 +9,31 @@ Subject: [PATCH] bgmac: check length of received frame --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c -@@ -349,6 +349,7 @@ static int bgmac_dma_rx_read(struct bgma - struct sk_buff *skb = slot-skb; - struct bgmac_rx_header *rx; - u16 len, flags; -+ int count; - - /* Unmap buffer to make it accessible to the CPU */ - dma_sync_single_for_cpu(dma_dev, slot-dma_addr, -@@ -357,6 +358,12 @@ static int bgmac_dma_rx_read(struct bgma - /* Get info from the header */ - rx = (struct bgmac_rx_header *)skb-data; - len = le16_to_cpu(rx-len); -+ for (count = 0; count 200; count++) { -+ len = le16_to_cpu(rx-len); -+ if (len) -+ break; -+ udelay(1); -+ } - flags = le16_to_cpu(rx-flags); - - do { -@@ -364,7 +371,7 @@ static int bgmac_dma_rx_read(struct bgma +@@ -363,6 +363,27 @@ static int bgmac_dma_rx_read(struct bgma + dma_addr_t old_dma_addr = slot-dma_addr; int err; ++ if (len BGMAC_RX_MAX_FRAME_SIZE) { ++ struct bgmac_dma_desc *dma_desc = ring-cpu_base + ring-start; ++ ++ bgmac_err(bgmac, Hardware reported invalid packet length %d for slot %d!\n, len, ring-start); ++ bgmac_err(bgmac, flags: 0x%04X\n, flags); ++ bgmac_err(bgmac, ctl0: 0x%08X\tctl1: 0x%08X\n, le32_to_cpu(dma_desc-ctl0), le32_to_cpu(dma_desc-ctl1)); ++ ++ bgmac_err(bgmac, BGMAC_DMA_RX_CTL: 0x%08X\n, bgmac_read(bgmac, ring-mmio_base + BGMAC_DMA_RX_CTL)); ++ bgmac_err(bgmac, BGMAC_DMA_RX_INDEX: 0x%08X\n, bgmac_read(bgmac, ring-mmio_base + BGMAC_DMA_RX_INDEX)); ++ bgmac_err(bgmac, BGMAC_DMA_RX_RINGLO: 0x%08X\n, bgmac_read(bgmac, ring-mmio_base + BGMAC_DMA_RX_RINGLO)); ++ bgmac_err(bgmac, BGMAC_DMA_RX_RINGHI: 0x%08X\n, bgmac_read(bgmac, ring-mmio_base + BGMAC_DMA_RX_RINGHI)); ++ bgmac_err(bgmac, BGMAC_DMA_RX_STATUS: 0x%08X\n, bgmac_read(bgmac, ring-mmio_base + BGMAC_DMA_RX_STATUS)); ++ bgmac_err(bgmac, BGMAC_DMA_RX_ERROR: 0x%08X\n, bgmac_read(bgmac, ring-mmio_base + BGMAC_DMA_RX_ERROR)); ++ ++ dma_sync_single_for_device(dma_dev, ++ slot-dma_addr, ++ BGMAC_RX_BUF_SIZE, ++ DMA_FROM_DEVICE); ++ break; ++ } ++ /* Check for poison and drop or pass the packet */ -- if (len == 0xdead flags == 0xbeef) { -+ if (!len || (len == 0xdead flags == 0xbeef)) { + if (len == 0xdead flags == 0xbeef) { bgmac_err(bgmac, Found poisoned packet at slot %d, DMA issue!\n, - ring-start); - dma_sync_single_for_device(dma_dev, -- 1.8.4.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] firewall: improve logging in hotplug script
Signed-off-by: Nathan Hintz nlhi...@hotmail.com Index: package/network/config/firewall/files/firewall.hotplug === --- package/network/config/firewall/files/firewall.hotplug (revision 39294) +++ package/network/config/firewall/files/firewall.hotplug (working copy) @@ -6,5 +6,5 @@ fw3 -q network $INTERFACE/dev/null || exit 0 -logger -t firewall Reloading firewall due to ifup of $INTERFACE ($DEVICE) +logger -t firewall Reloading firewall due to $ACTION of $INTERFACE ($DEVICE) fw3 -q reload ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH,v2 0/2] 6relayd updates
From 3ab6fc3a87c6782c324d0638da950efe35ca2194 Mon Sep 17 00:00:00 2001 From: Nathan Hintz nlhi...@hotmail.com Date: Tue, 14 Jan 2014 21:00:29 -0800 Subject: [PATCH,v2 0/2] 6relayd updates Hi Steven: Of the gaggle of patches I sent previously for 6relayd when you were working on the RA filtering (for Comcast), I think these two are still worthy of consideration. The second patch virtually eliminates the dnsmasq/firewall reloading (and associated spam). I've updated/re-based the patches against the current 6relayd source. Thanks, Nathan Nathan Hintz (2): 6relayd: verify fd is valid before use 6relayd: minimize interface updates src/6relayd.c | 3 +++ src/dhcpv6-ia.c | 17 ++--- 2 files changed, 13 insertions(+), 7 deletions(-) -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH, v2 1/2] 6relayd: verify fd is valid before use
From 400821e6eab2f7803d35862d6e03b9689f7cc18c Mon Sep 17 00:00:00 2001 From: Nathan Hintz nlhi...@hotmail.com Date: Sun, 20 Oct 2013 14:02:48 -0700 Subject: [PATCH,v2 1/2] 6relayd: verify fd is valid before use Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- src/6relayd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/6relayd.c b/src/6relayd.c index fcfecb7..32ead14 100644 --- a/src/6relayd.c +++ b/src/6relayd.c @@ -403,6 +403,9 @@ int relayd_get_interface_mtu(const char *ifname) snprintf(buf, sizeof(buf), sysctl_pattern, ifname); int fd = open(buf, O_RDONLY); + if (fd 0) + return -1; + ssize_t len = read(fd, buf, sizeof(buf) - 1); close(fd); -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH, v2 2/2] 6relayd: minimize interface updates
From 3ab6fc3a87c6782c324d0638da950efe35ca2194 Mon Sep 17 00:00:00 2001 From: Nathan Hintz nlhi...@hotmail.com Date: Sun, 1 Dec 2013 11:15:46 -0800 Subject: [PATCH,v2 2/2] 6relayd: minimize interface updates This is an attempt to prevent frequently triggering dnsmasq/firewall reload when only the validity timers have changed. This is necessary because it seems the state file is being used for multiple purposes: 1) to transfer address information to dnsmasq, and 2) to provide state information that is useful for debugging but not relevant to dnsmasq. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- src/dhcpv6-ia.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index f7b380d..2e37763 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -203,7 +203,7 @@ static int send_reconf(struct relayd_interface *iface, struct assignment *assign } -static void write_statefile(void) +static void write_statefile(bool address_change) { if (config-dhcpv6_statefile) { time_t now = monotonic_time(), wall_time = time(NULL); @@ -272,7 +272,7 @@ static void write_statefile(void) fclose(fp); } - if (config-dhcpv6_cb) { + if (address_change config-dhcpv6_cb) { char *argv[2] = {config-dhcpv6_cb, NULL}; if (!vfork()) { execv(argv[0], argv); @@ -414,13 +414,16 @@ static void update(struct relayd_interface *iface) border-assigned = 1 (64 - minprefix); bool change = len != (int)iface-pd_addr_len; + bool address_change = change; for (int i = 0; !change i len; ++i) if (addr[i].addr.s6_addr32[0] != iface-pd_addr[i].addr.s6_addr32[0] || addr[i].addr.s6_addr32[1] != iface-pd_addr[i].addr.s6_addr32[1] || - (addr[i].preferred 0) != (iface-pd_addr[i].preferred 0) || - (addr[i].valid (uint32_t)now + 7200) != - (iface-pd_addr[i].valid (uint32_t)now + 7200)) + (addr[i].preferred 0) != (iface-pd_addr[i].preferred 0)) { + change = address_change = true; + } else if ((addr[i].valid (uint32_t)now + 7200) != + (iface-pd_addr[i].valid (uint32_t)now + 7200)) { change = true; + } if (change) { struct assignment *c; @@ -467,7 +470,7 @@ static void update(struct relayd_interface *iface) } } - write_statefile(); + write_statefile(address_change); } } @@ -891,7 +894,7 @@ size_t dhcpv6_handle_ia(uint8_t *buf, size_t buflen, struct relayd_interface *if } if (update_state) - write_statefile(); + write_statefile(true); out: return response_len; -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT610n v2 support
On Fri, 13 Dec 2013 23:24:28 -0800 Cody P Schafer de...@codyps.com wrote: I run current trunk on a wrt610n v2 without applying any patches, and without observing any of the issues mentioned. Also, that kernel is ancient (Was this email stalled for 2 years somewhere in the depths of the web?). On Sat, Dec 18, 2010 at 2:19 AM, Nathan Hintz nlhi...@hotmail.com wrote: The patches being referred to can be found in this thread (https://lists.openwrt.org/pipermail/openwrt-devel/2010-May/007049.html). I have applied them with modifications to a recent version of trunk and the 2.6.37-rc6 kernel; and modified the build to produce a bootable image for a Linksys E3000 (same H/W as WRT610Nv2). The modifications include changes for the WRT610Nv2, but I have not tested that image to see if it loads (no H/W to test on). The image has the same problems as mentioned previously (no Ethernet, no wireless, no USB, no switch support); you need to have serial access to do anything with it. There are also issues with reading from NVRAM (some work, some don’t) that I looked into a little but didn’t figure out; so the board detection (in broadcom-diag) doesn’t work. The broadcom-wl driver loads (w/ a small patch) and creates an interface; but when the interface is brought up, it causes a kernel oops followed by a reboot. The patches from the link above disable support for the PCI-E core. I suspect this needs to be fixed, before we will get very far. This was what I was going to look at next, but it will be slow going since I have to educate myself before I can make sense of it. If someone knows how this all works, I could really use some help with this or some pointers to send me in the right direction so I’m not wasting effort. Nathan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel Wow, that's old. I updated the credentials in an email client on a laptop I rarely use a few days ago; and it must have been sitting in the outbox. It's all OBE, so disregard the noise. -- Nathan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT610n v2 support
The patches being referred to can be found in this thread (https://lists.openwrt.org/pipermail/openwrt-devel/2010-May/007049.html). I have applied them with modifications to a recent version of trunk and the 2.6.37-rc6 kernel; and modified the build to produce a bootable image for a Linksys E3000 (same H/W as WRT610Nv2). The modifications include changes for the WRT610Nv2, but I have not tested that image to see if it loads (no H/W to test on). The image has the same problems as mentioned previously (no Ethernet, no wireless, no USB, no switch support); you need to have serial access to do anything with it. There are also issues with reading from NVRAM (some work, some don't) that I looked into a little but didn't figure out; so the board detection (in broadcom-diag) doesn't work. The broadcom-wl driver loads (w/ a small patch) and creates an interface; but when the interface is brought up, it causes a kernel oops followed by a reboot. The patches from the link above disable support for the PCI-E core. I suspect this needs to be fixed, before we will get very far. This was what I was going to look at next, but it will be slow going since I have to educate myself before I can make sense of it. If someone knows how this all works, I could really use some help with this or some pointers to send me in the right direction so I'm not wasting effort. Nathan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] ixp4xx: support for little endian build
On Sun, 03 Nov 2013 20:41:15 +0100 Imre Kaloz ka...@openwrt.org wrote: On Sat, 02 Nov 2013 20:38:19 +0100, Nathan Hintz nlhi...@hotmail.com wrote: Set ARCH=arm in target/linux/ixp4xx/Makefile snip There are virtually zero LE ixp4xx devices out there, and this config doesn't even support those, only ones where the secondary bootloader swaps endianness before booting the kernel. So, frankly, what's the real-world use of this additional subtarget? Imre ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel Hi Imre: The patches stopped a little short of creating an additional subtarget; but with the patches, it's possible to make a LE build with minor hand modifications to the target Makefile and kernel config. Making an additional official subtarget was not the goal. I've used this in the past for debugging purposes, and am currently using this to experiment with BitTorrent Sync (currently closed source, and not available for BE ARM) using an eglibc build. I don't own any of the other devices you speak of, so I can't address them. I don't believe the patches are harmful to the existing target; so I submitted them with the thought they might be useful to someone else. Thanks, -- Nathan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH, v2] zram-swap: fix dependencies
swapon/swapoff are no longer provided by swap-utils; they are provided by block-mount instead. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/system/zram-swap/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/system/zram-swap/Makefile b/package/system/zram-swap/Makefile index bded5f3..1fe3804 100644 --- a/package/system/zram-swap/Makefile +++ b/package/system/zram-swap/Makefile @@ -18,7 +18,7 @@ include $(INCLUDE_DIR)/package.mk define Package/zram-swap SECTION:=utils CATEGORY:=Base system - DEPENDS:=+kmod-zram +!(BUSYBOX_CONFIG_MKSWAPBUSYBOX_CONFIG_SWAPONOFF):swap-utils + DEPENDS:=+kmod-zram +!BUSYBOX_CONFIG_MKSWAP:swap-utils +!BUSYBOX_CONFIG_SWAPONOFF:block-mount TITLE:=ZRAM swap scripts PKGARCH:=all endef -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 0/18, v2] broadcom-wl: improvements for newer devices
The goal of this patch set is to provide improved support for newer devices supported by the proprietary broadcom-wl driver. This includes some general cleanup items, bug fixes, and some enhancements. I've tried to keep the individual patches small and focused on a single topic. Testing was limited to devices I have available to me (WRT54GS v1.1 and E3000). I have not been able to get encrypted WDS working with the existing mechanization in /etc/hotplug.d/net/20-broadcom-wds (nas4not); but I have gotten it to work by eliminating the use of the hotplug script and setting up the WDS interfaces directly in /lib/wifi/broadcom.sh (specifying them on the 'nas' command line). This change is not included in this patch set; but I would clean it up and submit it, assuming this patch set is accepted (perhaps w/ modifications), if the WDS experience is still the same for others and there were no fundamental objections to the approach. Nathan --- v2 - Incorporated Jow's comment to rename the interfaces (wl0, wl0-1, wl0-2..., and wds0-1, wds0-2...). Added an error check when attempting to read 'bssmax'. The rest are just along for the ride. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 4/18, v2] broadcom-wl: update description for recently added
Update descriptions for 'phytype' and 'band'. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/src/wlc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/kernel/broadcom-wl/src/wlc.c b/package/kernel/broadcom-wl/src/wlc.c index 7e638e5..7b21ea0 100644 --- a/package/kernel/broadcom-wl/src/wlc.c +++ b/package/kernel/broadcom-wl/src/wlc.c @@ -917,7 +917,7 @@ static const struct wlc_call wlc_calls[] = { .param = INT, .data.num = (WLC_GET_PHYTYPE 16), .handler = wlc_ioctl, - .desc = PHY Type + .desc = PHY Type (read-only) }, { .name = nmode, @@ -945,7 +945,7 @@ static const struct wlc_call wlc_calls[] = { .param = INT, .data.num = ((WLC_GET_BAND 16) | WLC_SET_BAND), .handler = wlc_ioctl, - .desc = Band + .desc = Band (0=auto, 1=5Ghz, 2=2.4GHz) }, }; #define wlc_calls_size (sizeof(wlc_calls) / sizeof(struct wlc_call)) -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/18, v2] broadcom-wl: change interface names
'netifd' treats all devices with a . in their name as vlan devices. Modify the name of virtual/WDS interfaces created by broadcom-wl to use a - instead of a ., so they will be treated as simple devices by 'netifd'. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- v2 - Incorporated Jow's comment to rename the interfaces (wl0, wl0-1, wl0-2..., and wds0-1, wds0-2...). .../broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds | 2 +- package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 4 ++-- package/kernel/broadcom-wl/patches/013-interface-name.patch | 11 +++ 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 package/kernel/broadcom-wl/patches/013-interface-name.patch diff --git a/package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds b/package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds index 0a563c2..4e56d21 100644 --- a/package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds +++ b/package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds @@ -56,6 +56,6 @@ setup_broadcom_wds() { case $ACTION in add|register) - [ ${INTERFACE%%0.*} = wds ] setup_broadcom_wds $INTERFACE + [ ${INTERFACE%%0-*} = wds ] setup_broadcom_wds $INTERFACE ;; esac diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 4d81bcb..506b077 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -45,7 +45,7 @@ scan_broadcom() { local _c= for vif in ${adhoc_if:-$sta_if $ap_if $mon_if}; do - config_set $vif ifname ${device}${_c:+.$_c} + config_set $vif ifname ${device}${_c:+-$_c} _c=$((${_c:-0} + 1)) done config_set $device vifs ${adhoc_if:-$sta_if $ap_if $mon_if} @@ -102,7 +102,7 @@ disable_broadcom() { include /lib/network # make sure the interfaces are down and removed from all bridges - for dev in $device ${device}.1 ${device}.2 ${device}.3; do + for dev in $device ${device}-1 ${device}-2 ${device}-3; do ifconfig $dev down 2/dev/null /dev/null { unbridge $dev } diff --git a/package/kernel/broadcom-wl/patches/013-interface-name.patch b/package/kernel/broadcom-wl/patches/013-interface-name.patch new file mode 100644 index 000..3a136de --- /dev/null +++ b/package/kernel/broadcom-wl/patches/013-interface-name.patch @@ -0,0 +1,11 @@ +--- a/driver/wl_linux.c b/driver/wl_linux.c +@@ -1556,7 +1556,7 @@ wl_add_if(wl_info_t *wl, struct wlc_if* + + wl_if_setup(wlif-dev); + +- sprintf(wlif-dev-name, %s%d.%d, devname, wl-pub-unit, wlif-subunit); ++ sprintf(wlif-dev-name, %s%d-%d, devname, wl-pub-unit, wlif-subunit); + if (remote) + bcopy(remote, wlif-remote, ETHER_ADDR_LEN); + -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 7/18, v2] broadcom-wl: shutdown 'nas' when 'wl' device is disabled
'nas' must be shutdown independently for each 'wl' device to properly support devices with multiple radios. Do the shutdown when the device is disabled instead of when it is brought up. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- v2 - Incorporated Jow's comment to rename the interfaces (wl0, wl0-1, wl0-2..., and wds0-1, wds0-2...). package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 80cd9d5..191092a 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -101,6 +101,9 @@ disable_broadcom() { ( include /lib/network + local pid_file=/var/run/nas.$device.pid + [ -e $pid_file ] start-stop-daemon -K -q -s SIGKILL -p $pid_file rm $pid_file + # make sure the interfaces are down and removed from all bridges for dev in $device ${device}-1 ${device}-2 ${device}-3; do ifconfig $dev down 2/dev/null /dev/null { @@ -346,7 +349,6 @@ enable_broadcom() { } _c=$(($_c + 1)) done - killall -KILL nas - 2- wlc ifname $device stdin EOF $ifdown -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 3/18, v2] broadcom-wl: fix band reporting
Modify the band reporting for broadcom devices to correctly report HW capability. Currently, 802.11na devices report bgn; but should be reporting an. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- .../patches/014-fix-band-reporting.patch | 41 ++ 1 file changed, 41 insertions(+) create mode 100644 package/kernel/broadcom-wl/patches/014-fix-band-reporting.patch diff --git a/package/kernel/broadcom-wl/patches/014-fix-band-reporting.patch b/package/kernel/broadcom-wl/patches/014-fix-band-reporting.patch new file mode 100644 index 000..f1305a4 --- /dev/null +++ b/package/kernel/broadcom-wl/patches/014-fix-band-reporting.patch @@ -0,0 +1,41 @@ +--- a/driver/wl_iw.c b/driver/wl_iw.c +@@ -314,7 +314,7 @@ + ) + { + int phytype, err; +- uint band[3]; ++ uint i, band[3], bands; + char cap[5]; + + WL_TRACE((%s: SIOCGIWNAME\n, dev-name)); +@@ -335,16 +335,20 @@ + break; + case WLC_PHY_TYPE_LP: + case WLC_PHY_TYPE_G: +- if (band[0] = 2) +- strcpy(cap, abg); +- else +- strcpy(cap, bg); +- break; + case WLC_PHY_TYPE_N: +- if (band[0] = 2) +- strcpy(cap, abgn); +- else +- strcpy(cap, bgn); ++ bands = 0; ++ for (i = 1; i = band[0]; i++) { ++ bands |= dtoh32(band[i]); ++ } ++ strcpy(cap, ); ++ if (bands WLC_BAND_5G) ++ strcat(cap, a); ++ if (bands WLC_BAND_2G) ++ strcat(cap, bg); ++ if (phytype == WLC_PHY_TYPE_N) ++ strcat(cap, n); ++ break; ++ default: + break; + } + done: -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/18, v2] broadcom-wl: fix compiler warning
Delete the return value (nvram_exit is declared with a 'void' return). Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/patches/100-fix_nvram_two_devices.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/broadcom-wl/patches/100-fix_nvram_two_devices.patch b/package/kernel/broadcom-wl/patches/100-fix_nvram_two_devices.patch index 5650862..6cf6fae 100644 --- a/package/kernel/broadcom-wl/patches/100-fix_nvram_two_devices.patch +++ b/package/kernel/broadcom-wl/patches/100-fix_nvram_two_devices.patch @@ -25,7 +25,7 @@ + nvram_init_done--; + if (nvram_init_done != 0) -+ return 0; ++ return; + sih = (si_t *)si; this = vars; -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 5/18, v2] broadcom-wl: fix whitespace handling
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/src/wlc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/broadcom-wl/src/wlc.c b/package/kernel/broadcom-wl/src/wlc.c index 7b21ea0..9f4abc0 100644 --- a/package/kernel/broadcom-wl/src/wlc.c +++ b/package/kernel/broadcom-wl/src/wlc.c @@ -1104,14 +1104,14 @@ int main(int argc, char **argv) if (!*s) continue; - if ((s2 = strchr(buf, ' ')) != NULL) + if ((s2 = strchr(s, ' ')) != NULL) *(s2++) = 0; while (s2 isspace(*s2)) s2++; - if ((call = find_cmd(buf)) == NULL) { - fprintf(stderr, Invalid command: %s\n, buf); + if ((call = find_cmd(s)) == NULL) { + fprintf(stderr, Invalid command: %s\n, s); ret = -1; } else ret = do_command(call, ((call-param NOARG) ? NULL : s2)); -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 10/18, v2] broadcom-wl: eliminate 'invalid command' when setting ssid
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 17fa80f..0dd25a3 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -319,8 +319,7 @@ enable_broadcom() { local ssid config_get ssid $vif ssid append vif_post_up vlan_mode 0 $N - append vif_post_up ssid $ssid $N - append vif_do_up ssid $ssid $N + append vif_pre_up ssid $ssid $N [ $mode = monitor ] { append vif_post_up monitor $monitor $N -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 6/18, v2] broadcom-wl: use a single instance of 'nas' per 'wl' device
A single instance of 'nas' can support multiple interfaces; there's no need to run multiple instances. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 506b077..80cd9d5 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -334,13 +334,15 @@ enable_broadcom() { append if_up set_wifi_up '$vif' '$ifname' ;$N append if_up start_net '$ifname' '$net_cfg' ;$N } - [ -z $nasopts ] || { + [ -z $nas -o -z $nasopts ] || { eval ${vif}_ssid=\\$ssid\ nas_mode=-A [ $mode = sta ] nas_mode=-S - [ -z $nas ] || { - nas_cmd=${nas_cmd:+$nas_cmd$N}start-stop-daemon -S -b -p /var/run/nas.$ifname.pid -x $nas -- -P /var/run/nas.$ifname.pid -H 34954 -i $ifname $nas_mode -m $auth -w $wsec -s \\$${vif}_ssid\ -g 3600 -F $nasopts + [ -z $nas_cmd ] { + local pid_file=/var/run/nas.$device.pid + nas_cmd=start-stop-daemon -S -b -p $pid_file -x $nas -- -P $pid_file -H 34954 } + append nas_cmd -i $ifname $nas_mode -m $auth -w $wsec -s \\$${vif}_ssid\ -g 3600 -F $nasopts } _c=$(($_c + 1)) done -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 16/18, v2] broadcom-wl: support probe of 'wds' devices
'nas' requires probe of 'wds' devices to be successful; so don't fail them. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- .../patches/015-support-probe-of-wds-interfaces.patch | 11 +++ 1 file changed, 11 insertions(+) create mode 100644 package/kernel/broadcom-wl/patches/015-support-probe-of-wds-interfaces.patch diff --git a/package/kernel/broadcom-wl/patches/015-support-probe-of-wds-interfaces.patch b/package/kernel/broadcom-wl/patches/015-support-probe-of-wds-interfaces.patch new file mode 100644 index 000..f44921a --- /dev/null +++ b/package/kernel/broadcom-wl/patches/015-support-probe-of-wds-interfaces.patch @@ -0,0 +1,11 @@ +--- a/shared/wl.c b/shared/wl.c +@@ -27,7 +27,7 @@ wl_probe(char *name) + { + int ret, val; + +- if ((name[0] != 'w') || (name[1] != 'l')) ++ if ((name[0] != 'w') || ((name[1] != 'l') ((name[1] != 'd') || (name[2] != 's' + return -1; + + /* Check interface */ -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 11/18, v2] broadcom-wl: add support for setting H/W address
Some devices initialize with a default address (common to all H/W). The address needs to be changeable so that a unique address can be assigned to each AP. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- v2 - Incorporated Jow's comment to rename the interfaces (wl0, wl0-1, wl0-2..., and wds0-1, wds0-2...). package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 15 +++ package/kernel/broadcom-wl/src/wlc.c | 7 +++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 0dd25a3..892a415 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -97,7 +97,6 @@ disable_broadcom() { local device=$1 set_wifi_down $device wlc ifname $device down - wlc ifname $device bssid `wlc ifname $device default_bssid` ( include /lib/network @@ -131,7 +130,7 @@ enable_broadcom() { config_get_bool frameburst $device frameburst config_get macfilter $device macfilter config_get maclist $device maclist - config_get macaddr $device macaddr + config_get macaddr $device macaddr $(wlc ifname $device default_bssid) config_get txpower $device txpower config_get frag $device frag config_get rts $device rts @@ -199,7 +198,7 @@ enable_broadcom() { local _c=0 local nas=$(which nas) - local if_up nas_cmd + local if_pre_up if_up nas_cmd local vif vif_pre_up vif_post_up vif_do_up vif_txpower for vif in $vifs; do @@ -340,7 +339,10 @@ enable_broadcom() { local ifname config_get ifname $vif ifname - #append if_up ifconfig $ifname up ;$N + local if_cmd=if_pre_up + [ $ifname != ${ifname##${device}-} ] if_cmd=if_up + append $if_cmd macaddr=\$(wlc ifname '$ifname' cur_etheraddr) ;$N + append $if_cmd ifconfig '$ifname' \${macaddr:+hw ether \$macaddr} ;$N local net_cfg=$(find_net_config $vif) [ -z $net_cfg ] || { @@ -362,6 +364,8 @@ enable_broadcom() { wlc ifname $device stdin EOF $ifdown +${macaddr:+bssid $macaddr} +${macaddr:+cur_etheraddr $macaddr} band ${band:-0} ${nmode:+nmode $nmode} ${nmode:+${nreqd:+nreqd $nreqd}} @@ -393,6 +397,9 @@ slottime ${slottime:--1} ${frameburst:+frameburst $frameburst} $vif_pre_up +EOF + eval $if_pre_up + wlc ifname $device stdin EOF up $vif_post_up EOF diff --git a/package/kernel/broadcom-wl/src/wlc.c b/package/kernel/broadcom-wl/src/wlc.c index 9f4abc0..21754a7 100644 --- a/package/kernel/broadcom-wl/src/wlc.c +++ b/package/kernel/broadcom-wl/src/wlc.c @@ -892,6 +892,13 @@ static const struct wlc_call wlc_calls[] = { .desc = BSSID }, { + .name = cur_etheraddr, + .param = MAC, + .handler = wlc_iovar, + .data.str = cur_etheraddr, + .desc = Current MAC Address + }, + { .name = default_bssid, .param = MAC, .handler = wlc_iovar, -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 12/18, v2] broadcom-wl: improve device cleanup
Move all device cleanup to disable_broadcom. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- v2 - Incorporated Jow's comment to rename the interfaces (wl0, wl0-1, wl0-2..., and wds0-1, wds0-2...). .../kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 36 +- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 892a415..9416f77 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -50,12 +50,6 @@ scan_broadcom() { done config_set $device vifs ${adhoc_if:-$sta_if $ap_if $mon_if} - ifdown=down - for vif in 0 1 2 3; do - append ifdown vif $vif $N - append ifdown enabled 0 $N - done - ap=1 infra=1 if [ $_c -gt 1 ]; then @@ -96,7 +90,6 @@ scan_broadcom() { disable_broadcom() { local device=$1 set_wifi_down $device - wlc ifname $device down ( include /lib/network @@ -104,12 +97,28 @@ disable_broadcom() { [ -e $pid_file ] start-stop-daemon -K -q -s SIGKILL -p $pid_file rm $pid_file # make sure the interfaces are down and removed from all bridges - local dev - for dev in $device ${device}-1 ${device}-2 ${device}-3; do - ifconfig $dev down 2/dev/null /dev/null { - unbridge $dev - } + local dev ifname + for dev in /sys/class/net/wds${device##wl}-* /sys/class/net/${device}-* /sys/class/net/${device}; do + if [ -e $dev ]; then + ifname=${dev##/sys/class/net/} + ifconfig $ifname down + unbridge $ifname + fi + done + + # make sure all of the devices are disabled in the driver + local ifdown= + local vif + append ifdown down $N + append ifdown wds none $N + for vif in 3 2 1 0; do + append ifdown vif $vif $N + append ifdown enabled 0 $N done + + wlc ifname $device stdin EOF +$ifdown +EOF ) true } @@ -362,8 +371,6 @@ enable_broadcom() { _c=$(($_c + 1)) done wlc ifname $device stdin EOF -$ifdown - ${macaddr:+bssid $macaddr} ${macaddr:+cur_etheraddr $macaddr} band ${band:-0} @@ -387,7 +394,6 @@ monitor ${monitor:-0} radio ${radio:-1} macfilter ${macfilter:-0} maclist ${maclist:-none} -wds none ${wds:+wds $wds} country ${country:-US} ${channel:+channel $channel} -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 14/18, v2] broadcom-wl: perform additional cleanup on wl module unload
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/patches/007-use-glue-driver.patch | 8 ++-- .../kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch | 2 +- package/kernel/broadcom-wl/patches/012-compat-3.10.patch | 2 +- package/kernel/broadcom-wl/patches/013-interface-name.patch | 2 +- .../kernel/broadcom-wl/patches/110-add_number_to_dev_name.patch | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/package/kernel/broadcom-wl/patches/007-use-glue-driver.patch b/package/kernel/broadcom-wl/patches/007-use-glue-driver.patch index 2639abc..a30dcc4 100644 --- a/package/kernel/broadcom-wl/patches/007-use-glue-driver.patch +++ b/package/kernel/broadcom-wl/patches/007-use-glue-driver.patch @@ -108,18 +108,20 @@ #ifdef CONFIG_PCI error = pci_register_driver(wl_pci_driver); -@@ -1082,7 +1053,9 @@ wl_module_init(void) +@@ -1082,7 +1053,11 @@ wl_module_init(void) return 0; error_pci: - ssb_driver_unregister(wl_ssb_driver); +#if defined(CONFIG_SSB) || defined(CONFIG_BCMA) + wl_glue_unregister(); ++ wl_glue_set_attach_callback(NULL); ++ wl_glue_set_remove_callback(NULL); +#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */ return error; } -@@ -1099,9 +1072,9 @@ wl_module_exit(void) +@@ -1099,9 +1074,11 @@ wl_module_exit(void) #ifdef CONFIG_PCI pci_unregister_driver(wl_pci_driver); #endif/* CONFIG_PCI */ @@ -128,6 +130,8 @@ -#endif/* CONFIG_SSB */ +#if defined(CONFIG_SSB) || defined(CONFIG_BCMA) + wl_glue_unregister(); ++ wl_glue_set_attach_callback(NULL); ++ wl_glue_set_remove_callback(NULL); +#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */ } diff --git a/package/kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch b/package/kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch index 6cffa27..3605931 100644 --- a/package/kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch +++ b/package/kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch @@ -1,6 +1,6 @@ --- a/driver/wl_linux.c +++ b/driver/wl_linux.c -@@ -1541,6 +1541,8 @@ wl_add_if(wl_info_t *wl, struct wlc_if* +@@ -1545,6 +1545,8 @@ wl_add_if(wl_info_t *wl, struct wlc_if* return NULL; } diff --git a/package/kernel/broadcom-wl/patches/012-compat-3.10.patch b/package/kernel/broadcom-wl/patches/012-compat-3.10.patch index 0e0415f..1ab8539 100644 --- a/package/kernel/broadcom-wl/patches/012-compat-3.10.patch +++ b/package/kernel/broadcom-wl/patches/012-compat-3.10.patch @@ -36,7 +36,7 @@ static int wl_read_proc(char *buffer, char **start, off_t offset, int length, int *eof, void *data) { -@@ -1137,7 +1137,7 @@ wl_free(wl_info_t *wl) +@@ -1141,7 +1141,7 @@ wl_free(wl_info_t *wl) /* free common resources */ if (wl-wlc) { diff --git a/package/kernel/broadcom-wl/patches/013-interface-name.patch b/package/kernel/broadcom-wl/patches/013-interface-name.patch index 3a136de..a19e3a9 100644 --- a/package/kernel/broadcom-wl/patches/013-interface-name.patch +++ b/package/kernel/broadcom-wl/patches/013-interface-name.patch @@ -1,6 +1,6 @@ --- a/driver/wl_linux.c +++ b/driver/wl_linux.c -@@ -1556,7 +1556,7 @@ wl_add_if(wl_info_t *wl, struct wlc_if* +@@ -1560,7 +1560,7 @@ wl_add_if(wl_info_t *wl, struct wlc_if* wl_if_setup(wlif-dev); diff --git a/package/kernel/broadcom-wl/patches/110-add_number_to_dev_name.patch b/package/kernel/broadcom-wl/patches/110-add_number_to_dev_name.patch index 13ce727..28917d9 100644 --- a/package/kernel/broadcom-wl/patches/110-add_number_to_dev_name.patch +++ b/package/kernel/broadcom-wl/patches/110-add_number_to_dev_name.patch @@ -1,6 +1,6 @@ --- a/driver/wl_linux.c +++ b/driver/wl_linux.c -@@ -1412,7 +1412,7 @@ wl_alloc_if(wl_info_t *wl, int iftype, u +@@ -1416,7 +1416,7 @@ wl_alloc_if(wl_info_t *wl, int iftype, u dev = alloc_etherdev(sizeof(wl_if_t)); wlif = netdev_priv(dev); bzero(wlif, sizeof(wl_if_t)); -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 9/18, v2] broadcom-wl: clean up variable definitions (broadcom.sh)
Specify variables as 'local' where appropriate Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- v2 - Incorporated Jow's comment to rename the interfaces (wl0, wl0-1, wl0-2..., and wds0-1, wds0-2...). .../kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 47 +- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 7721b87..17fa80f 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -2,18 +2,17 @@ append DRIVERS broadcom scan_broadcom() { local device=$1 - local wds + local vif vifs wds local adhoc sta apmode mon disabled local adhoc_if sta_if ap_if mon_if - local _c=0 config_get vifs $device vifs for vif in $vifs; do config_get_bool disabled $vif disabled 0 [ $disabled -eq 0 ] || continue + local mode config_get mode $vif mode - _c=$(($_c + 1)) case $mode in adhoc) adhoc=1 @@ -28,6 +27,7 @@ scan_broadcom() { ap_if=${ap_if:+$ap_if }$vif ;; wds) + local addr config_get addr $vif bssid [ -z $addr ] || { addr=$(echo $addr | tr 'A-F' 'a-f') @@ -105,6 +105,7 @@ disable_broadcom() { [ -e $pid_file ] start-stop-daemon -K -q -s SIGKILL -p $pid_file rm $pid_file # make sure the interfaces are down and removed from all bridges + local dev for dev in $device ${device}-1 ${device}-2 ${device}-3; do ifconfig $dev down 2/dev/null /dev/null { unbridge $dev @@ -116,7 +117,8 @@ disable_broadcom() { enable_broadcom() { local device=$1 - local _c + local channel country maxassoc wds vifs distance slottime rxantenna txantenna + local frameburst macfilter maclist macaddr txpower frag rts hwmode htmode config_get channel $device channel config_get country $device country config_get maxassoc $device maxassoc @@ -135,15 +137,9 @@ enable_broadcom() { config_get rts $device rts config_get hwmode $device hwmode config_get htmode $device htmode - local vif_pre_up vif_post_up vif_do_up vif_txpower local doth=0 local wmm=1 - _c=0 - nas=$(which nas) - nas_cmd= - if_up= - [ -z $slottime ] { [ -n $distance ] { # slottime = 9 + (distance / 150) + (distance % 150 ? 1 : 0) @@ -201,9 +197,15 @@ enable_broadcom() { esac } + local _c=0 + local nas=$(which nas) + local if_up nas_cmd + local vif vif_pre_up vif_post_up vif_do_up vif_txpower + for vif in $vifs; do config_get vif_txpower $vif txpower + local mode config_get mode $vif mode append vif_pre_up vif $_c $N append vif_post_up vif $_c $N @@ -213,20 +215,24 @@ enable_broadcom() { config_get_bool doth $vif doth $doth [ $mode = sta ] || { + local hidden isolate config_get_bool hidden $vif hidden 0 append vif_pre_up closed $hidden $N config_get_bool isolate $vif isolate 0 append vif_pre_up ap_isolate $isolate $N } - wsec_r=0 - eap_r=0 - wsec=0 - auth=0 - nasopts= + local wsec_r=0 + local eap_r=0 + local wsec=0 + local auth=0 + local nasopts= + local enc key rekey + config_get enc $vif encryption case $enc in *wep*) + local def defkey k knr wsec_r=1 wsec=1 defkey=1 @@ -274,6 +280,7 @@ enable_broadcom() { nasopts=-k \\$${vif}_key\${rekey:+ -g $rekey} ;; *wpa*) + local auth_port auth_secret auth_server wsec_r=1 eap_r=1 config_get auth_server $vif auth_server @@ -309,6 +316,7 @@ enable_broadcom() { append vif_do_up wsec_restrict $wsec_r $N append vif_do_up eap_restrict $eap_r $N
[OpenWrt-Devel] [PATCH 15/18, v2] broadcom-wl: fix crash when starting multiple virtual interfaces
When enabling multiple VIFS, the driver sometimes crashes. The frequency of the crash increases as more VIFS are enabled. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- .../patches/008-fix_virtual_interfaces.patch | 123 - .../broadcom-wl/patches/009-fix_compile_3_2.patch | 4 +- .../patches/010-remove_irqf_samble_random.patch| 2 +- .../broadcom-wl/patches/012-compat-3.10.patch | 8 +- .../broadcom-wl/patches/013-interface-name.patch | 2 +- .../patches/110-add_number_to_dev_name.patch | 2 +- 6 files changed, 131 insertions(+), 10 deletions(-) diff --git a/package/kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch b/package/kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch index 3605931..23831df 100644 --- a/package/kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch +++ b/package/kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch @@ -1,6 +1,117 @@ --- a/driver/wl_linux.c +++ b/driver/wl_linux.c -@@ -1545,6 +1545,8 @@ wl_add_if(wl_info_t *wl, struct wlc_if* +@@ -354,6 +354,7 @@ static int wl_read_proc(char *buffer, ch + static int wl_dump(wl_info_t *wl, struct bcmstrbuf *b); + #endif /* BCMDBG */ + struct wl_if *wl_alloc_if(wl_info_t *wl, int iftype, uint unit, struct wlc_if* wlc_if); ++static void wl_link_if(wl_info_t *wl, wl_if_t *wlif); + static void wl_free_if(wl_info_t *wl, wl_if_t *wlif); + + +@@ -566,6 +567,9 @@ wl_attach(uint16 vendor, uint16 device, + wl-dev = dev; + wl_if_setup(dev); + ++ /* add the interface to the interface linked list */ ++ wl_link_if(wl, wlif); ++ + /* map chip registers (47xx: and sprom) */ + dev-base_addr = regs; + +@@ -1106,10 +1110,14 @@ wl_free(wl_info_t *wl) + free_irq(wl-dev-irq, wl); + } + +- if (wl-dev) { +- wl_free_if(wl, WL_DEV_IF(wl-dev)); +- wl-dev = NULL; ++ /* free all interfaces */ ++ while (wl-if_list) { ++ if ((wl-if_list-dev != wl-dev) || wl-if_list-next == NULL) ++ wl_free_if(wl, wl-if_list); ++ else ++ wl_free_if(wl, wl-if_list-next); + } ++ wl-dev = NULL; + + #ifdef TOE + wl_toe_detach(wl-toei); +@@ -1355,10 +1363,12 @@ wl_txflowcontrol(wl_info_t *wl, bool sta + + ASSERT(prio == ALLPRIO); + for (wlif = wl-if_list; wlif != NULL; wlif = wlif-next) { +- if (state == ON) +- netif_stop_queue(wlif-dev); +- else +- netif_wake_queue(wlif-dev); ++ if (wlif-dev_registed) { ++ if (state == ON) ++ netif_stop_queue(wlif-dev); ++ else ++ netif_wake_queue(wlif-dev); ++ } + } + } + +@@ -1398,7 +1408,6 @@ wl_alloc_if(wl_info_t *wl, int iftype, u + { + struct net_device *dev; + wl_if_t *wlif; +- wl_if_t *p; + + dev = alloc_etherdev(sizeof(wl_if_t)); + wlif = netdev_priv(dev); +@@ -1411,9 +1420,13 @@ wl_alloc_if(wl_info_t *wl, int iftype, u + wlif-wlcif = wlcif; + wlif-subunit = subunit; + +- /* match current flow control state */ +- if (iftype != WL_IFTYPE_MON wl-dev netif_queue_stopped(wl-dev)) +- netif_stop_queue(dev); ++ return wlif; ++} ++ ++static void ++wl_link_if(wl_info_t *wl, wl_if_t *wlif) ++{ ++ wl_if_t *p; + + /* add the interface to the interface linked list */ + if (wl-if_list == NULL) +@@ -1424,7 +1437,6 @@ wl_alloc_if(wl_info_t *wl, int iftype, u + p = p-next; + p-next = wlif; + } +- return wlif; + } + + static void +@@ -1504,6 +1516,9 @@ _wl_add_if(wl_task_t *task) + wl_info_t *wl = wlif-wl; + struct net_device *dev = wlif-dev; + ++ /* add the interface to the interface linked list */ ++ wl_link_if(wl, wlif); ++ + if (wlif-type == WL_IFTYPE_WDS) + dev-netdev_ops = wl_wds_ops; + +@@ -1516,6 +1531,14 @@ _wl_add_if(wl_task_t *task) + } + wlif-dev_registed = TRUE; + ++ /* match current flow control state */ ++ if (wl-dev) { ++ if (netif_queue_stopped(wl-dev)) ++ netif_stop_queue(dev); ++ else ++ netif_wake_queue(dev); ++ } ++ + done: + MFREE(wl-osh, task, sizeof(wl_task_t)); + atomic_dec(wl-callbacks); +@@ -1545,6 +1568,8 @@ wl_add_if(wl_info_t *wl, struct wlc_if* return NULL; } @@ -9,3 +120,13 @@ sprintf(wlif-dev-name, %s%d.%d, devname, wl-pub-unit, wlif-subunit); if (remote) bcopy(remote, wlif-remote, ETHER_ADDR_LEN); +@@ -2778,6 +2803,9 @@ wl_add_monitor(wl_task_t *task) + dev = wlif-dev; + wl-monitor = dev; + ++ /* add the interface to the interface linked list */ ++ wl_link_if(wl
[OpenWrt-Devel] [PATCH 8/18, v2] broadcom-wl: simplify processing of 'hwmode'
Default gmode to GOnly unless explicitly overwridden. This corrects processing for 11ng to specify GOnly for gmode instead of Auto (which translated to bg). Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- .../kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 42 +++--- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 191092a..7721b87 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -165,32 +165,34 @@ enable_broadcom() { ;; esac - [ ${channel:-0} -ge 1 -a ${channel:-0} -le 14 ] band=2 - [ ${channel:-0} -ge 36 ] band=1 + local gmode=2 nmode=0 nreqd= + case $hwmode in + *a) gmode=;; + *b) gmode=0;; + *bg)gmode=1;; + *g) gmode=2;; + *gst) gmode=4;; + *lrs) gmode=5;; + *) nmode=1; nreqd=0;; + esac case $hwmode in - *na)nmode=1; nreqd=0;; - *a) nmode=0;; - *ng)gmode=1; nmode=1; nreqd=0;; - *n) nmode=1; nreqd=1;; - *b) gmode=0; nmode=0;; - *bg)gmode=1; nmode=0;; - *g) gmode=2; nmode=0;; - *gst) gmode=4; nmode=0;; - *lrs) gmode=5; nmode=0;; - *) case $band in - 2) gmode=1; nmode=1; nreqd=0;; - 1) nmode=1; nreqd=0;; - *) gmode=1; nmode=1; nreqd=0;; - esac - ;; + n|11n) nmode=1; nreqd=1;; + *n*)nmode=1; nreqd=0;; esac # Use 'nmode' for N-Phy only - [ $(wlc ifname $device phytype) = 4 ] || nmode= + [ $(wlc ifname $device phytype) = 4 ] || nmode= + + local band chanspec + [ ${channel:-0} -ge 1 -a ${channel:-0} -le 14 ] band=2 + [ ${channel:-0} -ge 36 ] { + band=1 + gmode= + } # Use 'chanspec' instead of 'channel' for 'N' modes (See bcmwifi.h) - [ ${nmode:-0} -ne 0 -a -n $band ] { + [ ${nmode:-0} -ne 0 -a -n $band -a -n $channel ] { case $htmode in HT40-) chanspec=$(printf 0x%x%x%02x $band 0xe $(($channel - 2))); channel=;; HT40+) chanspec=$(printf 0x%x%x%02x $band 0xd $(($channel + 2))); channel=;; @@ -352,7 +354,7 @@ enable_broadcom() { wlc ifname $device stdin EOF $ifdown -${nmode:+band ${band:-0}} +band ${band:-0} ${nmode:+nmode $nmode} ${nmode:+${nreqd:+nreqd $nreqd}} ${gmode:+gmode $gmode} -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 13/18, v2] broadcom-wl: support more virtual interfaces
Read the number of virtual interfaces to support from the device capabilities; as some newer devices can support up to 16. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- v2 - Added an error check when attempting to read 'bssmax'. .../kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 10 - package/kernel/broadcom-wl/src/wlc.c | 45 ++ 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 9416f77..614db0c 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -108,12 +108,14 @@ disable_broadcom() { # make sure all of the devices are disabled in the driver local ifdown= - local vif + local bssmax=$(wlc ifname $device bssmax) + local vif=$((${bssmax:-4} - 1)) append ifdown down $N append ifdown wds none $N - for vif in 3 2 1 0; do + while [ $vif -ge 0 ]; do append ifdown vif $vif $N append ifdown enabled 0 $N + vif=$(($vif - 1)) done wlc ifname $device stdin EOF @@ -209,8 +211,12 @@ enable_broadcom() { local nas=$(which nas) local if_pre_up if_up nas_cmd local vif vif_pre_up vif_post_up vif_do_up vif_txpower + local bssmax=$(wlc ifname $device bssmax) + bssmax=${bssmax:-4} for vif in $vifs; do + [ $_c -ge $bssmax ] break + config_get vif_txpower $vif txpower local mode diff --git a/package/kernel/broadcom-wl/src/wlc.c b/package/kernel/broadcom-wl/src/wlc.c index 21754a7..50c40e8 100644 --- a/package/kernel/broadcom-wl/src/wlc.c +++ b/package/kernel/broadcom-wl/src/wlc.c @@ -391,6 +391,37 @@ static int wlc_wsec_key(wlc_param param, void *null, void *value) return wl_bssiovar_set(interface, wsec_key, vif, wsec_key, sizeof(wsec_key)); } +static int wlc_cap(wlc_param param, void *data, void *value) +{ + char *iov = *((char **) data); + + if (param GET) + return wl_iovar_get(interface, iov, value, BUFSIZE); + + return -1; +} + +static int wlc_bssmax(wlc_param param, void *data, void *value) +{ + int *val = (int *) value; + char *iov = *((char **) data); + int ret = -1; + + if (param GET) { + ret = wl_iovar_get(interface, iov, wlbuf, BUFSIZE); + if (!ret) { + if (strstr(wlbuf, mbss4)) + *val = 4; + else if (strstr(wlbuf, mbss16)) + *val = 16; + else + *val = 1; + } + } + + return ret; +} + static inline int cw2ecw(int cw) { int i; @@ -954,6 +985,20 @@ static const struct wlc_call wlc_calls[] = { .handler = wlc_ioctl, .desc = Band (0=auto, 1=5Ghz, 2=2.4GHz) }, + { + .name = cap, + .param = STRING|NOARG, + .handler = wlc_cap, + .data.str = cap, + .desc = Capabilities + }, + { + .name = bssmax, + .param = INT|NOARG, + .handler = wlc_bssmax, + .data.str = cap, + .desc = Number of VIF's supported + }, }; #define wlc_calls_size (sizeof(wlc_calls) / sizeof(struct wlc_call)) -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 17/18, v2] broadcom-wl: support 'wds' interfaces on 'wl1' device
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- v2 - Incorporated Jow's comment to rename the interfaces (wl0, wl0-1, wl0-2..., and wds0-1, wds0-2...). package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds b/package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds index 4e56d21..35c4218 100644 --- a/package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds +++ b/package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds @@ -56,6 +56,6 @@ setup_broadcom_wds() { case $ACTION in add|register) - [ ${INTERFACE%%0-*} = wds ] setup_broadcom_wds $INTERFACE + [ ${INTERFACE%%[0-1]-*} = wds ] setup_broadcom_wds $INTERFACE ;; esac -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 18/18, v2] broadcom-wl: version roll
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/broadcom-wl/Makefile b/package/kernel/broadcom-wl/Makefile index 3b4d54c..588ac34 100644 --- a/package/kernel/broadcom-wl/Makefile +++ b/package/kernel/broadcom-wl/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=broadcom-wl PKG_VERSION:=5.10.56.27.3 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(ARCH).tar.bz2 PKG_SOURCE_URL:=http://downloads.openwrt.org/sources -- 1.8.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 0/18] broadcom-wl: improvements for newer devices
On Tue, 05 Nov 2013 16:16:01 +0100 Hauke Mehrtens ha...@hauke-m.de wrote: Are you integrating Jow's suggesting into your patches and will you resend them? I will update the patches with Jow's suggestion, and resend them (probably won't be until this weekend though). -- Nathan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2] ubox: support specifying swap priority from the command line
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- block.c | 104 1 file changed, 66 insertions(+), 38 deletions(-) diff --git a/block.c b/block.c index 2289b77..941e4b8 100644 --- a/block.c +++ b/block.c @@ -13,6 +13,7 @@ */ #define _GNU_SOURCE +#include getopt.h #include stdio.h #include unistd.h #include syslog.h @@ -1036,50 +1037,75 @@ static int main_info(int argc, char **argv) return 0; } +static int swapon_usage(void) +{ + fprintf(stderr, Usage: swapon [-s] [-a] [[-p pri] DEVICE]\n\n + \tStart swapping on [DEVICE]\n +-a\tStart swapping on all swap devices\n +-p pri\tSet priority of swap device\n +-s\tShow summary\n); + return -1; +} + static int main_swapon(int argc, char **argv) { - if (argc != 2) { - fprintf(stderr, Usage: swapon -s -a [DEVICE]\n\n\tStart swapping on [DEVICE]\n -a\tStart swapping on all swap devices\n -s\tShow summary\n); - return -1; - } + int ch; + FILE *fp; + char *lineptr; + size_t s; + struct blkid_struct_probe *pr; + int flags = 0; + int pri; + struct stat st; + int err; - if (!strcmp(argv[1], -s)) { - FILE *fp = fopen(/proc/swaps, r); - char *lineptr = NULL; - size_t s; + while ((ch = getopt(argc, argv, ap:s)) != -1) { + switch(ch) { + case 's': + fp = fopen(/proc/swaps, r); + lineptr = NULL; - if (!fp) { - fprintf(stderr, failed to open /proc/swaps\n); - return -1; + if (!fp) { + fprintf(stderr, failed to open /proc/swaps\n); + return -1; + } + while (getline(lineptr, s, fp) 0) + printf(lineptr); + if (lineptr) + free(lineptr); + fclose(fp); + return 0; + case 'a': + cache_load(0); + list_for_each_entry(pr, devices, list) { + if (strcmp(pr-id-name, swap)) + continue; + if (swapon(pr-dev, 0)) + fprintf(stderr, failed to swapon %s\n, pr-dev); + } + return 0; + case 'p': + pri = atoi(optarg); + if (pri = 0) + flags = ((pri SWAP_FLAG_PRIO_SHIFT) SWAP_FLAG_PRIO_MASK) | SWAP_FLAG_PREFER; + break; + default: + return swapon_usage(); } - while (getline(lineptr, s, fp) 0) - printf(lineptr); - if (lineptr) - free(lineptr); - fclose(fp); - } else if (!strcmp(argv[1], -a)) { - struct blkid_struct_probe *pr; - cache_load(0); - list_for_each_entry(pr, devices, list) { - if (strcmp(pr-id-name, swap)) - continue; - if (swapon(pr-dev, 0)) - fprintf(stderr, failed to swapon %s\n, pr-dev); - } - } else { - struct stat s; - int err; + } - if (stat(argv[1], s) || (!S_ISBLK(s.st_mode) !S_ISREG(s.st_mode))) { - fprintf(stderr, %s is not a block device or file\n, argv[1]); - return -1; - } - err = swapon(argv[1], 0); - if (err) { - fprintf(stderr, failed to swapon %s (%d)\n, argv[1], err); - return err; - } + if (optind != (argc - 1)) + return swapon_usage(); + + if (stat(argv[optind], st) || (!S_ISBLK(st.st_mode) !S_ISREG(st.st_mode))) { + fprintf(stderr, %s is not a block device or file\n, argv[optind]); + return -1; + } + err = swapon(argv[optind], flags); + if (err) { + fprintf(stderr, failed to swapon %s (%d)\n, argv[optind], err); + return err; } return 0; @@ -1088,7 +1114,9 @@ static int main_swapon(int argc, char **argv) static int main_swapoff(int argc, char **argv) { if (argc != 2) { - fprintf(stderr, Usage: swapoff [-a] [DEVICE]\n\n\tStop swapping on DEVICE\n -a\tStop swapping on all swap devices\n); + fprintf(stderr, Usage: swapoff [-a] [DEVICE]\n\n + \tStop swapping
[OpenWrt-Devel] util-linux: cleanup description for swap-utils
swapon/swapoff are no longer provided by swap-utils, so remove them from the description as well. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/utils/util-linux/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/utils/util-linux/Makefile b/package/utils/util-linux/Makefile index 83cb9d4..4503a79 100644 --- a/package/utils/util-linux/Makefile +++ b/package/utils/util-linux/Makefile @@ -341,7 +341,7 @@ $(call Package/util-linux/Default) endef define Package/swap-utils/description - contains: mkswap, swaplabel, swapon, swapoff + contains: mkswap, swaplabel endef define Package/uuidd -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] zram-swap: fix dependencies
swapon/swapoff are no longer provided by swap-utils; they are provided by block-mount instead. Selecting swap-utils when swapon/swapoff are not provided by busybox serves no purpose. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/system/zram-swap/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/system/zram-swap/Makefile b/package/system/zram-swap/Makefile index bded5f3..af1e8bd 100644 --- a/package/system/zram-swap/Makefile +++ b/package/system/zram-swap/Makefile @@ -18,7 +18,7 @@ include $(INCLUDE_DIR)/package.mk define Package/zram-swap SECTION:=utils CATEGORY:=Base system - DEPENDS:=+kmod-zram +!(BUSYBOX_CONFIG_MKSWAPBUSYBOX_CONFIG_SWAPONOFF):swap-utils + DEPENDS:=+kmod-zram +!BUSYBOX_CONFIG_MKSWAP:swap-utils TITLE:=ZRAM swap scripts PKGARCH:=all endef -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v3] zram-swap: Assign non-default priority to zram swap
Insures zram swap is higher priority than any swap added by block-mount; which is not the case if zram swap is restarted for any reason (e.g., /etc/init.d/zram restart). Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- v3 - Added fallback for case when swap priority is not supported. - Removed default of BUSYBOX_CONFIG_FEATURE_SWAPON_PRI to y --- package/system/zram-swap/files/zram.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 = 100755 package/system/zram-swap/files/zram.init diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init old mode 100644 new mode 100755 index 23de915..7020d71 --- a/package/system/zram-swap/files/zram.init +++ b/package/system/zram-swap/files/zram.init @@ -100,7 +100,7 @@ start() zram_reset $zram_dev enforcing defaults echo $(( $zram_size * 1024 * 1024 )) /sys/block/$( basename $zram_dev )/disksize mkswap $zram_dev - swapon $zram_dev + swapon -p 0 $zram_dev 2 /dev/null || swapon $zram_dev } done } -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] busybox: don't enable swapon/swapoff by default
'swapon/swapoff' are now provided by 'block-mount'; enabling them by default in busybox is no longer required and adds unnecessary bloat. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/utils/busybox/config/util-linux/Config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/utils/busybox/config/util-linux/Config.in b/package/utils/busybox/config/util-linux/Config.in index d60b139..d75841e 100644 --- a/package/utils/busybox/config/util-linux/Config.in +++ b/package/utils/busybox/config/util-linux/Config.in @@ -652,7 +652,7 @@ config BUSYBOX_CONFIG_SETARCH config BUSYBOX_CONFIG_SWAPONOFF bool swaponoff - default y + default n select BUSYBOX_CONFIG_PLATFORM_LINUX help This option enables both the 'swapon' and the 'swapoff' utilities. -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] ixp4xx: support for little endian build
Set ARCH=arm in target/linux/ixp4xx/Makefile Adjust kernel config as follows: target/linux/generic/config-3.10 # CONFIG_MTD_CFI_NOSWAP is not set target/linux/ixp4xx/config-3.10 # CONFIG_CPU_BIG_ENDIAN is not set # CONFIG_CPU_ENDIAN_BE32 is not set CONFIG_MTD_CFI_BE_BYTE_SWAP=y Tested on NSLU2. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/boot/apex/Makefile | 10 +- .../patches/100-openwrt_nslu2_armeb_config.patch | 2 +- .../patches/101-openwrt_nslu2_arm_config.patch | 23 ++ .../120-openwrt_nslu2_16mb_armeb_config.patch | 2 +- .../121-openwrt_nslu2_16mb_arm_config.patch| 23 ++ .../patches/140-openwrt_fsg3_armeb_config.patch| 10 +- .../apex/patches/141-openwrt_fsg3_arm_config.patch | 23 ++ .../boot/apex/patches/150-limit_ram_to_64mb.patch | 8 .../boot/apex/patches/151-limit_ram_to_64mb.patch | 22 + .../patches/160-openwrt_nas100d_armeb_config.patch | 2 +- .../patches/161-openwrt_nas100d_arm_config.patch | 20 +++ scripts/arm-magic.sh | 20 ++- scripts/slugimage.pl | 10 +- target/linux/ixp4xx/image/Makefile | 16 ++- 14 files changed, 159 insertions(+), 32 deletions(-) create mode 100644 package/boot/apex/patches/101-openwrt_nslu2_arm_config.patch create mode 100644 package/boot/apex/patches/121-openwrt_nslu2_16mb_arm_config.patch create mode 100644 package/boot/apex/patches/141-openwrt_fsg3_arm_config.patch create mode 100644 package/boot/apex/patches/151-limit_ram_to_64mb.patch create mode 100644 package/boot/apex/patches/161-openwrt_nas100d_arm_config.patch diff --git a/package/boot/apex/Makefile b/package/boot/apex/Makefile index f17118e..dc2e3e1 100644 --- a/package/boot/apex/Makefile +++ b/package/boot/apex/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=apex PKG_VERSION:=1.6.9 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://ftp.buici.com/pub/apex/ \ @@ -44,10 +44,10 @@ endef define Build/Compile $(INSTALL_DIR) $(PKG_BUILD_DIR)/out - $(call build_apex,slugos-nslu2-armeb,nslu2-armeb) - $(call build_apex,slugos-nslu2-16mb-armeb,nslu2-16mb-armeb) - $(call build_apex,slugos-fsg3-armeb,fsg3-armeb) - $(call build_apex,slugos-nas100d-armeb,nas100d-armeb) + $(call build_apex,slugos-nslu2-$(ARCH),nslu2-$(ARCH)) + $(call build_apex,slugos-nslu2-16mb-$(ARCH),nslu2-16mb-$(ARCH)) + $(call build_apex,slugos-fsg3-$(ARCH),fsg3-$(ARCH)) + $(call build_apex,slugos-nas100d-$(ARCH),nas100d-$(ARCH)) endef define Package/apex/install diff --git a/package/boot/apex/patches/100-openwrt_nslu2_armeb_config.patch b/package/boot/apex/patches/100-openwrt_nslu2_armeb_config.patch index 7e9cfdf..c2d1626 100644 --- a/package/boot/apex/patches/100-openwrt_nslu2_armeb_config.patch +++ b/package/boot/apex/patches/100-openwrt_nslu2_armeb_config.patch @@ -5,7 +5,7 @@ # General Setup # -CONFIG_TARGET_DESCRIPTION=SlugOS NSLU2 (bigendian) -+CONFIG_TARGET_DESCRIPTION=OpenWRT NSLU2 (8MiB Flash) ++CONFIG_TARGET_DESCRIPTION=OpenWRT NSLU2/BE (8MiB Flash) CONFIG_CROSS_COMPILE= CONFIG_AEABI=y # CONFIG_DRIVER_LONG_LONG_SIZE is not set diff --git a/package/boot/apex/patches/101-openwrt_nslu2_arm_config.patch b/package/boot/apex/patches/101-openwrt_nslu2_arm_config.patch new file mode 100644 index 000..a374b89 --- /dev/null +++ b/package/boot/apex/patches/101-openwrt_nslu2_arm_config.patch @@ -0,0 +1,23 @@ +--- a/src/mach-ixp42x/slugos-nslu2-arm_config b/src/mach-ixp42x/slugos-nslu2-arm_config +@@ -19,7 +19,7 @@ CONFIG_EXPERIMENTAL=y + # + # General Setup + # +-CONFIG_TARGET_DESCRIPTION=SlugOS NSLU2 ++CONFIG_TARGET_DESCRIPTION=OpenWRT NSLU2/LE (8MiB Flash) + CONFIG_CROSS_COMPILE= + CONFIG_AEABI=y + # CONFIG_DRIVER_LONG_LONG_SIZE is not set +@@ -163,9 +163,9 @@ CONFIG_ENV_REGION_KERNEL_ALT=fis://kern + # Overrides + # + CONFIG_ENV_DEFAULT_CMDLINE_OVERRIDE=y +-CONFIG_ENV_DEFAULT_CMDLINE=root=/dev/mtdblock4 rootfstype=jffs2 console=ttyS0,115200 init=/linuxrc ++CONFIG_ENV_DEFAULT_CMDLINE=root=/dev/mtdblock4 rootfstype=squashfs,jffs2 console=ttyS0,115200 init=/etc/preinit noinitrd + CONFIG_ENV_DEFAULT_CMDLINE_ALT_P=y +-CONFIG_ENV_DEFAULT_CMDLINE_ALT=root=/dev/mtdblock4 rootfstype=jffs2 console=ttyS0,115200 init=/linuxrc ++CONFIG_ENV_DEFAULT_CMDLINE_ALT=root=/dev/mtdblock4 rootfstype=squashfs,jffs2 console=ttyS0,115200 init=/etc/preinit noinitrd + # CONFIG_ENV_DEFAULT_STARTUP_OVERRIDE is not set + # CONFIG_ENV_DEFAULT_STARTUP_ALT_P is not set + CONFIG_USES_NOR_BOOTFLASH=y diff --git a/package/boot/apex/patches/120
[OpenWrt-Devel] [PATCH v2] netifd: Implement unbridge in /lib/network/config.sh
The unbridge function in /lib/network/config.sh is not implemented. As a result; when wifi down is executed, the wireless devices remain attached to the bridge (broadcom-wl). Subsequent attempts to bring up the wireless devices using wifi up fail; as netifd was never notified to remove them, and therefore ignores the add_device requests. (Note that unbridge is referenced by mac80211 and hostap as well, so I suspect that this behavior is not isolated to broadcom-wl). This patch eliminates the problem for me; although it is inefficient/brute force. It could be improved considerably if the status returned by a ubus call to retrieve network.device status for a particular device included the interface (e.g. 'lan') the device was attached to; or alternatively if there was a means of specifying a wild card (e.g., all interfaces) when the ubus call network.interface.interface remove_device was made. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- .../config/netifd/files/lib/network/config.sh | 28 +++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/package/network/config/netifd/files/lib/network/config.sh b/package/network/config/netifd/files/lib/network/config.sh index 9128971..1be1c11 100755 --- a/package/network/config/netifd/files/lib/network/config.sh +++ b/package/network/config/netifd/files/lib/network/config.sh @@ -12,10 +12,27 @@ find_config() { json_load $(ifstatus $interface) json_get_var ifdev device json_get_var ifl3dev l3_device - if [[ $device = $ifdev ]] || [[ $device = $ifl3dev ]]; then + if [ $device = $ifdev -o $device = $ifl3dev ]; then echo $interface exit 0 else + if [ -n $ifdev ]; then + local iftype + json_init + json_load $(ubus call network.device status { \name\: \$ifdev\ }) + json_get_var iftype type + if [ $iftype = Bridge ]; then + json_select bridge-members + local member _c=1 + while json_get_var member $_c; [ $member != ]; do + if [ $device = $member ]; then + echo $interface + exit 0 + fi + _c=$(($_c + 1)) + done + fi + fi exit 1 fi ) return @@ -23,7 +40,13 @@ find_config() { } unbridge() { - return + local device=$1 + local interface=${2:-$(find_config $device)} + if [ -n $interface ]; then + ubus call network.interface.$interface remove_device { \name\: \$device\ } /dev/null 21 + return 0 + fi + return 1 } ubus_call() { @@ -34,7 +57,6 @@ ubus_call() { return 0 } - fixup_interface() { local config=$1 local ifname type device l3dev -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] netifd: delete redundant 'wifi down'
wifi up performs an implied wifi down prior to performing the up. Delete the redundant wifi down calls. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/network/config/netifd/files/etc/init.d/network | 2 -- 1 file changed, 2 deletions(-) diff --git a/package/network/config/netifd/files/etc/init.d/network b/package/network/config/netifd/files/etc/init.d/network index 8031802..f54d69b 100755 --- a/package/network/config/netifd/files/etc/init.d/network +++ b/package/network/config/netifd/files/etc/init.d/network @@ -18,7 +18,6 @@ start_service() { reload_service() { ubus call network reload - /sbin/wifi down /sbin/wifi up } @@ -34,7 +33,6 @@ service_running() { sleep 5 - /sbin/wifi down /sbin/wifi up } -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] iwinfo: fix hwmodelist reporting for broadcom wl
Modify the hwmodelist reporting for broadcom devices to include proper reporting of 802.11n support. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- .../utils/iwinfo/src/include/iwinfo/api/broadcom.h | 23 +--- package/network/utils/iwinfo/src/iwinfo_wl.c | 41 +- 2 files changed, 59 insertions(+), 5 deletions(-) diff --git a/package/network/utils/iwinfo/src/include/iwinfo/api/broadcom.h b/package/network/utils/iwinfo/src/include/iwinfo/api/broadcom.h index 50eedd9..c7aa33e 100644 --- a/package/network/utils/iwinfo/src/include/iwinfo/api/broadcom.h +++ b/package/network/utils/iwinfo/src/include/iwinfo/api/broadcom.h @@ -26,7 +26,7 @@ #define WLC_IOCTL_MAGIC0x14e46c77 #defineWLC_IOCTL_MAXLEN8192 -#define WLC_CNTRY_BUF_SZ 4 +#define WLC_CNTRY_BUF_SZ 4 #define WLC_GET_MAGIC 0 #define WLC_GET_RATE 12 @@ -35,18 +35,30 @@ #define WLC_GET_BSSID 23 #define WLC_GET_SSID 25 #define WLC_GET_CHANNEL29 +#define WLC_GET_PHYTYPE39 #define WLC_GET_PASSIVE48 #define WLC_GET_COUNTRY83 #define WLC_GET_REVINFO98 -#define WLC_GET_AP 117 +#define WLC_GET_AP 117 #define WLC_GET_RSSI 127 #define WLC_GET_WSEC 133 #define WLC_GET_PHY_NOISE 135 #define WLC_GET_BSS_INFO 136 +#define WLC_GET_BANDLIST 140 #define WLC_GET_ASSOCLIST 159 #define WLC_GET_WPA_AUTH 164 -#define WLC_GET_COUNTRY_LIST 261 -#define WLC_GET_VAR262 +#define WLC_GET_COUNTRY_LIST 261 +#define WLC_GET_VAR262 + +#define WLC_PHY_TYPE_A 0 +#define WLC_PHY_TYPE_B 1 +#define WLC_PHY_TYPE_G 2 +#define WLC_PHY_TYPE_N 4 +#define WLC_PHY_TYPE_LP5 + +#define WLC_BAND_5G1 +#define WLC_BAND_2G2 +#define WLC_BAND_ALL 3 struct wl_ether_addr { @@ -117,6 +129,9 @@ typedef struct wlc_rev_info { uintucoderev; /* microcode version */ uintbus;/* bus type */ uintchipnum;/* chip number */ + uintphytype;/* phy type */ + uintphyrev; /* phy revision */ + uintanarev; /* anacore rev */ } wlc_rev_info_t; typedef struct wl_country_list { diff --git a/package/network/utils/iwinfo/src/iwinfo_wl.c b/package/network/utils/iwinfo/src/iwinfo_wl.c index 0a1439b..f5f0d4b 100644 --- a/package/network/utils/iwinfo/src/iwinfo_wl.c +++ b/package/network/utils/iwinfo/src/iwinfo_wl.c @@ -583,7 +583,46 @@ int wl_get_countrylist(const char *ifname, char *buf, int *len) int wl_get_hwmodelist(const char *ifname, int *buf) { - return wext_get_hwmodelist(ifname, buf); + int phytype; + uint i, band[WLC_BAND_ALL], bands; + + if (!wl_ioctl(ifname, WLC_GET_PHYTYPE, phytype, sizeof(phytype)) + !wl_ioctl(ifname, WLC_GET_BANDLIST, band, sizeof(band))) + { + switch (phytype) + { + case WLC_PHY_TYPE_A: + *buf = IWINFO_80211_A; + break; + case WLC_PHY_TYPE_B: + *buf = IWINFO_80211_B; + break; + case WLC_PHY_TYPE_LP: + case WLC_PHY_TYPE_G: + case WLC_PHY_TYPE_N: + bands = 0; + for (i = 1; i = band[0]; i++) + { + bands |= band[i]; + } + *buf = 0; + if (bands WLC_BAND_5G) + *buf |= IWINFO_80211_A; + if (bands WLC_BAND_2G) + { + *buf |= IWINFO_80211_B; + *buf |= IWINFO_80211_G; + } + if (phytype == WLC_PHY_TYPE_N) + *buf |= IWINFO_80211_N; + break; + default: + return -1
[OpenWrt-Devel] [PATCH] iwinfo: don't report associations for broadcom wds interfaces
The associations list for Broadcom WDS interfaces are duplicate to those reported by the corresponding AP interface; so there is no need to report them again. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/network/utils/iwinfo/src/iwinfo_wl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/network/utils/iwinfo/src/iwinfo_wl.c b/package/network/utils/iwinfo/src/iwinfo_wl.c index f5f0d4b..1adceb0 100644 --- a/package/network/utils/iwinfo/src/iwinfo_wl.c +++ b/package/network/utils/iwinfo/src/iwinfo_wl.c @@ -55,6 +55,9 @@ static struct wl_maclist * wl_read_assoclist(const char *ifname) struct wl_maclist *macs; int maclen = 4 + WL_MAX_STA_COUNT * 6; + if (strstr(ifname, wds)) + return NULL; + if ((macs = (struct wl_maclist *) malloc(maclen)) != NULL) { memset(macs, 0, maclen); -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/5] base-files: clean up variable definitions in /sbin/wifi
Make variables 'local' when appropriate and delete unused. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/base-files/files/sbin/wifi | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index ef20787..b6d286a 100755 --- a/package/base-files/files/sbin/wifi +++ b/package/base-files/files/sbin/wifi @@ -13,8 +13,7 @@ EOF find_net_config() {( local vif=$1 - local cfg - local ifname + local cfg ifname config_get cfg $vif network @@ -33,6 +32,7 @@ find_net_config() {( bridge_interface() {( local cfg=$1 + local iftype [ -z $cfg ] return 0 include /lib/network @@ -62,7 +62,7 @@ prepare_key_wep() { wifi_fixup_hwmode() { local device=$1 local default=$2 - local hwmode hwmode_11n + local channel hwmode hwmode_11n config_get channel $device channel config_get hwmode $device hwmode @@ -96,6 +96,7 @@ wifi_fixup_hwmode() { } wifi_updown() { + local device disabled iftype [ enable = $1 ] { wifi_updown disable $2 scan_wifi @@ -117,6 +118,7 @@ wifi_updown() { } wifi_detect() { + local driver for driver in ${2:-$DRIVERS}; do ( if eval type detect_$driver 2/dev/null /dev/null; then eval detect_$driver || echo $driver: Detect failed 2 @@ -150,7 +152,7 @@ set_wifi_up() { set_wifi_down() { local cfg=$1 - local vifs vif vifstr + local vifs vif [ -f /var/run/wifi-${cfg}.pid ] kill $(cat /var/run/wifi-${cfg}.pid) 2/dev/null @@ -178,9 +180,11 @@ scan_wifi() { esac # section end + local TYPE config_get TYPE $CONFIG_SECTION TYPE case $TYPE in wifi-iface) + local device vifs config_get device $CONFIG_SECTION device config_get vifs $device vifs append vifs $CONFIG_SECTION -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/5] base-files: clean up parameters to setup_interface in /sbin/wifi
Delete unused/obsolete parameters in 'setup_interface' call. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/base-files/files/sbin/wifi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index b6d286a..7f12e01 100755 --- a/package/base-files/files/sbin/wifi +++ b/package/base-files/files/sbin/wifi @@ -131,14 +131,13 @@ wifi_detect() { start_net() {( local iface=$1 local config=$2 - local vifmac=$3 [ -f /var/run/$iface.pid ] kill $(cat /var/run/${iface}.pid) 2/dev/null [ -z $config ] || { include /lib/network scan_interfaces for config in $config; do - setup_interface $iface $config $vifmac + setup_interface $iface $config done } )} -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 3/5] base-files: remove unnecessary 'scan_interfaces' call
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/base-files/files/sbin/wifi | 1 - 1 file changed, 1 deletion(-) diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index 7f12e01..eb12b59 100755 --- a/package/base-files/files/sbin/wifi +++ b/package/base-files/files/sbin/wifi @@ -135,7 +135,6 @@ start_net() {( [ -f /var/run/$iface.pid ] kill $(cat /var/run/${iface}.pid) 2/dev/null [ -z $config ] || { include /lib/network - scan_interfaces for config in $config; do setup_interface $iface $config done -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 4/5] base-files: fix return values
Fix return values for 'find_net_config' and 'bridge_interface'. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/base-files/files/sbin/wifi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index eb12b59..e4365a9 100755 --- a/package/base-files/files/sbin/wifi +++ b/package/base-files/files/sbin/wifi @@ -25,8 +25,9 @@ find_net_config() {( cfg=$(find_config $ifname) } - [ -z $cfg ] return 0 + [ -z $cfg ] return 1 echo $cfg + return 0 )} @@ -44,6 +45,7 @@ bridge_interface() {( prepare_interface_bridge $cfg return $? done + return 1 )} prepare_key_wep() { -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 5/5] base-files: improve device cleanup
/var/state/wireless isn't cleaned up properly when 'set_wifi_down' is called. State info for virtual devices (broadcom-wl) remains set unless 'scan_wifi' is invoked prior to calling 'uci_revert_state wireless $cfg' Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/base-files/files/sbin/wifi | 1 + 1 file changed, 1 insertion(+) diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index e4365a9..e3ed54b 100755 --- a/package/base-files/files/sbin/wifi +++ b/package/base-files/files/sbin/wifi @@ -154,6 +154,7 @@ set_wifi_down() { local cfg=$1 local vifs vif + scan_wifi [ -f /var/run/wifi-${cfg}.pid ] kill $(cat /var/run/wifi-${cfg}.pid) 2/dev/null uci_revert_state wireless $cfg -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] base-files: don't kill nas for sysupgrade
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/base-files/files/lib/upgrade/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 7e6e5fc..322c9c9 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -99,7 +99,7 @@ kill_remaining() { # [ signal ] case $name in # Skip essential services - *procd*|*ash*|*init*|*watchdog*|*ssh*|*dropbear*|*telnet*|*login*|*hostapd*|*wpa_supplicant*) : ;; + *procd*|*ash*|*init*|*watchdog*|*ssh*|*dropbear*|*telnet*|*login*|*hostapd*|*wpa_supplicant*|nas) : ;; # Killable process *) -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/18] broadcom-wl: fix compiler warning
Delete the return value (nvram_exit is declared with a 'void' return). Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/patches/100-fix_nvram_two_devices.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/broadcom-wl/patches/100-fix_nvram_two_devices.patch b/package/kernel/broadcom-wl/patches/100-fix_nvram_two_devices.patch index 5650862..6cf6fae 100644 --- a/package/kernel/broadcom-wl/patches/100-fix_nvram_two_devices.patch +++ b/package/kernel/broadcom-wl/patches/100-fix_nvram_two_devices.patch @@ -25,7 +25,7 @@ + nvram_init_done--; + if (nvram_init_done != 0) -+ return 0; ++ return; + sih = (si_t *)si; this = vars; -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 4/18] broadcom-wl: update description for recently added
Update descriptions for 'phytype' and 'band'. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/src/wlc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/kernel/broadcom-wl/src/wlc.c b/package/kernel/broadcom-wl/src/wlc.c index 7e638e5..7b21ea0 100644 --- a/package/kernel/broadcom-wl/src/wlc.c +++ b/package/kernel/broadcom-wl/src/wlc.c @@ -917,7 +917,7 @@ static const struct wlc_call wlc_calls[] = { .param = INT, .data.num = (WLC_GET_PHYTYPE 16), .handler = wlc_ioctl, - .desc = PHY Type + .desc = PHY Type (read-only) }, { .name = nmode, @@ -945,7 +945,7 @@ static const struct wlc_call wlc_calls[] = { .param = INT, .data.num = ((WLC_GET_BAND 16) | WLC_SET_BAND), .handler = wlc_ioctl, - .desc = Band + .desc = Band (0=auto, 1=5Ghz, 2=2.4GHz) }, }; #define wlc_calls_size (sizeof(wlc_calls) / sizeof(struct wlc_call)) -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/18] broadcom-wl: change interface names
'netifd' treats all devices with a . in their name as vlan devices. Modify the name of virtual/WDS interfaces created by broadcom-wl to use an _ instead of a ., so they will be treated as simple devices by 'netifd'. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- .../broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds | 2 +- package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 4 ++-- package/kernel/broadcom-wl/patches/013-interface-name.patch | 11 +++ 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 package/kernel/broadcom-wl/patches/013-interface-name.patch diff --git a/package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds b/package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds index 0a563c2..24853f3 100644 --- a/package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds +++ b/package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds @@ -56,6 +56,6 @@ setup_broadcom_wds() { case $ACTION in add|register) - [ ${INTERFACE%%0.*} = wds ] setup_broadcom_wds $INTERFACE + [ ${INTERFACE%%0_*} = wds ] setup_broadcom_wds $INTERFACE ;; esac diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 4d81bcb..26ebea5 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -45,7 +45,7 @@ scan_broadcom() { local _c= for vif in ${adhoc_if:-$sta_if $ap_if $mon_if}; do - config_set $vif ifname ${device}${_c:+.$_c} + config_set $vif ifname ${device}${_c:+_$_c} _c=$((${_c:-0} + 1)) done config_set $device vifs ${adhoc_if:-$sta_if $ap_if $mon_if} @@ -102,7 +102,7 @@ disable_broadcom() { include /lib/network # make sure the interfaces are down and removed from all bridges - for dev in $device ${device}.1 ${device}.2 ${device}.3; do + for dev in $device ${device}_1 ${device}_2 ${device}_3; do ifconfig $dev down 2/dev/null /dev/null { unbridge $dev } diff --git a/package/kernel/broadcom-wl/patches/013-interface-name.patch b/package/kernel/broadcom-wl/patches/013-interface-name.patch new file mode 100644 index 000..8aa0ca2 --- /dev/null +++ b/package/kernel/broadcom-wl/patches/013-interface-name.patch @@ -0,0 +1,11 @@ +--- a/driver/wl_linux.c b/driver/wl_linux.c +@@ -1556,7 +1556,7 @@ wl_add_if(wl_info_t *wl, struct wlc_if* + + wl_if_setup(wlif-dev); + +- sprintf(wlif-dev-name, %s%d.%d, devname, wl-pub-unit, wlif-subunit); ++ sprintf(wlif-dev-name, %s%d_%d, devname, wl-pub-unit, wlif-subunit); + if (remote) + bcopy(remote, wlif-remote, ETHER_ADDR_LEN); + -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 0/18] broadcom-wl: improvements for newer devices
The goal of this patch set is to provide improved support for newer devices supported by the proprietary broadcom-wl driver. This includes some general cleanup items, bug fixes, and some enhancements. I've tried to keep the individual patches small and focused on a single topic. Testing was limited to devices I have available to me (WRT54GS v1.1 and E3000). I have not been able to get encrypted WDS working with the existing mechanization in /etc/hotplug.d/net/20-broadcom-wds (nas4not); but I have gotten it to work by eliminating the use of the hotplug script and setting up the WDS interfaces directly in /lib/wifi/broadcom.sh (specifying them on the 'nas' command line). This change is not included in this patch set; but I would clean it up and submit it, assuming this patch set is accepted (perhaps w/ modifications), if the WDS experience is still the same for others and there were no fundamental objections to the approach. Nathan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 3/18] broadcom-wl: fix band reporting
Modify the band reporting for broadcom devices to correctly report HW capability. Currently, 802.11na devices report bgn; but should be reporting an. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- .../patches/014-fix-band-reporting.patch | 41 ++ 1 file changed, 41 insertions(+) create mode 100644 package/kernel/broadcom-wl/patches/014-fix-band-reporting.patch diff --git a/package/kernel/broadcom-wl/patches/014-fix-band-reporting.patch b/package/kernel/broadcom-wl/patches/014-fix-band-reporting.patch new file mode 100644 index 000..f1305a4 --- /dev/null +++ b/package/kernel/broadcom-wl/patches/014-fix-band-reporting.patch @@ -0,0 +1,41 @@ +--- a/driver/wl_iw.c b/driver/wl_iw.c +@@ -314,7 +314,7 @@ + ) + { + int phytype, err; +- uint band[3]; ++ uint i, band[3], bands; + char cap[5]; + + WL_TRACE((%s: SIOCGIWNAME\n, dev-name)); +@@ -335,16 +335,20 @@ + break; + case WLC_PHY_TYPE_LP: + case WLC_PHY_TYPE_G: +- if (band[0] = 2) +- strcpy(cap, abg); +- else +- strcpy(cap, bg); +- break; + case WLC_PHY_TYPE_N: +- if (band[0] = 2) +- strcpy(cap, abgn); +- else +- strcpy(cap, bgn); ++ bands = 0; ++ for (i = 1; i = band[0]; i++) { ++ bands |= dtoh32(band[i]); ++ } ++ strcpy(cap, ); ++ if (bands WLC_BAND_5G) ++ strcat(cap, a); ++ if (bands WLC_BAND_2G) ++ strcat(cap, bg); ++ if (phytype == WLC_PHY_TYPE_N) ++ strcat(cap, n); ++ break; ++ default: + break; + } + done: -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 5/18] broadcom-wl: fix whitespace handling
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/src/wlc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/broadcom-wl/src/wlc.c b/package/kernel/broadcom-wl/src/wlc.c index 7b21ea0..9f4abc0 100644 --- a/package/kernel/broadcom-wl/src/wlc.c +++ b/package/kernel/broadcom-wl/src/wlc.c @@ -1104,14 +1104,14 @@ int main(int argc, char **argv) if (!*s) continue; - if ((s2 = strchr(buf, ' ')) != NULL) + if ((s2 = strchr(s, ' ')) != NULL) *(s2++) = 0; while (s2 isspace(*s2)) s2++; - if ((call = find_cmd(buf)) == NULL) { - fprintf(stderr, Invalid command: %s\n, buf); + if ((call = find_cmd(s)) == NULL) { + fprintf(stderr, Invalid command: %s\n, s); ret = -1; } else ret = do_command(call, ((call-param NOARG) ? NULL : s2)); -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 7/18] broadcom-wl: shutdown 'nas' when 'wl' device is disabled
'nas' must be shutdown independently for each 'wl' device to properly support devices with multiple radios. Do the shutdown when the device is disabled instead of when it is brought up. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 104f31a..ff1d750 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -101,6 +101,9 @@ disable_broadcom() { ( include /lib/network + local pid_file=/var/run/nas.$device.pid + [ -e $pid_file ] start-stop-daemon -K -q -s SIGKILL -p $pid_file rm $pid_file + # make sure the interfaces are down and removed from all bridges for dev in $device ${device}_1 ${device}_2 ${device}_3; do ifconfig $dev down 2/dev/null /dev/null { @@ -346,7 +349,6 @@ enable_broadcom() { } _c=$(($_c + 1)) done - killall -KILL nas - 2- wlc ifname $device stdin EOF $ifdown -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 12/18] broadcom-wl: improve device cleanup
Move all device cleanup to disable_broadcom. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- .../kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 36 +- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 741aec3..ac6e76e 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -50,12 +50,6 @@ scan_broadcom() { done config_set $device vifs ${adhoc_if:-$sta_if $ap_if $mon_if} - ifdown=down - for vif in 0 1 2 3; do - append ifdown vif $vif $N - append ifdown enabled 0 $N - done - ap=1 infra=1 if [ $_c -gt 1 ]; then @@ -96,7 +90,6 @@ scan_broadcom() { disable_broadcom() { local device=$1 set_wifi_down $device - wlc ifname $device down ( include /lib/network @@ -104,12 +97,28 @@ disable_broadcom() { [ -e $pid_file ] start-stop-daemon -K -q -s SIGKILL -p $pid_file rm $pid_file # make sure the interfaces are down and removed from all bridges - local dev - for dev in $device ${device}_1 ${device}_2 ${device}_3; do - ifconfig $dev down 2/dev/null /dev/null { - unbridge $dev - } + local dev ifname + for dev in /sys/class/net/wds${device##wl}_* /sys/class/net/${device}_* /sys/class/net/${device}; do + if [ -e $dev ]; then + ifname=${dev##/sys/class/net/} + ifconfig $ifname down + unbridge $ifname + fi + done + + # make sure all of the devices are disabled in the driver + local ifdown= + local vif + append ifdown down $N + append ifdown wds none $N + for vif in 3 2 1 0; do + append ifdown vif $vif $N + append ifdown enabled 0 $N done + + wlc ifname $device stdin EOF +$ifdown +EOF ) true } @@ -362,8 +371,6 @@ enable_broadcom() { _c=$(($_c + 1)) done wlc ifname $device stdin EOF -$ifdown - ${macaddr:+bssid $macaddr} ${macaddr:+cur_etheraddr $macaddr} band ${band:-0} @@ -387,7 +394,6 @@ monitor ${monitor:-0} radio ${radio:-1} macfilter ${macfilter:-0} maclist ${maclist:-none} -wds none ${wds:+wds $wds} country ${country:-US} ${channel:+channel $channel} -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 10/18] broadcom-wl: eliminate 'invalid command' when setting ssid
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index dd2acec..a25ea7e 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -319,8 +319,7 @@ enable_broadcom() { local ssid config_get ssid $vif ssid append vif_post_up vlan_mode 0 $N - append vif_post_up ssid $ssid $N - append vif_do_up ssid $ssid $N + append vif_pre_up ssid $ssid $N [ $mode = monitor ] { append vif_post_up monitor $monitor $N -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 6/18] broadcom-wl: use a single instance of 'nas' per 'wl' device
A single instance of 'nas' can support multiple interfaces; there's no need to run multiple instances. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 26ebea5..104f31a 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -334,13 +334,15 @@ enable_broadcom() { append if_up set_wifi_up '$vif' '$ifname' ;$N append if_up start_net '$ifname' '$net_cfg' ;$N } - [ -z $nasopts ] || { + [ -z $nas -o -z $nasopts ] || { eval ${vif}_ssid=\\$ssid\ nas_mode=-A [ $mode = sta ] nas_mode=-S - [ -z $nas ] || { - nas_cmd=${nas_cmd:+$nas_cmd$N}start-stop-daemon -S -b -p /var/run/nas.$ifname.pid -x $nas -- -P /var/run/nas.$ifname.pid -H 34954 -i $ifname $nas_mode -m $auth -w $wsec -s \\$${vif}_ssid\ -g 3600 -F $nasopts + [ -z $nas_cmd ] { + local pid_file=/var/run/nas.$device.pid + nas_cmd=start-stop-daemon -S -b -p $pid_file -x $nas -- -P $pid_file -H 34954 } + append nas_cmd -i $ifname $nas_mode -m $auth -w $wsec -s \\$${vif}_ssid\ -g 3600 -F $nasopts } _c=$(($_c + 1)) done -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 11/18] broadcom-wl: add support for setting H/W address
Some devices initialize with a default address (common to all H/W). The address needs to be changeable so that a unique address can be assigned to each AP. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 15 +++ package/kernel/broadcom-wl/src/wlc.c | 7 +++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index a25ea7e..741aec3 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -97,7 +97,6 @@ disable_broadcom() { local device=$1 set_wifi_down $device wlc ifname $device down - wlc ifname $device bssid `wlc ifname $device default_bssid` ( include /lib/network @@ -131,7 +130,7 @@ enable_broadcom() { config_get_bool frameburst $device frameburst config_get macfilter $device macfilter config_get maclist $device maclist - config_get macaddr $device macaddr + config_get macaddr $device macaddr $(wlc ifname $device default_bssid) config_get txpower $device txpower config_get frag $device frag config_get rts $device rts @@ -199,7 +198,7 @@ enable_broadcom() { local _c=0 local nas=$(which nas) - local if_up nas_cmd + local if_pre_up if_up nas_cmd local vif vif_pre_up vif_post_up vif_do_up vif_txpower for vif in $vifs; do @@ -340,7 +339,10 @@ enable_broadcom() { local ifname config_get ifname $vif ifname - #append if_up ifconfig $ifname up ;$N + local if_cmd=if_pre_up + [ $ifname != ${ifname##${device}_} ] if_cmd=if_up + append $if_cmd macaddr=\$(wlc ifname '$ifname' cur_etheraddr) ;$N + append $if_cmd ifconfig '$ifname' \${macaddr:+hw ether \$macaddr} ;$N local net_cfg=$(find_net_config $vif) [ -z $net_cfg ] || { @@ -362,6 +364,8 @@ enable_broadcom() { wlc ifname $device stdin EOF $ifdown +${macaddr:+bssid $macaddr} +${macaddr:+cur_etheraddr $macaddr} band ${band:-0} ${nmode:+nmode $nmode} ${nmode:+${nreqd:+nreqd $nreqd}} @@ -393,6 +397,9 @@ slottime ${slottime:--1} ${frameburst:+frameburst $frameburst} $vif_pre_up +EOF + eval $if_pre_up + wlc ifname $device stdin EOF up $vif_post_up EOF diff --git a/package/kernel/broadcom-wl/src/wlc.c b/package/kernel/broadcom-wl/src/wlc.c index 9f4abc0..21754a7 100644 --- a/package/kernel/broadcom-wl/src/wlc.c +++ b/package/kernel/broadcom-wl/src/wlc.c @@ -892,6 +892,13 @@ static const struct wlc_call wlc_calls[] = { .desc = BSSID }, { + .name = cur_etheraddr, + .param = MAC, + .handler = wlc_iovar, + .data.str = cur_etheraddr, + .desc = Current MAC Address + }, + { .name = default_bssid, .param = MAC, .handler = wlc_iovar, -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 15/18] broadcom-wl: fix crash when starting multiple virtual interfaces
When enabling multiple VIFS, the driver sometimes crashes. The frequency of the crash increases as more VIFS are enabled. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- .../patches/008-fix_virtual_interfaces.patch | 123 - .../broadcom-wl/patches/009-fix_compile_3_2.patch | 4 +- .../patches/010-remove_irqf_samble_random.patch| 2 +- .../broadcom-wl/patches/012-compat-3.10.patch | 8 +- .../broadcom-wl/patches/013-interface-name.patch | 2 +- .../patches/110-add_number_to_dev_name.patch | 2 +- 6 files changed, 131 insertions(+), 10 deletions(-) diff --git a/package/kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch b/package/kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch index 3605931..23831df 100644 --- a/package/kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch +++ b/package/kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch @@ -1,6 +1,117 @@ --- a/driver/wl_linux.c +++ b/driver/wl_linux.c -@@ -1545,6 +1545,8 @@ wl_add_if(wl_info_t *wl, struct wlc_if* +@@ -354,6 +354,7 @@ static int wl_read_proc(char *buffer, ch + static int wl_dump(wl_info_t *wl, struct bcmstrbuf *b); + #endif /* BCMDBG */ + struct wl_if *wl_alloc_if(wl_info_t *wl, int iftype, uint unit, struct wlc_if* wlc_if); ++static void wl_link_if(wl_info_t *wl, wl_if_t *wlif); + static void wl_free_if(wl_info_t *wl, wl_if_t *wlif); + + +@@ -566,6 +567,9 @@ wl_attach(uint16 vendor, uint16 device, + wl-dev = dev; + wl_if_setup(dev); + ++ /* add the interface to the interface linked list */ ++ wl_link_if(wl, wlif); ++ + /* map chip registers (47xx: and sprom) */ + dev-base_addr = regs; + +@@ -1106,10 +1110,14 @@ wl_free(wl_info_t *wl) + free_irq(wl-dev-irq, wl); + } + +- if (wl-dev) { +- wl_free_if(wl, WL_DEV_IF(wl-dev)); +- wl-dev = NULL; ++ /* free all interfaces */ ++ while (wl-if_list) { ++ if ((wl-if_list-dev != wl-dev) || wl-if_list-next == NULL) ++ wl_free_if(wl, wl-if_list); ++ else ++ wl_free_if(wl, wl-if_list-next); + } ++ wl-dev = NULL; + + #ifdef TOE + wl_toe_detach(wl-toei); +@@ -1355,10 +1363,12 @@ wl_txflowcontrol(wl_info_t *wl, bool sta + + ASSERT(prio == ALLPRIO); + for (wlif = wl-if_list; wlif != NULL; wlif = wlif-next) { +- if (state == ON) +- netif_stop_queue(wlif-dev); +- else +- netif_wake_queue(wlif-dev); ++ if (wlif-dev_registed) { ++ if (state == ON) ++ netif_stop_queue(wlif-dev); ++ else ++ netif_wake_queue(wlif-dev); ++ } + } + } + +@@ -1398,7 +1408,6 @@ wl_alloc_if(wl_info_t *wl, int iftype, u + { + struct net_device *dev; + wl_if_t *wlif; +- wl_if_t *p; + + dev = alloc_etherdev(sizeof(wl_if_t)); + wlif = netdev_priv(dev); +@@ -1411,9 +1420,13 @@ wl_alloc_if(wl_info_t *wl, int iftype, u + wlif-wlcif = wlcif; + wlif-subunit = subunit; + +- /* match current flow control state */ +- if (iftype != WL_IFTYPE_MON wl-dev netif_queue_stopped(wl-dev)) +- netif_stop_queue(dev); ++ return wlif; ++} ++ ++static void ++wl_link_if(wl_info_t *wl, wl_if_t *wlif) ++{ ++ wl_if_t *p; + + /* add the interface to the interface linked list */ + if (wl-if_list == NULL) +@@ -1424,7 +1437,6 @@ wl_alloc_if(wl_info_t *wl, int iftype, u + p = p-next; + p-next = wlif; + } +- return wlif; + } + + static void +@@ -1504,6 +1516,9 @@ _wl_add_if(wl_task_t *task) + wl_info_t *wl = wlif-wl; + struct net_device *dev = wlif-dev; + ++ /* add the interface to the interface linked list */ ++ wl_link_if(wl, wlif); ++ + if (wlif-type == WL_IFTYPE_WDS) + dev-netdev_ops = wl_wds_ops; + +@@ -1516,6 +1531,14 @@ _wl_add_if(wl_task_t *task) + } + wlif-dev_registed = TRUE; + ++ /* match current flow control state */ ++ if (wl-dev) { ++ if (netif_queue_stopped(wl-dev)) ++ netif_stop_queue(dev); ++ else ++ netif_wake_queue(dev); ++ } ++ + done: + MFREE(wl-osh, task, sizeof(wl_task_t)); + atomic_dec(wl-callbacks); +@@ -1545,6 +1568,8 @@ wl_add_if(wl_info_t *wl, struct wlc_if* return NULL; } @@ -9,3 +120,13 @@ sprintf(wlif-dev-name, %s%d.%d, devname, wl-pub-unit, wlif-subunit); if (remote) bcopy(remote, wlif-remote, ETHER_ADDR_LEN); +@@ -2778,6 +2803,9 @@ wl_add_monitor(wl_task_t *task) + dev = wlif-dev; + wl-monitor = dev; + ++ /* add the interface to the interface linked list */ ++ wl_link_if(wl
[OpenWrt-Devel] [PATCH 16/18] broadcom-wl: support probe of 'wds' devices
'nas' requires probe of 'wds' devices to be successful; so don't fail them. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- .../patches/015-support-probe-of-wds-interfaces.patch | 11 +++ 1 file changed, 11 insertions(+) create mode 100644 package/kernel/broadcom-wl/patches/015-support-probe-of-wds-interfaces.patch diff --git a/package/kernel/broadcom-wl/patches/015-support-probe-of-wds-interfaces.patch b/package/kernel/broadcom-wl/patches/015-support-probe-of-wds-interfaces.patch new file mode 100644 index 000..f44921a --- /dev/null +++ b/package/kernel/broadcom-wl/patches/015-support-probe-of-wds-interfaces.patch @@ -0,0 +1,11 @@ +--- a/shared/wl.c b/shared/wl.c +@@ -27,7 +27,7 @@ wl_probe(char *name) + { + int ret, val; + +- if ((name[0] != 'w') || (name[1] != 'l')) ++ if ((name[0] != 'w') || ((name[1] != 'l') ((name[1] != 'd') || (name[2] != 's' + return -1; + + /* Check interface */ -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 13/18] broadcom-wl: support more virtual interfaces
Read the number of virtual interfaces to support from the device capabilities; as some newer devices can support up to 16. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- .../kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 10 - package/kernel/broadcom-wl/src/wlc.c | 43 ++ 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index ac6e76e..727bd73 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -108,12 +108,14 @@ disable_broadcom() { # make sure all of the devices are disabled in the driver local ifdown= - local vif + local bssmax=$(wlc ifname $device bssmax) + local vif=$((${bssmax:-4} - 1)) append ifdown down $N append ifdown wds none $N - for vif in 3 2 1 0; do + while [ $vif -ge 0 ]; do append ifdown vif $vif $N append ifdown enabled 0 $N + vif=$(($vif - 1)) done wlc ifname $device stdin EOF @@ -209,8 +211,12 @@ enable_broadcom() { local nas=$(which nas) local if_pre_up if_up nas_cmd local vif vif_pre_up vif_post_up vif_do_up vif_txpower + local bssmax=$(wlc ifname $device bssmax) + bssmax=${bssmax:-4} for vif in $vifs; do + [ $_c -ge $bssmax ] break + config_get vif_txpower $vif txpower local mode diff --git a/package/kernel/broadcom-wl/src/wlc.c b/package/kernel/broadcom-wl/src/wlc.c index 21754a7..5fee316 100644 --- a/package/kernel/broadcom-wl/src/wlc.c +++ b/package/kernel/broadcom-wl/src/wlc.c @@ -391,6 +391,35 @@ static int wlc_wsec_key(wlc_param param, void *null, void *value) return wl_bssiovar_set(interface, wsec_key, vif, wsec_key, sizeof(wsec_key)); } +static int wlc_cap(wlc_param param, void *data, void *value) +{ + char *iov = *((char **) data); + + if (param GET) + return wl_iovar_get(interface, iov, value, BUFSIZE); + + return -1; +} + +static int wlc_bssmax(wlc_param param, void *data, void *value) +{ + int *val = (int *) value; + char *iov = *((char **) data); + int ret = -1; + + if (param GET) { + ret = wl_iovar_get(interface, iov, wlbuf, BUFSIZE); + if (strstr(wlbuf, mbss4)) + *val = 4; + else if (strstr(wlbuf, mbss16)) + *val = 16; + else + *val = 1; + } + + return ret; +} + static inline int cw2ecw(int cw) { int i; @@ -954,6 +983,20 @@ static const struct wlc_call wlc_calls[] = { .handler = wlc_ioctl, .desc = Band (0=auto, 1=5Ghz, 2=2.4GHz) }, + { + .name = cap, + .param = STRING|NOARG, + .handler = wlc_cap, + .data.str = cap, + .desc = Capabilities + }, + { + .name = bssmax, + .param = INT|NOARG, + .handler = wlc_bssmax, + .data.str = cap, + .desc = Number of VIF's supported + }, }; #define wlc_calls_size (sizeof(wlc_calls) / sizeof(struct wlc_call)) -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 14/18] broadcom-wl: perform additional cleanup on wl module unload
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/patches/007-use-glue-driver.patch | 8 ++-- .../kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch | 2 +- package/kernel/broadcom-wl/patches/012-compat-3.10.patch | 2 +- package/kernel/broadcom-wl/patches/013-interface-name.patch | 2 +- .../kernel/broadcom-wl/patches/110-add_number_to_dev_name.patch | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/package/kernel/broadcom-wl/patches/007-use-glue-driver.patch b/package/kernel/broadcom-wl/patches/007-use-glue-driver.patch index 2639abc..a30dcc4 100644 --- a/package/kernel/broadcom-wl/patches/007-use-glue-driver.patch +++ b/package/kernel/broadcom-wl/patches/007-use-glue-driver.patch @@ -108,18 +108,20 @@ #ifdef CONFIG_PCI error = pci_register_driver(wl_pci_driver); -@@ -1082,7 +1053,9 @@ wl_module_init(void) +@@ -1082,7 +1053,11 @@ wl_module_init(void) return 0; error_pci: - ssb_driver_unregister(wl_ssb_driver); +#if defined(CONFIG_SSB) || defined(CONFIG_BCMA) + wl_glue_unregister(); ++ wl_glue_set_attach_callback(NULL); ++ wl_glue_set_remove_callback(NULL); +#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */ return error; } -@@ -1099,9 +1072,9 @@ wl_module_exit(void) +@@ -1099,9 +1074,11 @@ wl_module_exit(void) #ifdef CONFIG_PCI pci_unregister_driver(wl_pci_driver); #endif/* CONFIG_PCI */ @@ -128,6 +130,8 @@ -#endif/* CONFIG_SSB */ +#if defined(CONFIG_SSB) || defined(CONFIG_BCMA) + wl_glue_unregister(); ++ wl_glue_set_attach_callback(NULL); ++ wl_glue_set_remove_callback(NULL); +#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */ } diff --git a/package/kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch b/package/kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch index 6cffa27..3605931 100644 --- a/package/kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch +++ b/package/kernel/broadcom-wl/patches/008-fix_virtual_interfaces.patch @@ -1,6 +1,6 @@ --- a/driver/wl_linux.c +++ b/driver/wl_linux.c -@@ -1541,6 +1541,8 @@ wl_add_if(wl_info_t *wl, struct wlc_if* +@@ -1545,6 +1545,8 @@ wl_add_if(wl_info_t *wl, struct wlc_if* return NULL; } diff --git a/package/kernel/broadcom-wl/patches/012-compat-3.10.patch b/package/kernel/broadcom-wl/patches/012-compat-3.10.patch index 0e0415f..1ab8539 100644 --- a/package/kernel/broadcom-wl/patches/012-compat-3.10.patch +++ b/package/kernel/broadcom-wl/patches/012-compat-3.10.patch @@ -36,7 +36,7 @@ static int wl_read_proc(char *buffer, char **start, off_t offset, int length, int *eof, void *data) { -@@ -1137,7 +1137,7 @@ wl_free(wl_info_t *wl) +@@ -1141,7 +1141,7 @@ wl_free(wl_info_t *wl) /* free common resources */ if (wl-wlc) { diff --git a/package/kernel/broadcom-wl/patches/013-interface-name.patch b/package/kernel/broadcom-wl/patches/013-interface-name.patch index 8aa0ca2..a40154f 100644 --- a/package/kernel/broadcom-wl/patches/013-interface-name.patch +++ b/package/kernel/broadcom-wl/patches/013-interface-name.patch @@ -1,6 +1,6 @@ --- a/driver/wl_linux.c +++ b/driver/wl_linux.c -@@ -1556,7 +1556,7 @@ wl_add_if(wl_info_t *wl, struct wlc_if* +@@ -1560,7 +1560,7 @@ wl_add_if(wl_info_t *wl, struct wlc_if* wl_if_setup(wlif-dev); diff --git a/package/kernel/broadcom-wl/patches/110-add_number_to_dev_name.patch b/package/kernel/broadcom-wl/patches/110-add_number_to_dev_name.patch index 13ce727..28917d9 100644 --- a/package/kernel/broadcom-wl/patches/110-add_number_to_dev_name.patch +++ b/package/kernel/broadcom-wl/patches/110-add_number_to_dev_name.patch @@ -1,6 +1,6 @@ --- a/driver/wl_linux.c +++ b/driver/wl_linux.c -@@ -1412,7 +1412,7 @@ wl_alloc_if(wl_info_t *wl, int iftype, u +@@ -1416,7 +1416,7 @@ wl_alloc_if(wl_info_t *wl, int iftype, u dev = alloc_etherdev(sizeof(wl_if_t)); wlif = netdev_priv(dev); bzero(wlif, sizeof(wl_if_t)); -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 17/18] broadcom-wl: support 'wds' interfaces on 'wl1' device
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds b/package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds index 24853f3..63ac36a 100644 --- a/package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds +++ b/package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds @@ -56,6 +56,6 @@ setup_broadcom_wds() { case $ACTION in add|register) - [ ${INTERFACE%%0_*} = wds ] setup_broadcom_wds $INTERFACE + [ ${INTERFACE%%[0-1]_*} = wds ] setup_broadcom_wds $INTERFACE ;; esac -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 18/18] broadcom-wl: version roll
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/kernel/broadcom-wl/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/broadcom-wl/Makefile b/package/kernel/broadcom-wl/Makefile index 3b4d54c..588ac34 100644 --- a/package/kernel/broadcom-wl/Makefile +++ b/package/kernel/broadcom-wl/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=broadcom-wl PKG_VERSION:=5.10.56.27.3 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(ARCH).tar.bz2 PKG_SOURCE_URL:=http://downloads.openwrt.org/sources -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] ubox: support specifying swap priority from the command line
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- block.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/block.c b/block.c index 2289b77..2ef33e8 100644 --- a/block.c +++ b/block.c @@ -1038,8 +1038,8 @@ static int main_info(int argc, char **argv) static int main_swapon(int argc, char **argv) { - if (argc != 2) { - fprintf(stderr, Usage: swapon -s -a [DEVICE]\n\n\tStart swapping on [DEVICE]\n -a\tStart swapping on all swap devices\n -s\tShow summary\n); + if (argc != 2 argc != 4) { + fprintf(stderr, Usage: swapon -s -a -p pri [DEVICE]\n\n\tStart swapping on [DEVICE]\n -a\tStart swapping on all swap devices\n -p pri\tSet priority of swap device\n -s\tShow summary\n); return -1; } @@ -1070,14 +1070,21 @@ static int main_swapon(int argc, char **argv) } else { struct stat s; int err; + int prio = 0; + int dev_arg = 1; - if (stat(argv[1], s) || (!S_ISBLK(s.st_mode) !S_ISREG(s.st_mode))) { - fprintf(stderr, %s is not a block device or file\n, argv[1]); + if (!strcmp(argv[1], -p)) { + prio = ((atoi(argv[2]) SWAP_FLAG_PRIO_SHIFT) SWAP_FLAG_PRIO_MASK) | SWAP_FLAG_PREFER; + dev_arg = 3; + } + + if (stat(argv[dev_arg], s) || (!S_ISBLK(s.st_mode) !S_ISREG(s.st_mode))) { + fprintf(stderr, %s is not a block device or file\n, argv[dev_arg]); return -1; } - err = swapon(argv[1], 0); + err = swapon(argv[dev_arg], prio); if (err) { - fprintf(stderr, failed to swapon %s (%d)\n, argv[1], err); + fprintf(stderr, failed to swapon %s (%d)\n, argv[dev_arg], err); return err; } } -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [RFC TRY#2][PATCH] bgmac: pass received packet to the netif instead of copying it
On Mon, 28 Oct 2013 18:42:22 +0100 Rafał Miłecki zaj...@gmail.com wrote: Hi: A few questions/comments inline... Nathan Copying whole packets with skb_copy_from_linear_data_offset is a pretty bad idea. CPU was spending time in __copy_user_common and network performance was lower. With the new solution iperf-measured speed increased from 116Mb/s to 134Mb/s. Another way to improve performance could be switching to build_skb. It is cache-specific, so will require testing of various devices. Signed-off-by: Rafał Miłecki zaj...@gmail.com --- drivers/net/ethernet/broadcom/bgmac.c | 71 - 1 file changed, 44 insertions(+), 27 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c index 6b7541f..fde9a11 100644 --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c @@ -307,7 +307,6 @@ static int bgmac_dma_rx_read(struct bgmac *bgmac, struct bgmac_dma_ring *ring, struct device *dma_dev = bgmac-core-dma_dev; struct bgmac_slot_info *slot = ring-slots[ring-start]; struct sk_buff *skb = slot-skb; - struct sk_buff *new_skb; struct bgmac_rx_header *rx; u16 len, flags; @@ -320,38 +319,56 @@ static int bgmac_dma_rx_read(struct bgmac *bgmac, struct bgmac_dma_ring *ring, len = le16_to_cpu(rx-len); flags = le16_to_cpu(rx-flags); - /* Check for poison and drop or pass the packet */ - if (len == 0xdead flags == 0xbeef) { - bgmac_err(bgmac, Found poisoned packet at slot %d, DMA issue!\n, - ring-start); - } else { + do { old_skb duplicates skb stored above, can that one be used (renamed) instead of creating a new one here? + struct sk_buff *old_skb = slot-skb; + dma_addr_t old_dma_addr = slot-dma_addr; + int err; + + /* Check for poison and drop or pass the packet */ + if (len == 0xdead flags == 0xbeef) { + bgmac_err(bgmac, Found poisoned packet at slot %d, DMA issue!\n, + ring-start); Nothing in the buffer has been changed by the cpu yet, so is this sync necessary? + dma_sync_single_for_device(dma_dev, +slot-dma_addr, +BGMAC_RX_BUF_SIZE, +DMA_FROM_DEVICE); + break; + } + /* Omit CRC. */ len -= ETH_FCS_LEN; - new_skb = netdev_alloc_skb_ip_align(bgmac-net_dev, len); - if (new_skb) { - skb_put(new_skb, len); - skb_copy_from_linear_data_offset(skb, BGMAC_RX_FRAME_OFFSET, - new_skb-data, - len); - skb_checksum_none_assert(skb); - new_skb-protocol = - eth_type_trans(new_skb, bgmac-net_dev); - netif_receive_skb(new_skb); - handled++; - } else { - bgmac-net_dev-stats.rx_dropped++; - bgmac_err(bgmac, Allocation of skb for copying packet failed!\n); + /* Prepare new skb as replacement */ + err = bgmac_dma_rx_skb_for_slot(bgmac, slot); + if (err) { I've sent a separate patch against bgmac_dma_rx_skb_for_slot to not corrupt the slot at all if an error occurs (skb alloc or dma mapping), and free the skb that was allocated if a dma mapping error occurs. Assuming that patch is accepted, then the following two lines would not be needed. With bgmac_dma_rx_skb_for_slot as it currently exists, this would leak an skb for a dma mapping error (this was pre-existing to the changes in this patch). + slot-skb = old_skb; + slot-dma_addr = old_dma_addr; + + /* Poison the old skb */ + rx-len = cpu_to_le16(0xdead); + rx-flags = cpu_to_le16(0xbeef); + + dma_sync_single_for_device(dma_dev, +slot-dma_addr, +BGMAC_RX_BUF_SIZE, +DMA_FROM_DEVICE); +
[OpenWrt-Devel] [RFC] 6relayd: only invoke callback when addresses have changed
This is an attempt to prevent frequently triggering dnsmasq to reload when only the validity timers have changed. This is necessary because it seems the state file is being used for multiple purposes: 1) to transfer address information to dnsmasq, and 2) to provide state information that is useful for debugging but not relevant to dnsmasq. Reference: https://lists.openwrt.org/pipermail/openwrt-devel/2013-October/021699.html Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- src/dhcpv6-ia.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index aced2c0..cce419b 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -203,7 +203,7 @@ static int send_reconf(struct relayd_interface *iface, struct assignment *assign } -static void write_statefile(void) +static void write_statefile(bool address_change) { if (config-dhcpv6_statefile) { time_t now = monotonic_time(), wall_time = time(NULL); @@ -272,7 +272,7 @@ static void write_statefile(void) fclose(fp); } - if (config-dhcpv6_cb) { + if (address_change config-dhcpv6_cb) { char *argv[2] = {config-dhcpv6_cb, NULL}; if (!vfork()) { execv(argv[0], argv); @@ -384,7 +384,7 @@ static int prefixcmp(const void *va, const void *vb) static void update(struct relayd_interface *iface) { - struct relayd_ipaddr addr[8]; + struct relayd_ipaddr addr[8], old_addr[8]; memset(addr, 0, sizeof(addr)); int len = relayd_get_interface_addresses(iface-ifindex, addr, 8); @@ -396,6 +396,8 @@ static void update(struct relayd_interface *iface) time_t now = monotonic_time(); int minprefix = -1; + memcpy(old_addr, iface-pd_addr, iface-pd_addr_len * sizeof(*addr)); + for (int i = 0; i len; ++i) { if (addr[i].prefix minprefix) minprefix = addr[i].prefix; @@ -408,6 +410,11 @@ static void update(struct relayd_interface *iface) if (addr[i].valid UINT32_MAX - now) addr[i].valid += now; + + old_addr[i].addr.s6_addr32[2] = addr[i].addr.s6_addr32[2]; + old_addr[i].addr.s6_addr32[3] = addr[i].addr.s6_addr32[3]; + old_addr[i].preferred = addr[i].preferred; + old_addr[i].valid = addr[i].valid; } struct assignment *border = list_last_entry(iface-pd_assignments, struct assignment, head); @@ -415,6 +422,8 @@ static void update(struct relayd_interface *iface) bool change = len != (int)iface-pd_addr_len || memcmp(iface-pd_addr, addr, len * sizeof(*addr)); + bool address_change = len != (int)iface-pd_addr_len + || memcmp(old_addr, addr, len * sizeof(*addr)); if (change) { struct assignment *c; @@ -461,7 +470,7 @@ static void update(struct relayd_interface *iface) } } - write_statefile(); + write_statefile(address_change); } } @@ -885,7 +894,7 @@ size_t dhcpv6_handle_ia(uint8_t *buf, size_t buflen, struct relayd_interface *if } if (update_state) - write_statefile(); + write_statefile(true); out: return response_len; -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] 6relayd: verify fd is valid before use
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- src/6relayd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/6relayd.c b/src/6relayd.c index fcfecb7..32ead14 100644 --- a/src/6relayd.c +++ b/src/6relayd.c @@ -403,6 +403,9 @@ int relayd_get_interface_mtu(const char *ifname) snprintf(buf, sizeof(buf), sysctl_pattern, ifname); int fd = open(buf, O_RDONLY); + if (fd 0) + return -1; + ssize_t len = read(fd, buf, sizeof(buf) - 1); close(fd); -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] 6relayd: correct exit condition
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- src/dhcpv6-ia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index e5fefea..f824355 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -388,7 +388,7 @@ static void update(struct relayd_interface *iface) memset(addr, 0, sizeof(addr)); int len = relayd_get_interface_addresses(iface-ifindex, addr, 8); - if (len 0) + if (len 1) return; qsort(addr, len, sizeof(*addr), prefixcmp); -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] 6relayd: correct memcmp length calculation
Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- src/dhcpv6-ia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index f824355..aced2c0 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -414,7 +414,7 @@ static void update(struct relayd_interface *iface) border-assigned = 1 (64 - minprefix); bool change = len != (int)iface-pd_addr_len - || memcmp(iface-pd_addr, addr, len * sizeof(*border)); + || memcmp(iface-pd_addr, addr, len * sizeof(*addr)); if (change) { struct assignment *c; -- 1.8.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] iwinfo: make 'type' visible in wrapped iwinfo
On Thu, 10 Oct 2013 16:52:23 +0200 Jo-Philipp Wich j...@openwrt.org wrote: I do not understand the purpose of this patch. Can you outline such a callsite which is attempting to read the type attribute? ~ Jow Here are the places in luci that I am aware of: libs/core/luasrc/model/network.lua (lines 1251 and 1253) modules/admin-full/luasrc/view/admin_network/wifi_join.htm (line 135) -- Nathan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] iwinfo: make 'type' visible in wrapped iwinfo
There are several cases within 'luci' that attempt to access the interface 'type' from within the 'type' specific meta tables; however, 'type' is not currently available there. Replicate the common metadata in the 'type' specific meta tables. Signed-off-by: Nathan Hintz nlhi...@hotmail.com --- package/network/utils/iwinfo/src/iwinfo_lua.c | 4 1 file changed, 4 insertions(+) diff --git a/package/network/utils/iwinfo/src/iwinfo_lua.c b/package/network/utils/iwinfo/src/iwinfo_lua.c index fc4fd4a..3f1f206 100644 --- a/package/network/utils/iwinfo/src/iwinfo_lua.c +++ b/package/network/utils/iwinfo/src/iwinfo_lua.c @@ -862,6 +862,7 @@ LUALIB_API int luaopen_iwinfo(lua_State *L) { #ifdef USE_WL luaL_newmetatable(L, IWINFO_WL_META); + luaL_register(L, NULL, R_common); luaL_register(L, NULL, R_wl); lua_pushvalue(L, -1); lua_setfield(L, -2, __index); @@ -870,6 +871,7 @@ LUALIB_API int luaopen_iwinfo(lua_State *L) { #ifdef USE_MADWIFI luaL_newmetatable(L, IWINFO_MADWIFI_META); + luaL_register(L, NULL, R_common); luaL_register(L, NULL, R_madwifi); lua_pushvalue(L, -1); lua_setfield(L, -2, __index); @@ -878,6 +880,7 @@ LUALIB_API int luaopen_iwinfo(lua_State *L) { #ifdef USE_NL80211 luaL_newmetatable(L, IWINFO_NL80211_META); + luaL_register(L, NULL, R_common); luaL_register(L, NULL, R_nl80211); lua_pushvalue(L, -1); lua_setfield(L, -2, __index); @@ -885,6 +888,7 @@ LUALIB_API int luaopen_iwinfo(lua_State *L) { #endif luaL_newmetatable(L, IWINFO_WEXT_META); + luaL_register(L, NULL, R_common); luaL_register(L, NULL, R_wext); lua_pushvalue(L, -1); lua_setfield(L, -2, __index); -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] dhcpv6.script being triggered a lot
On Wed, 02 Oct 2013 08:21:33 +0200 Steven Barth cy...@openwrt.org wrote: On 02.10.2013 07:35, Nathan Hintz wrote: Hi Steven: netifd eventually crashed: Tue Oct 1 21:57:58 2013 daemon.notice netifd: wan6 (1382): Segmentation fault Could this be due to continuing to call system_add_address(dev, a_new); without ever calling system_del_address(dev, a_old);? Hmm strange, I tested this fix and fired multiple rounds of RAs at it but couldn't reproduce this segfault. Also calling system_add_address just sends a netlink control-message to the kernel and does not allocate anything which must be deallocated later (same goes for _handle_subnet_route) so this shouldn't be causing this. -Steven I searched for a core file, but didn't find one. Any suggestions for how I can help debug this if it happens again? It may be completely unrelated to your changes; although I haven't seen any crashes in 'netifd' in quite some time. I've reverted to the previous 'netifd' for now, but I will try it again tomorrow evening when I get home from work to see if it crashes again. -- Nathan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] dhcpv6.script being triggered a lot
On Tue, 01 Oct 2013 09:51:23 +0200 Steven Barth cy...@openwrt.org wrote: Hi Nathan, actually it's not that easy. Especially if the contents are the same this means an update. This is because most contents of the RA contain a validity timer in seconds. Thus if you sent 2 successive RAs with the same contents with a 3 second difference the second RA increases the validity of the contents by 3 seconds (as it arrived 3 seconds later). Cheers, Steven ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel True, but does it need to be passed on to netifd? Depends on who maintains/monitors the validity timers I guess. -- Nathan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel