On Wed, 2012-11-28 at 07:53 +0100, John Crispin wrote: 
> On 28/11/12 02:47, Daniel Gimpelevich wrote:
> > This corrects a few oversights in mach-netgear.c, adds a diag.sh with
> > per-board conditionals, in line with the uci-defaults "leds" file, fixes
> > the Netgear eth0 MAC address detection, and provides a mechanism for the
> > DSL driver to have a preset MAC address.
> >
> > Signed-off-by: Daniel Gimpelevich<dan...@gimpelevich.san-francisco.ca.us>
> >
> >
> >
> > _______________________________________________
> > openwrt-devel mailing list
> > openwrt-devel@lists.openwrt.org
> > https://lists.openwrt.org/mailman/listinfo/openwrt-devel
> 
> 
> please send the patch inline

Whoops. 

Signed-off-by: Daniel Gimpelevich<dan...@gimpelevich.san-francisco.ca.us>

Index: target/linux/lantiq/image/Makefile
===================================================================
--- target/linux/lantiq/image/Makefile  (revision 34398)
+++ target/linux/lantiq/image/Makefile  (working copy)
@@ -154,7 +154,7 @@
 
 ifeq ($(CONFIG_TARGET_lantiq_ar9),y)
 Image/BuildKernel/Profile/WBMR=$(call 
Image/BuildKernel/Template,WBMR,$(xway_cmdline))
-Image/BuildKernel/Profile/DGN3500B=$(call 
Image/BuildKernel/Template,DGN3500B,$(xway_cmdline))
+Image/BuildKernel/Profile/DGN3500B=$(call 
Image/BuildKernel/Template,DGN3500B,$(sx76x_cmdline))
 Image/BuildKernel/Profile/P2601HNFX=$(call 
Image/BuildKernel/Template,P2601HNFX,$(xway_cmdline))
 Image/BuildKernel/Profile/H201L=$(call 
Image/BuildKernel/Template,H201L,$(xway_cmdline))
 Image/BuildKernel/Profile/FRITZ7320=$(call 
Image/BuildKernelEVA/Template,FRITZ7320,$(xway_cmdline))
Index: target/linux/lantiq/patches-3.3/0026-cmdline.patch
===================================================================
--- target/linux/lantiq/patches-3.3/0026-cmdline.patch  (revision 0)
+++ target/linux/lantiq/patches-3.3/0026-cmdline.patch  (revision 0)
@@ -0,0 +1,10 @@
+--- a/init/main.c
++++ b/init/main.c
+@@ -123,6 +123,7 @@
+ char __initdata boot_command_line[COMMAND_LINE_SIZE];
+ /* Untouched saved command line (eg. for /proc) */
+ char *saved_command_line;
++EXPORT_SYMBOL(saved_command_line);
+ /* Command line for parameter parsing */
+ static char *static_command_line;
+ 
Index: target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c
===================================================================
--- target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c  
(revision 34398)
+++ target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-netgear.c  
(working copy)
@@ -77,8 +77,8 @@
 
 static struct gpio_led
 dgn3500_gpio_leds[] __initdata = {
-       { .name = "soc:green:power", .gpio = 34, .active_low = 1, },
-       { .name = "soc:red:power", .gpio = 39, .active_low = 1, },
+       { .name = "soc:green:power", .gpio = 34, .active_low = 1, 
.default_trigger = "default-on" },
+       { .name = "soc:red:power", .gpio = 39, .active_low = 1, 
.default_trigger = "default-on" },
        { .name = "soc:orange:wlan", .gpio = 51, .active_low = 1, },
        { .name = "soc:green:wps", .gpio = 52, .active_low = 1, },
        { .name = "soc:green:usb", .gpio = 22, .active_low = 1, },
@@ -91,7 +91,7 @@
        {
                .desc = "wps",
                .type = EV_KEY,
-               .code = BTN_0,
+               .code = BTN_2,
                .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
                .gpio = 54,
                .active_low = 1,
@@ -101,6 +101,14 @@
                .type = EV_KEY,
                .code = BTN_1,
                .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
+               .gpio = 53,
+               .active_low = 1,
+       },
+       {
+               .desc = "rfkill",
+               .type = EV_KEY,
+               .code = BTN_0,
+               .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
                .gpio = 36,
                .active_low = 1,
        },
@@ -253,5 +261,5 @@
 
 MIPS_MACHINE(LANTIQ_MACH_DGN3500B,
             "DGN3500B",
-            "Netgear DGN3500B",
+            "DGN3500B - Netgear DGN3500 or DGN3500B",
              dgn3500_init);
Index: target/linux/lantiq/base-files/lib/preinit/42_athfix
===================================================================
--- target/linux/lantiq/base-files/lib/preinit/42_athfix        (revision 34398)
+++ target/linux/lantiq/base-files/lib/preinit/42_athfix        (working copy)
@@ -5,7 +5,7 @@
 init_atheeprom() {
        local board=$(lantiq_board_name)
        case $board in
-       "Netgear DGN3500B")
+       DGN3500B)
                echo "- loading eeprom -"
                dd if=/dev/mtd2 of=/sys/firmware/ath_eeprom bs=1k skip=60 
count=4
                echo 0 > /sys/bus/pci/slots/0000\:00\:0e.0/power
Index: target/linux/lantiq/base-files/etc/diag.sh
===================================================================
--- target/linux/lantiq/base-files/etc/diag.sh  (revision 0)
+++ target/linux/lantiq/base-files/etc/diag.sh  (revision 0)
@@ -0,0 +1,48 @@
+#!/bin/sh
+# Copyright (C) 2006-2012 OpenWrt.org
+
+# This setup gives us 4.5 distinguishable states:
+#
+# Solid YELLOW: Bootloader running, or kernel hung (timer task stalled)
+# Solid RED:    preinit
+# 5Hz blink:    failsafe
+# Solid GREEN:  normal operation
+
+. /lib/lantiq.sh
+ 
+set_state() {
+        board=$(lantiq_board_name)
+        case "$1" in
+                preinit)
+                        {
+                                case "$board" in
+                                        DGN3500B)        
+                                                echo none 
>/sys/class/leds/soc\:green\:power/trigger
+                                        ;;
+                                esac
+                        }
+                ;;
+                failsafe)
+                        {
+                                case "$board" in
+                                        DGN3500B)        
+                                                echo none 
>/sys/class/leds/soc\:green\:power/trigger
+                                                echo timer 
>/sys/class/leds/soc\:red\:power/trigger
+                                                echo 100 
>/sys/class/leds/soc\:red\:power/delay_on
+                                                echo 100 
>/sys/class/leds/soc\:red\:power/delay_off
+                                        ;;
+                                esac
+                        }
+                ;;
+                done)
+                        {
+                                case "$board" in
+                                        DGN3500B)        
+                                                echo default-on 
>/sys/class/leds/soc\:green\:power/trigger
+                                                echo none 
>/sys/class/leds/soc\:red\:power/trigger
+                                        ;;
+                                esac
+                        }
+                ;;
+        esac
+}
Index: package/system/ltq-dsl/src/ifxmips_atm_core.c
===================================================================
--- package/system/ltq-dsl/src/ifxmips_atm_core.c       (revision 34398)
+++ package/system/ltq-dsl/src/ifxmips_atm_core.c       (working copy)
@@ -57,6 +57,7 @@
 #include <linux/atm.h>
 #include <linux/clk.h>
 #include <linux/interrupt.h>
+#include <linux/string.h>
 
 /*
  *  Chip Specific Head File
@@ -4611,11 +4612,12 @@
  */
 static int __devinit ifx_atm_init(void)
 {
-    int ret;
+    int ret, esiset;
     int port_num;
     struct port_cell_info port_cell = {0};
     int i, j;
-    char ver_str[256];
+    char ver_str[256], *substr;
+    unsigned char esi[6];
 
     check_parameters();
 
@@ -4629,6 +4631,9 @@
     init_rx_tables();
     init_tx_tables();
 
+    if ((substr = strstr(saved_command_line, "ethaddr=")) != 
saved_command_line)
+        substr = strstr(saved_command_line, " ethaddr=");
+    esiset = (substr != NULL && sscanf(substr, " 
ethaddr=%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx", esi, esi + 1, esi + 2, esi + 3, 
esi + 4, esi + 5) == 6);
     /*  create devices  */
     for ( port_num = 0; port_num < ATM_PORT_NUMBER; port_num++ ) {
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
@@ -4647,6 +4652,12 @@
             g_atm_priv_data.port[port_num].dev->ci_range.vci_bits = 16;
             g_atm_priv_data.port[port_num].dev->link_rate = 
g_atm_priv_data.port[port_num].tx_max_cell_rate;
             g_atm_priv_data.port[port_num].dev->dev_data = (void*)port_num;
+            if (esiset) {
+                if (!++(esi[5]))
+                    if (!++(esi[4]))
+                        esi[3]++;
+                memcpy(g_atm_priv_data.port[port_num].dev->esi, esi, 6);
+            }
         }
     }
 



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

Reply via email to