1/* 2 * arch/s390/kernel/s390io.h 3 * 4 * S390 version 5 * Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation 6 * Author(s): Ingo Adlung (adlung@de.ibm.com) 7 */ 8 9#ifndef __s390io_h 10#define __s390io_h 11 12/* 13 * IRQ data structure used by I/O subroutines 14 * 15 * Note : If bit flags are added, the "unused" value must be 16 * decremented accordingly ! 17 */ 18typedef struct _ioinfo { 19 unsigned int irq; /* aka. subchannel number */ 20 spinlock_t irq_lock; /* irq lock */ 21 void *private_data; /* pointer to private data */ 22 23 struct _ioinfo *prev; 24 struct _ioinfo *next; 25 26 __u8 st; /* subchannel type */ 27 28 union { 29 unsigned int info; 30 struct { 31 unsigned int busy : 1; /* device currently in use */ 32 unsigned int oper : 1; /* device is operational */ 33 unsigned int fast : 1; /* post with "channel end", ... */ 34 /* ... don't wait for "device end" */ 35 /* ... from do_IO() parameters */ 36 unsigned int ready : 1; /* interrupt handler registered */ 37 unsigned int haltio : 1; /* halt_IO in process */ 38 unsigned int doio : 1; /* do_IO in process */ 39 unsigned int doio_q : 1; /* do_IO queued - only possible ... */ 40 /* ... if 'fast' is set too */ 41 unsigned int w4final : 1; /* wait for final status, internally */ 42 /* ... used with 'fast' setting only */ 43 unsigned int repall : 1; /* report every interrupt status */ 44 unsigned int unready : 1; /* deregister irq handler in process */ 45 unsigned int d_disable : 1; /* delayed disabling required */ 46 unsigned int w4sense : 1; /* SENSE status pending */ 47 unsigned int syncio : 1; /* synchronous I/O requested */ 48 unsigned int consns : 1; /* concurrent sense is available */ 49 unsigned int delsense : 1; /* delayed SENSE required */ 50 unsigned int s_pend : 1; /* status pending condition */ 51 unsigned int pgid : 1; /* "path group ID" is valid */ 52 unsigned int pgid_supp : 1; /* "path group ID" command is supported */ 53 unsigned int esid : 1; /* Ext. SenseID supported by HW */ 54 unsigned int rcd : 1; /* RCD supported by HW */ 55 unsigned int repnone : 1; /* don't call IRQ handler on interrupt */ 56 unsigned int newreq : 1; /* new register interface */ 57 unsigned int dval : 1; /* device number valid */ 58 unsigned int unknown : 1; /* unknown device - if SenseID failed */ 59 unsigned int unfriendly: 1; /* device is locked by someone else */ 60 unsigned int unused : (sizeof(unsigned int)*8 - 25); /* unused */ 61 } __attribute__ ((packed)) flags; 62 } ui; 63 64 unsigned long u_intparm; /* user interruption parameter */ 65 senseid_t senseid; /* SenseID info */ 66 irq_desc_t irq_desc; /* irq descriptor */ 67 not_oper_handler_func_t nopfunc; /* not oper handler */ 68 __u8 ulpm; /* logical path mask used for I/O */ 69 __u8 opm; /* path mask of operational paths */ 70 __u16 devno; /* device number */ 71 pgid_t pgid; /* path group ID */ 72 schib_t schib; /* subchannel information block */ 73 orb_t orb; /* operation request block */ 74 devstat_t devstat; /* device status */ 75 ccw1_t *qcpa; /* queued channel program */ 76 ccw1_t senseccw; /* ccw for sense command */ 77 __u8 sense_data[32];/* buffer for basic sense */ 78 unsigned int stctl; /* accumulated status control from irb */ 79 unsigned long qintparm; /* queued interruption parameter */ 80 unsigned long qflag; /* queued flags */ 81 __u8 qlpm; /* queued logical path mask */ 82 ssd_info_t ssd_info; /* subchannel description */ 83 84 } __attribute__ ((aligned(8))) ioinfo_t; 85 86#define IOINFO_FLAGS_BUSY 0x80000000 87#define IOINFO_FLAGS_OPER 0x40000000 88#define IOINFO_FLAGS_FAST 0x20000000 89#define IOINFO_FLAGS_READY 0x10000000 90#define IOINFO_FLAGS_HALTIO 0x08000000 91#define IOINFO_FLAGS_DOIO 0x04000000 92#define IOINFO_FLAGS_DOIO_Q 0x02000000 93#define IOINFO_FLAGS_W4FINAL 0x01000000 94#define IOINFO_FLAGS_REPALL 0x00800000 95 96extern ioinfo_t *ioinfo[]; 97int s390_set_private_data(int irq, void * data); 98void * s390_get_private_data(int irq); 99 100#define CHSC_SEI_ACC_CHPID 1 101#define CHSC_SEI_ACC_LINKADDR 2 102#define CHSC_SEI_ACC_FULLLINKADDR 3 103 104#endif /* __s390io_h */ 105 106