本文整理汇总了C++中serial_paranoia_check函数的典型用法代码示例。如果您正苦于以下问题:C++ serial_paranoia_check函数的具体用法?C++ serial_paranoia_check怎么用?C++ serial_paranoia_check使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了serial_paranoia_check函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: rs_flush_buffer
static void rs_flush_buffer(struct tty_struct *tty)
{
struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
unsigned long flags;
if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
return;
local_irq_save(flags);
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
local_irq_restore(flags);
tty_wakeup(tty);
}
开发者ID:kprog,项目名称:linux,代码行数:12,代码来源:68328serial.c
示例2: rs_throttle
/*
* ------------------------------------------------------------
* rs_throttle()
*
* This routine is called by the upper-layer tty layer to signal that
* incoming characters should be throttled.
* ------------------------------------------------------------
*/
static void rs_throttle(struct tty_struct * tty)
{
struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
if (serial_paranoia_check(info, tty->name, "rs_throttle"))
return;
if (I_IXOFF(tty))
info->x_char = STOP_CHAR(tty);
/* Turn off RTS line (do this atomic) */
}
开发者ID:kprog,项目名称:linux,代码行数:20,代码来源:68328serial.c
示例3: rs_write_room
static int rs_write_room(struct tty_struct *tty)
{
struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
int ret;
if (serial_paranoia_check(info, tty->name, "rs_write_room"))
return 0;
ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
if (ret < 0)
ret = 0;
return ret;
}
开发者ID:kprog,项目名称:linux,代码行数:12,代码来源:68328serial.c
示例4: rs_360_write
static int rs_360_write(struct tty_struct * tty,
const unsigned char *buf, int count)
{
int c, ret = 0;
ser_info_t *info = (ser_info_t *)tty->driver_data;
volatile QUICC_BD *bdp;
#ifdef CONFIG_KGDB
/* Try to let stub handle output. Returns true if it did. */
if (kgdb_output_string(buf, count))
return ret;
#endif
if (serial_paranoia_check(info, tty->name, "rs_write"))
return 0;
if (!tty)
return 0;
bdp = info->tx_cur;
while (1) {
c = min(count, TX_BUF_SIZE);
if (c <= 0)
break;
if (bdp->status & BD_SC_READY) {
info->flags |= TX_WAKEUP;
break;
}
/* memcpy(__va(bdp->buf), buf, c); */
memcpy((void *)bdp->buf, buf, c);
bdp->length = c;
bdp->status |= BD_SC_READY;
buf += c;
count -= c;
ret += c;
/* Get next BD.
*/
if (bdp->status & BD_SC_WRAP)
bdp = info->tx_bd_base;
else
bdp++;
info->tx_cur = (QUICC_BD *)bdp;
}
return ret;
}
开发者ID:joka90,项目名称:htc-kernel-msm7227,代码行数:52,代码来源:68360serial.c
示例5: rs_360_flush_buffer
static void rs_360_flush_buffer(struct tty_struct *tty)
{
ser_info_t *info = (ser_info_t *)tty->driver_data;
if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
return;
/* There is nothing to "flush", whatever we gave the CPM
* is on its way out.
*/
tty_wakeup(tty);
info->flags &= ~TX_WAKEUP;
}
开发者ID:joka90,项目名称:htc-kernel-msm7227,代码行数:13,代码来源:68360serial.c
示例6: rs_stop
/*
* ------------------------------------------------------------
* rs_stop() and rs_start()
*
* This routines are called before setting or resetting tty->stopped.
* They enable or disable transmitter interrupts, as necessary.
* ------------------------------------------------------------
*/
static void rs_stop(struct tty_struct *tty)
{
struct NIOS_serial *info = (struct NIOS_serial *)tty->driver_data;
np_uart * uart= (np_uart *)(info->port);
unsigned long flags;
if (serial_paranoia_check(info, tty->device, "rs_stop"))
return;
save_flags(flags); cli();
uart->np_uartcontrol &= ~np_uartcontrol_itrdy_mask;
restore_flags(flags);
}
开发者ID:ProjectZeroSlackr,项目名称:linux-2.4.32-ipod,代码行数:21,代码来源:NIOSserial.c
示例7: xmbrs_start
static void xmbrs_start(struct tty_struct *tty)
{
volatile unsigned int *uartp;
struct xmb_serial *info = (struct xmb_serial *)tty->driver_data;
unsigned long flags;
if (serial_paranoia_check(info, tty->device, "xmbrs_start"))
return;
uartp = (volatile unsigned int *) info->addr;
save_flags_cli(flags);
EnableInterrupts(uartp);
restore_flags(flags);
}
开发者ID:ProjectZeroSlackr,项目名称:linux-2.4.32-ipod,代码行数:13,代码来源:xmbserial.c
示例8: rs_start
static void rs_start(struct tty_struct *tty)
{
struct LEON_serial *info = (struct LEON_serial *)tty->driver_data;
unsigned long flags;
if (serial_paranoia_check(info, tty->device, "rs_start"))
return;
save_flags(flags); cli();
if (info->xmit_cnt && info->xmit_buf && !(leon->uartctrl1 & UCTRL_TE))
leon->uartctrl1 |= UCTRL_TE | UCTRL_TI;
restore_flags(flags);
}
开发者ID:robacklin,项目名称:uclinux-linux,代码行数:13,代码来源:LEONserial.c
示例9: rs_flush_buffer
static void rs_flush_buffer(struct tty_struct *tty)
{
struct cnxt_serial *info = (struct cnxt_serial *)tty->driver_data;
if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
return;
cli();
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
sti();
wake_up_interruptible(&tty->write_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
}
开发者ID:ProjectZeroSlackr,项目名称:linux-2.4.32-ipod,代码行数:13,代码来源:cnxtserial.c
示例10: rs_stop
static void rs_stop(struct tty_struct *tty)
{
struct cnxt_serial *info = (struct cnxt_serial *)tty->driver_data;
if (serial_paranoia_check(info, tty->device, "rs_stop"))
return;
#if 0
save_flags(flags); cli();
tx_stop(info->uart);
restore_flags(flags);
#endif
}
开发者ID:ProjectZeroSlackr,项目名称:linux-2.4.32-ipod,代码行数:13,代码来源:cnxtserial.c
示例11: rs_stop
/*
* ------------------------------------------------------------
* rs_stop() and rs_start()
*
* This routines are called before setting or resetting tty->stopped.
* They enable or disable transmitter interrupts, as necessary.
* ------------------------------------------------------------
*/
static void rs_stop(struct tty_struct *tty)
{
struct bf535_serial *info = (struct bf535_serial *)tty->driver_data;
unsigned long flags = 0;
unsigned int idx = (unsigned int) info->hub2;
if (serial_paranoia_check(info, tty->device, "rs_stop"))
return;
save_flags(flags); cli();
ACCESS_PORT_IER(idx) /* Change access to IER & data port */
UART_IER(idx) = 0;
restore_flags(flags);
}
开发者ID:ProjectZeroSlackr,项目名称:linux-2.4.32-ipod,代码行数:22,代码来源:bf535_serial.c
示例12: rs_start
static void rs_start(struct tty_struct *tty)
{
struct s3c3410_serial *info = (struct s3c3410_serial *) tty->driver_data;
unsigned long flags = 0;
if (serial_paranoia_check(info, tty->device, "rs_start"))
return;
save_flags(flags);
cli();
rx_start(info->use_ints);
tx_start(info->use_ints);
restore_flags(flags);
}
开发者ID:BackupTheBerlios,项目名称:wl530g-svn,代码行数:14,代码来源:serial_s3c3410.c
示例13: rs_open
/*
* This routine is called whenever a serial port is opened. It
* enables interrupts for a serial port, linking in its S structure into
* the IRQ chain. It also performs the serial-specific
* initialization for the tty structure.
*/
int rs_open(struct tty_struct *tty, struct file * filp)
{
int retval, line;
struct cnxt_serial *info;
line = MINOR(tty->device) - tty->driver.minor_start;
if (line != 0) /* we have exactly one */
return -ENODEV;
info = &uart_info;
if (serial_paranoia_check(info, tty->device, "rs_open"))
return -ENODEV;
info->count++;
tty->driver_data = info;
info->tty = tty;
/*
* Start up serial port
*/
retval = startup(info);
if (retval)
return retval;
retval = block_til_ready(tty, filp, info);
if (retval) {
printk("rs_open returning after block_til_ready with %d\n",
retval);
return retval;
}
if ((info->count == 1) && (info->flags & S_SPLIT_TERMIOS)) {
if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
*tty->termios = info->normal_termios;
else
*tty->termios = info->callout_termios;
change_speed(info);
}
info->session = current->session;
info->pgrp = current->pgrp;
// Enable GPIO interrupt line for console uart
SetGPIOIntEnable(GPIOINT_UART1, IRQ_ON);
return 0;
}
开发者ID:ProjectZeroSlackr,项目名称:linux-2.4.32-ipod,代码行数:56,代码来源:cnxtserial.c
示例14: rs_start
static void rs_start(struct tty_struct *tty)
{
unsigned long flags;
struct cnxt_serial *info = (struct cnxt_serial *)tty->driver_data;
if (serial_paranoia_check(info,tty->device, "rs_start"))
return;
save_flags(flags);
cli();
tx_start(info->uart, info->use_ints);
start_rx();
restore_flags(flags);
}
开发者ID:ProjectZeroSlackr,项目名称:linux-2.4.32-ipod,代码行数:14,代码来源:cnxtserial.c
示例15: rs_hangup
/*
* rs_hangup() --- called by tty_hangup() when a hangup is signaled.
*/
void rs_hangup(struct tty_struct *tty)
{
struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
if (serial_paranoia_check(info, tty->name, "rs_hangup"))
return;
rs_flush_buffer(tty);
shutdown(info, tty);
info->tport.count = 0;
info->tport.flags &= ~ASYNC_NORMAL_ACTIVE;
tty_port_tty_set(&info->tport, NULL);
wake_up_interruptible(&info->tport.open_wait);
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:17,代码来源:68328serial.c
示例16: rs_hangup
/*
* rs_hangup() --- called by tty_hangup() when a hangup is signaled.
*/
static void rs_hangup(struct tty_struct *tty)
{
struct serial_state *info = tty->driver_data;
if (serial_paranoia_check(info, tty->name, "rs_hangup"))
return;
rs_flush_buffer(tty);
shutdown(tty, info);
info->tport.count = 0;
info->tport.flags &= ~ASYNC_NORMAL_ACTIVE;
info->tport.tty = NULL;
wake_up_interruptible(&info->tport.open_wait);
}
开发者ID:kprog,项目名称:linux,代码行数:17,代码来源:amiserial.c
示例17: mcfrs_write
static int mcfrs_write(struct tty_struct * tty,
const unsigned char *buf, int count)
{
volatile unsigned char *uartp;
struct mcf_serial *info = (struct mcf_serial *)tty->driver_data;
unsigned long flags;
int c, total = 0;
#if 0
printk("%s(%d): mcfrs_write(tty=%x,buf=%x,count=%d)\n",
__FILE__, __LINE__, (int)tty, (int)buf, count);
#endif
if (serial_paranoia_check(info, tty->name, "mcfrs_write"))
return 0;
if (!tty || !info->xmit_buf)
return 0;
local_save_flags(flags);
while (1) {
local_irq_disable();
c = min(count, (int) min(((int)SERIAL_XMIT_SIZE) - info->xmit_cnt - 1,
((int)SERIAL_XMIT_SIZE) - info->xmit_head));
local_irq_restore(flags);
if (c <= 0)
break;
memcpy(info->xmit_buf + info->xmit_head, buf, c);
local_irq_disable();
info->xmit_head = (info->xmit_head + c) & (SERIAL_XMIT_SIZE-1);
info->xmit_cnt += c;
local_irq_restore(flags);
buf += c;
count -= c;
total += c;
}
local_irq_disable();
uartp = info->addr;
info->imr |= MCFUART_UIR_TXREADY;
uartp[MCFUART_UIMR] = info->imr;
local_irq_restore(flags);
return total;
}
开发者ID:LouZiffer,项目名称:m900_kernel_cupcake-SDX,代码行数:49,代码来源:mcfserial.c
示例18: xmbrs_open
/*
* This routine is called whenever a serial port is opened. It
* enables interrupts for a serial port, linking in its structure into
* the IRQ chain. It also performs the serial-specific
* initialization for the tty structure.
*/
int xmbrs_open(struct tty_struct *tty, struct file * filp)
{
struct xmb_serial *info;
int retval, line;
line = MINOR(tty->device) - tty->driver.minor_start;
if ((line < 0) || (line >= NR_PORTS))
return -ENODEV;
info = xmbrs_table + line;
if (serial_paranoia_check(info, tty->device, "xmbrs_open"))
return -ENODEV;
#ifdef SERIAL_DEBUG_OPEN
printk("xmbrs_open ttyS%d, count = %d\n", info->line, info->count);
#endif
info->count++;
tty->driver_data = info;
info->tty = tty;
/*
* Start up serial port
*/
retval = startup(info);
if (retval)
return retval;
retval = block_til_ready(tty, filp, info);
if (retval) {
#ifdef SERIAL_DEBUG_OPEN
printk("xmbrs_open returning after block_til_ready with %d\n",
retval);
#endif
return retval;
}
if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) {
if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
*tty->termios = info->normal_termios;
else
*tty->termios = info->callout_termios;
}
info->session = current->session;
info->pgrp = current->pgrp;
#ifdef SERIAL_DEBUG_OPEN
printk("xmbrs_open ttyS%d successful...\n", info->line);
#endif
return 0;
}
开发者ID:ProjectZeroSlackr,项目名称:linux-2.4.32-ipod,代码行数:55,代码来源:xmbserial.c
示例19: xmbrs_hangup
/*
* xmbrs_hangup() --- called by tty_hangup() when a hangup is signaled.
*/
void xmbrs_hangup(struct tty_struct *tty)
{
struct xmb_serial * info = (struct xmb_serial *)tty->driver_data;
if (serial_paranoia_check(info, tty->device, "xmbrs_hangup"))
return;
xmbrs_flush_buffer(tty);
shutdown(info);
info->event = 0;
info->count = 0;
info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE);
info->tty = 0;
wake_up_interruptible(&info->open_wait);
}
开发者ID:ProjectZeroSlackr,项目名称:linux-2.4.32-ipod,代码行数:18,代码来源:xmbserial.c
示例20: rs_set_ldisc
static void rs_set_ldisc(struct tty_struct *tty)
{
struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
if (serial_paranoia_check(info, tty->name, "rs_set_ldisc"))
return;
info->is_cons = (tty->termios->c_line == N_TTY);
#ifdef CONFIG_DEBUG_PRINTK
printk("ttyS%d console mode %s\n", info->line, info->is_cons ? "on" : "off");
#else
;
#endif
}
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:15,代码来源:68328serial.c
注:本文中的serial_paranoia_check函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论