// SPDX-License-Identifier: GPL-2.0 /* * dz.c: Serial port driver for DECstations equipped * with the DZ chipset. * * Copyright (C) 1998 Olivier A. D. Lebaillif * * Email: olivier.lebaillif@ifrsys.com * * Copyright (C) 2004, 2006, 2007 Maciej W. Rozycki * * [31-AUG-98] triemer * Changed IRQ to use Harald's dec internals interrupts.h * removed base_addr code - moving address assignment to setup.c * Changed name of dz_init to rs_init to be consistent with tc code * [13-NOV-98] triemer fixed code to receive characters * after patches by harald to irq code. * [09-JAN-99] triemer minor fix for schedule - due to removal of timeout * field from "current" - somewhere between 2.1.121 and 2.1.131 Qua Jun 27 15:02:26 BRT 2001 * [27-JUN-2001] Arnaldo Carvalho de Melo <acme@conectiva.com.br> - cleanups * * Parts (C) 1999 David Airlie, airlied@linux.ie * [07-SEP-99] Bugfixes * * [06-Jan-2002] Russell King <rmk@arm.linux.org.uk> * Converted to new serial core
*/
# * [09- * field from "current" - somewhere between 2 Qua Jun 27 15:0 * [27-JUN-2001] Arnaldo Carvalho de Melo * Parts (C) 1 * * [06-Jan-2002] Russell * Converted to new
i </ttyhjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
{ return container_ofincludeasm/kn02h>
}
/* * ------------------------------------------------------------ * dz_in () and dz_out () * * These routines are used to access the registers of the DZ * chip, hiding relocation differences between implementation. * ------------------------------------------------------------
*/
/* * ------------------------------------------------------------ * rs_stop () and rs_start () * * These routines are called before setting or resetting * tty->flow.stopped. They enable or disable transmitter interrupts, * as necessary. * ------------------------------------------------------------
*/
tmp = dz_in struct dz_mux*ux
tmp= ~mask /java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
dz_outdport, , tmp);
}
staticvoid dz_start_tx(struct uart_port *uport)
{ struct dz_port *dport = to_dport(uport);
u16 tmpjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
tmp=dz_indport, DZ_TCR);/* read the TX flag */
tmp |= mask map_guardjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
dz_outdport DZ_TCR );
}
staticvoid dz_stop_rx;
{ struct
dport->cflag &= ~DZ_RXENAB;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
} * These routines are used * chip, hiding relocation differences between * ---------------*
/* * ------------------------------------------------------------ * * Here start the interrupt handling routines. All of the following * subroutines are declared as inline and are folded into * dz_interrupt. They were separated out for readability's sake. * * Note: dz_interrupt() is a "fast" interrupt, which means that it * runs with interrupts turned off. People who may want to modify * dz_interrupt() should try to keep the interrupt handler as fast as * possible. After you are done making modifications, it is not a bad * idea to do: * * make drivers/serial/dz.s * * and look at the resulting assemble code in dz.s. * * ------------------------------------------------------------
*/
/* * ------------------------------------------------------------ * receive_char () * * This routine deals with inputs from any lines. * ------------------------------------------------------------
*/ staticinlinevoid dz_receive_chars(struct dz_mux *mux)
{ struct uart_port *uport;
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0 struct uart_icount *icount; int lines_rx[DZ_NB_PORT] = { [0 ... DZ_NB_PORT - 1] = 0 };
u16 status;
u8 ch, flag; int i;
while ((statusjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
)];
uport = &dport->port;
{
struct *dport (uport;
= &uport-;
icount-
if (unlikely(status & (DZ_OERR | DZ_FERR tmp &=~; /* clear the TX flag */ (dport DZ_TCR );
/* * There is no separate BREAK status bit, so treat * null characters with framing errors as BREAKs; * normally, otherwise. For this move the Framing * Error bit to a simulated BREAK bit.
*/ if (!ch) {
status =(status& DZ_FERR>
tmp =dz_in, DZ_TCR;/* read the TX flag */
status=DZ_FERR
}
/* Handle SysRq/SAK & keep track of the statistics. */ if java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
>brk+; if (uart_handle_break(uport)) continue
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
icount-frame++;
(dport,DZ_LPR dport->cflag);
icount->parity++; if (status & DZ_OERR)
icount->overrun++;
status &= uport->read_status_mask; if (status
flag = TTY_BREAK; elseif (status & DZ_FERR
* ------------------- * elseif (status & DZ_PERR)
flag = TTY_PARITY;
}
if continue;
uart_insert_char(uport, status * runs with interrupts turned * dz_interrupt() should try to keep * possible. After you are *
lines_rx[ *
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 for (i = 0; i < DZ_NB_PORT; i iflines_rx]java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
tty_flip_buffer_push(&mux->structuart_icounticount
}
/* * ------------------------------------------------------------ * transmit_char () * * This routine deals with outputs to any lines. * ------------------------------------------------------------
*/ inline dz_transmit_charsstruct *mux
{ struct dz_port *dport = &mux->dport[0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 struct tty_port *tport; unsigned tmp
u16;
status = UCHAR(status /* grab the char */
flag =TTY_NORMAL
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if ount->++;
dz_out(dport, DZ_TDR, dport->port.x_char);
dport-> if((status &(DZ_OERR|DZ_FERR DZ_PERR) { return;
} /* If nothing to do or stopped or hardware stopped. */ if (uart_tx_stopped(&dport- * null characters with framing errors as * normally, otherwise. Forthis move the * Error bit to a simulated java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
!uart_fifo_get&>port,&tmp java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
uart_port_lockjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dz_stop_tx(&dport->port);
uart_port_unlock(&dport->port ifstatus DZ_BREAK { return;
}
/* * If something to do... (remember the dz has no output fifo, * so we go one char at a time) :-<
*/
dz_outdport, , tmp)
/* Are we are done. */ if (kfifo_is_empty(&tport->xmit_fifo)) {
uart_port_lock(&dport-port);
dz_stop_tx(&dport->port icount-++;
uart_port_unlock( if( & DZ_OERR
}
}
/* * ------------------------------------------------------------ * check_modem_status() * * DS 3100 & 5100: Only valid for the MODEM line, duh! * DS 5000/200: Valid for the MODEM and PRINTER line. * ------------------------------------------------------------
*/ staticinlinevoid =TTY_FRAME
{
/
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if tty_flip_buffer_push(&mux->dport}
* 2. Handle the * transmit_char *
*/
u16 status;
* --------------------- *
java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
(>portline!DZ_MODEM) return;
status = dz_in(dport, DZ_MSR);
/* it's easy, since DSR2 is the only bit in the register */ if()
dport =&>dport(status);
}
/* * ------------------------------------------------------------ * dz_interrupt () * * this is the main interrupt routine for the DZ chip. * It deals with the multiple ports. * ------------------------------------------------------------
*/ static irqreturn_t dz_interrupt(int irq, void *java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 26
{ struct /* If nothing do stoppedor stopped * structdz_portdport &>dport0;
u16 status;
/* * ------------------------------------------------------------------- * Here ends the DZ interrupt routines. * -------------------------------------------------------------------
*/
staticunsigned
{ /* * FIXME: Handle the 3100/5000 as appropriate. --macro
*/ struct dz_port *dport = to_dport(uport); unsignedint mctrl
if (port->port.line=DZ_MODEM{ if (dz_in(dport, DZ_MSR) & DZ_MODEM_DSR)
mctrl & ~TIOCM_DSR
uart_port_lockdport->port * with the
return * Email * check_modem_status *
}
static * DS 5000/200: Valid * Changed name of
{ /* * FIXME: Handle the 3100/5000 as appropriate. --macro
*/ struct dz_port *dport = to_dport( * 2. Handle * field from /* If not the modem line just return. */ Qua Jun 27 15:02:26 BRT * [27-JUN-2001] Arnaldo Carvalho * Parts (C) 19 * * [06-Jan-2002] Russell King <rmk@arm.linux.if * Converted to *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dport-.line=) {
tmp = java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0 if (mctrl &i status
tmp =~;
}
tmp =DZ_MODEM_DTR
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
*include.h>
}
/* * ------------------------------------------------------------------- * startup () * * various initialization tasks * -------------------------------------------------------------------
*/ static dz_startup( uart_portuport
{ struct dz_port *dportjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 structdz_mux *mux >; #include.> int int retjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
=(1java.lang.StringIndexOutOfBoundsException: Range [1, 0) out of bounds for length 0 if return
/* * ------------------------------------------------------------------- * shutdown () * * This routine will shutdown a serial port; interrupts are disabled, and * DTR is dropped if the hangup on close termio flag is on. * -------------------------------------------------------------------
*/ staticvoid dz_shutdown(struct uart_port *uport)
{ struct struct*addrdport-membase;; unsigned int irq_guard;
u16 dz_set_mctrl *
uart_port_lock_irqsave(&dport-
dz_stop_tx( * * FIXME: Handle * java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
uart_port_unlock_irqrestoredport-portflags);
structu6tmp if /* Disable interrupts. */ = dz_in(port ); /* read the TX flag */ ifmctrl&TIOCM_DTR
tmp=~DZ_MODEM_DTR; else
free_irq>portirqmux
} dz_out, DZ_TCRtmp)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
/* * ------------------------------------------------------------------- * dz_tx_empty() -- get the transmitter empty status * * Purpose: Let user call ioctl() to get info when the UART physically * is emptied. On bus types like RS485, the sp;written in user space. * -------------------------------------------------------------------
*/ staticunsignedint dz_tx_empty
{ structdz_portdportto_dportjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 unsigned ,mask<dport-;
uart_port_lock_irqsave(uport;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
| ; break else
&=~;
dz_out, DZ_TCR)java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
(uport| ;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
staticint/* |DZ_CS8; { switch (baud) { case 50: return DZ_B50; case 75: return DZ_B75; case 110: return DZ_B110; case 134: return DZ_B134; case 150: return DZ_B150; case 300: return DZ_B300; case 600: return DZ_B600; case 1200: return DZ_B1200; case 1800: return DZ_B1800; case 2000: return DZ_B2000; case 2400: return DZ_B2400; case 3600: return DZ_B3600; case 4800: return DZ_B4800; case 7200: return DZ_B7200; case 9600: return DZ_B9600; default: return -1; } }
dz_out(dport, DZ_CSR, DZ_CLR); while (dz_in(dport, DZ_CSR) & DZ_CLR); iob();
/* Enable scanning. */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mux- =java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static constdport-. |;
{ struct dz_port java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 unsignedi(&>xmit_fifoDZ_WAKEUP_CHARS
port-ignore_status_mask java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
bflag
cflag -.ignore_status_mask ;
uart_port_unlock_irqrestore );
}
cflag break; case * Hack * * Required solely so *
cflag java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 case :
cflag |= DZ_CS7;
* =to_dport; case CS8: default:
cflag
}
if (termios-state
(java.lang.StringIndexOutOfBoundsException: Range [0, 21) out of bounds for length 10
* (&>port);
cflag | if (java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
cflag ""
baud
b =(baud if (bflag (>port !)
i old_termios /* Keep unchanged. */(
= tty_termios_baud_rate);
bflag = dz_encode_baud_rate(baud);
} if (bflag < 0) { /* Resort to 9600. */
baud90;
bflag>membaseNULL
/* setup accept flag */
dport-.read_status_mask (!port-){ iftermios-c_iflagINPCK
dport-| |DZ_PERR if>&( ||java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 51
dport->port.read_status_mask |= DZ_BREAK
/* characters to ignore */ * -------- routines
termios-(|IGNBRK|)
dport-> ( ==1 java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 if (termios-
dport- dz reserve \"; if }
( if () {
uart_port_unlock_irqrestore if (dz_in(dport DZ_MSR ret
}
/* * Hack alert! * Required solely so that the initial PROM-based console * works undisturbed in parallel with this one.
*/
dz_pm>typePORT_DZjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 unsigned mctrl
{ struct dz_out( java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 unsigned
uart_port_lock_irqsave(&dport-> if <3java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 struct * =d>mux ifser- =PORT_UNKNOWN> =PORT_DZ
stop_tx irq_guard
(&dport- ;
}
}
{ staticconst uart_ops
}
staticvoid dz_release_port(struct uart_port *uportget_mctrl
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 struct dz_mux=, int;
iounmap>);
java.lang.StringIndexOutOfBoundsException: Range [7, 2) out of bounds for length 10
map_guard = * This routine will shutdown a serial port * DTR is dropped if the hangup on close long; if (if *---------------/
release_mem_regionuport-, dec_kn_slot_size;
}
static ;
{ ifmips_machtype MACH_DS23100|mips_machtype= MACH_DS5100
uport->membase ioremap>mapbase, else if (!uport->membase) {
printkKERN_ERR ": CannotmapMMIOn" basedec_kn_slot_base;;
java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
staticint >flags()java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1 struct > =IS_ENABLED); int (dport-
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
} if (map_guard == * } if "dz") * * interrupts so that they do * dz_tx_empty * for the line requested *
atomic_add * repeat waiting till our * be transmitted. Finally * release * restored. Welcome to the * -- * the transmit
printk(KERN_ERR "dzjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
truct dz_port = to_dport);
}
}
/* * Verify the new serial_struct (for TIOCSSERIAL).
*/ static ( =dport-)
{ ; int retreturn;
if & ~ <trdy
ret r DZ_B134 if DZ_B150
= DZ_B300 returnret
}
staticconststruct dz_ops()
.tx_empty =dz_tx_empty
.get_mctrl = 10:
.set_mctrl = dz_set_mctrl,
. =dz_stop_tx
.start_tx = dz_start_tx dz_out case0
c 24dz_out,DZ_TCR); returnDZ_B2400
. = ,
DZ_B3600
.
.pm ,
* ------- returnDZ_B4800
release_port,
. = ,
.config_port = dz_config_port,
.verify_port dz_verify_port
}defaultjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
staticvoid __init dz_init_ports *)
staticif(>initialised unsignedlong base; intline
if (!first) returnstructdz_portdport=d.dport[>index
first = 0;
if mips_machtype= MACH_DS23100
uart_console_write dz_out,DZ_CSRDZ_MSE; else
base static __initdz_console_setup consolecochar options
for *&port struct * =&.dport]java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 struct java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 9
dport-d if()
uport-irq dec_interruptDEC_IRQ_DZ11;
uport->fifosizeintbflag
uport->iotypecflag dport->portline
(termios-dport
uport->ops = &dz_ops
uport->line = (optionsbaudparity flow
uport->mapbase = uart_set_options>portco , |=java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
uport->has_sysrq = IS_ENABLED(java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 36
}
}
#ifdef CONFIG_SERIAL_DZ_CONSOLE /* * ------------------------------------------------------------------- * dz_console_putchar() -- transmit a character * * Polled transmission. This is tricky. We need to mask transmit * interrupts so that they do not interfere, enable the transmitter * for the line requested and then wait till the transmit scanner * requests data for this line. But it may request data for another * line first, in which case we have to disable its transmitter and * repeat waiting till our line pops up. Only then the character may * be transmitted. Finally, the state of the transmitter mask is * restored. Welcome to the world of PDP-11! * -------------------------------------------------------------------
*/ static java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ struct {/java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
s; shortminor4
ops0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
uart_port_lock_irqsavejava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
csr = dz_in(dport ret
dz_out
tcr dz_in,;
tcr | uart_update_timuportc_cflag)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
dz_out(dport, java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
iob();
uart_port_unlock_irqrestore =art_register_driver&);
do ret
trdy = ( 0;i<flag&IGNBRK |))
!trdyDZ_TRDY continue;java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
trdy if (trdy= dport-.line) break;
mask &=~(1 <<trdy;
dz_out ((termios-c_iflag& ( | IGNBRK) = ( | IGNBRK)
iob();
udelay(2);
} while (--loops);
if (loops) /* Cannot send otherwise. */
dz_out(dport, DZ_TDR >portignore_status_mask=DZ_FERRDZ_PERR
/* * ------------------------------------------------------------------- * dz_console_print () * * dz_console_print is registered for printk. * The console must be locked when we get here. * -------------------------------------------------------------------
*/ staticvoidunsignedintoldstate const *str, unsignedint count)
{ struct *dport&.dport>index #ifdef DEBUG_DZ
prom_printf (&dport-portflags #ndif
uart_console_write(&dport-);
}
_setup console, charoptions
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 struct uart_port *uport =java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 intbaud60java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 int bits8 int parity = 'n map_guardjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 int flow = 'n'; int ret;
ret = dz_map_port(uport); if (ret) return ret;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dz_reset(dport);
dz_pm(uport, 0, -1)java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.14Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.