• Home
  • Raw
  • Download

Lines Matching refs:fp

54 fs3270_working(struct fs3270 *fp)  in fs3270_working()  argument
60 return fp->active && raw3270_request_final(fp->init); in fs3270_working()
66 struct fs3270 *fp; in fs3270_do_io() local
69 fp = (struct fs3270 *) view; in fs3270_do_io()
71 rq->callback_data = &fp->wait; in fs3270_do_io()
74 if (!fs3270_working(fp)) { in fs3270_do_io()
76 rc = wait_event_interruptible(fp->wait, in fs3270_do_io()
77 fs3270_working(fp)); in fs3270_do_io()
84 wait_event(fp->wait, raw3270_request_final(rq)); in fs3270_do_io()
96 struct fs3270 *fp; in fs3270_reset_callback() local
98 fp = (struct fs3270 *) rq->view; in fs3270_reset_callback()
100 wake_up(&fp->wait); in fs3270_reset_callback()
106 struct fs3270 *fp; in fs3270_restore_callback() local
108 fp = (struct fs3270 *) rq->view; in fs3270_restore_callback()
110 if (fp->fs_pid) in fs3270_restore_callback()
111 kill_pid(fp->fs_pid, SIGHUP, 1); in fs3270_restore_callback()
113 fp->rdbuf_size = 0; in fs3270_restore_callback()
115 wake_up(&fp->wait); in fs3270_restore_callback()
121 struct fs3270 *fp; in fs3270_activate() local
125 fp = (struct fs3270 *) view; in fs3270_activate()
128 if (!raw3270_request_final(fp->init)) in fs3270_activate()
131 if (fp->rdbuf_size == 0) { in fs3270_activate()
133 raw3270_request_set_cmd(fp->init, TC_EWRITEA); in fs3270_activate()
134 fp->init->callback = fs3270_reset_callback; in fs3270_activate()
137 raw3270_request_set_cmd(fp->init, TC_EWRITEA); in fs3270_activate()
138 raw3270_request_set_idal(fp->init, fp->rdbuf); in fs3270_activate()
139 fp->init->ccw.count = fp->rdbuf_size; in fs3270_activate()
140 cp = fp->rdbuf->data[0]; in fs3270_activate()
149 fp->init->rescnt = 0; in fs3270_activate()
150 fp->init->callback = fs3270_restore_callback; in fs3270_activate()
152 rc = fp->init->rc = raw3270_start_locked(view, fp->init); in fs3270_activate()
154 fp->init->callback(fp->init, NULL); in fs3270_activate()
156 fp->active = 1; in fs3270_activate()
166 struct fs3270 *fp; in fs3270_save_callback() local
168 fp = (struct fs3270 *) rq->view; in fs3270_save_callback()
171 fp->rdbuf->data[0] -= 5; in fs3270_save_callback()
172 fp->rdbuf->size += 5; in fs3270_save_callback()
181 if (fp->fs_pid) in fs3270_save_callback()
182 kill_pid(fp->fs_pid, SIGHUP, 1); in fs3270_save_callback()
183 fp->rdbuf_size = 0; in fs3270_save_callback()
185 fp->rdbuf_size = fp->rdbuf->size - rq->rescnt; in fs3270_save_callback()
187 wake_up(&fp->wait); in fs3270_save_callback()
193 struct fs3270 *fp; in fs3270_deactivate() local
195 fp = (struct fs3270 *) view; in fs3270_deactivate()
196 fp->active = 0; in fs3270_deactivate()
199 if (!raw3270_request_final(fp->init)) in fs3270_deactivate()
203 raw3270_request_set_cmd(fp->init, TC_RDBUF); in fs3270_deactivate()
209 fp->rdbuf->data[0] += 5; in fs3270_deactivate()
210 fp->rdbuf->size -= 5; in fs3270_deactivate()
211 raw3270_request_set_idal(fp->init, fp->rdbuf); in fs3270_deactivate()
212 fp->init->rescnt = 0; in fs3270_deactivate()
213 fp->init->callback = fs3270_save_callback; in fs3270_deactivate()
216 fp->init->rc = raw3270_start_locked(view, fp->init); in fs3270_deactivate()
217 if (fp->init->rc) in fs3270_deactivate()
218 fp->init->callback(fp->init, NULL); in fs3270_deactivate()
222 fs3270_irq(struct fs3270 *fp, struct raw3270_request *rq, struct irb *irb) in fs3270_irq() argument
226 fp->attention = 1; in fs3270_irq()
227 wake_up(&fp->wait); in fs3270_irq()
245 struct fs3270 *fp; in fs3270_read() local
252 fp = filp->private_data; in fs3270_read()
253 if (!fp) in fs3270_read()
260 if (fp->read_command == 0 && fp->write_command != 0) in fs3270_read()
261 fp->read_command = 6; in fs3270_read()
262 raw3270_request_set_cmd(rq, fp->read_command ? : 2); in fs3270_read()
264 rc = wait_event_interruptible(fp->wait, fp->attention); in fs3270_read()
265 fp->attention = 0; in fs3270_read()
267 rc = fs3270_do_io(&fp->view, rq); in fs3270_read()
290 struct fs3270 *fp; in fs3270_write() local
296 fp = filp->private_data; in fs3270_write()
297 if (!fp) in fs3270_write()
305 write_command = fp->write_command ? : 1; in fs3270_write()
310 rc = fs3270_do_io(&fp->view, rq); in fs3270_write()
329 struct fs3270 *fp; in fs3270_ioctl() local
333 fp = filp->private_data; in fs3270_ioctl()
334 if (!fp) in fs3270_ioctl()
344 fp->read_command = arg; in fs3270_ioctl()
347 fp->write_command = arg; in fs3270_ioctl()
350 rc = put_user(fp->read_command, argp); in fs3270_ioctl()
353 rc = put_user(fp->write_command, argp); in fs3270_ioctl()
356 iocb.model = fp->view.model; in fs3270_ioctl()
357 iocb.line_cnt = fp->view.rows; in fs3270_ioctl()
358 iocb.col_cnt = fp->view.cols; in fs3270_ioctl()
376 struct fs3270 *fp; in fs3270_alloc_view() local
378 fp = kzalloc(sizeof(struct fs3270),GFP_KERNEL); in fs3270_alloc_view()
379 if (!fp) in fs3270_alloc_view()
381 fp->init = raw3270_request_alloc(0); in fs3270_alloc_view()
382 if (IS_ERR(fp->init)) { in fs3270_alloc_view()
383 kfree(fp); in fs3270_alloc_view()
386 return fp; in fs3270_alloc_view()
395 struct fs3270 *fp; in fs3270_free_view() local
397 fp = (struct fs3270 *) view; in fs3270_free_view()
398 if (fp->rdbuf) in fs3270_free_view()
399 idal_buffer_free(fp->rdbuf); in fs3270_free_view()
410 struct fs3270 *fp; in fs3270_release() local
412 fp = (struct fs3270 *) view; in fs3270_release()
413 if (fp->fs_pid) in fs3270_release()
414 kill_pid(fp->fs_pid, SIGHUP, 1); in fs3270_release()
432 struct fs3270 *fp; in fs3270_open() local
451 fp = (struct fs3270 *) raw3270_find_view(&fs3270_fn, minor); in fs3270_open()
452 if (!IS_ERR(fp)) { in fs3270_open()
453 raw3270_put_view(&fp->view); in fs3270_open()
458 fp = fs3270_alloc_view(); in fs3270_open()
459 if (IS_ERR(fp)) { in fs3270_open()
460 rc = PTR_ERR(fp); in fs3270_open()
464 init_waitqueue_head(&fp->wait); in fs3270_open()
465 fp->fs_pid = get_pid(task_pid(current)); in fs3270_open()
466 rc = raw3270_add_view(&fp->view, &fs3270_fn, minor, in fs3270_open()
469 fs3270_free_view(&fp->view); in fs3270_open()
474 ib = idal_buffer_alloc(2*fp->view.rows*fp->view.cols + 5, 0); in fs3270_open()
476 raw3270_put_view(&fp->view); in fs3270_open()
477 raw3270_del_view(&fp->view); in fs3270_open()
481 fp->rdbuf = ib; in fs3270_open()
483 rc = raw3270_activate_view(&fp->view); in fs3270_open()
485 raw3270_put_view(&fp->view); in fs3270_open()
486 raw3270_del_view(&fp->view); in fs3270_open()
490 filp->private_data = fp; in fs3270_open()
503 struct fs3270 *fp; in fs3270_close() local
505 fp = filp->private_data; in fs3270_close()
507 if (fp) { in fs3270_close()
508 put_pid(fp->fs_pid); in fs3270_close()
509 fp->fs_pid = NULL; in fs3270_close()
510 raw3270_reset(&fp->view); in fs3270_close()
511 raw3270_put_view(&fp->view); in fs3270_close()
512 raw3270_del_view(&fp->view); in fs3270_close()