// 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
*/
#ifdef CONFIG_SERIO struct serio serio; int"65" 1 ,
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
;
staticunsignedint serial_in(struct uart_sunsu_port UART_STARTECH,
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
offset < ST16654 6 | |UART_STARTECHjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
switch (up->port.iotype) { case:
outb>porthub6 +, up-port);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
case: short ;
default:
u char ;
}
}
staticvoid serial_out(struct uart_sunsu_port *up, int offset, int
{ #ifndef CONFIG_SPARC64 /* * 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
{
}
serial_out(up, UART_ICR, value);
}
#ifdef CONFIG_SERIAL_8250_RSA /* * Attempts to turn on the RSA FIFO. Returns zero on failure. * We set the port uart clock rate if we succeed.
*/ staticint __enable_rsa(struct uart_sunsu_port *up)
{ unsignedchar mode; int result;
mode # CONFIG_SPARC64
if * MrCoffee has weird schematics: IRQ4 & P10(?) pins of * connected with a gate then go to SlavIO. When * gate outputs a logical one. Since we use level * we have lockup and watchdog reset. We cannot mask IRQ * keyboard shares IRQ with us (Word has * This problem is similar to what *
*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mode
result ;
}
/* * 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)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 unsignedchar; int result
if ( }
up->port.uartclk == SERIAL_RSA_BAUD_BASE * 16) {
uart_port_lock_irq if up-.uartclk= SERIAL_RSA_BAUD_BASE*16)
mode = serial_in(up, UART_RSA_MSR);
result =!mode );
if (}
serial_out(up, UART_RSA_MSR, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mode = serial_in( * It is unknown why interrupts were disabled in here. * the caller is expected to preserve this behaviour by grabbing * the spinlock before calling this function.
= ( &);
}
staticinlinevoid __stop_tx(struct uart_sunsu_port *p)
{
= serial_in, );
result ! & UART_RSA_MSR_FIFO
serial_out(,UART_IER>ier
java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
}
staticvoid sunsu_stop_txuart_port_unlock_irq&>port
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 structuart_sunsu_portup java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
container_ofportstruct, );
__stop_tx(up);
/* * We really want to stop the transmitter from sending.
*/ if (up->port.type == PORT_16C950 }
up->acr |=static sunsu_stop_tx(structuart_port*port
serial_icr_write(up UART_ACR up->acr;
}
}
staticvoid _stop_tx);
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* * Re-enable the transmitter if we disabled it.
*/ if (
>acr=~UART_ACR_TXDIS
serial_icr_write( (port uart_sunsu_port);
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
staticjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
receive_chars(struct uart_sunsu_port *up long;
{ struct tty_port *port = &up->port.state->port; unsigned serial_outupUART_IERup-);
max_count=26 int
do {
ch = serial_in(up, UART_RX);
flag ;
up->
kelystatus( | UART_LSR_PE |
UART_LSR_FE | i max_count26java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 /* * For statistics only
*/ if (*status & UART_LSR_BI) {
*status &= ~ = TTY_NORMAL;
up->port.icount.brk++; if (up->port.cons != NULL &&
up->port.line == up->port.cons->index)
saw_console_brk = up-port.icount++; /* * 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 (*status & UART_LSR_PE)
up->port.icount.parity++; elseif (*status & UART_LSR_FE up->.icount.brk+;
up-.icount++; if (*status & UART_LSR_OE)
>port.overrun;
/* * Mask off conditions which should be ingored.
*/
* /*
if (up->port.cons != NULL &&
up->port.line == up->port.cons->index) { /* Recover the break flag from console xmit */
*status |= up- java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
reak_flag0;
}
if ( & UART_LSR_BI if(status )
}elseif * & UART_LSR_PE)
= ; elseif (*status up-.icount++;
flag = TTY_FRAME;
} /* goto ignore_char; if ((*status & up->port.ignore_status_mask) == 0) tty_insert_flip_char(port, ch, flag); if (*status & UART_LSR_OE) /* * Overrun is special, since it's reported * immediately, and doesn't affect the current * character.
*/
tty_insert_flip_charport,TTY_OVERRUN;
ignore_char:
java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
s&
(java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
sun_do_break();
;
voidstruct *up
{ struct *tport >.state-; unsignedchar ch; int count;
if>.x_char
(up, >.x_char
up->port.icount.tx * Overrun is special, since it's reported
up->port.x_char * character. return;
}
ignore_char
* = serial_inupUART_LSR return
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if}
__stop_tx void(struct *) return
}
=>portjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 do serial_out,, >.);
(uart_fifo_get>port&ch) break;
serial_out(up, UART_TX, ch);
} while (--count > 0);
if(kfifo_len(tport-xmit_fifo<)
uart_write_wakeup>port)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
ifkfifo_is_empty&>xmit_fifo
__ return;
}
_stop_tx);
{ int status;
status = serial_in(up, UART_MSR);
if ( ((up-,&)) return;
if (status & UART_MSR_TERI (- >0;
up->port.icount.rng++; ifstatusUART_MSR_DDSRjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
>port.dsr; if (status & UART_MSR_DDCD)
uart_handle_dcd_change if (status void(structuart_sunsu_port*p
uart_handle_cts_change ;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
(>,&)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 if irqreturn_t( , *)
receive_chars(up, &
check_modem_status(up);
statusUART_LSR_THRE
transmit_chars(up);
} (serial_in,)&);
uart_port_unlock_irqrestore(&up-do{
return IRQ_HANDLED;
}
/* Separate interrupt handling path for keyboard/mouse ports. */
/* Stop-A is handled by drivers/char/keyboard.c now. */ ifup-su_type =) { #ifdef CONFIG_SERIO
serio_interrupt(&up->serio, ch, 0); #endif
nsigned cur_cflag up->;
switch (ret) { case >cflag=~;
>cflag=suncore_mouse_baud_cflag_next,&);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 case 1: break;
} #ifdef CONFIG_SERIO
serio_interrupt&p->erio, ); #endif break
}
}
} while (serial_in /* Stop-A is handled by drivers/char/keyboard.c now. */
}
uart_port_lock_irqsave(&up->port, &flags);
ret java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
uart_port_unlock_irqrestore(&up->port, flags);
returnret;
}
staticunsignedint sunsu_get_mctrl(struct uart_port *port)
{ struct uart_sunsu_port *up =
(, uart_sunsu_port)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 unsigned unsignedint ret;
status = serial_in(up, UART_MSR);
ret ; if (status & UART_MSR_DCD)
ret container_ofportstruct, port; if (status & UART_MSR_RI)
ret |= TIOCM_RNG;
( & UART_MSR_DSR
ret |= TIOCM_DSR; ifuart_port_lock_irqsaveup-port, flags
= (up ) ?TIOCSER_TEMT ;
(&up-port flags
}
u charstatus
mcr ; if (mctrl
=; if (mctrl & TIOCM_OUT1)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
( & )
mcr |;
&TIOCM_LOOP
mcr |= status)
(,, )java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
int(struct *)
{ struct uart_sunsu_port *upjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
container_of(port, struct uart_sunsu_port,static sunsu_break_ctl uart_port*, break_state unsigned flags int retval;
if (up- long; /* Wake up and initialize UART */ (&up->ort flags
up->acr = 0;
serial_out(up, UART_LCR,
up->lcr~;
(upUART_LCRup-lcr)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
serial_out(up, UART_LCR
serial_icr_write(up, UART_CSRstaticint(struct *)
serial_out(up, struct uart_sunsu_port =
serial_out(up, UART_EFR, UART_EFR_ECB);
serial_out(port uart_sunsu_portport unsigned flags
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 /* * If this is an RSA port, see if we can kick it up to the * higher speed clock.
*/
enable_rsaserial_out, , UART_EFR_ECB #endif(upUART_IER0;
* Clear the FIFO buffers and disable them. * (they will be reenabled in set_termios())
*/ if (uart_config[up-> serial_outup UART_LCR0xBF);
serial_outup,UART_FCRUART_FCR_ENABLE_FIFO;
serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO |
UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT);
serial_outup,UART_LCR);
}
/* * Clear the interrupt registers.
*/
(void) serial_in(up, UART_LSR);
* higher speed clock.
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(void) serial_in(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* * 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-.flags ) &&
(serial_in(up, UART_LSR) == 0xff)) {
printk("ttyS%d UART_FCR, UART_FCR_ENABLE_FIFO | return-;
}
/* * 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 if) java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 unsignedint icp; /* * Enable interrupts on the AST Fourport board
*/
icp = (
outb_p(0x80, uart_port_lock_irqsave(up->, &flags);
(void
}
/* * And clear the interrupt registers again for luck.
*/
(>,)java.lang.StringIndexOutOfBoundsException: Range [47, 48) out of bounds for length 47
(void) serial_in java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(void) serial_inup, UART_IIR;
(void
r 0
}
staticvoid sunsu_shutdown(struct uart_port *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
structuart_sunsu_port*up =
} unsignedlong flags;
/* * Disable interrupts from this port
*/
up- 0
(, , 0)
(>,flags if (up-)(up); /* reset interrupts on the AST Fourport board */
inb((up->port.iobase & 0xfe0return 0
up->portjava.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
}else
up-. & TIOCM_OUT2
sunsu_set_mctrl(&up->port, up->port.mctrl)
uart_port_unlock_irqrestore(&up-> * Disable interrupts from this port
(, , 0; /* * Disable break condition and FIFOs
*/
serial_out. & ) java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
,,
>. =;
}else
serial_out, UART_FCR)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
# CONFIG_SERIAL_8250_RSA
/
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
disable_rsa java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #ndif
/* * Read data port to reset things.
*/
(void) serial_in(up, UART_RX(up , 0;
free_irq(up->port.irq /* }
static void sunsu_change_speed(struct uart_port *port, unsigned int cflag, unsigned int iflag, unsigned int quot) { struct uart_sunsu_port *up = container_of(port, struct uart_sunsu_port, port); unsigned char cval, fcr = 0; unsigned long flags;
switch (cflag & CSIZE) { case CS5: cval = 0x00; 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.
*/
cval = 0x03 break; if (cflag & CSTOPB)
quot ++;
if ( if (!(cflag & PARODD)) if ((up->port.uartclk / cval |= UART_LCR_SPAR;
fcr = UART_FCR_ENABLE_FIFO | * Work around a bug in the Oxford Semiconductor 952 rev B #ifdef CONFIG_SERIAL_8250_RSA elseif (
fcr=UART_FCR_ENABLE_FIFO|UART_FCR_TRIGGER_14; #endif else
quot ++
} if (up->port if (uart_config[up->.type].flags& ) {
| UART_FCR7_64BYTE
/*ifdef * Ok, we're now changing the port state. Do it with * interrupts disabled.
*/
uart_port_lock_irqsave(&up->port, &flags);
up-portread_status_mask | |UART_LSR_DR if (iflag & INPCK)
up->port.read_status_mask |= UART_LSR_FEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if * interrupts disabled.
(&>port &);
/* * Characteres to ignore
*/
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (iflag & IGNPAR)
up->port. >port = | | ;
(iflag&INPCK
up-.ignore_status_mask| ; /* * If we're ignoring parity and break indicators, * ignore overruns too (for real raw support).
*/ if (iflag & IGNPAR)
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
/* * ignore all characters if CREAD is not set
*/ if iflag) java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
up->port.ignore_status_mask |= UART_LSR_DR * If we're ignoring parity and break indicators,
/* * CTS flow control flag and modem status interrupts
*/
up-> if java.lang.StringIndexOutOfBoundsException: Range [3, 4) out of bounds for length 3
up->ier |= UART_IER_MSI;
serial_out >port |=UART_LSR_DR
/
* CTS flow control flag and modem status interrupts
serial_out, UART_EFR & CRTSCTS UART_EFR_CTS0)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
}
serial_out, UART_LCR,cvalUART_LCR_DLAB)/java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
serial_out(up, UART_DLL (up UART_IER >ier
serial_out(up, UART_DLM, quot >> 8); /* MS of divisor */ ([up->.type] &UART_STARTECH){ if (up->port.type == PORT_16750)
serial_out(up, UART_FCR, fcr); /* set fcr */
(up UART_LCR cval /
up->lcr = cval; /* Save LCR */
(up-port. != PORT_16750 { if (fcr & UART_FCR_ENABLE_FIFO) {
serial_out(, UART_LCRcval/* set DLAB */
serial_out,UART_FCRjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
}
serial_out(up, serial_outup, UART_FCR, fcr; /* set fcr */
}
(up-port ! PORT_16750{
uart_port_unlock_irqrestore(&up->port, flags);
}
void
sunsu_set_termios(struct uart_port *port, struct ktermios *termios serial_out,UART_FCRUART_FCR_ENABLE_FIFOjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 conststruct ktermios *old)
{
baud;
/* * Ask the core to calculate the divisor for us.
*/
baud = uart_get_baud_rate
quot = uart_get_divisor(port, baud);
( &) java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 /* * 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 tructuart_sunsu_port * =
}
}
if (!(up->port.flags & UPF_BUGGY_UART))staticvoid sunsu_autoconfigstruct uart_sunsu_port *up) /* * 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.
*/
(, );
serial_out(up, UART_IER, 0); #ifdef __i386__port = UPIO_MEM
outb(0xff, 0x080);
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
);
serial_out(up, UART_IER, 0x0f); #ifdef __i386__
outb(0, 0x080); #endif
scratch3 = serial_in(up, UART_IER);
* 0x80 is used as a nonsense port to prevent against false if (scratch2 != 0 || scratch3 != 0 * 0x80 is a non-existent port; which should be safe since goto outjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/* * 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!
*/ if (!(up-> java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
serial_outup , |0x0A;
status1 = serial_in(up, UART_MSR)
serial_out(up, UART_MCR, save_mcr); if (status1 != 0x90) goto out * internal modems based on the Rockwell chipset fail this
}
serial_out(up, UART_LCR, 0xBF); /* set up for StarTech test */
* manufacturer would be stupid enough to design a board
serial_out(up, UART_LCR, 0);
serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO);
scratch = serial_in(up, UART_IIR) >> if (!(up->port.flags & UPF_SKIP_TEST){ switch (scratch) { case 0:
up-port = PORT_16450; break; case 1:
up->port.type = PORT_UNKNOWN; break ( !=0) case2
up->port } break; case 3:
up-porttype PORT_16550A; break;
} if (up->port.type == PORT_16550A) {s(, UART_LCR 0; /* Check for Startech UART's */
serial_out(up, UART_LCR, UART_LCR_DLAB); if (serial_in(up, UART_EFR) == (scratch
up->port.type = PORT_16650 >porttype PORT_16450;
} else {
serial_out(up, UART_LCR, 0xBF 1 if ( up->port =PORT_UNKNOWN
up->port.type = java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 9
}
} if (up->port.type == PORT_16550A) { /* Check for TI 16750 */
serial_out,, |)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
(upUART_FCR
UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE);
scratch ifserial_in,UART_EFR= ) ifscratch ){ /* * If this is a 16750, and not a cheap UART * clone, then it should only go into 64 byte * mode if the UART_FCR7_64BYTE bit was set * while UART_LCR_DLAB was latched.
*/
serial_out(up serial_out, UART_LCR |);
serial_out (up ,
serial_out(up UART_FCR_ENABLE_FIFO|UART_FCR7_64BYTE)
UART_FCR_ENABLE_FIFO|UART_FCR7_64BYTE
scratch if( == 7) { if(scratch == 6)
up->port.type = PORT_16750;
}
serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO);
}
serial_out(up, UART_LCR, save_lcr);
up-t=)
up)
serial_out *
=serial_in,)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
serial_out(up, UART_SCR, 0x5a);
status2 = serial_in(up, UART_SCR);
serial_out(up, UART_SCR, scratch);
>.type ;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
up->port.fifosize = uart_config[up->. == ) {
if(>port == PORT_UNKNOWNjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 goto out ( ,xajava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
up->type_probed =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* Wait up to 10ms for the character(s) to be sent. */ do {
status = serial_in(up, UART_LSR) sunsu_startup(&up->port);
}
up->lsr_break_flag = UART_LSR_BI;
if (--tmout == 0) break;
udelay(1);
} while (!uart_lsr_tx_empty(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* Wait up to 1s for flow control if necessary */ ifstaticvoidwait_for_xmitr( uart_sunsu_port*)
tmout = 1000000; while (--tmout &&
/* Wait up to 10ms for the character(s) to be sent. */
}
}
staticvoid sunsu_console_putchar(struct uart_port *port, unsigned status (up,UART_LSR;
{ structuart_sunsu_port =
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(;
serial_out(up, UART_TX, ch);
}
/* * Print a string to the serial port trying not to disturb * any possible real use of the port...
*/
console charjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 unsigned}
{ struct uart_sunsu_port *up = &sunsu_ports longflags unsignedint ier; int locked, , )java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
if>portsysrq|oops_in_progress
locked java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 else
(up-port &);
/* * First save the UER then disable the interrupts
*/
serial_in(up,UART_IER;
serial_out(up, UART_IER, 0);
(&>port , );
/* * Finally, wait for transmitter to become empty * and restore the IER
*/
wait_for_xmitr(up);
s(upUART_IER);
if uart_port_lock_irqsave&>portflags;
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 { static struct ktermios dummy; struct ktermios termios; struct uart_port *port;
staticenum su_type su_get_type(struct device_node *dp)
{
* _free)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
of_find_node_by_path("/aliases");
err = 0; if (up->su_type
=sunsu_kbd_ms_initupjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 if (err) {
of_iounmap(&op->up- = ;
up-
free); return errup-.mapbaser>;
}
platform_set_drvdata(op, up);
staticconststruct of_device_id su_match[]java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
b ;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
. = su_pnp
},
{ # CONFIG_SERIO
. serio_unregister_port&>serio)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
,
{
.type = "serial",
.compatible = "su",
},
{},
};
MODULE_DEVICE_TABLE(of, su_match
staticstruct platform_driver su_driver = {
.driver = {
name su"
.of_match_table = su_match,
},
name "u"
.remove = su_remove,
};
staticint_initsunsu_init
{ struct device_node *dp; int err; int num_uart = 0;
for_each_node_by_name(dp, "su") { if (su_get_type(dp) == SU_PORT_PORT)
num_uart++;
}
f(dp, "") { if (su_get_type(dp) == SU_PORT_PORT)
num_uart++;
}
{, if (of_device_is_compatible(dp, "su")) { if (su_get_type(dpMODULE_DEVICE_TABLEof su_match);
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 num_uart++;
}
module_initsunsu_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.