Commit 8b07d521 authored by Lidza Louina's avatar Lidza Louina Committed by Greg Kroah-Hartman

staging: dgnc: tty.c: removes trailing whitespace

This patch removes trailing whitespace in
the dgnc_tty.c file.
Signed-off-by: default avatarLidza Louina <lidza.louina@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cfa4ccc9
...@@ -17,22 +17,22 @@ ...@@ -17,22 +17,22 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* *
* NOTE TO LINUX KERNEL HACKERS: DO NOT REFORMAT THIS CODE! * NOTE TO LINUX KERNEL HACKERS: DO NOT REFORMAT THIS CODE!
* *
* This is shared code between Digi's CVS archive and the * This is shared code between Digi's CVS archive and the
* Linux Kernel sources. * Linux Kernel sources.
* Changing the source just for reformatting needlessly breaks * Changing the source just for reformatting needlessly breaks
* our CVS diff history. * our CVS diff history.
* *
* Send any bug fixes/changes to: Eng.Linux at digi dot com. * Send any bug fixes/changes to: Eng.Linux at digi dot com.
* Thank you. * Thank you.
*/ */
/************************************************************************ /************************************************************************
* *
* This file implements the tty driver functionality for the * This file implements the tty driver functionality for the
* Neo and ClassicBoard PCI based product lines. * Neo and ClassicBoard PCI based product lines.
* *
************************************************************************ ************************************************************************
* *
* $Id: dgnc_tty.c,v 1.5 2013/04/30 19:18:30 markh Exp $ * $Id: dgnc_tty.c,v 1.5 2013/04/30 19:18:30 markh Exp $
...@@ -165,11 +165,11 @@ static const struct tty_operations dgnc_tty_ops = { ...@@ -165,11 +165,11 @@ static const struct tty_operations dgnc_tty_ops = {
}; };
/************************************************************************ /************************************************************************
* *
* TTY Initialization/Cleanup Functions * TTY Initialization/Cleanup Functions
* *
************************************************************************/ ************************************************************************/
/* /*
* dgnc_tty_preinit() * dgnc_tty_preinit()
* *
...@@ -213,7 +213,7 @@ int dgnc_tty_register(struct board_t *brd) ...@@ -213,7 +213,7 @@ int dgnc_tty_register(struct board_t *brd)
memset(&brd->PrintDriver, 0, sizeof(struct tty_driver)); memset(&brd->PrintDriver, 0, sizeof(struct tty_driver));
brd->SerialDriver.magic = TTY_DRIVER_MAGIC; brd->SerialDriver.magic = TTY_DRIVER_MAGIC;
snprintf(brd->SerialName, MAXTTYNAMELEN, "tty_dgnc_%d_", brd->boardnum); snprintf(brd->SerialName, MAXTTYNAMELEN, "tty_dgnc_%d_", brd->boardnum);
brd->SerialDriver.name = brd->SerialName; brd->SerialDriver.name = brd->SerialName;
...@@ -221,15 +221,15 @@ int dgnc_tty_register(struct board_t *brd) ...@@ -221,15 +221,15 @@ int dgnc_tty_register(struct board_t *brd)
brd->SerialDriver.major = 0; brd->SerialDriver.major = 0;
brd->SerialDriver.minor_start = 0; brd->SerialDriver.minor_start = 0;
brd->SerialDriver.num = brd->maxports; brd->SerialDriver.num = brd->maxports;
brd->SerialDriver.type = TTY_DRIVER_TYPE_SERIAL; brd->SerialDriver.type = TTY_DRIVER_TYPE_SERIAL;
brd->SerialDriver.subtype = SERIAL_TYPE_NORMAL; brd->SerialDriver.subtype = SERIAL_TYPE_NORMAL;
brd->SerialDriver.init_termios = DgncDefaultTermios; brd->SerialDriver.init_termios = DgncDefaultTermios;
brd->SerialDriver.driver_name = DRVSTR; brd->SerialDriver.driver_name = DRVSTR;
brd->SerialDriver.flags = (TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_HARDWARE_BREAK); brd->SerialDriver.flags = (TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_HARDWARE_BREAK);
/* /*
* The kernel wants space to store pointers to * The kernel wants space to store pointers to
* tty_struct's and termios's. * tty_struct's and termios's.
*/ */
brd->SerialDriver.ttys = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct tty_struct *), GFP_KERNEL); brd->SerialDriver.ttys = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct tty_struct *), GFP_KERNEL);
if (!brd->SerialDriver.ttys) if (!brd->SerialDriver.ttys)
...@@ -279,7 +279,7 @@ int dgnc_tty_register(struct board_t *brd) ...@@ -279,7 +279,7 @@ int dgnc_tty_register(struct board_t *brd)
brd->PrintDriver.major = brd->SerialDriver.major; brd->PrintDriver.major = brd->SerialDriver.major;
brd->PrintDriver.minor_start = 0x80; brd->PrintDriver.minor_start = 0x80;
brd->PrintDriver.num = brd->maxports; brd->PrintDriver.num = brd->maxports;
brd->PrintDriver.type = TTY_DRIVER_TYPE_SERIAL; brd->PrintDriver.type = TTY_DRIVER_TYPE_SERIAL;
brd->PrintDriver.subtype = SERIAL_TYPE_NORMAL; brd->PrintDriver.subtype = SERIAL_TYPE_NORMAL;
brd->PrintDriver.init_termios = DgncDefaultTermios; brd->PrintDriver.init_termios = DgncDefaultTermios;
brd->PrintDriver.driver_name = DRVSTR; brd->PrintDriver.driver_name = DRVSTR;
...@@ -459,7 +459,7 @@ void dgnc_tty_post_uninit(void) ...@@ -459,7 +459,7 @@ void dgnc_tty_post_uninit(void)
* dgnc_tty_uninit() * dgnc_tty_uninit()
* *
* Uninitialize the TTY portion of this driver. Free all memory and * Uninitialize the TTY portion of this driver. Free all memory and
* resources. * resources.
*/ */
void dgnc_tty_uninit(struct board_t *brd) void dgnc_tty_uninit(struct board_t *brd)
{ {
...@@ -567,7 +567,7 @@ void dgnc_sniff_nowait_nolock(struct channel_t *ch, uchar *text, uchar *buf, int ...@@ -567,7 +567,7 @@ void dgnc_sniff_nowait_nolock(struct channel_t *ch, uchar *text, uchar *buf, int
if (n == 0) { if (n == 0) {
return; return;
} }
/* /*
* Copy as much data as will fit. * Copy as much data as will fit.
*/ */
...@@ -630,7 +630,7 @@ static void dgnc_wmove(struct channel_t *ch, char *buf, uint n) ...@@ -630,7 +630,7 @@ static void dgnc_wmove(struct channel_t *ch, char *buf, uint n)
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return; return;
head = ch->ch_w_head & WQUEUEMASK; head = ch->ch_w_head & WQUEUEMASK;
/* /*
...@@ -641,7 +641,7 @@ static void dgnc_wmove(struct channel_t *ch, char *buf, uint n) ...@@ -641,7 +641,7 @@ static void dgnc_wmove(struct channel_t *ch, char *buf, uint n)
remain = WQUEUESIZE - head; remain = WQUEUESIZE - head;
if (n >= remain) { if (n >= remain) {
n -= remain; n -= remain;
memcpy(ch->ch_wqueue + head, buf, remain); memcpy(ch->ch_wqueue + head, buf, remain);
head = 0; head = 0;
buf += remain; buf += remain;
...@@ -666,9 +666,9 @@ static void dgnc_wmove(struct channel_t *ch, char *buf, uint n) ...@@ -666,9 +666,9 @@ static void dgnc_wmove(struct channel_t *ch, char *buf, uint n)
/*======================================================================= /*=======================================================================
* *
* dgnc_input - Process received data. * dgnc_input - Process received data.
* *
* ch - Pointer to channel structure. * ch - Pointer to channel structure.
* *
*=======================================================================*/ *=======================================================================*/
void dgnc_input(struct channel_t *ch) void dgnc_input(struct channel_t *ch)
{ {
...@@ -697,8 +697,8 @@ void dgnc_input(struct channel_t *ch) ...@@ -697,8 +697,8 @@ void dgnc_input(struct channel_t *ch)
DGNC_LOCK(ch->ch_lock, lock_flags); DGNC_LOCK(ch->ch_lock, lock_flags);
/* /*
* Figure the number of characters in the buffer. * Figure the number of characters in the buffer.
* Exit immediately if none. * Exit immediately if none.
*/ */
rmask = RQUEUEMASK; rmask = RQUEUEMASK;
...@@ -717,7 +717,7 @@ void dgnc_input(struct channel_t *ch) ...@@ -717,7 +717,7 @@ void dgnc_input(struct channel_t *ch)
* If the device is not open, or CREAD is off, * If the device is not open, or CREAD is off,
* flush input data and return immediately. * flush input data and return immediately.
*/ */
if (!tp || (tp->magic != TTY_MAGIC) || !(ch->ch_tun.un_flags & UN_ISOPEN) || if (!tp || (tp->magic != TTY_MAGIC) || !(ch->ch_tun.un_flags & UN_ISOPEN) ||
!(tp->termios.c_cflag & CREAD) || (ch->ch_tun.un_flags & UN_CLOSING)) { !(tp->termios.c_cflag & CREAD) || (ch->ch_tun.un_flags & UN_CLOSING)) {
DPR_READ(("input. dropping %d bytes on port %d...\n", data_len, ch->ch_portnum)); DPR_READ(("input. dropping %d bytes on port %d...\n", data_len, ch->ch_portnum));
...@@ -778,7 +778,7 @@ void dgnc_input(struct channel_t *ch) ...@@ -778,7 +778,7 @@ void dgnc_input(struct channel_t *ch)
if (!ld->ops->receive_buf) { if (!ld->ops->receive_buf) {
ch->ch_r_head = ch->ch_r_tail; ch->ch_r_head = ch->ch_r_tail;
len = 0; len = 0;
} }
} }
if (len <= 0) { if (len <= 0) {
...@@ -793,7 +793,7 @@ void dgnc_input(struct channel_t *ch) ...@@ -793,7 +793,7 @@ void dgnc_input(struct channel_t *ch)
* *
* The flip buffers in the tty structure are no longer exposed, * The flip buffers in the tty structure are no longer exposed,
* and probably will be going away eventually. * and probably will be going away eventually.
* *
* If we are completely raw, we don't need to go through a lot * If we are completely raw, we don't need to go through a lot
* of the tty layers that exist. * of the tty layers that exist.
* In this case, we take the shortest and fastest route we * In this case, we take the shortest and fastest route we
...@@ -818,7 +818,7 @@ void dgnc_input(struct channel_t *ch) ...@@ -818,7 +818,7 @@ void dgnc_input(struct channel_t *ch)
break; break;
/* /*
* If conditions are such that ld needs to see all * If conditions are such that ld needs to see all
* UART errors, we will have to walk each character * UART errors, we will have to walk each character
* and error byte and send them to the buffer one at * and error byte and send them to the buffer one at
* a time. * a time.
...@@ -862,9 +862,9 @@ void dgnc_input(struct channel_t *ch) ...@@ -862,9 +862,9 @@ void dgnc_input(struct channel_t *ch)
} }
/************************************************************************ /************************************************************************
* Determines when CARRIER changes state and takes appropriate * Determines when CARRIER changes state and takes appropriate
* action. * action.
************************************************************************/ ************************************************************************/
void dgnc_carrier(struct channel_t *ch) void dgnc_carrier(struct channel_t *ch)
{ {
...@@ -872,7 +872,7 @@ void dgnc_carrier(struct channel_t *ch) ...@@ -872,7 +872,7 @@ void dgnc_carrier(struct channel_t *ch)
int virt_carrier = 0; int virt_carrier = 0;
int phys_carrier = 0; int phys_carrier = 0;
DPR_CARR(("dgnc_carrier called...\n")); DPR_CARR(("dgnc_carrier called...\n"));
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
...@@ -890,11 +890,11 @@ void dgnc_carrier(struct channel_t *ch) ...@@ -890,11 +890,11 @@ void dgnc_carrier(struct channel_t *ch)
if (ch->ch_digi.digi_flags & DIGI_FORCEDCD) { if (ch->ch_digi.digi_flags & DIGI_FORCEDCD) {
virt_carrier = 1; virt_carrier = 1;
} }
if (ch->ch_c_cflag & CLOCAL) { if (ch->ch_c_cflag & CLOCAL) {
virt_carrier = 1; virt_carrier = 1;
} }
DPR_CARR(("DCD: physical: %d virt: %d\n", phys_carrier, virt_carrier)); DPR_CARR(("DCD: physical: %d virt: %d\n", phys_carrier, virt_carrier));
...@@ -941,7 +941,7 @@ void dgnc_carrier(struct channel_t *ch) ...@@ -941,7 +941,7 @@ void dgnc_carrier(struct channel_t *ch)
* "make pretend that carrier is there". * "make pretend that carrier is there".
*/ */
if ((virt_carrier == 0) && ((ch->ch_flags & CH_CD) != 0) && if ((virt_carrier == 0) && ((ch->ch_flags & CH_CD) != 0) &&
(phys_carrier == 0)) (phys_carrier == 0))
{ {
/* /*
...@@ -964,7 +964,7 @@ void dgnc_carrier(struct channel_t *ch) ...@@ -964,7 +964,7 @@ void dgnc_carrier(struct channel_t *ch)
tty_hangup(ch->ch_tun.un_tty); tty_hangup(ch->ch_tun.un_tty);
} }
if (ch->ch_pun.un_open_count > 0) { if (ch->ch_pun.un_open_count > 0) {
DPR_CARR(("Sending pr hangup\n")); DPR_CARR(("Sending pr hangup\n"));
tty_hangup(ch->ch_pun.un_tty); tty_hangup(ch->ch_pun.un_tty);
} }
...@@ -975,7 +975,7 @@ void dgnc_carrier(struct channel_t *ch) ...@@ -975,7 +975,7 @@ void dgnc_carrier(struct channel_t *ch)
*/ */
if (virt_carrier == 1) if (virt_carrier == 1)
ch->ch_flags |= CH_FCAR; ch->ch_flags |= CH_FCAR;
else else
ch->ch_flags &= ~CH_FCAR; ch->ch_flags &= ~CH_FCAR;
if (phys_carrier == 1) if (phys_carrier == 1)
...@@ -991,7 +991,7 @@ static void dgnc_set_custom_speed(struct channel_t *ch, uint newrate) ...@@ -991,7 +991,7 @@ static void dgnc_set_custom_speed(struct channel_t *ch, uint newrate)
{ {
int testdiv; int testdiv;
int testrate_high; int testrate_high;
int testrate_low; int testrate_low;
int deltahigh; int deltahigh;
int deltalow; int deltalow;
...@@ -1016,7 +1016,7 @@ static void dgnc_set_custom_speed(struct channel_t *ch, uint newrate) ...@@ -1016,7 +1016,7 @@ static void dgnc_set_custom_speed(struct channel_t *ch, uint newrate)
* If we try to figure out what rate the board would use * If we try to figure out what rate the board would use
* with the test divisor, it will be either equal or higher * with the test divisor, it will be either equal or higher
* than the requested baud rate. If we then determine the * than the requested baud rate. If we then determine the
* rate with a divisor one higher, we will get the next lower * rate with a divisor one higher, we will get the next lower
* supported rate below the requested. * supported rate below the requested.
*/ */
testrate_high = ch->ch_bd->bd_dividend / testdiv; testrate_high = ch->ch_bd->bd_dividend / testdiv;
...@@ -1044,7 +1044,7 @@ static void dgnc_set_custom_speed(struct channel_t *ch, uint newrate) ...@@ -1044,7 +1044,7 @@ static void dgnc_set_custom_speed(struct channel_t *ch, uint newrate)
break; break;
} }
ch->ch_custom_speed = newrate; ch->ch_custom_speed = newrate;
return; return;
...@@ -1250,9 +1250,9 @@ void dgnc_wakeup_writes(struct channel_t *ch) ...@@ -1250,9 +1250,9 @@ void dgnc_wakeup_writes(struct channel_t *ch)
/************************************************************************ /************************************************************************
* *
* TTY Entry points and helper functions * TTY Entry points and helper functions
* *
************************************************************************/ ************************************************************************/
/* /*
...@@ -1453,7 +1453,7 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file) ...@@ -1453,7 +1453,7 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file)
dgnc_carrier(ch); dgnc_carrier(ch);
/* /*
* follow protocol for opening port * follow protocol for opening port
*/ */
...@@ -1478,13 +1478,13 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file) ...@@ -1478,13 +1478,13 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file)
} }
/* /*
* dgnc_block_til_ready() * dgnc_block_til_ready()
* *
* Wait for DCD, if needed. * Wait for DCD, if needed.
*/ */
static int dgnc_block_til_ready(struct tty_struct *tty, struct file *file, struct channel_t *ch) static int dgnc_block_til_ready(struct tty_struct *tty, struct file *file, struct channel_t *ch)
{ {
int retval = 0; int retval = 0;
struct un_t *un = NULL; struct un_t *un = NULL;
ulong lock_flags; ulong lock_flags;
...@@ -1529,7 +1529,7 @@ static int dgnc_block_til_ready(struct tty_struct *tty, struct file *file, struc ...@@ -1529,7 +1529,7 @@ static int dgnc_block_til_ready(struct tty_struct *tty, struct file *file, struc
* If either unit is in the middle of the fragile part of close, * If either unit is in the middle of the fragile part of close,
* we just cannot touch the channel safely. * we just cannot touch the channel safely.
* Go back to sleep, knowing that when the channel can be * Go back to sleep, knowing that when the channel can be
* touched safely, the close routine will signal the * touched safely, the close routine will signal the
* ch_wait_flags to wake us back up. * ch_wait_flags to wake us back up.
*/ */
if (!((ch->ch_tun.un_flags | ch->ch_pun.un_flags) & UN_CLOSING)) { if (!((ch->ch_tun.un_flags | ch->ch_pun.un_flags) & UN_CLOSING)) {
...@@ -1638,7 +1638,7 @@ static int dgnc_block_til_ready(struct tty_struct *tty, struct file *file, struc ...@@ -1638,7 +1638,7 @@ static int dgnc_block_til_ready(struct tty_struct *tty, struct file *file, struc
* dgnc_tty_hangup() * dgnc_tty_hangup()
* *
* Hangup the port. Like a close, but don't wait for output to drain. * Hangup the port. Like a close, but don't wait for output to drain.
*/ */
static void dgnc_tty_hangup(struct tty_struct *tty) static void dgnc_tty_hangup(struct tty_struct *tty)
{ {
struct un_t *un; struct un_t *un;
...@@ -1709,7 +1709,7 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file) ...@@ -1709,7 +1709,7 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file)
*/ */
APR(("tty->count is 1, un open count is %d\n", un->un_open_count)); APR(("tty->count is 1, un open count is %d\n", un->un_open_count));
un->un_open_count = 1; un->un_open_count = 1;
} }
if (--un->un_open_count < 0) { if (--un->un_open_count < 0) {
APR(("bad serial port open count of %d\n", un->un_open_count)); APR(("bad serial port open count of %d\n", un->un_open_count));
...@@ -1782,7 +1782,7 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file) ...@@ -1782,7 +1782,7 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file)
bd->bd_ops->assert_modem_signals(ch); bd->bd_ops->assert_modem_signals(ch);
/* /*
* Go to sleep to ensure RTS/DTR * Go to sleep to ensure RTS/DTR
* have been dropped for modems to see it. * have been dropped for modems to see it.
*/ */
if (ch->ch_close_delay) { if (ch->ch_close_delay) {
...@@ -1871,21 +1871,21 @@ static int dgnc_tty_chars_in_buffer(struct tty_struct *tty) ...@@ -1871,21 +1871,21 @@ static int dgnc_tty_chars_in_buffer(struct tty_struct *tty)
chars = thead - ttail + WQUEUESIZE; chars = thead - ttail + WQUEUESIZE;
} }
DPR_WRITE(("dgnc_tty_chars_in_buffer. Port: %x - %d (head: %d tail: %d)\n", DPR_WRITE(("dgnc_tty_chars_in_buffer. Port: %x - %d (head: %d tail: %d)\n",
ch->ch_portnum, chars, thead, ttail)); ch->ch_portnum, chars, thead, ttail));
return(chars); return(chars);
} }
/* /*
* dgnc_maxcps_room * dgnc_maxcps_room
* *
* Reduces bytes_available to the max number of characters * Reduces bytes_available to the max number of characters
* that can be sent currently given the maxcps value, and * that can be sent currently given the maxcps value, and
* returns the new bytes_available. This only affects printer * returns the new bytes_available. This only affects printer
* output. * output.
*/ */
static int dgnc_maxcps_room(struct tty_struct *tty, int bytes_available) static int dgnc_maxcps_room(struct tty_struct *tty, int bytes_available)
{ {
struct channel_t *ch = NULL; struct channel_t *ch = NULL;
...@@ -1926,7 +1926,7 @@ static int dgnc_maxcps_room(struct tty_struct *tty, int bytes_available) ...@@ -1926,7 +1926,7 @@ static int dgnc_maxcps_room(struct tty_struct *tty, int bytes_available)
} }
else { else {
/* no room in the buffer */ /* no room in the buffer */
cps_limit = 0; cps_limit = 0;
} }
bytes_available = min(cps_limit, bytes_available); bytes_available = min(cps_limit, bytes_available);
...@@ -1940,7 +1940,7 @@ static int dgnc_maxcps_room(struct tty_struct *tty, int bytes_available) ...@@ -1940,7 +1940,7 @@ static int dgnc_maxcps_room(struct tty_struct *tty, int bytes_available)
* dgnc_tty_write_room() * dgnc_tty_write_room()
* *
* Return space available in Tx buffer * Return space available in Tx buffer
*/ */
static int dgnc_tty_write_room(struct tty_struct *tty) static int dgnc_tty_write_room(struct tty_struct *tty)
{ {
struct channel_t *ch = NULL; struct channel_t *ch = NULL;
...@@ -1975,7 +1975,7 @@ static int dgnc_tty_write_room(struct tty_struct *tty) ...@@ -1975,7 +1975,7 @@ static int dgnc_tty_write_room(struct tty_struct *tty)
ret = dgnc_maxcps_room(tty, ret); ret = dgnc_maxcps_room(tty, ret);
/* /*
* If we are printer device, leave space for * If we are printer device, leave space for
* possibly both the on and off strings. * possibly both the on and off strings.
*/ */
if (un->un_type == DGNC_PRINT) { if (un->un_type == DGNC_PRINT) {
...@@ -1992,7 +1992,7 @@ static int dgnc_tty_write_room(struct tty_struct *tty) ...@@ -1992,7 +1992,7 @@ static int dgnc_tty_write_room(struct tty_struct *tty)
ret = 0; ret = 0;
DGNC_UNLOCK(ch->ch_lock, lock_flags); DGNC_UNLOCK(ch->ch_lock, lock_flags);
DPR_WRITE(("dgnc_tty_write_room - %d tail: %d head: %d\n", ret, tail, head)); DPR_WRITE(("dgnc_tty_write_room - %d tail: %d head: %d\n", ret, tail, head));
return(ret); return(ret);
...@@ -2003,7 +2003,7 @@ static int dgnc_tty_write_room(struct tty_struct *tty) ...@@ -2003,7 +2003,7 @@ static int dgnc_tty_write_room(struct tty_struct *tty)
* dgnc_tty_put_char() * dgnc_tty_put_char()
* *
* Put a character into ch->ch_buf * Put a character into ch->ch_buf
* *
* - used by the line discipline for OPOST processing * - used by the line discipline for OPOST processing
*/ */
static int dgnc_tty_put_char(struct tty_struct *tty, unsigned char c) static int dgnc_tty_put_char(struct tty_struct *tty, unsigned char c)
...@@ -2118,7 +2118,7 @@ static int dgnc_tty_write(struct tty_struct *tty, ...@@ -2118,7 +2118,7 @@ static int dgnc_tty_write(struct tty_struct *tty,
/* /*
* If there is nothing left to copy, or I can't handle any more data, leave. * If there is nothing left to copy, or I can't handle any more data, leave.
*/ */
if (count <= 0) { if (count <= 0) {
DGNC_UNLOCK(ch->ch_lock, lock_flags); DGNC_UNLOCK(ch->ch_lock, lock_flags);
return(0); return(0);
...@@ -2330,11 +2330,11 @@ static int dgnc_tty_tiocmset(struct tty_struct *tty, struct file *file, ...@@ -2330,11 +2330,11 @@ static int dgnc_tty_tiocmset(struct tty_struct *tty, struct file *file,
if (set & TIOCM_RTS) { if (set & TIOCM_RTS) {
ch->ch_mostat |= UART_MCR_RTS; ch->ch_mostat |= UART_MCR_RTS;
} }
if (set & TIOCM_DTR) { if (set & TIOCM_DTR) {
ch->ch_mostat |= UART_MCR_DTR; ch->ch_mostat |= UART_MCR_DTR;
} }
if (clear & TIOCM_RTS) { if (clear & TIOCM_RTS) {
ch->ch_mostat &= ~(UART_MCR_RTS); ch->ch_mostat &= ~(UART_MCR_RTS);
...@@ -2441,7 +2441,7 @@ static void dgnc_tty_wait_until_sent(struct tty_struct *tty, int timeout) ...@@ -2441,7 +2441,7 @@ static void dgnc_tty_wait_until_sent(struct tty_struct *tty, int timeout)
return; return;
} }
return; return;
} }
/* /*
...@@ -2481,7 +2481,7 @@ static void dgnc_tty_send_xchar(struct tty_struct *tty, char c) ...@@ -2481,7 +2481,7 @@ static void dgnc_tty_send_xchar(struct tty_struct *tty, char c)
DPR_IOCTL(("dgnc_tty_send_xchar finish\n")); DPR_IOCTL(("dgnc_tty_send_xchar finish\n"));
printk("dgnc_tty_send_xchar finish\n"); printk("dgnc_tty_send_xchar finish\n");
return; return;
} }
...@@ -2648,7 +2648,7 @@ static int dgnc_set_modem_info(struct tty_struct *tty, unsigned int command, uns ...@@ -2648,7 +2648,7 @@ static int dgnc_set_modem_info(struct tty_struct *tty, unsigned int command, uns
/* /*
* dgnc_tty_digigeta() * dgnc_tty_digigeta()
* *
* Ioctl to get the information for ditty. * Ioctl to get the information for ditty.
* *
...@@ -2690,7 +2690,7 @@ static int dgnc_tty_digigeta(struct tty_struct *tty, struct digi_t __user *retin ...@@ -2690,7 +2690,7 @@ static int dgnc_tty_digigeta(struct tty_struct *tty, struct digi_t __user *retin
/* /*
* dgnc_tty_digiseta() * dgnc_tty_digiseta()
* *
* Ioctl to set the information for ditty. * Ioctl to set the information for ditty.
* *
...@@ -2747,10 +2747,10 @@ static int dgnc_tty_digiseta(struct tty_struct *tty, struct digi_t __user *new_i ...@@ -2747,10 +2747,10 @@ static int dgnc_tty_digiseta(struct tty_struct *tty, struct digi_t __user *new_i
memcpy(&ch->ch_digi, &new_digi, sizeof(struct digi_t)); memcpy(&ch->ch_digi, &new_digi, sizeof(struct digi_t));
if (ch->ch_digi.digi_maxcps < 1) if (ch->ch_digi.digi_maxcps < 1)
ch->ch_digi.digi_maxcps = 1; ch->ch_digi.digi_maxcps = 1;
if (ch->ch_digi.digi_maxcps > 10000) if (ch->ch_digi.digi_maxcps > 10000)
ch->ch_digi.digi_maxcps = 10000; ch->ch_digi.digi_maxcps = 10000;
if (ch->ch_digi.digi_bufsize < 10) if (ch->ch_digi.digi_bufsize < 10)
...@@ -2831,7 +2831,7 @@ static void dgnc_tty_throttle(struct tty_struct *tty) ...@@ -2831,7 +2831,7 @@ static void dgnc_tty_throttle(struct tty_struct *tty)
un = tty->driver_data; un = tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return; return;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return; return;
...@@ -2860,7 +2860,7 @@ static void dgnc_tty_unthrottle(struct tty_struct *tty) ...@@ -2860,7 +2860,7 @@ static void dgnc_tty_unthrottle(struct tty_struct *tty)
un = tty->driver_data; un = tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return; return;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return; return;
...@@ -2890,7 +2890,7 @@ static void dgnc_tty_start(struct tty_struct *tty) ...@@ -2890,7 +2890,7 @@ static void dgnc_tty_start(struct tty_struct *tty)
un = tty->driver_data; un = tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return; return;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return; return;
...@@ -2924,7 +2924,7 @@ static void dgnc_tty_stop(struct tty_struct *tty) ...@@ -2924,7 +2924,7 @@ static void dgnc_tty_stop(struct tty_struct *tty)
un = tty->driver_data; un = tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return; return;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return; return;
...@@ -2945,7 +2945,7 @@ static void dgnc_tty_stop(struct tty_struct *tty) ...@@ -2945,7 +2945,7 @@ static void dgnc_tty_stop(struct tty_struct *tty)
} }
/* /*
* dgnc_tty_flush_chars() * dgnc_tty_flush_chars()
* *
* Flush the cook buffer * Flush the cook buffer
...@@ -2971,7 +2971,7 @@ static void dgnc_tty_flush_chars(struct tty_struct *tty) ...@@ -2971,7 +2971,7 @@ static void dgnc_tty_flush_chars(struct tty_struct *tty)
un = tty->driver_data; un = tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return; return;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return; return;
...@@ -2995,7 +2995,7 @@ static void dgnc_tty_flush_chars(struct tty_struct *tty) ...@@ -2995,7 +2995,7 @@ static void dgnc_tty_flush_chars(struct tty_struct *tty)
/* /*
* dgnc_tty_flush_buffer() * dgnc_tty_flush_buffer()
* *
* Flush Tx buffer (make in == out) * Flush Tx buffer (make in == out)
*/ */
static void dgnc_tty_flush_buffer(struct tty_struct *tty) static void dgnc_tty_flush_buffer(struct tty_struct *tty)
...@@ -3010,7 +3010,7 @@ static void dgnc_tty_flush_buffer(struct tty_struct *tty) ...@@ -3010,7 +3010,7 @@ static void dgnc_tty_flush_buffer(struct tty_struct *tty)
un = tty->driver_data; un = tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return; return;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return; return;
...@@ -3048,7 +3048,7 @@ static void dgnc_tty_flush_buffer(struct tty_struct *tty) ...@@ -3048,7 +3048,7 @@ static void dgnc_tty_flush_buffer(struct tty_struct *tty)
* The IOCTL function and all of its helpers * The IOCTL function and all of its helpers
* *
*****************************************************************************/ *****************************************************************************/
/* /*
* dgnc_tty_ioctl() * dgnc_tty_ioctl()
* *
...@@ -3079,7 +3079,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -3079,7 +3079,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
if (!bd || bd->magic != DGNC_BOARD_MAGIC) if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return (-ENODEV); return (-ENODEV);
DPR_IOCTL(("dgnc_tty_ioctl start on port %d - cmd %s (%x), arg %lx\n", DPR_IOCTL(("dgnc_tty_ioctl start on port %d - cmd %s (%x), arg %lx\n",
ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg)); ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg));
DGNC_LOCK(ch->ch_lock, lock_flags); DGNC_LOCK(ch->ch_lock, lock_flags);
...@@ -3096,7 +3096,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -3096,7 +3096,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
case TCSBRK: case TCSBRK:
/* /*
* TCSBRK is SVID version: non-zero arg --> no break * TCSBRK is SVID version: non-zero arg --> no break
* this behaviour is exploited by tcdrain(). * this behaviour is exploited by tcdrain().
* *
* According to POSIX.1 spec (7.2.2.1.2) breaks should be * According to POSIX.1 spec (7.2.2.1.2) breaks should be
...@@ -3124,7 +3124,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -3124,7 +3124,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGNC_UNLOCK(ch->ch_lock, lock_flags); DGNC_UNLOCK(ch->ch_lock, lock_flags);
DPR_IOCTL(("dgnc_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n", DPR_IOCTL(("dgnc_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n",
ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg)); ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg));
return(0); return(0);
...@@ -3154,7 +3154,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -3154,7 +3154,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGNC_UNLOCK(ch->ch_lock, lock_flags); DGNC_UNLOCK(ch->ch_lock, lock_flags);
DPR_IOCTL(("dgnc_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n", DPR_IOCTL(("dgnc_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n",
ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg)); ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg));
return(0); return(0);
...@@ -3178,7 +3178,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -3178,7 +3178,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGNC_UNLOCK(ch->ch_lock, lock_flags); DGNC_UNLOCK(ch->ch_lock, lock_flags);
DPR_IOCTL(("dgnc_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n", DPR_IOCTL(("dgnc_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n",
ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg)); ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg));
return(0); return(0);
...@@ -3208,7 +3208,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -3208,7 +3208,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGNC_UNLOCK(ch->ch_lock, lock_flags); DGNC_UNLOCK(ch->ch_lock, lock_flags);
return(0); return(0);
case TIOCMGET: case TIOCMGET:
DGNC_UNLOCK(ch->ch_lock, lock_flags); DGNC_UNLOCK(ch->ch_lock, lock_flags);
return(dgnc_get_modem_info(ch, uarg)); return(dgnc_get_modem_info(ch, uarg));
...@@ -3222,8 +3222,8 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -3222,8 +3222,8 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
/* /*
* Here are any additional ioctl's that we want to implement * Here are any additional ioctl's that we want to implement
*/ */
case TCFLSH: case TCFLSH:
/* /*
* The linux tty driver doesn't have a flush * The linux tty driver doesn't have a flush
* input routine for the driver, assuming all backed * input routine for the driver, assuming all backed
...@@ -3232,7 +3232,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -3232,7 +3232,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
* act on the ioctl, but then lie and say we didn't * act on the ioctl, but then lie and say we didn't
* so the line discipline will process the flush * so the line discipline will process the flush
* also. * also.
*/ */
rc = tty_check_change(tty); rc = tty_check_change(tty);
if (rc) { if (rc) {
DGNC_UNLOCK(ch->ch_lock, lock_flags); DGNC_UNLOCK(ch->ch_lock, lock_flags);
...@@ -3264,7 +3264,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -3264,7 +3264,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
} }
} }
/* pretend we didn't recognize this IOCTL */ /* pretend we didn't recognize this IOCTL */
DGNC_UNLOCK(ch->ch_lock, lock_flags); DGNC_UNLOCK(ch->ch_lock, lock_flags);
return(-ENOIOCTLCMD); return(-ENOIOCTLCMD);
case TCSETSF: case TCSETSF:
...@@ -3295,7 +3295,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -3295,7 +3295,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
return(-EINTR); return(-EINTR);
} }
DPR_IOCTL(("dgnc_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n", DPR_IOCTL(("dgnc_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n",
ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg)); ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg));
/* pretend we didn't recognize this */ /* pretend we didn't recognize this */
...@@ -3311,7 +3311,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -3311,7 +3311,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
} }
/* pretend we didn't recognize this */ /* pretend we didn't recognize this */
return(-ENOIOCTLCMD); return(-ENOIOCTLCMD);
case TCXONC: case TCXONC:
DGNC_UNLOCK(ch->ch_lock, lock_flags); DGNC_UNLOCK(ch->ch_lock, lock_flags);
...@@ -3345,7 +3345,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -3345,7 +3345,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
case DIGI_SETA: case DIGI_SETA:
DGNC_UNLOCK(ch->ch_lock, lock_flags); DGNC_UNLOCK(ch->ch_lock, lock_flags);
return(dgnc_tty_digiseta(tty, uarg)); return(dgnc_tty_digiseta(tty, uarg));
case DIGI_LOOPBACK: case DIGI_LOOPBACK:
{ {
uint loopback = 0; uint loopback = 0;
...@@ -3356,7 +3356,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -3356,7 +3356,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
return(rc); return(rc);
DGNC_LOCK(ch->ch_lock, lock_flags); DGNC_LOCK(ch->ch_lock, lock_flags);
/* Enable/disable internal loopback for this port */ /* Enable/disable internal loopback for this port */
if (loopback) if (loopback)
ch->ch_flags |= CH_LOOPBACK; ch->ch_flags |= CH_LOOPBACK;
else else
...@@ -3530,7 +3530,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -3530,7 +3530,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGNC_UNLOCK(ch->ch_lock, lock_flags); DGNC_UNLOCK(ch->ch_lock, lock_flags);
DPR_IOCTL(("dgnc_tty_ioctl - in default\n")); DPR_IOCTL(("dgnc_tty_ioctl - in default\n"));
DPR_IOCTL(("dgnc_tty_ioctl end - cmd %s (%x), arg %lx\n", DPR_IOCTL(("dgnc_tty_ioctl end - cmd %s (%x), arg %lx\n",
dgnc_ioctl_name(cmd), cmd, arg)); dgnc_ioctl_name(cmd), cmd, arg));
return(-ENOIOCTLCMD); return(-ENOIOCTLCMD);
...@@ -3538,8 +3538,8 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ...@@ -3538,8 +3538,8 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGNC_UNLOCK(ch->ch_lock, lock_flags); DGNC_UNLOCK(ch->ch_lock, lock_flags);
DPR_IOCTL(("dgnc_tty_ioctl end - cmd %s (%x), arg %lx\n", DPR_IOCTL(("dgnc_tty_ioctl end - cmd %s (%x), arg %lx\n",
dgnc_ioctl_name(cmd), cmd, arg)); dgnc_ioctl_name(cmd), cmd, arg));
return(0); return(0);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment