diff options
| author | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 20:03:48 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 20:03:48 -0800 |
| commit | a931b32fc32a4c59f711ddea37ed56d414c9ded7 (patch) | |
| tree | 2eb9acf38b04e91065c6920b9d803b4716a75db2 /include | |
| parent | 70d68bd32041d22febb277038641d55c6ac7b57a (diff) | |
v2.4.7.4 -> v2.4.7.5
- Alan Cox: more merging
- L.C. Chang: new SiS IDE PCI id's.
- Maciej Rozycki: make MP table parsing more anal. Should fix broken P4 MP tables.
- Leonard Zubkoff: merge DAC960 completion changes
- Christoph Rohland: saner tmpfs mount-time limit behaviour (and remount)
- me: buffer.c logic update - faster and hopefully livelock-free
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-i386/serial.h | 16 | ||||
| -rw-r--r-- | include/asm-s390/cache.h | 2 | ||||
| -rw-r--r-- | include/asm-s390/dasd.h | 423 | ||||
| -rw-r--r-- | include/asm-s390/vtoc.h | 321 | ||||
| -rw-r--r-- | include/asm-s390x/cache.h | 2 | ||||
| -rw-r--r-- | include/asm-s390x/dasd.h | 423 | ||||
| -rw-r--r-- | include/asm-s390x/vtoc.h | 321 | ||||
| -rw-r--r-- | include/linux/blkdev.h | 2 | ||||
| -rw-r--r-- | include/linux/fs.h | 4 | ||||
| -rw-r--r-- | include/linux/ibmtr.h | 2 | ||||
| -rw-r--r-- | include/linux/pci_ids.h | 8 | ||||
| -rw-r--r-- | include/linux/serial.h | 3 |
12 files changed, 767 insertions, 760 deletions
diff --git a/include/asm-i386/serial.h b/include/asm-i386/serial.h index 33cd30fc9a6d..ecc8278676ed 100644 --- a/include/asm-i386/serial.h +++ b/include/asm-i386/serial.h @@ -31,7 +31,9 @@ #else #define RS_TABLE_SIZE #endif - + +#define MCA_COM_FLAGS (STD_COM_FLAGS|ASYNC_BOOT_ONLYMCA) + /* * The following define the access methods for the HUB6 card. All * access is through two ports for all 24 possible chips. The card is @@ -113,12 +115,12 @@ #ifdef CONFIG_MCA #define MCA_SERIAL_PORT_DFNS \ - { 0, BASE_BAUD, 0x3220, 3, STD_COM_FLAGS }, \ - { 0, BASE_BAUD, 0x3228, 3, STD_COM_FLAGS }, \ - { 0, BASE_BAUD, 0x4220, 3, STD_COM_FLAGS }, \ - { 0, BASE_BAUD, 0x4228, 3, STD_COM_FLAGS }, \ - { 0, BASE_BAUD, 0x5220, 3, STD_COM_FLAGS }, \ - { 0, BASE_BAUD, 0x5228, 3, STD_COM_FLAGS }, + { 0, BASE_BAUD, 0x3220, 3, MCA_COM_FLAGS }, \ + { 0, BASE_BAUD, 0x3228, 3, MCA_COM_FLAGS }, \ + { 0, BASE_BAUD, 0x4220, 3, MCA_COM_FLAGS }, \ + { 0, BASE_BAUD, 0x4228, 3, MCA_COM_FLAGS }, \ + { 0, BASE_BAUD, 0x5220, 3, MCA_COM_FLAGS }, \ + { 0, BASE_BAUD, 0x5228, 3, MCA_COM_FLAGS }, #else #define MCA_SERIAL_PORT_DFNS #endif diff --git a/include/asm-s390/cache.h b/include/asm-s390/cache.h index 93565f5e0191..ae5338ec5064 100644 --- a/include/asm-s390/cache.h +++ b/include/asm-s390/cache.h @@ -12,6 +12,6 @@ #define __ARCH_S390_CACHE_H #define L1_CACHE_BYTES 256 -#define L1_CACHE_SHIFT 16 +#define L1_CACHE_SHIFT 8 #endif diff --git a/include/asm-s390/dasd.h b/include/asm-s390/dasd.h index 3bde842ce288..f9ee1d530e48 100644 --- a/include/asm-s390/dasd.h +++ b/include/asm-s390/dasd.h @@ -4,43 +4,39 @@ * Bugreports.to..: <Linux390@de.ibm.com> * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 * + * This file is the interface of the DASD device driver, which is exported to user space + * any future changes wrt the API will result in a change of the APIVERSION reported + * to userspace by the DASDAPIVER-ioctl + * * History of changes (starts July 2000) - * 02/01/01 added dynamic registration of ioctls + * 05/04/01 created by moving the kernel interface to drivers/s390/block/dasd_int.h */ #ifndef DASD_H #define DASD_H - -#undef ERP_DEBUG /* enable debug messages */ -#undef ERP_FULL_ERP /* enable full ERP - experimental code !!!! */ -#define CONFIG_DASD_DYNAMIC - #include <linux/ioctl.h> -#include <asm/irq.h> -#define IOCTL_LETTER 'D' -/* Disable the volume (for Linux) */ -#define BIODASDDISABLE _IO(IOCTL_LETTER,0) -/* Enable the volume (for Linux) */ -#define BIODASDENABLE _IO(IOCTL_LETTER,1) -/* Issue a reserve/release command, rsp. */ -#define BIODASDRSRV _IO(IOCTL_LETTER,2) /* reserve */ -#define BIODASDRLSE _IO(IOCTL_LETTER,3) /* release */ -#define BIODASDSLCK _IO(IOCTL_LETTER,4) /* steal lock */ -/* Read sense ID infpormation */ -#define BIODASDRSID _IOR(IOCTL_LETTER,0,senseid_t) -/* Format the volume or an extent */ -#define BIODASDFORMAT _IOW(IOCTL_LETTER,0,format_data_t) -/* translate blocknumber of partition to absolute */ -#define BIODASDRWTB _IOWR(IOCTL_LETTER,0,int) +#define DASD_IOCTL_LETTER 'D' -typedef int(*dasd_ioctl_fn_t) (struct inode *inp, int no, long args); -int dasd_ioctl_no_register(int no, dasd_ioctl_fn_t handler); -int dasd_ioctl_no_unregister(int no, dasd_ioctl_fn_t handler); +#if (DASD_API_VERSION == 0) -#define DASD_NAME "dasd" #define DASD_PARTN_BITS 2 -#define DASD_PER_MAJOR ( 1U<<(MINORBITS-DASD_PARTN_BITS)) + +/* + * struct profile_info_t + * holds the profinling information + */ +typedef struct dasd_profile_info_t { + unsigned int dasd_io_reqs; /* number of requests processed at all */ + unsigned int dasd_io_sects; /* number of sectors processed at all */ + unsigned int dasd_io_secs[32]; /* histogram of request's sizes */ + unsigned int dasd_io_times[32]; /* histogram of requests's times */ + unsigned int dasd_io_timps[32]; /* histogram of requests's times per sector */ + unsigned int dasd_io_time1[32]; /* histogram of time from build to start */ + unsigned int dasd_io_time2[32]; /* histogram of time from start to irq */ + unsigned int dasd_io_time2ps[32]; /* histogram of time from start to irq */ + unsigned int dasd_io_time3[32]; /* histogram of time from irq to end */ +} dasd_profile_info_t; /* * struct format_data_t @@ -50,332 +46,65 @@ typedef struct format_data_t { int start_unit; /* from track */ int stop_unit; /* to track */ int blksize; /* sectorsize */ - int intensity; /* 0: normal, 1:record zero, 3:home address, 4 invalidate tracks */ -} __attribute__ ((packed)) format_data_t; - -#define DASD_FORMAT_DEFAULT_START_UNIT 0 -#define DASD_FORMAT_DEFAULT_STOP_UNIT -1 -#define DASD_FORMAT_DEFAULT_BLOCKSIZE -1 -#define DASD_FORMAT_DEFAULT_INTENSITY -1 - -#define DASD_FORMAT_INTENS_WRITE_RECZERO 0x01 -#define DASD_FORMAT_INTENS_WRITE_HOMEADR 0x02 -#define DASD_FORMAT_INTENS_INVALIDATE 0x04 -#define DASD_FORMAT_INTENS_CDL 0x08 -#ifdef __KERNEL__ -#include <linux/version.h> -#include <linux/major.h> -#include <linux/wait.h> -#include <asm/ccwcache.h> -#include <linux/blk.h> -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,3,98)) -#include <linux/blkdev.h> -#include <linux/devfs_fs_kernel.h> -#endif -#include <linux/genhd.h> -#include <linux/hdreg.h> -#include <linux/compatmac.h> - -#include <asm/s390dyn.h> -#include <asm/todclk.h> -#include <asm/debug.h> - -/* Kernel Version Compatibility section */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,98)) -typedef struct request *request_queue_t; -#define block_device_operations file_operations -#define __setup(x,y) struct dasd_device_t -#define devfs_register_blkdev(major,name,ops) register_blkdev(major,name,ops) -#define register_disk(dd,dev,partn,ops,size) \ -do { \ - dd->sizes[MINOR(dev)] = size >> 1; \ - resetup_one_dev(dd,MINOR(dev)>>DASD_PARTN_BITS); \ -} while(0) -#define init_waitqueue_head(x) do { *x = NULL; } while(0) -#define blk_cleanup_queue(x) do {} while(0) -#define blk_init_queue(x...) do {} while(0) -#define blk_queue_headactive(x...) do {} while(0) -#define blk_queue_make_request(x) do {} while(0) -#define list_empty(x) (0) -#define INIT_BLK_DEV(d_major,d_request_fn,d_queue_fn,d_current) \ -do { \ - blk_dev[d_major].request_fn = d_request_fn; \ - blk_dev[d_major].queue = d_queue_fn; \ - blk_dev[d_major].current_request = d_current; \ -} while(0) -#define INIT_GENDISK(D_MAJOR,D_NAME,D_PARTN_BITS,D_PER_MAJOR) \ - major:D_MAJOR, \ - major_name:D_NAME, \ - minor_shift:D_PARTN_BITS, \ - max_p:1 << D_PARTN_BITS, \ - max_nr:D_PER_MAJOR, \ - nr_real:D_PER_MAJOR, -static inline struct request * -dasd_next_request( request_queue_t *queue ) -{ - return *queue; -} -static inline void -dasd_dequeue_request( request_queue_t * q, struct request *req ) -{ - *q = req->next; - req->next = NULL; -} -#else -#define INIT_BLK_DEV(d_major,d_request_fn,d_queue_fn,d_current) \ -do { \ - blk_dev[d_major].queue = d_queue_fn; \ -} while(0) -#define INIT_GENDISK(D_MAJOR,D_NAME,D_PARTN_BITS,D_PER_MAJOR) \ - major:D_MAJOR, \ - major_name:D_NAME, \ - minor_shift:D_PARTN_BITS, \ - max_p:1 << D_PARTN_BITS, \ - nr_real:D_PER_MAJOR, -static inline struct request * -dasd_next_request( request_queue_t *queue ) -{ - return blkdev_entry_next_request(&queue->queue_head); -} -static inline void -dasd_dequeue_request( request_queue_t * q, struct request *req ) -{ - blkdev_dequeue_request (req); -} -#endif - -/* dasd_range_t are used for dynamic device att-/detachment */ -typedef struct dasd_devreg_t { - devreg_t devreg; /* the devreg itself */ - /* build a linked list of devregs, needed for cleanup */ - struct list_head list; -} dasd_devreg_t; - -typedef struct { - struct list_head list; - int no; - dasd_ioctl_fn_t handler; -} dasd_ioctl_list_t; - -typedef enum { - dasd_era_fatal = -1, /* no chance to recover */ - dasd_era_none = 0, /* don't recover, everything alright */ - dasd_era_msg = 1, /* don't recover, just report... */ - dasd_era_recover = 2 /* recovery action recommended */ -} dasd_era_t; - -/* BIT DEFINITIONS FOR SENSE DATA */ -#define DASD_SENSE_BIT_0 0x80 -#define DASD_SENSE_BIT_1 0x40 -#define DASD_SENSE_BIT_2 0x20 -#define DASD_SENSE_BIT_3 0x10 - -#define check_then_set(where,from,to) \ -do { \ - if ((*(where)) != (from) ) { \ - printk (KERN_ERR PRINTK_HEADER "was %d\n", *(where)); \ - BUG(); \ - } \ - (*(where)) = (to); \ -} while (0) - -#define DASD_MESSAGE(d_loglevel,d_device,d_string,d_args...)\ -do { \ - int d_devno = d_device->devinfo.devno; \ - int d_irq = d_device->devinfo.irq; \ - char *d_name = d_device->name; \ - int d_major = MAJOR(d_device->kdev); \ - int d_minor = MINOR(d_device->kdev); \ - printk(d_loglevel PRINTK_HEADER \ - "/dev/%s(%d:%d),%04X IRQ0x%x:" \ - d_string "\n",d_name,d_major,d_minor,d_devno,d_irq,d_args ); \ -} while(0) - -/* - * struct dasd_sizes_t - * represents all data needed to access dasd with properly set up sectors - */ -typedef -struct dasd_sizes_t { - unsigned long blocks; /* size of volume in blocks */ - unsigned int bp_block; /* bytes per block */ - unsigned int s2b_shift; /* log2 (bp_block/512) */ - unsigned int pt_block; /* from which block to read the partn table */ -} dasd_sizes_t; + int intensity; +} format_data_t; -/* - * struct dasd_chanq_t - * represents a queue of channel programs related to a single device +/* + * values to be used for format_data_t.intensity + * 0/8: normal format + * 1/9: also write record zero + * 3/11: also write home address + * 4/12: invalidate track */ -typedef -struct dasd_chanq_t { - ccw_req_t *head; - ccw_req_t *tail; -} dasd_chanq_t; - -#define DASD_DEVICE_FORMAT_STRING "Device: %p" -#define DASD_DEVICE_DEBUG_EVENT(d_level, d_device, d_str, d_data...)\ -do {\ - if ( d_device->debug_area != NULL )\ - debug_sprintf_event(d_device->debug_area,d_level,\ - DASD_DEVICE_FORMAT_STRING d_str "\n",\ - d_device, d_data);\ -} while(0); -#define DASD_DEVICE_DEBUG_EXCEPTION(d_level, d_device, d_str, d_data...)\ -do {\ - if ( d_device->debug_area != NULL )\ - debug_sprintf_exception(d_device->debug_area,d_level,\ - DASD_DEVICE_FORMAT_STRING d_str "\n",\ - d_device, d_data);\ -} while(0); - -#define DASD_DRIVER_FORMAT_STRING "Driver: <[%p]>" -#define DASD_DRIVER_DEBUG_EVENT(d_level, d_fn, d_str, d_data...)\ -do {\ - if ( dasd_debug_area != NULL )\ - debug_sprintf_event(dasd_debug_area, d_level,\ - DASD_DRIVER_FORMAT_STRING #d_fn ":" d_str "\n",\ - d_fn, d_data);\ -} while(0); -#define DASD_DRIVER_DEBUG_EXCEPTION(d_level, d_fn, d_str, d_data...)\ -do {\ - if ( dasd_debug_area != NULL )\ - debug_sprintf_exception(dasd_debug_area, d_level,\ - DASD_DRIVER_FORMAT_STRING #d_fn ":" d_str "\n",\ - d_fn, d_data);\ -} while(0); - -struct dasd_device_t; -struct request; +#define DASD_FMT_INT_FMT_R0 1 /* write record zero */ +#define DASD_FMT_INT_FMT_HA 2 /* write home address, also set FMT_R0 ! */ +#define DASD_FMT_INT_INVAL 4 /* invalidate tracks */ +#define DASD_FMT_INT_COMPAT 8 /* use OS/390 compatible disk layout */ /* - * signatures for the functions of dasd_discipline_t - * make typecasts much easier + * struct dasd_information_t + * represents any data about the data, which is visible to userspace */ -typedef ccw_req_t *(*dasd_erp_action_fn_t) (ccw_req_t * cqr); -typedef ccw_req_t *(*dasd_erp_postaction_fn_t) (ccw_req_t * cqr); - -typedef int (*dasd_ck_id_fn_t) (s390_dev_info_t *); -typedef int (*dasd_ck_characteristics_fn_t) (struct dasd_device_t *); -typedef int (*dasd_fill_geometry_fn_t) (struct dasd_device_t *, struct hd_geometry *); -typedef ccw_req_t *(*dasd_format_fn_t) (struct dasd_device_t *, struct format_data_t *); -typedef ccw_req_t *(*dasd_init_analysis_fn_t) (struct dasd_device_t *); -typedef int (*dasd_do_analysis_fn_t) (struct dasd_device_t *); -typedef int (*dasd_io_starter_fn_t) (ccw_req_t *); -typedef void (*dasd_int_handler_fn_t)(int irq, void *, struct pt_regs *); -typedef dasd_era_t (*dasd_error_examine_fn_t) (ccw_req_t *, devstat_t * stat); -typedef dasd_erp_action_fn_t (*dasd_error_analyse_fn_t) (ccw_req_t *); -typedef dasd_erp_postaction_fn_t (*dasd_erp_analyse_fn_t) (ccw_req_t *); -typedef ccw_req_t *(*dasd_cp_builder_fn_t)(struct dasd_device_t *,struct request *); -typedef char *(*dasd_dump_sense_fn_t)(struct dasd_device_t *,ccw_req_t *); -typedef ccw_req_t *(*dasd_reserve_fn_t)(struct dasd_device_t *); -typedef ccw_req_t *(*dasd_release_fn_t)(struct dasd_device_t *); -typedef ccw_req_t *(*dasd_merge_cp_fn_t)(struct dasd_device_t *); - - -/* - * the dasd_discipline_t is - * sth like a table of virtual functions, if you think of dasd_eckd - * inheriting dasd... - * no, currently we are not planning to reimplement the driver in C++ - */ -typedef struct dasd_discipline_t { - char ebcname[8]; /* a name used for tagging and printks */ - char name[8]; /* a name used for tagging and printks */ - int max_blocks; /* maximum number of blocks to be chained */ - dasd_ck_id_fn_t id_check; /* to check sense data */ - dasd_ck_characteristics_fn_t check_characteristics; /* to check the characteristics */ - dasd_init_analysis_fn_t init_analysis; /* to start the analysis of the volume */ - dasd_do_analysis_fn_t do_analysis; /* to complete the analysis of the volume */ - dasd_fill_geometry_fn_t fill_geometry; /* to set up hd_geometry */ - dasd_io_starter_fn_t start_IO; - dasd_format_fn_t format_device; /* to format the device */ - dasd_error_examine_fn_t examine_error; - dasd_error_analyse_fn_t erp_action; - dasd_erp_analyse_fn_t erp_postaction; - dasd_cp_builder_fn_t build_cp_from_req; - dasd_dump_sense_fn_t dump_sense; - dasd_int_handler_fn_t int_handler; - dasd_reserve_fn_t reserve; - dasd_release_fn_t release; - dasd_merge_cp_fn_t merge_cp; - - struct dasd_discipline_t *next; /* used for list of disciplines */ -} dasd_discipline_t; - -#define DASD_MAJOR_INFO_REGISTERED 1 -#define DASD_MAJOR_INFO_IS_STATIC 2 - -typedef struct major_info_t { - struct list_head list; - struct dasd_device_t **dasd_device; - int flags; - struct gendisk gendisk; /* actually contains the major number */ -} __attribute__ ((packed)) major_info_t; - -typedef struct dasd_profile_info_t { - unsigned long dasd_io_reqs; /* number of requests processed at all */ - unsigned long dasd_io_secs[32]; /* histogram of request's sizes */ - unsigned long dasd_io_times[32]; /* histogram of requests's times */ - unsigned long dasd_io_timps[32]; /* histogram of requests's times per sector */ - unsigned long dasd_io_time1[32]; /* histogram of time from build to start */ - unsigned long dasd_io_time2[32]; /* histogram of time from start to irq */ - unsigned long dasd_io_time2ps[32]; /* histogram of time from start to irq */ - unsigned long dasd_io_time3[32]; /* histogram of time from irq to end */ -} dasd_profile_info_t; - -typedef struct dasd_device_t { - s390_dev_info_t devinfo; - dasd_discipline_t *discipline; - int level; - int open_count; - kdev_t kdev; - major_info_t *major_info; - struct dasd_chanq_t queue; - wait_queue_head_t wait_q; - request_queue_t request_queue; - struct timer_list timer; - devstat_t dev_status; /* needed ONLY!! for request_irq */ - dasd_sizes_t sizes; - char name[16]; /* The name of the device in /dev */ - char *private; /* to be used by the discipline internally */ -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,3,98)) - devfs_handle_t devfs_entry; -#endif /* LINUX_IS_24 */ - struct tq_struct bh_tq; - atomic_t bh_scheduled; - debug_info_t *debug_area; - dasd_profile_info_t profile; - struct proc_dir_entry *proc_dir; /* directory node */ - struct proc_dir_entry *proc_info; /* information from dasd_device_t */ - struct proc_dir_entry *proc_stats; /* statictics information */ -} dasd_device_t; - -/* dasd_device_t.level can be: */ -#define DASD_DEVICE_LEVEL_UNKNOWN 0x00 -#define DASD_DEVICE_LEVEL_RECOGNIZED 0x01 -#define DASD_DEVICE_LEVEL_ANALYSIS_PENDING 0x02 -#define DASD_DEVICE_LEVEL_ANALYSIS_PREPARED 0x04 -#define DASD_DEVICE_LEVEL_ANALYSED 0x08 -#define DASD_DEVICE_LEVEL_ONLINE 0x10 - -int dasd_init (void); -void dasd_discipline_enq (dasd_discipline_t *); -int dasd_discipline_deq(dasd_discipline_t *); -int dasd_start_IO (ccw_req_t *); -void dasd_int_handler (int , void *, struct pt_regs *); -ccw_req_t *default_erp_action (ccw_req_t *); -ccw_req_t *default_erp_postaction (ccw_req_t *); -int dasd_chanq_deq (dasd_chanq_t *, ccw_req_t *); -ccw_req_t *dasd_alloc_request (char *, int, int); -void dasd_free_request (ccw_req_t *); -extern int (*genhd_dasd_name) (char *, int, int, struct gendisk *); -extern int (*genhd_dasd_fillgeo) (int, struct hd_geometry *); -int dasd_oper_handler (int irq, devreg_t * devreg); -void dasd_schedule_bh (dasd_device_t *); - -#endif /* __KERNEL__ */ +typedef struct dasd_information_t { + unsigned int devno; /* S/390 devno */ + unsigned int real_devno; /* for aliases */ + unsigned int schid; /* S/390 subchannel identifier */ + unsigned int cu_type : 16; /* from SenseID */ + unsigned int cu_model : 8; /* from SenseID */ + unsigned int dev_type : 16; /* from SenseID */ + unsigned int dev_model : 8; /* from SenseID */ + unsigned int open_count; + unsigned int req_queue_len; + unsigned int chanq_len; + char type[4]; /* from discipline.name, 'none' for unknown */ + unsigned int status; /* current device level */ + unsigned int label_block; /* where to find the VOLSER */ + unsigned int FBA_layout; /* fixed block size (like AIXVOL) */ + unsigned int characteristics_size; + unsigned int confdata_size; + char characteristics[64]; /* from read_device_characteristics */ + char configuration_data[256]; /* from read_configuration_data */ +} dasd_information_t; +/* Disable the volume (for Linux) */ +#define BIODASDDISABLE _IO(DASD_IOCTL_LETTER,0) +/* Enable the volume (for Linux) */ +#define BIODASDENABLE _IO(DASD_IOCTL_LETTER,1) +/* Issue a reserve/release command, rsp. */ +#define BIODASDRSRV _IO(DASD_IOCTL_LETTER,2) /* reserve */ +#define BIODASDRLSE _IO(DASD_IOCTL_LETTER,3) /* release */ +#define BIODASDSLCK _IO(DASD_IOCTL_LETTER,4) /* steal lock */ +/* reset profiling information of a device */ +#define BIODASDPRRST _IO(DASD_IOCTL_LETTER,5) +/* retrieve API version number */ +#define DASDAPIVER _IOR(DASD_IOCTL_LETTER,0,int) +/* Get information on a dasd device */ +#define BIODASDINFO _IOR(DASD_IOCTL_LETTER,1,dasd_information_t) +/* retrieve profiling information of a device */ +#define BIODASDPRRD _IOR(DASD_IOCTL_LETTER,2,dasd_profile_info_t) +/* #define BIODASDFORMAT _IOW(IOCTL_LETTER,0,format_data_t) , deprecated */ +#define BIODASDFMT _IOW(DASD_IOCTL_LETTER,1,format_data_t) +#endif /* DASD_API_VERSION */ #endif /* DASD_H */ /* diff --git a/include/asm-s390/vtoc.h b/include/asm-s390/vtoc.h index 2f53faaa6728..4a7927896ed5 100644 --- a/include/asm-s390/vtoc.h +++ b/include/asm-s390/vtoc.h @@ -15,41 +15,188 @@ #include <linux/types.h> #include <linux/hdreg.h> #include <linux/version.h> -#endif #include <asm/dasd.h> +#endif + +#define DASD_API_VERSION 0 #define LINE_LENGTH 80 #define VTOC_START_CC 0x0 #define VTOC_START_HH 0x1 +#define FIRST_USABLE_CYL 1 +#define FIRST_USABLE_TRK 2 + +#define DASD_3380_TYPE 13148 +#define DASD_3390_TYPE 13200 +#define DASD_9345_TYPE 37701 + +#define DASD_3380_VALUE 0xbb60 +#define DASD_3390_VALUE 0xe5a2 +#define DASD_9345_VALUE 0xbc98 + +#define VOLSER_LENGTH 6 +#define BIG_DISK_SIZE 0x10000 + +#define VTOC_ERROR "VTOC error:" enum failure {unable_to_open, unable_to_seek, unable_to_write, unable_to_read}; -typedef struct ttr { +unsigned char ASCtoEBC[256] = +{ + /*00 NL SH SX EX ET NQ AK BL */ + 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, + /*08 BS HT LF VT FF CR SO SI */ + 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + /*10 DL D1 D2 D3 D4 NK SN EB */ + 0x10, 0x11, 0x12, 0x13, 0x3C, 0x15, 0x32, 0x26, + /*18 CN EM SB EC FS GS RS US */ + 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F, + /*20 SP ! " # $ % & ' */ + 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, + /*28 ( ) * + , - . / */ + 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, + /*30 0 1 2 3 4 5 6 7 */ + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, + /*38 8 9 : ; < = > ? */ + 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, + /*40 @ A B C D E F G */ + 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, + /*48 H I J K L M N O */ + 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, + /*50 P Q R S T U V W */ + 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, + /*58 X Y Z [ \ ] ^ _ */ + 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D, + /*60 ` a b c d e f g */ + 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + /*68 h i j k l m n o */ + 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, + /*70 p q r s t u v w */ + 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, + /*78 x y z { | } ~ DL */ + 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0xFF +}; + + +unsigned char EBCtoASC[256] = +{ + /* 0x00 NUL SOH STX ETX *SEL HT *RNL DEL */ + 0x00, 0x01, 0x02, 0x03, 0x07, 0x09, 0x07, 0x7F, + /* 0x08 -GE -SPS -RPT VT FF CR SO SI */ + 0x07, 0x07, 0x07, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + /* 0x10 DLE DC1 DC2 DC3 -RES -NL BS -POC + -ENP ->LF */ + 0x10, 0x11, 0x12, 0x13, 0x07, 0x0A, 0x08, 0x07, + /* 0x18 CAN EM -UBS -CU1 -IFS -IGS -IRS -ITB + -IUS */ + 0x18, 0x19, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + /* 0x20 -DS -SOS FS -WUS -BYP LF ETB ESC + -INP */ + 0x07, 0x07, 0x1C, 0x07, 0x07, 0x0A, 0x17, 0x1B, + /* 0x28 -SA -SFE -SM -CSP -MFA ENQ ACK BEL + -SW */ + 0x07, 0x07, 0x07, 0x07, 0x07, 0x05, 0x06, 0x07, + /* 0x30 ---- ---- SYN -IR -PP -TRN -NBS EOT */ + 0x07, 0x07, 0x16, 0x07, 0x07, 0x07, 0x07, 0x04, + /* 0x38 -SBS -IT -RFF -CU3 DC4 NAK ---- SUB */ + 0x07, 0x07, 0x07, 0x07, 0x14, 0x15, 0x07, 0x1A, + /* 0x40 SP RSP ä ---- */ + 0x20, 0xFF, 0x83, 0x84, 0x85, 0xA0, 0x07, 0x86, + /* 0x48 . < ( + | */ + 0x87, 0xA4, 0x9B, 0x2E, 0x3C, 0x28, 0x2B, 0x7C, + /* 0x50 & ---- */ + 0x26, 0x82, 0x88, 0x89, 0x8A, 0xA1, 0x8C, 0x07, + /* 0x58 ß ! $ * ) ; */ + 0x8D, 0xE1, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0xAA, + /* 0x60 - / ---- Ä ---- ---- ---- */ + 0x2D, 0x2F, 0x07, 0x8E, 0x07, 0x07, 0x07, 0x8F, + /* 0x68 ---- , % _ > ? */ + 0x80, 0xA5, 0x07, 0x2C, 0x25, 0x5F, 0x3E, 0x3F, + /* 0x70 ---- ---- ---- ---- ---- ---- ---- */ + 0x07, 0x90, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + /* 0x78 * ` : # @ ' = " */ + 0x70, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22, + /* 0x80 * a b c d e f g */ + 0x07, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + /* 0x88 h i ---- ---- ---- */ + 0x68, 0x69, 0xAE, 0xAF, 0x07, 0x07, 0x07, 0xF1, + /* 0x90 ° j k l m n o p */ + 0xF8, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, + /* 0x98 q r ---- ---- */ + 0x71, 0x72, 0xA6, 0xA7, 0x91, 0x07, 0x92, 0x07, + /* 0xA0 ~ s t u v w x */ + 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, + /* 0xA8 y z ---- ---- ---- ---- */ + 0x79, 0x7A, 0xAD, 0xAB, 0x07, 0x07, 0x07, 0x07, + /* 0xB0 ^ ---- § ---- */ + 0x5E, 0x9C, 0x9D, 0xFA, 0x07, 0x07, 0x07, 0xAC, + /* 0xB8 ---- [ ] ---- ---- ---- ---- */ + 0xAB, 0x07, 0x5B, 0x5D, 0x07, 0x07, 0x07, 0x07, + /* 0xC0 { A B C D E F G */ + 0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, + /* 0xC8 H I ---- ö ---- */ + 0x48, 0x49, 0x07, 0x93, 0x94, 0x95, 0xA2, 0x07, + /* 0xD0 } J K L M N O P */ + 0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, + /* 0xD8 Q R ---- ü */ + 0x51, 0x52, 0x07, 0x96, 0x81, 0x97, 0xA3, 0x98, + /* 0xE0 \ S T U V W X */ + 0x5C, 0xF6, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, + /* 0xE8 Y Z ---- Ö ---- ---- ---- */ + 0x59, 0x5A, 0xFD, 0x07, 0x99, 0x07, 0x07, 0x07, + /* 0xF0 0 1 2 3 4 5 6 7 */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + /* 0xF8 8 9 ---- ---- Ü ---- ---- ---- */ + 0x38, 0x39, 0x07, 0x07, 0x9A, 0x07, 0x07, 0x07 +}; + +typedef struct ttr +{ __u16 tt; __u8 r; } __attribute__ ((packed)) ttr_t; -typedef struct cchhb { +typedef struct cchhb +{ __u16 cc; __u16 hh; __u8 b; } __attribute__ ((packed)) cchhb_t; -typedef struct cchh { +typedef struct cchh +{ __u16 cc; __u16 hh; } __attribute__ ((packed)) cchh_t; -typedef struct labeldate { +typedef struct labeldate +{ __u8 year; __u16 day; } __attribute__ ((packed)) labeldate_t; -typedef struct volume_label { +typedef struct volume_label +{ char volkey[4]; /* volume key = volume label */ char vollbl[4]; /* volume label */ char volid[6]; /* volume identifier */ @@ -66,7 +213,8 @@ typedef struct volume_label { } __attribute__ ((packed)) volume_label_t; -typedef struct extent { +typedef struct extent +{ __u8 typeind; /* extent type indicator */ __u8 seqno; /* extent sequence number */ cchh_t llimit; /* starting point of this extent */ @@ -74,7 +222,8 @@ typedef struct extent { } __attribute__ ((packed)) extent_t; -typedef struct dev_const { +typedef struct dev_const +{ __u16 DS4DSCYL; /* number of logical cyls */ __u16 DS4DSTRK; /* number of tracks in a logical cylinder */ __u16 DS4DEVTK; /* device track length */ @@ -88,7 +237,8 @@ typedef struct dev_const { } __attribute__ ((packed)) dev_const_t; -typedef struct format1_label { +typedef struct format1_label +{ char DS1DSNAM[44]; /* data set name */ __u8 DS1FMTID; /* format identifier */ char DS1DSSN[6]; /* data set serial number */ @@ -124,7 +274,8 @@ typedef struct format1_label { } __attribute__ ((packed)) format1_label_t; -typedef struct format4_label { +typedef struct format4_label +{ char DS4KEYCD[44]; /* key code for VTOC labels: 44 times 0x04 */ __u8 DS4IDFMT; /* format identifier */ cchhb_t DS4HPCHR; /* highest address of a format 1 DSCB */ @@ -153,6 +304,43 @@ typedef struct format4_label { } __attribute__ ((packed)) format4_label_t; +typedef struct ds5ext +{ + __u16 t; /* RTA of the first track of free extent */ + __u16 fc; /* number of whole cylinders in free ext. */ + __u8 ft; /* number of remaining free tracks */ +} __attribute__ ((packed)) ds5ext_t; + + +typedef struct format5_label +{ + char DS5KEYID[4]; /* key identifier */ + ds5ext_t DS5AVEXT; /* first available (free-space) extent. */ + ds5ext_t DS5EXTAV[7]; /* seven available extents */ + __u8 DS5FMTID; /* format identifier */ + ds5ext_t DS5MAVET[18]; /* eighteen available extents */ + cchhb_t DS5PTRDS[5]; /* pointer to next format5 DSCB */ +} __attribute__ ((packed)) format5_label_t; + + +typedef struct ds7ext +{ + __u32 a; /* starting RTA value */ + __u32 b; /* ending RTA value + 1 */ +} __attribute__ ((packed)) ds7ext_t; + + +typedef struct format7_label +{ + char DS7KEYID[4]; /* key identifier */ + ds7ext_t DS7EXTNT[5]; /* space for 5 extent descriptions */ + __u8 DS7FMTID; /* format identifier */ + ds7ext_t DS7ADEXT[11]; /* space for 11 extent descriptions */ + char res1[2]; /* reserved */ + cchhb_t DS7PTRDS; /* pointer to next FMT7 DSCB */ +} __attribute__ ((packed)) format7_label_t; + + char * vtoc_ebcdic_enc ( unsigned char source[LINE_LENGTH], unsigned char target[LINE_LENGTH], @@ -181,45 +369,126 @@ void vtoc_set_date ( __u8 year, __u16 day); +void vtoc_volume_label_init ( + volume_label_t *vlabel); int vtoc_read_volume_label ( char * device, unsigned long vlabel_start, volume_label_t * vlabel); + int vtoc_write_volume_label ( - char * device, + char *device, unsigned long vlabel_start, - volume_label_t * vlabel); + volume_label_t *vlabel); + +void vtoc_volume_label_set_volser ( + volume_label_t *vlabel, + char *volser); + +char *vtoc_volume_label_get_volser ( + volume_label_t *vlabel, + char *volser); + +void vtoc_volume_label_set_key ( + volume_label_t *vlabel, + char *key); + +void vtoc_volume_label_set_label ( + volume_label_t *vlabel, + char *lbl); + +char *vtoc_volume_label_get_label ( + volume_label_t *vlabel, + char *lbl); + void vtoc_read_label ( char *device, unsigned long position, + format1_label_t *f1, format4_label_t *f4, - format1_label_t *f1); + format5_label_t *f5, + format7_label_t *f7); + void vtoc_write_label ( char *device, unsigned long position, + format1_label_t *f1, format4_label_t *f4, - format1_label_t *f1); -void vtoc_init_format4_label ( - struct hd_geometry *geo, - format4_label_t *f4lbl, - unsigned int usable_partitions, - unsigned int cylinders, - unsigned int tracks, - unsigned int blocks); + format5_label_t *f5, + format7_label_t *f7); + + void vtoc_init_format1_label ( char *volid, unsigned int blksize, extent_t *part_extent, format1_label_t *f1); -void vtoc_update_format4_label ( - format4_label_t *f4, - cchhb_t *highest_f1, - __u8 unused_update, - __u16 freespace_update); +void vtoc_init_format4_label ( + format4_label_t *f4lbl, + unsigned int usable_partitions, + unsigned int cylinders, + unsigned int tracks, + unsigned int blocks, + unsigned int blksize, + __u16 dev_type); +void vtoc_update_format4_label ( + format4_label_t *f4, + cchhb_t *highest_f1, + __u16 unused_update); + + +void vtoc_init_format5_label ( + format5_label_t *f5); + +void vtoc_update_format5_label_add ( + format5_label_t *f5, + int verbose, + int cyl, + int trk, + __u16 a, + __u16 b, + __u8 c); + +void vtoc_update_format5_label_del ( + format5_label_t *f5, + int verbose, + int cyl, + int trk, + __u16 a, + __u16 b, + __u8 c); + + +void vtoc_init_format7_label ( + format7_label_t *f7); + +void vtoc_update_format7_label_add ( + format7_label_t *f7, + int verbose, + __u32 a, + __u32 b); + +void vtoc_update_format7_label_del ( + format7_label_t *f7, + int verbose, + __u32 a, + __u32 b); + + +void vtoc_set_freespace( + format4_label_t *f4, + format5_label_t *f5, + format7_label_t *f7, + char ch, + int verbose, + __u32 start, + __u32 stop, + int cyl, + int trk); diff --git a/include/asm-s390x/cache.h b/include/asm-s390x/cache.h index 93565f5e0191..ae5338ec5064 100644 --- a/include/asm-s390x/cache.h +++ b/include/asm-s390x/cache.h @@ -12,6 +12,6 @@ #define __ARCH_S390_CACHE_H #define L1_CACHE_BYTES 256 -#define L1_CACHE_SHIFT 16 +#define L1_CACHE_SHIFT 8 #endif diff --git a/include/asm-s390x/dasd.h b/include/asm-s390x/dasd.h index 3bde842ce288..f9ee1d530e48 100644 --- a/include/asm-s390x/dasd.h +++ b/include/asm-s390x/dasd.h @@ -4,43 +4,39 @@ * Bugreports.to..: <Linux390@de.ibm.com> * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 * + * This file is the interface of the DASD device driver, which is exported to user space + * any future changes wrt the API will result in a change of the APIVERSION reported + * to userspace by the DASDAPIVER-ioctl + * * History of changes (starts July 2000) - * 02/01/01 added dynamic registration of ioctls + * 05/04/01 created by moving the kernel interface to drivers/s390/block/dasd_int.h */ #ifndef DASD_H #define DASD_H - -#undef ERP_DEBUG /* enable debug messages */ -#undef ERP_FULL_ERP /* enable full ERP - experimental code !!!! */ -#define CONFIG_DASD_DYNAMIC - #include <linux/ioctl.h> -#include <asm/irq.h> -#define IOCTL_LETTER 'D' -/* Disable the volume (for Linux) */ -#define BIODASDDISABLE _IO(IOCTL_LETTER,0) -/* Enable the volume (for Linux) */ -#define BIODASDENABLE _IO(IOCTL_LETTER,1) -/* Issue a reserve/release command, rsp. */ -#define BIODASDRSRV _IO(IOCTL_LETTER,2) /* reserve */ -#define BIODASDRLSE _IO(IOCTL_LETTER,3) /* release */ -#define BIODASDSLCK _IO(IOCTL_LETTER,4) /* steal lock */ -/* Read sense ID infpormation */ -#define BIODASDRSID _IOR(IOCTL_LETTER,0,senseid_t) -/* Format the volume or an extent */ -#define BIODASDFORMAT _IOW(IOCTL_LETTER,0,format_data_t) -/* translate blocknumber of partition to absolute */ -#define BIODASDRWTB _IOWR(IOCTL_LETTER,0,int) +#define DASD_IOCTL_LETTER 'D' -typedef int(*dasd_ioctl_fn_t) (struct inode *inp, int no, long args); -int dasd_ioctl_no_register(int no, dasd_ioctl_fn_t handler); -int dasd_ioctl_no_unregister(int no, dasd_ioctl_fn_t handler); +#if (DASD_API_VERSION == 0) -#define DASD_NAME "dasd" #define DASD_PARTN_BITS 2 -#define DASD_PER_MAJOR ( 1U<<(MINORBITS-DASD_PARTN_BITS)) + +/* + * struct profile_info_t + * holds the profinling information + */ +typedef struct dasd_profile_info_t { + unsigned int dasd_io_reqs; /* number of requests processed at all */ + unsigned int dasd_io_sects; /* number of sectors processed at all */ + unsigned int dasd_io_secs[32]; /* histogram of request's sizes */ + unsigned int dasd_io_times[32]; /* histogram of requests's times */ + unsigned int dasd_io_timps[32]; /* histogram of requests's times per sector */ + unsigned int dasd_io_time1[32]; /* histogram of time from build to start */ + unsigned int dasd_io_time2[32]; /* histogram of time from start to irq */ + unsigned int dasd_io_time2ps[32]; /* histogram of time from start to irq */ + unsigned int dasd_io_time3[32]; /* histogram of time from irq to end */ +} dasd_profile_info_t; /* * struct format_data_t @@ -50,332 +46,65 @@ typedef struct format_data_t { int start_unit; /* from track */ int stop_unit; /* to track */ int blksize; /* sectorsize */ - int intensity; /* 0: normal, 1:record zero, 3:home address, 4 invalidate tracks */ -} __attribute__ ((packed)) format_data_t; - -#define DASD_FORMAT_DEFAULT_START_UNIT 0 -#define DASD_FORMAT_DEFAULT_STOP_UNIT -1 -#define DASD_FORMAT_DEFAULT_BLOCKSIZE -1 -#define DASD_FORMAT_DEFAULT_INTENSITY -1 - -#define DASD_FORMAT_INTENS_WRITE_RECZERO 0x01 -#define DASD_FORMAT_INTENS_WRITE_HOMEADR 0x02 -#define DASD_FORMAT_INTENS_INVALIDATE 0x04 -#define DASD_FORMAT_INTENS_CDL 0x08 -#ifdef __KERNEL__ -#include <linux/version.h> -#include <linux/major.h> -#include <linux/wait.h> -#include <asm/ccwcache.h> -#include <linux/blk.h> -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,3,98)) -#include <linux/blkdev.h> -#include <linux/devfs_fs_kernel.h> -#endif -#include <linux/genhd.h> -#include <linux/hdreg.h> -#include <linux/compatmac.h> - -#include <asm/s390dyn.h> -#include <asm/todclk.h> -#include <asm/debug.h> - -/* Kernel Version Compatibility section */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,98)) -typedef struct request *request_queue_t; -#define block_device_operations file_operations -#define __setup(x,y) struct dasd_device_t -#define devfs_register_blkdev(major,name,ops) register_blkdev(major,name,ops) -#define register_disk(dd,dev,partn,ops,size) \ -do { \ - dd->sizes[MINOR(dev)] = size >> 1; \ - resetup_one_dev(dd,MINOR(dev)>>DASD_PARTN_BITS); \ -} while(0) -#define init_waitqueue_head(x) do { *x = NULL; } while(0) -#define blk_cleanup_queue(x) do {} while(0) -#define blk_init_queue(x...) do {} while(0) -#define blk_queue_headactive(x...) do {} while(0) -#define blk_queue_make_request(x) do {} while(0) -#define list_empty(x) (0) -#define INIT_BLK_DEV(d_major,d_request_fn,d_queue_fn,d_current) \ -do { \ - blk_dev[d_major].request_fn = d_request_fn; \ - blk_dev[d_major].queue = d_queue_fn; \ - blk_dev[d_major].current_request = d_current; \ -} while(0) -#define INIT_GENDISK(D_MAJOR,D_NAME,D_PARTN_BITS,D_PER_MAJOR) \ - major:D_MAJOR, \ - major_name:D_NAME, \ - minor_shift:D_PARTN_BITS, \ - max_p:1 << D_PARTN_BITS, \ - max_nr:D_PER_MAJOR, \ - nr_real:D_PER_MAJOR, -static inline struct request * -dasd_next_request( request_queue_t *queue ) -{ - return *queue; -} -static inline void -dasd_dequeue_request( request_queue_t * q, struct request *req ) -{ - *q = req->next; - req->next = NULL; -} -#else -#define INIT_BLK_DEV(d_major,d_request_fn,d_queue_fn,d_current) \ -do { \ - blk_dev[d_major].queue = d_queue_fn; \ -} while(0) -#define INIT_GENDISK(D_MAJOR,D_NAME,D_PARTN_BITS,D_PER_MAJOR) \ - major:D_MAJOR, \ - major_name:D_NAME, \ - minor_shift:D_PARTN_BITS, \ - max_p:1 << D_PARTN_BITS, \ - nr_real:D_PER_MAJOR, -static inline struct request * -dasd_next_request( request_queue_t *queue ) -{ - return blkdev_entry_next_request(&queue->queue_head); -} -static inline void -dasd_dequeue_request( request_queue_t * q, struct request *req ) -{ - blkdev_dequeue_request (req); -} -#endif - -/* dasd_range_t are used for dynamic device att-/detachment */ -typedef struct dasd_devreg_t { - devreg_t devreg; /* the devreg itself */ - /* build a linked list of devregs, needed for cleanup */ - struct list_head list; -} dasd_devreg_t; - -typedef struct { - struct list_head list; - int no; - dasd_ioctl_fn_t handler; -} dasd_ioctl_list_t; - -typedef enum { - dasd_era_fatal = -1, /* no chance to recover */ - dasd_era_none = 0, /* don't recover, everything alright */ - dasd_era_msg = 1, /* don't recover, just report... */ - dasd_era_recover = 2 /* recovery action recommended */ -} dasd_era_t; - -/* BIT DEFINITIONS FOR SENSE DATA */ -#define DASD_SENSE_BIT_0 0x80 -#define DASD_SENSE_BIT_1 0x40 -#define DASD_SENSE_BIT_2 0x20 -#define DASD_SENSE_BIT_3 0x10 - -#define check_then_set(where,from,to) \ -do { \ - if ((*(where)) != (from) ) { \ - printk (KERN_ERR PRINTK_HEADER "was %d\n", *(where)); \ - BUG(); \ - } \ - (*(where)) = (to); \ -} while (0) - -#define DASD_MESSAGE(d_loglevel,d_device,d_string,d_args...)\ -do { \ - int d_devno = d_device->devinfo.devno; \ - int d_irq = d_device->devinfo.irq; \ - char *d_name = d_device->name; \ - int d_major = MAJOR(d_device->kdev); \ - int d_minor = MINOR(d_device->kdev); \ - printk(d_loglevel PRINTK_HEADER \ - "/dev/%s(%d:%d),%04X IRQ0x%x:" \ - d_string "\n",d_name,d_major,d_minor,d_devno,d_irq,d_args ); \ -} while(0) - -/* - * struct dasd_sizes_t - * represents all data needed to access dasd with properly set up sectors - */ -typedef -struct dasd_sizes_t { - unsigned long blocks; /* size of volume in blocks */ - unsigned int bp_block; /* bytes per block */ - unsigned int s2b_shift; /* log2 (bp_block/512) */ - unsigned int pt_block; /* from which block to read the partn table */ -} dasd_sizes_t; + int intensity; +} format_data_t; -/* - * struct dasd_chanq_t - * represents a queue of channel programs related to a single device +/* + * values to be used for format_data_t.intensity + * 0/8: normal format + * 1/9: also write record zero + * 3/11: also write home address + * 4/12: invalidate track */ -typedef -struct dasd_chanq_t { - ccw_req_t *head; - ccw_req_t *tail; -} dasd_chanq_t; - -#define DASD_DEVICE_FORMAT_STRING "Device: %p" -#define DASD_DEVICE_DEBUG_EVENT(d_level, d_device, d_str, d_data...)\ -do {\ - if ( d_device->debug_area != NULL )\ - debug_sprintf_event(d_device->debug_area,d_level,\ - DASD_DEVICE_FORMAT_STRING d_str "\n",\ - d_device, d_data);\ -} while(0); -#define DASD_DEVICE_DEBUG_EXCEPTION(d_level, d_device, d_str, d_data...)\ -do {\ - if ( d_device->debug_area != NULL )\ - debug_sprintf_exception(d_device->debug_area,d_level,\ - DASD_DEVICE_FORMAT_STRING d_str "\n",\ - d_device, d_data);\ -} while(0); - -#define DASD_DRIVER_FORMAT_STRING "Driver: <[%p]>" -#define DASD_DRIVER_DEBUG_EVENT(d_level, d_fn, d_str, d_data...)\ -do {\ - if ( dasd_debug_area != NULL )\ - debug_sprintf_event(dasd_debug_area, d_level,\ - DASD_DRIVER_FORMAT_STRING #d_fn ":" d_str "\n",\ - d_fn, d_data);\ -} while(0); -#define DASD_DRIVER_DEBUG_EXCEPTION(d_level, d_fn, d_str, d_data...)\ -do {\ - if ( dasd_debug_area != NULL )\ - debug_sprintf_exception(dasd_debug_area, d_level,\ - DASD_DRIVER_FORMAT_STRING #d_fn ":" d_str "\n",\ - d_fn, d_data);\ -} while(0); - -struct dasd_device_t; -struct request; +#define DASD_FMT_INT_FMT_R0 1 /* write record zero */ +#define DASD_FMT_INT_FMT_HA 2 /* write home address, also set FMT_R0 ! */ +#define DASD_FMT_INT_INVAL 4 /* invalidate tracks */ +#define DASD_FMT_INT_COMPAT 8 /* use OS/390 compatible disk layout */ /* - * signatures for the functions of dasd_discipline_t - * make typecasts much easier + * struct dasd_information_t + * represents any data about the data, which is visible to userspace */ -typedef ccw_req_t *(*dasd_erp_action_fn_t) (ccw_req_t * cqr); -typedef ccw_req_t *(*dasd_erp_postaction_fn_t) (ccw_req_t * cqr); - -typedef int (*dasd_ck_id_fn_t) (s390_dev_info_t *); -typedef int (*dasd_ck_characteristics_fn_t) (struct dasd_device_t *); -typedef int (*dasd_fill_geometry_fn_t) (struct dasd_device_t *, struct hd_geometry *); -typedef ccw_req_t *(*dasd_format_fn_t) (struct dasd_device_t *, struct format_data_t *); -typedef ccw_req_t *(*dasd_init_analysis_fn_t) (struct dasd_device_t *); -typedef int (*dasd_do_analysis_fn_t) (struct dasd_device_t *); -typedef int (*dasd_io_starter_fn_t) (ccw_req_t *); -typedef void (*dasd_int_handler_fn_t)(int irq, void *, struct pt_regs *); -typedef dasd_era_t (*dasd_error_examine_fn_t) (ccw_req_t *, devstat_t * stat); -typedef dasd_erp_action_fn_t (*dasd_error_analyse_fn_t) (ccw_req_t *); -typedef dasd_erp_postaction_fn_t (*dasd_erp_analyse_fn_t) (ccw_req_t *); -typedef ccw_req_t *(*dasd_cp_builder_fn_t)(struct dasd_device_t *,struct request *); -typedef char *(*dasd_dump_sense_fn_t)(struct dasd_device_t *,ccw_req_t *); -typedef ccw_req_t *(*dasd_reserve_fn_t)(struct dasd_device_t *); -typedef ccw_req_t *(*dasd_release_fn_t)(struct dasd_device_t *); -typedef ccw_req_t *(*dasd_merge_cp_fn_t)(struct dasd_device_t *); - - -/* - * the dasd_discipline_t is - * sth like a table of virtual functions, if you think of dasd_eckd - * inheriting dasd... - * no, currently we are not planning to reimplement the driver in C++ - */ -typedef struct dasd_discipline_t { - char ebcname[8]; /* a name used for tagging and printks */ - char name[8]; /* a name used for tagging and printks */ - int max_blocks; /* maximum number of blocks to be chained */ - dasd_ck_id_fn_t id_check; /* to check sense data */ - dasd_ck_characteristics_fn_t check_characteristics; /* to check the characteristics */ - dasd_init_analysis_fn_t init_analysis; /* to start the analysis of the volume */ - dasd_do_analysis_fn_t do_analysis; /* to complete the analysis of the volume */ - dasd_fill_geometry_fn_t fill_geometry; /* to set up hd_geometry */ - dasd_io_starter_fn_t start_IO; - dasd_format_fn_t format_device; /* to format the device */ - dasd_error_examine_fn_t examine_error; - dasd_error_analyse_fn_t erp_action; - dasd_erp_analyse_fn_t erp_postaction; - dasd_cp_builder_fn_t build_cp_from_req; - dasd_dump_sense_fn_t dump_sense; - dasd_int_handler_fn_t int_handler; - dasd_reserve_fn_t reserve; - dasd_release_fn_t release; - dasd_merge_cp_fn_t merge_cp; - - struct dasd_discipline_t *next; /* used for list of disciplines */ -} dasd_discipline_t; - -#define DASD_MAJOR_INFO_REGISTERED 1 -#define DASD_MAJOR_INFO_IS_STATIC 2 - -typedef struct major_info_t { - struct list_head list; - struct dasd_device_t **dasd_device; - int flags; - struct gendisk gendisk; /* actually contains the major number */ -} __attribute__ ((packed)) major_info_t; - -typedef struct dasd_profile_info_t { - unsigned long dasd_io_reqs; /* number of requests processed at all */ - unsigned long dasd_io_secs[32]; /* histogram of request's sizes */ - unsigned long dasd_io_times[32]; /* histogram of requests's times */ - unsigned long dasd_io_timps[32]; /* histogram of requests's times per sector */ - unsigned long dasd_io_time1[32]; /* histogram of time from build to start */ - unsigned long dasd_io_time2[32]; /* histogram of time from start to irq */ - unsigned long dasd_io_time2ps[32]; /* histogram of time from start to irq */ - unsigned long dasd_io_time3[32]; /* histogram of time from irq to end */ -} dasd_profile_info_t; - -typedef struct dasd_device_t { - s390_dev_info_t devinfo; - dasd_discipline_t *discipline; - int level; - int open_count; - kdev_t kdev; - major_info_t *major_info; - struct dasd_chanq_t queue; - wait_queue_head_t wait_q; - request_queue_t request_queue; - struct timer_list timer; - devstat_t dev_status; /* needed ONLY!! for request_irq */ - dasd_sizes_t sizes; - char name[16]; /* The name of the device in /dev */ - char *private; /* to be used by the discipline internally */ -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,3,98)) - devfs_handle_t devfs_entry; -#endif /* LINUX_IS_24 */ - struct tq_struct bh_tq; - atomic_t bh_scheduled; - debug_info_t *debug_area; - dasd_profile_info_t profile; - struct proc_dir_entry *proc_dir; /* directory node */ - struct proc_dir_entry *proc_info; /* information from dasd_device_t */ - struct proc_dir_entry *proc_stats; /* statictics information */ -} dasd_device_t; - -/* dasd_device_t.level can be: */ -#define DASD_DEVICE_LEVEL_UNKNOWN 0x00 -#define DASD_DEVICE_LEVEL_RECOGNIZED 0x01 -#define DASD_DEVICE_LEVEL_ANALYSIS_PENDING 0x02 -#define DASD_DEVICE_LEVEL_ANALYSIS_PREPARED 0x04 -#define DASD_DEVICE_LEVEL_ANALYSED 0x08 -#define DASD_DEVICE_LEVEL_ONLINE 0x10 - -int dasd_init (void); -void dasd_discipline_enq (dasd_discipline_t *); -int dasd_discipline_deq(dasd_discipline_t *); -int dasd_start_IO (ccw_req_t *); -void dasd_int_handler (int , void *, struct pt_regs *); -ccw_req_t *default_erp_action (ccw_req_t *); -ccw_req_t *default_erp_postaction (ccw_req_t *); -int dasd_chanq_deq (dasd_chanq_t *, ccw_req_t *); -ccw_req_t *dasd_alloc_request (char *, int, int); -void dasd_free_request (ccw_req_t *); -extern int (*genhd_dasd_name) (char *, int, int, struct gendisk *); -extern int (*genhd_dasd_fillgeo) (int, struct hd_geometry *); -int dasd_oper_handler (int irq, devreg_t * devreg); -void dasd_schedule_bh (dasd_device_t *); - -#endif /* __KERNEL__ */ +typedef struct dasd_information_t { + unsigned int devno; /* S/390 devno */ + unsigned int real_devno; /* for aliases */ + unsigned int schid; /* S/390 subchannel identifier */ + unsigned int cu_type : 16; /* from SenseID */ + unsigned int cu_model : 8; /* from SenseID */ + unsigned int dev_type : 16; /* from SenseID */ + unsigned int dev_model : 8; /* from SenseID */ + unsigned int open_count; + unsigned int req_queue_len; + unsigned int chanq_len; + char type[4]; /* from discipline.name, 'none' for unknown */ + unsigned int status; /* current device level */ + unsigned int label_block; /* where to find the VOLSER */ + unsigned int FBA_layout; /* fixed block size (like AIXVOL) */ + unsigned int characteristics_size; + unsigned int confdata_size; + char characteristics[64]; /* from read_device_characteristics */ + char configuration_data[256]; /* from read_configuration_data */ +} dasd_information_t; +/* Disable the volume (for Linux) */ +#define BIODASDDISABLE _IO(DASD_IOCTL_LETTER,0) +/* Enable the volume (for Linux) */ +#define BIODASDENABLE _IO(DASD_IOCTL_LETTER,1) +/* Issue a reserve/release command, rsp. */ +#define BIODASDRSRV _IO(DASD_IOCTL_LETTER,2) /* reserve */ +#define BIODASDRLSE _IO(DASD_IOCTL_LETTER,3) /* release */ +#define BIODASDSLCK _IO(DASD_IOCTL_LETTER,4) /* steal lock */ +/* reset profiling information of a device */ +#define BIODASDPRRST _IO(DASD_IOCTL_LETTER,5) +/* retrieve API version number */ +#define DASDAPIVER _IOR(DASD_IOCTL_LETTER,0,int) +/* Get information on a dasd device */ +#define BIODASDINFO _IOR(DASD_IOCTL_LETTER,1,dasd_information_t) +/* retrieve profiling information of a device */ +#define BIODASDPRRD _IOR(DASD_IOCTL_LETTER,2,dasd_profile_info_t) +/* #define BIODASDFORMAT _IOW(IOCTL_LETTER,0,format_data_t) , deprecated */ +#define BIODASDFMT _IOW(DASD_IOCTL_LETTER,1,format_data_t) +#endif /* DASD_API_VERSION */ #endif /* DASD_H */ /* diff --git a/include/asm-s390x/vtoc.h b/include/asm-s390x/vtoc.h index 2f53faaa6728..4a7927896ed5 100644 --- a/include/asm-s390x/vtoc.h +++ b/include/asm-s390x/vtoc.h @@ -15,41 +15,188 @@ #include <linux/types.h> #include <linux/hdreg.h> #include <linux/version.h> -#endif #include <asm/dasd.h> +#endif + +#define DASD_API_VERSION 0 #define LINE_LENGTH 80 #define VTOC_START_CC 0x0 #define VTOC_START_HH 0x1 +#define FIRST_USABLE_CYL 1 +#define FIRST_USABLE_TRK 2 + +#define DASD_3380_TYPE 13148 +#define DASD_3390_TYPE 13200 +#define DASD_9345_TYPE 37701 + +#define DASD_3380_VALUE 0xbb60 +#define DASD_3390_VALUE 0xe5a2 +#define DASD_9345_VALUE 0xbc98 + +#define VOLSER_LENGTH 6 +#define BIG_DISK_SIZE 0x10000 + +#define VTOC_ERROR "VTOC error:" enum failure {unable_to_open, unable_to_seek, unable_to_write, unable_to_read}; -typedef struct ttr { +unsigned char ASCtoEBC[256] = +{ + /*00 NL SH SX EX ET NQ AK BL */ + 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, + /*08 BS HT LF VT FF CR SO SI */ + 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + /*10 DL D1 D2 D3 D4 NK SN EB */ + 0x10, 0x11, 0x12, 0x13, 0x3C, 0x15, 0x32, 0x26, + /*18 CN EM SB EC FS GS RS US */ + 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F, + /*20 SP ! " # $ % & ' */ + 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, + /*28 ( ) * + , - . / */ + 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, + /*30 0 1 2 3 4 5 6 7 */ + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, + /*38 8 9 : ; < = > ? */ + 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, + /*40 @ A B C D E F G */ + 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, + /*48 H I J K L M N O */ + 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, + /*50 P Q R S T U V W */ + 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, + /*58 X Y Z [ \ ] ^ _ */ + 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D, + /*60 ` a b c d e f g */ + 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + /*68 h i j k l m n o */ + 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, + /*70 p q r s t u v w */ + 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, + /*78 x y z { | } ~ DL */ + 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, + 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0xFF +}; + + +unsigned char EBCtoASC[256] = +{ + /* 0x00 NUL SOH STX ETX *SEL HT *RNL DEL */ + 0x00, 0x01, 0x02, 0x03, 0x07, 0x09, 0x07, 0x7F, + /* 0x08 -GE -SPS -RPT VT FF CR SO SI */ + 0x07, 0x07, 0x07, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + /* 0x10 DLE DC1 DC2 DC3 -RES -NL BS -POC + -ENP ->LF */ + 0x10, 0x11, 0x12, 0x13, 0x07, 0x0A, 0x08, 0x07, + /* 0x18 CAN EM -UBS -CU1 -IFS -IGS -IRS -ITB + -IUS */ + 0x18, 0x19, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + /* 0x20 -DS -SOS FS -WUS -BYP LF ETB ESC + -INP */ + 0x07, 0x07, 0x1C, 0x07, 0x07, 0x0A, 0x17, 0x1B, + /* 0x28 -SA -SFE -SM -CSP -MFA ENQ ACK BEL + -SW */ + 0x07, 0x07, 0x07, 0x07, 0x07, 0x05, 0x06, 0x07, + /* 0x30 ---- ---- SYN -IR -PP -TRN -NBS EOT */ + 0x07, 0x07, 0x16, 0x07, 0x07, 0x07, 0x07, 0x04, + /* 0x38 -SBS -IT -RFF -CU3 DC4 NAK ---- SUB */ + 0x07, 0x07, 0x07, 0x07, 0x14, 0x15, 0x07, 0x1A, + /* 0x40 SP RSP ä ---- */ + 0x20, 0xFF, 0x83, 0x84, 0x85, 0xA0, 0x07, 0x86, + /* 0x48 . < ( + | */ + 0x87, 0xA4, 0x9B, 0x2E, 0x3C, 0x28, 0x2B, 0x7C, + /* 0x50 & ---- */ + 0x26, 0x82, 0x88, 0x89, 0x8A, 0xA1, 0x8C, 0x07, + /* 0x58 ß ! $ * ) ; */ + 0x8D, 0xE1, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0xAA, + /* 0x60 - / ---- Ä ---- ---- ---- */ + 0x2D, 0x2F, 0x07, 0x8E, 0x07, 0x07, 0x07, 0x8F, + /* 0x68 ---- , % _ > ? */ + 0x80, 0xA5, 0x07, 0x2C, 0x25, 0x5F, 0x3E, 0x3F, + /* 0x70 ---- ---- ---- ---- ---- ---- ---- */ + 0x07, 0x90, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + /* 0x78 * ` : # @ ' = " */ + 0x70, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22, + /* 0x80 * a b c d e f g */ + 0x07, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + /* 0x88 h i ---- ---- ---- */ + 0x68, 0x69, 0xAE, 0xAF, 0x07, 0x07, 0x07, 0xF1, + /* 0x90 ° j k l m n o p */ + 0xF8, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, + /* 0x98 q r ---- ---- */ + 0x71, 0x72, 0xA6, 0xA7, 0x91, 0x07, 0x92, 0x07, + /* 0xA0 ~ s t u v w x */ + 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, + /* 0xA8 y z ---- ---- ---- ---- */ + 0x79, 0x7A, 0xAD, 0xAB, 0x07, 0x07, 0x07, 0x07, + /* 0xB0 ^ ---- § ---- */ + 0x5E, 0x9C, 0x9D, 0xFA, 0x07, 0x07, 0x07, 0xAC, + /* 0xB8 ---- [ ] ---- ---- ---- ---- */ + 0xAB, 0x07, 0x5B, 0x5D, 0x07, 0x07, 0x07, 0x07, + /* 0xC0 { A B C D E F G */ + 0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, + /* 0xC8 H I ---- ö ---- */ + 0x48, 0x49, 0x07, 0x93, 0x94, 0x95, 0xA2, 0x07, + /* 0xD0 } J K L M N O P */ + 0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, + /* 0xD8 Q R ---- ü */ + 0x51, 0x52, 0x07, 0x96, 0x81, 0x97, 0xA3, 0x98, + /* 0xE0 \ S T U V W X */ + 0x5C, 0xF6, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, + /* 0xE8 Y Z ---- Ö ---- ---- ---- */ + 0x59, 0x5A, 0xFD, 0x07, 0x99, 0x07, 0x07, 0x07, + /* 0xF0 0 1 2 3 4 5 6 7 */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + /* 0xF8 8 9 ---- ---- Ü ---- ---- ---- */ + 0x38, 0x39, 0x07, 0x07, 0x9A, 0x07, 0x07, 0x07 +}; + +typedef struct ttr +{ __u16 tt; __u8 r; } __attribute__ ((packed)) ttr_t; -typedef struct cchhb { +typedef struct cchhb +{ __u16 cc; __u16 hh; __u8 b; } __attribute__ ((packed)) cchhb_t; -typedef struct cchh { +typedef struct cchh +{ __u16 cc; __u16 hh; } __attribute__ ((packed)) cchh_t; -typedef struct labeldate { +typedef struct labeldate +{ __u8 year; __u16 day; } __attribute__ ((packed)) labeldate_t; -typedef struct volume_label { +typedef struct volume_label +{ char volkey[4]; /* volume key = volume label */ char vollbl[4]; /* volume label */ char volid[6]; /* volume identifier */ @@ -66,7 +213,8 @@ typedef struct volume_label { } __attribute__ ((packed)) volume_label_t; -typedef struct extent { +typedef struct extent +{ __u8 typeind; /* extent type indicator */ __u8 seqno; /* extent sequence number */ cchh_t llimit; /* starting point of this extent */ @@ -74,7 +222,8 @@ typedef struct extent { } __attribute__ ((packed)) extent_t; -typedef struct dev_const { +typedef struct dev_const +{ __u16 DS4DSCYL; /* number of logical cyls */ __u16 DS4DSTRK; /* number of tracks in a logical cylinder */ __u16 DS4DEVTK; /* device track length */ @@ -88,7 +237,8 @@ typedef struct dev_const { } __attribute__ ((packed)) dev_const_t; -typedef struct format1_label { +typedef struct format1_label +{ char DS1DSNAM[44]; /* data set name */ __u8 DS1FMTID; /* format identifier */ char DS1DSSN[6]; /* data set serial number */ @@ -124,7 +274,8 @@ typedef struct format1_label { } __attribute__ ((packed)) format1_label_t; -typedef struct format4_label { +typedef struct format4_label +{ char DS4KEYCD[44]; /* key code for VTOC labels: 44 times 0x04 */ __u8 DS4IDFMT; /* format identifier */ cchhb_t DS4HPCHR; /* highest address of a format 1 DSCB */ @@ -153,6 +304,43 @@ typedef struct format4_label { } __attribute__ ((packed)) format4_label_t; +typedef struct ds5ext +{ + __u16 t; /* RTA of the first track of free extent */ + __u16 fc; /* number of whole cylinders in free ext. */ + __u8 ft; /* number of remaining free tracks */ +} __attribute__ ((packed)) ds5ext_t; + + +typedef struct format5_label +{ + char DS5KEYID[4]; /* key identifier */ + ds5ext_t DS5AVEXT; /* first available (free-space) extent. */ + ds5ext_t DS5EXTAV[7]; /* seven available extents */ + __u8 DS5FMTID; /* format identifier */ + ds5ext_t DS5MAVET[18]; /* eighteen available extents */ + cchhb_t DS5PTRDS[5]; /* pointer to next format5 DSCB */ +} __attribute__ ((packed)) format5_label_t; + + +typedef struct ds7ext +{ + __u32 a; /* starting RTA value */ + __u32 b; /* ending RTA value + 1 */ +} __attribute__ ((packed)) ds7ext_t; + + +typedef struct format7_label +{ + char DS7KEYID[4]; /* key identifier */ + ds7ext_t DS7EXTNT[5]; /* space for 5 extent descriptions */ + __u8 DS7FMTID; /* format identifier */ + ds7ext_t DS7ADEXT[11]; /* space for 11 extent descriptions */ + char res1[2]; /* reserved */ + cchhb_t DS7PTRDS; /* pointer to next FMT7 DSCB */ +} __attribute__ ((packed)) format7_label_t; + + char * vtoc_ebcdic_enc ( unsigned char source[LINE_LENGTH], unsigned char target[LINE_LENGTH], @@ -181,45 +369,126 @@ void vtoc_set_date ( __u8 year, __u16 day); +void vtoc_volume_label_init ( + volume_label_t *vlabel); int vtoc_read_volume_label ( char * device, unsigned long vlabel_start, volume_label_t * vlabel); + int vtoc_write_volume_label ( - char * device, + char *device, unsigned long vlabel_start, - volume_label_t * vlabel); + volume_label_t *vlabel); + +void vtoc_volume_label_set_volser ( + volume_label_t *vlabel, + char *volser); + +char *vtoc_volume_label_get_volser ( + volume_label_t *vlabel, + char *volser); + +void vtoc_volume_label_set_key ( + volume_label_t *vlabel, + char *key); + +void vtoc_volume_label_set_label ( + volume_label_t *vlabel, + char *lbl); + +char *vtoc_volume_label_get_label ( + volume_label_t *vlabel, + char *lbl); + void vtoc_read_label ( char *device, unsigned long position, + format1_label_t *f1, format4_label_t *f4, - format1_label_t *f1); + format5_label_t *f5, + format7_label_t *f7); + void vtoc_write_label ( char *device, unsigned long position, + format1_label_t *f1, format4_label_t *f4, - format1_label_t *f1); -void vtoc_init_format4_label ( - struct hd_geometry *geo, - format4_label_t *f4lbl, - unsigned int usable_partitions, - unsigned int cylinders, - unsigned int tracks, - unsigned int blocks); + format5_label_t *f5, + format7_label_t *f7); + + void vtoc_init_format1_label ( char *volid, unsigned int blksize, extent_t *part_extent, format1_label_t *f1); -void vtoc_update_format4_label ( - format4_label_t *f4, - cchhb_t *highest_f1, - __u8 unused_update, - __u16 freespace_update); +void vtoc_init_format4_label ( + format4_label_t *f4lbl, + unsigned int usable_partitions, + unsigned int cylinders, + unsigned int tracks, + unsigned int blocks, + unsigned int blksize, + __u16 dev_type); +void vtoc_update_format4_label ( + format4_label_t *f4, + cchhb_t *highest_f1, + __u16 unused_update); + + +void vtoc_init_format5_label ( + format5_label_t *f5); + +void vtoc_update_format5_label_add ( + format5_label_t *f5, + int verbose, + int cyl, + int trk, + __u16 a, + __u16 b, + __u8 c); + +void vtoc_update_format5_label_del ( + format5_label_t *f5, + int verbose, + int cyl, + int trk, + __u16 a, + __u16 b, + __u8 c); + + +void vtoc_init_format7_label ( + format7_label_t *f7); + +void vtoc_update_format7_label_add ( + format7_label_t *f7, + int verbose, + __u32 a, + __u32 b); + +void vtoc_update_format7_label_del ( + format7_label_t *f7, + int verbose, + __u32 a, + __u32 b); + + +void vtoc_set_freespace( + format4_label_t *f4, + format5_label_t *f5, + format7_label_t *f7, + char ch, + int verbose, + __u32 start, + __u32 stop, + int cyl, + int trk); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 2b2c0bb1e7cb..4ac152dcf660 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -180,7 +180,7 @@ extern int * max_segments[MAX_BLKDEV]; #define PageAlignSize(size) (((size) + PAGE_SIZE -1) & PAGE_MASK) /* read-ahead in pages.. */ -#define MAX_READAHEAD 127 +#define MAX_READAHEAD 31 #define MIN_READAHEAD 3 #define blkdev_entry_to_request(entry) list_entry((entry), struct request, queue) diff --git a/include/linux/fs.h b/include/linux/fs.h index a716192ba716..a2d4abe3daf6 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1316,7 +1316,7 @@ static inline void bforget(struct buffer_head *buf) } extern void set_blocksize(kdev_t, int); extern struct buffer_head * bread(kdev_t, int, int); -extern void wakeup_bdflush(int wait); +extern void wakeup_bdflush(void); extern int brw_page(int, struct page *, kdev_t, int [], int); @@ -1342,7 +1342,7 @@ extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *); extern ssize_t generic_file_write(struct file *, const char *, size_t, loff_t *); extern void do_generic_file_read(struct file *, loff_t *, read_descriptor_t *, read_actor_t); - +extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); extern ssize_t generic_read_dir(struct file *, char *, size_t, loff_t *); extern struct file_operations generic_ro_fops; diff --git a/include/linux/ibmtr.h b/include/linux/ibmtr.h index 094d40af864d..dd8cbdc9f1a8 100644 --- a/include/linux/ibmtr.h +++ b/include/linux/ibmtr.h @@ -169,7 +169,7 @@ typedef enum { CLOSED, OPEN } open_state; struct tok_info { unsigned char irq; - __u32 mmio; + void *mmio; unsigned char hw_address[32]; unsigned char adapter_type; unsigned char data_rate; diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index b209d49792f6..fcd93ba5e88b 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -437,7 +437,15 @@ #define PCI_DEVICE_ID_SI_601 0x0601 #define PCI_DEVICE_ID_SI_620 0x0620 #define PCI_DEVICE_ID_SI_630 0x0630 +#define PCI_DEVICE_ID_SI_635 0x0635 +#define PCI_DEVICE_ID_SI_640 0x0640 +#define PCI_DEVICE_ID_SI_645 0x0645 +#define PCI_DEVICE_ID_SI_650 0x0650 #define PCI_DEVICE_ID_SI_730 0x0730 +#define PCI_DEVICE_ID_SI_735 0x0735 +#define PCI_DEVICE_ID_SI_740 0x0740 +#define PCI_DEVICE_ID_SI_745 0x0745 +#define PCI_DEVICE_ID_SI_750 0x0750 #define PCI_DEVICE_ID_SI_630_VGA 0x6300 #define PCI_DEVICE_ID_SI_730_VGA 0x7300 #define PCI_DEVICE_ID_SI_900 0x0900 diff --git a/include/linux/serial.h b/include/linux/serial.h index d03c78ba43fc..28da97697470 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h @@ -141,7 +141,8 @@ struct serial_uart_config { --- no longer used */ #define ASYNC_CONS_FLOW 0x00800000 /* flow control for console */ -#define ASYNC_INTERNAL_FLAGS 0xFF800000 /* Internal flags */ +#define ASYNC_BOOT_ONLYMCA 0x00400000 /* Probe only if MCA bus */ +#define ASYNC_INTERNAL_FLAGS 0xFFC00000 /* Internal flags */ /* * Multiport serial configuration structure --- external structure |
