15 #include <linux/module.h>
16 #include <linux/list.h>
17 #include <linux/slab.h>
18 #include <linux/types.h>
20 #include <asm/compat.h>
59 return fp->
active && raw3270_request_final(fp->
init);
68 fp = (
struct fs3270 *) view;
73 if (!fs3270_working(fp)) {
124 fp = (
struct fs3270 *) view;
127 if (!raw3270_request_final(fp->
init))
133 fp->
init->callback = fs3270_reset_callback;
139 cp = fp->
rdbuf->data[0];
148 fp->
init->rescnt = 0;
149 fp->
init->callback = fs3270_restore_callback;
170 fp->
rdbuf->data[0] -= 5;
171 fp->
rdbuf->size += 5;
194 fp = (
struct fs3270 *) view;
198 if (!raw3270_request_final(fp->
init))
208 fp->
rdbuf->data[0] += 5;
209 fp->
rdbuf->size -= 5;
211 fp->
init->rescnt = 0;
212 fp->
init->callback = fs3270_save_callback;
243 fs3270_read(
struct file *filp,
char __user *data,
size_t count, loff_t *off)
250 if (count == 0 || count > 65535)
255 ib = idal_buffer_alloc(count, 0);
267 rc = fs3270_do_io(&fp->
view, rq);
270 if (idal_buffer_to_user(ib, data, count) != 0)
280 idal_buffer_free(ib);
288 fs3270_write(
struct file *filp,
const char __user *data,
size_t count, loff_t *off)
299 ib = idal_buffer_alloc(count, 0);
304 if (idal_buffer_from_user(ib, data, count) == 0) {
306 if (write_command == 5)
310 rc = fs3270_do_io(&fp->
view, rq);
318 idal_buffer_free(ib);
326 fs3270_ioctl(
struct file *filp,
unsigned int cmd,
unsigned long arg)
337 argp = compat_ptr(arg);
339 argp = (
char __user *)arg;
374 fs3270_alloc_view(
void)
382 if (IS_ERR(fp->
init)) {
397 fp = (
struct fs3270 *) view;
399 idal_buffer_free(fp->
rdbuf);
412 fp = (
struct fs3270 *) view;
419 .activate = fs3270_activate,
420 .deactivate = fs3270_deactivate,
421 .intv = (
void *) fs3270_irq,
423 .
free = fs3270_free_view
438 minor = iminor(filp->
f_path.dentry->d_inode);
453 raw3270_put_view(&fp->
view);
458 fp = fs3270_alloc_view();
468 fs3270_free_view(&fp->
view);
473 ib = idal_buffer_alloc(2*fp->
view.rows*fp->
view.cols + 5, 0);
475 raw3270_put_view(&fp->
view);
484 raw3270_put_view(&fp->
view);
500 fs3270_close(
struct inode *inode,
struct file *filp)
510 raw3270_put_view(&fp->
view);
519 .write = fs3270_write,
520 .unlocked_ioctl = fs3270_ioctl,
521 .compat_ioctl = fs3270_ioctl,
523 .release = fs3270_close,