PDP10, PDP11, VAX: Fix DMC & DUP unit attach strings for multi-line device configurations.
This commit is contained in:
parent
e63fbdce49
commit
edb475fcc1
3 changed files with 31 additions and 23 deletions
|
@ -3772,6 +3772,7 @@ int32 dmc = (int32)(uptr-dptr->units);
|
||||||
TMXR *mp = (dptr == &dmc_dev) ? &dmc_desc : &dmp_desc;
|
TMXR *mp = (dptr == &dmc_dev) ? &dmc_desc : &dmp_desc;
|
||||||
TMLN *lp = &mp->ldsc[dmc];
|
TMLN *lp = &mp->ldsc[dmc];
|
||||||
int32 i, attached;
|
int32 i, attached;
|
||||||
|
t_stat r;
|
||||||
|
|
||||||
if (!(uptr->flags & UNIT_ATT)) /* attached? */
|
if (!(uptr->flags & UNIT_ATT)) /* attached? */
|
||||||
return SCPE_OK;
|
return SCPE_OK;
|
||||||
|
@ -3784,9 +3785,10 @@ if (!attached) {
|
||||||
sim_cancel (dptr->units+mp->lines); /* stop poll on last detach */
|
sim_cancel (dptr->units+mp->lines); /* stop poll on last detach */
|
||||||
sim_cancel (dptr->units+(mp->lines+1)); /* stop timer on last detach */
|
sim_cancel (dptr->units+(mp->lines+1)); /* stop timer on last detach */
|
||||||
}
|
}
|
||||||
|
r = tmxr_detach_ln (lp);
|
||||||
free (uptr->filename);
|
free (uptr->filename);
|
||||||
uptr->filename = NULL;
|
uptr->filename = NULL;
|
||||||
return tmxr_detach_ln (lp);
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *dmc_description (DEVICE *dptr)
|
char *dmc_description (DEVICE *dptr)
|
||||||
|
|
|
@ -1275,6 +1275,7 @@ DEVICE *dptr = DUPDPTR;
|
||||||
int32 dup = (int32)(uptr-dptr->units);
|
int32 dup = (int32)(uptr-dptr->units);
|
||||||
TMLN *lp = &dup_ldsc[dup];
|
TMLN *lp = &dup_ldsc[dup];
|
||||||
int32 i, attached;
|
int32 i, attached;
|
||||||
|
t_stat r;
|
||||||
|
|
||||||
if (!(uptr->flags & UNIT_ATT)) /* attached? */
|
if (!(uptr->flags & UNIT_ATT)) /* attached? */
|
||||||
return SCPE_OK;
|
return SCPE_OK;
|
||||||
|
@ -1285,6 +1286,7 @@ for (i=attached=0; i<dup_desc.lines; i++)
|
||||||
++attached;
|
++attached;
|
||||||
if (!attached)
|
if (!attached)
|
||||||
sim_cancel (dup_units+dup_desc.lines); /* stop poll on last detach */
|
sim_cancel (dup_units+dup_desc.lines); /* stop poll on last detach */
|
||||||
|
r = tmxr_detach_ln (lp);
|
||||||
free (uptr->filename);
|
free (uptr->filename);
|
||||||
uptr->filename = NULL;
|
uptr->filename = NULL;
|
||||||
free (dup_rcvpacket[dup]);
|
free (dup_rcvpacket[dup]);
|
||||||
|
@ -1295,7 +1297,7 @@ free (dup_xmtpacket[dup]);
|
||||||
dup_xmtpacket[dup] = NULL;
|
dup_xmtpacket[dup] = NULL;
|
||||||
dup_xmtpksize[dup] = 0;
|
dup_xmtpksize[dup] = 0;
|
||||||
dup_xmtpkoffset[dup] = 0;
|
dup_xmtpkoffset[dup] = 0;
|
||||||
return tmxr_detach_ln (lp);
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SET/SHOW SPEED processor */
|
/* SET/SHOW SPEED processor */
|
||||||
|
|
46
sim_tmxr.c
46
sim_tmxr.c
|
@ -826,8 +826,6 @@ if (tptr == NULL) /* no more mem? */
|
||||||
|
|
||||||
if (mp->port) /* copy port */
|
if (mp->port) /* copy port */
|
||||||
sprintf (growstring(&tptr, 13 + strlen (mp->port)), "%s%s", mp->port, mp->notelnet ? ";notelnet" : "");
|
sprintf (growstring(&tptr, 13 + strlen (mp->port)), "%s%s", mp->port, mp->notelnet ? ";notelnet" : "");
|
||||||
if (mp->buffered)
|
|
||||||
sprintf (growstring(&tptr, 32), ",Buffered=%d", mp->buffered);
|
|
||||||
if (mp->logfiletmpl[0]) /* logfile info */
|
if (mp->logfiletmpl[0]) /* logfile info */
|
||||||
sprintf (growstring(&tptr, 7 + strlen (mp->logfiletmpl)), ",Log=%s", mp->logfiletmpl);
|
sprintf (growstring(&tptr, 7 + strlen (mp->logfiletmpl)), ",Log=%s", mp->logfiletmpl);
|
||||||
while ((*tptr == ',') || (*tptr == ' '))
|
while ((*tptr == ',') || (*tptr == ' '))
|
||||||
|
@ -2024,19 +2022,27 @@ if (lp->serport) { /* close current serial connection *
|
||||||
lp->destination = NULL;
|
lp->destination = NULL;
|
||||||
}
|
}
|
||||||
tmxr_set_line_loopback (lp, FALSE);
|
tmxr_set_line_loopback (lp, FALSE);
|
||||||
if ((lp->mp) && (lp->mp->uptr) && ((lp->uptr == NULL) || (lp->uptr == lp->mp->uptr))) {
|
|
||||||
/* Revise the unit's connect string to reflect the current attachments */
|
|
||||||
lp->mp->uptr->filename = tmxr_mux_attach_string (lp->mp->uptr->filename, lp->mp);
|
|
||||||
/* No connections or listeners exist, then we're equivalent to being fully detached. We should reflect that */
|
|
||||||
if (lp->mp->uptr->filename == NULL)
|
|
||||||
tmxr_detach (lp->mp, lp->mp->uptr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
t_stat tmxr_detach_ln (TMLN *lp)
|
t_stat tmxr_detach_ln (TMLN *lp)
|
||||||
{
|
{
|
||||||
tmxr_debug_trace_line (lp, "tmxr_detaach_ln()");
|
UNIT *uptr = NULL;
|
||||||
|
|
||||||
|
tmxr_debug_trace_line (lp, "tmxr_detach_ln()");
|
||||||
_mux_detach_line (lp, TRUE, TRUE);
|
_mux_detach_line (lp, TRUE, TRUE);
|
||||||
|
if (lp->mp)
|
||||||
|
if (lp->uptr)
|
||||||
|
uptr = lp->uptr;
|
||||||
|
else
|
||||||
|
if (lp->mp->uptr)
|
||||||
|
uptr = lp->mp->uptr;
|
||||||
|
if (uptr) {
|
||||||
|
/* Revise the unit's connect string to reflect the current attachments */
|
||||||
|
uptr->filename = tmxr_mux_attach_string (uptr->filename, lp->mp);
|
||||||
|
/* No connections or listeners exist, then we're equivalent to being fully detached. We should reflect that */
|
||||||
|
if (uptr->filename == NULL)
|
||||||
|
tmxr_detach (lp->mp, uptr);
|
||||||
|
}
|
||||||
return SCPE_OK;
|
return SCPE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2061,7 +2067,7 @@ char tbuf[CBUFSIZE], listen[CBUFSIZE], destination[CBUFSIZE],
|
||||||
SOCKET sock;
|
SOCKET sock;
|
||||||
SERHANDLE serport;
|
SERHANDLE serport;
|
||||||
char *tptr = cptr;
|
char *tptr = cptr;
|
||||||
t_bool nolog, notelnet, listennotelnet, unbuffered, modem_control, loopback, datagram, packet;
|
t_bool nolog, notelnet, listennotelnet, modem_control, loopback, datagram, packet;
|
||||||
TMLN *lp;
|
TMLN *lp;
|
||||||
t_stat r = SCPE_ARG;
|
t_stat r = SCPE_ARG;
|
||||||
|
|
||||||
|
@ -2079,7 +2085,7 @@ while (*tptr) {
|
||||||
memset(buffered, '\0', sizeof(buffered));
|
memset(buffered, '\0', sizeof(buffered));
|
||||||
memset(port, '\0', sizeof(port));
|
memset(port, '\0', sizeof(port));
|
||||||
memset(option, '\0', sizeof(option));
|
memset(option, '\0', sizeof(option));
|
||||||
nolog = notelnet = listennotelnet = unbuffered = loopback = FALSE;
|
nolog = notelnet = listennotelnet = loopback = FALSE;
|
||||||
datagram = mp->datagram;
|
datagram = mp->datagram;
|
||||||
packet = mp->packet;
|
packet = mp->packet;
|
||||||
if (mp->buffered)
|
if (mp->buffered)
|
||||||
|
@ -2121,7 +2127,7 @@ while (*tptr) {
|
||||||
(0 == MATCH_CMD (gbuf, "UNBUFFERED"))) {
|
(0 == MATCH_CMD (gbuf, "UNBUFFERED"))) {
|
||||||
if ((NULL != cptr) && ('\0' != *cptr))
|
if ((NULL != cptr) && ('\0' != *cptr))
|
||||||
return SCPE_2MARG;
|
return SCPE_2MARG;
|
||||||
unbuffered = TRUE;
|
buffered[0] = '\0';
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (0 == MATCH_CMD (gbuf, "BUFFERED")) {
|
if (0 == MATCH_CMD (gbuf, "BUFFERED")) {
|
||||||
|
@ -2267,16 +2273,12 @@ while (*tptr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((unbuffered) && (mp->buffered))
|
|
||||||
mp->buffered = 0;
|
|
||||||
if (buffered[0])
|
|
||||||
mp->buffered = atoi(buffered);
|
|
||||||
for (i = 0; i < mp->lines; i++) { /* initialize line buffers */
|
for (i = 0; i < mp->lines; i++) { /* initialize line buffers */
|
||||||
lp = mp->ldsc + i;
|
lp = mp->ldsc + i;
|
||||||
if (mp->buffered) {
|
if (buffered[0]) {
|
||||||
lp->txbsz = mp->buffered;
|
lp->txbsz = atoi(buffered);
|
||||||
lp->txbfd = 1;
|
lp->txbfd = 1;
|
||||||
lp->rxbsz = mp->buffered;
|
lp->rxbsz = atoi(buffered);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lp->txbsz = TMXR_MAXBUF;
|
lp->txbsz = TMXR_MAXBUF;
|
||||||
|
@ -2421,7 +2423,7 @@ while (*tptr) {
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((unbuffered) || (buffered[0] == '\0')) {
|
if (buffered[0] == '\0') {
|
||||||
lp->rxbsz = lp->txbsz = TMXR_MAXBUF;
|
lp->rxbsz = lp->txbsz = TMXR_MAXBUF;
|
||||||
lp->txbfd = 0;
|
lp->txbfd = 0;
|
||||||
}
|
}
|
||||||
|
@ -3304,6 +3306,8 @@ else {
|
||||||
fprintf(st, ", ModemControl=enabled");
|
fprintf(st, ", ModemControl=enabled");
|
||||||
if (mp->notelnet)
|
if (mp->notelnet)
|
||||||
fprintf(st, ", Telnet=disabled");
|
fprintf(st, ", Telnet=disabled");
|
||||||
|
if (mp->buffered)
|
||||||
|
fprintf(st, ", Buffered=%d", mp->buffered);
|
||||||
fprintf(st, "\n");
|
fprintf(st, "\n");
|
||||||
for (j = 0; j < mp->lines; j++) {
|
for (j = 0; j < mp->lines; j++) {
|
||||||
lp = mp->ldsc + j;
|
lp = mp->ldsc + j;
|
||||||
|
|
Loading…
Add table
Reference in a new issue