diff options
author | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2013-04-01 00:45:45 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2013-04-01 00:45:45 +0000 |
commit | ae3d83765cbb306696b3e0caa92e535e522b32d2 (patch) | |
tree | 2777c097b70e61f9a39ca0bca327974038c2ee4a /programmer.h | |
parent | 00e1608501a0eb270df80a31f0dd0b327b202059 (diff) | |
download | flashrom-ae3d83765cbb306696b3e0caa92e535e522b32d2.tar.gz flashrom-ae3d83765cbb306696b3e0caa92e535e522b32d2.tar.bz2 flashrom-ae3d83765cbb306696b3e0caa92e535e522b32d2.zip |
Introduce serialport_write_nonblock()
It seems useful to have a generic and platform-independent method to
read and write to a serial port without blocking. This is the write part.
This allows to get rid of the explicit temporary disabling of blocking I/O in
serprog's sp_synchronize().
Corresponding to flashrom svn r1662.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'programmer.h')
-rw-r--r-- | programmer.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/programmer.h b/programmer.h index c36b452f..a22bdd26 100644 --- a/programmer.h +++ b/programmer.h @@ -660,6 +660,7 @@ extern fdtype sp_fd; /* expose serialport_shutdown as it's currently used by buspirate */ int serialport_shutdown(void *data); int serialport_write(unsigned char *buf, unsigned int writecnt); +int serialport_write_nonblock(unsigned char *buf, unsigned int writecnt, unsigned int timeout, unsigned int *really_wrote); int serialport_read(unsigned char *buf, unsigned int readcnt); int serialport_read_nonblock(unsigned char *c, unsigned int readcnt, unsigned int timeout, unsigned int *really_read); |