aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/n_gsm.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2013-01-03 09:53:03 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-16 01:21:36 -0500
commit92a19f9cec9a80ad93c06e115822deb729e2c6ad (patch)
tree80e1550ac1647a1cdf20a0b568554c0c50a63f75 /drivers/tty/n_gsm.c
parent2f69335710884ae6112fc8196ebe29b5cda7b79b (diff)
TTY: switch tty_insert_flip_char
Now, we start converting tty buffer functions to actually use tty_port. This will allow us to get rid of the need of tty in many call sites. Only tty_port will needed and hence no more tty_port_tty_get in those paths. tty_insert_flip_char is the next one to proceed. This one is used all over the code, so the patch is huge. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/n_gsm.c')
-rw-r--r--drivers/tty/n_gsm.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 4572117988f8..769016504c88 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -1070,9 +1070,9 @@ static void gsm_process_modem(struct tty_struct *tty, struct gsm_dlci *dlci,
1070 if ((mlines & TIOCM_CD) == 0 && (dlci->modem_rx & TIOCM_CD)) 1070 if ((mlines & TIOCM_CD) == 0 && (dlci->modem_rx & TIOCM_CD))
1071 if (!(tty->termios.c_cflag & CLOCAL)) 1071 if (!(tty->termios.c_cflag & CLOCAL))
1072 tty_hangup(tty); 1072 tty_hangup(tty);
1073 if (brk & 0x01)
1074 tty_insert_flip_char(tty, 0, TTY_BREAK);
1075 } 1073 }
1074 if (brk & 0x01)
1075 tty_insert_flip_char(&dlci->port, 0, TTY_BREAK);
1076 dlci->modem_rx = mlines; 1076 dlci->modem_rx = mlines;
1077} 1077}
1078 1078
@@ -1140,6 +1140,7 @@ static void gsm_control_modem(struct gsm_mux *gsm, u8 *data, int clen)
1140 1140
1141static void gsm_control_rls(struct gsm_mux *gsm, u8 *data, int clen) 1141static void gsm_control_rls(struct gsm_mux *gsm, u8 *data, int clen)
1142{ 1142{
1143 struct tty_port *port;
1143 struct tty_struct *tty; 1144 struct tty_struct *tty;
1144 unsigned int addr = 0 ; 1145 unsigned int addr = 0 ;
1145 u8 bits; 1146 u8 bits;
@@ -1163,16 +1164,19 @@ static void gsm_control_rls(struct gsm_mux *gsm, u8 *data, int clen)
1163 bits = *dp; 1164 bits = *dp;
1164 if ((bits & 1) == 0) 1165 if ((bits & 1) == 0)
1165 return; 1166 return;
1166 /* See if we have an uplink tty */
1167 tty = tty_port_tty_get(&gsm->dlci[addr]->port);
1168 1167
1168 port = &gsm->dlci[addr]->port;
1169
1170 if (bits & 2)
1171 tty_insert_flip_char(port, 0, TTY_OVERRUN);
1172 if (bits & 4)
1173 tty_insert_flip_char(port, 0, TTY_PARITY);
1174 if (bits & 8)
1175 tty_insert_flip_char(port, 0, TTY_FRAME);
1176
1177 /* See if we have an uplink tty */
1178 tty = tty_port_tty_get(port);
1169 if (tty) { 1179 if (tty) {
1170 if (bits & 2)
1171 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
1172 if (bits & 4)
1173 tty_insert_flip_char(tty, 0, TTY_PARITY);
1174 if (bits & 8)
1175 tty_insert_flip_char(tty, 0, TTY_FRAME);
1176 tty_flip_buffer_push(tty); 1180 tty_flip_buffer_push(tty);
1177 tty_kref_put(tty); 1181 tty_kref_put(tty);
1178 } 1182 }