|
@@ -5,6 +5,8 @@
|
|
|
#include <linux/device.h> /* for dev_warn */
|
|
|
#include <linux/selection.h>
|
|
|
#include <linux/workqueue.h>
|
|
|
+#include <linux/tty.h>
|
|
|
+#include <linux/tty_flip.h>
|
|
|
#include <asm/cmpxchg.h>
|
|
|
|
|
|
#include "speakup.h"
|
|
@@ -135,8 +137,12 @@ static void __speakup_paste_selection(struct work_struct *work)
|
|
|
struct tty_struct *tty = xchg(&spw->tty, NULL);
|
|
|
struct vc_data *vc = (struct vc_data *) tty->driver_data;
|
|
|
int pasted = 0, count;
|
|
|
+ struct tty_ldisc *ld;
|
|
|
DECLARE_WAITQUEUE(wait, current);
|
|
|
|
|
|
+ ld = tty_ldisc_ref_wait(tty);
|
|
|
+ tty_buffer_lock_exclusive(&vc->port);
|
|
|
+
|
|
|
add_wait_queue(&vc->paste_wait, &wait);
|
|
|
while (sel_buffer && sel_buffer_lth > pasted) {
|
|
|
set_current_state(TASK_INTERRUPTIBLE);
|
|
@@ -145,13 +151,15 @@ static void __speakup_paste_selection(struct work_struct *work)
|
|
|
continue;
|
|
|
}
|
|
|
count = sel_buffer_lth - pasted;
|
|
|
- count = min_t(int, count, tty->receive_room);
|
|
|
- tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted,
|
|
|
- NULL, count);
|
|
|
+ count = tty_ldisc_receive_buf(ld, sel_buffer + pasted, NULL,
|
|
|
+ count);
|
|
|
pasted += count;
|
|
|
}
|
|
|
remove_wait_queue(&vc->paste_wait, &wait);
|
|
|
current->state = TASK_RUNNING;
|
|
|
+
|
|
|
+ tty_buffer_unlock_exclusive(&vc->port);
|
|
|
+ tty_ldisc_deref(ld);
|
|
|
tty_kref_put(tty);
|
|
|
}
|
|
|
|