/* SPDX-License-Identifier: GPL-2.0 */ /* * Linux driver for System z and s390 unit record devices * (z/VM virtual punch, reader, printer) * * Copyright IBM Corp. 2001, 2007 * Authors: Malcolm Beattie <beattiem@uk.ibm.com> * Michael Holzheu <holzheu@de.ibm.com> * Frank Munzert <munzert@de.ibm.com>
*/
#define DEV_CLASS_UR_I 0x20 /* diag210 unit record input device class */ #define DEV_CLASS_UR_O 0x10 /* diag210 unit record output device class */ /* * we only support z/VM's default unit record devices: * both in SPOOL directory control statement and in CP DEFINE statement * RDR defaults to 2540 reader * PUN defaults to 2540 punch * PRT defaults to 1403 printer
*/ #define READER_PUNCH_DEVTYPE 0x2540 #define PRINTER_DEVTYPE 0x1403
/* * A struct urdev is created for each ur device that is made available * via the ccw_device driver model.
*/ struct urdev { struct ccw_device *cdev; /* Backpointer to ccw device */ struct mutex io_mutex; /* Serialises device IO */ struct completion *io_done; /* do_ur_io waits; irq completes */ struct device *device; struct cdev *char_device; struct ccw_dev_id dev_id; /* device id */
size_t reclen; /* Record length for *write* CCWs */ intclass; /* VM device class */ int io_request_rc; /* return code from I/O request */
refcount_t ref_count; /* reference counter */
wait_queue_head_t wait; /* wait queue to serialize open */ int open_flag; /* "urdev is open" flag */
spinlock_t open_lock; /* serialize critical sections */ struct work_struct uevent_work; /* work to send uevent */
};
/* * A struct urfile is allocated at open() time for each device and * freed on release().
*/ struct urfile { struct urdev *urd; unsignedint flags;
size_t dev_reclen;
__u16 file_reclen;
};
/* * Device major/minor definitions.
*/
#define UR_MAJOR 0 /* get dynamic major */ /* * We map minor numbers directly to device numbers (0-FFFF) for simplicity. * This avoids having to allocate (and manage) slot numbers.
*/ #define NUM_MINORS 65536
/* Limiting each I/O to 511 records limits chan prog to 4KB (511 r/w + 1 NOP) */ #define MAX_RECS_PER_IO 511 #define WRITE_CCW_CMD 0x01
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.