FreeBSD Bugzilla – Attachment 521 Details for
Bug 2298
[sio] [patch] [request] support for DSR/DCD swapping on serial ports (sio)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.25 KB, created by
root
on 1996-12-27 14:30:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
root
Created:
1996-12-27 14:30:01 UTC
Size:
3.25 KB
patch
obsolete
>*** sio.c.orig Fri Nov 15 18:36:37 1996 >--- sio.c Fri Dec 20 11:24:46 1996 >*************** >*** 90,95 **** >--- 90,99 ---- > #define COM_LOSESOUTINTS(dev) ((dev)->id_flags & 0x08) > #define COM_NOFIFO(dev) ((dev)->id_flags & 0x02) > #define COM_VERBOSE(dev) ((dev)->id_flags & 0x80) >+ #define COM_SWAPDCDDSR(dev) ((dev)->id_flags & 0x10) >+ #define SWAPMASKDCD (MSR_DCD | MSR_DDCD) >+ #define SWAPMASKDSR (MSR_DSR | MSR_DDSR) >+ #define SWAPMASKDCDDSR (SWAPMASKDCD | SWAPMASKDSR) > > #define com_scr 7 /* scratch register for 16450-16550 (R/W) */ > >*************** >*** 168,173 **** >--- 172,178 ---- > #ifdef COM_MULTIPORT > bool_t multiport; /* is this unit part of a multiport device? */ > #endif /* COM_MULTIPORT */ >+ bool_t swapdcddsr; /* We want to swap DCD and DSR */ > bool_t no_irq; /* nonzero if irq is not attached */ > bool_t poll; /* nonzero if polling is required */ > bool_t poll_output; /* nonzero if polling for output is required */ >*************** >*** 410,415 **** >--- 415,421 ---- > } > } > #endif /* COM_MULTIPORT */ >+ > if (idev->id_irq == 0) > mcr_image = 0; > >*************** >*** 683,688 **** >--- 689,698 ---- > outb(iobase + com_fifo, 0); > determined_type: ; > >+ if (COM_SWAPDCDDSR(isdp)) { >+ com->swapdcddsr = TRUE; >+ printf (" DSR<->DCD "); >+ } > #ifdef COM_MULTIPORT > if (COM_ISMULTIPORT(isdp)) { > com->multiport = TRUE; >*************** >*** 752,757 **** >--- 762,768 ---- > int s; > struct tty *tp; > int unit; >+ u_char tmp1; > > mynor = minor(dev); > unit = MINOR_TO_UNIT(mynor); >*************** >*** 857,864 **** > disable_intr(); > (void) inb(com->line_status_port); > (void) inb(com->data_port); >! com->prev_modem_status = com->last_modem_status >! = inb(com->modem_status_port); > outb(iobase + com_ier, IER_ERXRDY | IER_ETXRDY | IER_ERLS > | IER_EMSC); > enable_intr(); >--- 868,884 ---- > disable_intr(); > (void) inb(com->line_status_port); > (void) inb(com->data_port); >! tmp1 = inb(com->modem_status_port); >! if (com->swapdcddsr) >! com->prev_modem_status = com->last_modem_status = >! ((tmp1 & ~SWAPMASKDCDDSR) >! | ((tmp1 & SWAPMASKDCD) >> 2) >! | ((tmp1 & SWAPMASKDSR) << 2)); >! else >! com->prev_modem_status = com->last_modem_status = tmp1; >! >! >! > outb(iobase + com_ier, IER_ERXRDY | IER_ETXRDY | IER_ERLS > | IER_EMSC); > enable_intr(); >*************** >*** 1102,1107 **** >--- 1122,1128 ---- > u_char modem_status; > u_char *ioptr; > u_char recv_data; >+ u_char tmp1; > > if (com->do_timestamp) > /* XXX a little bloat here... */ >*************** >*** 1187,1193 **** > } > > /* modem status change? (always check before doing output) */ >! modem_status = inb(com->modem_status_port); > if (modem_status != com->last_modem_status) { > /* > * Schedule high level to handle DCD changes. Note >--- 1208,1220 ---- > } > > /* modem status change? (always check before doing output) */ >! tmp1 = inb(com->modem_status_port); >! if (com->swapdcddsr) >! modem_status = ((tmp1 & ~SWAPMASKDCDDSR) >! | ((tmp1 & SWAPMASKDCD) >> 2) >! | ((tmp1 & SWAPMASKDSR) << 2)); >! else >! modem_status = tmp1; > if (modem_status != com->last_modem_status) { > /* > * Schedule high level to handle DCD changes. Note
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2298
: 521