static int fs3270_do_io(struct raw3270_view *view, struct raw3270_request *rq) { struct fs3270 *fp; int rc; fp = (struct fs3270 *) view; rq->callback = fs3270_wake_up; rq->callback_data = &fp->wait; do { if (!fs3270_working(fp)) { /* Fullscreen view isn't ready yet. */ rc = wait_event_interruptible(fp->wait, fs3270_working(fp)); if (rc != 0) break; } rc = raw3270_start(view, rq); if (rc == 0) { /* Started sucessfully. Now wait for completion. */ wait_event(fp->wait, raw3270_request_final(rq)); } } while (rc == -EACCES); return rc; }
/* * Switch to the fullscreen view. */ static int fs3270_activate(struct raw3270_view *view) { struct fs3270 *fp; fp = (struct fs3270 *) view; raw3270_request_set_cmd(fp->clear, TC_EWRITEA); fp->clear->callback = fs3270_reset_callback; return raw3270_start(view, fp->clear); }
static int fs3270_do_io(struct raw3270_view *view, struct raw3270_request *rq) { wait_queue_head_t wq; int rc; init_waitqueue_head(&wq); rq->callback = fs3270_wake_up; rq->callback_data = &wq; rc = raw3270_start(view, rq); if (rc) return rc; /* Started sucessfully. Now wait for completion. */ wait_event(wq, raw3270_request_final(rq)); return rq->rc; }