2 * (C) Copyright 2007-2011 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
4 * This file is released under the GPLv2. See the COPYING file for more
12 #include <directory.h>
19 * VDEV_SPOOL and VDEV_CONS related definitions
25 void (*f
[16])(struct virt_sys
*sys
, struct virt_device
*vdev
,
26 struct ccw
*ccw
, struct spdev_state
*st
);
29 extern struct spool_ops spool_cons_ops
; /* for VDEV_CONS */
32 u8 dev_status
; /* device/CU status */
33 u8 sch_status
; /* subchannel status */
35 u32 addr
; /* ccw address */
36 int f
; /* ccw format */
40 u32 rem
; /* current record remaining count */
41 u32 pos
; /* current record remaining offset */
43 int cd
; /* chain data bool */
44 u8 cmd
; /* chain data command */
48 struct spool_ops
*ops
;
52 * The virtual device struct definition
55 struct list_head devices
;
58 * protects the R/W fields:
64 enum directory_vdevtype vtype
; /* VDEV_CONS, VDEV_DED, ... */
65 u32 sch
; /* subchannel id */
66 u16 type
; /* 3330, 3215, ... */
75 struct spool_file
*file
;
76 /* the spool file backing this dev */
77 struct spool_ops
*ops
;
78 /* ops vector used for CCW exec */
82 u8 sense
; /* sense info */
84 struct pmcw pmcw
; /* path info */
85 struct scsw scsw
; /* subchannel-status */
90 * VDEV_SPOOL and VDEV_CONS: generate command reject
92 static inline void spooldev_cmdrej(struct virt_sys
*sys
,
93 struct virt_device
*vdev
,
94 struct spdev_state
*st
)
96 st
->dev_status
= SC_STATUS_CE
| SC_STATUS_DE
| SC_STATUS_UC
;
97 vdev
->sense
= SENSE_CMDREJ
;
101 * misc virtual device functions
103 extern int alloc_virt_dev(struct virt_sys
*sys
,
104 struct directory_vdev
*dirdev
, u32 sch
);
106 #define for_each_vdev(sys, v) list_for_each_entry((v), &(sys)->virt_devs, \