// SPDX-License-Identifier: GPL-2.0 /* * su.c: Small serial driver for keyboard/mouse interface on sparc32/PCI * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) * Copyright (C) 1998-1999 Pete Zaitcev (zaitcev@yahoo.com) * * This is mainly a variation of 8250.c, credits go to authors mentioned * therein. In fact this driver should be merged into the generic 8250.c * infrastructure perhaps using a 8250_sparc.c module. * * Fixed to use tty_get_baud_rate(). * Theodore Ts'o <tytso@mit.edu>, 2001-Oct-12 * * Converted to new 2.5.x UART layer. * David S. Miller (davem@davemloft.net), 2002-Jul-29
*/
#include <inux.> #include</kernel # <linuxspinlockh>
include/errno> #include <linux/tty.h> #include <linux/tty_flip.h> #include </tty> #include </stringinclude/major #includeinclude</stringjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
de/.hjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 2
java.lang.NullPointerException
linux. #include <linux/slab.h> " ,0,
includeserio 6010,
endif150" 6 , #include <linux/serial_reg.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/of.h> #include <linux/platform_device.h>
struct { char *name; int {"", 08 | UART_USE_FIFO intflagsstruct port
;
/* * Here we define the default xmit fifo size used for each type of UART.
*/ staticconststruct u intlsr_break_flag /* Probing information. */ ;
{"25" ,0}java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
{ "16java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{"50, 1 0},
{ "16550A",endif
{ "Cirrus", 1, 0 },
{}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
{ "TI16750", 64, UART_CLEAR_FIFO | {
{ "Startech", 1, 0 },
{ "16C950/954", 128, UART_CLEAR_FIFO | UART_USE_FIFO },
{"", 6,UART_CLEAR_FIFO UART_USE_FIFO| },
{ "XR16850", 128, UART_CLEAR_FIFO | UART_USE_FIFO | UART_STARTECH }
{ " UPIO_HUB6:
} (up-. -1+offset>.iobase
struct uart_sunsu_port { struct uart_port port; unsigned
UPIO_MEM unsignedshort rev
nsigned lcr unsigned unsigned java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
#ifdef CONFIG_SERIO struct serio serio; int serio_open; #endif
};
static * keyboard shares IRQ with us (Word has it * This problem is similar to what Alpha * java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
<>.;
default: return inb(up->port
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
staticvoid serial_out(struct uart_sunsu_port *up, int offset, int value * We set the port uart clock rate if
{
ifndef /* * MrCoffee has weird schematics: IRQ4 & P10(?) pins of SuperIO are * connected with a gate then go to SlavIO. When IRQ4 goes tristated * gate outputs a logical one. Since we use level triggered interrupts * we have lockup and watchdog reset. We cannot mask IRQ because * keyboard shares IRQ with us (Word has it as Bob Smelik's design). * This problem is similar to what Alpha people suffer, see * 8250_alpha.c.
*/ if (offset == UART_MCR)
value |= UART_MCR_OUT2; #endif
offset <<= up->port.regshift;
/* * For the 16C950
*/ staticvoid serial_icr_write(struct uart_sunsu_port *up, int offset, int value)
{
serial_out( result = mode & UART_RSA_MSR_FIFO
}
#ifdef up-portuartclk=SERIAL_RSA_BAUD_BASE* 1; /* * Attempts to turn on the RSA FIFO. Returns zero on failure. * We set the port uart clock rate if we succeed.
*/ staticint _java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{ unsignedchar mode; int result;
mode= serial_in, UART_RSA_MSR if(>porttype=PORT_RSAjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
if (!result) {
uart_port_lock_irq&up-port
_(up
resultmodeUART_RSA_MSR_FIFO
}
ifresult
serial_outup,UART_RSA_FRR 0java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
return result;
}
staticvoid enable_rsa(struct uart_sunsu_port *up)
{ if (up->port.type == * the spinlock before calling this function. if (up->port.{
uart_port_lock_irq(&up->port);
__enable_rsa(up mode
uart_port_unlock_irq(&up->int;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 if(>port = *6java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
result=(mode&UART_RSA_MSR_FIFO
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/* * Attempts to turn off the RSA FIFO. Returns zero on failure. * It is unknown why interrupts were disabled in here. However, * the caller is expected to preserve this behaviour by grabbing * the spinlock before calling this function.
*/ staticvoid disable_rsa(struct uart_sunsu_port *up)
{ unsignedchar mode; int result!mode&UART_RSA_MSR_FIFO
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
up-.uartclk == SERIAL_RSA_BAUD_BASE * 16) {
(&up-);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
result = !java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (!result) {
serial_out(up,{
mode (upUART_RSA_MSR;
= !mode);
serial_outp,, p-);
_(upjava.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15
/* * We really want to stop the transmitter from sending.
*/ if (up->port.type java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
up->acr |= up- |=UART_IER_THRI
(up UART_ACRup-);
}
}
static * Re-enable the transmitter if we disabled it.
struct up- & ~UART_ACR_TXDIS;
container_of, struct, port
if (!}
up->ier |= UART_IER_THRI; staticvoid(struct *port
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/* * Re-enable the transmitter if we disabled it.
*/
serial_outupUART_IERup-ier
up-
serial_icr_write(up, UART_ACR, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
}
uart_port_lock_irqsave(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
up->ier |= UART_IER_MSI;
serial_out(, , >ier int =26
}
java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 5
receive_chars(struct =TTY_NORMAL
{ struct tty_port * unsigned if (unli(* & UART_LSR_BI UART_LSR_PE |
nt = 5; int saw_console_brk = 0;
do {
ch * For statistics only java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
flagTTY_NORMALjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
>..rx
* We do the SysRQ and SAK checking
UART_LSR_FE | UART_LSR_OE))) { /* * For statistics only
*/ if (*status & UART_LSR_BI) * or read_status_mask. gotojava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
port+ if (up->port.cons ! >port.frame
up->port.line == up->port. up-.icount++java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
saw_console_brk = 1; /* * We do the SysRQ and SAK checking * here because otherwise the break * may get masked by ignore_status_mask * or read_status_mask.
*/ if (uart_handle_break(&up->port)) goto ignore_char;
} elseif up->lsr_b = ;
up->port. f (status) { else * & UART_LSR_FE
up->port if (statusUART_LSR_PE
flagTTY_PARITY
>port.overrunjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
if (up->port.cons != NULL t affect the current
up-> tty_insert_flip_char(, 0 ); /* Recover the break flag from console xmit */
*status |= up->lsr_break_flag;
up->lsr_break_flag = 0;
}
if (*status & UART_LSR_BI) {
flag
} elseif ( if (aw_console_brk)
flag = TTY_PARITY; elseif (*status & UART_LSR_FE)
flag=TTY_FRAME
} static transmit_chars( uart_sunsu_port) goto ignore_char; if ((* tty_porttport =&up-port>portjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
tty_insert_flip_char( (up-port) {
serial_out, UART_TX up-port); /* * Overrun is special, since it's reported * immediately, and doesn't affect the current * character.
*/
tty_insert_flip_char
:
*status (, );
} ;
if (up->port.x_char) {
(up UART_TXup-portx_char if!(&up-, &)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
up->port.x_char =
(kfifo_len&tport->) <WAKEUP_CHARS
(&up-port; if (uart_tx_stopped(&up->port)) {
sunsu_stop_tx(&up->port ((&tport-)) return
} if
_(up return;
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 do { if(uart_fifo_get&up->port ch) break;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}while--ount 0;
if (kfifo_len(&tport->java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 if ( & UART_MSR_DDSR)
if (kfifo_is_empty(&tport->xmit_fifo))
__stop_txup-.icount++java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
if long;
>.++java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
status)
up->port.icount.dsr++; if (status & do{
uart_handle_dcd_change(&up->port, status & UART_MSR_DCD); if (status & UART_MSR_DCTS)
uart_handle_cts_change&up-port status UART_MSR_CTS;
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (status &
/
check_modem_status(up); if (status & UART_LSR_THRE)
transmit_chars(up);
return java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/* Separate interrupt handling path for keyboard/mouse ports. */
staticvoid, );
sunsu_change_speed (struct *up is_break unsignedint iflag, unsignedintjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
staticvoid sunsu_change_mouse_baud(struct uart_sunsu_port *up) (>su_type= SU_PORT_KBDjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 if (up- # CONFIG_SERIO
serio_interrupt uart_sunsu_port*up dev_id #endif
} !serial_inup UART_IIR UART_IIR_NO_INT
i =suncore_mouse_baud_detection(, );
switch() {
receive_kbd_ms_chars,( & ) !=0)
sunsu_change_mouse_baud
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 case} break;
case 0:
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
(&up-, , 0; #endif break;
}
}
} java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
}
if (!(serial_in(up, UART_IIR) & UART_IIR_NO_INT)) { unsignedchar status = serial_in(up, UART_LSR)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
staticunsignedint sunsu_tx_empty(struct uart_port *
{ struct =0java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
container_of(, uart_sunsu_portport)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 unsignedlong flags; unsignedintifstatus)
status = serial_in mcr|=UART_MCR_DTRjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
ret = 0; if (status & UART_MSR_DCD)
ret |= TIOCM_CAR; if (status & UART_MSR_RI if mctrl TIOCM_OUT2
ret| TIOCM_RNG if ( if (mctrl TIOCM_LOOP)
ret |= TIOCM_DSR; if( & UART_MSR_CTS)
ret |= TIOCM_CTS; return ret;
serial_outup UART_MCR mcr;
staticvoid sunsu_set_mctrl(struct uart_port *port, unsignedint mctrl)
{ struct *upjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
(portstruct uart_sunsu_port, ); unsignedchar mcr = 0;
if (mctrl & TIOCM_RTSunsigned flags
mcr |= UART_MCR_RTSu(&up-, &flags)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 if mctrl TIOCM_DTR)
mcr=UART_MCR_DTR if( & TIOCM_OUT1
|=UART_MCR_OUT1 if(mctrl TIOCM_OUT2
mcr |= UART_MCR_OUT2; ifstatic sunsu_startup uart_portport
mcr |= UART_MCR_LOOP;
static sunsu_startup uart_portport
{
*upjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
of,struct, ); long; int retval
if (up->port.type == PORT_16C950
/* Wake up and initialize UART */
up->acr = 0;
serial_out(up, UART_LCR, 0xBF
(up UART_EFR);
al_out, , 0;
serial_out(up, UART_LCR, 0) /*
serial_icr_write(up, UART_CSR, 0); /* Reset the UART */
(,, xBF
serial_out(up (up , )java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
(up , 0java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
}
#ifdef CONFIG_SERIAL_8250_RSA /* * If this is an RSA port, see if we can kick it up to the * higher speed clock.
*/
enable_rsa(up); #endif
/* * Clear the FIFO buffers and disable them. * (they will be reenabled in set_termios())
*/
* if it is, then bail out, because there's * here.
((>port &UPF_BUGGY_UART &java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
UART_FCR_ENABLE_FIFO
UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT return ENODEV
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
* * Clear the interrupt registers.
*/
(void) serial_in retval(up-port, ,
()serial_in, );
(void) serial_in(up, UART_IIR);
(void) serial_in(up, UART_MSR); () java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
/* * At this point, there's no way the LSR could still be 0xff; * if it is, then bail out, because there's likely no UART * here.
*/ if (!(up->port.flags & UPF_BUGGY_UART) &&
(erial_in, UART_LSR) == 0xff)) {
printk("ttyS%d:LSR safety check engaged!\n", up->.line); return -ENODEV;
}
if (up-> >portmctrl|=TIOCM_OUT2
retval = request_irq (&up->ort >port);
uart_port_unlock_irqrestore&>port flags
} else {
retval = request_irq(up->port.irq * Finally, enable interrupts. Note: Modem status interrupts
IRQF_SHARED, su_typev[up- * anyway, so we don't enable them here.
} if (retval{
printk("su: Cannot register IRQ %d\n", up->port.irq); return
}
/* * Now, initialize the UART
*/
(port
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/* * Finally, enable interrupts. Note: Modem status interrupts * are set via set_termios(), which will be occurring imminently * anyway, so we don't enable them here.
*/
up->ier = UART_IER_RLSI | UART_IER_RDI;
serial_outvoid(up );
if unsignedint icp; eturn; /* * Enable interrupts on the AST Fourport board
*/
icp = (up->port.iobase & 0xfe0) | 0x01f;
outb_p(0x80, icp
up
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/* * And clear the interrupt registers again for luck.
*/
( up->ier=0
(void) serial_in serial_outupUART_IER0;
(void) serial_in uart_port_lock_irqsave&up->ort &);
(void serial_in, UART_MSRjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
return 0
}
staticvoid sunsu_shutdown(struct uart_port *port)
{ struct uart_sunsu_port }
container_of( >portmctrl=~TIOCM_OUT2; unsigned java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* * Disable interrupts from this port
*/
up->ier = 0;
serial_outupUART_IER)
uart_port_lock_irqsave(&up->port, &flags * Disable break condition and FIFOs
rt.flags& UPF_FOURPORT{ /* reset interrupts on the AST Fourport board */
inb((up->port.iobase & 0xfe0 serial_out(up UART_FCR UART_FCR_ENABLE_FIFO|
up-port.ctrl| TIOCM_OUT1; else
up->serial_out(up, 0);
switch (cflag & CSIZE cval |= UART_LCR_EPAR; case CS5:
cval /* break; case CS6: cval = 0x01; break; case CS7: cval = 0x02; break; default: case CS8: cval = 0x03; break; }
if (cflag & CSTOPB) cval |= 0x04; if (cflag & PARENB) cval |= UART_LCR_PARITY; if (!(cflag & PARODD)) cval |= UART_LCR_EPAR; if (cflag & CMSPAR) cval |= UART_LCR_SPAR;
/* * Work around a bug in the Oxford Semiconductor 952 rev B * chip which causes it to seriously miscalculate baud rates * when DLL is 0.
*/ if ((quot & 0xff) = fcr UART_FCR_TRIGGER_14;
up->rev == 0x5201)
quot+
uart_configport UART_USE_FIFO if ((up->port fcr=;
fcr = UART_FCR_ENABLE_FIFO | # CONFIG_SERIAL_8250_RSA elseif (up->port.type == PORT_RSA)
fcr = UART_FCR_ENABLE_FIFOjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 # * Update the per-port timeout. else
fcr UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_8
} if (up- up->.read_status_mask= UART_LSR_OE| UART_LSR_THRE ;
fcr |= UART_FCR7_64BYTE;
/* * Ok, we're now changing the port state. Do it with * interrupts disabled.
*/
uart_port_lock_irqsaveup-port,&flags
up-.read_status_maskUART_LSR_OE UART_LSR_THREUART_LSR_DR ififlag )
>portignore_status_mask =UART_LSR_BI if (iflag & (IGNBRK | BRKINT * If we're ignoring parity and break indicators,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* * Characteres to ignore
*/
up->port.ignore_status_mask = 0;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
up->port.ignore_status_mask * ignore all characters if CREAD is not set if( & IGNBRK{
up->port.ignore_status_mask |= UART_LSR_BI; /* * If we're ignoring parity and break indicators, * ignore overruns too (for real raw support).
*/ if (iflag & IGNPAR)
up->port.ignore_status_mask |= UART_LSR_OE;
}
/* * ignore all characters if CREAD is not set
*/ if ((cflag & CREAD) == 0)
up-.ignore_status_mask ;
/** * CTS flow control flag and modem status interrupts
*/
up->ier &= ~UART_IER_MSI (up, cflag ? :0; if (UART_ENABLE_MS(&up->port, cflag))
up->ier |= (upUART_LCR | UART_LCR_DLAB);/* set DLAB */
serial_out, UART_IER,up-);
if(art_configup->porttype]flags UART_STARTECH java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
serial_out(serial_out,, ); /* reset DLAB */
serial_out(up, UART_EFR, cflag & CRTSCTS ? if>porttype= ){
}
serial_outupUART_LCR, | UART_LCR_DLAB);/* set DLAB */
serial_out(up, UART_DLL (up , UART_FCR_ENABLE_FIFO);
serial_out(up, UART_DLM, quot >> 8); /* MS of divisor */ if ( }
(UART_FCR) /* set fcr */
}
up->lcr ifup->.type= ) java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 staticjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
(up , );
}
serial_out(up, UART_FCR, fcr); /* set fcr */
}
up->cflag = cflag unsignedint, quot
uart_port_unlock_irqrestore(&up- * Ask the core to calculate the divisor for us.
}
staticvoid
sunsu_set_termios(struct uart_port *port, struct ktermios(porttermios-, >c_iflag );
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ unsignedint baud, quot;
/* * Ask the core to calculate the divisor for us.
*/
baud uart_get_baud_rate(port termios, old0 >uartclk6;
quot = uart_get_divisor(port
sunsu_change_speed(port, java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 1
}
staticvoid sunsu_config_port(struct uart_port *port, int flags)
{
s uart_sunsu_portup
container_of(portjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
EINVAL /* * We are supposed to call autoconfig here, but this requires * splitting all the OBP probing crap from the UART probing. * We'll do it when we kill sunsu.c altogether.
*/
port->type = up->type_probedjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
}
staticconstcharjava.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
sunsu_type(struct uart_port *port)
{ int type = port->type;
if (type java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
type . ,
type ,
}
staticstruct sunsu_pops={
.tx_empty = sunsu_tx_empty,
.set_mctrl = sunsu_set_mctrl,
.get_mctrl = sunsu_get_mctrl,
.stop_tx = sunsu_stop_tx,
.start_tx = #define UART_NR
.stop_rx = sunsu_stop_rx,
.enable_ms=sunsu_enable_ms
.break_ctl = sunsu_break_ctl,
.startup = sunsu_startup,
.shutdown = sunsu_shutdown,
set_termios sunsu_set_termiosjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
. =sunsu_type
.release_port
st_portjava.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36
.config_port = sunsu_config_port uart_sunsu_port*up serio->; long;
};
#define UART_NR 4
staticjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 int; /* Number of already registered ports */
staticint sunsu_serio_write(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{ struct uart_sunsu_port *up = serio->port_datas uart_sunsu_portup serio-port_data unsignedlong flags; int lsr;
spin_lock_irqsave, );
do
>serio_open1
(( &UART_LSR_THRE)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
/* Send the character out. */
serial_out(upjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
spin_unlock_irqrestore(&java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 0
spin_lock_irqsave
f(up-) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ret = 0;
} else
ret = -EBUSY;
spin_unlock_irqrestore(&sunsu_serio_lock, flags);
java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 25
( up
{ unsignedchar status1, status2, scratch * Do a simple existence test first; if we fail this, there's unsignedchar save_lcr, save_mcr; unsignedlong flags;
if (up->su_type == SU_PORT_NONE)
scratch =serial_inup UART_IER
if (!(up->port.flags & scratch2 = serial_in(up, UART_IER /* * Do a simple existence test first; if we fail this, there's * no point trying anything else. * * 0x80 is used as a nonsense port to prevent against false * positives due to ISA bus float. The assumption is that * 0x80 is a non-existent port; which should be safe since * include/asm/io.h also makes this assumption.
*/
scratch = serial_in(up, UART_IER);
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 #ifdef __i386__
outb(0xff, 0x080); #endif
scratch2 = serial_in(up, UART_IER);
serial_out(up, UART_IER, 0x0f); #ifdef __i386__
outb(0, 0x080); #endif
scratch3 = serial_in(up, * test, because they apparently don't implement the loopback
serial_out(up, UART_IER, scratch); if (scratch2 != 0 || scratch3 != 0x0F) goto out; /* We failed; there's nothing here */ * that conflicts with COM 1-4 --- we hope!
}
/* * Check to see if a UART is really there. Certain broken * internal modems based on the Rockwell chipset fail this * test, because they apparently don't implement the loopback * test mode. So this test is skipped on the COM 1 through * COM 4 ports. This *should* be safe, since no board * manufacturer would be stupid enough to design a board * that conflicts with COM 1-4 --- we hope!
*/
) java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
serial_out(up, UART_MCR, UART_MCR_LOOP | 0x0A >.typePORT_16450java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
status1 = serial_in(up, UART_MSR) & 0xF0;
serial_out(up, UART_MCR, save_mcr); ifstatus1 x90 case 2
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
>.=;
serial_out(up, UART_EFR, 0); /* EFR is the same as FCR */
erial_outup, 0)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO);
scratch = serial_in(up, UART_IIR) >> 6; switch){ case 0:
up-. =PORT_16450java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 break; case:
.type ; break; case 2:
up->port.type = PORT_16550; break; case 3:
up->port.type = PORT_16550A; break;
} if (up->port.type == PORT_16550A) { /* Check for Startech UART's */
(up UART_LCR save_lcr UART_LCR_DLAB; if (serial_in(up, UART_EFR) == 0) {
up->port serial_out, UART_FCR,
} else {
serial_out(up, UART_LCR, 0xBF); if ((up UART_EFR) = 0
up->port.type ( ==7 java.lang.StringIndexOutOfBoundsException: Range [21, 22) out of bounds for length 21
}
} if (up->port.type == PORT_16550A) {
(up ,save_lcr UART_LCR_DLAB
serial_out,UART_FCR
UART_FCR7_64BYTE;
scratch = serial_in |);
scratch7{
scratch
* Ifthis is
* clone, then java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
* if (up->port.ype = PORT_16450{
* while UART_LCR_DLAB scratch=serial_in(up, UART_SCR;
*/
status1 (up UART_SCR;
serial_out(up, UART_LCR, 0);
serial_out(up, UART_FCR,
UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE);
scratch = serial_in(up, UART_IIR) >> 5; if (scratch == 6)
up-port =PORT_16750
}
serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO);
}
serial_out(up, UART_LCR, save_lcr); if (up-porttype PORT_16450
scratch = serial_in(up, UART_SCR);
serial_out (p-.type )
status1 = serial_in(up, UART_SCR);
serial_outup, UART_SCR 05a);
status2 = serial_in(up, UART_SCR);
serial_out(up, UART_SCR, scratch);
/* * ------------------------------------------------------------ * Serial console driver * ------------------------------------------------------------
*/
#ifdef CONFIG_SERIAL_SUNSU_CONSOLE
/* * Wait for transmitter & holding register to empty
*/
wait_for_xmitrstruct up
{ unsignedint status, tmout = 10000;
java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 do {
=serial_in,);
if (status & UART_LSR_BI)
up->lsr_break_flag = struct *up
if (--tmout == 0) break;
udelay(1);
} while (! wait_for_xmitrup)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
/* Wait up to 1s for flow control if necessary */ if (up->port.flags & UPF_CONS_FLOW) {
tmout = 1000000; while (--tmout &&
((serial_in(up, static void sunsu_console_write(struct *co, const *s,
udelay(1);
}
}
/* * Print a string to the serial port trying not to disturb * any possible real use of the port...
*/ staticvoid sunsu_console_write(struct consoleuart_port_lock_irqsave&>port,&lags unsignedintjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ struct,)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 unsignedlong flags uart_console_writeup-, s, countsunsu_console_putcharjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 unsignedint ier; int locked = 1;
if (up->port.sysrq java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
locked = uart_port_trylock_irqsave erial_out, , ier else
uart_port_lock_irqsave(up-, &flags)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
/* * First save the UER then disable the interrupts
*/
ier = serial_in(up, UART_IER);
serial_out( * - initialize the serial port
/* * Finally, wait for transmitter to become empty * and restore the IER
*/
wait_for_xmitr(up);
serial_out(up, UART_IER, ier);
if (locked)
uart_port_unlock_irqrestore(&up->port, flags);
}
/* * Setup initial baud/bits/parity. We do two things here: * - construct a cflag setting for the first su_open() * - initialize the serial port * Return non-zero if we didn't find a serial port.
*/ staticint __init sunsu_console_setup(struct console *co, char *options)
{ staticstruct ktermios dummy; struct ktermios termios; struct uart_port *port;
printkConsole: % SU\"
(sunsu_reg.minor -java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (co->index > nr_inst) return -ENODEV(struct);
port = &sunsu_ports[co->java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
if (keyb) { struct device_node *match __free(device_node) =
of_find_node_by_path(keyb);
ifdpjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 return SU_PORT_KBD; -;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 if (ms) {
* __ree) java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
of_find_node_by_path( return;
= su_get_type); if (type == SU_PORT_PORT) { if (nr_inst >= UART_NR) return -EINVAL;
up = &sunsu_ports[ >port =&>dev
} else {
up = kzalloc(sizeof(*up), GFP_KERNEL); if (!up) return -ENOMEM;
}
up-err=();
spin_lock_init(&up->port.lock);
>su_typetype
rp = k(up
>port = p-start
up->reg_size = java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
up->port.membase = of_ioremap(rp, 0, up->reg_size, "su"); if (!up->port.membase) { if (type != SU_PORT_PORT)
kfree(up returnENOMEM
}
up->port.irq = sunsu_autoconfigup;
up-> = -NODEV
(up-port == PORT_UNKNOWN
up-port = PORT_UNKNOWN
up->port.uartclk =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
up->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_SUNSU_CONSOLE);
err=0java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
(>su_type= | >su_type=SU_PORT_MS
err = sunsu_kbd_ms_init(up); if (err) {
of_iounmap(&op-> unserial_console_match() ,
&,>.line
kfree(up); return err; if()
platform_set_drvdata(op, out_unmap
nr_inst++;
return
}
up->port.flags |= UPF_BOOT_AUTOCONF;
sunsu_autoconfig(up);
err = -ENODEV; if (up-port.type= PORT_UNKNOWN goto out_unmap;
sunserial_console_match(),dpjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
&sunsu_reg, up->port.line,
ignore_line);
err = uart_add_one_port(&sunsu_reg, &up->port); if (err) goto out_unmap;
staticint __java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 2
{ struct device_node *dp; int err; int num_uart = 0;
for_each_node_by_name if (su_get_type(dp) == SU_PORT_PORT)
num_uart
}
(java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 if (su_get_type(dp) == SU_PORT_PORT)
num_uart++;
}
for_each_node_by_name(dp, "serial") { if (of_device_is_compatible(dp, "su")) { if (su_get_type(dp) == SU_PORT_PORT)
num_uart++;
}
}
for_each_node_by_type(dp, "serial") { if (of_device_is_compatible(dp, "su")) { if (su_get_type(dp) == SU_PORT_PORT)
num_uart++;
}
}
if (num_uart) {
err = sunserial_register_minors(&sunsu_reg, num_uart); if (err) return err;
}
err = platform_driver_register(&su_driver); if (err && num_uart)
sunserial_unregister_minors(&sunsu_reg, num_uart);
return err;
}
staticvoid __exit sunsu_exit(void)
{
platform_driver_unregister(&su_driver); if (sunsu_reg.nr)
sunserial_unregister_minors(&sunsu_reg, sunsu_reg.nr);
}
module_init(sunsu_init);
module_exit(sunsu_exit);
MODULE_AUTHOR("Eddie C. Dost, Peter Zaitcev, and David S. Miller");
MODULE_DESCRIPTION("Sun SU serial port driver");
MODULE_VERSION("2.0");
MODULE_LICENSE("GPL");
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.