[OpenWrt-Devel] how mini_fo run in mpc8247
my boot information RAMDISK: Compressed image found at block 0 SQUASHFS: Mounting a different endian SQUASHFS filesystem on ram0 VFS: Mounted root (squashfs filesystem) readonly. Freeing unused kernel memory: 144k init mkdir: can't create directory '/dev/shm': Read-only file system mkdir: can't create directory '/dev/pts': Read-only file system mount: mounting devpts on /dev/pts failed: No such file or directory - preinit - Press the [f] key and hit [enter] to enter failsafe mode - regular preinit - Could not open mtd device: rootfs Could not open mtd device: rootfs run firstboot by hacklu's hand Could not open mtd device: rootfs_data Could not open mtd device: rootfs_data mount: mounting on /overlay failed: Invalid argument mount: mounting /proc on /mnt/proc failed: No such file or directory - init - init started: BusyBox v1.16.1 (2010-06-09 18:06:15 CST) sysinit: rm: can't remove 'base-files': Read-only file system sysinit: uci: I/O error sysinit: uci: I/O error or how mini_fo run in powerpc ARCH thanks 2010-07-13 hacklu ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] comgt
What exactly does this patch do/achieve? Michael Grigorev wrote: Signed-off-by: Michael Grigorev sleuthho...@gmail.com mailto:sleuthho...@gmail.com Index: package/comgt/patches/004-CHANGELOG.diff === --- package/comgt/patches/004-CHANGELOG.diff (revision 0) +++ package/comgt/patches/004-CHANGELOG.diff (revision 0) @@ -0,0 +1,18 @@ +--- a/CHANGELOG Fri Oct 20 20:49:46 2006 b/CHANGELOG Tue Jul 13 09:38:59 2010 +@@ -1,7 +1,14 @@ +-Change log $Id: CHANGELOG,v 1.3 2006/10/20 14:30:19 pharscape Exp $ ++Change log $Id: CHANGELOG,v 1.4 2010/02/26 00:09:08 gknauf Exp $ + == + Changes to comgt + ++Tues Jul. 13th 2010 Michael Grigorev ++- fixed use CGREG for registration checking ++ ++Fri Feb. 26th 2010 Guenter Knauf ++- fixed typo in builtin script APN (bug ID 1610044). ++- silenced compiler warning (patch ID 1667936). ++ + Fri Oct. 20th 2006 Paul Hardwick + - Scripts distributed with package are now located in scripts sub-directory + - Install now copies scripts to /etc/comgt see scripts/README for list of scripts Index: package/comgt/patches/002-comgt.c.diff === --- package/comgt/patches/002-comgt.c.diff (revision 0) +++ package/comgt/patches/002-comgt.c.diff (revision 0) @@ -0,0 +1,26 @@ +--- a/comgt.c Fri Oct 20 20:49:46 2006 b/comgt.c Tue Jul 13 09:31:23 2010 +@@ -22,7 +22,7 @@ + */ + + /*** +-* $Id: comgt.c,v 1.4 2006/10/20 14:30:19 pharscape Exp $ ++* $Id: comgt.c,v 1.5 2010/02/25 23:47:30 gknauf Exp $ + / + + +@@ -1539,7 +1539,7 @@ + unsigned char terminator='\n'; + char *devenv,line[STRINGL]; + +- //Load up the COMGT device env variable if it exists ++ /* Load up the COMGT device env variable if it exists */ + devenv = getenv(COMGTDEVICE); + if (devenv != NULL strlen(devenv)){ + strcpy(device,devenv); +@@ -1737,4 +1737,5 @@ + sprintf(msg,Exit with code %d.\n,a); + vmsg(msg); + ext(a); ++ return 0; /* NOTREACHED */ + } Index: package/comgt/patches/003-comgt.h.diff === --- package/comgt/patches/003-comgt.h.diff (revision 0) +++ package/comgt/patches/003-comgt.h.diff (revision 0) @@ -0,0 +1,48 @@ +--- a/comgt.h Fri Oct 20 20:49:46 2006 b/comgt.h Tue Jul 13 09:36:18 2010 +@@ -20,10 +20,10 @@ + ***/ + + /*** +-* $Id: comgt.h,v 1.4 2006/10/20 14:30:19 pharscape Exp $ ++* $Id: comgt.h,v 1.5 2010/02/25 23:25:57 gknauf Exp $ + / +-#define COMGT_VERSION 0.32 +-#define YEARS 2005,2006 ++#define COMGT_VERSION 0.33 ++#define YEARS 2005,2006,2010 + + char _default_code[] = + opengt\n\ +@@ -83,8 +83,8 @@ + print \Waiting for Registration..(120 sec max)\\n\ + let c = 0\n\ + :waitreg\n\ +-send \AT+CREG?^m\\n\ +-waitfor 2 \+CREG: 0,1\,\+CREG: 0,5\\n\ ++send \AT+CGREG?^m\\n\ ++waitfor 2 \+CGREG: 0,1\,\+CGREG: 0,5\\n\ + if % = -1 goto regagain\n\ + if % = 0 goto homereg\n\ + if % = 1 goto roamreg\n\ +@@ -470,13 +470,17 @@ + if a=0 goto apnerror\n\ + if a32 goto apnerror\n\ + :enterapn\n\ +-send \AT+CGDCONT=1,\\\IP\\\,n\ +-send $c\n\ ++send \AT+CGDCONT=1,\\\IP\\\,\n\ ++send $x\n\ + send ^m\\n\ + waitfor 20 \OK\,\ERR\\n\ + if % = -1 goto timeerror\n\ + if % = 0 goto OK\n\ +-if % = 1 goto apnerror\n\ ++if % = 1 goto apnseterror\n\ ++ :apnseterror\n\ ++print \ERROR entering APN\n\\n\ ++print \The device did not accept the APN set command\n\\n\ ++exit 1\n\ + :apnerror\n\ + print \ERROR entering APN\n\\n\ + print \The COMGTAPN env variable is not set\n\\n\ ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel signature.asc Description: OpenPGP digital signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] ramips: Fix bridging in ramips ethernet driver
2010.07.08. 12:23 keltezéssel, Helmut Schaa írta: Bridging between the ramips ethernet driver and rt2800pci was somewhat broken. Frames received by the ethernet driver which were passed to the wifi driver for transmission were sometimes corrupted or sent out with huge delays. The reason for this is the missing assignment of skb-tail in the ramips ethernet driver's rx path resulting in skb-tail pointing to skb-data. Since skb-tail is used by mac80211 it writes into skb-data which messes up the frames content. Fix this by using skb_put to correctly set skb-len and skb-tail. Signed-off-by: Helmut Schaa helmut.sc...@googlemail.com Applied: https://dev.openwrt.org/changeset/22172 Thanks, Gabor ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/3] ar71xx: in-flash macs and eeprom for mach-eap7660d
This patch adds support for reading MAC addresses as well as wireless interface callibration-data from the board flash of the EAP7660D. Signed-off-by: Daniel Golle daniel.go...@gmail.com Index: target/linux/ar71xx/files/include/linux/ath_platform.h === --- target/linux/ar71xx/files/include/linux/ath_platform.h (revision 0) +++ target/linux/ar71xx/files/include/linux/ath_platform.h (revision 0) @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2008 Atheros Communications Inc. + * Copyright (c) 2009 Gabor Juhos juh...@openwrt.org + * Copyright (c) 2009 Imre Kaloz ka...@openwrt.org + * Copyright (c) 2010 Daniel Golle daniel.go...@gmail.com + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LINUX_ATH_PLATFORM_H +#define _LINUX_ATH_PLATFORM_H + +#define ATH_PLAT_EEP_MAX_WORDS 2048 + +struct ath_platform_data { + u16 *eeprom_data; + u8 *macaddr; +}; + +#endif /* _LINUX_ATH_PLATFORM_H */ Index: target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig === --- target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig (revision 22105) +++ target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig (working copy) @@ -226,7 +226,6 @@ config AR71XX_MACH_EAP7660D bool Senao EAP7660D support select AR71XX_DEV_M25P80 - select AR71XX_DEV_PB42_PCI if PCI select AR71XX_DEV_GPIO_BUTTONS select AR71XX_DEV_LEDS_GPIO default n Index: target/linux/ar71xx/files/arch/mips/ar71xx/mach-eap7660d.c === --- target/linux/ar71xx/files/arch/mips/ar71xx/mach-eap7660d.c (revision 22105) +++ target/linux/ar71xx/files/arch/mips/ar71xx/mach-eap7660d.c (working copy) @@ -10,13 +10,16 @@ * by the Free Software Foundation. */ +#include linux/pci.h +#include linux/ath_platform.h +#include linux/delay.h #include asm/mach-ar71xx/ar71xx.h +#include asm/mach-ar71xx/pci.h #include machtype.h #include devices.h #include dev-gpio-buttons.h #include dev-leds-gpio.h -#include dev-pb42-pci.h #include dev-m25p80.h #define EAP7660D_BUTTONS_POLL_INTERVAL 20 @@ -27,7 +30,77 @@ #define EAP7660D_GPIO_SW1 3 #define EAP7660D_GPIO_SW3 8 #define EAP7660D_PHYMASK BIT(20) +#define EAP7660D_BOARDCONFIG 0x1F7F +#define EAP7660D_GBIC_MAC_OFFSET 0x1000 +#define EAP7660D_WMAC0_MAC_OFFSET 0x1010 +#define EAP7660D_WMAC1_MAC_OFFSET 0x1016 +#define EAP7660D_WMAC0_CALDATA_OFFSET 0x2000 +#define EAP7660D_WMAC1_CALDATA_OFFSET 0x3000 +static struct ath_platform_data eap7660d_wmac0_data; +static struct ath_platform_data eap7660d_wmac1_data; +static char eap7660d_wmac0_mac[6]; +static char eap7660d_wmac1_mac[6]; +static __u16 eap7660d_wmac0_eeprom[ATH_PLAT_EEP_MAX_WORDS]; +static __u16 eap7660d_wmac1_eeprom[ATH_PLAT_EEP_MAX_WORDS]; +static int ap94_pci_fixup_enabled; + +static struct ar71xx_pci_irq eap7660d_pci_irqs[] __initdata = { +{ +.slot = 0, +.pin= 1, +.irq= AR71XX_PCI_IRQ_DEV0, +}, { +.slot = 1, +.pin= 1, +.irq= AR71XX_PCI_IRQ_DEV1, +} +}; + +static int eap7660d_pci_plat_dev_init(struct pci_dev *dev) +{ + switch(PCI_SLOT(dev-devfn)) { + case 17: + dev-dev.platform_data = eap7660d_wmac0_data; + break; + + case 18: + dev-dev.platform_data = eap7660d_wmac1_data; + break; + } + + return 0; +} + +void __init eap7660d_pci_init(u8 *cal_data0, u8 *mac_addr0, + u8 *cal_data1, u8 *mac_addr1) +{ + if (cal_data0 *cal_data0 == 0xa55a) { + memcpy(eap7660d_wmac0_eeprom, cal_data0, + ATH_PLAT_EEP_MAX_WORDS); + eap7660d_wmac0_data.eeprom_data = eap7660d_wmac0_eeprom; + } + + if (cal_data1 *cal_data1 == 0xa55a) { + memcpy(eap7660d_wmac1_eeprom, cal_data1, + ATH_PLAT_EEP_MAX_WORDS); + eap7660d_wmac1_data.eeprom_data = eap7660d_wmac1_eeprom; + } + + if (mac_addr0) { +
[OpenWrt-Devel] [PATCH 3/3] madwifi: in-flash macs for mach-eap7660d
This patch makes madwifi respect (at least) the platform_data supplied MAC address. Signed-off-by: Daniel Golle daniel.go...@gmail.com Index: package/madwifi/patches/470-mac_addresss_from_ath_platform_data.patch === --- package/madwifi/patches/470-mac_addresss_from_ath_platform_data.patch (revision 0) +++ package/madwifi/patches/470-mac_addresss_from_ath_platform_data.patch (revision 0) @@ -0,0 +1,43 @@ +diff -ru a/ath/if_ath.c b/ath/if_ath.c +--- a/ath/if_ath.c 2010-06-24 23:02:47.0 +0200 b/ath/if_ath.c 2010-06-24 23:48:07.0 +0200 +@@ -63,6 +63,8 @@ + #include linux/rtnetlink.h + #include linux/time.h + #include linux/pci.h ++#include linux/device.h ++#include linux/ath_platform.h + #include asm/uaccess.h + + #include if_ethersubr.h /* for ETHER_IS_MULTICAST */ +@@ -587,8 +589,13 @@ + unsigned int i; + int autocreatemode = -1; + u_int8_t csz; ++#ifdef ATH_PCI ++ struct ath_platform_data *pdata; ++ struct pci_dev *pdev; ++#endif + + sc-devid = devid; ++ + #ifdef AR_DEBUG + ath_debug_global = (ath_debug ATH_DEBUG_GLOBAL); + sc-sc_debug = (ath_debug ~ATH_DEBUG_GLOBAL); +@@ -648,8 +655,15 @@ + } + sc-sc_ah = ah; + +- /* WAR for AR7100 PCI bug */ + #ifdef CONFIG_ATHEROS_AR71XX ++#ifdef ATH_PCI ++ /* set MAC from ath_platform_data */ ++ pdev = (struct pci_dev *)sc-sc_bdev; ++ pdata = (struct ath_platform_data *)pdev-dev.platform_data; ++ if (pdata pdata-macaddr) ++ ath_hal_setmac(ah, pdata-macaddr); ++#endif ++ /* WAR for AR7100 PCI bug */ + if ((ar_device(sc-devid) = 5210) (ar_device(sc-devid) 5416)) { + ath_hal_setcapability(ah, HAL_CAP_DMABURST_RX, 0, HAL_DMABURST_4B, NULL); + ath_hal_setcapability(ah, HAL_CAP_DMABURST_TX, 0, HAL_DMABURST_4B, NULL); ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 1/3] ar71xx: in-flash macs and eeprom for mach-eap7660d
2010.07.13. 19:22 keltezéssel, daniel.go...@gmail.com írta: This patch adds support for reading MAC addresses as well as wireless interface callibration-data from the board flash of the EAP7660D. Signed-off-by: Daniel Golle daniel.go...@gmail.com Index: target/linux/ar71xx/files/include/linux/ath_platform.h === --- target/linux/ar71xx/files/include/linux/ath_platform.h(revision 0) +++ target/linux/ar71xx/files/include/linux/ath_platform.h(revision 0) @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2008 Atheros Communications Inc. + * Copyright (c) 2009 Gabor Juhos juh...@openwrt.org + * Copyright (c) 2009 Imre Kaloz ka...@openwrt.org + * Copyright (c) 2010 Daniel Golle daniel.go...@gmail.com + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LINUX_ATH_PLATFORM_H +#define _LINUX_ATH_PLATFORM_H + +#define ATH_PLAT_EEP_MAX_WORDS 2048 + +struct ath_platform_data { + u16 *eeprom_data; + u8 *macaddr; +}; + +#endif /* _LINUX_ATH_PLATFORM_H */ Now that this will be used for ath5k devices only, it would be better to rename it to ath5k_platform.h, and change the ath prefixes to ath5k as well. Index: target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig === --- target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig(revision 22105) +++ target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig(working copy) @@ -226,7 +226,6 @@ config AR71XX_MACH_EAP7660D bool Senao EAP7660D support select AR71XX_DEV_M25P80 - select AR71XX_DEV_PB42_PCI if PCI select AR71XX_DEV_GPIO_BUTTONS select AR71XX_DEV_LEDS_GPIO default n Index: target/linux/ar71xx/files/arch/mips/ar71xx/mach-eap7660d.c === --- target/linux/ar71xx/files/arch/mips/ar71xx/mach-eap7660d.c (revision 22105) +++ target/linux/ar71xx/files/arch/mips/ar71xx/mach-eap7660d.c (working copy) @@ -10,13 +10,16 @@ * by the Free Software Foundation. */ +#include linux/pci.h +#include linux/ath_platform.h +#include linux/delay.h #include asm/mach-ar71xx/ar71xx.h +#include asm/mach-ar71xx/pci.h #include machtype.h #include devices.h #include dev-gpio-buttons.h #include dev-leds-gpio.h -#include dev-pb42-pci.h #include dev-m25p80.h #define EAP7660D_BUTTONS_POLL_INTERVAL 20 @@ -27,7 +30,77 @@ #define EAP7660D_GPIO_SW13 #define EAP7660D_GPIO_SW38 #define EAP7660D_PHYMASK BIT(20) +#define EAP7660D_BOARDCONFIG 0x1F7F +#define EAP7660D_GBIC_MAC_OFFSET 0x1000 +#define EAP7660D_WMAC0_MAC_OFFSET0x1010 +#define EAP7660D_WMAC1_MAC_OFFSET0x1016 +#define EAP7660D_WMAC0_CALDATA_OFFSET0x2000 +#define EAP7660D_WMAC1_CALDATA_OFFSET0x3000 +static struct ath_platform_data eap7660d_wmac0_data; +static struct ath_platform_data eap7660d_wmac1_data; +static char eap7660d_wmac0_mac[6]; +static char eap7660d_wmac1_mac[6]; +static __u16 eap7660d_wmac0_eeprom[ATH_PLAT_EEP_MAX_WORDS]; +static __u16 eap7660d_wmac1_eeprom[ATH_PLAT_EEP_MAX_WORDS]; The __xx types are used in the header files which are exported to used-space. You should use 'u16' here. +static int ap94_pci_fixup_enabled; This variable is not needed. + +static struct ar71xx_pci_irq eap7660d_pci_irqs[] __initdata = { +{ +.slot = 0, +.pin= 1, +.irq= AR71XX_PCI_IRQ_DEV0, +}, { +.slot = 1, +.pin= 1, +.irq= AR71XX_PCI_IRQ_DEV1, +} +}; + +static int eap7660d_pci_plat_dev_init(struct pci_dev *dev) +{ + switch(PCI_SLOT(dev-devfn)) { + case 17: + dev-dev.platform_data = eap7660d_wmac0_data; + break; + + case 18: + dev-dev.platform_data = eap7660d_wmac1_data; + break; + } + + return 0; +} + +void __init eap7660d_pci_init(u8 *cal_data0, u8 *mac_addr0, + u8 *cal_data1, u8 *mac_addr1) +{ + if (cal_data0 *cal_data0 == 0xa55a) { +
Re: [OpenWrt-Devel] [PATCH 2/3] ath5k: in-flash macs and eeprom for mach-eap7660d
2010.07.13. 19:26 keltezéssel, daniel.go...@gmail.com írta: This adds ath_platform.h to mac80211 and patches ath5k to respect MAC addresses and eeprom content from platform_data, if supplied. Signed-off-by: Daniel Golle daniel.go...@gmail.com Index: package/mac80211/patches/450-add-ath-platform.patch === --- package/mac80211/patches/450-add-ath-platform.patch (revision 0) +++ package/mac80211/patches/450-add-ath-platform.patch (revision 0) @@ -0,0 +1,35 @@ +diff -Nur a/include/linux/ath_platform.h b/include/linux/ath_platform.h +--- a/include/linux/ath_platform.h 1970-01-01 01:00:00.0 +0100 b/include/linux/ath_platform.h 2010-06-21 00:19:52.0 +0200 +@@ -0,0 +1,30 @@ ++/* ++ * Copyright (c) 2008 Atheros Communications Inc. ++ * Copyright (c) 2009 Gabor Juhos juh...@openwrt.org ++ * Copyright (c) 2009 Imre Kaloz ka...@openwrt.org ++ * Copyright (c) 2010 Daniel Golle daniel.go...@gmail.com ++ * ++ * Permission to use, copy, modify, and/or distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ */ ++ ++#ifndef _LINUX_ATH_PLATFORM_H ++#define _LINUX_ATH_PLATFORM_H ++ ++#define ATH_PLAT_EEP_MAX_WORDS 2048 ++ ++struct ath_platform_data { ++u16 *eeprom_data; ++u8 *macaddr; ++}; ++ ++#endif /* _LINUX_ATH_PLATFORM_H */ + Index: package/mac80211/patches/451-add-platform-eeprom-support-to-ath5k.patch === --- package/mac80211/patches/451-add-platform-eeprom-support-to-ath5k.patch (revision 0) +++ package/mac80211/patches/451-add-platform-eeprom-support-to-ath5k.patch (revision 0) @@ -0,0 +1,57 @@ +--- a/drivers/net/wireless/ath/ath5k/eeprom.c2010-06-23 03:08:32.0 +0200 b/drivers/net/wireless/ath/ath5k/eeprom.c2010-06-23 05:59:30.0 +0200 +@@ -22,6 +23,8 @@ + \*/ + + #include linux/slab.h ++#include linux/ath_platform.h ++#include linux/pci.h + + #include ath5k.h + #include reg.h +@@ -34,6 +37,18 @@ + static int ath5k_hw_eeprom_read(struct ath5k_hw *ah, u32 offset, u16 *data) + { + u32 status, timeout; ++struct ath_platform_data *pdata = NULL; ++ ++if (ah-ah_sc-pdev) // we only got pdev with PCI bus, right? ++pdata = (struct ath_platform_data *) ah-ah_sc-pdev-dev.platform_data; The cast is not needed. ++ ++if (pdata ((__u16)(pdata-eeprom_data) == AR5K_EEPROM_MAGIC_VALUE)) You are checking the address of the eeprom_data instead of the first word of the actual data. ++{ ++ATH5K_INFO(ah-ah_sc, using eeprom-content from platform_data\n); ++if (offset = ATH_PLAT_EEP_MAX_WORDS) return -EIO; ++*data = pdata-eeprom_data[offset]; ++return 0; ++} + + /* + * Initialize EEPROM access +@@ -1788,7 +1802,7 @@ + } + + /* +- * Read the MAC address from eeprom ++ * Read the MAC address from eeprom or platform_data + */ + int ath5k_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac) + { +@@ -1796,6 +1810,16 @@ + u32 total, offset; + u16 data; + int octet, ret; ++struct ath_platform_data *pdata = NULL; ++ ++if (ah-ah_sc-pdev) ++pdata = (struct ath_platform_data *) ah-ah_sc-pdev-dev.platform_data; The cast is not needed. ++ ++if (pdata pdata-macaddr) ++{ ++memcpy(mac, pdata-macaddr, ETH_ALEN); ++return 0; ++} + + ret = ath5k_hw_eeprom_read(ah, 0x20, data); + if (ret) + ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 3/3] madwifi: in-flash macs for mach-eap7660d
2010.07.13. 19:31 keltezéssel, daniel.go...@gmail.com írta: This patch makes madwifi respect (at least) the platform_data supplied MAC address. Signed-off-by: Daniel Golle daniel.go...@gmail.com Index: package/madwifi/patches/470-mac_addresss_from_ath_platform_data.patch === --- package/madwifi/patches/470-mac_addresss_from_ath_platform_data.patch (revision 0) +++ package/madwifi/patches/470-mac_addresss_from_ath_platform_data.patch (revision 0) @@ -0,0 +1,43 @@ +diff -ru a/ath/if_ath.c b/ath/if_ath.c +--- a/ath/if_ath.c 2010-06-24 23:02:47.0 +0200 b/ath/if_ath.c 2010-06-24 23:48:07.0 +0200 +@@ -63,6 +63,8 @@ + #include linux/rtnetlink.h + #include linux/time.h + #include linux/pci.h ++#include linux/device.h ++#include linux/ath_platform.h + #include asm/uaccess.h + + #include if_ethersubr.h /* for ETHER_IS_MULTICAST */ +@@ -587,8 +589,13 @@ + unsigned int i; + int autocreatemode = -1; + u_int8_t csz; ++#ifdef ATH_PCI ++struct ath_platform_data *pdata; ++struct pci_dev *pdev; ++#endif + + sc-devid = devid; ++ + #ifdef AR_DEBUG + ath_debug_global = (ath_debug ATH_DEBUG_GLOBAL); + sc-sc_debug = (ath_debug ~ATH_DEBUG_GLOBAL); +@@ -648,8 +655,15 @@ + } + sc-sc_ah = ah; + +-/* WAR for AR7100 PCI bug */ + #ifdef CONFIG_ATHEROS_AR71XX ++#ifdef ATH_PCI Please move this out from the CONFIG_ATHEROS_AR71XXX section, because in the current form it will cause a compiler warning about unused variables on other platforms. ++/* set MAC from ath_platform_data */ ++pdev = (struct pci_dev *)sc-sc_bdev; ++pdata = (struct ath_platform_data *)pdev-dev.platform_data; The cast is not necessary. ++if (pdata pdata-macaddr) ++ath_hal_setmac(ah, pdata-macaddr); ++#endif ++/* WAR for AR7100 PCI bug */ + if ((ar_device(sc-devid) = 5210) (ar_device(sc-devid) 5416)) { + ath_hal_setcapability(ah, HAL_CAP_DMABURST_RX, 0, HAL_DMABURST_4B, NULL); + ath_hal_setcapability(ah, HAL_CAP_DMABURST_TX, 0, HAL_DMABURST_4B, NULL); ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] Modifies iptables Makefile to package libipq as a shared library
r21799 by jow changed the staging install of libipq so that it is no longer available as a static library but is dynamically linked in as a shared library. However the libipq package was not being built. This patch provides libipq.so as a package. Signed-off-by: Ashok Rao greatar...@gmail.com --- Index: Makefile === --- Makefile(revision 22140) +++ Makefile(working copy) @@ -44,7 +44,7 @@ $(call Package/iptables/Default) TITLE:=IPv4 firewall administration tool MENU:=1 - DEPENDS+= +kmod-ipt-core +libiptc +libxtables + DEPENDS+= +kmod-ipt-core +libiptc +libxtables +libipq endef define Package/iptables/description @@ -261,6 +261,12 @@ TITLE:=IPv4/IPv6 firewall - shared xtables library endef +define Package/libipq +$(call Package/iptables/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE:=IPv4/IPv6 firewall - shared libipq library +endef TARGET_CPPFLAGS := \ -I$(PKG_BUILD_DIR)/include \ @@ -361,6 +367,11 @@ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxtables.so* $(1)/usr/lib/ endef +define Package/libipq/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libipq.so* $(1)/usr/lib/ +endef + define BuildPlugin define Package/$(1)/install $(INSTALL_DIR) $$(1)/usr/lib/iptables @@ -399,3 +410,4 @@ $(eval $(call BuildPackage,ip6tables-utils)) $(eval $(call BuildPackage,libiptc)) $(eval $(call BuildPackage,libxtables)) +$(eval $(call BuildPackage,libipq)) ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] Adds rawnat and rawpost package options to xtables-addons and bumps version up to 1.24
rawpost is an addition to the netfilter raw table. rawnat is used to do stateless NAT and is useful for multi-link wan load balancing of a single flow. v1.22 and prior of xtables-addons required ipv6 support for rawnat. v1.23 and later made that support optional. Request bumping up xtables-addons to version 1.24 at the very least. The latest version is 1.27. Ashok --- Index: Makefile === --- Makefile(revision 22145) +++ Makefile(working copy) @@ -9,11 +9,11 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=xtables-addons -PKG_VERSION:=1.22 +PKG_VERSION:=1.24 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_MD5SUM:=990e2d84a1767c8247c92ae7b11e53a9 +PKG_MD5SUM:=1b538a25ef82edb7a7ea7411d599d6b9 PKG_SOURCE_URL:=...@sf/xtables-addons PKG_BUILD_DEPENDS:=iptables @@ -93,3 +93,5 @@ $(eval $(call BuildTemplate,tarpit,TARPIT,xt_TARPIT,xt_TARPIT,46,+kmod-ipt-compat-xtables)) $(eval $(call BuildTemplate,tee,TEE,xt_TEE,xt_TEE,46,+kmod-ipt-compat-xtables)) $(eval $(call BuildTemplate,ipp2p,IPP2P,xt_ipp2p,xt_ipp2p,46,)) +$(eval $(call BuildTemplate,rawpost,RAWPOST,,iptable_rawpost,46,+kmod-ipt-compat-xtables)) +$(eval $(call BuildTemplate,rawnat,RAWNAT,xt_RAWDNAT xt_RAWSNAT,xt_RAWNAT,46,+kmod-ipt-compat-xtables)) ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 1/3] ar71xx: in-flash macs and eeprom for mach-eap7660d
I now renamed everything to ath5k_platform and also included all other previously suggested fixes. Cheers! This adds in-flash mac-addresses and callibration data for the Senao EAP7660D board. Signed-off-by: Daniel Golle daniel.go...@gmail.com Index: target/linux/ar71xx/files/include/linux/ath5k_platform.h === --- target/linux/ar71xx/files/include/linux/ath5k_platform.h(revision 0) +++ target/linux/ar71xx/files/include/linux/ath5k_platform.h(revision 0) @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2008 Atheros Communications Inc. + * Copyright (c) 2009 Gabor Juhos juh...@openwrt.org + * Copyright (c) 2009 Imre Kaloz ka...@openwrt.org + * Copyright (c) 2010 Daniel Golle daniel.go...@gmail.com + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LINUX_ATH5K_PLATFORM_H +#define _LINUX_ATH5K_PLATFORM_H + +#define ATH5K_PLAT_EEP_MAX_WORDS 2048 + +struct ath5k_platform_data { + u16 *eeprom_data; + u8 *macaddr; +}; + +#endif /* _LINUX_ATH5K_PLATFORM_H */ Index: target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig === --- target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig (revision 22105) +++ target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig (working copy) @@ -226,7 +226,6 @@ config AR71XX_MACH_EAP7660D bool Senao EAP7660D support select AR71XX_DEV_M25P80 - select AR71XX_DEV_PB42_PCI if PCI select AR71XX_DEV_GPIO_BUTTONS select AR71XX_DEV_LEDS_GPIO default n Index: target/linux/ar71xx/files/arch/mips/ar71xx/mach-eap7660d.c === --- target/linux/ar71xx/files/arch/mips/ar71xx/mach-eap7660d.c (revision 22105) +++ target/linux/ar71xx/files/arch/mips/ar71xx/mach-eap7660d.c (working copy) @@ -10,13 +10,16 @@ * by the Free Software Foundation. */ +#include linux/pci.h +#include linux/ath5k_platform.h +#include linux/delay.h #include asm/mach-ar71xx/ar71xx.h +#include asm/mach-ar71xx/pci.h #include machtype.h #include devices.h #include dev-gpio-buttons.h #include dev-leds-gpio.h -#include dev-pb42-pci.h #include dev-m25p80.h #define EAP7660D_BUTTONS_POLL_INTERVAL 20 @@ -27,7 +30,76 @@ #define EAP7660D_GPIO_SW1 3 #define EAP7660D_GPIO_SW3 8 #define EAP7660D_PHYMASK BIT(20) +#define EAP7660D_BOARDCONFIG 0x1F7F +#define EAP7660D_GBIC_MAC_OFFSET 0x1000 +#define EAP7660D_WMAC0_MAC_OFFSET 0x1010 +#define EAP7660D_WMAC1_MAC_OFFSET 0x1016 +#define EAP7660D_WMAC0_CALDATA_OFFSET 0x2000 +#define EAP7660D_WMAC1_CALDATA_OFFSET 0x3000 +static struct ath5k_platform_data eap7660d_wmac0_data; +static struct ath5k_platform_data eap7660d_wmac1_data; +static char eap7660d_wmac0_mac[6]; +static char eap7660d_wmac1_mac[6]; +static u16 eap7660d_wmac0_eeprom[ATH5K_PLAT_EEP_MAX_WORDS]; +static u16 eap7660d_wmac1_eeprom[ATH5K_PLAT_EEP_MAX_WORDS]; + +static struct ar71xx_pci_irq eap7660d_pci_irqs[] __initdata = { +{ +.slot = 0, +.pin= 1, +.irq= AR71XX_PCI_IRQ_DEV0, +}, { +.slot = 1, +.pin= 1, +.irq= AR71XX_PCI_IRQ_DEV1, +} +}; + +static int eap7660d_pci_plat_dev_init(struct pci_dev *dev) +{ + switch(PCI_SLOT(dev-devfn)) { + case 17: + dev-dev.platform_data = eap7660d_wmac0_data; + break; + + case 18: + dev-dev.platform_data = eap7660d_wmac1_data; + break; + } + + return 0; +} + +void __init eap7660d_pci_init(u8 *cal_data0, u8 *mac_addr0, + u8 *cal_data1, u8 *mac_addr1) +{ + if (cal_data0 *cal_data0 == 0xa55a) { + memcpy(eap7660d_wmac0_eeprom, cal_data0, + ATH5K_PLAT_EEP_MAX_WORDS); + eap7660d_wmac0_data.eeprom_data = eap7660d_wmac0_eeprom; + } + + if (cal_data1 *cal_data1 == 0xa55a) { + memcpy(eap7660d_wmac1_eeprom, cal_data1, + ATH5K_PLAT_EEP_MAX_WORDS); + eap7660d_wmac1_data.eeprom_data = eap7660d_wmac1_eeprom; + } + + if
Re: [OpenWrt-Devel] [PATCH 2/3] ath5k: in-flash macs and eeprom for mach-eap7660d
I removed unneeded casts and now hopefully really checking the first word for the magic... Also renamed everything to ath5k_platform here, too, of course. This adds ath_platform.h to mac80211 and patches ath5k to respect MAC addresses and eeprom content from platform_data, if supplied. Signed-off-by: Daniel Golle daniel.go...@gmail.com Index: package/mac80211/patches/450-add-ath5k-platform.patch === --- package/mac80211/patches/450-add-ath5k-platform.patch (revision 0) +++ package/mac80211/patches/450-add-ath5k-platform.patch (revision 0) @@ -0,0 +1,35 @@ +diff -Nur a/include/linux/ath5k_platform.h b/include/linux/ath5k_platform.h +--- a/include/linux/ath5k_platform.h 1970-01-01 01:00:00.0 +0100 b/include/linux/ath5k_platform.h 2010-06-21 00:19:52.0 +0200 +@@ -0,0 +1,30 @@ ++/* ++ * Copyright (c) 2008 Atheros Communications Inc. ++ * Copyright (c) 2009 Gabor Juhos juh...@openwrt.org ++ * Copyright (c) 2009 Imre Kaloz ka...@openwrt.org ++ * Copyright (c) 2010 Daniel Golle daniel.go...@gmail.com ++ * ++ * Permission to use, copy, modify, and/or distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ */ ++ ++#ifndef _LINUX_ATH5K_PLATFORM_H ++#define _LINUX_ATH5K_PLATFORM_H ++ ++#define ATH5K_PLAT_EEP_MAX_WORDS 2048 ++ ++struct ath5k_platform_data { ++ u16 *eeprom_data; ++ u8 *macaddr; ++}; ++ ++#endif /* _LINUX_ATH5K_PLATFORM_H */ + Index: package/mac80211/patches/451-add-platform-eeprom-support-to-ath5k.patch === --- package/mac80211/patches/451-add-platform-eeprom-support-to-ath5k.patch (revision 0) +++ package/mac80211/patches/451-add-platform-eeprom-support-to-ath5k.patch (revision 0) @@ -0,0 +1,57 @@ +--- a/drivers/net/wireless/ath/ath5k/eeprom.c 2010-06-23 03:08:32.0 +0200 b/drivers/net/wireless/ath/ath5k/eeprom.c 2010-06-23 05:59:30.0 +0200 +@@ -22,6 +23,8 @@ + \*/ + + #include linux/slab.h ++#include linux/ath5k_platform.h ++#include linux/pci.h + + #include ath5k.h + #include reg.h +@@ -34,6 +37,18 @@ + static int ath5k_hw_eeprom_read(struct ath5k_hw *ah, u32 offset, u16 *data) + { + u32 status, timeout; ++ struct ath5k_platform_data *pdata = NULL; ++ ++ if (ah-ah_sc-pdev) ++ pdata = ah-ah_sc-pdev-dev.platform_data; ++ ++ if (pdata pdata-eeprom_data pdata-eeprom_data[0] == AR5K_EEPROM_MAGIC_VALUE) ++ { ++ ATH5K_INFO(ah-ah_sc, using eeprom-content from platform_data\n); ++ if (offset = ATH5K_PLAT_EEP_MAX_WORDS) return -EIO; ++ *data = pdata-eeprom_data[offset]; ++ return 0; ++ } + + /* +* Initialize EEPROM access +@@ -1788,7 +1802,7 @@ + } + + /* +- * Read the MAC address from eeprom ++ * Read the MAC address from eeprom or platform_data + */ + int ath5k_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac) + { +@@ -1796,6 +1810,16 @@ + u32 total, offset; + u16 data; + int octet, ret; ++ struct ath5k_platform_data *pdata = NULL; ++ ++ if (ah-ah_sc-pdev) ++ pdata = ah-ah_sc-pdev-dev.platform_data; ++ ++ if (pdata pdata-macaddr) ++ { ++ memcpy(mac, pdata-macaddr, ETH_ALEN); ++ return 0; ++ } + + ret = ath5k_hw_eeprom_read(ah, 0x20, data); + if (ret) + ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 3/3] madwifi: in-flash macs for mach-eap7660d
Moved new code outside of #ifdef CONFIG_ATHEROS_AR71XXX and removed unneeded cast. This patch makes madwifi respect (at least) the platform_data supplied MAC address. Signed-off-by: Daniel Golle daniel.go...@gmail.com Index: package/madwifi/patches/470-mac_addresss_from_ath5k_platform_data.patch === --- package/madwifi/patches/470-mac_addresss_from_ath5k_platform_data.patch (revision 0) +++ package/madwifi/patches/470-mac_addresss_from_ath5k_platform_data.patch (revision 0) @@ -0,0 +1,36 @@ +--- a/ath/if_ath.c 2010-07-13 22:58:23.0 +0200 b/ath/if_ath.c 2010-07-13 23:03:20.0 +0200 +@@ -63,6 +63,8 @@ + #include linux/rtnetlink.h + #include linux/time.h + #include linux/pci.h ++#include linux/device.h ++#include linux/ath5k_platform.h + #include asm/uaccess.h + + #include if_ethersubr.h /* for ETHER_IS_MULTICAST */ +@@ -587,6 +589,10 @@ + unsigned int i; + int autocreatemode = -1; + u_int8_t csz; ++#ifdef ATH_PCI ++ struct ath5k_platform_data *pdata; ++ struct pci_dev *pdev; ++#endif + + sc-devid = devid; + #ifdef AR_DEBUG +@@ -648,6 +654,13 @@ + } + sc-sc_ah = ah; + ++#ifdef ATH_PCI ++ /* set MAC from ath_platform_data */ ++ pdev = (struct pci_dev *)sc-sc_bdev; ++ pdata = pdev-dev.platform_data; ++ if (pdata pdata-macaddr) ++ ath_hal_setmac(ah, pdata-macaddr); ++#endif + /* WAR for AR7100 PCI bug */ + #ifdef CONFIG_ATHEROS_AR71XX + if ((ar_device(sc-devid) = 5210) (ar_device(sc-devid) 5416)) { ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel