drivers/s390/char/tape.h
Source file repositories/reference/linux-study-clean/drivers/s390/char/tape.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/char/tape.h- Extension
.h- Size
- 10405 bytes
- Lines
- 380
- Domain
- Driver Families
- Bucket
- drivers/s390
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/ccwdev.hasm/debug.hasm/idals.hlinux/kernel.hlinux/module.hlinux/mtio.hlinux/interrupt.hlinux/workqueue.h
Detected Declarations
struct gendiskstruct tape_devicestruct tape_requeststruct tape_disciplinestruct tape_char_datastruct tape_deviceenum tape_medium_stateenum tape_stateenum tape_openum tape_request_statusfunction tape_do_io_freefunction tape_do_io_async_freefunction tape_proc_initfunction tape_proc_cleanupfunction tape_ccw_ccfunction tape_ccw_endfunction tape_ccw_cmdfunction tape_ccw_repeatfunction tape_ccw_dc_idalfunction tape_ccw_cc_idalfunction tape_ccw_end_idal
Annotated Snippet
struct tape_request {
struct list_head list; /* list head for request queueing. */
struct tape_device *device; /* tape device of this request */
struct ccw1 *cpaddr; /* address of the channel program. */
void *cpdata; /* pointer to ccw data. */
enum tape_request_status status;/* status of this request */
int options; /* options for execution. */
int retries; /* retry counter for error recovery. */
int rescnt; /* residual count from devstat. */
struct timer_list timer; /* timer for std_assign_timeout(). */
struct irb irb; /* device status */
/* Callback for delivering final status. */
void (*callback)(struct tape_request *, void *);
void *callback_data;
enum tape_op op;
int rc;
};
/* Function type for magnetic tape commands */
typedef int (*tape_mtop_fn)(struct tape_device *, int);
/* Size of the array containing the mtops for a discipline */
#define TAPE_NR_MTOPS (MTMKPART+1)
/* Tape Discipline */
struct tape_discipline {
struct module *owner;
int (*setup_device)(struct tape_device *);
void (*cleanup_device)(struct tape_device *);
int (*irq)(struct tape_device *, struct tape_request *, struct irb *);
struct tape_request *(*read_block)(struct tape_device *);
struct tape_request *(*write_block)(struct tape_device *);
void (*process_eov)(struct tape_device*);
/* Array of tape commands with TAPE_NR_MTOPS entries */
tape_mtop_fn *mtop_array;
};
/*
* The discipline irq function either returns an error code (<0) which
* means that the request has failed with an error or one of the following:
*/
#define TAPE_IO_SUCCESS 0 /* request successful */
#define TAPE_IO_PENDING 1 /* request still running */
#define TAPE_IO_RETRY 2 /* retry to current request */
#define TAPE_IO_STOP 3 /* stop the running request */
#define TAPE_IO_LONG_BUSY 4 /* delay the running request */
/* Char Frontend Data */
struct tape_char_data {
struct idal_buffer **ibs; /* idal buffer array for user char data */
int block_size; /* of size block_size. */
};
/* Tape Info */
struct tape_device {
/* entry in tape_device_list */
struct list_head node;
int cdev_id;
struct ccw_device * cdev;
struct tape_class_device * nt;
struct tape_class_device * rt;
/* Device mutex to serialize tape commands. */
struct mutex mutex;
/* Device discipline information. */
struct tape_discipline * discipline;
/* Generic status flags */
long tape_generic_status;
/* Device state information. */
wait_queue_head_t state_change_wq;
enum tape_state tape_state;
enum tape_medium_state medium_state;
unsigned char * modeset_byte;
/* Reference count. */
atomic_t ref_count;
/* Request queue. */
struct list_head req_queue;
/* Request wait queue. */
wait_queue_head_t wait_queue;
/* Each tape device has (currently) two minor numbers. */
Annotation
- Immediate include surface: `asm/ccwdev.h`, `asm/debug.h`, `asm/idals.h`, `linux/kernel.h`, `linux/module.h`, `linux/mtio.h`, `linux/interrupt.h`, `linux/workqueue.h`.
- Detected declarations: `struct gendisk`, `struct tape_device`, `struct tape_request`, `struct tape_discipline`, `struct tape_char_data`, `struct tape_device`, `enum tape_medium_state`, `enum tape_state`, `enum tape_op`, `enum tape_request_status`.
- Atlas domain: Driver Families / drivers/s390.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.