// SPDX-License-Identifier: GPL-2.0 /* * IBM/3270 Driver - fullscreen driver. * * Author(s): * Original 3270 Code for 2.4 written by Richard Hitt (UTS Global) * Rewritten for 2.5/2.6 by Martin Schwidefsky <schwidefsky@de.ibm.com> * Copyright IBM Corp. 2003, 2009
*/
struct fs3270 { struct raw3270_view view; struct pid *fs_pid; /* Pid of controlling program. */ int read_command; /* ccw command to use for reads. */ int write_command; /* ccw command to use for writes. */ int attention; /* Got attention. */ int active; /* Fullscreen view is active. */ struct raw3270_request *init; /* single init request. */
wait_queue_head_t wait; /* Init & attention wait queue. */ struct idal_buffer *rdbuf; /* full-screen-deactivate buffer */
size_t rdbuf_size; /* size of data returned by RDBUF */
};
staticinlineint fs3270_working(struct fs3270 *fp)
{ /* * The fullscreen view is in working order if the view * has been activated AND the initial request is finished.
*/ return fp->active && raw3270_request_final(fp->init);
}
/* * If the rdbuf command failed or the idal buffer is * to small for the amount of data returned by the * rdbuf command, then we have no choice but to send * a SIGHUP to the application.
*/ if (rq->rc != 0 || rq->rescnt == 0) { if (fp->fs_pid)
kill_pid(fp->fs_pid, SIGHUP, 1);
fp->rdbuf_size = 0;
} else {
fp->rdbuf_size = fp->rdbuf->size - rq->rescnt;
}
raw3270_request_reset(rq);
wake_up(&fp->wait);
}
/* If an old init command is still running just return. */ if (!raw3270_request_final(fp->init)) return;
/* Prepare read-buffer request. */
raw3270_request_set_cmd(fp->init, TC_RDBUF); /* * Hackish: skip first 5 bytes of the idal buffer to make * room for the TW_KR/TO_SBA/<address>/<address>/TO_IC sequence * in the activation command.
*/
fp->rdbuf->data[0] = dma64_add(fp->rdbuf->data[0], 5);
fp->rdbuf->size -= 5;
raw3270_request_set_idal(fp->init, fp->rdbuf);
fp->init->rescnt = 0;
fp->init->callback = fs3270_save_callback;
/* Start I/O to read in the 3270 buffer. */
fp->init->rc = raw3270_start_locked(view, fp->init); if (fp->init->rc)
fp->init->callback(fp->init, NULL);
}
staticvoid fs3270_irq(struct fs3270 *fp, struct raw3270_request *rq, struct irb *irb)
{ /* Handle ATTN. Set indication and wake waiters for attention. */ if (irb->scsw.cmd.dstat & DEV_STAT_ATTENTION) {
fp->attention = 1;
wake_up(&fp->wait);
}
if (rq) { if (irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK)
rq->rc = -EIO; else /* Normal end. Copy residual count. */
rq->rescnt = irb->scsw.cmd.count;
}
}
/* * This routine is called when the 3270 tty is closed. We wait * for the remaining request to be completed. Then we clean up.
*/ staticint fs3270_close(struct inode *inode, struct file *filp)
{ struct fs3270 *fp;
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.27Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.