aboutsummaryrefslogtreecommitdiffstats
path: root/com32/libupload/serial.h
diff options
context:
space:
mode:
authorErwan Velu <erwanaliasr1@gmail.com>2011-03-15 21:51:46 +0100
committerErwan Velu <erwanaliasr1@gmail.com>2011-03-15 21:58:47 +0100
commit997985d79e5813e8a33e82fb0cc0c0f08cf2c55d (patch)
tree075ba6a5c1abceb938626430743e6de6e2cbc4fe /com32/libupload/serial.h
parent3905382158cc8c5c40f71e1b33f1802341838bca (diff)
downloadsyslinux-997985d79e5813e8a33e82fb0cc0c0f08cf2c55d.tar.gz
syslinux-997985d79e5813e8a33e82fb0cc0c0f08cf2c55d.tar.xz
syslinux-997985d79e5813e8a33e82fb0cc0c0f08cf2c55d.zip
libupload: New library to manage uploads
This commit creates a library to upload content via 3 backends (srec/ymodem/tftp). Code came from sysdump and got librarized for being used more easily by more other com32 modules.
Diffstat (limited to 'com32/libupload/serial.h')
-rw-r--r--com32/libupload/serial.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/com32/libupload/serial.h b/com32/libupload/serial.h
new file mode 100644
index 00000000..356f2cef
--- /dev/null
+++ b/com32/libupload/serial.h
@@ -0,0 +1,19 @@
+#ifndef SERIAL_H
+#define SERIAL_H
+
+#include <stddef.h>
+
+struct serial_if {
+ uint16_t port;
+ bool console;
+ struct {
+ uint8_t dll, dlm, ier, iir, lcr, mcr;
+ } old;
+};
+
+int serial_init(struct serial_if *sif, const char *argv[]);
+void serial_read(struct serial_if *sif, void *data, size_t n);
+void serial_write(struct serial_if *sif, const void *data, size_t n);
+void serial_cleanup(struct serial_if *sif);
+
+#endif /* SERIAL_H */