Lines Matching refs:fp

53 fs3270_working(struct fs3270 *fp)
59 return fp->active && raw3270_request_final(fp->init);
65 struct fs3270 *fp;
68 fp = (struct fs3270 *) view;
70 rq->callback_data = &fp->wait;
73 if (!fs3270_working(fp)) {
75 rc = wait_event_interruptible(fp->wait,
76 fs3270_working(fp));
83 wait_event(fp->wait, raw3270_request_final(rq));
95 struct fs3270 *fp;
97 fp = (struct fs3270 *) rq->view;
99 wake_up(&fp->wait);
105 struct fs3270 *fp;
107 fp = (struct fs3270 *) rq->view;
109 if (fp->fs_pid)
110 kill_pid(fp->fs_pid, SIGHUP, 1);
112 fp->rdbuf_size = 0;
114 wake_up(&fp->wait);
120 struct fs3270 *fp;
124 fp = (struct fs3270 *) view;
127 if (!raw3270_request_final(fp->init))
130 if (fp->rdbuf_size == 0) {
132 raw3270_request_set_cmd(fp->init, TC_EWRITEA);
133 fp->init->callback = fs3270_reset_callback;
136 raw3270_request_set_cmd(fp->init, TC_EWRITEA);
137 raw3270_request_set_idal(fp->init, fp->rdbuf);
138 fp->init->ccw.count = fp->rdbuf_size;
139 cp = fp->rdbuf->data[0];
148 fp->init->rescnt = 0;
149 fp->init->callback = fs3270_restore_callback;
151 rc = fp->init->rc = raw3270_start_locked(view, fp->init);
153 fp->init->callback(fp->init, NULL);
155 fp->active = 1;
165 struct fs3270 *fp;
167 fp = (struct fs3270 *) rq->view;
170 fp->rdbuf->data[0] -= 5;
171 fp->rdbuf->size += 5;
180 if (fp->fs_pid)
181 kill_pid(fp->fs_pid, SIGHUP, 1);
182 fp->rdbuf_size = 0;
184 fp->rdbuf_size = fp->rdbuf->size - rq->rescnt;
186 wake_up(&fp->wait);
192 struct fs3270 *fp;
194 fp = (struct fs3270 *) view;
195 fp->active = 0;
198 if (!raw3270_request_final(fp->init))
202 raw3270_request_set_cmd(fp->init, TC_RDBUF);
208 fp->rdbuf->data[0] += 5;
209 fp->rdbuf->size -= 5;
210 raw3270_request_set_idal(fp->init, fp->rdbuf);
211 fp->init->rescnt = 0;
212 fp->init->callback = fs3270_save_callback;
215 fp->init->rc = raw3270_start_locked(view, fp->init);
216 if (fp->init->rc)
217 fp->init->callback(fp->init, NULL);
221 fs3270_irq(struct fs3270 *fp, struct raw3270_request *rq, struct irb *irb)
225 fp->attention = 1;
226 wake_up(&fp->wait);
245 struct fs3270 *fp;
252 fp = filp->private_data;
253 if (!fp)
260 if (fp->read_command == 0 && fp->write_command != 0)
261 fp->read_command = 6;
262 raw3270_request_set_cmd(rq, fp->read_command ? : 2);
264 rc = wait_event_interruptible(fp->wait, fp->attention);
265 fp->attention = 0;
267 rc = fs3270_do_io(&fp->view, rq);
290 struct fs3270 *fp;
296 fp = filp->private_data;
297 if (!fp)
305 write_command = fp->write_command ? : 1;
310 rc = fs3270_do_io(&fp->view, rq);
329 struct fs3270 *fp;
333 fp = filp->private_data;
334 if (!fp)
344 fp->read_command = arg;
347 fp->write_command = arg;
350 rc = put_user(fp->read_command, argp);
353 rc = put_user(fp->write_command, argp);
356 iocb.model = fp->view.model;
357 iocb.line_cnt = fp->view.rows;
358 iocb.col_cnt = fp->view.cols;
376 struct fs3270 *fp;
378 fp = kzalloc(sizeof(struct fs3270),GFP_KERNEL);
379 if (!fp)
381 fp->init = raw3270_request_alloc(0);
382 if (IS_ERR(fp->init)) {
383 kfree(fp);
386 return fp;
395 struct fs3270 *fp;
397 fp = (struct fs3270 *) view;
398 if (fp->rdbuf)
399 idal_buffer_free(fp->rdbuf);
410 struct fs3270 *fp;
412 fp = (struct fs3270 *) view;
413 if (fp->fs_pid)
414 kill_pid(fp->fs_pid, SIGHUP, 1);
432 struct fs3270 *fp;
451 fp = (struct fs3270 *) raw3270_find_view(&fs3270_fn, minor);
452 if (!IS_ERR(fp)) {
453 raw3270_put_view(&fp->view);
458 fp = fs3270_alloc_view();
459 if (IS_ERR(fp)) {
460 rc = PTR_ERR(fp);
464 init_waitqueue_head(&fp->wait);
465 fp->fs_pid = get_pid(task_pid(current));
466 rc = raw3270_add_view(&fp->view, &fs3270_fn, minor);
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);
476 raw3270_del_view(&fp->view);
480 fp->rdbuf = ib;
482 rc = raw3270_activate_view(&fp->view);
484 raw3270_put_view(&fp->view);
485 raw3270_del_view(&fp->view);
489 filp->private_data = fp;
502 struct fs3270 *fp;
504 fp = filp->private_data;
506 if (fp) {
507 put_pid(fp->fs_pid);
508 fp->fs_pid = NULL;
509 raw3270_reset(&fp->view);
510 raw3270_put_view(&fp->view);
511 raw3270_del_view(&fp->view);