diff options
author | Alan Cox <alan@redhat.com> | 2008-07-16 16:53:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:12:34 -0400 |
commit | a352def21a642133758b868c71bee12ab34ad5c5 (patch) | |
tree | 95d0f7229f9e4afccdc6fbbf11f7f5c6dd83b0fd /drivers/char/ip2 | |
parent | e1e5770bb63fb9d71619a68f52cb0ba4b2ae58a6 (diff) |
tty: Ldisc revamp
Move the line disciplines towards a conventional ->ops arrangement. For
the moment the actual 'tty_ldisc' struct in the tty is kept as part of
the tty struct but this can then be changed if it turns out that when it
all settles down we want to refcount ldiscs separately to the tty.
Pull the ldisc code out of /proc and put it with our ldisc code.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/ip2')
-rw-r--r-- | drivers/char/ip2/i2lib.c | 4 | ||||
-rw-r--r-- | drivers/char/ip2/ip2main.c | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/drivers/char/ip2/i2lib.c b/drivers/char/ip2/i2lib.c index 938879cc7bcc..0061e18aff60 100644 --- a/drivers/char/ip2/i2lib.c +++ b/drivers/char/ip2/i2lib.c | |||
@@ -868,11 +868,11 @@ i2Input(i2ChanStrPtr pCh) | |||
868 | amountToMove = count; | 868 | amountToMove = count; |
869 | } | 869 | } |
870 | // Move the first block | 870 | // Move the first block |
871 | pCh->pTTY->ldisc.receive_buf( pCh->pTTY, | 871 | pCh->pTTY->ldisc.ops->receive_buf( pCh->pTTY, |
872 | &(pCh->Ibuf[stripIndex]), NULL, amountToMove ); | 872 | &(pCh->Ibuf[stripIndex]), NULL, amountToMove ); |
873 | // If we needed to wrap, do the second data move | 873 | // If we needed to wrap, do the second data move |
874 | if (count > amountToMove) { | 874 | if (count > amountToMove) { |
875 | pCh->pTTY->ldisc.receive_buf( pCh->pTTY, | 875 | pCh->pTTY->ldisc.ops->receive_buf( pCh->pTTY, |
876 | pCh->Ibuf, NULL, count - amountToMove ); | 876 | pCh->Ibuf, NULL, count - amountToMove ); |
877 | } | 877 | } |
878 | // Bump and wrap the stripIndex all at once by the amount of data read. This | 878 | // Bump and wrap the stripIndex all at once by the amount of data read. This |
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c index 9a2394cda943..5dc74404058f 100644 --- a/drivers/char/ip2/ip2main.c +++ b/drivers/char/ip2/ip2main.c | |||
@@ -1289,11 +1289,12 @@ static void do_input(struct work_struct *work) | |||
1289 | // code duplicated from n_tty (ldisc) | 1289 | // code duplicated from n_tty (ldisc) |
1290 | static inline void isig(int sig, struct tty_struct *tty, int flush) | 1290 | static inline void isig(int sig, struct tty_struct *tty, int flush) |
1291 | { | 1291 | { |
1292 | /* FIXME: This is completely bogus */ | ||
1292 | if (tty->pgrp) | 1293 | if (tty->pgrp) |
1293 | kill_pgrp(tty->pgrp, sig, 1); | 1294 | kill_pgrp(tty->pgrp, sig, 1); |
1294 | if (flush || !L_NOFLSH(tty)) { | 1295 | if (flush || !L_NOFLSH(tty)) { |
1295 | if ( tty->ldisc.flush_buffer ) | 1296 | if ( tty->ldisc.ops->flush_buffer ) |
1296 | tty->ldisc.flush_buffer(tty); | 1297 | tty->ldisc.ops->flush_buffer(tty); |
1297 | i2InputFlush( tty->driver_data ); | 1298 | i2InputFlush( tty->driver_data ); |
1298 | } | 1299 | } |
1299 | } | 1300 | } |
@@ -1342,7 +1343,7 @@ static void do_status(struct work_struct *work) | |||
1342 | } | 1343 | } |
1343 | tmp = pCh->pTTY->real_raw; | 1344 | tmp = pCh->pTTY->real_raw; |
1344 | pCh->pTTY->real_raw = 0; | 1345 | pCh->pTTY->real_raw = 0; |
1345 | pCh->pTTY->ldisc.receive_buf( pCh->pTTY, &brkc, &brkf, 1 ); | 1346 | pCh->pTTY->ldisc->ops.receive_buf( pCh->pTTY, &brkc, &brkf, 1 ); |
1346 | pCh->pTTY->real_raw = tmp; | 1347 | pCh->pTTY->real_raw = tmp; |
1347 | } | 1348 | } |
1348 | #endif /* NEVER_HAPPENS_AS_SETUP_XXX */ | 1349 | #endif /* NEVER_HAPPENS_AS_SETUP_XXX */ |