Lines Matching refs:fp

53 static inline int fs3270_working(struct fs3270 *fp)
59 return fp->active && raw3270_request_final(fp->init);
64 struct fs3270 *fp;
67 fp = (struct fs3270 *)view;
69 rq->callback_data = &fp->wait;
72 if (!fs3270_working(fp)) {
74 rc = wait_event_interruptible(fp->wait,
75 fs3270_working(fp));
82 wait_event(fp->wait, raw3270_request_final(rq));
93 struct fs3270 *fp;
95 fp = (struct fs3270 *)rq->view;
97 wake_up(&fp->wait);
102 struct fs3270 *fp;
104 fp = (struct fs3270 *)rq->view;
106 if (fp->fs_pid)
107 kill_pid(fp->fs_pid, SIGHUP, 1);
109 fp->rdbuf_size = 0;
111 wake_up(&fp->wait);
116 struct fs3270 *fp;
120 fp = (struct fs3270 *)view;
123 if (!raw3270_request_final(fp->init))
126 raw3270_request_set_cmd(fp->init, TC_EWRITEA);
127 raw3270_request_set_idal(fp->init, fp->rdbuf);
128 fp->init->rescnt = 0;
129 cp = dma64_to_virt(fp->rdbuf->data[0]);
130 if (fp->rdbuf_size == 0) {
132 fp->init->ccw.count = 1;
133 fp->init->callback = fs3270_reset_callback;
137 fp->init->ccw.count = fp->rdbuf_size;
138 fp->init->callback = fs3270_restore_callback;
148 rc = raw3270_start_locked(view, fp->init);
149 fp->init->rc = rc;
151 fp->init->callback(fp->init, NULL);
153 fp->active = 1;
162 struct fs3270 *fp;
164 fp = (struct fs3270 *)rq->view;
167 fp->rdbuf->data[0] = dma64_add(fp->rdbuf->data[0], -5);
168 fp->rdbuf->size += 5;
177 if (fp->fs_pid)
178 kill_pid(fp->fs_pid, SIGHUP, 1);
179 fp->rdbuf_size = 0;
181 fp->rdbuf_size = fp->rdbuf->size - rq->rescnt;
184 wake_up(&fp->wait);
189 struct fs3270 *fp;
191 fp = (struct fs3270 *)view;
192 fp->active = 0;
195 if (!raw3270_request_final(fp->init))
199 raw3270_request_set_cmd(fp->init, TC_RDBUF);
205 fp->rdbuf->data[0] = dma64_add(fp->rdbuf->data[0], 5);
206 fp->rdbuf->size -= 5;
207 raw3270_request_set_idal(fp->init, fp->rdbuf);
208 fp->init->rescnt = 0;
209 fp->init->callback = fs3270_save_callback;
212 fp->init->rc = raw3270_start_locked(view, fp->init);
213 if (fp->init->rc)
214 fp->init->callback(fp->init, NULL);
217 static void fs3270_irq(struct fs3270 *fp, struct raw3270_request *rq,
222 fp->attention = 1;
223 wake_up(&fp->wait);
241 struct fs3270 *fp;
248 fp = filp->private_data;
249 if (!fp)
256 if (fp->read_command == 0 && fp->write_command != 0)
257 fp->read_command = 6;
258 raw3270_request_set_cmd(rq, fp->read_command ? : 2);
260 rc = wait_event_interruptible(fp->wait, fp->attention);
261 fp->attention = 0;
263 rc = fs3270_do_io(&fp->view, rq);
286 struct fs3270 *fp;
292 fp = filp->private_data;
293 if (!fp)
301 write_command = fp->write_command ? : 1;
306 rc = fs3270_do_io(&fp->view, rq);
326 struct fs3270 *fp;
330 fp = filp->private_data;
331 if (!fp)
341 fp->read_command = arg;
344 fp->write_command = arg;
347 rc = put_user(fp->read_command, argp);
350 rc = put_user(fp->write_command, argp);
353 iocb.model = fp->view.model;
354 iocb.line_cnt = fp->view.rows;
355 iocb.col_cnt = fp->view.cols;
372 struct fs3270 *fp;
374 fp = kzalloc(sizeof(*fp), GFP_KERNEL);
375 if (!fp)
377 fp->init = raw3270_request_alloc(0);
378 if (IS_ERR(fp->init)) {
379 kfree(fp);
382 return fp;
390 struct fs3270 *fp;
392 fp = (struct fs3270 *)view;
393 if (fp->rdbuf)
394 idal_buffer_free(fp->rdbuf);
404 struct fs3270 *fp;
406 fp = (struct fs3270 *)view;
407 if (fp->fs_pid)
408 kill_pid(fp->fs_pid, SIGHUP, 1);
425 struct fs3270 *fp;
445 fp = (struct fs3270 *)raw3270_find_view(&fs3270_fn, minor);
446 if (!IS_ERR(fp)) {
447 raw3270_put_view(&fp->view);
452 fp = fs3270_alloc_view();
453 if (IS_ERR(fp)) {
454 rc = PTR_ERR(fp);
458 init_waitqueue_head(&fp->wait);
459 fp->fs_pid = get_pid(task_pid(current));
460 rc = raw3270_add_view(&fp->view, &fs3270_fn, minor,
463 fs3270_free_view(&fp->view);
468 ib = idal_buffer_alloc(2 * fp->view.rows * fp->view.cols + 5, 0);
470 raw3270_put_view(&fp->view);
471 raw3270_del_view(&fp->view);
475 fp->rdbuf = ib;
477 rc = raw3270_activate_view(&fp->view);
479 raw3270_put_view(&fp->view);
480 raw3270_del_view(&fp->view);
484 filp->private_data = fp;
496 struct fs3270 *fp;
498 fp = filp->private_data;
500 if (fp) {
501 put_pid(fp->fs_pid);
502 fp->fs_pid = NULL;
503 raw3270_reset(&fp->view);
504 raw3270_put_view(&fp->view);
505 raw3270_del_view(&fp->view);