summarylogtreecommitdiffstats
path: root/8a8796802bc497f00b6a27ca14e2be0c9f9ec176.patch
diff options
context:
space:
mode:
Diffstat (limited to '8a8796802bc497f00b6a27ca14e2be0c9f9ec176.patch')
-rw-r--r--8a8796802bc497f00b6a27ca14e2be0c9f9ec176.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/8a8796802bc497f00b6a27ca14e2be0c9f9ec176.patch b/8a8796802bc497f00b6a27ca14e2be0c9f9ec176.patch
new file mode 100644
index 00000000000..4e13363ddd9
--- /dev/null
+++ b/8a8796802bc497f00b6a27ca14e2be0c9f9ec176.patch
@@ -0,0 +1,59 @@
+From 8a8796802bc497f00b6a27ca14e2be0c9f9ec176 Mon Sep 17 00:00:00 2001
+From: Andreas Eversberg <jolly@eversberg.eu>
+Date: Wed, 19 Jun 2013 07:55:21 +0000
+Subject: osmocon: Improve performance by handling several serial bytes at a time
+
+---
+diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c
+index 1066291..648d416 100644
+--- a/src/host/osmocon/osmocon.c
++++ b/src/host/osmocon/osmocon.c
+@@ -655,13 +655,24 @@ static int handle_write_dnload(void)
+
+ static int handle_sercomm_write(void)
+ {
+- uint8_t c;
++ uint8_t buffer[256];
++ int i, count = 0, end = 0;
+
+- if (sercomm_drv_pull(&c) != 0) {
+- if (write(dnload.serial_fd.fd, &c, 1) != 1)
++ for (i = 0; i < sizeof(buffer); i++) {
++ if (sercomm_drv_pull(&buffer[i]) == 0) {
++ end = 1;
++ break;
++ }
++ count++;
++ }
++
++ if (count) {
++ if (write(dnload.serial_fd.fd, buffer, count) != count)
+ perror("short write");
+- } else
+- dnload.serial_fd.when &= ~BSC_FD_WRITE;
++ }
++
++ if (end)
++ dnload.serial_fd.when &= ~BSC_FD_WRITE;
+
+ return 0;
+ }
+@@ -1154,13 +1165,13 @@ static int serial_read(struct osmo_fd *fd, unsigned int flags)
+ if (flags & BSC_FD_READ) {
+ switch (dnload.mode) {
+ case MODE_ROMLOAD:
+- rc = handle_read_romload();
++ while ((rc = handle_read_romload()) > 0);
+ break;
+ case MODE_MTK:
+- rc = handle_read_mtk();
++ while ((rc = handle_read_mtk()) > 0);
+ break;
+ default:
+- rc = handle_read();
++ while ((rc = handle_read()) > 0);
+ break;
+ }
+ if (rc == 0)
+--
+cgit v0.9.1