Commit d96d6867 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Linus Torvalds

[PATCH] s390: dasd driver coding style (1/2)

s390 dasd driver:
 - Coding style adaptions. Removed almost all typedefs from the dasd driver.
parent 616dea43
...@@ -7,43 +7,12 @@ ...@@ -7,43 +7,12 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
* *
* $Revision: 1.82 $ * $Revision: 1.94 $
*
* History of changes (starts July 2000)
* 11/09/00 complete redesign after code review
* 02/01/01 added dynamic registration of ioctls
* fixed bug in registration of new majors
* fixed handling of request during dasd_end_request
* fixed handling of plugged queues
* fixed partition handling and HDIO_GETGEO
* fixed traditional naming scheme for devices beyond 702
* fixed some race conditions related to modules
* added devfs suupport
* 03/06/01 refined dynamic attach/detach for leaving devices which are online.
* 03/09/01 refined dynamic modifiaction of devices
* 03/12/01 moved policy in dasd_format to dasdfmt (renamed BIODASDFORMAT)
* 03/19/01 added BIODASDINFO-ioctl
* removed 2.2 compatibility
* 04/27/01 fixed PL030119COT (dasd_disciplines does not work)
* 04/30/01 fixed PL030146HSM (module locking with dynamic ioctls)
* fixed PL030130SBA (handling of invalid ranges)
* 05/02/01 fixed PL030145SBA (killing dasdmt)
* fixed PL030149SBA (status of 'accepted' devices)
* fixed PL030146SBA (BUG in ibm.c after adding device)
* added BIODASDPRRD ioctl interface
* 05/11/01 fixed PL030164MVE (trap in probeonly mode)
* 05/15/01 fixed devfs support for unformatted devices
* 06/26/01 hopefully fixed PL030172SBA,PL030234SBA
* 07/09/01 fixed PL030324MSH (wrong statistics output)
* 07/16/01 merged in new fixes for handling low-mem situations
* 01/22/01 fixed PL030579KBE (wrong statistics)
* 05/04/02 code restructuring.
*/ */
#define LOCAL_END_REQUEST /* Don't generate end_request in blk.h */ #define LOCAL_END_REQUEST /* Don't generate end_request in blk.h */
#include <linux/config.h> #include <linux/config.h>
#include <linux/version.h>
#include <linux/kmod.h> #include <linux/kmod.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -83,12 +52,12 @@ MODULE_LICENSE("GPL"); ...@@ -83,12 +52,12 @@ MODULE_LICENSE("GPL");
/* /*
* SECTION: prototypes for static functions of dasd.c * SECTION: prototypes for static functions of dasd.c
*/ */
static int dasd_setup_blkdev(dasd_device_t * device); static int dasd_setup_blkdev(struct dasd_device * device);
static void dasd_disable_blkdev(dasd_device_t * device); static void dasd_disable_blkdev(struct dasd_device * device);
static void dasd_flush_request_queue(dasd_device_t *); static void dasd_flush_request_queue(struct dasd_device *);
static void dasd_int_handler(struct ccw_device *, unsigned long, struct irb *); static void dasd_int_handler(struct ccw_device *, unsigned long, struct irb *);
static void dasd_flush_ccw_queue(dasd_device_t *, int); static void dasd_flush_ccw_queue(struct dasd_device *, int);
static void dasd_tasklet(dasd_device_t *); static void dasd_tasklet(struct dasd_device *);
static void do_kick_device(void *data); static void do_kick_device(void *data);
static int dasd_add_sysfs_files(struct ccw_device *cdev); static int dasd_add_sysfs_files(struct ccw_device *cdev);
...@@ -100,16 +69,16 @@ static wait_queue_head_t dasd_init_waitq; ...@@ -100,16 +69,16 @@ static wait_queue_head_t dasd_init_waitq;
/* /*
* Allocate memory for a new device structure. * Allocate memory for a new device structure.
*/ */
dasd_device_t * struct dasd_device *
dasd_alloc_device(unsigned int devindex) dasd_alloc_device(unsigned int devindex)
{ {
dasd_device_t *device; struct dasd_device *device;
struct gendisk *gdp; struct gendisk *gdp;
device = kmalloc(sizeof (dasd_device_t), GFP_ATOMIC); device = kmalloc(sizeof (struct dasd_device), GFP_ATOMIC);
if (device == NULL) if (device == NULL)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
memset(device, 0, sizeof (dasd_device_t)); memset(device, 0, sizeof (struct dasd_device));
/* Get two pages for normal block device operations. */ /* Get two pages for normal block device operations. */
device->ccw_mem = (void *) __get_free_pages(GFP_ATOMIC | GFP_DMA, 1); device->ccw_mem = (void *) __get_free_pages(GFP_ATOMIC | GFP_DMA, 1);
...@@ -131,7 +100,7 @@ dasd_alloc_device(unsigned int devindex) ...@@ -131,7 +100,7 @@ dasd_alloc_device(unsigned int devindex)
free_page((unsigned long) device->erp_mem); free_page((unsigned long) device->erp_mem);
free_pages((unsigned long) device->ccw_mem, 1); free_pages((unsigned long) device->ccw_mem, 1);
kfree(device); kfree(device);
return (dasd_device_t *) gdp; return (struct dasd_device *) gdp;
} }
gdp->private_data = device; gdp->private_data = device;
device->gdp = gdp; device->gdp = gdp;
...@@ -156,7 +125,7 @@ dasd_alloc_device(unsigned int devindex) ...@@ -156,7 +125,7 @@ dasd_alloc_device(unsigned int devindex)
* Free memory of a device structure. * Free memory of a device structure.
*/ */
void void
dasd_free_device(dasd_device_t *device) dasd_free_device(struct dasd_device *device)
{ {
if (device->private) if (device->private)
kfree(device->private); kfree(device->private);
...@@ -170,7 +139,7 @@ dasd_free_device(dasd_device_t *device) ...@@ -170,7 +139,7 @@ dasd_free_device(dasd_device_t *device)
* Make a new device known to the system. * Make a new device known to the system.
*/ */
static inline int static inline int
dasd_state_new_to_known(dasd_device_t *device) dasd_state_new_to_known(struct dasd_device *device)
{ {
umode_t devfs_perm; umode_t devfs_perm;
kdev_t kdev; kdev_t kdev;
...@@ -211,7 +180,7 @@ dasd_state_new_to_known(dasd_device_t *device) ...@@ -211,7 +180,7 @@ dasd_state_new_to_known(dasd_device_t *device)
* Let the system forget about a device. * Let the system forget about a device.
*/ */
static inline void static inline void
dasd_state_known_to_new(dasd_device_t * device) dasd_state_known_to_new(struct dasd_device * device)
{ {
/* Remove device entry and devfs directory. */ /* Remove device entry and devfs directory. */
devfs_unregister(device->devfs_entry); devfs_unregister(device->devfs_entry);
...@@ -229,7 +198,7 @@ dasd_state_known_to_new(dasd_device_t * device) ...@@ -229,7 +198,7 @@ dasd_state_known_to_new(dasd_device_t * device)
* Request the irq line for the device. * Request the irq line for the device.
*/ */
static inline int static inline int
dasd_state_known_to_basic(dasd_device_t * device) dasd_state_known_to_basic(struct dasd_device * device)
{ {
/* register 'device' debug area, used for all DBF_DEV_XXX calls */ /* register 'device' debug area, used for all DBF_DEV_XXX calls */
device->debug_area = debug_register(device->gdp->disk_name, 0, 2, device->debug_area = debug_register(device->gdp->disk_name, 0, 2,
...@@ -246,7 +215,7 @@ dasd_state_known_to_basic(dasd_device_t * device) ...@@ -246,7 +215,7 @@ dasd_state_known_to_basic(dasd_device_t * device)
* Release the irq line for the device. Terminate any running i/o. * Release the irq line for the device. Terminate any running i/o.
*/ */
static inline void static inline void
dasd_state_basic_to_known(dasd_device_t * device) dasd_state_basic_to_known(struct dasd_device * device)
{ {
dasd_flush_ccw_queue(device, 1); dasd_flush_ccw_queue(device, 1);
DBF_DEV_EVENT(DBF_EMERG, device, "%p debug area deleted", device); DBF_DEV_EVENT(DBF_EMERG, device, "%p debug area deleted", device);
...@@ -268,7 +237,7 @@ dasd_state_basic_to_known(dasd_device_t * device) ...@@ -268,7 +237,7 @@ dasd_state_basic_to_known(dasd_device_t * device)
* discipline code, see dasd_eckd.c. * discipline code, see dasd_eckd.c.
*/ */
static inline int static inline int
dasd_state_basic_to_accept(dasd_device_t * device) dasd_state_basic_to_accept(struct dasd_device * device)
{ {
int rc; int rc;
...@@ -284,7 +253,7 @@ dasd_state_basic_to_accept(dasd_device_t * device) ...@@ -284,7 +253,7 @@ dasd_state_basic_to_accept(dasd_device_t * device)
* Forget everything the initial analysis found out. * Forget everything the initial analysis found out.
*/ */
static inline void static inline void
dasd_state_accept_to_basic(dasd_device_t * device) dasd_state_accept_to_basic(struct dasd_device * device)
{ {
device->blocks = 0; device->blocks = 0;
device->bp_block = 0; device->bp_block = 0;
...@@ -296,7 +265,7 @@ dasd_state_accept_to_basic(dasd_device_t * device) ...@@ -296,7 +265,7 @@ dasd_state_accept_to_basic(dasd_device_t * device)
* Setup block device. * Setup block device.
*/ */
static inline int static inline int
dasd_state_accept_to_ready(dasd_device_t * device) dasd_state_accept_to_ready(struct dasd_device * device)
{ {
int rc; int rc;
...@@ -312,7 +281,7 @@ dasd_state_accept_to_ready(dasd_device_t * device) ...@@ -312,7 +281,7 @@ dasd_state_accept_to_ready(dasd_device_t * device)
* Remove device from block device layer. Destroy dirty buffers. * Remove device from block device layer. Destroy dirty buffers.
*/ */
static inline void static inline void
dasd_state_ready_to_accept(dasd_device_t * device) dasd_state_ready_to_accept(struct dasd_device * device)
{ {
dasd_flush_ccw_queue(device, 0); dasd_flush_ccw_queue(device, 0);
dasd_destroy_partitions(device); dasd_destroy_partitions(device);
...@@ -327,7 +296,7 @@ dasd_state_ready_to_accept(dasd_device_t * device) ...@@ -327,7 +296,7 @@ dasd_state_ready_to_accept(dasd_device_t * device)
* ccw queue. * ccw queue.
*/ */
static inline int static inline int
dasd_state_ready_to_online(dasd_device_t * device) dasd_state_ready_to_online(struct dasd_device * device)
{ {
device->state = DASD_STATE_ONLINE; device->state = DASD_STATE_ONLINE;
dasd_schedule_bh(device); dasd_schedule_bh(device);
...@@ -338,7 +307,7 @@ dasd_state_ready_to_online(dasd_device_t * device) ...@@ -338,7 +307,7 @@ dasd_state_ready_to_online(dasd_device_t * device)
* Stop the requeueing of requests again. * Stop the requeueing of requests again.
*/ */
static inline void static inline void
dasd_state_online_to_ready(dasd_device_t * device) dasd_state_online_to_ready(struct dasd_device * device)
{ {
device->state = DASD_STATE_READY; device->state = DASD_STATE_READY;
} }
...@@ -347,7 +316,7 @@ dasd_state_online_to_ready(dasd_device_t * device) ...@@ -347,7 +316,7 @@ dasd_state_online_to_ready(dasd_device_t * device)
* Device startup state changes. * Device startup state changes.
*/ */
static inline int static inline int
dasd_increase_state(dasd_device_t *device) dasd_increase_state(struct dasd_device *device)
{ {
int rc; int rc;
...@@ -379,7 +348,7 @@ dasd_increase_state(dasd_device_t *device) ...@@ -379,7 +348,7 @@ dasd_increase_state(dasd_device_t *device)
* Device shutdown state changes. * Device shutdown state changes.
*/ */
static inline int static inline int
dasd_decrease_state(dasd_device_t *device) dasd_decrease_state(struct dasd_device *device)
{ {
if (device->state == DASD_STATE_ONLINE && if (device->state == DASD_STATE_ONLINE &&
device->target <= DASD_STATE_READY) device->target <= DASD_STATE_READY)
...@@ -408,7 +377,7 @@ dasd_decrease_state(dasd_device_t *device) ...@@ -408,7 +377,7 @@ dasd_decrease_state(dasd_device_t *device)
* This is the main startup/shutdown routine. * This is the main startup/shutdown routine.
*/ */
static void static void
dasd_change_state(dasd_device_t *device) dasd_change_state(struct dasd_device *device)
{ {
int rc; int rc;
...@@ -440,16 +409,16 @@ dasd_change_state(dasd_device_t *device) ...@@ -440,16 +409,16 @@ dasd_change_state(dasd_device_t *device)
static void static void
do_kick_device(void *data) do_kick_device(void *data)
{ {
dasd_device_t *device; struct dasd_device *device;
device = (dasd_device_t *) data; device = (struct dasd_device *) data;
dasd_change_state(device); dasd_change_state(device);
dasd_schedule_bh(device); dasd_schedule_bh(device);
dasd_put_device(device); dasd_put_device(device);
} }
void void
dasd_kick_device(dasd_device_t *device) dasd_kick_device(struct dasd_device *device)
{ {
dasd_get_device(device); dasd_get_device(device);
/* queue call to dasd_kick_device to the kernel event daemon. */ /* queue call to dasd_kick_device to the kernel event daemon. */
...@@ -460,7 +429,7 @@ dasd_kick_device(dasd_device_t *device) ...@@ -460,7 +429,7 @@ dasd_kick_device(dasd_device_t *device)
* Set the target state for a device and starts the state change. * Set the target state for a device and starts the state change.
*/ */
void void
dasd_set_target_state(dasd_device_t *device, int target) dasd_set_target_state(struct dasd_device *device, int target)
{ {
/* If we are in probeonly mode stop at DASD_STATE_ACCEPT. */ /* If we are in probeonly mode stop at DASD_STATE_ACCEPT. */
if (dasd_probeonly && target > DASD_STATE_ACCEPT) if (dasd_probeonly && target > DASD_STATE_ACCEPT)
...@@ -478,14 +447,14 @@ dasd_set_target_state(dasd_device_t *device, int target) ...@@ -478,14 +447,14 @@ dasd_set_target_state(dasd_device_t *device, int target)
* Enable devices with device numbers in [from..to]. * Enable devices with device numbers in [from..to].
*/ */
static inline int static inline int
_wait_for_device(dasd_device_t *device) _wait_for_device(struct dasd_device *device)
{ {
return (device->state == device->target); return (device->state == device->target);
} }
// FIXME: if called from dasd_devices_write discpline is not set -> oops. // FIXME: if called from dasd_devices_write discpline is not set -> oops.
void void
dasd_enable_device(dasd_device_t *device) dasd_enable_device(struct dasd_device *device)
{ {
dasd_set_target_state(device, DASD_STATE_ONLINE); dasd_set_target_state(device, DASD_STATE_ONLINE);
if (device->state <= DASD_STATE_KNOWN) if (device->state <= DASD_STATE_KNOWN)
...@@ -500,7 +469,7 @@ dasd_enable_device(dasd_device_t *device) ...@@ -500,7 +469,7 @@ dasd_enable_device(dasd_device_t *device)
*/ */
#ifdef CONFIG_DASD_PROFILE #ifdef CONFIG_DASD_PROFILE
dasd_profile_info_t dasd_global_profile; struct dasd_profile_info_t dasd_global_profile;
unsigned int dasd_profile_level = DASD_PROFILE_OFF; unsigned int dasd_profile_level = DASD_PROFILE_OFF;
/* /*
...@@ -518,7 +487,7 @@ unsigned int dasd_profile_level = DASD_PROFILE_OFF; ...@@ -518,7 +487,7 @@ unsigned int dasd_profile_level = DASD_PROFILE_OFF;
* Add profiling information for cqr before execution. * Add profiling information for cqr before execution.
*/ */
static inline void static inline void
dasd_profile_start(dasd_device_t *device, dasd_ccw_req_t * cqr, dasd_profile_start(struct dasd_device *device, struct dasd_ccw_req * cqr,
struct request *req) struct request *req)
{ {
struct list_head *l; struct list_head *l;
...@@ -540,7 +509,7 @@ dasd_profile_start(dasd_device_t *device, dasd_ccw_req_t * cqr, ...@@ -540,7 +509,7 @@ dasd_profile_start(dasd_device_t *device, dasd_ccw_req_t * cqr,
* Add profiling information for cqr after execution. * Add profiling information for cqr after execution.
*/ */
static inline void static inline void
dasd_profile_end(dasd_device_t *device, dasd_ccw_req_t * cqr, dasd_profile_end(struct dasd_device *device, struct dasd_ccw_req * cqr,
struct request *req) struct request *req)
{ {
long strtime, irqtime, endtime, tottime; /* in microseconds */ long strtime, irqtime, endtime, tottime; /* in microseconds */
...@@ -562,12 +531,14 @@ dasd_profile_end(dasd_device_t *device, dasd_ccw_req_t * cqr, ...@@ -562,12 +531,14 @@ dasd_profile_end(dasd_device_t *device, dasd_ccw_req_t * cqr,
tottimeps = tottime / sectors; tottimeps = tottime / sectors;
if (!dasd_global_profile.dasd_io_reqs) if (!dasd_global_profile.dasd_io_reqs)
memset(&dasd_global_profile, 0, sizeof (dasd_profile_info_t)); memset(&dasd_global_profile, 0,
sizeof (struct dasd_profile_info_t));
dasd_global_profile.dasd_io_reqs++; dasd_global_profile.dasd_io_reqs++;
dasd_global_profile.dasd_io_sects += sectors; dasd_global_profile.dasd_io_sects += sectors;
if (!device->profile.dasd_io_reqs) if (!device->profile.dasd_io_reqs)
memset(&device->profile, 0, sizeof (dasd_profile_info_t)); memset(&device->profile, 0,
sizeof (struct dasd_profile_info_t));
device->profile.dasd_io_reqs++; device->profile.dasd_io_reqs++;
device->profile.dasd_io_sects += sectors; device->profile.dasd_io_sects += sectors;
...@@ -591,11 +562,11 @@ dasd_profile_end(dasd_device_t *device, dasd_ccw_req_t * cqr, ...@@ -591,11 +562,11 @@ dasd_profile_end(dasd_device_t *device, dasd_ccw_req_t * cqr,
* memory and 2) dasd_smalloc_request uses the static ccw memory * memory and 2) dasd_smalloc_request uses the static ccw memory
* that gets allocated for each device. * that gets allocated for each device.
*/ */
dasd_ccw_req_t * struct dasd_ccw_req *
dasd_kmalloc_request(char *magic, int cplength, int datasize, dasd_kmalloc_request(char *magic, int cplength, int datasize,
dasd_device_t * device) struct dasd_device * device)
{ {
dasd_ccw_req_t *cqr; struct dasd_ccw_req *cqr;
/* Sanity checks */ /* Sanity checks */
if ( magic == NULL || datasize > PAGE_SIZE || if ( magic == NULL || datasize > PAGE_SIZE ||
...@@ -606,10 +577,10 @@ dasd_kmalloc_request(char *magic, int cplength, int datasize, ...@@ -606,10 +577,10 @@ dasd_kmalloc_request(char *magic, int cplength, int datasize,
debug_int_event ( dasd_debug_area, 1, cplength); debug_int_event ( dasd_debug_area, 1, cplength);
debug_int_event ( dasd_debug_area, 1, datasize); debug_int_event ( dasd_debug_area, 1, datasize);
cqr = kmalloc(sizeof(dasd_ccw_req_t), GFP_ATOMIC); cqr = kmalloc(sizeof(struct dasd_ccw_req), GFP_ATOMIC);
if (cqr == NULL) if (cqr == NULL)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
memset(cqr, 0, sizeof(dasd_ccw_req_t)); memset(cqr, 0, sizeof(struct dasd_ccw_req));
cqr->cpaddr = NULL; cqr->cpaddr = NULL;
if (cplength > 0) { if (cplength > 0) {
cqr->cpaddr = kmalloc(cplength*sizeof(struct ccw1), cqr->cpaddr = kmalloc(cplength*sizeof(struct ccw1),
...@@ -637,12 +608,12 @@ dasd_kmalloc_request(char *magic, int cplength, int datasize, ...@@ -637,12 +608,12 @@ dasd_kmalloc_request(char *magic, int cplength, int datasize,
return cqr; return cqr;
} }
dasd_ccw_req_t * struct dasd_ccw_req *
dasd_smalloc_request(char *magic, int cplength, int datasize, dasd_smalloc_request(char *magic, int cplength, int datasize,
dasd_device_t * device) struct dasd_device * device)
{ {
unsigned long flags; unsigned long flags;
dasd_ccw_req_t *cqr; struct dasd_ccw_req *cqr;
char *data; char *data;
int size; int size;
...@@ -655,18 +626,19 @@ dasd_smalloc_request(char *magic, int cplength, int datasize, ...@@ -655,18 +626,19 @@ dasd_smalloc_request(char *magic, int cplength, int datasize,
debug_int_event ( dasd_debug_area, 1, cplength); debug_int_event ( dasd_debug_area, 1, cplength);
debug_int_event ( dasd_debug_area, 1, datasize); debug_int_event ( dasd_debug_area, 1, datasize);
size = (sizeof(dasd_ccw_req_t) + 7L) & -8L; size = (sizeof(struct dasd_ccw_req) + 7L) & -8L;
if (cplength > 0) if (cplength > 0)
size += cplength * sizeof(struct ccw1); size += cplength * sizeof(struct ccw1);
if (datasize > 0) if (datasize > 0)
size += datasize; size += datasize;
spin_lock_irqsave(&device->mem_lock, flags); spin_lock_irqsave(&device->mem_lock, flags);
cqr = (dasd_ccw_req_t *) dasd_alloc_chunk(&device->ccw_chunks, size); cqr = (struct dasd_ccw_req *)
dasd_alloc_chunk(&device->ccw_chunks, size);
spin_unlock_irqrestore(&device->mem_lock, flags); spin_unlock_irqrestore(&device->mem_lock, flags);
if (cqr == NULL) if (cqr == NULL)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
memset(cqr, 0, sizeof(dasd_ccw_req_t)); memset(cqr, 0, sizeof(struct dasd_ccw_req));
data = (char *) cqr + ((sizeof(dasd_ccw_req_t) + 7L) & -8L); data = (char *) cqr + ((sizeof(struct dasd_ccw_req) + 7L) & -8L);
cqr->cpaddr = NULL; cqr->cpaddr = NULL;
if (cplength > 0) { if (cplength > 0) {
cqr->cpaddr = (struct ccw1 *) data; cqr->cpaddr = (struct ccw1 *) data;
...@@ -687,10 +659,10 @@ dasd_smalloc_request(char *magic, int cplength, int datasize, ...@@ -687,10 +659,10 @@ dasd_smalloc_request(char *magic, int cplength, int datasize,
/* /*
* Free memory of a channel program. This function needs to free all the * Free memory of a channel program. This function needs to free all the
* idal lists that might have been created by dasd_set_cda and the * idal lists that might have been created by dasd_set_cda and the
* dasd_ccw_req_t itself. * struct dasd_ccw_req itself.
*/ */
void void
dasd_kfree_request(dasd_ccw_req_t * cqr, dasd_device_t * device) dasd_kfree_request(struct dasd_ccw_req * cqr, struct dasd_device * device)
{ {
#ifdef CONFIG_ARCH_S390X #ifdef CONFIG_ARCH_S390X
struct ccw1 *ccw; struct ccw1 *ccw;
...@@ -714,7 +686,7 @@ dasd_kfree_request(dasd_ccw_req_t * cqr, dasd_device_t * device) ...@@ -714,7 +686,7 @@ dasd_kfree_request(dasd_ccw_req_t * cqr, dasd_device_t * device)
} }
void void
dasd_sfree_request(dasd_ccw_req_t * cqr, dasd_device_t * device) dasd_sfree_request(struct dasd_ccw_req * cqr, struct dasd_device * device)
{ {
unsigned long flags; unsigned long flags;
...@@ -732,16 +704,16 @@ dasd_sfree_request(dasd_ccw_req_t * cqr, dasd_device_t * device) ...@@ -732,16 +704,16 @@ dasd_sfree_request(dasd_ccw_req_t * cqr, dasd_device_t * device)
* Check discipline magic in cqr. * Check discipline magic in cqr.
*/ */
static inline int static inline int
dasd_check_cqr(dasd_ccw_req_t *cqr) dasd_check_cqr(struct dasd_ccw_req *cqr)
{ {
dasd_device_t *device; struct dasd_device *device;
if (cqr == NULL) if (cqr == NULL)
return -EINVAL; return -EINVAL;
device = cqr->device; device = cqr->device;
if (strncmp((char *) &cqr->magic, device->discipline->ebcname, 4)) { if (strncmp((char *) &cqr->magic, device->discipline->ebcname, 4)) {
DEV_MESSAGE(KERN_WARNING, device, DEV_MESSAGE(KERN_WARNING, device,
" dasd_ccw_req_t 0x%08x magic doesn't match" " dasd_ccw_req 0x%08x magic doesn't match"
" discipline 0x%08x", " discipline 0x%08x",
cqr->magic, cqr->magic,
*(unsigned int *) device->discipline->name); *(unsigned int *) device->discipline->name);
...@@ -756,9 +728,9 @@ dasd_check_cqr(dasd_ccw_req_t *cqr) ...@@ -756,9 +728,9 @@ dasd_check_cqr(dasd_ccw_req_t *cqr)
* is in a bad mood. * is in a bad mood.
*/ */
int int
dasd_term_IO(dasd_ccw_req_t * cqr) dasd_term_IO(struct dasd_ccw_req * cqr)
{ {
dasd_device_t *device; struct dasd_device *device;
int retries, rc; int retries, rc;
/* Check the cqr */ /* Check the cqr */
...@@ -766,7 +738,7 @@ dasd_term_IO(dasd_ccw_req_t * cqr) ...@@ -766,7 +738,7 @@ dasd_term_IO(dasd_ccw_req_t * cqr)
if (rc) if (rc)
return rc; return rc;
retries = 0; retries = 0;
device = (dasd_device_t *) cqr->device; device = (struct dasd_device *) cqr->device;
while ((retries < 5) && (cqr->status == DASD_CQR_IN_IO)) { while ((retries < 5) && (cqr->status == DASD_CQR_IN_IO)) {
if (retries < 2) if (retries < 2)
rc = ccw_device_halt(device->cdev, (long) cqr); rc = ccw_device_halt(device->cdev, (long) cqr);
...@@ -808,16 +780,16 @@ dasd_term_IO(dasd_ccw_req_t * cqr) ...@@ -808,16 +780,16 @@ dasd_term_IO(dasd_ccw_req_t * cqr)
* In that case set up a timer to start the request later. * In that case set up a timer to start the request later.
*/ */
int int
dasd_start_IO(dasd_ccw_req_t * cqr) dasd_start_IO(struct dasd_ccw_req * cqr)
{ {
dasd_device_t *device; struct dasd_device *device;
int rc; int rc;
/* Check the cqr */ /* Check the cqr */
rc = dasd_check_cqr(cqr); rc = dasd_check_cqr(cqr);
if (rc) if (rc)
return rc; return rc;
device = (dasd_device_t *) cqr->device; device = (struct dasd_device *) cqr->device;
cqr->startclk = get_clock(); cqr->startclk = get_clock();
rc = ccw_device_start(device->cdev, cqr->cpaddr, (long) cqr, rc = ccw_device_start(device->cdev, cqr->cpaddr, (long) cqr,
cqr->lpm, 0); cqr->lpm, 0);
...@@ -860,14 +832,15 @@ static void ...@@ -860,14 +832,15 @@ static void
dasd_timeout_device(unsigned long ptr) dasd_timeout_device(unsigned long ptr)
{ {
unsigned long flags; unsigned long flags;
dasd_device_t *device; struct dasd_device *device;
dasd_ccw_req_t *cqr; struct dasd_ccw_req *cqr;
device = (dasd_device_t *) ptr; device = (struct dasd_device *) ptr;
spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags); spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags);
/* re-activate first request in queue */ /* re-activate first request in queue */
if (!list_empty(&device->ccw_queue)) { if (!list_empty(&device->ccw_queue)) {
cqr = list_entry(device->ccw_queue.next, dasd_ccw_req_t, list); cqr = list_entry(device->ccw_queue.next,
struct dasd_ccw_req, list);
if (cqr->status == DASD_CQR_PENDING) if (cqr->status == DASD_CQR_PENDING)
cqr->status = DASD_CQR_QUEUED; cqr->status = DASD_CQR_QUEUED;
} }
...@@ -879,7 +852,7 @@ dasd_timeout_device(unsigned long ptr) ...@@ -879,7 +852,7 @@ dasd_timeout_device(unsigned long ptr)
* Setup timeout for a device. * Setup timeout for a device.
*/ */
void void
dasd_set_timer(dasd_device_t *device, int expires) dasd_set_timer(struct dasd_device *device, int expires)
{ {
/* FIXME: timeouts are based on jiffies but the timeout /* FIXME: timeouts are based on jiffies but the timeout
* comparision in __dasd_check_expire is based on the * comparision in __dasd_check_expire is based on the
...@@ -903,7 +876,7 @@ dasd_set_timer(dasd_device_t *device, int expires) ...@@ -903,7 +876,7 @@ dasd_set_timer(dasd_device_t *device, int expires)
* Clear timeout for a device. * Clear timeout for a device.
*/ */
void void
dasd_clear_timer(dasd_device_t *device) dasd_clear_timer(struct dasd_device *device)
{ {
if (timer_pending(&device->timer)) if (timer_pending(&device->timer))
del_timer(&device->timer); del_timer(&device->timer);
...@@ -921,10 +894,10 @@ do_state_change_pending(void *data) ...@@ -921,10 +894,10 @@ do_state_change_pending(void *data)
{ {
struct { struct {
struct work_struct work; struct work_struct work;
dasd_device_t *device; struct dasd_device *device;
} *p; } *p;
dasd_device_t *device; struct dasd_device *device;
dasd_ccw_req_t *cqr; struct dasd_ccw_req *cqr;
p = data; p = data;
device = p->device; device = p->device;
...@@ -934,7 +907,8 @@ do_state_change_pending(void *data) ...@@ -934,7 +907,8 @@ do_state_change_pending(void *data)
spin_lock_irq(get_ccwdev_lock(device->cdev)); spin_lock_irq(get_ccwdev_lock(device->cdev));
/* re-activate first request in queue */ /* re-activate first request in queue */
if (!list_empty(&device->ccw_queue)) { if (!list_empty(&device->ccw_queue)) {
cqr = list_entry(device->ccw_queue.next, dasd_ccw_req_t, list); cqr = list_entry(device->ccw_queue.next,
struct dasd_ccw_req, list);
if (cqr == NULL) { if (cqr == NULL) {
MESSAGE (KERN_DEBUG, MESSAGE (KERN_DEBUG,
"got state change pending interrupt on" "got state change pending interrupt on"
...@@ -954,10 +928,10 @@ do_state_change_pending(void *data) ...@@ -954,10 +928,10 @@ do_state_change_pending(void *data)
static void static void
dasd_handle_killed_request(struct ccw_device *cdev, unsigned long intparm) dasd_handle_killed_request(struct ccw_device *cdev, unsigned long intparm)
{ {
dasd_ccw_req_t *cqr; struct dasd_ccw_req *cqr;
dasd_device_t *device; struct dasd_device *device;
cqr = (dasd_ccw_req_t *) intparm; cqr = (struct dasd_ccw_req *) intparm;
if (cqr->status != DASD_CQR_IN_IO) { if (cqr->status != DASD_CQR_IN_IO) {
MESSAGE(KERN_DEBUG, MESSAGE(KERN_DEBUG,
"invalid status: bus_id %s, status %02x", "invalid status: bus_id %s, status %02x",
...@@ -965,7 +939,7 @@ dasd_handle_killed_request(struct ccw_device *cdev, unsigned long intparm) ...@@ -965,7 +939,7 @@ dasd_handle_killed_request(struct ccw_device *cdev, unsigned long intparm)
return; return;
} }
device = (dasd_device_t *) cqr->device; device = (struct dasd_device *) cqr->device;
if (device == NULL || if (device == NULL ||
device != cdev->dev.driver_data || device != cdev->dev.driver_data ||
strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) { strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) {
...@@ -982,11 +956,11 @@ dasd_handle_killed_request(struct ccw_device *cdev, unsigned long intparm) ...@@ -982,11 +956,11 @@ dasd_handle_killed_request(struct ccw_device *cdev, unsigned long intparm)
} }
static void static void
dasd_handle_state_change_pending(dasd_device_t *device) dasd_handle_state_change_pending(struct dasd_device *device)
{ {
struct { struct {
struct work_struct work; struct work_struct work;
dasd_device_t *device; struct dasd_device *device;
} *p; } *p;
p = kmalloc(sizeof(*p), GFP_ATOMIC); p = kmalloc(sizeof(*p), GFP_ATOMIC);
...@@ -1006,8 +980,8 @@ void ...@@ -1006,8 +980,8 @@ void
dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
struct irb *irb) struct irb *irb)
{ {
dasd_ccw_req_t *cqr, *next; struct dasd_ccw_req *cqr, *next;
dasd_device_t *device; struct dasd_device *device;
unsigned long long now; unsigned long long now;
int expires; int expires;
dasd_era_t era; dasd_era_t era;
...@@ -1042,7 +1016,7 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1042,7 +1016,7 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
return; return;
} }
cqr = (dasd_ccw_req_t *) intparm; cqr = (struct dasd_ccw_req *) intparm;
/* /*
* check status - the request might have been killed * check status - the request might have been killed
* because of dyn detach * because of dyn detach
...@@ -1054,7 +1028,7 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1054,7 +1028,7 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
return; return;
} }
device = (dasd_device_t *) cqr->device; device = (struct dasd_device *) cqr->device;
if (device == NULL || if (device == NULL ||
device != cdev->dev.driver_data || device != cdev->dev.driver_data ||
strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) { strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) {
...@@ -1084,7 +1058,7 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1084,7 +1058,7 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
/* Start first request on queue if possible -> fast_io. */ /* Start first request on queue if possible -> fast_io. */
if (cqr->list.next != &device->ccw_queue) { if (cqr->list.next != &device->ccw_queue) {
next = list_entry(cqr->list.next, next = list_entry(cqr->list.next,
dasd_ccw_req_t, list); struct dasd_ccw_req, list);
if (next->status == DASD_CQR_QUEUED) { if (next->status == DASD_CQR_QUEUED) {
if (device->discipline->start_IO(next) == 0) if (device->discipline->start_IO(next) == 0)
expires = next->expires; expires = next->expires;
...@@ -1141,7 +1115,7 @@ dasd_end_request(struct request *req, int uptodate) ...@@ -1141,7 +1115,7 @@ dasd_end_request(struct request *req, int uptodate)
* Process finished error recovery ccw. * Process finished error recovery ccw.
*/ */
static inline void static inline void
__dasd_process_erp(dasd_device_t *device, dasd_ccw_req_t *cqr) __dasd_process_erp(struct dasd_device *device, struct dasd_ccw_req *cqr)
{ {
dasd_erp_fn_t erp_fn; dasd_erp_fn_t erp_fn;
...@@ -1157,16 +1131,17 @@ __dasd_process_erp(dasd_device_t *device, dasd_ccw_req_t *cqr) ...@@ -1157,16 +1131,17 @@ __dasd_process_erp(dasd_device_t *device, dasd_ccw_req_t *cqr)
* Process ccw request queue. * Process ccw request queue.
*/ */
static inline void static inline void
__dasd_process_ccw_queue(dasd_device_t * device, struct list_head *final_queue) __dasd_process_ccw_queue(struct dasd_device * device,
struct list_head *final_queue)
{ {
struct list_head *l, *n; struct list_head *l, *n;
dasd_ccw_req_t *cqr; struct dasd_ccw_req *cqr;
dasd_erp_fn_t erp_fn; dasd_erp_fn_t erp_fn;
restart: restart:
/* Process request with final status. */ /* Process request with final status. */
list_for_each_safe(l, n, &device->ccw_queue) { list_for_each_safe(l, n, &device->ccw_queue) {
cqr = list_entry(l, dasd_ccw_req_t, list); cqr = list_entry(l, struct dasd_ccw_req, list);
/* Stop list processing at the first non-final request. */ /* Stop list processing at the first non-final request. */
if (cqr->status != DASD_CQR_DONE && if (cqr->status != DASD_CQR_DONE &&
cqr->status != DASD_CQR_FAILED && cqr->status != DASD_CQR_FAILED &&
...@@ -1197,7 +1172,7 @@ __dasd_process_ccw_queue(dasd_device_t * device, struct list_head *final_queue) ...@@ -1197,7 +1172,7 @@ __dasd_process_ccw_queue(dasd_device_t * device, struct list_head *final_queue)
} }
static void static void
dasd_end_request_cb(dasd_ccw_req_t * cqr, void *data) dasd_end_request_cb(struct dasd_ccw_req * cqr, void *data)
{ {
struct request *req; struct request *req;
...@@ -1214,11 +1189,11 @@ dasd_end_request_cb(dasd_ccw_req_t * cqr, void *data) ...@@ -1214,11 +1189,11 @@ dasd_end_request_cb(dasd_ccw_req_t * cqr, void *data)
* Fetch requests from the block device queue. * Fetch requests from the block device queue.
*/ */
static inline void static inline void
__dasd_process_blk_queue(dasd_device_t * device) __dasd_process_blk_queue(struct dasd_device * device)
{ {
request_queue_t *queue; request_queue_t *queue;
struct request *req; struct request *req;
dasd_ccw_req_t *cqr; struct dasd_ccw_req *cqr;
int nr_queued; int nr_queued;
queue = device->request_queue; queue = device->request_queue;
...@@ -1281,14 +1256,14 @@ __dasd_process_blk_queue(dasd_device_t * device) ...@@ -1281,14 +1256,14 @@ __dasd_process_blk_queue(dasd_device_t * device)
* if it reached its expire time. If so, terminate the IO. * if it reached its expire time. If so, terminate the IO.
*/ */
static inline void static inline void
__dasd_check_expire(dasd_device_t * device) __dasd_check_expire(struct dasd_device * device)
{ {
dasd_ccw_req_t *cqr; struct dasd_ccw_req *cqr;
unsigned long long now; unsigned long long now;
if (list_empty(&device->ccw_queue)) if (list_empty(&device->ccw_queue))
return; return;
cqr = list_entry(device->ccw_queue.next, dasd_ccw_req_t, list); cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, list);
if (cqr->status == DASD_CQR_IN_IO && cqr->expires != 0) { if (cqr->status == DASD_CQR_IN_IO && cqr->expires != 0) {
now = get_clock(); now = get_clock();
if (cqr->expires * (TOD_SEC / HZ) + cqr->startclk < now) { if (cqr->expires * (TOD_SEC / HZ) + cqr->startclk < now) {
...@@ -1304,14 +1279,14 @@ __dasd_check_expire(dasd_device_t * device) ...@@ -1304,14 +1279,14 @@ __dasd_check_expire(dasd_device_t * device)
* if it needs to be started. * if it needs to be started.
*/ */
static inline void static inline void
__dasd_start_head(dasd_device_t * device) __dasd_start_head(struct dasd_device * device)
{ {
dasd_ccw_req_t *cqr; struct dasd_ccw_req *cqr;
int rc; int rc;
if (list_empty(&device->ccw_queue)) if (list_empty(&device->ccw_queue))
return; return;
cqr = list_entry(device->ccw_queue.next, dasd_ccw_req_t, list); cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, list);
if (cqr->status == DASD_CQR_QUEUED) { if (cqr->status == DASD_CQR_QUEUED) {
/* try to start the first I/O that can be started */ /* try to start the first I/O that can be started */
rc = device->discipline->start_IO(cqr); rc = device->discipline->start_IO(cqr);
...@@ -1327,16 +1302,16 @@ __dasd_start_head(dasd_device_t * device) ...@@ -1327,16 +1302,16 @@ __dasd_start_head(dasd_device_t * device)
* Remove requests from the ccw queue. * Remove requests from the ccw queue.
*/ */
static void static void
dasd_flush_ccw_queue(dasd_device_t * device, int all) dasd_flush_ccw_queue(struct dasd_device * device, int all)
{ {
struct list_head flush_queue; struct list_head flush_queue;
struct list_head *l, *n; struct list_head *l, *n;
dasd_ccw_req_t *cqr; struct dasd_ccw_req *cqr;
INIT_LIST_HEAD(&flush_queue); INIT_LIST_HEAD(&flush_queue);
spin_lock_irq(get_ccwdev_lock(device->cdev)); spin_lock_irq(get_ccwdev_lock(device->cdev));
list_for_each_safe(l, n, &device->ccw_queue) { list_for_each_safe(l, n, &device->ccw_queue) {
cqr = list_entry(l, dasd_ccw_req_t, list); cqr = list_entry(l, struct dasd_ccw_req, list);
/* Flush all request or only block device requests? */ /* Flush all request or only block device requests? */
if (all == 0 && cqr->callback == dasd_end_request_cb) if (all == 0 && cqr->callback == dasd_end_request_cb)
continue; continue;
...@@ -1359,7 +1334,7 @@ dasd_flush_ccw_queue(dasd_device_t * device, int all) ...@@ -1359,7 +1334,7 @@ dasd_flush_ccw_queue(dasd_device_t * device, int all)
spin_unlock_irq(get_ccwdev_lock(device->cdev)); spin_unlock_irq(get_ccwdev_lock(device->cdev));
/* Now call the callback function of flushed requests */ /* Now call the callback function of flushed requests */
list_for_each_safe(l, n, &flush_queue) { list_for_each_safe(l, n, &flush_queue) {
cqr = list_entry(l, dasd_ccw_req_t, list); cqr = list_entry(l, struct dasd_ccw_req, list);
if (cqr->callback != NULL) if (cqr->callback != NULL)
(cqr->callback)(cqr, cqr->callback_data); (cqr->callback)(cqr, cqr->callback_data);
} }
...@@ -1369,11 +1344,11 @@ dasd_flush_ccw_queue(dasd_device_t * device, int all) ...@@ -1369,11 +1344,11 @@ dasd_flush_ccw_queue(dasd_device_t * device, int all)
* Acquire the device lock and process queues for the device. * Acquire the device lock and process queues for the device.
*/ */
static void static void
dasd_tasklet(dasd_device_t * device) dasd_tasklet(struct dasd_device * device)
{ {
struct list_head final_queue; struct list_head final_queue;
struct list_head *l, *n; struct list_head *l, *n;
dasd_ccw_req_t *cqr; struct dasd_ccw_req *cqr;
atomic_set (&device->tasklet_scheduled, 0); atomic_set (&device->tasklet_scheduled, 0);
INIT_LIST_HEAD(&final_queue); INIT_LIST_HEAD(&final_queue);
...@@ -1385,7 +1360,7 @@ dasd_tasklet(dasd_device_t * device) ...@@ -1385,7 +1360,7 @@ dasd_tasklet(dasd_device_t * device)
spin_unlock_irq(get_ccwdev_lock(device->cdev)); spin_unlock_irq(get_ccwdev_lock(device->cdev));
/* Now call the callback function of requests with final status */ /* Now call the callback function of requests with final status */
list_for_each_safe(l, n, &final_queue) { list_for_each_safe(l, n, &final_queue) {
cqr = list_entry(l, dasd_ccw_req_t, list); cqr = list_entry(l, struct dasd_ccw_req, list);
list_del(&cqr->list); list_del(&cqr->list);
if (cqr->callback != NULL) if (cqr->callback != NULL)
(cqr->callback)(cqr, cqr->callback_data); (cqr->callback)(cqr, cqr->callback_data);
...@@ -1405,7 +1380,7 @@ dasd_tasklet(dasd_device_t * device) ...@@ -1405,7 +1380,7 @@ dasd_tasklet(dasd_device_t * device)
* Schedules a call to dasd_tasklet over the device tasklet. * Schedules a call to dasd_tasklet over the device tasklet.
*/ */
void void
dasd_schedule_bh(dasd_device_t * device) dasd_schedule_bh(struct dasd_device * device)
{ {
/* Protect against rescheduling. */ /* Protect against rescheduling. */
if (atomic_compare_and_swap (0, 1, &device->tasklet_scheduled)) if (atomic_compare_and_swap (0, 1, &device->tasklet_scheduled))
...@@ -1419,9 +1394,9 @@ dasd_schedule_bh(dasd_device_t * device) ...@@ -1419,9 +1394,9 @@ dasd_schedule_bh(dasd_device_t * device)
* possible. * possible.
*/ */
void void
dasd_add_request_head(dasd_ccw_req_t *req) dasd_add_request_head(struct dasd_ccw_req *req)
{ {
dasd_device_t *device; struct dasd_device *device;
unsigned long flags; unsigned long flags;
device = req->device; device = req->device;
...@@ -1439,9 +1414,9 @@ dasd_add_request_head(dasd_ccw_req_t *req) ...@@ -1439,9 +1414,9 @@ dasd_add_request_head(dasd_ccw_req_t *req)
* possible. * possible.
*/ */
void void
dasd_add_request_tail(dasd_ccw_req_t *req) dasd_add_request_tail(struct dasd_ccw_req *req)
{ {
dasd_device_t *device; struct dasd_device *device;
unsigned long flags; unsigned long flags;
device = req->device; device = req->device;
...@@ -1458,15 +1433,15 @@ dasd_add_request_tail(dasd_ccw_req_t *req) ...@@ -1458,15 +1433,15 @@ dasd_add_request_tail(dasd_ccw_req_t *req)
* Wakeup callback. * Wakeup callback.
*/ */
static void static void
dasd_wakeup_cb(dasd_ccw_req_t *cqr, void *data) dasd_wakeup_cb(struct dasd_ccw_req *cqr, void *data)
{ {
wake_up((wait_queue_head_t *) data); wake_up((wait_queue_head_t *) data);
} }
static inline int static inline int
_wait_for_wakeup(dasd_ccw_req_t *cqr) _wait_for_wakeup(struct dasd_ccw_req *cqr)
{ {
dasd_device_t *device; struct dasd_device *device;
int rc; int rc;
device = cqr->device; device = cqr->device;
...@@ -1480,10 +1455,10 @@ _wait_for_wakeup(dasd_ccw_req_t *cqr) ...@@ -1480,10 +1455,10 @@ _wait_for_wakeup(dasd_ccw_req_t *cqr)
* Attempts to start a special ccw queue and waits for its completion. * Attempts to start a special ccw queue and waits for its completion.
*/ */
int int
dasd_sleep_on(dasd_ccw_req_t * cqr) dasd_sleep_on(struct dasd_ccw_req * cqr)
{ {
wait_queue_head_t wait_q; wait_queue_head_t wait_q;
dasd_device_t *device; struct dasd_device *device;
int rc; int rc;
device = cqr->device; device = cqr->device;
...@@ -1512,10 +1487,10 @@ dasd_sleep_on(dasd_ccw_req_t * cqr) ...@@ -1512,10 +1487,10 @@ dasd_sleep_on(dasd_ccw_req_t * cqr)
* for its completion. * for its completion.
*/ */
int int
dasd_sleep_on_interruptible(dasd_ccw_req_t * cqr) dasd_sleep_on_interruptible(struct dasd_ccw_req * cqr)
{ {
wait_queue_head_t wait_q; wait_queue_head_t wait_q;
dasd_device_t *device; struct dasd_device *device;
int rc, finished; int rc, finished;
device = cqr->device; device = cqr->device;
...@@ -1557,14 +1532,14 @@ dasd_sleep_on_interruptible(dasd_ccw_req_t * cqr) ...@@ -1557,14 +1532,14 @@ dasd_sleep_on_interruptible(dasd_ccw_req_t * cqr)
* to the head of the queue. Then the special request is waited on normally. * to the head of the queue. Then the special request is waited on normally.
*/ */
static inline int static inline int
_dasd_term_running_cqr(dasd_device_t *device) _dasd_term_running_cqr(struct dasd_device *device)
{ {
dasd_ccw_req_t *cqr; struct dasd_ccw_req *cqr;
int rc; int rc;
if (list_empty(&device->ccw_queue)) if (list_empty(&device->ccw_queue))
return 0; return 0;
cqr = list_entry(device->ccw_queue.next, dasd_ccw_req_t, list); cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, list);
rc = device->discipline->term_IO(cqr); rc = device->discipline->term_IO(cqr);
if (rc == 0) { if (rc == 0) {
/* termination successful */ /* termination successful */
...@@ -1575,10 +1550,10 @@ _dasd_term_running_cqr(dasd_device_t *device) ...@@ -1575,10 +1550,10 @@ _dasd_term_running_cqr(dasd_device_t *device)
} }
int int
dasd_sleep_on_immediatly(dasd_ccw_req_t * cqr) dasd_sleep_on_immediatly(struct dasd_ccw_req * cqr)
{ {
wait_queue_head_t wait_q; wait_queue_head_t wait_q;
dasd_device_t *device; struct dasd_device *device;
int rc; int rc;
device = cqr->device; device = cqr->device;
...@@ -1613,9 +1588,9 @@ dasd_sleep_on_immediatly(dasd_ccw_req_t * cqr) ...@@ -1613,9 +1588,9 @@ dasd_sleep_on_immediatly(dasd_ccw_req_t * cqr)
* terminated if it is currently in i/o. * terminated if it is currently in i/o.
* Returns 1 if the request has been terminated. * Returns 1 if the request has been terminated.
*/ */
int dasd_cancel_req(dasd_ccw_req_t *cqr) int dasd_cancel_req(struct dasd_ccw_req *cqr)
{ {
dasd_device_t *device = cqr->device; struct dasd_device *device = cqr->device;
unsigned long flags; unsigned long flags;
int rc; int rc;
...@@ -1661,9 +1636,9 @@ int dasd_cancel_req(dasd_ccw_req_t *cqr) ...@@ -1661,9 +1636,9 @@ int dasd_cancel_req(dasd_ccw_req_t *cqr)
static void static void
do_dasd_request(request_queue_t * queue) do_dasd_request(request_queue_t * queue)
{ {
dasd_device_t *device; struct dasd_device *device;
device = (dasd_device_t *) queue->queuedata; device = (struct dasd_device *) queue->queuedata;
spin_lock(get_ccwdev_lock(device->cdev)); spin_lock(get_ccwdev_lock(device->cdev));
/* Get new request from the block device request queue */ /* Get new request from the block device request queue */
__dasd_process_blk_queue(device); __dasd_process_blk_queue(device);
...@@ -1676,7 +1651,7 @@ do_dasd_request(request_queue_t * queue) ...@@ -1676,7 +1651,7 @@ do_dasd_request(request_queue_t * queue)
* Allocate request queue and initialize gendisk info for device. * Allocate request queue and initialize gendisk info for device.
*/ */
static int static int
dasd_setup_blkdev(dasd_device_t * device) dasd_setup_blkdev(struct dasd_device * device)
{ {
int max, rc; int max, rc;
...@@ -1711,7 +1686,7 @@ dasd_setup_blkdev(dasd_device_t * device) ...@@ -1711,7 +1686,7 @@ dasd_setup_blkdev(dasd_device_t * device)
* Deactivate and free request queue. * Deactivate and free request queue.
*/ */
static void static void
dasd_disable_blkdev(dasd_device_t * device) dasd_disable_blkdev(struct dasd_device * device)
{ {
if (device->request_queue) { if (device->request_queue) {
blk_cleanup_queue(device->request_queue); blk_cleanup_queue(device->request_queue);
...@@ -1724,7 +1699,7 @@ dasd_disable_blkdev(dasd_device_t * device) ...@@ -1724,7 +1699,7 @@ dasd_disable_blkdev(dasd_device_t * device)
* Flush request on the request queue. * Flush request on the request queue.
*/ */
static void static void
dasd_flush_request_queue(dasd_device_t * device) dasd_flush_request_queue(struct dasd_device * device)
{ {
struct request *req; struct request *req;
...@@ -1745,7 +1720,7 @@ dasd_flush_request_queue(dasd_device_t * device) ...@@ -1745,7 +1720,7 @@ dasd_flush_request_queue(dasd_device_t * device)
static int static int
dasd_open(struct inode *inp, struct file *filp) dasd_open(struct inode *inp, struct file *filp)
{ {
dasd_device_t *device; struct dasd_device *device;
int rc; int rc;
if (dasd_probeonly) { if (dasd_probeonly) {
...@@ -1776,7 +1751,7 @@ dasd_open(struct inode *inp, struct file *filp) ...@@ -1776,7 +1751,7 @@ dasd_open(struct inode *inp, struct file *filp)
static int static int
dasd_release(struct inode *inp, struct file *filp) dasd_release(struct inode *inp, struct file *filp)
{ {
dasd_device_t *device; struct dasd_device *device;
device = inp->i_bdev->bd_disk->private_data; device = inp->i_bdev->bd_disk->private_data;
...@@ -1824,7 +1799,8 @@ dasd_exit(void) ...@@ -1824,7 +1799,8 @@ dasd_exit(void)
/* initial attempt at a probe function. this can be simplified once /* initial attempt at a probe function. this can be simplified once
* the other detection code is gone */ * the other detection code is gone */
int int
dasd_generic_probe (struct ccw_device *cdev, dasd_discipline_t *discipline) dasd_generic_probe (struct ccw_device *cdev,
struct dasd_discipline *discipline)
{ {
int devno; int devno;
int ret = 0; int ret = 0;
...@@ -1857,7 +1833,7 @@ dasd_generic_probe (struct ccw_device *cdev, dasd_discipline_t *discipline) ...@@ -1857,7 +1833,7 @@ dasd_generic_probe (struct ccw_device *cdev, dasd_discipline_t *discipline)
int int
dasd_generic_remove (struct ccw_device *cdev) dasd_generic_remove (struct ccw_device *cdev)
{ {
struct dasd_device_t *device; struct dasd_device *device;
device = cdev->dev.driver_data; device = cdev->dev.driver_data;
cdev->dev.driver_data = NULL; cdev->dev.driver_data = NULL;
...@@ -1871,10 +1847,10 @@ dasd_generic_remove (struct ccw_device *cdev) ...@@ -1871,10 +1847,10 @@ dasd_generic_remove (struct ccw_device *cdev)
* or the user has started activation through sysfs */ * or the user has started activation through sysfs */
int int
dasd_generic_set_online (struct ccw_device *cdev, dasd_generic_set_online (struct ccw_device *cdev,
dasd_discipline_t *discipline) struct dasd_discipline *discipline)
{ {
dasd_device_t *device; struct dasd_device *device;
int rc; int rc;
device = dasd_create_device(cdev); device = dasd_create_device(cdev);
...@@ -1928,7 +1904,7 @@ dasd_generic_set_online (struct ccw_device *cdev, ...@@ -1928,7 +1904,7 @@ dasd_generic_set_online (struct ccw_device *cdev,
int int
dasd_generic_set_offline (struct ccw_device *cdev) dasd_generic_set_offline (struct ccw_device *cdev)
{ {
dasd_device_t *device; struct dasd_device *device;
device = cdev->dev.driver_data; device = cdev->dev.driver_data;
if (atomic_read(&device->open_count) > 0) { if (atomic_read(&device->open_count) > 0) {
...@@ -1984,7 +1960,7 @@ dasd_generic_auto_online (struct ccw_driver *dasd_discipline_driver) ...@@ -1984,7 +1960,7 @@ dasd_generic_auto_online (struct ccw_driver *dasd_discipline_driver)
static ssize_t static ssize_t
dasd_ro_show(struct device *dev, char *buf) dasd_ro_show(struct device *dev, char *buf)
{ {
dasd_device_t *device; struct dasd_device *device;
device = dev->driver_data; device = dev->driver_data;
if (!device) if (!device)
...@@ -1996,7 +1972,7 @@ dasd_ro_show(struct device *dev, char *buf) ...@@ -1996,7 +1972,7 @@ dasd_ro_show(struct device *dev, char *buf)
static ssize_t static ssize_t
dasd_ro_store(struct device *dev, const char *buf, size_t count) dasd_ro_store(struct device *dev, const char *buf, size_t count)
{ {
dasd_device_t *device = dev->driver_data; struct dasd_device *device = dev->driver_data;
if (device) if (device)
device->ro_flag = (buf[0] == '1') ? 1 : 0; device->ro_flag = (buf[0] == '1') ? 1 : 0;
...@@ -2013,7 +1989,7 @@ static DEVICE_ATTR(readonly, 0644, dasd_ro_show, dasd_ro_store); ...@@ -2013,7 +1989,7 @@ static DEVICE_ATTR(readonly, 0644, dasd_ro_show, dasd_ro_store);
static ssize_t static ssize_t
dasd_use_diag_show(struct device *dev, char *buf) dasd_use_diag_show(struct device *dev, char *buf)
{ {
dasd_device_t *device; struct dasd_device *device;
device = dev->driver_data; device = dev->driver_data;
if (!device) if (!device)
...@@ -2025,7 +2001,7 @@ dasd_use_diag_show(struct device *dev, char *buf) ...@@ -2025,7 +2001,7 @@ dasd_use_diag_show(struct device *dev, char *buf)
static ssize_t static ssize_t
dasd_use_diag_store(struct device *dev, const char *buf, size_t count) dasd_use_diag_store(struct device *dev, const char *buf, size_t count)
{ {
dasd_device_t *device = dev->driver_data; struct dasd_device *device = dev->driver_data;
if (device) if (device)
device->use_diag_flag = (buf[0] == '1') ? 1 : 0; device->use_diag_flag = (buf[0] == '1') ? 1 : 0;
...@@ -2043,7 +2019,7 @@ static ssize_t ...@@ -2043,7 +2019,7 @@ static ssize_t
dasd_devices_show(struct device *dev, char *buf) dasd_devices_show(struct device *dev, char *buf)
{ {
dasd_device_t *device; struct dasd_device *device;
dasd_devmap_t *devmap; dasd_devmap_t *devmap;
devmap = NULL; devmap = NULL;
...@@ -2063,7 +2039,7 @@ static DEVICE_ATTR(dasd, 0444, dasd_devices_show, 0); ...@@ -2063,7 +2039,7 @@ static DEVICE_ATTR(dasd, 0444, dasd_devices_show, 0);
static ssize_t static ssize_t
dasd_discipline_show(struct device *dev, char *buf) dasd_discipline_show(struct device *dev, char *buf)
{ {
dasd_device_t *device; struct dasd_device *device;
device = dev->driver_data; device = dev->driver_data;
if (!device || !device->discipline) if (!device || !device->discipline)
......
...@@ -4,10 +4,7 @@ ...@@ -4,10 +4,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000
* *
* $Revision: 1.7 $ * $Revision: 1.9 $
*
* History of changes
*
*/ */
#define PRINTK_HEADER "dasd_erp(3370)" #define PRINTK_HEADER "dasd_erp(3370)"
...@@ -32,7 +29,7 @@ ...@@ -32,7 +29,7 @@
* dasd_era_recover for all others. * dasd_era_recover for all others.
*/ */
dasd_era_t dasd_era_t
dasd_3370_erp_examine(dasd_ccw_req_t * cqr, struct irb * irb) dasd_3370_erp_examine(struct dasd_ccw_req * cqr, struct irb * irb)
{ {
char *sense = irb->ecw; char *sense = irb->ecw;
......
...@@ -5,11 +5,7 @@ ...@@ -5,11 +5,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000, 2001 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000, 2001
* *
* $Revision: 1.20 $ * $Revision: 1.24 $
*
* History of changes:
* 05/14/01 fixed PL030160GTO (BUG() in erp_action_5)
* 05/04/02 code restructuring.
*/ */
#include <linux/timer.h> #include <linux/timer.h>
...@@ -23,11 +19,11 @@ ...@@ -23,11 +19,11 @@
#include "dasd_eckd.h" #include "dasd_eckd.h"
typedef struct DCTL_data_t { struct DCTL_data {
unsigned char subcommand; /* e.g Inhibit Write, Enable Write,... */ unsigned char subcommand; /* e.g Inhibit Write, Enable Write,... */
unsigned char modifier; /* Subcommand modifier */ unsigned char modifier; /* Subcommand modifier */
unsigned short res; /* reserved */ unsigned short res; /* reserved */
} __attribute__ ((packed)) DCTL_data_t; } __attribute__ ((packed));
/* /*
***************************************************************************** *****************************************************************************
...@@ -54,10 +50,10 @@ typedef struct DCTL_data_t { ...@@ -54,10 +50,10 @@ typedef struct DCTL_data_t {
* dasd_era_recover for all others. * dasd_era_recover for all others.
*/ */
static dasd_era_t static dasd_era_t
dasd_3990_erp_examine_24(dasd_ccw_req_t * cqr, char *sense) dasd_3990_erp_examine_24(struct dasd_ccw_req * cqr, char *sense)
{ {
dasd_device_t *device = cqr->device; struct dasd_device *device = cqr->device;
/* check for 'Command Reject' */ /* check for 'Command Reject' */
if ((sense[0] & SNS0_CMD_REJECT) && if ((sense[0] & SNS0_CMD_REJECT) &&
...@@ -111,10 +107,10 @@ dasd_3990_erp_examine_24(dasd_ccw_req_t * cqr, char *sense) ...@@ -111,10 +107,10 @@ dasd_3990_erp_examine_24(dasd_ccw_req_t * cqr, char *sense)
* dasd_era_recover for recoverable others. * dasd_era_recover for recoverable others.
*/ */
static dasd_era_t static dasd_era_t
dasd_3990_erp_examine_32(dasd_ccw_req_t * cqr, char *sense) dasd_3990_erp_examine_32(struct dasd_ccw_req * cqr, char *sense)
{ {
dasd_device_t *device = cqr->device; struct dasd_device *device = cqr->device;
switch (sense[25]) { switch (sense[25]) {
case 0x00: case 0x00:
...@@ -149,12 +145,12 @@ dasd_3990_erp_examine_32(dasd_ccw_req_t * cqr, char *sense) ...@@ -149,12 +145,12 @@ dasd_3990_erp_examine_32(dasd_ccw_req_t * cqr, char *sense)
* dasd_era_recover for all others. * dasd_era_recover for all others.
*/ */
dasd_era_t dasd_era_t
dasd_3990_erp_examine(dasd_ccw_req_t * cqr, struct irb * irb) dasd_3990_erp_examine(struct dasd_ccw_req * cqr, struct irb * irb)
{ {
char *sense = irb->ecw; char *sense = irb->ecw;
dasd_era_t era = dasd_era_recover; dasd_era_t era = dasd_era_recover;
dasd_device_t *device = cqr->device; struct dasd_device *device = cqr->device;
/* check for successful execution first */ /* check for successful execution first */
if (irb->scsw.cstat == 0x00 && if (irb->scsw.cstat == 0x00 &&
...@@ -207,10 +203,10 @@ dasd_3990_erp_examine(dasd_ccw_req_t * cqr, struct irb * irb) ...@@ -207,10 +203,10 @@ dasd_3990_erp_examine(dasd_ccw_req_t * cqr, struct irb * irb)
* RETURN VALUES * RETURN VALUES
* cqr original cqr * cqr original cqr
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_cleanup(dasd_ccw_req_t * erp, char final_status) dasd_3990_erp_cleanup(struct dasd_ccw_req * erp, char final_status)
{ {
dasd_ccw_req_t *cqr = erp->refers; struct dasd_ccw_req *cqr = erp->refers;
dasd_free_erp_request(erp, erp->device); dasd_free_erp_request(erp, erp->device);
cqr->status = final_status; cqr->status = final_status;
...@@ -234,10 +230,10 @@ dasd_3990_erp_cleanup(dasd_ccw_req_t * erp, char final_status) ...@@ -234,10 +230,10 @@ dasd_3990_erp_cleanup(dasd_ccw_req_t * erp, char final_status)
* void * void
*/ */
static void static void
dasd_3990_erp_block_queue(dasd_ccw_req_t * erp, int expires) dasd_3990_erp_block_queue(struct dasd_ccw_req * erp, int expires)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
DEV_MESSAGE(KERN_INFO, device, DEV_MESSAGE(KERN_INFO, device,
"blocking request queue for %is", expires); "blocking request queue for %is", expires);
...@@ -258,11 +254,11 @@ dasd_3990_erp_block_queue(dasd_ccw_req_t * erp, int expires) ...@@ -258,11 +254,11 @@ dasd_3990_erp_block_queue(dasd_ccw_req_t * erp, int expires)
* RETURN VALUES * RETURN VALUES
* erp modified erp * erp modified erp
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_int_req(dasd_ccw_req_t * erp) dasd_3990_erp_int_req(struct dasd_ccw_req * erp)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
/* first time set initial retry counter and erp_function */ /* first time set initial retry counter and erp_function */
/* and retry once without blocking queue */ /* and retry once without blocking queue */
...@@ -301,9 +297,9 @@ dasd_3990_erp_int_req(dasd_ccw_req_t * erp) ...@@ -301,9 +297,9 @@ dasd_3990_erp_int_req(dasd_ccw_req_t * erp)
* erp modified pointer to the ERP * erp modified pointer to the ERP
*/ */
static void static void
dasd_3990_erp_alternate_path(dasd_ccw_req_t * erp) dasd_3990_erp_alternate_path(struct dasd_ccw_req * erp)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
__u8 opm; __u8 opm;
/* try alternate valid path */ /* try alternate valid path */
...@@ -349,17 +345,18 @@ dasd_3990_erp_alternate_path(dasd_ccw_req_t * erp) ...@@ -349,17 +345,18 @@ dasd_3990_erp_alternate_path(dasd_ccw_req_t * erp)
* dctl_cqr pointer to NEW dctl_cqr * dctl_cqr pointer to NEW dctl_cqr
* *
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_DCTL(dasd_ccw_req_t * erp, char modifier) dasd_3990_erp_DCTL(struct dasd_ccw_req * erp, char modifier)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
DCTL_data_t *DCTL_data; struct DCTL_data *DCTL_data;
struct ccw1 *ccw; struct ccw1 *ccw;
dasd_ccw_req_t *dctl_cqr; struct dasd_ccw_req *dctl_cqr;
dctl_cqr = dasd_alloc_erp_request((char *) &erp->magic, 1, dctl_cqr = dasd_alloc_erp_request((char *) &erp->magic, 1,
sizeof (DCTL_data_t), erp->device); sizeof (struct DCTL_data),
erp->device);
if (IS_ERR(dctl_cqr)) { if (IS_ERR(dctl_cqr)) {
DEV_MESSAGE(KERN_ERR, device, "%s", DEV_MESSAGE(KERN_ERR, device, "%s",
"Unable to allocate DCTL-CQR"); "Unable to allocate DCTL-CQR");
...@@ -409,8 +406,8 @@ dasd_3990_erp_DCTL(dasd_ccw_req_t * erp, char modifier) ...@@ -409,8 +406,8 @@ dasd_3990_erp_DCTL(dasd_ccw_req_t * erp, char modifier)
* erp pointer to the ERP * erp pointer to the ERP
* *
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_action_1(dasd_ccw_req_t * erp) dasd_3990_erp_action_1(struct dasd_ccw_req * erp)
{ {
erp->function = dasd_3990_erp_action_1; erp->function = dasd_3990_erp_action_1;
...@@ -438,11 +435,11 @@ dasd_3990_erp_action_1(dasd_ccw_req_t * erp) ...@@ -438,11 +435,11 @@ dasd_3990_erp_action_1(dasd_ccw_req_t * erp)
* erp pointer to the ERP * erp pointer to the ERP
* *
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_action_4(dasd_ccw_req_t * erp, char *sense) dasd_3990_erp_action_4(struct dasd_ccw_req * erp, char *sense)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
/* first time set initial retry counter and erp_function */ /* first time set initial retry counter and erp_function */
/* and retry once without waiting for state change pending */ /* and retry once without waiting for state change pending */
...@@ -496,8 +493,8 @@ dasd_3990_erp_action_4(dasd_ccw_req_t * erp, char *sense) ...@@ -496,8 +493,8 @@ dasd_3990_erp_action_4(dasd_ccw_req_t * erp, char *sense)
* erp pointer to the ERP * erp pointer to the ERP
* *
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_action_5(dasd_ccw_req_t * erp) dasd_3990_erp_action_5(struct dasd_ccw_req * erp)
{ {
/* first of all retry */ /* first of all retry */
...@@ -523,10 +520,10 @@ dasd_3990_erp_action_5(dasd_ccw_req_t * erp) ...@@ -523,10 +520,10 @@ dasd_3990_erp_action_5(dasd_ccw_req_t * erp)
* void * void
*/ */
static void static void
dasd_3990_handle_env_data(dasd_ccw_req_t * erp, char *sense) dasd_3990_handle_env_data(struct dasd_ccw_req * erp, char *sense)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
char msg_format = (sense[7] & 0xF0); char msg_format = (sense[7] & 0xF0);
char msg_no = (sense[7] & 0x0F); char msg_no = (sense[7] & 0x0F);
...@@ -1146,11 +1143,11 @@ dasd_3990_handle_env_data(dasd_ccw_req_t * erp, char *sense) ...@@ -1146,11 +1143,11 @@ dasd_3990_handle_env_data(dasd_ccw_req_t * erp, char *sense)
* RETURN VALUES * RETURN VALUES
* erp 'new' erp_head - pointer to new ERP * erp 'new' erp_head - pointer to new ERP
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_com_rej(dasd_ccw_req_t * erp, char *sense) dasd_3990_erp_com_rej(struct dasd_ccw_req * erp, char *sense)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
erp->function = dasd_3990_erp_com_rej; erp->function = dasd_3990_erp_com_rej;
...@@ -1187,11 +1184,11 @@ dasd_3990_erp_com_rej(dasd_ccw_req_t * erp, char *sense) ...@@ -1187,11 +1184,11 @@ dasd_3990_erp_com_rej(dasd_ccw_req_t * erp, char *sense)
* RETURN VALUES * RETURN VALUES
* erp new erp_head - pointer to new ERP * erp new erp_head - pointer to new ERP
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_bus_out(dasd_ccw_req_t * erp) dasd_3990_erp_bus_out(struct dasd_ccw_req * erp)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
/* first time set initial retry counter and erp_function */ /* first time set initial retry counter and erp_function */
/* and retry once without blocking queue */ /* and retry once without blocking queue */
...@@ -1226,11 +1223,11 @@ dasd_3990_erp_bus_out(dasd_ccw_req_t * erp) ...@@ -1226,11 +1223,11 @@ dasd_3990_erp_bus_out(dasd_ccw_req_t * erp)
* RETURN VALUES * RETURN VALUES
* erp new erp_head - pointer to new ERP * erp new erp_head - pointer to new ERP
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_equip_check(dasd_ccw_req_t * erp, char *sense) dasd_3990_erp_equip_check(struct dasd_ccw_req * erp, char *sense)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
erp->function = dasd_3990_erp_equip_check; erp->function = dasd_3990_erp_equip_check;
...@@ -1288,11 +1285,11 @@ dasd_3990_erp_equip_check(dasd_ccw_req_t * erp, char *sense) ...@@ -1288,11 +1285,11 @@ dasd_3990_erp_equip_check(dasd_ccw_req_t * erp, char *sense)
* RETURN VALUES * RETURN VALUES
* erp new erp_head - pointer to new ERP * erp new erp_head - pointer to new ERP
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_data_check(dasd_ccw_req_t * erp, char *sense) dasd_3990_erp_data_check(struct dasd_ccw_req * erp, char *sense)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
erp->function = dasd_3990_erp_data_check; erp->function = dasd_3990_erp_data_check;
...@@ -1347,11 +1344,11 @@ dasd_3990_erp_data_check(dasd_ccw_req_t * erp, char *sense) ...@@ -1347,11 +1344,11 @@ dasd_3990_erp_data_check(dasd_ccw_req_t * erp, char *sense)
* RETURN VALUES * RETURN VALUES
* erp new erp_head - pointer to new ERP * erp new erp_head - pointer to new ERP
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_overrun(dasd_ccw_req_t * erp, char *sense) dasd_3990_erp_overrun(struct dasd_ccw_req * erp, char *sense)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
erp->function = dasd_3990_erp_overrun; erp->function = dasd_3990_erp_overrun;
...@@ -1376,11 +1373,11 @@ dasd_3990_erp_overrun(dasd_ccw_req_t * erp, char *sense) ...@@ -1376,11 +1373,11 @@ dasd_3990_erp_overrun(dasd_ccw_req_t * erp, char *sense)
* RETURN VALUES * RETURN VALUES
* erp new erp_head - pointer to new ERP * erp new erp_head - pointer to new ERP
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_inv_format(dasd_ccw_req_t * erp, char *sense) dasd_3990_erp_inv_format(struct dasd_ccw_req * erp, char *sense)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
erp->function = dasd_3990_erp_inv_format; erp->function = dasd_3990_erp_inv_format;
...@@ -1417,11 +1414,11 @@ dasd_3990_erp_inv_format(dasd_ccw_req_t * erp, char *sense) ...@@ -1417,11 +1414,11 @@ dasd_3990_erp_inv_format(dasd_ccw_req_t * erp, char *sense)
* RETURN VALUES * RETURN VALUES
* erp pointer to original (failed) cqr. * erp pointer to original (failed) cqr.
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_EOC(dasd_ccw_req_t * default_erp, char *sense) dasd_3990_erp_EOC(struct dasd_ccw_req * default_erp, char *sense)
{ {
dasd_device_t *device = default_erp->device; struct dasd_device *device = default_erp->device;
DEV_MESSAGE(KERN_ERR, device, "%s", DEV_MESSAGE(KERN_ERR, device, "%s",
"End-of-Cylinder - must never happen"); "End-of-Cylinder - must never happen");
...@@ -1442,11 +1439,11 @@ dasd_3990_erp_EOC(dasd_ccw_req_t * default_erp, char *sense) ...@@ -1442,11 +1439,11 @@ dasd_3990_erp_EOC(dasd_ccw_req_t * default_erp, char *sense)
* RETURN VALUES * RETURN VALUES
* erp new erp_head - pointer to new ERP * erp new erp_head - pointer to new ERP
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_env_data(dasd_ccw_req_t * erp, char *sense) dasd_3990_erp_env_data(struct dasd_ccw_req * erp, char *sense)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
erp->function = dasd_3990_erp_env_data; erp->function = dasd_3990_erp_env_data;
...@@ -1479,11 +1476,11 @@ dasd_3990_erp_env_data(dasd_ccw_req_t * erp, char *sense) ...@@ -1479,11 +1476,11 @@ dasd_3990_erp_env_data(dasd_ccw_req_t * erp, char *sense)
* RETURN VALUES * RETURN VALUES
* erp new erp_head - pointer to new ERP * erp new erp_head - pointer to new ERP
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_no_rec(dasd_ccw_req_t * default_erp, char *sense) dasd_3990_erp_no_rec(struct dasd_ccw_req * default_erp, char *sense)
{ {
dasd_device_t *device = default_erp->device; struct dasd_device *device = default_erp->device;
DEV_MESSAGE(KERN_ERR, device, "%s", DEV_MESSAGE(KERN_ERR, device, "%s",
"No Record Found - Fatal error should " "No Record Found - Fatal error should "
...@@ -1506,11 +1503,11 @@ dasd_3990_erp_no_rec(dasd_ccw_req_t * default_erp, char *sense) ...@@ -1506,11 +1503,11 @@ dasd_3990_erp_no_rec(dasd_ccw_req_t * default_erp, char *sense)
* RETURN VALUES * RETURN VALUES
* erp new erp_head - pointer to new ERP * erp new erp_head - pointer to new ERP
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_file_prot(dasd_ccw_req_t * erp) dasd_3990_erp_file_prot(struct dasd_ccw_req * erp)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
DEV_MESSAGE(KERN_ERR, device, "%s", "File Protected"); DEV_MESSAGE(KERN_ERR, device, "%s", "File Protected");
...@@ -1532,11 +1529,11 @@ dasd_3990_erp_file_prot(dasd_ccw_req_t * erp) ...@@ -1532,11 +1529,11 @@ dasd_3990_erp_file_prot(dasd_ccw_req_t * erp)
* RETURN VALUES * RETURN VALUES
* erp pointer to the (addtitional) ERP * erp pointer to the (addtitional) ERP
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_inspect_24(dasd_ccw_req_t * erp, char *sense) dasd_3990_erp_inspect_24(struct dasd_ccw_req * erp, char *sense)
{ {
dasd_ccw_req_t *erp_filled = NULL; struct dasd_ccw_req *erp_filled = NULL;
/* Check sense for .... */ /* Check sense for .... */
/* 'Command Reject' */ /* 'Command Reject' */
...@@ -1612,11 +1609,11 @@ dasd_3990_erp_inspect_24(dasd_ccw_req_t * erp, char *sense) ...@@ -1612,11 +1609,11 @@ dasd_3990_erp_inspect_24(dasd_ccw_req_t * erp, char *sense)
* RETURN VALUES * RETURN VALUES
* erp modified erp_head * erp modified erp_head
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_action_10_32(dasd_ccw_req_t * erp, char *sense) dasd_3990_erp_action_10_32(struct dasd_ccw_req * erp, char *sense)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
erp->retries = 256; erp->retries = 256;
erp->function = dasd_3990_erp_action_10_32; erp->function = dasd_3990_erp_action_10_32;
...@@ -1646,15 +1643,15 @@ dasd_3990_erp_action_10_32(dasd_ccw_req_t * erp, char *sense) ...@@ -1646,15 +1643,15 @@ dasd_3990_erp_action_10_32(dasd_ccw_req_t * erp, char *sense)
* erp new erp or * erp new erp or
* default_erp in case of imprecise ending or error * default_erp in case of imprecise ending or error
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_action_1B_32(dasd_ccw_req_t * default_erp, char *sense) dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense)
{ {
dasd_device_t *device = default_erp->device; struct dasd_device *device = default_erp->device;
__u32 cpa = 0; __u32 cpa = 0;
dasd_ccw_req_t *cqr; struct dasd_ccw_req *cqr;
dasd_ccw_req_t *erp; struct dasd_ccw_req *erp;
DE_eckd_data_t *DE_data; struct DE_eckd_data *DE_data;
char *LO_data; /* LO_eckd_data_t */ char *LO_data; /* LO_eckd_data_t */
struct ccw1 *ccw; struct ccw1 *ccw;
...@@ -1695,8 +1692,8 @@ dasd_3990_erp_action_1B_32(dasd_ccw_req_t * default_erp, char *sense) ...@@ -1695,8 +1692,8 @@ dasd_3990_erp_action_1B_32(dasd_ccw_req_t * default_erp, char *sense)
/* Build new ERP request including DE/LO */ /* Build new ERP request including DE/LO */
erp = dasd_alloc_erp_request((char *) &cqr->magic, erp = dasd_alloc_erp_request((char *) &cqr->magic,
2 + 1,/* DE/LO + TIC */ 2 + 1,/* DE/LO + TIC */
sizeof (DE_eckd_data_t) + sizeof (struct DE_eckd_data) +
sizeof (LO_eckd_data_t), device); sizeof (struct LO_eckd_data), device);
if (IS_ERR(erp)) { if (IS_ERR(erp)) {
DEV_MESSAGE(KERN_ERR, device, "%s", "Unable to allocate ERP"); DEV_MESSAGE(KERN_ERR, device, "%s", "Unable to allocate ERP");
...@@ -1705,10 +1702,10 @@ dasd_3990_erp_action_1B_32(dasd_ccw_req_t * default_erp, char *sense) ...@@ -1705,10 +1702,10 @@ dasd_3990_erp_action_1B_32(dasd_ccw_req_t * default_erp, char *sense)
/* use original DE */ /* use original DE */
DE_data = erp->data; DE_data = erp->data;
memcpy(DE_data, cqr->data, sizeof (DE_eckd_data_t)); memcpy(DE_data, cqr->data, sizeof (struct DE_eckd_data));
/* create LO */ /* create LO */
LO_data = erp->data + sizeof (DE_eckd_data_t); LO_data = erp->data + sizeof (struct DE_eckd_data);
if ((sense[3] == 0x01) && (LO_data[1] & 0x01)) { if ((sense[3] == 0x01) && (LO_data[1] & 0x01)) {
...@@ -1791,15 +1788,15 @@ dasd_3990_erp_action_1B_32(dasd_ccw_req_t * default_erp, char *sense) ...@@ -1791,15 +1788,15 @@ dasd_3990_erp_action_1B_32(dasd_ccw_req_t * default_erp, char *sense)
* RETURN VALUES * RETURN VALUES
* erp modified erp * erp modified erp
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_update_1B(dasd_ccw_req_t * previous_erp, char *sense) dasd_3990_update_1B(struct dasd_ccw_req * previous_erp, char *sense)
{ {
dasd_device_t *device = previous_erp->device; struct dasd_device *device = previous_erp->device;
__u32 cpa = 0; __u32 cpa = 0;
dasd_ccw_req_t *cqr; struct dasd_ccw_req *cqr;
dasd_ccw_req_t *erp; struct dasd_ccw_req *erp;
char *LO_data; /* LO_eckd_data_t */ char *LO_data; /* struct LO_eckd_data */
struct ccw1 *ccw; struct ccw1 *ccw;
DEV_MESSAGE(KERN_DEBUG, device, "%s", DEV_MESSAGE(KERN_DEBUG, device, "%s",
...@@ -1842,7 +1839,7 @@ dasd_3990_update_1B(dasd_ccw_req_t * previous_erp, char *sense) ...@@ -1842,7 +1839,7 @@ dasd_3990_update_1B(dasd_ccw_req_t * previous_erp, char *sense)
erp = previous_erp; erp = previous_erp;
/* update the LO with the new returned sense data */ /* update the LO with the new returned sense data */
LO_data = erp->data + sizeof (DE_eckd_data_t); LO_data = erp->data + sizeof (struct DE_eckd_data);
if ((sense[3] == 0x01) && (LO_data[1] & 0x01)) { if ((sense[3] == 0x01) && (LO_data[1] & 0x01)) {
...@@ -1905,7 +1902,7 @@ dasd_3990_update_1B(dasd_ccw_req_t * previous_erp, char *sense) ...@@ -1905,7 +1902,7 @@ dasd_3990_update_1B(dasd_ccw_req_t * previous_erp, char *sense)
* *
*/ */
static void static void
dasd_3990_erp_compound_retry(dasd_ccw_req_t * erp, char *sense) dasd_3990_erp_compound_retry(struct dasd_ccw_req * erp, char *sense)
{ {
switch (sense[25] & 0x03) { switch (sense[25] & 0x03) {
...@@ -1949,7 +1946,7 @@ dasd_3990_erp_compound_retry(dasd_ccw_req_t * erp, char *sense) ...@@ -1949,7 +1946,7 @@ dasd_3990_erp_compound_retry(dasd_ccw_req_t * erp, char *sense)
* *
*/ */
static void static void
dasd_3990_erp_compound_path(dasd_ccw_req_t * erp, char *sense) dasd_3990_erp_compound_path(struct dasd_ccw_req * erp, char *sense)
{ {
if (sense[25] & DASD_SENSE_BIT_3) { if (sense[25] & DASD_SENSE_BIT_3) {
...@@ -1984,8 +1981,8 @@ dasd_3990_erp_compound_path(dasd_ccw_req_t * erp, char *sense) ...@@ -1984,8 +1981,8 @@ dasd_3990_erp_compound_path(dasd_ccw_req_t * erp, char *sense)
* erp NEW ERP pointer * erp NEW ERP pointer
* *
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_compound_code(dasd_ccw_req_t * erp, char *sense) dasd_3990_erp_compound_code(struct dasd_ccw_req * erp, char *sense)
{ {
if (sense[25] & DASD_SENSE_BIT_2) { if (sense[25] & DASD_SENSE_BIT_2) {
...@@ -2033,13 +2030,13 @@ dasd_3990_erp_compound_code(dasd_ccw_req_t * erp, char *sense) ...@@ -2033,13 +2030,13 @@ dasd_3990_erp_compound_code(dasd_ccw_req_t * erp, char *sense)
* *
*/ */
static void static void
dasd_3990_erp_compound_config(dasd_ccw_req_t * erp, char *sense) dasd_3990_erp_compound_config(struct dasd_ccw_req * erp, char *sense)
{ {
if ((sense[25] & DASD_SENSE_BIT_1) && (sense[26] & DASD_SENSE_BIT_2)) { if ((sense[25] & DASD_SENSE_BIT_1) && (sense[26] & DASD_SENSE_BIT_2)) {
/* set to suspended duplex state then restart */ /* set to suspended duplex state then restart */
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
DEV_MESSAGE(KERN_ERR, device, "%s", DEV_MESSAGE(KERN_ERR, device, "%s",
"Set device to suspended duplex state should be " "Set device to suspended duplex state should be "
...@@ -2068,8 +2065,8 @@ dasd_3990_erp_compound_config(dasd_ccw_req_t * erp, char *sense) ...@@ -2068,8 +2065,8 @@ dasd_3990_erp_compound_config(dasd_ccw_req_t * erp, char *sense)
* erp (additional) ERP pointer * erp (additional) ERP pointer
* *
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_compound(dasd_ccw_req_t * erp, char *sense) dasd_3990_erp_compound(struct dasd_ccw_req * erp, char *sense)
{ {
if ((erp->function == dasd_3990_erp_compound_retry) && if ((erp->function == dasd_3990_erp_compound_retry) &&
...@@ -2115,11 +2112,11 @@ dasd_3990_erp_compound(dasd_ccw_req_t * erp, char *sense) ...@@ -2115,11 +2112,11 @@ dasd_3990_erp_compound(dasd_ccw_req_t * erp, char *sense)
* erp_filled pointer to the ERP * erp_filled pointer to the ERP
* *
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_inspect_32(dasd_ccw_req_t * erp, char *sense) dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
erp->function = dasd_3990_erp_inspect_32; erp->function = dasd_3990_erp_inspect_32;
...@@ -2232,11 +2229,11 @@ dasd_3990_erp_inspect_32(dasd_ccw_req_t * erp, char *sense) ...@@ -2232,11 +2229,11 @@ dasd_3990_erp_inspect_32(dasd_ccw_req_t * erp, char *sense)
* RETURN VALUES * RETURN VALUES
* erp_new contens was possibly modified * erp_new contens was possibly modified
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_inspect(dasd_ccw_req_t * erp) dasd_3990_erp_inspect(struct dasd_ccw_req * erp)
{ {
dasd_ccw_req_t *erp_new = NULL; struct dasd_ccw_req *erp_new = NULL;
/* sense data are located in the refers record of the */ /* sense data are located in the refers record of the */
/* already set up new ERP ! */ /* already set up new ERP ! */
char *sense = erp->refers->dstat->ecw; char *sense = erp->refers->dstat->ecw;
...@@ -2272,15 +2269,15 @@ dasd_3990_erp_inspect(dasd_ccw_req_t * erp) ...@@ -2272,15 +2269,15 @@ dasd_3990_erp_inspect(dasd_ccw_req_t * erp)
* RETURN VALUES * RETURN VALUES
* erp pointer to new ERP-chain head * erp pointer to new ERP-chain head
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_add_erp(dasd_ccw_req_t * cqr) dasd_3990_erp_add_erp(struct dasd_ccw_req * cqr)
{ {
dasd_device_t *device = cqr->device; struct dasd_device *device = cqr->device;
struct ccw1 *ccw; struct ccw1 *ccw;
/* allocate additional request block */ /* allocate additional request block */
dasd_ccw_req_t *erp; struct dasd_ccw_req *erp;
erp = dasd_alloc_erp_request((char *) &cqr->magic, 2, 0, cqr->device); erp = dasd_alloc_erp_request((char *) &cqr->magic, 2, 0, cqr->device);
if (IS_ERR(erp)) { if (IS_ERR(erp)) {
...@@ -2333,11 +2330,11 @@ dasd_3990_erp_add_erp(dasd_ccw_req_t * cqr) ...@@ -2333,11 +2330,11 @@ dasd_3990_erp_add_erp(dasd_ccw_req_t * cqr)
* RETURN VALUES * RETURN VALUES
* erp pointer to new ERP-chain head * erp pointer to new ERP-chain head
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_additional_erp(dasd_ccw_req_t * cqr) dasd_3990_erp_additional_erp(struct dasd_ccw_req * cqr)
{ {
dasd_ccw_req_t *erp = NULL; struct dasd_ccw_req *erp = NULL;
/* add erp and initialize with default TIC */ /* add erp and initialize with default TIC */
erp = dasd_3990_erp_add_erp(cqr); erp = dasd_3990_erp_add_erp(cqr);
...@@ -2371,7 +2368,7 @@ dasd_3990_erp_additional_erp(dasd_ccw_req_t * cqr) ...@@ -2371,7 +2368,7 @@ dasd_3990_erp_additional_erp(dasd_ccw_req_t * cqr)
* returns 1 if match found, otherwise 0. * returns 1 if match found, otherwise 0.
*/ */
static int static int
dasd_3990_erp_error_match(dasd_ccw_req_t * cqr1, dasd_ccw_req_t * cqr2) dasd_3990_erp_error_match(struct dasd_ccw_req *cqr1, struct dasd_ccw_req *cqr2)
{ {
/* check failed CCW */ /* check failed CCW */
...@@ -2406,11 +2403,11 @@ dasd_3990_erp_error_match(dasd_ccw_req_t * cqr1, dasd_ccw_req_t * cqr2) ...@@ -2406,11 +2403,11 @@ dasd_3990_erp_error_match(dasd_ccw_req_t * cqr1, dasd_ccw_req_t * cqr2)
* recovery procedure OR * recovery procedure OR
* NULL if a 'new' error occurred. * NULL if a 'new' error occurred.
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_in_erp(dasd_ccw_req_t * cqr) dasd_3990_erp_in_erp(struct dasd_ccw_req *cqr)
{ {
dasd_ccw_req_t *erp_head = cqr, /* save erp chain head */ struct dasd_ccw_req *erp_head = cqr, /* save erp chain head */
*erp_match = NULL; /* save erp chain head */ *erp_match = NULL; /* save erp chain head */
int match = 0; /* 'boolean' for matching error found */ int match = 0; /* 'boolean' for matching error found */
...@@ -2450,11 +2447,11 @@ dasd_3990_erp_in_erp(dasd_ccw_req_t * cqr) ...@@ -2450,11 +2447,11 @@ dasd_3990_erp_in_erp(dasd_ccw_req_t * cqr)
* RETURN VALUES * RETURN VALUES
* erp modified/additional ERP * erp modified/additional ERP
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_further_erp(dasd_ccw_req_t * erp) dasd_3990_erp_further_erp(struct dasd_ccw_req *erp)
{ {
dasd_device_t *device = erp->device; struct dasd_device *device = erp->device;
char *sense = erp->dstat->ecw; char *sense = erp->dstat->ecw;
/* check for 24 byte sense ERP */ /* check for 24 byte sense ERP */
...@@ -2539,13 +2536,14 @@ dasd_3990_erp_further_erp(dasd_ccw_req_t * erp) ...@@ -2539,13 +2536,14 @@ dasd_3990_erp_further_erp(dasd_ccw_req_t * erp)
* RETURN VALUES * RETURN VALUES
* erp modified/additional ERP * erp modified/additional ERP
*/ */
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_3990_erp_handle_match_erp(dasd_ccw_req_t * erp_head, dasd_ccw_req_t * erp) dasd_3990_erp_handle_match_erp(struct dasd_ccw_req *erp_head,
struct dasd_ccw_req *erp)
{ {
dasd_device_t *device = erp_head->device; struct dasd_device *device = erp_head->device;
dasd_ccw_req_t *erp_done = erp_head; /* finished req */ struct dasd_ccw_req *erp_done = erp_head; /* finished req */
dasd_ccw_req_t *erp_free = NULL; /* req to be freed */ struct dasd_ccw_req *erp_free = NULL; /* req to be freed */
/* loop over successful ERPs and remove them from chanq */ /* loop over successful ERPs and remove them from chanq */
while (erp_done != erp) { while (erp_done != erp) {
...@@ -2619,12 +2617,12 @@ dasd_3990_erp_handle_match_erp(dasd_ccw_req_t * erp_head, dasd_ccw_req_t * erp) ...@@ -2619,12 +2617,12 @@ dasd_3990_erp_handle_match_erp(dasd_ccw_req_t * erp_head, dasd_ccw_req_t * erp)
* - the original given cqr (which's status might * - the original given cqr (which's status might
* be modified) * be modified)
*/ */
dasd_ccw_req_t * struct dasd_ccw_req *
dasd_3990_erp_action(dasd_ccw_req_t * cqr) dasd_3990_erp_action(struct dasd_ccw_req * cqr)
{ {
dasd_ccw_req_t *erp = NULL; struct dasd_ccw_req *erp = NULL;
dasd_device_t *device = cqr->device; struct dasd_device *device = cqr->device;
__u32 cpa = cqr->dstat->scsw.cpa; __u32 cpa = cqr->dstat->scsw.cpa;
#ifdef ERP_DEBUG #ifdef ERP_DEBUG
...@@ -2632,7 +2630,7 @@ dasd_3990_erp_action(dasd_ccw_req_t * cqr) ...@@ -2632,7 +2630,7 @@ dasd_3990_erp_action(dasd_ccw_req_t * cqr)
DEV_MESSAGE(KERN_DEBUG, device, "%s", DEV_MESSAGE(KERN_DEBUG, device, "%s",
"ERP chain at BEGINNING of ERP-ACTION"); "ERP chain at BEGINNING of ERP-ACTION");
{ {
dasd_ccw_req_t *temp_erp = NULL; struct dasd_ccw_req *temp_erp = NULL;
for (temp_erp = cqr; for (temp_erp = cqr;
temp_erp != NULL; temp_erp = temp_erp->refers) { temp_erp != NULL; temp_erp = temp_erp->refers) {
...@@ -2683,7 +2681,7 @@ dasd_3990_erp_action(dasd_ccw_req_t * cqr) ...@@ -2683,7 +2681,7 @@ dasd_3990_erp_action(dasd_ccw_req_t * cqr)
/* print current erp_chain */ /* print current erp_chain */
DEV_MESSAGE(KERN_DEBUG, device, "%s", "ERP chain at END of ERP-ACTION"); DEV_MESSAGE(KERN_DEBUG, device, "%s", "ERP chain at END of ERP-ACTION");
{ {
dasd_ccw_req_t *temp_erp = NULL; struct dasd_ccw_req *temp_erp = NULL;
for (temp_erp = erp; for (temp_erp = erp;
temp_erp != NULL; temp_erp = temp_erp->refers) { temp_erp != NULL; temp_erp = temp_erp->refers) {
......
...@@ -4,10 +4,7 @@ ...@@ -4,10 +4,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000
* *
* $Revision: 1.6 $ * $Revision: 1.8 $
*
* History of changes
*
*/ */
#define PRINTK_HEADER "dasd_erp(9336)" #define PRINTK_HEADER "dasd_erp(9336)"
...@@ -32,7 +29,7 @@ ...@@ -32,7 +29,7 @@
* dasd_era_recover for all others. * dasd_era_recover for all others.
*/ */
dasd_era_t dasd_era_t
dasd_9336_erp_examine(dasd_ccw_req_t * cqr, struct irb * irb) dasd_9336_erp_examine(struct dasd_ccw_req * cqr, struct irb * irb)
{ {
/* check for successful execution first */ /* check for successful execution first */
if (irb->scsw.cstat == 0x00 && if (irb->scsw.cstat == 0x00 &&
......
...@@ -4,10 +4,7 @@ ...@@ -4,10 +4,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000
* *
* $Revision: 1.11 $ * $Revision: 1.13 $
*
* History of changes
*
*/ */
#define PRINTK_HEADER "dasd_erp(9343)" #define PRINTK_HEADER "dasd_erp(9343)"
...@@ -15,7 +12,7 @@ ...@@ -15,7 +12,7 @@
#include "dasd_int.h" #include "dasd_int.h"
dasd_era_t dasd_era_t
dasd_9343_erp_examine(dasd_ccw_req_t * cqr, struct irb * irb) dasd_9343_erp_examine(struct dasd_ccw_req * cqr, struct irb * irb)
{ {
if (irb->scsw.cstat == 0x00 && if (irb->scsw.cstat == 0x00 &&
irb->scsw.dstat == (DEV_STAT_CHN_END | DEV_STAT_DEV_END)) irb->scsw.dstat == (DEV_STAT_CHN_END | DEV_STAT_DEV_END))
......
...@@ -11,14 +11,10 @@ ...@@ -11,14 +11,10 @@
* functions may not be called from interrupt context. In particular * functions may not be called from interrupt context. In particular
* dasd_get_device is a no-no from interrupt context. * dasd_get_device is a no-no from interrupt context.
* *
* $Revision: 1.12 $ * $Revision: 1.15 $
*
* History of changes
* 05/04/02 split from dasd.c, code restructuring.
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/version.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -40,14 +36,14 @@ ...@@ -40,14 +36,14 @@
* can be removed since the device number will then be identical * can be removed since the device number will then be identical
* to the device index. * to the device index.
*/ */
typedef struct { struct dasd_devmap {
struct list_head devindex_list; struct list_head devindex_list;
struct list_head devno_list; struct list_head devno_list;
unsigned int devindex; unsigned int devindex;
unsigned short devno; unsigned short devno;
unsigned short features; unsigned short features;
dasd_device_t *device; struct dasd_device *device;
} dasd_devmap_t; };
/* /*
* Parameter parsing functions for dasd= parameter. The syntax is: * Parameter parsing functions for dasd= parameter. The syntax is:
...@@ -264,13 +260,12 @@ dasd_add_range(int from, int to, int features) ...@@ -264,13 +260,12 @@ dasd_add_range(int from, int to, int features)
} }
spin_lock(&dasd_devmap_lock); spin_lock(&dasd_devmap_lock);
for (devno = from; devno <= to; devno++) { for (devno = from; devno <= to; devno++) {
dasd_devmap_t *devmap, *tmp; struct dasd_devmap *devmap, *tmp;
struct list_head *l;
devmap = NULL; devmap = NULL;
/* Find previous devmap for device number i */ /* Find previous devmap for device number i */
list_for_each(l, &dasd_devno_hashlists[devno & 255]) { list_for_each_entry(tmp, &dasd_devno_hashlists[devno & 255],
tmp = list_entry(l, dasd_devmap_t, devno_list); devno_list) {
if (tmp->devno == devno) { if (tmp->devno == devno) {
devmap = tmp; devmap = tmp;
break; break;
...@@ -278,8 +273,8 @@ dasd_add_range(int from, int to, int features) ...@@ -278,8 +273,8 @@ dasd_add_range(int from, int to, int features)
} }
if (devmap == NULL) { if (devmap == NULL) {
/* This devno is new. */ /* This devno is new. */
devmap = (dasd_devmap_t *) devmap = (struct dasd_devmap *)
kmalloc(sizeof(dasd_devmap_t), GFP_KERNEL); kmalloc(sizeof(struct dasd_devmap),GFP_KERNEL);
if (devmap == NULL) if (devmap == NULL)
return -ENOMEM; return -ENOMEM;
devindex = dasd_max_devindex++; devindex = dasd_max_devindex++;
...@@ -303,14 +298,15 @@ dasd_add_range(int from, int to, int features) ...@@ -303,14 +298,15 @@ dasd_add_range(int from, int to, int features)
int int
dasd_devno_in_range(int devno) dasd_devno_in_range(int devno)
{ {
struct list_head *l; struct dasd_devmap *devmap;
int ret; int ret;
ret = -ENOENT; ret = -ENOENT;
spin_lock(&dasd_devmap_lock); spin_lock(&dasd_devmap_lock);
/* Find devmap for device with device number devno */ /* Find devmap for device with device number devno */
list_for_each(l, &dasd_devno_hashlists[devno&255]) { list_for_each_entry(devmap, &dasd_devno_hashlists[devno&255],
if (list_entry(l, dasd_devmap_t, devno_list)->devno == devno) { devno_list) {
if (devmap->devno == devno) {
/* Found the device. */ /* Found the device. */
ret = 0; ret = 0;
break; break;
...@@ -332,9 +328,9 @@ dasd_forget_ranges(void) ...@@ -332,9 +328,9 @@ dasd_forget_ranges(void)
spin_lock(&dasd_devmap_lock); spin_lock(&dasd_devmap_lock);
for (i = 0; i < 256; i++) { for (i = 0; i < 256; i++) {
struct list_head *l, *next; struct list_head *l, *next;
dasd_devmap_t *devmap; struct dasd_devmap *devmap;
list_for_each_safe(l, next, &dasd_devno_hashlists[i]) { list_for_each_safe(l, next, &dasd_devno_hashlists[i]) {
devmap = list_entry(l, dasd_devmap_t, devno_list); devmap = list_entry(l, struct dasd_devmap, devno_list);
if (devmap->device != NULL) if (devmap->device != NULL)
BUG(); BUG();
list_del(&devmap->devindex_list); list_del(&devmap->devindex_list);
...@@ -349,17 +345,15 @@ dasd_forget_ranges(void) ...@@ -349,17 +345,15 @@ dasd_forget_ranges(void)
* Find the devmap structure from a devno. Can be removed as soon * Find the devmap structure from a devno. Can be removed as soon
* as big minors are available. * as big minors are available.
*/ */
static dasd_devmap_t * static struct dasd_devmap *
dasd_devmap_from_devno(int devno) dasd_devmap_from_devno(int devno)
{ {
struct list_head *l; struct dasd_devmap *devmap, *tmp;
dasd_devmap_t *devmap, *tmp;
devmap = NULL; devmap = NULL;
spin_lock(&dasd_devmap_lock); spin_lock(&dasd_devmap_lock);
/* Find devmap for device with device number devno */ /* Find devmap for device with device number devno */
list_for_each(l, &dasd_devno_hashlists[devno&255]) { list_for_each_entry(tmp, &dasd_devno_hashlists[devno&255], devno_list) {
tmp = list_entry(l, dasd_devmap_t, devno_list);
if (tmp->devno == devno) { if (tmp->devno == devno) {
/* Found the device, return devmap */ /* Found the device, return devmap */
devmap = tmp; devmap = tmp;
...@@ -374,17 +368,16 @@ dasd_devmap_from_devno(int devno) ...@@ -374,17 +368,16 @@ dasd_devmap_from_devno(int devno)
* Find the devmap for a device by its device index. Can be removed * Find the devmap for a device by its device index. Can be removed
* as soon as big minors are available. * as soon as big minors are available.
*/ */
static dasd_devmap_t * static struct dasd_devmap *
dasd_devmap_from_devindex(int devindex) dasd_devmap_from_devindex(int devindex)
{ {
struct list_head *l; struct dasd_devmap *devmap, *tmp;
dasd_devmap_t *devmap, *tmp;
devmap = NULL; devmap = NULL;
spin_lock(&dasd_devmap_lock); spin_lock(&dasd_devmap_lock);
/* Find devmap for device with device index devindex */ /* Find devmap for device with device index devindex */
list_for_each(l, &dasd_devindex_hashlists[devindex & 255]) { list_for_each_entry(tmp, &dasd_devindex_hashlists[devindex & 255],
tmp = list_entry(l, dasd_devmap_t, devindex_list); devindex_list) {
if (tmp->devindex == devindex) { if (tmp->devindex == devindex) {
/* Found the device, return devno */ /* Found the device, return devno */
devmap = tmp; devmap = tmp;
...@@ -395,11 +388,11 @@ dasd_devmap_from_devindex(int devindex) ...@@ -395,11 +388,11 @@ dasd_devmap_from_devindex(int devindex)
return devmap; return devmap;
} }
dasd_device_t * struct dasd_device *
dasd_device_from_devindex(int devindex) dasd_device_from_devindex(int devindex)
{ {
dasd_devmap_t *devmap; struct dasd_devmap *devmap;
dasd_device_t *device; struct dasd_device *device;
devmap = dasd_devmap_from_devindex(devindex); devmap = dasd_devmap_from_devindex(devindex);
spin_lock(&dasd_devmap_lock); spin_lock(&dasd_devmap_lock);
...@@ -416,9 +409,9 @@ dasd_device_from_devindex(int devindex) ...@@ -416,9 +409,9 @@ dasd_device_from_devindex(int devindex)
* Return kdev for a dasd device. * Return kdev for a dasd device.
*/ */
kdev_t kdev_t
dasd_get_kdev(dasd_device_t *device) dasd_get_kdev(struct dasd_device *device)
{ {
dasd_devmap_t *devmap; struct dasd_devmap *devmap;
int major, minor; int major, minor;
int devno; int devno;
...@@ -436,11 +429,11 @@ dasd_get_kdev(dasd_device_t *device) ...@@ -436,11 +429,11 @@ dasd_get_kdev(dasd_device_t *device)
/* /*
* Create a dasd device structure for cdev. * Create a dasd device structure for cdev.
*/ */
dasd_device_t * struct dasd_device *
dasd_create_device(struct ccw_device *cdev) dasd_create_device(struct ccw_device *cdev)
{ {
dasd_devmap_t *devmap; struct dasd_devmap *devmap;
dasd_device_t *device; struct dasd_device *device;
int devno; int devno;
int rc; int rc;
...@@ -491,10 +484,10 @@ static DECLARE_WAIT_QUEUE_HEAD(dasd_delete_wq); ...@@ -491,10 +484,10 @@ static DECLARE_WAIT_QUEUE_HEAD(dasd_delete_wq);
* Remove a dasd device structure. * Remove a dasd device structure.
*/ */
void void
dasd_delete_device(dasd_device_t *device) dasd_delete_device(struct dasd_device *device)
{ {
struct ccw_device *cdev; struct ccw_device *cdev;
dasd_devmap_t *devmap; struct dasd_devmap *devmap;
int devno; int devno;
/* First remove device pointer from devmap. */ /* First remove device pointer from devmap. */
...@@ -526,7 +519,7 @@ dasd_delete_device(dasd_device_t *device) ...@@ -526,7 +519,7 @@ dasd_delete_device(dasd_device_t *device)
* in dasd_delete_device. * in dasd_delete_device.
*/ */
void void
dasd_put_device_wake(dasd_device_t *device) dasd_put_device_wake(struct dasd_device *device)
{ {
wake_up(&dasd_delete_wq); wake_up(&dasd_delete_wq);
} }
......
...@@ -6,16 +6,7 @@ ...@@ -6,16 +6,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
* *
* $Revision: 1.28 $ * $Revision: 1.31 $
*
* History of changes
* 07/13/00 Added fixup sections for diagnoses ans saved some registers
* 07/14/00 fixed constraints in newly generated inline asm
* 10/05/00 adapted to 'new' DASD driver
* fixed return codes of dia250()
* fixed partition handling and HDIO_GETGEO
* 2002/01/04 Created 2.4-2.5 compatibility mode
* 05/04/02 code restructuring.
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -44,17 +35,17 @@ ...@@ -44,17 +35,17 @@
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
typedef struct dasd_diag_private_t { struct dasd_diag_private {
dasd_diag_characteristics_t rdc_data; struct dasd_diag_characteristics rdc_data;
diag_rw_io_t iob; struct dasd_diag_rw_io iob;
diag_init_io_t iib; struct dasd_diag_init_io iib;
unsigned int pt_block; unsigned int pt_block;
} dasd_diag_private_t; };
typedef struct dasd_diag_req_t { struct dasd_diag_req {
int block_count; int block_count;
diag_bio_t bio[0]; struct dasd_diag_bio bio[0];
} dasd_diag_req_t; };
static __inline__ int static __inline__ int
dia250(void *iob, int cmd) dia250(void *iob, int cmd)
...@@ -86,15 +77,15 @@ dia250(void *iob, int cmd) ...@@ -86,15 +77,15 @@ dia250(void *iob, int cmd)
} }
static __inline__ int static __inline__ int
mdsk_init_io(dasd_device_t * device, int blocksize, int offset, int size) mdsk_init_io(struct dasd_device * device, int blocksize, int offset, int size)
{ {
dasd_diag_private_t *private; struct dasd_diag_private *private;
diag_init_io_t *iib; struct dasd_diag_init_io *iib;
int rc; int rc;
private = (dasd_diag_private_t *) device->private; private = (struct dasd_diag_private *) device->private;
iib = &private->iib; iib = &private->iib;
memset(iib, 0, sizeof (diag_init_io_t)); memset(iib, 0, sizeof (struct dasd_diag_init_io));
iib->dev_nr = _ccw_device_get_device_number(device->cdev); iib->dev_nr = _ccw_device_get_device_number(device->cdev);
iib->block_size = blocksize; iib->block_size = blocksize;
...@@ -108,31 +99,31 @@ mdsk_init_io(dasd_device_t * device, int blocksize, int offset, int size) ...@@ -108,31 +99,31 @@ mdsk_init_io(dasd_device_t * device, int blocksize, int offset, int size)
} }
static __inline__ int static __inline__ int
mdsk_term_io(dasd_device_t * device) mdsk_term_io(struct dasd_device * device)
{ {
dasd_diag_private_t *private; struct dasd_diag_private *private;
diag_init_io_t *iib; struct dasd_diag_init_io *iib;
int rc; int rc;
private = (dasd_diag_private_t *) device->private; private = (struct dasd_diag_private *) device->private;
iib = &private->iib; iib = &private->iib;
memset(iib, 0, sizeof (diag_init_io_t)); memset(iib, 0, sizeof (struct dasd_diag_init_io));
iib->dev_nr = _ccw_device_get_device_number(device->cdev); iib->dev_nr = _ccw_device_get_device_number(device->cdev);
rc = dia250(iib, TERM_BIO); rc = dia250(iib, TERM_BIO);
return rc & 3; return rc & 3;
} }
static int static int
dasd_start_diag(dasd_ccw_req_t * cqr) dasd_start_diag(struct dasd_ccw_req * cqr)
{ {
dasd_device_t *device; struct dasd_device *device;
dasd_diag_private_t *private; struct dasd_diag_private *private;
dasd_diag_req_t *dreq; struct dasd_diag_req *dreq;
int rc; int rc;
device = cqr->device; device = cqr->device;
private = (dasd_diag_private_t *) device->private; private = (struct dasd_diag_private *) device->private;
dreq = (dasd_diag_req_t *) cqr->data; dreq = (struct dasd_diag_req *) cqr->data;
private->iob.dev_nr = _ccw_device_get_device_number(device->cdev); private->iob.dev_nr = _ccw_device_get_device_number(device->cdev);
private->iob.key = 0; private->iob.key = 0;
...@@ -160,8 +151,8 @@ dasd_start_diag(dasd_ccw_req_t * cqr) ...@@ -160,8 +151,8 @@ dasd_start_diag(dasd_ccw_req_t * cqr)
static void static void
dasd_ext_handler(struct pt_regs *regs, __u16 code) dasd_ext_handler(struct pt_regs *regs, __u16 code)
{ {
dasd_ccw_req_t *cqr, *next; struct dasd_ccw_req *cqr, *next;
dasd_device_t *device; struct dasd_device *device;
unsigned long long expires; unsigned long long expires;
unsigned long flags; unsigned long flags;
char status; char status;
...@@ -186,11 +177,11 @@ dasd_ext_handler(struct pt_regs *regs, __u16 code) ...@@ -186,11 +177,11 @@ dasd_ext_handler(struct pt_regs *regs, __u16 code)
irq_exit(); irq_exit();
return; return;
} }
cqr = (dasd_ccw_req_t *)(addr_t) ip; cqr = (struct dasd_ccw_req *)(addr_t) ip;
device = (dasd_device_t *) cqr->device; device = (struct dasd_device *) cqr->device;
if (strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) { if (strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) {
DEV_MESSAGE(KERN_WARNING, device, DEV_MESSAGE(KERN_WARNING, device,
" magic number of dasd_ccw_req_t 0x%08X doesn't" " magic number of dasd_ccw_req 0x%08X doesn't"
" match discipline 0x%08X", " match discipline 0x%08X",
cqr->magic, *(int *) (&device->discipline->name)); cqr->magic, *(int *) (&device->discipline->name));
irq_exit(); irq_exit();
...@@ -208,7 +199,7 @@ dasd_ext_handler(struct pt_regs *regs, __u16 code) ...@@ -208,7 +199,7 @@ dasd_ext_handler(struct pt_regs *regs, __u16 code)
/* Start first request on queue if possible -> fast_io. */ /* Start first request on queue if possible -> fast_io. */
if (!list_empty(&device->ccw_queue)) { if (!list_empty(&device->ccw_queue)) {
next = list_entry(device->ccw_queue.next, next = list_entry(device->ccw_queue.next,
dasd_ccw_req_t, list); struct dasd_ccw_req, list);
if (next->status == DASD_CQR_QUEUED) { if (next->status == DASD_CQR_QUEUED) {
if (dasd_start_diag(next) == 0) if (dasd_start_diag(next) == 0)
expires = next->expires; expires = next->expires;
...@@ -231,18 +222,18 @@ dasd_ext_handler(struct pt_regs *regs, __u16 code) ...@@ -231,18 +222,18 @@ dasd_ext_handler(struct pt_regs *regs, __u16 code)
} }
static int static int
dasd_diag_check_device(dasd_device_t *device) dasd_diag_check_device(struct dasd_device *device)
{ {
dasd_diag_private_t *private; struct dasd_diag_private *private;
dasd_diag_characteristics_t *rdc_data; struct dasd_diag_characteristics *rdc_data;
diag_bio_t bio; struct dasd_diag_bio bio;
long *label; long *label;
int sb, bsize; int sb, bsize;
int rc; int rc;
private = (dasd_diag_private_t *) device->private; private = (struct dasd_diag_private *) device->private;
if (private == NULL) { if (private == NULL) {
private = kmalloc(sizeof(dasd_diag_private_t), GFP_KERNEL); private = kmalloc(sizeof(struct dasd_diag_private),GFP_KERNEL);
if (private == NULL) { if (private == NULL) {
MESSAGE(KERN_WARNING, "%s", MESSAGE(KERN_WARNING, "%s",
"memory allocation failed for private data"); "memory allocation failed for private data");
...@@ -253,7 +244,7 @@ dasd_diag_check_device(dasd_device_t *device) ...@@ -253,7 +244,7 @@ dasd_diag_check_device(dasd_device_t *device)
/* Read Device Characteristics */ /* Read Device Characteristics */
rdc_data = (void *) &(private->rdc_data); rdc_data = (void *) &(private->rdc_data);
rdc_data->dev_nr = _ccw_device_get_device_number(device->cdev); rdc_data->dev_nr = _ccw_device_get_device_number(device->cdev);
rdc_data->rdc_len = sizeof (dasd_diag_characteristics_t); rdc_data->rdc_len = sizeof (struct dasd_diag_characteristics);
rc = diag210((struct diag210 *) rdc_data); rc = diag210((struct diag210 *) rdc_data);
if (rc) if (rc)
...@@ -289,11 +280,11 @@ dasd_diag_check_device(dasd_device_t *device) ...@@ -289,11 +280,11 @@ dasd_diag_check_device(dasd_device_t *device)
} }
for (bsize = 512; bsize <= PAGE_SIZE; bsize <<= 1) { for (bsize = 512; bsize <= PAGE_SIZE; bsize <<= 1) {
mdsk_init_io(device, bsize, 0, 64); mdsk_init_io(device, bsize, 0, 64);
memset(&bio, 0, sizeof (diag_bio_t)); memset(&bio, 0, sizeof (struct dasd_diag_bio));
bio.type = MDSK_READ_REQ; bio.type = MDSK_READ_REQ;
bio.block_number = private->pt_block + 1; bio.block_number = private->pt_block + 1;
bio.buffer = __pa(label); bio.buffer = __pa(label);
memset(&private->iob, 0, sizeof (diag_rw_io_t)); memset(&private->iob, 0, sizeof (struct dasd_diag_rw_io));
private->iob.dev_nr = rdc_data->dev_nr; private->iob.dev_nr = rdc_data->dev_nr;
private->iob.key = 0; private->iob.key = 0;
private->iob.flags = 0; /* do synchronous io */ private->iob.flags = 0; /* do synchronous io */
...@@ -324,7 +315,7 @@ dasd_diag_check_device(dasd_device_t *device) ...@@ -324,7 +315,7 @@ dasd_diag_check_device(dasd_device_t *device)
} }
static int static int
dasd_diag_fill_geometry(dasd_device_t *device, struct hd_geometry *geo) dasd_diag_fill_geometry(struct dasd_device *device, struct hd_geometry *geo)
{ {
if (dasd_check_blocksize(device->bp_block) != 0) if (dasd_check_blocksize(device->bp_block) != 0)
return -EINVAL; return -EINVAL;
...@@ -335,29 +326,29 @@ dasd_diag_fill_geometry(dasd_device_t *device, struct hd_geometry *geo) ...@@ -335,29 +326,29 @@ dasd_diag_fill_geometry(dasd_device_t *device, struct hd_geometry *geo)
} }
static dasd_era_t static dasd_era_t
dasd_diag_examine_error(dasd_ccw_req_t * cqr, struct irb * stat) dasd_diag_examine_error(struct dasd_ccw_req * cqr, struct irb * stat)
{ {
return dasd_era_fatal; return dasd_era_fatal;
} }
static dasd_erp_fn_t static dasd_erp_fn_t
dasd_diag_erp_action(dasd_ccw_req_t * cqr) dasd_diag_erp_action(struct dasd_ccw_req * cqr)
{ {
return dasd_default_erp_action; return dasd_default_erp_action;
} }
static dasd_erp_fn_t static dasd_erp_fn_t
dasd_diag_erp_postaction(dasd_ccw_req_t * cqr) dasd_diag_erp_postaction(struct dasd_ccw_req * cqr)
{ {
return dasd_default_erp_postaction; return dasd_default_erp_postaction;
} }
static dasd_ccw_req_t * static struct dasd_ccw_req *
dasd_diag_build_cp(dasd_device_t * device, struct request *req) dasd_diag_build_cp(struct dasd_device * device, struct request *req)
{ {
dasd_ccw_req_t *cqr; struct dasd_ccw_req *cqr;
dasd_diag_req_t *dreq; struct dasd_diag_req *dreq;
diag_bio_t *dbio; struct dasd_diag_bio *dbio;
struct bio *bio; struct bio *bio;
struct bio_vec *bv; struct bio_vec *bv;
char *dst; char *dst;
...@@ -391,13 +382,14 @@ dasd_diag_build_cp(dasd_device_t * device, struct request *req) ...@@ -391,13 +382,14 @@ dasd_diag_build_cp(dasd_device_t * device, struct request *req)
if (count != last_rec - first_rec + 1) if (count != last_rec - first_rec + 1)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
/* Build the request */ /* Build the request */
datasize = sizeof(dasd_diag_req_t) + count*sizeof(diag_bio_t); datasize = sizeof(struct dasd_diag_req) +
count*sizeof(struct dasd_diag_bio);
cqr = dasd_smalloc_request(dasd_diag_discipline.name, 0, cqr = dasd_smalloc_request(dasd_diag_discipline.name, 0,
datasize, device); datasize, device);
if (IS_ERR(cqr)) if (IS_ERR(cqr))
return cqr; return cqr;
dreq = (dasd_diag_req_t *) cqr->data; dreq = (struct dasd_diag_req *) cqr->data;
dreq->block_count = count; dreq->block_count = count;
dbio = dreq->bio; dbio = dreq->bio;
recid = first_rec; recid = first_rec;
...@@ -405,7 +397,7 @@ dasd_diag_build_cp(dasd_device_t * device, struct request *req) ...@@ -405,7 +397,7 @@ dasd_diag_build_cp(dasd_device_t * device, struct request *req)
bio_for_each_segment(bv, bio, i) { bio_for_each_segment(bv, bio, i) {
dst = kmap(bv->bv_page) + bv->bv_offset; dst = kmap(bv->bv_page) + bv->bv_offset;
for (off = 0; off < bv->bv_len; off += blksize) { for (off = 0; off < bv->bv_len; off += blksize) {
memset(dbio, 0, sizeof (diag_bio_t)); memset(dbio, 0, sizeof (struct dasd_diag_bio));
dbio->type = rw_cmd; dbio->type = rw_cmd;
dbio->block_number = recid + 1; dbio->block_number = recid + 1;
dbio->buffer = __pa(dst); dbio->buffer = __pa(dst);
...@@ -423,24 +415,25 @@ dasd_diag_build_cp(dasd_device_t * device, struct request *req) ...@@ -423,24 +415,25 @@ dasd_diag_build_cp(dasd_device_t * device, struct request *req)
} }
static int static int
dasd_diag_fill_info(dasd_device_t * device, dasd_information2_t * info) dasd_diag_fill_info(struct dasd_device * device,
struct dasd_information2_t * info)
{ {
dasd_diag_private_t *private; struct dasd_diag_private *private;
private = (dasd_diag_private_t *) device->private; private = (struct dasd_diag_private *) device->private;
info->label_block = private->pt_block; info->label_block = private->pt_block;
info->FBA_layout = 1; info->FBA_layout = 1;
info->format = DASD_FORMAT_LDL; info->format = DASD_FORMAT_LDL;
info->characteristics_size = sizeof (dasd_diag_characteristics_t); info->characteristics_size = sizeof (struct dasd_diag_characteristics);
memcpy(info->characteristics, memcpy(info->characteristics,
&((dasd_diag_private_t *) device->private)->rdc_data, &((struct dasd_diag_private *) device->private)->rdc_data,
sizeof (dasd_diag_characteristics_t)); sizeof (struct dasd_diag_characteristics));
info->confdata_size = 0; info->confdata_size = 0;
return 0; return 0;
} }
static void static void
dasd_diag_dump_sense(dasd_device_t *device, dasd_ccw_req_t * req, dasd_diag_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
struct irb *stat) struct irb *stat)
{ {
char *page; char *page;
...@@ -463,15 +456,15 @@ dasd_diag_dump_sense(dasd_device_t *device, dasd_ccw_req_t * req, ...@@ -463,15 +456,15 @@ dasd_diag_dump_sense(dasd_device_t *device, dasd_ccw_req_t * req,
* max_blocks is dependent on the amount of storage that is available * max_blocks is dependent on the amount of storage that is available
* in the static io buffer for each device. Currently each device has * in the static io buffer for each device. Currently each device has
* 8192 bytes (=2 pages). dasd diag is only relevant for 31 bit. * 8192 bytes (=2 pages). dasd diag is only relevant for 31 bit.
* The dasd_ccw_req_t has 96 bytes, the dasd_diag_req_t has 8 bytes and * The struct dasd_ccw_req has 96 bytes, the struct dasd_diag_req has
* the diag_bio_t for each block has 16 bytes. * 8 bytes and the struct dasd_diag_bio for each block has 16 bytes.
* That makes: * That makes:
* (8192 - 96 - 8) / 16 = 505.5 blocks at maximum. * (8192 - 96 - 8) / 16 = 505.5 blocks at maximum.
* We want to fit two into the available memory so that we can immediately * We want to fit two into the available memory so that we can immediately
* start the next request if one finishes off. That makes 252.75 blocks * start the next request if one finishes off. That makes 252.75 blocks
* for one request. Give a little safety and the result is 240. * for one request. Give a little safety and the result is 240.
*/ */
dasd_discipline_t dasd_diag_discipline = { struct dasd_discipline dasd_diag_discipline = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "DIAG", .name = "DIAG",
.ebcname = "DIAG", .ebcname = "DIAG",
......
...@@ -6,10 +6,7 @@ ...@@ -6,10 +6,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
* *
* $Revision: 1.4 $ * $Revision: 1.6 $
*
* History of changes
*
*/ */
#define MDSK_WRITE_REQ 0x01 #define MDSK_WRITE_REQ 0x01
...@@ -22,7 +19,7 @@ ...@@ -22,7 +19,7 @@
#define DEV_CLASS_FBA 0x01 #define DEV_CLASS_FBA 0x01
#define DEV_CLASS_ECKD 0x04 #define DEV_CLASS_ECKD 0x04
typedef struct dasd_diag_characteristics_t { struct dasd_diag_characteristics {
u16 dev_nr; u16 dev_nr;
u16 rdc_len; u16 rdc_len;
u8 vdev_class; u8 vdev_class;
...@@ -33,22 +30,18 @@ typedef struct dasd_diag_characteristics_t { ...@@ -33,22 +30,18 @@ typedef struct dasd_diag_characteristics_t {
u8 rdev_type; u8 rdev_type;
u8 rdev_model; u8 rdev_model;
u8 rdev_features; u8 rdev_features;
} __attribute__ ((packed, aligned(4))) } __attribute__ ((packed, aligned(4)));
dasd_diag_characteristics_t;
typedef struct diag_bio_t { struct dasd_diag_bio {
u8 type; u8 type;
u8 status; u8 status;
u16 spare1; u16 spare1;
u32 block_number; u32 block_number;
u32 alet; u32 alet;
u32 buffer; u32 buffer;
} __attribute__ ((packed, aligned(8))) } __attribute__ ((packed, aligned(8)));
diag_bio_t; struct dasd_diag_init_io {
typedef struct diag_init_io_t {
u16 dev_nr; u16 dev_nr;
u16 spare1[11]; u16 spare1[11];
u32 block_size; u32 block_size;
...@@ -56,11 +49,9 @@ typedef struct diag_init_io_t { ...@@ -56,11 +49,9 @@ typedef struct diag_init_io_t {
u32 start_block; u32 start_block;
u32 end_block; u32 end_block;
u32 spare2[6]; u32 spare2[6];
} __attribute__ ((packed, aligned(8))) } __attribute__ ((packed, aligned(8)));
diag_init_io_t;
typedef struct diag_rw_io_t { struct dasd_diag_rw_io {
u16 dev_nr; u16 dev_nr;
u16 spare1[11]; u16 spare1[11];
u8 key; u8 key;
...@@ -71,7 +62,5 @@ typedef struct diag_rw_io_t { ...@@ -71,7 +62,5 @@ typedef struct diag_rw_io_t {
u32 bio_list; u32 bio_list;
u32 interrupt_params; u32 interrupt_params;
u32 spare3[5]; u32 spare3[5];
} __attribute__ ((packed, aligned(8))) } __attribute__ ((packed, aligned(8)));
diag_rw_io_t;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment