fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

char-tcp: Control line support

Based on a patch by Julien Oster

Hampa Hug 5d88113d 73080edf

+55 -2
+10
doc/char-drivers.txt
··· 129 129 Common telnet clients need this when connecting to 130 130 a port other than 23. Defaults to true. 131 131 132 + usectl=[0|1] 133 + If true, modem status lines are properly handled in 134 + both directions. Specifically, DSR is always asserted, 135 + CTS and CD are only asserted when a client is 136 + connected to the TCP port, and flashing DTR causes the 137 + TCP connection to close. This is useful when the 138 + serial line is a tty, to close the connection when 139 + logged out and, conversely, to log out when the 140 + connection is closed manually. Defaults to true. 141 + 132 142 tios: 133 143 file=<filename> 134 144 The character device to connect to
+1 -1
src/arch/ibmpc/pce-ibmpc.cfg.in
··· 406 406 #driver = "pty:symlink=com1" 407 407 driver = "stdio:file=serport1.out:flush=1" 408 408 #driver = "tios:file=/dev/ttyS0" 409 - #driver = "tcp:port=5555:telnet=1:telnetinit=1" 409 + #driver = "tcp:port=5555:telnet=1:telnetinit=1:usectl=1" 410 410 411 411 # Log all traffic to this file. This is for debugging. 412 412 #log = "serport1.log"
+1 -1
src/arch/macplus/pce-macplus.cfg.in
··· 317 317 #driver = "pty:symlink=ser_a" 318 318 driver = "stdio:file=ser_a.out:flush=1" 319 319 #driver = "tios:file=/dev/ttyS0" 320 - #driver = "tcp:port=5555:telnet=1:telnetinit=1" 320 + #driver = "tcp:port=5555:telnet=1:telnetinit=1:usectl=1" 321 321 } 322 322 323 323 serial {
+40
src/drivers/char/char-tcp.c
··· 589 589 } 590 590 591 591 static 592 + int chr_tcp_get_ctl (char_drv_t *cdrv, unsigned *ctl) 593 + { 594 + char_tcp_t *drv = cdrv->ext; 595 + 596 + *ctl = drv->ctl | PCE_CHAR_DSR; 597 + 598 + if (drv->fd >= 0) { 599 + *ctl |= PCE_CHAR_CTS | PCE_CHAR_CD; 600 + } 601 + else { 602 + *ctl &= ~(PCE_CHAR_CTS | PCE_CHAR_CD); 603 + } 604 + 605 + return (0); 606 + } 607 + 608 + static 609 + int chr_tcp_set_ctl (char_drv_t *cdrv, unsigned ctl) 610 + { 611 + char_tcp_t *drv = cdrv->ext; 612 + 613 + if ((drv->ctl ^ ctl) & ~ctl & PCE_CHAR_DTR) { 614 + /* Hang Up */ 615 + chr_tcp_shutdown(drv); 616 + } 617 + 618 + drv->ctl = ctl; 619 + 620 + return (0); 621 + } 622 + 623 + static 592 624 int chr_tcp_init (char_tcp_t *drv, const char *name) 593 625 { 594 626 char *str; ··· 602 634 drv->listen_fd = -1; 603 635 drv->fd = -1; 604 636 637 + drv->ctl = PCE_CHAR_DSR; 638 + 605 639 drv->host = drv_get_option (name, "host"); 606 640 drv->connect = drv_get_option_bool (name, "connect", 0); 607 641 drv->port = drv_get_option_uint (name, "port", 5555); 608 642 609 643 drv->telnet = drv_get_option_bool (name, "telnet", 0); 610 644 drv->telnetinit = drv_get_option_bool (name, "telnetinit", 1); 645 + drv->usectl = drv_get_option_bool (name, "usectl", 1); 646 + 647 + if (drv->usectl) { 648 + drv->cdrv.get_ctl = chr_tcp_get_ctl; 649 + drv->cdrv.set_ctl = chr_tcp_set_ctl; 650 + } 611 651 612 652 if (drv->host != NULL) { 613 653 str = tcp_host_resolve (drv->host);
+3
src/drivers/char/char-tcp.h
··· 35 35 int connect; 36 36 int telnet; 37 37 int telnetinit; 38 + int usectl; 38 39 39 40 char *host; 40 41 unsigned port; 41 42 42 43 int listen_fd; 43 44 int fd; 45 + 46 + unsigned ctl; 44 47 45 48 unsigned telnet_state; 46 49 } char_tcp_t;