Re: [OpenWrt-Devel] LAN "force_link" causes WDS Client routers to be no-longer administerable
On Mon, Jun 9, 2014 at 3:55 PM, Felix Fietkau wrote: > On 2014-06-09 21:37, Chirag Chhatriwala wrote: > > Hello Felix and other devs, > > > > I recently went from r39555 (BB) to r41055 (also BB) without sysupgrade, > > direct update of firmware. I've got a couple of WD N750 Routers that I > > like to run in WDS mode. After flashing 41055 and then configuring, WDS > > on the routers, I was left completely locked out of the WDS Client > router. > > > > There were quite a few changes which I ruled out as the cause and > > ultimately narrowed out the changeset in 40773 [1] causes WDS Client > > Routers to stop being adminsterable via SSH or LuCI. > > > > I'm not sure if this change warrants a trac ticket item so I emailed the > > group as a heads-up. I can create a ticket if I don't hear back within a > > couple of days. > I haven't seen anything similar in my own tests (and I've been using WDS > as well). Please show me your configuration (network and wireless) so I > can try to reproduce it. > > Thanks, > > - Felix > > Hi Felix, I've attached the /etc/config/network and /etc/config/wireless for both the Main WDS Access Point (_ap files) and the 2ndary WDS Client+AP (_sta files). Point to note that if I had went through a sysupgrade from (which I also tried as well), this issue wouldn't manifest as r39555 did not yet make use of "option force_link 1". In which case, there were no issues with the WDS Client router receiving a proper IP and being accessible via SSH/LuCI. Problem only occurred when I loaded a fresh install of r41055 on both WD MyNet N750 routers and manually configured WDS in the AP and the Client router. Hope this helps, Chirag network_ap Description: Binary data wireless_ap Description: Binary data network_sta Description: Binary data wireless_sta Description: Binary data dhcp_sta Description: Binary data ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 12/17] atheros: spaces fixes
Add missed spaces and remove odd space as suggested by checkpatch. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/100-board.patch | 38 +++--- .../atheros/patches-3.10/105-ar2315_pci.patch | 17 +- .../atheros/patches-3.10/110-ar2313_ethernet.patch | 32 +- .../linux/atheros/patches-3.10/120-spiflash.patch | 26 --- .../linux/atheros/patches-3.10/130-watchdog.patch | 8 ++--- .../patches-3.10/140-redboot_boardconfig.patch | 2 +- .../142-redboot_various_erase_size_fix.patch | 2 +- .../patches-3.10/220-enet_micrel_workaround.patch | 2 +- .../atheros/patches-3.10/230-3_10-updates.patch| 2 +- 9 files changed, 66 insertions(+), 63 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index ee60b52..33c7ce5 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -213,7 +213,7 @@ + radio_config = 0; + } + -+ return (u8 *) radio_config; ++ return radio_config; +} + +int __init @@ -248,7 +248,7 @@ + } + + board_data = kzalloc(BOARD_CONFIG_BUFSZ, GFP_KERNEL); -+ ar231x_board.config = (struct ar231x_boarddata *) board_data; ++ ar231x_board.config = (struct ar231x_boarddata *)board_data; + memcpy(board_data, bcfg, 0x100); + if (broken_boarddata) { + pr_warn("WARNING: broken board data detected\n"); @@ -269,7 +269,7 @@ + * of what the physical layout on the flash chip looks like */ + + if (ar231x_board.radio) -+ rcfg = (u8 *) ar231x_board.radio; ++ rcfg = (u8 *)ar231x_board.radio; + else + rcfg = find_radio_config(flash_limit, bcfg); + @@ -1818,13 +1818,13 @@ + +static const struct gpio_led_platform_data ar5312_led_data = { + .num_leds = ARRAY_SIZE(ar5312_leds), -+ .leds = (void *) ar5312_leds, ++ .leds = (void *)ar5312_leds, +}; + +static struct platform_device ar5312_gpio_leds = { + .name = "leds-gpio", + .id = -1, -+ .dev.platform_data = (void *) &ar5312_led_data, ++ .dev.platform_data = (void *)&ar5312_led_data, +}; +#endif + @@ -1857,7 +1857,7 @@ + ar231x_write_reg(AR531X_FLASHCTL2, + ar231x_read_reg(AR531X_FLASHCTL2) & ~(FLASHCTL_E | FLASHCTL_AC)); + -+ return (char *) KSEG1ADDR(AR531X_FLASH + 0x80); ++ return (char *)KSEG1ADDR(AR531X_FLASH + 0x80); +} + +int __init ar5312_init_devices(void) @@ -1916,7 +1916,7 @@ + c--; + } + -+ switch(ar231x_devtype) { ++ switch (ar231x_devtype) { + case DEV_TYPE_AR5312: + ar5312_eth0_data.macaddr = config->enet0_mac; + ar231x_add_ethernet(0, KSEG1ADDR(AR531X_ENET0), @@ -2258,7 +2258,7 @@ + unsigned int imr; + + imr = ar231x_read_reg(AR2315_IMR); -+ switch(d->irq) { ++ switch (d->irq) { + case AR531X_MISC_IRQ_SPI: + imr |= AR2315_ISR_SPI; + break; @@ -2289,7 +2289,7 @@ + unsigned int imr; + + imr = ar231x_read_reg(AR2315_IMR); -+ switch(d->irq) { ++ switch (d->irq) { + case AR531X_MISC_IRQ_SPI: + imr &= ~AR2315_ISR_SPI; + break; @@ -2581,20 +2581,20 @@ + + ar2315_spiflash_res[0].end = ar2315_spiflash_res[0].start + + flash_size - 1; -+ return (u8 *) ar2315_spiflash_res[0].end + 1; ++ return (u8 *)ar2315_spiflash_res[0].end + 1; +} + +#ifdef CONFIG_LEDS_GPIO +static struct gpio_led ar2315_leds[6]; +static struct gpio_led_platform_data ar2315_led_data = { -+ .leds = (void *) ar2315_leds, ++ .leds = (void *)ar2315_leds, +}; + +static struct platform_device ar2315_gpio_leds = { + .name = "leds-gpio", + .id = -1, + .dev = { -+ .platform_data = (void *) &ar2315_led_data, ++ .platform_data = (void *)&ar2315_led_data, + } +}; + @@ -2606,8 +2606,8 @@ + + ar2315_led_data.num_leds = 0; + for (i = 1; i < 8; i++) { -+ if((i == AR2315_RESET_GPIO) || -+ (i == ar231x_board.config->reset_config_gpio)) ++ if ((i == AR2315_RESET_GPIO) || ++ (i == ar231x_board.config->reset_config_gpio)) + continue; + + if (i == ar231x_board.config->sys_led_gpio) @@ -2652,12 +2652,12 @@ +static void +ar2315_restart(char *command) +{ -+ void (*mips_reset_vec)(void) = (void *) 0xbfc0; ++ void (*mips_reset_vec)(void) = (void *)0xbfc0; + + local_irq_disable(); + + /* try reset the system via reset control */ -+ ar231x_write_reg(AR2315_COLD_RESET,AR2317_RESET_SYSTEM); ++ ar231x_write_reg(AR2315_COLD_RESET, AR2317_RESET_SYSTEM); + + /* Cold reset does not work on the AR2315/6, use the GPIO reset bits a wo
[OpenWrt-Devel] [PATCH 16/17] atheros: shorten lines
Wrap lines over 80 chars or make them shorter by other ways. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/100-board.patch | 378 - .../atheros/patches-3.10/105-ar2315_pci.patch | 39 ++- .../atheros/patches-3.10/110-ar2313_ethernet.patch | 105 +++--- .../linux/atheros/patches-3.10/120-spiflash.patch | 22 +- .../linux/atheros/patches-3.10/130-watchdog.patch | 5 +- .../patches-3.10/140-redboot_boardconfig.patch | 9 +- .../patches-3.10/141-redboot_partition_scan.patch | 2 +- .../142-redboot_various_erase_size_fix.patch | 4 +- .../patches-3.10/220-enet_micrel_workaround.patch | 6 +- .../atheros/patches-3.10/230-3_10-updates.patch| 10 +- 10 files changed, 318 insertions(+), 262 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index d223677..36d861c 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -144,8 +144,8 @@ + ar231x_board.radio = addr + 0x1; + + if (ar231x_board.radio) { -+ /* broken board data detected, use radio data to find the offset, -+ * user will fix this */ ++ /* broken board data detected, use radio data to find the ++ * offset, user will fix this */ + return 1; + } + return 0; @@ -561,7 +561,7 @@ +#endif /* __ASM_MACH_ATHEROS_CPU_FEATURE_OVERRIDES_H */ --- /dev/null +++ b/arch/mips/include/asm/mach-ar231x/dma-coherence.h -@@ -0,0 +1,76 @@ +@@ -0,0 +1,79 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive @@ -590,24 +590,27 @@ + return 0; +} + -+static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t size) ++static inline dma_addr_t ++plat_map_dma_mem(struct device *dev, void *addr, size_t size) +{ + return virt_to_phys(addr) + ar231x_dev_offset(dev); +} + -+static inline dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page) ++static inline dma_addr_t ++plat_map_dma_mem_page(struct device *dev, struct page *page) +{ + return page_to_phys(page) + ar231x_dev_offset(dev); +} + -+static inline unsigned long plat_dma_addr_to_phys(struct device *dev, -+ dma_addr_t dma_addr) ++static inline unsigned long ++plat_dma_addr_to_phys(struct device *dev, dma_addr_t dma_addr) +{ + return dma_addr - ar231x_dev_offset(dev); +} + -+static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr, -+ size_t size, enum dma_data_direction direction) ++static inline void ++plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr, size_t size, ++ enum dma_data_direction direction) +{ +} + @@ -710,7 +713,7 @@ +#endif /* __ASM_MIPS_MACH_ATHEROS_WAR_H */ --- /dev/null +++ b/arch/mips/include/asm/mach-ar231x/ar2315_regs.h -@@ -0,0 +1,580 @@ +@@ -0,0 +1,615 @@ +/* + * Register definitions for AR2315+ + * @@ -759,56 +762,88 @@ +#define AR2315_RESET_COLD_APB 0x0002 +#define AR2315_RESET_COLD_CPU 0x0004 +#define AR2315_RESET_COLD_CPUWARM 0x0008 -+#define AR2315_RESET_SYSTEM(RESET_COLD_CPU | RESET_COLD_APB | RESET_COLD_AHB) /* full system */ ++#define AR2315_RESET_SYSTEM \ ++ (RESET_COLD_CPU |\ ++ RESET_COLD_APB |\ ++ RESET_COLD_AHB) /* full system */ +#define AR2317_RESET_SYSTEM0x0010 + + +#define AR2315_RESET(AR2315_DSLBASE + 0x0004) + -+#define AR2315_RESET_WARM_WLAN0_MAC0x0001 /* warm reset WLAN0 MAC */ -+#define AR2315_RESET_WARM_WLAN0_BB 0x0002 /* warm reset WLAN0 BaseBand */ -+#define AR2315_RESET_MPEGTS_RSVD 0x0004 /* warm reset MPEG-TS */ -+#define AR2315_RESET_PCIDMA0x0008 /* warm reset PCI ahb/dma */ -+#define AR2315_RESET_MEMCTL0x0010 /* warm reset memory controller */ -+#define AR2315_RESET_LOCAL 0x0020 /* warm reset local bus */ -+#define AR2315_RESET_I2C_RSVD 0x0040 /* warm reset I2C bus */ -+#define AR2315_RESET_SPI 0x0080 /* warm reset SPI interface */ -+#define AR2315_RESET_UART0 0x0100 /* warm reset UART0 */ -+#define AR2315_RESET_IR_RSVD 0x0200 /* warm reset IR interface */ -+#define AR2315_RESET_EPHY0 0x0400 /* cold reset ENET0 phy */ -+#define AR2315_RESET_ENET0 0x0800 /* cold reset ENET0 mac */ ++/* warm reset WLAN0 MAC */ ++#define AR2315_RESET_WARM_WLAN0_MAC0x0001 ++/* warm reset WLAN0 BaseBand */ ++#define AR2315_RESET_WARM_WLAN0_BB 0x0002 ++/*
[OpenWrt-Devel] [PATCH 14/17] atheros: avoid __FUNCTION__ usage
Use __func__ instead of gcc specific __FUNCTION__ as suggested by checkpatch. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch index b283e31..00348c3 100644 --- a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch +++ b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch @@ -438,7 +438,7 @@ + ar231x_descr_t *space; + + if (sp->rx_ring != NULL) { -+ printk("%s: already done.\n", __FUNCTION__); ++ printk("%s: already done.\n", __func__); + return 0; + } + @@ -673,7 +673,7 @@ + /* Allocate descriptors */ + if (ar231x_allocate_descriptors(dev)) { + printk("%s: %s: ar231x_allocate_descriptors failed\n", -+ dev->name, __FUNCTION__); ++ dev->name, __func__); + ecode = -EAGAIN; + goto init_error; + } @@ -685,7 +685,7 @@ + GFP_KERNEL); + if (!(sp->rx_skb)) { + printk("%s: %s: rx_skb kmalloc failed\n", -+ dev->name, __FUNCTION__); ++ dev->name, __func__); + ecode = -EAGAIN; + goto init_error; + } @@ -698,7 +698,7 @@ + GFP_KERNEL); + if (!(sp->tx_skb)) { + printk("%s: %s: tx_skb kmalloc failed\n", -+ dev->name, __FUNCTION__); ++ dev->name, __func__); + ecode = -EAGAIN; + goto init_error; + } @@ -735,7 +735,7 @@ + dev->name, dev); + if (ecode) { + printk(KERN_WARNING "%s: %s: Requested IRQ %d is busy\n", -+ dev->name, __FUNCTION__, dev->irq); ++ dev->name, __func__, dev->irq); + goto init_error; + } + @@ -773,7 +773,7 @@ + skb = netdev_alloc_skb_ip_align(dev, AR2313_BUFSIZE); + if (!skb) { + printk("\n\n\n\n %s: No memory in system\n\n\n\n", -+ __FUNCTION__); ++ __func__); + break; + } + -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 15/17] atheros: constify some static structures
Constify some static structures as suggested by checkpatch. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/100-board.patch| 2 +- target/linux/atheros/patches-3.10/120-spiflash.patch | 6 -- target/linux/atheros/patches-3.10/130-watchdog.patch | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 07b8145..d223677 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -3086,7 +3086,7 @@ + }, +}; + -+static const char *devtype_strings[] = { ++static const char * const devtype_strings[] = { + [DEV_TYPE_AR5312] = "Atheros AR5312", + [DEV_TYPE_AR2312] = "Atheros AR2312", + [DEV_TYPE_AR2313] = "Atheros AR2313", diff --git a/target/linux/atheros/patches-3.10/120-spiflash.patch b/target/linux/atheros/patches-3.10/120-spiflash.patch index a1b36ee..7f8acd0 100644 --- a/target/linux/atheros/patches-3.10/120-spiflash.patch +++ b/target/linux/atheros/patches-3.10/120-spiflash.patch @@ -23,7 +23,7 @@ --- /dev/null +++ b/drivers/mtd/devices/ar2315.c -@@ -0,0 +1,517 @@ +@@ -0,0 +1,519 @@ + +/* + * MTD driver for the SPI Flash Memory support on Atheros AR2315 @@ -436,7 +436,9 @@ + + +#if defined CONFIG_MTD_REDBOOT_PARTS || CONFIG_MTD_MYLOADER_PARTS -+static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", "MyLoader", NULL }; ++static const char * const part_probe_types[] = { ++ "cmdlinepart", "RedBoot", "MyLoader", NULL ++}; +#endif + + diff --git a/target/linux/atheros/patches-3.10/130-watchdog.patch b/target/linux/atheros/patches-3.10/130-watchdog.patch index 2ae6dcc..4b39500 100644 --- a/target/linux/atheros/patches-3.10/130-watchdog.patch +++ b/target/linux/atheros/patches-3.10/130-watchdog.patch @@ -128,7 +128,7 @@ + return ret; +} + -+static struct file_operations ar2315_wdt_fops = { ++static const struct file_operations ar2315_wdt_fops = { + .owner = THIS_MODULE, + .llseek = no_llseek, + .write = ar2315_wdt_write, -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 17/17] atheros: fix too short msleep
Use msleep(20) instead of msleep(10) to make code closer to reality since msleep can sleep for up to 20ms even we request shorter delay. All updated calls are located in PCI initialization routine which is called only once upon device boot. So there should be no performance issues caused by more longer delay. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/105-ar2315_pci.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/atheros/patches-3.10/105-ar2315_pci.patch b/target/linux/atheros/patches-3.10/105-ar2315_pci.patch index 7a9714f..7108d6c 100644 --- a/target/linux/atheros/patches-3.10/105-ar2315_pci.patch +++ b/target/linux/atheros/patches-3.10/105-ar2315_pci.patch @@ -198,11 +198,11 @@ + set_io_port_base(ar231x_pci_controller.io_map_base); /* PCI I/O space*/ + + reg = ar231x_mask_reg(AR2315_RESET, 0, AR2315_RESET_PCIDMA); -+ msleep(10); ++ msleep(20); + + reg &= ~AR2315_RESET_PCIDMA; + ar231x_write_reg(AR2315_RESET, reg); -+ msleep(10); ++ msleep(20); + + ar231x_mask_reg(AR2315_ENDIAN_CTL, 0, + AR2315_CONFIG_PCIAHB | AR2315_CONFIG_PCIAHB_BRIDGE); -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 10/17] atheros: fix includes
Remove some unnecessary includes and use instead of when it possible as suggested by checkpatch. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/100-board.patch | 6 +++--- target/linux/atheros/patches-3.10/105-ar2315_pci.patch | 6 ++ target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch | 13 - target/linux/atheros/patches-3.10/120-spiflash.patch| 5 ++--- target/linux/atheros/patches-3.10/130-watchdog.patch| 7 +++ .../atheros/patches-3.10/220-enet_micrel_workaround.patch | 10 +- target/linux/atheros/patches-3.10/230-3_10-updates.patch| 2 +- 7 files changed, 20 insertions(+), 29 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 4816667..c3eece7 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -106,9 +106,9 @@ +#include +#include +#include ++#include +#include +#include -+#include + +#include +#include "devices.h" @@ -1559,7 +1559,7 @@ +#include +#include +#include -+#include ++#include + +#include +#include @@ -2141,7 +2141,7 @@ +#include +#include +#include -+#include ++#include + +#include +#include diff --git a/target/linux/atheros/patches-3.10/105-ar2315_pci.patch b/target/linux/atheros/patches-3.10/105-ar2315_pci.patch index 3e51848..af4bb88 100644 --- a/target/linux/atheros/patches-3.10/105-ar2315_pci.patch +++ b/target/linux/atheros/patches-3.10/105-ar2315_pci.patch @@ -7,7 +7,7 @@ +obj-$(CONFIG_ATHEROS_AR2315_PCI) += pci.o --- /dev/null +++ b/arch/mips/ar231x/pci.c -@@ -0,0 +1,230 @@ +@@ -0,0 +1,228 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License @@ -32,10 +32,8 @@ +#include +#include +#include -+#include ++#include +#include -+#include -+#include +#include +#include +#include diff --git a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch index 13ae8a4..156b969 100644 --- a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch +++ b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch @@ -32,7 +32,7 @@ +obj-$(CONFIG_NET_VENDOR_AR231X) += ar231x.o --- /dev/null +++ b/drivers/net/ethernet/ar231x/ar231x.c -@@ -0,0 +1,1260 @@ +@@ -0,0 +1,1256 @@ +/* + * ar231x.c: Linux driver for the Atheros AR231x Ethernet device. + * @@ -75,16 +75,12 @@ +#include +#include +#include ++#include ++#include + +#include +#include + -+#include -+#include -+#include -+#include -+#include -+ +#define AR2313_MTU 1692 +#define AR2313_PRIOS 1 +#define AR2313_QUEUES (2*AR2313_PRIOS) @@ -1295,7 +1291,7 @@ + --- /dev/null +++ b/drivers/net/ethernet/ar231x/ar231x.h -@@ -0,0 +1,289 @@ +@@ -0,0 +1,288 @@ +/* + * ar231x.h: Linux driver for the Atheros AR231x Ethernet device. + * @@ -1318,7 +1314,6 @@ +#include +#include +#include -+#include +#include + +/* probe link timer - 5 secs */ diff --git a/target/linux/atheros/patches-3.10/120-spiflash.patch b/target/linux/atheros/patches-3.10/120-spiflash.patch index 7876de1..e91fd41 100644 --- a/target/linux/atheros/patches-3.10/120-spiflash.patch +++ b/target/linux/atheros/patches-3.10/120-spiflash.patch @@ -23,7 +23,7 @@ --- /dev/null +++ b/drivers/mtd/devices/ar2315.c -@@ -0,0 +1,515 @@ +@@ -0,0 +1,514 @@ + +/* + * MTD driver for the SPI Flash Memory support on Atheros AR2315 @@ -52,8 +52,7 @@ +#include +#include +#include -+#include -+#include ++#include + +#include +#include diff --git a/target/linux/atheros/patches-3.10/130-watchdog.patch b/target/linux/atheros/patches-3.10/130-watchdog.patch index 7cc8fee..07c82e5 100644 --- a/target/linux/atheros/patches-3.10/130-watchdog.patch +++ b/target/linux/atheros/patches-3.10/130-watchdog.patch @@ -1,6 +1,6 @@ --- /dev/null +++ b/drivers/watchdog/ar2315-wtd.c -@@ -0,0 +1,200 @@ +@@ -0,0 +1,199 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by @@ -32,10 +32,9 @@ +#include +#include +#include ++#include ++#include + -+#include -+#include -+#include +#include +#include +#include diff --git a/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch b/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch index d7a4d4a..5e7a660 100644 --- a/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch +++ b/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/ar231x/ar231x.c +++ b/drivers/net/ethernet/ar231x/ar231x.c -@@ -150,6 +150,7 @@ static int ar231x_mdiobus_write(struct m +@@ -146,6 +146,7 @@ static int ar231x_m
[OpenWrt-Devel] [PATCH 05/17] atheros: do not assignment in if condition
Remove assignments from if conditions as suggested by checkpatch. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/100-board.patch| 9 + target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch | 5 +++-- target/linux/atheros/patches-3.10/130-watchdog.patch | 5 +++-- .../linux/atheros/patches-3.10/220-enet_micrel_workaround.patch | 2 +- target/linux/atheros/patches-3.10/230-3_10-updates.patch | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 0bd3410..df7dcf6 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -1524,7 +1524,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar5312.c -@@ -0,0 +1,579 @@ +@@ -0,0 +1,580 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive @@ -1975,7 +1975,7 @@ +static int __init +ar5312_cpu_frequency(void) +{ -+ unsigned int result; ++ unsigned int scratch; + unsigned int predivide_mask, predivide_shift; + unsigned int multiplier_mask, multiplier_shift; + unsigned int clock_ctl1, predivide_select, predivisor, multiplier; @@ -1983,8 +1983,9 @@ + u16 devid; + + /* Trust the bootrom's idea of cpu frequency. */ -+ if ((result = ar231x_read_reg(AR5312_SCRATCH))) -+ return result; ++ scratch = ar231x_read_reg(AR5312_SCRATCH); ++ if (scratch) ++ return scratch; + + devid = ar231x_read_reg(AR531X_REV); + devid &= AR531X_REV_MAJ; diff --git a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch index b9a56b7..38b2969 100644 --- a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch +++ b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch @@ -32,7 +32,7 @@ +obj-$(CONFIG_NET_VENDOR_AR231X) += ar231x.o --- /dev/null +++ b/drivers/net/ethernet/ar231x/ar231x.c -@@ -0,0 +1,1265 @@ +@@ -0,0 +1,1266 @@ +/* + * ar231x.c: Linux driver for the Atheros AR231x Ethernet device. + * @@ -905,8 +905,9 @@ + + while (idx != sp->tx_prd) { + txdesc = &sp->tx_ring[idx]; ++ status = txdesc->status; + -+ if ((status = txdesc->status) & DMA_TX_OWN) { ++ if (status & DMA_TX_OWN) { + /* ar231x dma still owns descr */ + break; + } diff --git a/target/linux/atheros/patches-3.10/130-watchdog.patch b/target/linux/atheros/patches-3.10/130-watchdog.patch index 8c61c91..f98b6b2 100644 --- a/target/linux/atheros/patches-3.10/130-watchdog.patch +++ b/target/linux/atheros/patches-3.10/130-watchdog.patch @@ -1,6 +1,6 @@ --- /dev/null +++ b/drivers/watchdog/ar2315-wtd.c -@@ -0,0 +1,199 @@ +@@ -0,0 +1,200 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by @@ -117,7 +117,8 @@ + break; + + case WDIOC_SETTIMEOUT: -+ if((ret = get_user(new_wdt_timeout, (int __user *)arg))) ++ ret = get_user(new_wdt_timeout, (int __user *)arg); ++ if (ret) + break; + wdt_timeout = HEARTBEAT(new_wdt_timeout); + ar2315_wdt_enable(); diff --git a/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch b/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch index 870b76c..35344ca 100644 --- a/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch +++ b/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch @@ -78,7 +78,7 @@ kfree(dev); return 0; } -@@ -1119,6 +1165,9 @@ static int ar231x_ioctl(struct net_devic +@@ -1120,6 +1166,9 @@ static int ar231x_ioctl(struct net_devic struct ar231x_private *sp = netdev_priv(dev); int ret; diff --git a/target/linux/atheros/patches-3.10/230-3_10-updates.patch b/target/linux/atheros/patches-3.10/230-3_10-updates.patch index 873296d..80d7eaa 100644 --- a/target/linux/atheros/patches-3.10/230-3_10-updates.patch +++ b/target/linux/atheros/patches-3.10/230-3_10-updates.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/ar231x/ar231x.c +++ b/drivers/net/ethernet/ar231x/ar231x.c -@@ -1282,7 +1282,7 @@ static int ar231x_mdiobus_probe (struct +@@ -1283,7 +1283,7 @@ static int ar231x_mdiobus_probe (struct BUG_ON(!phydev); BUG_ON(phydev->attached_dev); -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 11/17] atheros: indent fixes
Various indent fixes suggested by checkpatch: use tabs, use same level of indentation for switch and case, correct indentation levels. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/100-board.patch | 213 +++-- .../atheros/patches-3.10/110-ar2313_ethernet.patch | 29 ++- .../linux/atheros/patches-3.10/120-spiflash.patch | 9 +- .../linux/atheros/patches-3.10/130-watchdog.patch | 38 ++-- .../atheros/patches-3.10/230-3_10-updates.patch| 2 +- 5 files changed, 146 insertions(+), 145 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index c3eece7..ee60b52 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -197,15 +197,15 @@ + + /* AR2316 relocates radio config to new location */ + if (!found) { -+ for (radio_config = board_config + 0xf8; -+ (radio_config < flash_limit - 0x1000 + 0xf8); -+ radio_config += 0x1000) { ++ for (radio_config = board_config + 0xf8; ++ (radio_config < flash_limit - 0x1000 + 0xf8); ++ radio_config += 0x1000) { + if ((*(u32 *)radio_config != 0x) && -+ check_radio_magic(radio_config)) { ++ check_radio_magic(radio_config)) { + found = 1; + break; + } -+ } ++ } + } + + if (!found) { @@ -398,15 +398,15 @@ + * address(es). + */ +struct ar231x_boarddata { -+u32 magic; /* board data is valid */ ++ u32 magic; /* board data is valid */ +#define AR531X_BD_MAGIC 0x35333131 /* "5311", for all 531x platforms */ -+u16 cksum; /* checksum (starting with BD_REV 2) */ -+u16 rev; /* revision of this struct */ -+#define BD_REV 4 -+char board_name[64]; /* Name of board */ -+u16 major; /* Board major number */ -+u16 minor; /* Board minor number */ -+u32 flags; /* Board configuration */ ++ u16 cksum; /* checksum (starting with BD_REV 2) */ ++ u16 rev; /* revision of this struct */ ++#define BD_REV 4 ++ char board_name[64]; /* Name of board */ ++ u16 major; /* Board major number */ ++ u16 minor; /* Board minor number */ ++ u32 flags; /* Board configuration */ +#define BD_ENET00x0001 /* ENET0 is stuffed */ +#define BD_ENET10x0002 /* ENET1 is stuffed */ +#define BD_UART10x0004 /* UART1 is stuffed */ @@ -425,22 +425,22 @@ +#define BD_WLAN0_5G_EN 0x8000 /* FLAG for radio0_2G */ +#define BD_WLAN1_2G_EN 0x0002 /* FLAG for radio0_2G */ +#define BD_WLAN1_5G_EN 0x0004 /* FLAG for radio0_2G */ -+u16 reset_config_gpio; /* Reset factory GPIO pin */ -+u16 sys_led_gpio;/* System LED GPIO pin */ ++ u16 reset_config_gpio; /* Reset factory GPIO pin */ ++ u16 sys_led_gpio;/* System LED GPIO pin */ + -+u32 cpu_freq;/* CPU core frequency in Hz */ -+u32 sys_freq;/* System frequency in Hz */ -+u32 cnt_freq;/* Calculated C0_COUNT frequency */ ++ u32 cpu_freq;/* CPU core frequency in Hz */ ++ u32 sys_freq;/* System frequency in Hz */ ++ u32 cnt_freq;/* Calculated C0_COUNT frequency */ + -+u8 wlan0_mac[6]; -+u8 enet0_mac[6]; -+u8 enet1_mac[6]; ++ u8 wlan0_mac[6]; ++ u8 enet0_mac[6]; ++ u8 enet1_mac[6]; + -+u16 pci_id; /* Pseudo PCIID for common code */ -+u16 mem_cap; /* cap bank1 in MB */ ++ u16 pci_id; /* Pseudo PCIID for common code */ ++ u16 mem_cap; /* cap bank1 in MB */ + -+/* version 3 */ -+u8 wlan1_mac[6]; /* (ar5212) */ ++ /* version 3 */ ++ u8 wlan1_mac[6];/* (ar5212) */ +}; + +#define BOARD_CONFIG_BUFSZ0x1000 @@ -932,10 +932,10 @@ +#define AR2315_AHB_ERR3 (AR2315_DSLBASE + 0x005c) /* hrdata */ +#define AR2315_AHB_ERR4 (AR2315_DSLBASE + 0x0060) /* status */ + -+#define AHB_ERROR_DET 1 /* AHB Error has been detected, */ -+/* write 1 to clear all bits in ERR0 */ -+#define AHB_ERROR_OVR 2 /* AHB Error overflow has been detected */ -+#define AHB_ERROR_WDT 4 /* AHB Error due to wdt instead of hresp */ ++#define AHB_ERROR
[OpenWrt-Devel] [PATCH 07/17] atheros: do not initialize statics to 0 or false
as suggested by checkpatch. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/100-board.patch | 2 +- target/linux/atheros/patches-3.10/130-watchdog.patch | 4 ++-- target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index df7dcf6..7192a7b 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -2147,7 +2147,7 @@ +#include "devices.h" +#include "ar2315.h" + -+static u32 gpiointmask = 0, gpiointval = 0; ++static u32 gpiointmask, gpiointval; + +static inline void ar2315_gpio_irq(void) +{ diff --git a/target/linux/atheros/patches-3.10/130-watchdog.patch b/target/linux/atheros/patches-3.10/130-watchdog.patch index f98b6b2..506b5f9 100644 --- a/target/linux/atheros/patches-3.10/130-watchdog.patch +++ b/target/linux/atheros/patches-3.10/130-watchdog.patch @@ -44,8 +44,8 @@ +#define HEARTBEAT(x) (x < 1 || x > 90 ? 20 : x) + +static int wdt_timeout = 20; -+static int started = 0; -+static int in_use = 0; ++static int started; ++static int in_use; + +static void +ar2315_wdt_enable(void) diff --git a/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch b/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch index 35344ca..58cccd0 100644 --- a/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch +++ b/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch @@ -4,7 +4,7 @@ static int ar231x_mdiobus_reset(struct mii_bus *bus); static int ar231x_mdiobus_probe (struct net_device *dev); static void ar231x_adjust_link(struct net_device *dev); -+static bool no_phy = false; ++static bool no_phy; #ifndef ERR #define ERR(fmt, args...) printk("%s: " fmt, __func__, ##args) -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 13/17] atheros: trailing statements fixes
Move trailing statements to next line with indentation as suggested by checkpatch. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/100-board.patch| 5 +++-- target/linux/atheros/patches-3.10/101-early-printk-support.patch | 8 +--- target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch | 8 +--- target/linux/atheros/patches-3.10/230-3_10-updates.patch | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 33c7ce5..07b8145 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -84,7 +84,7 @@ +obj-$(CONFIG_ATHEROS_AR2315) += ar2315.o --- /dev/null +++ b/arch/mips/ar231x/board.c -@@ -0,0 +1,260 @@ +@@ -0,0 +1,261 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive @@ -297,7 +297,8 @@ +ar231x_halt(void) +{ + local_irq_disable(); -+ while (1); ++ while (1) ++ ; +} + +void __init diff --git a/target/linux/atheros/patches-3.10/101-early-printk-support.patch b/target/linux/atheros/patches-3.10/101-early-printk-support.patch index 2346e24..3daa011 100644 --- a/target/linux/atheros/patches-3.10/101-early-printk-support.patch +++ b/target/linux/atheros/patches-3.10/101-early-printk-support.patch @@ -1,6 +1,6 @@ --- /dev/null +++ b/arch/mips/ar231x/early_printk.c -@@ -0,0 +1,44 @@ +@@ -0,0 +1,46 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive @@ -40,9 +40,11 @@ + base = (void __iomem *)(KSEG1ADDR(AR531X_UART0)); + } + -+ while ((prom_uart_rr(base, UART_LSR) & UART_LSR_THRE) == 0); ++ while ((prom_uart_rr(base, UART_LSR) & UART_LSR_THRE) == 0) ++ ; + prom_uart_wr(base, UART_TX, ch); -+ while ((prom_uart_rr(base, UART_LSR) & UART_LSR_THRE) == 0); ++ while ((prom_uart_rr(base, UART_LSR) & UART_LSR_THRE) == 0) ++ ; +} + --- a/arch/mips/ar231x/Makefile diff --git a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch index 1fc4eb4..b283e31 100644 --- a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch +++ b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch @@ -32,7 +32,7 @@ +obj-$(CONFIG_NET_VENDOR_AR231X) += ar231x.o --- /dev/null +++ b/drivers/net/ethernet/ar231x/ar231x.c -@@ -0,0 +1,1255 @@ +@@ -0,0 +1,1257 @@ +/* + * ar231x.c: Linux driver for the Atheros AR231x Ethernet device. + * @@ -1208,7 +1208,8 @@ + volatile ETHERNET_STRUCT *ethernet = sp->phy_regs; + + ethernet->mii_addr = MII_ADDR(phy_addr, regnum); -+ while (ethernet->mii_addr & MII_ADDR_BUSY); ++ while (ethernet->mii_addr & MII_ADDR_BUSY) ++ ; + return ethernet->mii_data >> MII_DATA_SHIFT; +} + @@ -1219,7 +1220,8 @@ + struct ar231x_private *sp = netdev_priv(dev); + volatile ETHERNET_STRUCT *ethernet = sp->phy_regs; + -+ while (ethernet->mii_addr & MII_ADDR_BUSY); ++ while (ethernet->mii_addr & MII_ADDR_BUSY) ++ ; + ethernet->mii_data = value << MII_DATA_SHIFT; + ethernet->mii_addr = MII_ADDR(phy_addr, regnum) | MII_ADDR_WRITE; + diff --git a/target/linux/atheros/patches-3.10/230-3_10-updates.patch b/target/linux/atheros/patches-3.10/230-3_10-updates.patch index 8e4db17..f1adf82 100644 --- a/target/linux/atheros/patches-3.10/230-3_10-updates.patch +++ b/target/linux/atheros/patches-3.10/230-3_10-updates.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/ar231x/ar231x.c +++ b/drivers/net/ethernet/ar231x/ar231x.c -@@ -1272,7 +1272,7 @@ static int ar231x_mdiobus_probe(struct n +@@ -1274,7 +1274,7 @@ static int ar231x_mdiobus_probe(struct n BUG_ON(!phydev); BUG_ON(phydev->attached_dev); -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 09/17] atheros: various printk(...) fixes
Use more particular functions dev_ or pr_(...) insead of direct printk(...) call. Add KERN_LEVEL to calls what missed it. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/100-board.patch | 38 +++--- .../linux/atheros/patches-3.10/120-spiflash.patch | 8 ++--- .../linux/atheros/patches-3.10/130-watchdog.patch | 17 ++ 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 5c81e02..4816667 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -84,7 +84,7 @@ +obj-$(CONFIG_ATHEROS_AR2315) += ar2315.o --- /dev/null +++ b/arch/mips/ar231x/board.c -@@ -0,0 +1,259 @@ +@@ -0,0 +1,260 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive @@ -209,7 +209,7 @@ + } + + if (!found) { -+ printk("Could not find Radio Configuration data\n"); ++ pr_warn("WARNING: Could not find Radio Configuration data\n"); + radio_config = 0; + } + @@ -243,7 +243,7 @@ + } + + if (!bcfg) { -+ printk(KERN_WARNING "WARNING: No board configuration data found!\n"); ++ pr_warn("WARNING: No board configuration data found!\n"); + return -ENODEV; + } + @@ -251,10 +251,10 @@ + ar231x_board.config = (struct ar231x_boarddata *) board_data; + memcpy(board_data, bcfg, 0x100); + if (broken_boarddata) { -+ printk(KERN_WARNING "WARNING: broken board data detected\n"); ++ pr_warn("WARNING: broken board data detected\n"); + config = ar231x_board.config; + if (!memcmp(config->enet0_mac, "\x00\x00\x00\x00\x00\x00", 6)) { -+ printk(KERN_INFO "Fixing up empty mac addresses\n"); ++ pr_info("Fixing up empty mac addresses\n"); + config->reset_config_gpio = 0x; + config->sys_led_gpio = 0x; + random_ether_addr(config->wlan0_mac); @@ -279,13 +279,14 @@ + radio_data = board_data + 0x100 + ((rcfg - bcfg) & 0xfff); + ar231x_board.radio = radio_data; + offset = radio_data - board_data; -+ printk(KERN_INFO "Radio config found at offset 0x%x(0x%x)\n", rcfg - bcfg, offset); ++ pr_info("Radio config found at offset 0x%x (0x%x)\n", rcfg - bcfg, ++ offset); + rcfg_size = BOARD_CONFIG_BUFSZ - offset; + memcpy(radio_data, rcfg, rcfg_size); + + mac_addr = &radio_data[0x1d * 2]; + if (is_broadcast_ether_addr(mac_addr)) { -+ printk(KERN_INFO "Radio MAC is blank; using board-data\n"); ++ pr_info("Radio MAC is blank; using board-data\n"); + memcpy(mac_addr, ar231x_board.config->wlan0_mac, ETH_ALEN); + } + @@ -1640,8 +1641,9 @@ + u32 dma1 = ar231x_read_reg(AR531X_DMA1); + u32 dma_addr = ar231x_read_reg(AR531X_DMAADDR); /* clears error */ + -+ printk("AHB interrupt: PROCADDR=0x%8.8x PROC1=0x%8.8x DMAADDR=0x%8.8x DMA1=0x%8.8x\n", -+ proc_addr, proc1, dma_addr, dma1); ++ pr_emerg("AHB interrupt: PROCADDR=0x%8.8x PROC1=0x%8.8x " ++ "DMAADDR=0x%8.8x DMA1=0x%8.8x\n", proc_addr, proc1, dma_addr, ++ dma1); + + machine_restart("AHB error"); /* Catastrophic failure */ + return IRQ_HANDLED; @@ -2057,12 +2059,11 @@ + gpch = &ar5312_gpio_chip; + ret = gpiochip_add(&gpch->chip); + if (ret) { -+ printk(KERN_ERR "%s: failed to add gpiochip\n", -+ gpch->chip.label); ++ pr_err("%s: failed to add gpiochip\n", gpch->chip.label); + return ret; + } -+ printk(KERN_INFO "%s: registered %d GPIOs\n", -+ gpch->chip.label, gpch->chip.ngpio); ++ pr_info("%s: registered %d GPIOs\n", gpch->chip.label, ++ gpch->chip.ngpio); + return ret; +} + @@ -2108,7 +2109,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar2315.c -@@ -0,0 +1,692 @@ +@@ -0,0 +1,691 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive @@ -2322,7 +2323,7 @@ +ar231x_write_reg(AR2315_AHB_ERR0, AHB_ERROR_DET); +ar231x_read_reg(AR2315_AHB_ERR1); + -+printk(KERN_ERR "AHB fatal error\n"); ++pr_emerg("AHB fatal error\n"); +machine_restart("AHB error"); /* Catastrophic failure */ + +return IRQ_HANDLED; @@ -2742,12 +2743,11 @@ + gpch = &ar2315_gpio_chip; + ret = gpiochip_add(&gpch->chip); + if (ret) { -+ printk(KERN_ERR "%s: failed to add gpiochip\n", -+ gpch->chip.label); ++ pr_err("%s: fa
[OpenWrt-Devel] [PATCH 08/17] atheros: various braces fixes
Fix braces location, remove unnecessary empty lines before or after code block, remove useless braces. All cases are detected by checkpatch. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/100-board.patch | 26 +++--- .../atheros/patches-3.10/110-ar2313_ethernet.patch | 20 ++--- .../linux/atheros/patches-3.10/130-watchdog.patch | 11 - .../patches-3.10/140-redboot_boardconfig.patch | 5 ++--- .../142-redboot_various_erase_size_fix.patch | 6 ++--- .../patches-3.10/220-enet_micrel_workaround.patch | 4 ++-- .../atheros/patches-3.10/230-3_10-updates.patch| 2 +- 7 files changed, 32 insertions(+), 42 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 7192a7b..5c81e02 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -121,9 +121,9 @@ +check_radio_magic(u8 *addr) +{ + addr += 0x7a; /* offset for flash magic */ -+ if ((addr[0] == 0x5a) && (addr[1] == 0xa5)) { ++ if ((addr[0] == 0x5a) && (addr[1] == 0xa5)) + return 1; -+ } ++ + return 0; +} + @@ -638,7 +638,7 @@ +#endif /* __ASM_MACH_GENERIC_DMA_COHERENCE_H */ --- /dev/null +++ b/arch/mips/include/asm/mach-ar231x/gpio.h -@@ -0,0 +1,28 @@ +@@ -0,0 +1,30 @@ +#ifndef _ATHEROS_GPIO_H_ +#define _ATHEROS_GPIO_H_ + @@ -655,12 +655,14 @@ +/* not sure if these are used? */ + +/* Returns IRQ to attach for gpio. Unchecked function */ -+static inline int gpio_to_irq(unsigned gpio) { ++static inline int gpio_to_irq(unsigned gpio) ++{ + return AR531X_GPIO_IRQ(gpio); +} + +/* Returns gpio for IRQ attached. Unchecked function */ -+static inline int irq_to_gpio(unsigned irq) { ++static inline int irq_to_gpio(unsigned irq) ++{ + return irq - AR531X_GPIO_IRQ(0); +} + @@ -1524,7 +1526,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar5312.c -@@ -0,0 +1,580 @@ +@@ -0,0 +1,579 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive @@ -1959,9 +1961,8 @@ +{ + /* reset the system */ + local_irq_disable(); -+ while(1) { ++ while (1) + ar231x_write_reg(AR531X_RESET, AR531X_RESET_SYSTEM); -+ } +} + + @@ -2027,9 +2028,9 @@ + predivisor = clockctl1_predivide_table[predivide_select]; + multiplier = (clock_ctl1 & multiplier_mask) >> multiplier_shift; + -+ if (clock_ctl1 & doubler_mask) { ++ if (clock_ctl1 & doubler_mask) + multiplier = multiplier << 1; -+ } ++ + return (4000 / predivisor) * multiplier; +} + @@ -2107,7 +2108,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar2315.c -@@ -0,0 +1,693 @@ +@@ -0,0 +1,692 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive @@ -2602,8 +2603,7 @@ + int i, led = 0; + + ar2315_led_data.num_leds = 0; -+ for(i = 1; i < 8; i++) -+ { ++ for (i = 1; i < 8; i++) { + if((i == AR2315_RESET_GPIO) || + (i == ar231x_board.config->reset_config_gpio)) + continue; diff --git a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch index 38b2969..13ae8a4 100644 --- a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch +++ b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch @@ -32,7 +32,7 @@ +obj-$(CONFIG_NET_VENDOR_AR231X) += ar231x.o --- /dev/null +++ b/drivers/net/ethernet/ar231x/ar231x.c -@@ -0,0 +1,1266 @@ +@@ -0,0 +1,1260 @@ +/* + * ar231x.c: Linux driver for the Atheros AR231x Ethernet device. + * @@ -535,7 +535,6 @@ + + add_timer(&sp->link_timer); + return 0; -+ +} + +static void ar231x_link_timer_fn(unsigned long data) @@ -554,11 +553,10 @@ + * Loop faster when we don't have link. + * This was needed to speed up the AP bootstrap time. + */ -+ if (sp->link == 0) { ++ if (sp->link == 0) + mod_timer(&sp->link_timer, jiffies + HZ / 2); -+ } else { ++ else + mod_timer(&sp->link_timer, jiffies + LINK_TIMER); -+ } +} + +static void ar231x_check_link(struct net_device *dev) @@ -764,7 +762,6 @@ + */ +static void ar231x_load_rx_ring(struct net_device *dev, int nr_bufs) +{ -+ + struct ar231x_private *sp = netdev_priv(dev); + short i, idx; + @@ -824,9 +821,9 @@ + + /* process at most the entire ring and then wait for another int */ + while (1) { -+ + rxdesc = &sp->rx_ring[idx]; + status = rxdesc->status; ++ + if (status & DMA_RX_OWN) { + /* SiByte owns descriptor or descr not yet filled in */ +
[OpenWrt-Devel] [PATCH 04/17] atheros: remove parentheses around return values
Remove parentheses around return values since return is no a function, as suggested by checkpatch. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/100-board.patch | 2 +- target/linux/atheros/patches-3.10/105-ar2315_pci.patch | 2 +- target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch | 12 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 4f7b072..0bd3410 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -661,7 +661,7 @@ + +/* Returns gpio for IRQ attached. Unchecked function */ +static inline int irq_to_gpio(unsigned irq) { -+ return (irq - (AR531X_GPIO_IRQ(0))); ++ return irq - AR531X_GPIO_IRQ(0); +} + +#include /* cansleep wrappers */ diff --git a/target/linux/atheros/patches-3.10/105-ar2315_pci.patch b/target/linux/atheros/patches-3.10/105-ar2315_pci.patch index 7c72a8e..3e51848 100644 --- a/target/linux/atheros/patches-3.10/105-ar2315_pci.patch +++ b/target/linux/atheros/patches-3.10/105-ar2315_pci.patch @@ -95,7 +95,7 @@ + ar231x_mask_reg(AR2315_PCI_MISC_CONFIG, AR2315_PCIMISC_CFG_SEL, 0); + local_irq_restore(flags); + -+ return (err ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL); ++ return err ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; +} + +static int ar231x_pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * value) diff --git a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch index e3773e3..b9a56b7 100644 --- a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch +++ b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch @@ -262,7 +262,7 @@ + ioremap_nocache(virt_to_phys(ar_eth_base), sizeof(*sp->eth_regs)); + if (!sp->eth_regs) { + printk("Can't remap eth registers\n"); -+ return (-ENXIO); ++ return -ENXIO; + } + + /** @@ -278,7 +278,7 @@ + sizeof(*sp->phy_regs)); + if (!sp->phy_regs) { + printk("Can't remap phy registers\n"); -+ return (-ENXIO); ++ return -ENXIO; + } + } + @@ -288,13 +288,13 @@ + dev->base_addr = (unsigned int) sp->dma_regs; + if (!sp->dma_regs) { + printk("Can't remap DMA registers\n"); -+ return (-ENXIO); ++ return -ENXIO; + } + + sp->int_regs = ioremap_nocache(virt_to_phys(sp->cfg->reset_base), 4); + if (!sp->int_regs) { + printk("Can't remap INTERRUPT registers\n"); -+ return (-ENXIO); ++ return -ENXIO; + } + + strncpy(sp->name, "Atheros AR231x", sizeof(sp->name) - 1); @@ -667,7 +667,7 @@ + + mdelay(10); + -+ return (0); ++ return 0; +} + + @@ -1218,7 +1218,7 @@ + + ethernet->mii_addr = MII_ADDR(phy_addr, regnum); + while (ethernet->mii_addr & MII_ADDR_BUSY); -+ return (ethernet->mii_data >> MII_DATA_SHIFT); ++ return ethernet->mii_data >> MII_DATA_SHIFT; +} + +static int -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 06/17] atheros: remove trailing whitespace
as suggested by checkpatch. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/141-redboot_partition_scan.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/atheros/patches-3.10/141-redboot_partition_scan.patch b/target/linux/atheros/patches-3.10/141-redboot_partition_scan.patch index c255baf..4db94a1 100644 --- a/target/linux/atheros/patches-3.10/141-redboot_partition_scan.patch +++ b/target/linux/atheros/patches-3.10/141-redboot_partition_scan.patch @@ -7,7 +7,7 @@ + buf = vmalloc(master->erasesize); + if (!buf) + return -ENOMEM; -+ ++ + restart: if ( directory < 0 ) { offset = master->size + directory * master->erasesize; -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 03/17] atheros: parenthesis around complex macroses value
Use parenthesis around complex macroses value as suggested by checkpatch. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/100-board.patch | 60 +++--- .../linux/atheros/patches-3.10/130-watchdog.patch | 2 +- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index a0dd618..4f7b072 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -726,11 +726,11 @@ +/* + * IRQs + */ -+#define AR2315_IRQ_MISC_INTRS MIPS_CPU_IRQ_BASE+2 /* C0_CAUSE: 0x0400 */ -+#define AR2315_IRQ_WLAN0_INTRS MIPS_CPU_IRQ_BASE+3 /* C0_CAUSE: 0x0800 */ -+#define AR2315_IRQ_ENET0_INTRS MIPS_CPU_IRQ_BASE+4 /* C0_CAUSE: 0x1000 */ -+#define AR2315_IRQ_LCBUS_PCIMIPS_CPU_IRQ_BASE+5 /* C0_CAUSE: 0x2000 */ -+#define AR2315_IRQ_WLAN0_POLL MIPS_CPU_IRQ_BASE+6 /* C0_CAUSE: 0x4000 */ ++#define AR2315_IRQ_MISC_INTRS (MIPS_CPU_IRQ_BASE+2) /* C0_CAUSE: 0x0400 */ ++#define AR2315_IRQ_WLAN0_INTRS (MIPS_CPU_IRQ_BASE+3) /* C0_CAUSE: 0x0800 */ ++#define AR2315_IRQ_ENET0_INTRS (MIPS_CPU_IRQ_BASE+4) /* C0_CAUSE: 0x1000 */ ++#define AR2315_IRQ_LCBUS_PCI(MIPS_CPU_IRQ_BASE+5) /* C0_CAUSE: 0x2000 */ ++#define AR2315_IRQ_WLAN0_POLL (MIPS_CPU_IRQ_BASE+6) /* C0_CAUSE: 0x4000 */ + +/* + * Address map @@ -1309,11 +1309,11 @@ + * IRQs + */ + -+#define AR5312_IRQ_WLAN0_INTRS MIPS_CPU_IRQ_BASE+2 /* C0_CAUSE: 0x0400 */ -+#define AR5312_IRQ_ENET0_INTRS MIPS_CPU_IRQ_BASE+3 /* C0_CAUSE: 0x0800 */ -+#define AR5312_IRQ_ENET1_INTRS MIPS_CPU_IRQ_BASE+4 /* C0_CAUSE: 0x1000 */ -+#define AR5312_IRQ_WLAN1_INTRS MIPS_CPU_IRQ_BASE+5 /* C0_CAUSE: 0x2000 */ -+#define AR5312_IRQ_MISC_INTRS MIPS_CPU_IRQ_BASE+6 /* C0_CAUSE: 0x4000 */ ++#define AR5312_IRQ_WLAN0_INTRS (MIPS_CPU_IRQ_BASE+2) /* C0_CAUSE: 0x0400 */ ++#define AR5312_IRQ_ENET0_INTRS (MIPS_CPU_IRQ_BASE+3) /* C0_CAUSE: 0x0800 */ ++#define AR5312_IRQ_ENET1_INTRS (MIPS_CPU_IRQ_BASE+4) /* C0_CAUSE: 0x1000 */ ++#define AR5312_IRQ_WLAN1_INTRS (MIPS_CPU_IRQ_BASE+5) /* C0_CAUSE: 0x2000 */ ++#define AR5312_IRQ_MISC_INTRS (MIPS_CPU_IRQ_BASE+6) /* C0_CAUSE: 0x4000 */ + + +/* Address Map */ @@ -1403,14 +1403,14 @@ +#define AR531X_RESET_WDOG 0x0010 /* last reset was a watchdog */ + +#define AR531X_RESET_WMAC0_BITS \ -+AR531X_RESET_WLAN0 |\ -+AR531X_RESET_WARM_WLAN0_MAC |\ -+AR531X_RESET_WARM_WLAN0_BB ++ (AR531X_RESET_WLAN0 |\ ++ AR531X_RESET_WARM_WLAN0_MAC |\ ++ AR531X_RESET_WARM_WLAN0_BB) + +#define AR531X_RESERT_WMAC1_BITS \ -+AR531X_RESET_WLAN1 |\ -+AR531X_RESET_WARM_WLAN1_MAC |\ -+AR531X_RESET_WARM_WLAN1_BB ++ (AR531X_RESET_WLAN1 |\ ++ AR531X_RESET_WARM_WLAN1_MAC |\ ++ AR531X_RESET_WARM_WLAN1_BB) + +/* AR5312_CLOCKCTL1 register bit field definitions */ +#define AR5312_CLOCKCTL1_PREDIVIDE_MASK0x0030 @@ -2894,25 +2894,25 @@ +#define AR531X_GPIO_IRQ_BASE 0x30 + +/* Software's idea of interrupts handled by "CPU Interrupt Controller" */ -+#define AR531X_IRQ_NONE MIPS_CPU_IRQ_BASE+0 -+#define AR531X_IRQ_CPU_CLOCK MIPS_CPU_IRQ_BASE+7 /* C0_CAUSE: 0x8000 */ ++#define AR531X_IRQ_NONE (MIPS_CPU_IRQ_BASE+0) ++#define AR531X_IRQ_CPU_CLOCK (MIPS_CPU_IRQ_BASE+7) /* C0_CAUSE: 0x8000 */ + +/* Miscellaneous interrupts, which share IP6 */ -+#define AR531X_MISC_IRQ_NONE AR531X_MISC_IRQ_BASE+0 -+#define AR531X_MISC_IRQ_TIMER AR531X_MISC_IRQ_BASE+1 -+#define AR531X_MISC_IRQ_AHB_PROC AR531X_MISC_IRQ_BASE+2 -+#define AR531X_MISC_IRQ_AHB_DMA AR531X_MISC_IRQ_BASE+3 -+#define AR531X_MISC_IRQ_GPIO AR531X_MISC_IRQ_BASE+4 -+#define AR531X_MISC_IRQ_UART0 AR531X_MISC_IRQ_BASE+5 -+#define AR531X_MISC_IRQ_UART0_DMA AR531X_MISC_IRQ_BASE+6 -+#define AR531X_MISC_IRQ_WATCHDOG AR531X_MISC_IRQ_BASE+7 -+#define AR531X_MISC_IRQ_LOCAL AR531X_MISC_IRQ_BASE+8 -+#define AR531X_MISC_IRQ_SPI AR531X_MISC_IRQ_BASE+9 ++#define AR531X_MISC_IRQ_NONE (AR531X_MISC_IRQ_BASE+0) ++#define AR531X_MISC_IRQ_TIMER (AR531X_MISC_IRQ_BASE+1) ++#define AR531X_MISC_IRQ_AHB_PROC (AR531X_MISC_IRQ_BASE+2) ++#define AR531X_MISC_IRQ_AHB_DMA (AR531X_MISC_IRQ_BASE+3) ++#define AR531X_MISC_IRQ_GPIO (AR531X_MISC_IRQ_BASE+4) ++#define AR531X_MISC_IRQ_UART0 (AR531X_MISC_IRQ_BASE+5) ++#define AR531X_MISC_IRQ_UART0_DMA (AR531X_MISC_IRQ_BASE+6) ++#define AR531X_MISC_IRQ_WATCHDOG (AR531X_MISC_IRQ_BASE+7) ++#define AR531X_MISC_IRQ_LOCAL (AR531X_MISC_IRQ_BASE+8) ++#define AR531X_MISC_IRQ_SPI (AR531X_MISC_IRQ_BASE+9) +#define AR531X_MISC_IRQ_COUNT 10 + +/* GPIO Interrupts [0..7], share AR531X_MISC_IRQ_GPIO */ -+#define AR531X_GPIO_IRQ_NONEAR531X_GPIO_IRQ_BASE+0 -+#define AR531X_GPIO_IRQ(n) AR531X_GPIO_IRQ_BASE+n ++
[OpenWrt-Devel] [PATCH 02/17] atheros: various comments fixes
Fix comment issues detected by checkpatch. Convert C99 // comments to ordinary /* ... */ comments. Correct block comments style or convert them to single line comments. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/100-board.patch | 16 +-- .../atheros/patches-3.10/110-ar2313_ethernet.patch | 133 - .../patches-3.10/220-enet_micrel_workaround.patch | 20 ++-- .../atheros/patches-3.10/230-3_10-updates.patch| 2 +- 4 files changed, 74 insertions(+), 97 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 4524f94..a0dd618 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -1766,11 +1766,11 @@ + .set= ar5312_gpio_set_value, + .get= ar5312_gpio_get_value, + .base = 0, -+ .ngpio = AR531X_GPIO_IRQ_COUNT, // 22 ++ .ngpio = AR531X_GPIO_IRQ_COUNT, /* 22 */ + } +}; + -+// end of gpiolib ++/* end of gpiolib */ + +static struct physmap_flash_data ar5312_flash_data = { + .width = 2, @@ -2406,7 +2406,7 @@ + u32 rett; + if (!(gpch->valid_mask & mask)) + return 0; -+ rett = ar2315_gpio_get(gpch->valid_mask); // legacy code ++ rett = ar2315_gpio_get(gpch->valid_mask); /* legacy code */ + return !!(rett & mask); +} + @@ -2418,7 +2418,7 @@ + u32 mask = 1 << gpio; + if (!(gpch->valid_mask & mask)) + return; -+ ar2315_gpio_set(mask, (!!value) * mask); // legacy ++ ar2315_gpio_set(mask, (!!value) * mask); /* legacy */ +} + +static int @@ -2429,7 +2429,7 @@ + u32 mask = 1 << gpio; + if (!(gpch->valid_mask & mask)) + return -ENXIO; -+ ar2315_gpio_set_output(mask, 0); // legacy ++ ar2315_gpio_set_output(mask, 0); /* legacy */ + return 0; +} + @@ -2441,7 +2441,7 @@ + u32 mask = 1 << gpio; + if (!(gpch->valid_mask & mask)) + return -ENXIO; -+ ar2315_gpio_set_output(mask, mask); // both legacy ++ ar2315_gpio_set_output(mask, mask); /* both legacy */ + ar2315_gpio_set(mask, (!!value) * mask); + return 0; +} @@ -2455,11 +2455,11 @@ + .set= ar2315_gpio_set_value, + .get= ar2315_gpio_get_value, + .base = 0, -+ .ngpio = AR531X_GPIO_IRQ_COUNT, // 22 ++ .ngpio = AR531X_GPIO_IRQ_COUNT, /* 22 */ + } +}; + -+// end of gpiolib ++/* end of gpiolib */ + + +static struct ar231x_eth ar2315_eth_data = { diff --git a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch index 4f712ac..e3773e3 100644 --- a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch +++ b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch @@ -32,7 +32,7 @@ +obj-$(CONFIG_NET_VENDOR_AR231X) += ar231x.o --- /dev/null +++ b/drivers/net/ethernet/ar231x/ar231x.c -@@ -0,0 +1,1278 @@ +@@ -0,0 +1,1265 @@ +/* + * ar231x.c: Linux driver for the Atheros AR231x Ethernet device. + * @@ -103,7 +103,7 @@ + +#include "ar231x.h" + -+/* ++/** + * New interrupt handler strategy: + * + * An old interrupt handler worked using the traditional method of @@ -142,7 +142,7 @@ + * handler. + */ + -+/* ++/** + * Threshold values for RX buffer allocation - the low water marks for + * when to start refilling the rings are set to 75% of the ring + * sizes. It seems to make sense to refill the rings entirely from the @@ -173,7 +173,7 @@ + +#define virt_to_phys(x) ((u32)(x) & 0x1fff) + -+// prototypes ++/* prototypes */ +static void ar231x_halt(struct net_device *dev); +static void rx_tasklet_func(unsigned long data); +static void rx_tasklet_cleanup(struct net_device *dev); @@ -265,7 +265,7 @@ + return (-ENXIO); + } + -+ /* ++ /** + * When there's only one MAC, PHY regs are typically on ENET0, + * even though the MAC might be on ENET1. + * Needto remap PHY regs separately in this case @@ -302,9 +302,7 @@ + memcpy(dev->dev_addr, sp->cfg->macaddr, 6); + + if (ar231x_init(dev)) { -+ /* -+ * ar231x_init() calls ar231x_init_cleanup() on error. -+ */ ++ /* ar231x_init() calls ar231x_init_cleanup() on error */ + kfree(dev); + return -ENODEV; + } @@ -373,7 +371,7 @@ +{ + struct ar231x_private *sp = netdev_priv(dev); + -+ /* ++ /** + * Tasklet may be scheduled. Need to get it removed from the list + * since we're about to free the struct. + */ @@ -397,7 +395,7 @@ +} + + -+/* ++/** + * Rest
[OpenWrt-Devel] [PATCH 01/17] atheros: avoid CamelCase
Change fooBar variables names to foo_bar as suggested by checkpatch, write few tables names in lower case and correctly place __initdata keyword. Signed-off-by: Sergey Ryazanov --- target/linux/atheros/patches-3.10/100-board.patch | 109 +++-- .../atheros/patches-3.10/110-ar2313_ethernet.patch | 12 +-- .../atheros/patches-3.10/210-reset_button.patch| 4 +- 3 files changed, 63 insertions(+), 62 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 96be80d..4524f94 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -255,8 +255,8 @@ + config = ar231x_board.config; + if (!memcmp(config->enet0_mac, "\x00\x00\x00\x00\x00\x00", 6)) { + printk(KERN_INFO "Fixing up empty mac addresses\n"); -+ config->resetConfigGpio = 0x; -+ config->sysLedGpio = 0x; ++ config->reset_config_gpio = 0x; ++ config->sys_led_gpio = 0x; + random_ether_addr(config->wlan0_mac); + config->wlan0_mac[0] &= ~0x06; + random_ether_addr(config->enet0_mac); @@ -402,7 +402,7 @@ +u16 cksum; /* checksum (starting with BD_REV 2) */ +u16 rev; /* revision of this struct */ +#define BD_REV 4 -+char boardName[64];/* Name of board */ ++char board_name[64]; /* Name of board */ +u16 major; /* Board major number */ +u16 minor; /* Board minor number */ +u32 flags; /* Board configuration */ @@ -416,7 +416,7 @@ +#define BD_CPUFREQ 0x0080 /* cpu freq is valid in nvram */ +#define BD_SYSFREQ 0x0100 /* sys freq is set in nvram */ +#define BD_WLAN00x0200 /* Enable WLAN0 */ -+#define BD_MEMCAP 0x0400 /* CAP SDRAM @ memCap for testing */ ++#define BD_MEMCAP 0x0400 /* CAP SDRAM @ mem_cap for testing */ +#define BD_DISWATCHDOG 0x0800 /* disable system watchdog */ +#define BD_WLAN10x1000 /* Enable WLAN1 (ar5212) */ +#define BD_ISCASPER 0x2000 /* FLAG for AR2312 */ @@ -424,19 +424,19 @@ +#define BD_WLAN0_5G_EN 0x8000 /* FLAG for radio0_2G */ +#define BD_WLAN1_2G_EN 0x0002 /* FLAG for radio0_2G */ +#define BD_WLAN1_5G_EN 0x0004 /* FLAG for radio0_2G */ -+u16 resetConfigGpio; /* Reset factory GPIO pin */ -+u16 sysLedGpio; /* System LED GPIO pin */ ++u16 reset_config_gpio; /* Reset factory GPIO pin */ ++u16 sys_led_gpio;/* System LED GPIO pin */ + -+u32 cpuFreq; /* CPU core frequency in Hz */ -+u32 sysFreq; /* System frequency in Hz */ -+u32 cntFreq; /* Calculated C0_COUNT frequency */ ++u32 cpu_freq;/* CPU core frequency in Hz */ ++u32 sys_freq;/* System frequency in Hz */ ++u32 cnt_freq;/* Calculated C0_COUNT frequency */ + +u8 wlan0_mac[6]; +u8 enet0_mac[6]; +u8 enet1_mac[6]; + -+u16 pciId; /* Pseudo PCIID for common code */ -+u16 memCap; /* cap bank1 in MB */ ++u16 pci_id; /* Pseudo PCIID for common code */ ++u16 mem_cap; /* cap bank1 in MB */ + +/* version 3 */ +u8 wlan1_mac[6]; /* (ar5212) */ @@ -1634,12 +1634,12 @@ +static irqreturn_t ar5312_ahb_proc_handler(int cpl, void *dev_id) +{ + u32 proc1 = ar231x_read_reg(AR531X_PROC1); -+ u32 procAddr = ar231x_read_reg(AR531X_PROCADDR); /* clears error state */ ++ u32 proc_addr = ar231x_read_reg(AR531X_PROCADDR); /* clears error */ + u32 dma1 = ar231x_read_reg(AR531X_DMA1); -+ u32 dmaAddr = ar231x_read_reg(AR531X_DMAADDR); /* clears error state */ ++ u32 dma_addr = ar231x_read_reg(AR531X_DMAADDR); /* clears error */ + + printk("AHB interrupt: PROCADDR=0x%8.8x PROC1=0x%8.8x DMAADDR=0x%8.8x DMA1=0x%8.8x\n", -+ procAddr, proc1, dmaAddr, dma1); ++ proc_addr, proc1, dma_addr, dma1); + + machine_restart("AHB error"); /* Catastrophic failure */ + return IRQ_HANDLED; @@ -1895,7 +1895,7 @@ + platform_device_register(&ar5312_physmap_flash); + +#ifdef CONFIG_LEDS_GPIO -+ ar5312_leds[0].gpio = config->sysLedGpio; ++ ar5312_leds[0].gpio = config->sys_led_gpio; + platform_device_register(&ar5312_gpio_leds); +#endif + @@ -1969,7 +1969,7 @@ + * This table is indexed by bits 5..4 of the CLOCKCTL1 register + * to determine the predevisor value. + */ -+static int __initdata CLOCKCTL1_PREDIV
[OpenWrt-Devel] [PATCH 00/17] atheros: checkpatch fixes
This series is an attempt to cleanup checkpatch generated warnings and errors to make AR231x patches suitable for upstream merge. Sergey Ryazanov (17): atheros: avoid CamelCase atheros: various comments fixes atheros: parenthesis around complex macroses value atheros: remove parentheses around return values atheros: do not assignment in if condition atheros: remove trailing whitespace atheros: do not initialize statics to 0 or false atheros: various braces fixes atheros: various printk(...) fixes atheros: fix includes atheros: indent fixes atheros: spaces fixes atheros: trailing statements fixes atheros: avoid __FUNCTION__ usage atheros: constify some static structures atheros: shorten lines atheros: fix too short msleep target/linux/atheros/patches-3.10/100-board.patch | 864 +++-- .../patches-3.10/101-early-printk-support.patch| 8 +- .../atheros/patches-3.10/105-ar2315_pci.patch | 64 +- .../atheros/patches-3.10/110-ar2313_ethernet.patch | 369 - .../linux/atheros/patches-3.10/120-spiflash.patch | 68 +- .../linux/atheros/patches-3.10/130-watchdog.patch | 85 +- .../patches-3.10/140-redboot_boardconfig.patch | 14 +- .../patches-3.10/141-redboot_partition_scan.patch | 4 +- .../142-redboot_various_erase_size_fix.patch | 12 +- .../atheros/patches-3.10/210-reset_button.patch| 4 +- .../patches-3.10/220-enet_micrel_workaround.patch | 28 +- .../atheros/patches-3.10/230-3_10-updates.patch| 10 +- 12 files changed, 781 insertions(+), 749 deletions(-) -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] LAN "force_link" causes WDS Client routers to be no-longer administerable
On 2014-06-09 21:37, Chirag Chhatriwala wrote: > Hello Felix and other devs, > > I recently went from r39555 (BB) to r41055 (also BB) without sysupgrade, > direct update of firmware. I've got a couple of WD N750 Routers that I > like to run in WDS mode. After flashing 41055 and then configuring, WDS > on the routers, I was left completely locked out of the WDS Client router. > > There were quite a few changes which I ruled out as the cause and > ultimately narrowed out the changeset in 40773 [1] causes WDS Client > Routers to stop being adminsterable via SSH or LuCI. > > I'm not sure if this change warrants a trac ticket item so I emailed the > group as a heads-up. I can create a ticket if I don't hear back within a > couple of days. I haven't seen anything similar in my own tests (and I've been using WDS as well). Please show me your configuration (network and wireless) so I can try to reproduce it. Thanks, - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] LAN "force_link" causes WDS Client routers to be no-longer administerable
Hello Felix and other devs, I recently went from r39555 (BB) to r41055 (also BB) without sysupgrade, direct update of firmware. I've got a couple of WD N750 Routers that I like to run in WDS mode. After flashing 41055 and then configuring, WDS on the routers, I was left completely locked out of the WDS Client router. There were quite a few changes which I ruled out as the cause and ultimately narrowed out the changeset in 40773 [1] causes WDS Client Routers to stop being adminsterable via SSH or LuCI. I'm not sure if this change warrants a trac ticket item so I emailed the group as a heads-up. I can create a ticket if I don't hear back within a couple of days. Best Regards, Chirag Chhatriwala ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] hotplug / micro-optimization
* Felix Fietkau [09.06.2014 21:23]: [...] > For this trigger we can add a time delay, which will aggregate events. > Once that is implemented correctly, 400 ifup events in rapid succession > will lead to only one series of init script calls instead of 400. > With that approach, such micro-optimizations become unnecessary. thanks for the explanation - sound good! 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: usb-modeswitch-data update url/version
Hi Mark, Don't you have to update the package too? Not only the data files. Please, check this out: http://www.draisberghof.de/usb_modeswitch/#download 2014-06-06 13:03 GMT-03:00 Mark Janssen : > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > Hello, > > Package/utils/usbmode is referring to a file that no longer exists. > I've updated the filename and md5sum to the latest version. > > Signed-off-by: Mark Janssen > > - --- > package/utils/usbmode/Makefile | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/package/utils/usbmode/Makefile > b/package/utils/usbmode/Makefile > index 36459a6..c2a54a8 100644 > - --- a/package/utils/usbmode/Makefile > +++ b/package/utils/usbmode/Makefile > @@ -16,7 +16,7 @@ PKG_LICENSE_FILES:= > > PKG_MAINTAINER:=Felix Fietkau > > - -PKG_DATA_VERSION:=20131113 > +PKG_DATA_VERSION:=20140529 > PKG_DATA_URL:=http://www.draisberghof.de/usb_modeswitch > PKG_DATA_PATH:=usb-modeswitch-data-$(PKG_DATA_VERSION) > PKG_DATA_FILENAME:=$(PKG_DATA_PATH).tar.bz2 > @@ -27,7 +27,7 @@ include $(INCLUDE_DIR)/cmake.mk > define Download/data >FILE:=$(PKG_DATA_FILENAME) >URL:=$(PKG_DATA_URL) > - - MD5SUM:=7b5ac1226b360ddc366c286e62b3c3a4 > + MD5SUM:=dff94177781298aaf0b3c2a3c3dea6b2 > endef > $(eval $(call Download,data)) > > - -- > Mark Janssen -- Sig-I/O Automatisering > m...@sig-io.nl http://sig-io.nl Phone: +31-6-5886.7992 > Linux/Unix System Administration, DevOps, Ansible, Networking > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.12 (GNU/Linux) > > iQIcBAEBCAAGBQJTkeZsAAoJENhnTY/E9pvSIEcP/1kvrFkbTc7QPnkvuZbKaq2w > X5tTRUL61WgFH7ecz1lSlO4wzj4NgA6jMiAIbieOjvjvWgCzWfI1bqyEiWDcuLcK > 8ICeL+Ky2IjQi+C+z+T4YlZ3khXxFjuEhZf/+rv2BGsc6tEcFBDvPU6E1vwOT1eT > Rs0Whox/X3XbJR1rtJpKxrqOz2EjMCGMlbH8S+ZsDEwk3L0Viqkjnb72g+zyIM2a > 7q4dOtA/++itirxi7md/jJm4pyY7A5jWVJrqUcG3Y1hCuUGDTEXXzU8zCduxtqhm > 6OunTSE9O0CwbnfcsmGZr7Qx1osCGg+wb40XWpqYIaNvA6cqlrrGVevPWyzvhEhX > 2fWXxQos0iMtyqn2G8r0p1aJ6V5tUhmCt8iVe7zhjCaeMr2A7POQZLwJhOcUq1Mn > EvxyuES8QLxjvcmdFxecPTpd4taGyYVJ0eTtsWzPwBKhKPefLlYag6MJXGIv8ngd > ugzXuBevLEV8WMo5zENeGhWdURKbiPVlKToARG/v/6Lvj/kGxXoEbrkv+Jrn8m5Q > WpznxAgurltjAn1Gfj7DQiAwml6oXy0t/wU6M3Fft4c2q689XRuN8w2s1PGVbFD0 > mXnFj2BQR1w17+oNopo+/vpewoTJ8DMwKlqY6Dz0T1avDsPZ1tvYHkFucadvIwDD > f7Y+uuMQt1CDtwzzFnnv > =6CBJ > -END PGP SIGNATURE- > ___ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel > -- Ronaldo Afonso 11 9 5252 0484 www.ronaldoafonso.com.br ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [project/ucwmp.git][PATCH] build: install cwmpd and connreq
Signed-off-by: Rafał Miłecki --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ec95ff..7369df6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ TARGET_LINK_LIBRARIES(cwmp-session uci ubus uclient ubox roxml blobmsg_json ${js TARGET_LINK_LIBRARIES(cwmpd uci uclient ubus ubox blobmsg_json ${json}) TARGET_LINK_LIBRARIES(connreq ubus ubox) -INSTALL(TARGETS cwmp-session +INSTALL(TARGETS cwmp-session cwmpd connreq RUNTIME DESTINATION bin LIBRARY DESTINATION lib ) -- 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] [netifd] ifup script does not use new network config
Greeting, I found /sbin/ifup does not take new network config, through it does reload before bringing interface up. ifup orders netifd reload config via ubus call. But netifd uses an async event loop to do reloading work: void netifd_reload(void) { main_timer.cb = netifd_do_reload; uloop_timeout_set(&main_timer, 100); } That creates a race condition: interface will be brought up before netifd_do_reload gets a change to run. Sleeping in ifup after ubus reload can fix this: [ "$modes" = "down up" ] && ubus call network reload && sleep 1 I don't think we should change netifd_reload, so patch ifup is only way to make its reloading. How about you say? Best regards, -Chen ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel