aboutsummaryrefslogtreecommitdiffstats
path: root/package/dropbear/patches/160-tty_close.patch
blob: 8c06e0f912ced80494c92dae53e1888a3285e6cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Index: dropbear-0.50/common-channel.c
===================================================================
--- dropbear-0.50.orig/common-channel.c	2007-08-10 23:47:47.000000000 +0200
+++ dropbear-0.50/common-channel.c	2007-08-10 23:47:50.000000000 +0200
@@ -311,10 +311,10 @@
 		send_msg_channel_eof(channel);
 	}
 
-	/* And if we can't receive any more data from them either, close up */
+	/* And if we can't receive any more data from them either, close up (server only) */
 	if (!channel->sent_close
 			&& channel->readfd == FD_CLOSED
-			&& (ERRFD_IS_WRITE(channel) || channel->errfd == FD_CLOSED)
+			&& !ERRFD_IS_WRITE(channel)
 			&& !write_pending(channel)) {
 		TRACE(("sending close, readfd is closed"))
 		send_msg_channel_close(channel);
ame.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
From 26546e5499d98616322fb3472b977e2e86603f3a Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jogo@openwrt.org>
Date: Tue, 24 Jun 2014 10:57:51 +0200
Subject: [PATCH 45/48] MIPS: BCM63XX: add support for loading DTB

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
---
 arch/mips/bcm63xx/boards/Kconfig        |    4 ++++
 arch/mips/bcm63xx/boards/board_common.c |   34 +++++++++++++++++++++++++++++++
 arch/mips/bcm63xx/prom.c                |    6 ++++++
 3 files changed, 44 insertions(+)

--- a/arch/mips/bcm63xx/boards/Kconfig
+++ b/arch/mips/bcm63xx/boards/Kconfig
@@ -2,6 +2,10 @@
 menu "Board support"
 	depends on BCM63XX
 
+config BOARD_BCM63XX_DT
+	bool "Device Tree boards (experimential)"
+	select USE_OF
+
 config BOARD_BCM963XX
        bool "Generic Broadcom 963xx boards"
 	select SSB
--- a/arch/mips/bcm63xx/boards/board_common.c
+++ b/arch/mips/bcm63xx/boards/board_common.c
@@ -10,11 +10,14 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
+#include <linux/of_fdt.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/ssb/ssb.h>
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 #include <asm/fw/cfe/cfe_api.h>
+#include <asm/prom.h>
 #include <bcm63xx_board.h>
 #include <bcm63xx_cpu.h>
 #include <bcm63xx_dev_uart.h>
@@ -125,8 +128,23 @@ void __init board_setup(void)
 	/* make sure we're running on expected cpu */
 	if (bcm63xx_get_cpu_id() != board.expected_cpu_id)
 		panic("unexpected CPU for bcm963xx board");
+
+#if CONFIG_OF
+	if (initial_boot_params)
+		__dt_setup_arch(initial_boot_params);
+#endif
 }
 
+#if CONFIG_OF
+void __init device_tree_init(void)
+{
+	if (!initial_boot_params)
+		return;
+
+	unflatten_and_copy_device_tree();
+}
+#endif
+
 static struct gpio_led_platform_data bcm63xx_led_data;
 
 static struct platform_device bcm63xx_gpio_leds = {
@@ -135,6 +153,13 @@ static struct platform_device bcm63xx_gp
 	.dev.platform_data	= &bcm63xx_led_data,
 };
 
+#if CONFIG_OF
+static struct of_device_id of_ids[] = {
+	{ /* filled at runtime */ },
+	{ .compatible = "simple-bus" },
+	{ },
+};
+#endif
 /*
  * third stage init callback, register all board devices.
  */
@@ -142,6 +167,15 @@ int __init board_register_devices(void)
 {
 	int usbh_ports = 0;
 
+#if CONFIG_OF
+	if (of_have_populated_dt()) {
+		snprintf(of_ids[0].compatible, sizeof(of_ids[0].compatible),
+			 "brcm,bcm%x", bcm63xx_get_cpu_id());
+
+		of_platform_populate(NULL, of_ids, NULL, NULL);
+	}
+#endif
+
 	if (board.has_uart0)
 		bcm63xx_uart_register(0);
 
--- a/arch/mips/bcm63xx/prom.c
+++ b/arch/mips/bcm63xx/prom.c
@@ -8,6 +8,7 @@
 
 #include <linux/init.h>
 #include <linux/bootmem.h>
+#include <linux/of_fdt.h>
 #include <linux/smp.h>
 #include <asm/bootinfo.h>
 #include <asm/bmips.h>
@@ -23,6 +24,11 @@ void __init prom_init(void)
 {
 	u32 reg, mask;
 
+#if CONFIG_OF
+	if (fw_passed_dtb)
+		early_init_dt_verify((void *)fw_passed_dtb);
+#endif
+
 	bcm63xx_cpu_init();
 
 	/* stop any running watchdog */