/*1* File...........: linux/drivers/s390/block/dasd.c2* Author(s)......: Holger Smolinski <[email protected]>3* Bugreports.to..: <[email protected]>4* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,20005* EMC Symmetrix ioctl Copyright EMC Corporation, 20086* Author.........: Nigel Hislop <[email protected]>7*8* This file is the interface of the DASD device driver, which is exported to user space9* any future changes wrt the API will result in a change of the APIVERSION reported10* to userspace by the DASDAPIVER-ioctl11*12*/1314#ifndef DASD_H15#define DASD_H16#include <linux/types.h>17#include <linux/ioctl.h>1819#define DASD_IOCTL_LETTER 'D'2021#define DASD_API_VERSION 62223/*24* struct dasd_information2_t25* represents any data about the device, which is visible to userspace.26* including foramt and featueres.27*/28typedef struct dasd_information2_t {29unsigned int devno; /* S/390 devno */30unsigned int real_devno; /* for aliases */31unsigned int schid; /* S/390 subchannel identifier */32unsigned int cu_type : 16; /* from SenseID */33unsigned int cu_model : 8; /* from SenseID */34unsigned int dev_type : 16; /* from SenseID */35unsigned int dev_model : 8; /* from SenseID */36unsigned int open_count;37unsigned int req_queue_len;38unsigned int chanq_len; /* length of chanq */39char type[4]; /* from discipline.name, 'none' for unknown */40unsigned int status; /* current device level */41unsigned int label_block; /* where to find the VOLSER */42unsigned int FBA_layout; /* fixed block size (like AIXVOL) */43unsigned int characteristics_size;44unsigned int confdata_size;45char characteristics[64]; /* from read_device_characteristics */46char configuration_data[256]; /* from read_configuration_data */47unsigned int format; /* format info like formatted/cdl/ldl/... */48unsigned int features; /* dasd features like 'ro',... */49unsigned int reserved0; /* reserved for further use ,... */50unsigned int reserved1; /* reserved for further use ,... */51unsigned int reserved2; /* reserved for further use ,... */52unsigned int reserved3; /* reserved for further use ,... */53unsigned int reserved4; /* reserved for further use ,... */54unsigned int reserved5; /* reserved for further use ,... */55unsigned int reserved6; /* reserved for further use ,... */56unsigned int reserved7; /* reserved for further use ,... */57} dasd_information2_t;5859/*60* values to be used for dasd_information_t.format61* 0x00: NOT formatted62* 0x01: Linux disc layout63* 0x02: Common disc layout64*/65#define DASD_FORMAT_NONE 066#define DASD_FORMAT_LDL 167#define DASD_FORMAT_CDL 268/*69* values to be used for dasd_information_t.features70* 0x00: default features71* 0x01: readonly (ro)72* 0x02: use diag discipline (diag)73* 0x04: set the device initially online (internal use only)74* 0x08: enable ERP related logging75* 0x20: give access to raw eckd data76*/77#define DASD_FEATURE_DEFAULT 0x0078#define DASD_FEATURE_READONLY 0x0179#define DASD_FEATURE_USEDIAG 0x0280#define DASD_FEATURE_INITIAL_ONLINE 0x0481#define DASD_FEATURE_ERPLOG 0x0882#define DASD_FEATURE_FAILFAST 0x1083#define DASD_FEATURE_FAILONSLCK 0x2084#define DASD_FEATURE_USERAW 0x408586#define DASD_PARTN_BITS 28788/*89* struct dasd_information_t90* represents any data about the data, which is visible to userspace91*/92typedef struct dasd_information_t {93unsigned int devno; /* S/390 devno */94unsigned int real_devno; /* for aliases */95unsigned int schid; /* S/390 subchannel identifier */96unsigned int cu_type : 16; /* from SenseID */97unsigned int cu_model : 8; /* from SenseID */98unsigned int dev_type : 16; /* from SenseID */99unsigned int dev_model : 8; /* from SenseID */100unsigned int open_count;101unsigned int req_queue_len;102unsigned int chanq_len; /* length of chanq */103char type[4]; /* from discipline.name, 'none' for unknown */104unsigned int status; /* current device level */105unsigned int label_block; /* where to find the VOLSER */106unsigned int FBA_layout; /* fixed block size (like AIXVOL) */107unsigned int characteristics_size;108unsigned int confdata_size;109char characteristics[64]; /* from read_device_characteristics */110char configuration_data[256]; /* from read_configuration_data */111} dasd_information_t;112113/*114* Read Subsystem Data - Performance Statistics115*/116typedef struct dasd_rssd_perf_stats_t {117unsigned char invalid:1;118unsigned char format:3;119unsigned char data_format:4;120unsigned char unit_address;121unsigned short device_status;122unsigned int nr_read_normal;123unsigned int nr_read_normal_hits;124unsigned int nr_write_normal;125unsigned int nr_write_fast_normal_hits;126unsigned int nr_read_seq;127unsigned int nr_read_seq_hits;128unsigned int nr_write_seq;129unsigned int nr_write_fast_seq_hits;130unsigned int nr_read_cache;131unsigned int nr_read_cache_hits;132unsigned int nr_write_cache;133unsigned int nr_write_fast_cache_hits;134unsigned int nr_inhibit_cache;135unsigned int nr_bybass_cache;136unsigned int nr_seq_dasd_to_cache;137unsigned int nr_dasd_to_cache;138unsigned int nr_cache_to_dasd;139unsigned int nr_delayed_fast_write;140unsigned int nr_normal_fast_write;141unsigned int nr_seq_fast_write;142unsigned int nr_cache_miss;143unsigned char status2;144unsigned int nr_quick_write_promotes;145unsigned char reserved;146unsigned short ssid;147unsigned char reseved2[96];148} __attribute__((packed)) dasd_rssd_perf_stats_t;149150/*151* struct profile_info_t152* holds the profinling information153*/154typedef struct dasd_profile_info_t {155unsigned int dasd_io_reqs; /* number of requests processed at all */156unsigned int dasd_io_sects; /* number of sectors processed at all */157unsigned int dasd_io_secs[32]; /* histogram of request's sizes */158unsigned int dasd_io_times[32]; /* histogram of requests's times */159unsigned int dasd_io_timps[32]; /* histogram of requests's times per sector */160unsigned int dasd_io_time1[32]; /* histogram of time from build to start */161unsigned int dasd_io_time2[32]; /* histogram of time from start to irq */162unsigned int dasd_io_time2ps[32]; /* histogram of time from start to irq */163unsigned int dasd_io_time3[32]; /* histogram of time from irq to end */164unsigned int dasd_io_nr_req[32]; /* histogram of # of requests in chanq */165} dasd_profile_info_t;166167/*168* struct format_data_t169* represents all data necessary to format a dasd170*/171typedef struct format_data_t {172unsigned int start_unit; /* from track */173unsigned int stop_unit; /* to track */174unsigned int blksize; /* sectorsize */175unsigned int intensity;176} format_data_t;177178/*179* values to be used for format_data_t.intensity180* 0/8: normal format181* 1/9: also write record zero182* 3/11: also write home address183* 4/12: invalidate track184*/185#define DASD_FMT_INT_FMT_R0 1 /* write record zero */186#define DASD_FMT_INT_FMT_HA 2 /* write home address, also set FMT_R0 ! */187#define DASD_FMT_INT_INVAL 4 /* invalidate tracks */188#define DASD_FMT_INT_COMPAT 8 /* use OS/390 compatible disk layout */189190191/*192* struct attrib_data_t193* represents the operation (cache) bits for the device.194* Used in DE to influence caching of the DASD.195*/196typedef struct attrib_data_t {197unsigned char operation:3; /* cache operation mode */198unsigned char reserved:5; /* cache operation mode */199__u16 nr_cyl; /* no of cyliners for read ahaed */200__u8 reserved2[29]; /* for future use */201} __attribute__ ((packed)) attrib_data_t;202203/* definition of operation (cache) bits within attributes of DE */204#define DASD_NORMAL_CACHE 0x0205#define DASD_BYPASS_CACHE 0x1206#define DASD_INHIBIT_LOAD 0x2207#define DASD_SEQ_ACCESS 0x3208#define DASD_SEQ_PRESTAGE 0x4209#define DASD_REC_ACCESS 0x5210211/*212* Perform EMC Symmetrix I/O213*/214typedef struct dasd_symmio_parms {215unsigned char reserved[8]; /* compat with older releases */216unsigned long long psf_data; /* char * cast to u64 */217unsigned long long rssd_result; /* char * cast to u64 */218int psf_data_len;219int rssd_result_len;220} __attribute__ ((packed)) dasd_symmio_parms_t;221222/*223* Data returned by Sense Path Group ID (SNID)224*/225struct dasd_snid_data {226struct {227__u8 group:2;228__u8 reserve:2;229__u8 mode:1;230__u8 res:3;231} __attribute__ ((packed)) path_state;232__u8 pgid[11];233} __attribute__ ((packed));234235struct dasd_snid_ioctl_data {236struct dasd_snid_data data;237__u8 path_mask;238} __attribute__ ((packed));239240241/********************************************************************************242* SECTION: Definition of IOCTLs243*244* Here ist how the ioctl-nr should be used:245* 0 - 31 DASD driver itself246* 32 - 239 still open247* 240 - 255 reserved for EMC248*******************************************************************************/249250/* Disable the volume (for Linux) */251#define BIODASDDISABLE _IO(DASD_IOCTL_LETTER,0)252/* Enable the volume (for Linux) */253#define BIODASDENABLE _IO(DASD_IOCTL_LETTER,1)254/* Issue a reserve/release command, rsp. */255#define BIODASDRSRV _IO(DASD_IOCTL_LETTER,2) /* reserve */256#define BIODASDRLSE _IO(DASD_IOCTL_LETTER,3) /* release */257#define BIODASDSLCK _IO(DASD_IOCTL_LETTER,4) /* steal lock */258/* reset profiling information of a device */259#define BIODASDPRRST _IO(DASD_IOCTL_LETTER,5)260/* Quiesce IO on device */261#define BIODASDQUIESCE _IO(DASD_IOCTL_LETTER,6)262/* Resume IO on device */263#define BIODASDRESUME _IO(DASD_IOCTL_LETTER,7)264265266/* retrieve API version number */267#define DASDAPIVER _IOR(DASD_IOCTL_LETTER,0,int)268/* Get information on a dasd device */269#define BIODASDINFO _IOR(DASD_IOCTL_LETTER,1,dasd_information_t)270/* retrieve profiling information of a device */271#define BIODASDPRRD _IOR(DASD_IOCTL_LETTER,2,dasd_profile_info_t)272/* Get information on a dasd device (enhanced) */273#define BIODASDINFO2 _IOR(DASD_IOCTL_LETTER,3,dasd_information2_t)274/* Performance Statistics Read */275#define BIODASDPSRD _IOR(DASD_IOCTL_LETTER,4,dasd_rssd_perf_stats_t)276/* Get Attributes (cache operations) */277#define BIODASDGATTR _IOR(DASD_IOCTL_LETTER,5,attrib_data_t)278279280/* #define BIODASDFORMAT _IOW(IOCTL_LETTER,0,format_data_t) , deprecated */281#define BIODASDFMT _IOW(DASD_IOCTL_LETTER,1,format_data_t)282/* Set Attributes (cache operations) */283#define BIODASDSATTR _IOW(DASD_IOCTL_LETTER,2,attrib_data_t)284285/* Get Sense Path Group ID (SNID) data */286#define BIODASDSNID _IOWR(DASD_IOCTL_LETTER, 1, struct dasd_snid_ioctl_data)287288#define BIODASDSYMMIO _IOWR(DASD_IOCTL_LETTER, 240, dasd_symmio_parms_t)289290#endif /* DASD_H */291292293294