Lines Matching refs:fp
53 fs3270_working(struct fs3270 *fp) in fs3270_working() argument
59 return fp->active && raw3270_request_final(fp->init); in fs3270_working()
65 struct fs3270 *fp; in fs3270_do_io() local
68 fp = (struct fs3270 *) view; in fs3270_do_io()
70 rq->callback_data = &fp->wait; in fs3270_do_io()
73 if (!fs3270_working(fp)) { in fs3270_do_io()
75 rc = wait_event_interruptible(fp->wait, in fs3270_do_io()
76 fs3270_working(fp)); in fs3270_do_io()
83 wait_event(fp->wait, raw3270_request_final(rq)); in fs3270_do_io()
95 struct fs3270 *fp; in fs3270_reset_callback() local
97 fp = (struct fs3270 *) rq->view; in fs3270_reset_callback()
99 wake_up(&fp->wait); in fs3270_reset_callback()
105 struct fs3270 *fp; in fs3270_restore_callback() local
107 fp = (struct fs3270 *) rq->view; in fs3270_restore_callback()
109 if (fp->fs_pid) in fs3270_restore_callback()
110 kill_pid(fp->fs_pid, SIGHUP, 1); in fs3270_restore_callback()
112 fp->rdbuf_size = 0; in fs3270_restore_callback()
114 wake_up(&fp->wait); in fs3270_restore_callback()
120 struct fs3270 *fp; in fs3270_activate() local
124 fp = (struct fs3270 *) view; in fs3270_activate()
127 if (!raw3270_request_final(fp->init)) in fs3270_activate()
130 if (fp->rdbuf_size == 0) { in fs3270_activate()
132 raw3270_request_set_cmd(fp->init, TC_EWRITEA); in fs3270_activate()
133 fp->init->callback = fs3270_reset_callback; in fs3270_activate()
136 raw3270_request_set_cmd(fp->init, TC_EWRITEA); in fs3270_activate()
137 raw3270_request_set_idal(fp->init, fp->rdbuf); in fs3270_activate()
138 fp->init->ccw.count = fp->rdbuf_size; in fs3270_activate()
139 cp = fp->rdbuf->data[0]; in fs3270_activate()
148 fp->init->rescnt = 0; in fs3270_activate()
149 fp->init->callback = fs3270_restore_callback; in fs3270_activate()
151 rc = fp->init->rc = raw3270_start_locked(view, fp->init); in fs3270_activate()
153 fp->init->callback(fp->init, NULL); in fs3270_activate()
155 fp->active = 1; in fs3270_activate()
165 struct fs3270 *fp; in fs3270_save_callback() local
167 fp = (struct fs3270 *) rq->view; in fs3270_save_callback()
170 fp->rdbuf->data[0] -= 5; in fs3270_save_callback()
171 fp->rdbuf->size += 5; in fs3270_save_callback()
180 if (fp->fs_pid) in fs3270_save_callback()
181 kill_pid(fp->fs_pid, SIGHUP, 1); in fs3270_save_callback()
182 fp->rdbuf_size = 0; in fs3270_save_callback()
184 fp->rdbuf_size = fp->rdbuf->size - rq->rescnt; in fs3270_save_callback()
186 wake_up(&fp->wait); in fs3270_save_callback()
192 struct fs3270 *fp; in fs3270_deactivate() local
194 fp = (struct fs3270 *) view; in fs3270_deactivate()
195 fp->active = 0; in fs3270_deactivate()
198 if (!raw3270_request_final(fp->init)) in fs3270_deactivate()
202 raw3270_request_set_cmd(fp->init, TC_RDBUF); in fs3270_deactivate()
208 fp->rdbuf->data[0] += 5; in fs3270_deactivate()
209 fp->rdbuf->size -= 5; in fs3270_deactivate()
210 raw3270_request_set_idal(fp->init, fp->rdbuf); in fs3270_deactivate()
211 fp->init->rescnt = 0; in fs3270_deactivate()
212 fp->init->callback = fs3270_save_callback; in fs3270_deactivate()
215 fp->init->rc = raw3270_start_locked(view, fp->init); in fs3270_deactivate()
216 if (fp->init->rc) in fs3270_deactivate()
217 fp->init->callback(fp->init, NULL); in fs3270_deactivate()
221 fs3270_irq(struct fs3270 *fp, struct raw3270_request *rq, struct irb *irb) in fs3270_irq() argument
225 fp->attention = 1; in fs3270_irq()
226 wake_up(&fp->wait); in fs3270_irq()
244 struct fs3270 *fp; in fs3270_read() local
251 fp = filp->private_data; in fs3270_read()
252 if (!fp) in fs3270_read()
259 if (fp->read_command == 0 && fp->write_command != 0) in fs3270_read()
260 fp->read_command = 6; in fs3270_read()
261 raw3270_request_set_cmd(rq, fp->read_command ? : 2); in fs3270_read()
263 rc = wait_event_interruptible(fp->wait, fp->attention); in fs3270_read()
264 fp->attention = 0; in fs3270_read()
266 rc = fs3270_do_io(&fp->view, rq); in fs3270_read()
289 struct fs3270 *fp; in fs3270_write() local
295 fp = filp->private_data; in fs3270_write()
296 if (!fp) in fs3270_write()
304 write_command = fp->write_command ? : 1; in fs3270_write()
309 rc = fs3270_do_io(&fp->view, rq); in fs3270_write()
328 struct fs3270 *fp; in fs3270_ioctl() local
332 fp = filp->private_data; in fs3270_ioctl()
333 if (!fp) in fs3270_ioctl()
343 fp->read_command = arg; in fs3270_ioctl()
346 fp->write_command = arg; in fs3270_ioctl()
349 rc = put_user(fp->read_command, argp); in fs3270_ioctl()
352 rc = put_user(fp->write_command, argp); in fs3270_ioctl()
355 iocb.model = fp->view.model; in fs3270_ioctl()
356 iocb.line_cnt = fp->view.rows; in fs3270_ioctl()
357 iocb.col_cnt = fp->view.cols; in fs3270_ioctl()
375 struct fs3270 *fp; in fs3270_alloc_view() local
377 fp = kzalloc(sizeof(struct fs3270),GFP_KERNEL); in fs3270_alloc_view()
378 if (!fp) in fs3270_alloc_view()
380 fp->init = raw3270_request_alloc(0); in fs3270_alloc_view()
381 if (IS_ERR(fp->init)) { in fs3270_alloc_view()
382 kfree(fp); in fs3270_alloc_view()
385 return fp; in fs3270_alloc_view()
394 struct fs3270 *fp; in fs3270_free_view() local
396 fp = (struct fs3270 *) view; in fs3270_free_view()
397 if (fp->rdbuf) in fs3270_free_view()
398 idal_buffer_free(fp->rdbuf); in fs3270_free_view()
409 struct fs3270 *fp; in fs3270_release() local
411 fp = (struct fs3270 *) view; in fs3270_release()
412 if (fp->fs_pid) in fs3270_release()
413 kill_pid(fp->fs_pid, SIGHUP, 1); in fs3270_release()
431 struct fs3270 *fp; in fs3270_open() local
450 fp = (struct fs3270 *) raw3270_find_view(&fs3270_fn, minor); in fs3270_open()
451 if (!IS_ERR(fp)) { in fs3270_open()
452 raw3270_put_view(&fp->view); in fs3270_open()
457 fp = fs3270_alloc_view(); in fs3270_open()
458 if (IS_ERR(fp)) { in fs3270_open()
459 rc = PTR_ERR(fp); in fs3270_open()
463 init_waitqueue_head(&fp->wait); in fs3270_open()
464 fp->fs_pid = get_pid(task_pid(current)); in fs3270_open()
465 rc = raw3270_add_view(&fp->view, &fs3270_fn, minor); in fs3270_open()
467 fs3270_free_view(&fp->view); in fs3270_open()
472 ib = idal_buffer_alloc(2*fp->view.rows*fp->view.cols + 5, 0); in fs3270_open()
474 raw3270_put_view(&fp->view); in fs3270_open()
475 raw3270_del_view(&fp->view); in fs3270_open()
479 fp->rdbuf = ib; in fs3270_open()
481 rc = raw3270_activate_view(&fp->view); in fs3270_open()
483 raw3270_put_view(&fp->view); in fs3270_open()
484 raw3270_del_view(&fp->view); in fs3270_open()
488 filp->private_data = fp; in fs3270_open()
501 struct fs3270 *fp; in fs3270_close() local
503 fp = filp->private_data; in fs3270_close()
505 if (fp) { in fs3270_close()
506 put_pid(fp->fs_pid); in fs3270_close()
507 fp->fs_pid = NULL; in fs3270_close()
508 raw3270_reset(&fp->view); in fs3270_close()
509 raw3270_put_view(&fp->view); in fs3270_close()
510 raw3270_del_view(&fp->view); in fs3270_close()