Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267310
b: refs/heads/master
c: 83cac9f
h: refs/heads/master
v: v3
  • Loading branch information
Bernhard Roth authored and Greg Kroah-Hartman committed Aug 24, 2011
1 parent 4315abf commit 1d579ef
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 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: 019dc9ea8d528eb3640bbba604e1e5a2f6994b1f
refs/heads/master: 83cac9f3b45ba8e99c5305be42c67f1c83adf0aa
3 changes: 3 additions & 0 deletions trunk/Documentation/serial/serial-rs485.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@
rs485conf.flags |= SER_RS485_RTS_AFTER_SEND;
rs485conf.delay_rts_after_send = ...;

/* Set this flag if you want to receive data even whilst sending data */
rs485conf.flags |= SER_RS485_RX_DURING_TX;

if (ioctl (fd, TIOCSRS485, &rs485conf) < 0) {
/* Error handling. See errno. */
}
Expand Down
9 changes: 6 additions & 3 deletions trunk/drivers/tty/serial/atmel_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ static void atmel_stop_tx(struct uart_port *port)
/* Disable interrupts */
UART_PUT_IDR(port, atmel_port->tx_done_mask);

if (atmel_port->rs485.flags & SER_RS485_ENABLED)
if ((atmel_port->rs485.flags & SER_RS485_ENABLED) &&
!(atmel_port->rs485.flags & SER_RS485_RX_DURING_TX))
atmel_start_rx(port);
}

Expand All @@ -356,7 +357,8 @@ static void atmel_start_tx(struct uart_port *port)
really need this.*/
return;

if (atmel_port->rs485.flags & SER_RS485_ENABLED)
if ((atmel_port->rs485.flags & SER_RS485_ENABLED) &&
!(atmel_port->rs485.flags & SER_RS485_RX_DURING_TX))
atmel_stop_rx(port);

/* re-enable PDC transmit */
Expand Down Expand Up @@ -680,7 +682,8 @@ static void atmel_tx_dma(struct uart_port *port)
/* Enable interrupts */
UART_PUT_IER(port, atmel_port->tx_done_mask);
} else {
if (atmel_port->rs485.flags & SER_RS485_ENABLED) {
if ((atmel_port->rs485.flags & SER_RS485_ENABLED) &&
!(atmel_port->rs485.flags & SER_RS485_RX_DURING_TX)) {
/* DMA done, stop TX, start RX for RS485 */
atmel_start_rx(port);
}
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ struct serial_rs485 {
#define SER_RS485_RTS_ON_SEND (1 << 1)
#define SER_RS485_RTS_AFTER_SEND (1 << 2)
#define SER_RS485_RTS_BEFORE_SEND (1 << 3)
#define SER_RS485_RX_DURING_TX (1 << 4)
__u32 delay_rts_before_send; /* Milliseconds */
__u32 delay_rts_after_send; /* Milliseconds */
__u32 padding[5]; /* Memory is cheap, new structs
Expand Down

0 comments on commit 1d579ef

Please sign in to comment.