Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24944
b: refs/heads/master
c: a58e00e
h: refs/heads/master
v: v3
  • Loading branch information
Jesper Juhl authored and Linus Torvalds committed Mar 31, 2006
1 parent ba2e061 commit 634b413
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a244e1698ae3609cdfe24088e1293593cb7a5278
refs/heads/master: a58e00e7da5f93c096527f5e20ceb2cf6d130cf0
29 changes: 17 additions & 12 deletions trunk/drivers/serial/jsm/jsm_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,14 @@ static void jsm_tty_send_xchar(struct uart_port *port, char ch)
{
unsigned long lock_flags;
struct jsm_channel *channel = (struct jsm_channel *)port;
struct termios *termios;

spin_lock_irqsave(&port->lock, lock_flags);
if (ch == port->info->tty->termios->c_cc[VSTART])
termios = port->info->tty->termios;
if (ch == termios->c_cc[VSTART])
channel->ch_bd->bd_ops->send_start_character(channel);

if (ch == port->info->tty->termios->c_cc[VSTOP])
if (ch == termios->c_cc[VSTOP])
channel->ch_bd->bd_ops->send_stop_character(channel);
spin_unlock_irqrestore(&port->lock, lock_flags);
}
Expand Down Expand Up @@ -178,6 +180,7 @@ static int jsm_tty_open(struct uart_port *port)
struct jsm_board *brd;
int rc = 0;
struct jsm_channel *channel = (struct jsm_channel *)port;
struct termios *termios;

/* Get board pointer from our array of majors we have allocated */
brd = channel->ch_bd;
Expand Down Expand Up @@ -239,12 +242,13 @@ static int jsm_tty_open(struct uart_port *port)
channel->ch_cached_lsr = 0;
channel->ch_stops_sent = 0;

channel->ch_c_cflag = port->info->tty->termios->c_cflag;
channel->ch_c_iflag = port->info->tty->termios->c_iflag;
channel->ch_c_oflag = port->info->tty->termios->c_oflag;
channel->ch_c_lflag = port->info->tty->termios->c_lflag;
channel->ch_startc = port->info->tty->termios->c_cc[VSTART];
channel->ch_stopc = port->info->tty->termios->c_cc[VSTOP];
termios = port->info->tty->termios;
channel->ch_c_cflag = termios->c_cflag;
channel->ch_c_iflag = termios->c_iflag;
channel->ch_c_oflag = termios->c_oflag;
channel->ch_c_lflag = termios->c_lflag;
channel->ch_startc = termios->c_cc[VSTART];
channel->ch_stopc = termios->c_cc[VSTOP];

/* Tell UART to init itself */
brd->bd_ops->uart_init(channel);
Expand Down Expand Up @@ -784,6 +788,7 @@ static void jsm_carrier(struct jsm_channel *ch)

void jsm_check_queue_flow_control(struct jsm_channel *ch)
{
struct board_ops *bd_ops = ch->ch_bd->bd_ops;
int qleft = 0;

/* Store how much space we have left in the queue */
Expand All @@ -809,7 +814,7 @@ void jsm_check_queue_flow_control(struct jsm_channel *ch)
/* HWFLOW */
if (ch->ch_c_cflag & CRTSCTS) {
if(!(ch->ch_flags & CH_RECEIVER_OFF)) {
ch->ch_bd->bd_ops->disable_receiver(ch);
bd_ops->disable_receiver(ch);
ch->ch_flags |= (CH_RECEIVER_OFF);
jsm_printk(READ, INFO, &ch->ch_bd->pci_dev,
"Internal queue hit hilevel mark (%d)! Turning off interrupts.\n",
Expand All @@ -819,7 +824,7 @@ void jsm_check_queue_flow_control(struct jsm_channel *ch)
/* SWFLOW */
else if (ch->ch_c_iflag & IXOFF) {
if (ch->ch_stops_sent <= MAX_STOPS_SENT) {
ch->ch_bd->bd_ops->send_stop_character(ch);
bd_ops->send_stop_character(ch);
ch->ch_stops_sent++;
jsm_printk(READ, INFO, &ch->ch_bd->pci_dev,
"Sending stop char! Times sent: %x\n", ch->ch_stops_sent);
Expand All @@ -846,7 +851,7 @@ void jsm_check_queue_flow_control(struct jsm_channel *ch)
/* HWFLOW */
if (ch->ch_c_cflag & CRTSCTS) {
if (ch->ch_flags & CH_RECEIVER_OFF) {
ch->ch_bd->bd_ops->enable_receiver(ch);
bd_ops->enable_receiver(ch);
ch->ch_flags &= ~(CH_RECEIVER_OFF);
jsm_printk(READ, INFO, &ch->ch_bd->pci_dev,
"Internal queue hit lowlevel mark (%d)! Turning on interrupts.\n",
Expand All @@ -856,7 +861,7 @@ void jsm_check_queue_flow_control(struct jsm_channel *ch)
/* SWFLOW */
else if (ch->ch_c_iflag & IXOFF && ch->ch_stops_sent) {
ch->ch_stops_sent = 0;
ch->ch_bd->bd_ops->send_start_character(ch);
bd_ops->send_start_character(ch);
jsm_printk(READ, INFO, &ch->ch_bd->pci_dev, "Sending start char!\n");
}
}
Expand Down

0 comments on commit 634b413

Please sign in to comment.