diff options
Diffstat (limited to 'drivers/s390')
42 files changed, 968 insertions, 413 deletions
diff --git a/drivers/s390/Kconfig b/drivers/s390/Kconfig index 96413c2cd1a..a86a650f3d6 100644 --- a/drivers/s390/Kconfig +++ b/drivers/s390/Kconfig @@ -187,6 +187,13 @@ config VMLOGRDR *SYMPTOM. This driver depends on the IUCV support driver. +config VMCP + tristate "Support for the z/VM CP interface (VM only)" + help + Select this option if you want to be able to interact with the control + program on z/VM + + config MONREADER tristate "API for reading z/VM monitor service records" depends on IUCV diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index ceeb3cf64a1..6527ff6f470 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -176,7 +176,7 @@ dasd_state_known_to_basic(struct dasd_device * device) return rc; /* register 'device' debug area, used for all DBF_DEV_XXX calls */ - device->debug_area = debug_register(device->cdev->dev.bus_id, 0, 2, + device->debug_area = debug_register(device->cdev->dev.bus_id, 1, 2, 8 * sizeof (long)); debug_register_view(device->debug_area, &debug_sprintf_view); debug_set_level(device->debug_area, DBF_EMERG); @@ -1952,26 +1952,24 @@ dasd_generic_notify(struct ccw_device *cdev, int event) * Automatically online either all dasd devices (dasd_autodetect) or * all devices specified with dasd= parameters. */ +static int +__dasd_auto_online(struct device *dev, void *data) +{ + struct ccw_device *cdev; + + cdev = to_ccwdev(dev); + if (dasd_autodetect || dasd_busid_known(cdev->dev.bus_id) == 0) + ccw_device_set_online(cdev); + return 0; +} + void dasd_generic_auto_online (struct ccw_driver *dasd_discipline_driver) { struct device_driver *drv; - struct device *d, *dev; - struct ccw_device *cdev; drv = get_driver(&dasd_discipline_driver->driver); - down_read(&drv->bus->subsys.rwsem); - dev = NULL; - list_for_each_entry(d, &drv->devices, driver_list) { - dev = get_device(d); - if (!dev) - continue; - cdev = to_ccwdev(dev); - if (dasd_autodetect || dasd_busid_known(cdev->dev.bus_id) == 0) - ccw_device_set_online(cdev); - put_device(dev); - } - up_read(&drv->bus->subsys.rwsem); + driver_for_each_device(drv, NULL, NULL, __dasd_auto_online); put_driver(drv); } @@ -1983,7 +1981,7 @@ dasd_init(void) init_waitqueue_head(&dasd_init_waitq); /* register 'common' DASD debug area, used for all DBF_XXX calls */ - dasd_debug_area = debug_register("dasd", 0, 2, 8 * sizeof (long)); + dasd_debug_area = debug_register("dasd", 1, 2, 8 * sizeof (long)); if (dasd_debug_area == NULL) { rc = -ENOMEM; goto failed; diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c index 1aedc48e5f8..d948566bb24 100644 --- a/drivers/s390/block/dasd_devmap.c +++ b/drivers/s390/block/dasd_devmap.c @@ -615,7 +615,7 @@ dasd_device_from_cdev(struct ccw_device *cdev) * readonly controls the readonly status of a dasd */ static ssize_t -dasd_ro_show(struct device *dev, char *buf) +dasd_ro_show(struct device *dev, struct device_attribute *attr, char *buf) { struct dasd_devmap *devmap; int ro_flag; @@ -629,7 +629,7 @@ dasd_ro_show(struct device *dev, char *buf) } static ssize_t -dasd_ro_store(struct device *dev, const char *buf, size_t count) +dasd_ro_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct dasd_devmap *devmap; int ro_flag; @@ -656,7 +656,7 @@ static DEVICE_ATTR(readonly, 0644, dasd_ro_show, dasd_ro_store); * to talk to the device */ static ssize_t -dasd_use_diag_show(struct device *dev, char *buf) +dasd_use_diag_show(struct device *dev, struct device_attribute *attr, char *buf) { struct dasd_devmap *devmap; int use_diag; @@ -670,7 +670,7 @@ dasd_use_diag_show(struct device *dev, char *buf) } static ssize_t -dasd_use_diag_store(struct device *dev, const char *buf, size_t count) +dasd_use_diag_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct dasd_devmap *devmap; ssize_t rc; @@ -698,7 +698,7 @@ static DEVICE_ATTR(use_diag, 0644, dasd_use_diag_show, dasd_use_diag_store); static ssize_t -dasd_discipline_show(struct device *dev, char *buf) +dasd_discipline_show(struct device *dev, struct device_attribute *attr, char *buf) { struct dasd_devmap *devmap; char *dname; diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c index d7f19745911..43c34f8c5e6 100644 --- a/drivers/s390/block/dasd_proc.c +++ b/drivers/s390/block/dasd_proc.c @@ -9,13 +9,14 @@ * * /proc interface for the dasd driver. * - * $Revision: 1.31 $ + * $Revision: 1.32 $ */ #include <linux/config.h> #include <linux/ctype.h> #include <linux/seq_file.h> #include <linux/vmalloc.h> +#include <linux/proc_fs.h> #include <asm/debug.h> #include <asm/uaccess.h> diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index a66b17b6529..4fde4118899 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c @@ -35,26 +35,29 @@ static int dcssblk_open(struct inode *inode, struct file *filp); static int dcssblk_release(struct inode *inode, struct file *filp); static int dcssblk_make_request(struct request_queue *q, struct bio *bio); +static int dcssblk_direct_access(struct block_device *bdev, sector_t secnum, + unsigned long *data); static char dcssblk_segments[DCSSBLK_PARM_LEN] = "\0"; static int dcssblk_major; static struct block_device_operations dcssblk_devops = { - .owner = THIS_MODULE, - .open = dcssblk_open, - .release = dcssblk_release, + .owner = THIS_MODULE, + .open = dcssblk_open, + .release = dcssblk_release, + .direct_access = dcssblk_direct_access, }; -static ssize_t dcssblk_add_store(struct device * dev, const char * buf, +static ssize_t dcssblk_add_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t count); -static ssize_t dcssblk_remove_store(struct device * dev, const char * buf, +static ssize_t dcssblk_remove_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t count); -static ssize_t dcssblk_save_store(struct device * dev, const char * buf, +static ssize_t dcssblk_save_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t count); -static ssize_t dcssblk_save_show(struct device *dev, char *buf); -static ssize_t dcssblk_shared_store(struct device * dev, const char * buf, +static ssize_t dcssblk_save_show(struct device *dev, struct device_attribute *attr, char *buf); +static ssize_t dcssblk_shared_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t count); -static ssize_t dcssblk_shared_show(struct device *dev, char *buf); +static ssize_t dcssblk_shared_show(struct device *dev, struct device_attribute *attr, char *buf); static DEVICE_ATTR(add, S_IWUSR, NULL, dcssblk_add_store); static DEVICE_ATTR(remove, S_IWUSR, NULL, dcssblk_remove_store); @@ -195,7 +198,7 @@ dcssblk_segment_warn(int rc, char* seg_name) * operation (show + store) */ static ssize_t -dcssblk_shared_show(struct device *dev, char *buf) +dcssblk_shared_show(struct device *dev, struct device_attribute *attr, char *buf) { struct dcssblk_dev_info *dev_info; @@ -204,7 +207,7 @@ dcssblk_shared_show(struct device *dev, char *buf) } static ssize_t -dcssblk_shared_store(struct device *dev, const char *inbuf, size_t count) +dcssblk_shared_store(struct device *dev, struct device_attribute *attr, const char *inbuf, size_t count) { struct dcssblk_dev_info *dev_info; int rc; @@ -288,7 +291,7 @@ out: * (show + store) */ static ssize_t -dcssblk_save_show(struct device *dev, char *buf) +dcssblk_save_show(struct device *dev, struct device_attribute *attr, char *buf) { struct dcssblk_dev_info *dev_info; @@ -297,7 +300,7 @@ dcssblk_save_show(struct device *dev, char *buf) } static ssize_t -dcssblk_save_store(struct device *dev, const char *inbuf, size_t count) +dcssblk_save_store(struct device *dev, struct device_attribute *attr, const char *inbuf, size_t count) { struct dcssblk_dev_info *dev_info; @@ -343,7 +346,7 @@ dcssblk_save_store(struct device *dev, const char *inbuf, size_t count) * device attribute for adding devices */ static ssize_t -dcssblk_add_store(struct device *dev, const char *buf, size_t count) +dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { int rc, i; struct dcssblk_dev_info *dev_info; @@ -517,7 +520,7 @@ out_nobuf: * device attribute for removing devices */ static ssize_t -dcssblk_remove_store(struct device *dev, const char *buf, size_t count) +dcssblk_remove_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct dcssblk_dev_info *dev_info; int rc, i; @@ -641,6 +644,20 @@ dcssblk_make_request(request_queue_t *q, struct bio *bio) /* Request beyond end of DCSS segment. */ goto fail; } + /* verify data transfer direction */ + if (dev_info->is_shared) { + switch (dev_info->segment_type) { + case SEG_TYPE_SR: + case SEG_TYPE_ER: + case SEG_TYPE_SC: + /* cannot write to these segments */ + if (bio_data_dir(bio) == WRITE) { + PRINT_WARN("rejecting write to ro segment %s\n", dev_info->dev.bus_id); + goto fail; + } + } + } + index = (bio->bi_sector >> 3); bio_for_each_segment(bvec, bio, i) { page_addr = (unsigned long) @@ -661,7 +678,26 @@ dcssblk_make_request(request_queue_t *q, struct bio *bio) bio_endio(bio, bytes_done, 0); return 0; fail: - bio_io_error(bio, bytes_done); + bio_io_error(bio, bio->bi_size); + return 0; +} + +static int +dcssblk_direct_access (struct block_device *bdev, sector_t secnum, + unsigned long *data) +{ + struct dcssblk_dev_info *dev_info; + unsigned long pgoff; + + dev_info = bdev->bd_disk->private_data; + if (!dev_info) + return -ENODEV; + if (secnum % (PAGE_SIZE/512)) + return -EINVAL; + pgoff = secnum / (PAGE_SIZE / 512); + if ((pgoff+1)*PAGE_SIZE-1 > dev_info->end - dev_info->start) + return -ERANGE; + *data = (unsigned long) (dev_info->start+pgoff*PAGE_SIZE); return 0; } @@ -682,7 +718,7 @@ dcssblk_check_params(void) buf[j-i] = dcssblk_segments[j]; } buf[j-i] = '\0'; - rc = dcssblk_add_store(dcssblk_root_dev, buf, j-i); + rc = dcssblk_add_store(dcssblk_root_dev, NULL, buf, j-i); if ((rc >= 0) && (dcssblk_segments[j] == '(')) { for (k = 0; buf[k] != '\0'; k++) buf[k] = toupper(buf[k]); @@ -692,7 +728,7 @@ dcssblk_check_params(void) up_read(&dcssblk_devices_sem); if (dev_info) dcssblk_shared_store(&dev_info->dev, - "0\n", 2); + NULL, "0\n", 2); } } while ((dcssblk_segments[j] != ',') && diff --git a/drivers/s390/char/Makefile b/drivers/s390/char/Makefile index 14e8cce9f86..6377a96735d 100644 --- a/drivers/s390/char/Makefile +++ b/drivers/s390/char/Makefile @@ -19,6 +19,7 @@ obj-$(CONFIG_SCLP_CPI) += sclp_cpi.o obj-$(CONFIG_ZVM_WATCHDOG) += vmwatchdog.o obj-$(CONFIG_VMLOGRDR) += vmlogrdr.o +obj-$(CONFIG_VMCP) += vmcp.o tape-$(CONFIG_S390_TAPE_BLOCK) += tape_block.o tape-$(CONFIG_PROC_FS) += tape_proc.o diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 022f17bff73..f11a67fda40 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c @@ -860,8 +860,8 @@ con3215_init(void) /* Set the console mode for VM */ if (MACHINE_IS_VM) { - cpcmd("TERM CONMODE 3215", NULL, 0); - cpcmd("TERM AUTOCR OFF", NULL, 0); + cpcmd("TERM CONMODE 3215", NULL, 0, NULL); + cpcmd("TERM AUTOCR OFF", NULL, 0, NULL); } /* allocate 3215 request structures */ diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c index d52fb57a6b1..fc7a213e591 100644 --- a/drivers/s390/char/con3270.c +++ b/drivers/s390/char/con3270.c @@ -591,8 +591,8 @@ con3270_init(void) /* Set the console mode for VM */ if (MACHINE_IS_VM) { - cpcmd("TERM CONMODE 3270", 0, 0); - cpcmd("TERM AUTOCR OFF", 0, 0); + cpcmd("TERM CONMODE 3270", NULL, 0, NULL); + cpcmd("TERM AUTOCR OFF", NULL, 0, NULL); } cdev = ccw_device_probe_console(); diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c index 8e16a971668..d5eefeaba50 100644 --- a/drivers/s390/char/raw3270.c +++ b/drivers/s390/char/raw3270.c @@ -1084,7 +1084,7 @@ raw3270_probe (struct ccw_device *cdev) * Additional attributes for a 3270 device */ static ssize_t -raw3270_model_show(struct device *dev, char *buf) +raw3270_model_show(struct device *dev, struct device_attribute *attr, char *buf) { return snprintf(buf, PAGE_SIZE, "%i\n", ((struct raw3270 *) dev->driver_data)->model); @@ -1092,7 +1092,7 @@ raw3270_model_show(struct device *dev, char *buf) static DEVICE_ATTR(model, 0444, raw3270_model_show, 0); static ssize_t -raw3270_rows_show(struct device *dev, char *buf) +raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf) { return snprintf(buf, PAGE_SIZE, "%i\n", ((struct raw3270 *) dev->driver_data)->rows); @@ -1100,7 +1100,7 @@ raw3270_rows_show(struct device *dev, char *buf) static DEVICE_ATTR(rows, 0444, raw3270_rows_show, 0); static ssize_t -raw3270_columns_show(struct device *dev, char *buf) +raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *buf) { return snprintf(buf, PAGE_SIZE, "%i\n", ((struct raw3270 *) dev->driver_data)->cols); diff --git a/drivers/s390/char/tape_34xx.c b/drivers/s390/char/tape_34xx.c index 480ec87976f..20be88e91fa 100644 --- a/drivers/s390/char/tape_34xx.c +++ b/drivers/s390/char/tape_34xx.c @@ -1351,13 +1351,13 @@ tape_34xx_init (void) { int rc; - TAPE_DBF_AREA = debug_register ( "tape_34xx", 1, 2, 4*sizeof(long)); + TAPE_DBF_AREA = debug_register ( "tape_34xx", 2, 2, 4*sizeof(long)); debug_register_view(TAPE_DBF_AREA, &debug_sprintf_view); #ifdef DBF_LIKE_HELL debug_set_level(TAPE_DBF_AREA, 6); #endif - DBF_EVENT(3, "34xx init: $Revision: 1.21 $\n"); + DBF_EVENT(3, "34xx init: $Revision: 1.23 $\n"); /* Register driver for 3480/3490 tapes. */ rc = ccw_driver_register(&tape_34xx_driver); if (rc) @@ -1378,7 +1378,7 @@ tape_34xx_exit(void) MODULE_DEVICE_TABLE(ccw, tape_34xx_ids); MODULE_AUTHOR("(C) 2001-2002 IBM Deutschland Entwicklung GmbH"); MODULE_DESCRIPTION("Linux on zSeries channel attached 3480 tape " - "device driver ($Revision: 1.21 $)"); + "device driver ($Revision: 1.23 $)"); MODULE_LICENSE("GPL"); module_init(tape_34xx_init); diff --git a/drivers/s390/char/tape_class.c b/drivers/s390/char/tape_class.c index 0f8ffd4167c..ed0cb1f15b4 100644 --- a/drivers/s390/char/tape_class.c +++ b/drivers/s390/char/tape_class.c @@ -16,7 +16,7 @@ MODULE_DESCRIPTION( ); MODULE_LICENSE("GPL"); -struct class_simple *tape_class; +static struct class *tape_class; /* * Register a tape device and return a pointer to the cdev structure. @@ -70,7 +70,7 @@ struct tape_class_device *register_tape_dev( if (rc) goto fail_with_cdev; - tcd->class_device = class_simple_device_add( + tcd->class_device = class_device_create( tape_class, tcd->char_device->dev, device, @@ -101,7 +101,7 @@ void unregister_tape_dev(struct tape_class_device *tcd) &tcd->class_device->dev->kobj, tcd->mode_name ); - class_simple_device_remove(tcd->char_device->dev); + class_device_destroy(tape_class, tcd->char_device->dev); cdev_del(tcd->char_device); kfree(tcd); } @@ -111,14 +111,14 @@ EXPORT_SYMBOL(unregister_tape_dev); static int __init tape_init(void) { - tape_class = class_simple_create(THIS_MODULE, "tape390"); + tape_class = class_create(THIS_MODULE, "tape390"); return 0; } static void __exit tape_exit(void) { - class_simple_destroy(tape_class); + class_destroy(tape_class); tape_class = NULL; } diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c index e51046ab8ad..0597aa0e27e 100644 --- a/drivers/s390/char/tape_core.c +++ b/drivers/s390/char/tape_core.c @@ -107,7 +107,7 @@ busid_to_int(char *bus_id) * replaced by a link to the cdev tree. */ static ssize_t -tape_medium_state_show(struct device *dev, char *buf) +tape_medium_state_show(struct device *dev, struct device_attribute *attr, char *buf) { struct tape_device *tdev; @@ -119,7 +119,7 @@ static DEVICE_ATTR(medium_state, 0444, tape_medium_state_show, NULL); static ssize_t -tape_first_minor_show(struct device *dev, char *buf) +tape_first_minor_show(struct device *dev, struct device_attribute *attr, char *buf) { struct tape_device *tdev; @@ -131,7 +131,7 @@ static DEVICE_ATTR(first_minor, 0444, tape_first_minor_show, NULL); static ssize_t -tape_state_show(struct device *dev, char *buf) +tape_state_show(struct device *dev, struct device_attribute *attr, char *buf) { struct tape_device *tdev; @@ -144,7 +144,7 @@ static DEVICE_ATTR(state, 0444, tape_state_show, NULL); static ssize_t -tape_operation_show(struct device *dev, char *buf) +tape_operation_show(struct device *dev, struct device_attribute *attr, char *buf) { struct tape_device *tdev; ssize_t rc; @@ -171,7 +171,7 @@ static DEVICE_ATTR(operation, 0444, tape_operation_show, NULL); static ssize_t -tape_blocksize_show(struct device *dev, char *buf) +tape_blocksize_show(struct device *dev, struct device_attribute *attr, char *buf) { struct tape_device *tdev; @@ -1186,7 +1186,7 @@ tape_mtop(struct tape_device *device, int mt_op, int mt_count) static int tape_init (void) { - TAPE_DBF_AREA = debug_register ( "tape", 1, 2, 4*sizeof(long)); + TAPE_DBF_AREA = debug_register ( "tape", 2, 2, 4*sizeof(long)); debug_register_view(TAPE_DBF_AREA, &debug_sprintf_view); #ifdef DBF_LIKE_HELL debug_set_level(TAPE_DBF_AREA, 6); diff --git a/drivers/s390/char/tape_proc.c b/drivers/s390/char/tape_proc.c index 801d17cca34..5fec0a10cc3 100644 --- a/drivers/s390/char/tape_proc.c +++ b/drivers/s390/char/tape_proc.c @@ -15,6 +15,7 @@ #include <linux/module.h> #include <linux/vmalloc.h> #include <linux/seq_file.h> +#include <linux/proc_fs.h> #define TAPE_DBF_AREA tape_core_dbf diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c new file mode 100644 index 00000000000..7f11a608a63 --- /dev/null +++ b/drivers/s390/char/vmcp.c @@ -0,0 +1,219 @@ +/* + * Copyright (C) 2004,2005 IBM Corporation + * Interface implementation for communication with the v/VM control program + * Author(s): Christian Borntraeger <cborntra@de.ibm.com> + * + * + * z/VMs CP offers the possibility to issue commands via the diagnose code 8 + * this driver implements a character device that issues these commands and + * returns the answer of CP. + + * The idea of this driver is based on cpint from Neale Ferguson and #CP in CMS + */ + +#include <linux/fs.h> +#include <linux/init.h> +#include <linux/kernel.h> +#include <linux/miscdevice.h> +#include <linux/module.h> +#include <asm/cpcmd.h> +#include <asm/debug.h> +#include <asm/uaccess.h> +#include "vmcp.h" + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Christian Borntraeger <cborntra@de.ibm.com>"); +MODULE_DESCRIPTION("z/VM CP interface"); + +static debug_info_t *vmcp_debug; + +static int vmcp_open(struct inode *inode, struct file *file) +{ + struct vmcp_session *session; + + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + + session = kmalloc(sizeof(*session), GFP_KERNEL); + if (!session) + return -ENOMEM; + session->bufsize = PAGE_SIZE; + session->response = NULL; + session->resp_size = 0; + init_MUTEX(&session->mutex); + file->private_data = session; + return nonseekable_open(inode, file); +} + +static int vmcp_release(struct inode *inode, struct file *file) +{ + struct vmcp_session *session; + + session = (struct vmcp_session *)file->private_data; + file->private_data = NULL; + free_pages((unsigned long)session->response, get_order(session->bufsize)); + kfree(session); + return 0; +} + +static ssize_t +vmcp_read(struct file *file, char __user * buff, size_t count, loff_t * ppos) +{ + size_t tocopy; + struct vmcp_session *session; + + session = (struct vmcp_session *)file->private_data; + if (down_interruptible(&session->mutex)) + return -ERESTARTSYS; + if (!session->response) { + up(&session->mutex); + return 0; + } + if (*ppos > session->resp_size) { + up(&session->mutex); + return 0; + } + tocopy = min(session->resp_size - (size_t) (*ppos), count); + tocopy = min(tocopy,session->bufsize - (size_t) (*ppos)); + + if (copy_to_user(buff, session->response + (*ppos), tocopy)) { + up(&session->mutex); + return -EFAULT; + } + up(&session->mutex); + *ppos += tocopy; + return tocopy; +} + +static ssize_t +vmcp_write(struct file *file, const char __user * buff, size_t count, + loff_t * ppos) +{ + char *cmd; + struct vmcp_session *session; + + if (count > 240) + return -EINVAL; + cmd = kmalloc(count + 1, GFP_KERNEL); + if (!cmd) + return -ENOMEM; + if (copy_from_user(cmd, buff, count)) { + kfree(cmd); + return -EFAULT; + } + cmd[count] = '\0'; + session = (struct vmcp_session *)file->private_data; + if (down_interruptible(&session->mutex)) + return -ERESTARTSYS; + if (!session->response) + session->response = (char *)__get_free_pages(GFP_KERNEL + | __GFP_REPEAT | GFP_DMA, + get_order(session->bufsize)); + if (!session->response) { + up(&session->mutex); + kfree(cmd); + return -ENOMEM; + } + debug_text_event(vmcp_debug, 1, cmd); + session->resp_size = cpcmd(cmd, session->response, + session->bufsize, + &session->resp_code); + up(&session->mutex); + kfree(cmd); + *ppos = 0; /* reset the file pointer after a command */ + return count; +} + + +/* + * These ioctls are available, as the semantics of the diagnose 8 call + * does not fit very well into a Linux call. Diagnose X'08' is described in + * CP Programming Services SC24-6084-00 + * + * VMCP_GETCODE: gives the CP return code back to user space + * VMCP_SETBUF: sets the response buffer for the next write call. diagnose 8 + * expects adjacent pages in real storage and to make matters worse, we + * dont know the size of the response. Therefore we default to PAGESIZE and + * let userspace to change the response size, if userspace expects a bigger + * response + */ +static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + struct vmcp_session *session; + int temp; + + session = (struct vmcp_session *)file->private_data; + if (down_interruptible(&session->mutex)) + return -ERESTARTSYS; + switch (cmd) { + case VMCP_GETCODE: + temp = session->resp_code; + up(&session->mutex); + return put_user(temp, (int __user *)arg); + case VMCP_SETBUF: + free_pages((unsigned long)session->response, + get_order(session->bufsize)); + session->response=NULL; + temp = get_user(session->bufsize, (int __user *)arg); + if (get_order(session->bufsize) > 8) { + session->bufsize = PAGE_SIZE; + temp = -EINVAL; + } + up(&session->mutex); + return temp; + case VMCP_GETSIZE: + temp = session->resp_size; + up(&session->mutex); + return put_user(temp, (int __user *)arg); + default: + up(&session->mutex); + return -ENOIOCTLCMD; + } +} + +static struct file_operations vmcp_fops = { + .owner = THIS_MODULE, + .open = &vmcp_open, + .release = &vmcp_release, + .read = &vmcp_read, + .llseek = &no_llseek, + .write = &vmcp_write, + .unlocked_ioctl = &vmcp_ioctl, + .compat_ioctl = &vmcp_ioctl +}; + +static struct miscdevice vmcp_dev = { + .name = "vmcp", + .minor = MISC_DYNAMIC_MINOR, + .fops = &vmcp_fops, +}; + +static int __init vmcp_init(void) +{ + int ret; + + if (!MACHINE_IS_VM) { + printk(KERN_WARNING + "z/VM CP interface is only available under z/VM\n"); + return -ENODEV; + } + ret = misc_register(&vmcp_dev); + if (!ret) + printk(KERN_INFO "z/VM CP interface loaded\n"); + else + printk(KERN_WARNING + "z/VM CP interface not loaded. Could not register misc device.\n"); + vmcp_debug = debug_register("vmcp", 1, 1, 240); + debug_register_view(vmcp_debug, &debug_hex_ascii_view); + return ret; +} + +static void __exit vmcp_exit(void) +{ + WARN_ON(misc_deregister(&vmcp_dev) != 0); + debug_unregister(vmcp_debug); + printk(KERN_INFO "z/VM CP interface unloaded.\n"); +} + +module_init(vmcp_init); +module_exit(vmcp_exit); diff --git a/drivers/s390/char/vmcp.h b/drivers/s390/char/vmcp.h new file mode 100644 index 00000000000..87389e73046 --- /dev/null +++ b/drivers/s390/char/vmcp.h @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2004, 2005 IBM Corporation + * Interface implementation for communication with the v/VM control program + * Version 1.0 + * Author(s): Christian Borntraeger <cborntra@de.ibm.com> + * + * + * z/VMs CP offers the possibility to issue commands via the diagnose code 8 + * this driver implements a character device that issues these commands and + * returns the answer of CP. + * + * The idea of this driver is based on cpint from Neale Ferguson + */ + +#include <asm/semaphore.h> +#include <linux/ioctl.h> + +#define VMCP_GETCODE _IOR(0x10, 1, int) +#define VMCP_SETBUF _IOW(0x10, 2, int) +#define VMCP_GETSIZE _IOR(0x10, 3, int) + +struct vmcp_session { + unsigned int bufsize; + char *response; + int resp_size; + int resp_code; + /* As we use copy_from/to_user, which might * + * sleep and cannot use a spinlock */ + struct semaphore mutex; +}; diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c index edf50d2bd10..491f00c032e 100644 --- a/drivers/s390/char/vmlogrdr.c +++ b/drivers/s390/char/vmlogrdr.c @@ -236,7 +236,7 @@ vmlogrdr_get_recording_class_AB(void) { int len,i; printk (KERN_DEBUG "vmlogrdr: query command: %s\n", cp_command); - cpcmd(cp_command, cp_response, sizeof(cp_response)); + cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); printk (KERN_DEBUG "vmlogrdr: response: %s", cp_response); len = strnlen(cp_response,sizeof(cp_response)); // now the parsing @@ -288,7 +288,7 @@ vmlogrdr_recording(struct vmlogrdr_priv_t * logptr, int action, int purge) { printk (KERN_DEBUG "vmlogrdr: recording command: %s\n", cp_command); - cpcmd(cp_command, cp_response, sizeof(cp_response)); + cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); printk (KERN_DEBUG "vmlogrdr: recording response: %s", cp_response); } @@ -301,7 +301,7 @@ vmlogrdr_recording(struct vmlogrdr_priv_t * logptr, int action, int purge) { qid_string); printk (KERN_DEBUG "vmlogrdr: recording command: %s\n", cp_command); - cpcmd(cp_command, cp_response, sizeof(cp_response)); + cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); printk (KERN_DEBUG "vmlogrdr: recording response: %s", cp_response); /* The recording command will usually answer with 'Command complete' @@ -548,7 +548,7 @@ vmlogrdr_read (struct file *filp, char *data, size_t count, loff_t * ppos) } static ssize_t -vmlogrdr_autopurge_store(struct device * dev, const char * buf, size_t count) { +vmlogrdr_autopurge_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t count) { struct vmlogrdr_priv_t *priv = dev->driver_data; ssize_t ret = count; @@ -567,7 +567,7 @@ vmlogrdr_autopurge_store(struct device * dev, const char * buf, size_t count) { static ssize_t -vmlogrdr_autopurge_show(struct device *dev, char *buf) { +vmlogrdr_autopurge_show(struct device *dev, struct device_attribute *attr, char *buf) { struct vmlogrdr_priv_t *priv = dev->driver_data; return sprintf(buf, "%u\n", priv->autopurge); } @@ -578,7 +578,7 @@ static DEVICE_ATTR(autopurge, 0644, vmlogrdr_autopurge_show, static ssize_t -vmlogrdr_purge_store(struct device * dev, const char * buf, size_t count) { +vmlogrdr_purge_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t count) { char cp_command[80]; char cp_response[80]; @@ -607,7 +607,7 @@ vmlogrdr_purge_store(struct device * dev, const char * buf, size_t count) { priv->recording_name); printk (KERN_DEBUG "vmlogrdr: recording command: %s\n", cp_command); - cpcmd(cp_command, cp_response, sizeof(cp_response)); + cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); printk (KERN_DEBUG "vmlogrdr: recording response: %s", cp_response); @@ -619,7 +619,7 @@ static DEVICE_ATTR(purge, 0200, NULL, vmlogrdr_purge_store); static ssize_t -vmlogrdr_autorecording_store(struct device *dev, const char *buf, +vmlogrdr_autorecording_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct vmlogrdr_priv_t *priv = dev->driver_data; ssize_t ret = count; @@ -639,7 +639,7 @@ vmlogrdr_autorecording_store(struct device *dev, const char *buf, static ssize_t -vmlogrdr_autorecording_show(struct device *dev, char *buf) { +vmlogrdr_autorecording_show(struct device *dev, struct device_attribute *attr, char *buf) { struct vmlogrdr_priv_t *priv = dev->driver_data; return sprintf(buf, "%u\n", priv->autorecording); } @@ -650,7 +650,7 @@ static DEVICE_ATTR(autorecording, 0644, vmlogrdr_autorecording_show, static ssize_t -vmlogrdr_recording_store(struct device * dev, const char * buf, size_t count) { +vmlogrdr_recording_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t count) { struct vmlogrdr_priv_t *priv = dev->driver_data; ssize_t ret; @@ -682,7 +682,7 @@ vmlogrdr_recording_status_show(struct device_driver *driver, char *buf) { char cp_command[] = "QUERY RECORDING "; int len; - cpcmd(cp_command, buf, 4096); + cpcmd(cp_command, buf, 4096, NULL); len = strlen(buf); return len; } @@ -703,7 +703,7 @@ static struct attribute_group vmlogrdr_attr_group = { .attrs = vmlogrdr_attrs, }; -static struct class_simple *vmlogrdr_class; +static struct class *vmlogrdr_class; static struct device_driver vmlogrdr_driver = { .name = "vmlogrdr", .bus = &iucv_bus, @@ -727,7 +727,7 @@ vmlogrdr_register_driver(void) { goto unregdriver; } - vmlogrdr_class = class_simple_create(THIS_MODULE, "vmlogrdr"); + vmlogrdr_class = class_create(THIS_MODULE, "vmlogrdr"); if (IS_ERR(vmlogrdr_class)) { printk(KERN_ERR "vmlogrdr: failed to create class.\n"); ret=PTR_ERR(vmlogrdr_class); @@ -746,7 +746,7 @@ unregdriver: static void vmlogrdr_unregister_driver(void) { - class_simple_destroy(vmlogrdr_class); + class_destroy(vmlogrdr_class); vmlogrdr_class = NULL; driver_remove_file(&vmlogrdr_driver, &driver_attr_recording_status); driver_unregister(&vmlogrdr_driver); @@ -786,7 +786,7 @@ vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) { device_unregister(dev); return ret; } - priv->class_device = class_simple_device_add( + priv->class_device = class_device_create( vmlogrdr_class, MKDEV(vmlogrdr_major, priv->minor_num), dev, @@ -806,7 +806,7 @@ vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) { static int vmlogrdr_unregister_device(struct vmlogrdr_priv_t *priv ) { - class_simple_device_remove(MKDEV(vmlogrdr_major, priv->minor_num)); + class_device_destroy(vmlogrdr_class, MKDEV(vmlogrdr_major, priv->minor_num)); if (priv->device != NULL) { sysfs_remove_group(&priv->device->kobj, &vmlogrdr_attr_group); device_unregister(priv->device); diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c index 4a06c7d0e5e..aac83ce6469 100644 --- a/drivers/s390/cio/blacklist.c +++ b/drivers/s390/cio/blacklist.c @@ -1,7 +1,7 @@ /* * drivers/s390/cio/blacklist.c * S/390 common I/O routines -- blacklisting of specific devices - * $Revision: 1.33 $ + * $Revision: 1.34 $ * * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation @@ -289,7 +289,7 @@ static int cio_ignore_read (char *page, char **start, off_t off, len = 0; for (devno = off; /* abuse the page variable * as counter, see fs/proc/generic.c */ - devno <= __MAX_SUBCHANNELS && len + entry_size < count; devno++) { + devno < __MAX_SUBCHANNELS && len + entry_size < count; devno++) { if (!test_bit(devno, bl_dev)) continue; len += sprintf(page + len, "0.0.%04lx", devno); @@ -302,7 +302,7 @@ static int cio_ignore_read (char *page, char **start, off_t off, len += sprintf(page + len, "\n"); } - if (devno <= __MAX_SUBCHANNELS) + if (devno < __MAX_SUBCHANNELS) *eof = 1; *start = (char *) (devno - off); /* number of checked entries */ return len; diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index 21a75ee28b8..91ea8e4777f 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c @@ -77,7 +77,7 @@ __ccwgroup_remove_symlinks(struct ccwgroup_device *gdev) * longer needed or accidentially created. Saves memory :) */ static ssize_t -ccwgroup_ungroup_store(struct device *dev, const char *buf, size_t count) +ccwgroup_ungroup_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct ccwgroup_device *gdev; @@ -310,7 +310,7 @@ ccwgroup_set_offline(struct ccwgroup_device *gdev) } static ssize_t -ccwgroup_online_store (struct device *dev, const char *buf, size_t count) +ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct ccwgroup_device *gdev; struct ccwgroup_driver *gdrv; @@ -338,7 +338,7 @@ ccwgroup_online_store (struct device *dev, const char *buf, size_t count) } static ssize_t -ccwgroup_online_show (struct device *dev, char *buf) +ccwgroup_online_show (struct device *dev, struct device_attribute *attr, char *buf) { int online; @@ -403,34 +403,22 @@ ccwgroup_driver_register (struct ccwgroup_driver *cdriver) return driver_register(&cdriver->driver); } -static inline struct device * -__get_next_ccwgroup_device(struct device_driver *drv) +static int +__ccwgroup_driver_unregister_device(struct device *dev, void *data) { - struct device *dev, *d; - - down_read(&drv->bus->subsys.rwsem); - dev = NULL; - list_for_each_entry(d, &drv->devices, driver_list) { - dev = get_device(d); - if (dev) - break; - } - up_read(&drv->bus->subsys.rwsem); - return dev; + __ccwgroup_remove_symlinks(to_ccwgroupdev(dev)); + device_unregister(dev); + put_device(dev); + return 0; } void ccwgroup_driver_unregister (struct ccwgroup_driver *cdriver) { - struct device *dev; - /* We don't want ccwgroup devices to live longer than their driver. */ get_driver(&cdriver->driver); - while ((dev = __get_next_ccwgroup_device(&cdriver->driver))) { - __ccwgroup_remove_symlinks(to_ccwgroupdev(dev)); - device_unregister(dev); - put_device(dev); - }; + driver_for_each_device(&cdriver->driver, NULL, NULL, + __ccwgroup_driver_unregister_device); put_driver(&cdriver->driver); driver_unregister(&cdriver->driver); } @@ -449,7 +437,7 @@ __ccwgroup_get_gdev_by_cdev(struct ccw_device *cdev) if (cdev->dev.driver_data) { gdev = (struct ccwgroup_device *)cdev->dev.driver_data; if (get_device(&gdev->dev)) { - if (!list_empty(&gdev->dev.node)) + if (klist_node_attached(&gdev->dev.knode_bus)) return gdev; put_device(&gdev->dev); } diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index b35fe12e6bf..b86f94ecd87 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c @@ -852,7 +852,7 @@ out: * Files for the channel path entries. */ static ssize_t -chp_status_show(struct device *dev, char *buf) +chp_status_show(struct device *dev, struct device_attribute *attr, char *buf) { struct channel_path *chp = container_of(dev, struct channel_path, dev); @@ -863,7 +863,7 @@ chp_status_show(struct device *dev, char *buf) } static ssize_t -chp_status_write(struct device *dev, const char *buf, size_t count) +chp_status_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct channel_path *cp = container_of(dev, struct channel_path, dev); char cmd[10]; @@ -888,7 +888,7 @@ chp_status_write(struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(status, 0644, chp_status_show, chp_status_write); static ssize_t -chp_type_show(struct device *dev, char *buf) +chp_type_show(struct device *dev, struct device_attribute *attr, char *buf) { struct channel_path *chp = container_of(dev, struct channel_path, dev); diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index 1d9b3f18d8d..ea813bdce1d 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c @@ -1,7 +1,7 @@ /* * drivers/s390/cio/cio.c * S/390 common I/O routines -- low level i/o calls - * $Revision: 1.133 $ + * $Revision: 1.134 $ * * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation @@ -63,17 +63,17 @@ __setup ("cio_msg=", cio_setup); static int __init cio_debug_init (void) { - cio_debug_msg_id = debug_register ("cio_msg", 4, 4, 16*sizeof (long)); + cio_debug_msg_id = debug_register ("cio_msg", 16, 4, 16*sizeof (long)); if (!cio_debug_msg_id) goto out_unregister; debug_register_view (cio_debug_msg_id, &debug_sprintf_view); debug_set_level (cio_debug_msg_id, 2); - cio_debug_trace_id = debug_register ("cio_trace", 4, 4, 8); + cio_debug_trace_id = debug_register ("cio_trace", 16, 4, 8); if (!cio_debug_trace_id) goto out_unregister; debug_register_view (cio_debug_trace_id, &debug_hex_ascii_view); debug_set_level (cio_debug_trace_id, 2); - cio_debug_crw_id = debug_register ("cio_crw", 2, 4, 16*sizeof (long)); + cio_debug_crw_id = debug_register ("cio_crw", 4, 4, 16*sizeof (long)); if (!cio_debug_crw_id) goto out_unregister; debug_register_view (cio_debug_crw_id, &debug_sprintf_view); diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c index 49def26ba38..8cc4f1a940d 100644 --- a/drivers/s390/cio/cmf.c +++ b/drivers/s390/cio/cmf.c @@ -796,7 +796,7 @@ cmb_show_attr(struct device *dev, char *buf, enum cmb_index idx) } static ssize_t -cmb_show_avg_sample_interval(struct device *dev, char *buf) +cmb_show_avg_sample_interval(struct device *dev, struct device_attribute *attr, char *buf) { struct ccw_device *cdev; long interval; @@ -813,7 +813,7 @@ cmb_show_avg_sample_interval(struct device *dev, char *buf) } static ssize_t -cmb_show_avg_utilization(struct device *dev, char *buf) +cmb_show_avg_utilization(struct device *dev, struct device_attribute *attr, char *buf) { struct cmbdata data; u64 utilization; @@ -842,12 +842,12 @@ cmb_show_avg_utilization(struct device *dev, char *buf) } #define cmf_attr(name) \ -static ssize_t show_ ## name (struct device * dev, char * buf) \ +static ssize_t show_ ## name (struct device * dev, struct device_attribute *attr, char * buf) \ { return cmb_show_attr((dev), buf, cmb_ ## name); } \ static DEVICE_ATTR(name, 0444, show_ ## name, NULL); #define cmf_attr_avg(name) \ -static ssize_t show_avg_ ## name (struct device * dev, char * buf) \ +static ssize_t show_avg_ ## name (struct device * dev, struct device_attribute *attr, char * buf) \ { return cmb_show_attr((dev), buf, cmb_ ## name); } \ static DEVICE_ATTR(avg_ ## name, 0444, show_avg_ ## name, NULL); @@ -902,12 +902,12 @@ static struct attribute_group cmf_attr_group_ext = { .attrs = cmf_attributes_ext, }; -static ssize_t cmb_enable_show(struct device *dev, char *buf) +static ssize_t cmb_enable_show(struct device *dev, struct device_attribute *attr, char *buf) { return sprintf(buf, "%d\n", to_ccwdev(dev)->private->cmb ? 1 : 0); } -static ssize_t cmb_enable_store(struct device *dev, const char *buf, size_t c) +static ssize_t cmb_enable_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t c) { struct ccw_device *cdev; int ret; diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 87bd70eeabe..555119cacc2 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -128,34 +128,28 @@ css_probe_device(int irq) return ret; } +static int +check_subchannel(struct device * dev, void * data) +{ + struct subchannel *sch; + int irq = (unsigned long)data; + + sch = to_subchannel(dev); + return (sch->irq == irq); +} + struct subchannel * get_subchannel_by_schid(int irq) { - struct subchannel *sch; - struct list_head *entry; struct device *dev; - if (!get_bus(&css_bus_type)) - return NULL; - down_read(&css_bus_type.subsys.rwsem); - sch = NULL; - list_for_each(entry, &css_bus_type.devices.list) { - dev = get_device(container_of(entry, - struct device, bus_list)); - if (!dev) - continue; - sch = to_subchannel(dev); - if (sch->irq == irq) - break; - put_device(dev); - sch = NULL; - } - up_read(&css_bus_type.subsys.rwsem); - put_bus(&css_bus_type); + dev = bus_find_device(&css_bus_type, NULL, + (void *)(unsigned long)irq, check_subchannel); - return sch; + return dev ? to_subchannel(dev) : NULL; } + static inline int css_get_subchannel_status(struct subchannel *sch, int schid) { diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index df0325505e4..14c76f5e417 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -204,7 +204,7 @@ module_exit(cleanup_ccw_bus_type); * TODO: Split chpids and pimpampom up? Where is "in use" in the tree? */ static ssize_t -chpids_show (struct device * dev, char * buf) +chpids_show (struct device * dev, struct device_attribute *attr, char * buf) { struct subchannel *sch = to_subchannel(dev); struct ssd_info *ssd = &sch->ssd_info; @@ -219,7 +219,7 @@ chpids_show (struct device * dev, char * buf) } static ssize_t -pimpampom_show (struct device * dev, char * buf) +pimpampom_show (struct device * dev, struct device_attribute *attr, char * buf) { struct subchannel *sch = to_subchannel(dev); struct pmcw *pmcw = &sch->schib.pmcw; @@ -229,7 +229,7 @@ pimpampom_show (struct device * dev, char * buf) } static ssize_t -devtype_show (struct device *dev, char *buf) +devtype_show (struct device *dev, struct device_attribute *attr, char *buf) { struct ccw_device *cdev = to_ccwdev(dev); struct ccw_device_id *id = &(cdev->id); @@ -242,7 +242,7 @@ devtype_show (struct device *dev, char *buf) } static ssize_t -cutype_show (struct device *dev, char *buf) +cutype_show (struct device *dev, struct device_attribute *attr, char *buf) { struct ccw_device *cdev = to_ccwdev(dev); struct ccw_device_id *id = &(cdev->id); @@ -252,7 +252,7 @@ cutype_show (struct device *dev, char *buf) } static ssize_t -online_show (struct device *dev, char *buf) +online_show (struct device *dev, struct device_attribute *attr, char *buf) { struct ccw_device *cdev = to_ccwdev(dev); @@ -350,7 +350,7 @@ ccw_device_set_online(struct ccw_device *cdev) } static ssize_t -online_store (struct device *dev, const char *buf, size_t count) +online_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct ccw_device *cdev = to_ccwdev(dev); int i, force, ret; @@ -422,7 +422,7 @@ online_store (struct device *dev, const char *buf, size_t count) } static ssize_t -available_show (struct device *dev, char *buf) +available_show (struct device *dev, struct device_attribute *attr, char *buf) { struct ccw_device *cdev = to_ccwdev(dev); struct subchannel *sch; @@ -514,36 +514,39 @@ ccw_device_register(struct ccw_device *cdev) return ret; } +struct match_data { + unsigned int devno; + struct ccw_device * sibling; +}; + +static int +match_devno(struct device * dev, void * data) +{ + struct match_data * d = (struct match_data *)data; + struct ccw_device * cdev; + + cdev = to_ccwdev(dev); + if ((cdev->private->state == DEV_STATE_DISCONNECTED) && + (cdev->private->devno == d->devno) && + (cdev != d->sibling)) { + cdev->private->state = DEV_STATE_NOT_OPER; + return 1; + } + return 0; +} + static struct ccw_device * get_disc_ccwdev_by_devno(unsigned int devno, struct ccw_device *sibling) { - struct ccw_device *cdev; - struct list_head *entry; struct device *dev; + struct match_data data = { + .devno = devno, + .sibling = sibling, + }; - if (!get_bus(&ccw_bus_type)) - return NULL; - down_read(&ccw_bus_type.subsys.rwsem); - cdev = NULL; - list_for_each(entry, &ccw_bus_type.devices.list) { - dev = get_device(container_of(entry, - struct device, bus_list)); - if (!dev) - continue; - cdev = to_ccwdev(dev); - if ((cdev->private->state == DEV_STATE_DISCONNECTED) && - (cdev->private->devno == devno) && - (cdev != sibling)) { - cdev->private->state = DEV_STATE_NOT_OPER; - break; - } - put_device(dev); - cdev = NULL; - } - up_read(&ccw_bus_type.subsys.rwsem); - put_bus(&ccw_bus_type); + dev = bus_find_device(&css_bus_type, NULL, &data, match_devno); - return cdev; + return dev ? to_ccwdev(dev) : NULL; } static void @@ -647,7 +650,7 @@ io_subchannel_register(void *data) cdev = (struct ccw_device *) data; sch = to_subchannel(cdev->dev.parent); - if (!list_empty(&sch->dev.children)) { + if (klist_node_attached(&cdev->dev.knode_parent)) { bus_rescan_devices(&ccw_bus_type); goto out; } @@ -1019,30 +1022,29 @@ ccw_device_probe_console(void) /* * get ccw_device matching the busid, but only if owned by cdrv */ +static int +__ccwdev_check_busid(struct device *dev, void *id) +{ + char *bus_id; + + bus_id = (char *)id; + + return (strncmp(bus_id, dev->bus_id, BUS_ID_SIZE) == 0); +} + + struct ccw_device * get_ccwdev_by_busid(struct ccw_driver *cdrv, const char *bus_id) { - struct device *d, *dev; + struct device *dev; struct device_driver *drv; drv = get_driver(&cdrv->driver); if (!drv) - return 0; - - down_read(&drv->bus->subsys.rwsem); - - dev = NULL; - list_for_each_entry(d, &drv->devices, driver_list) { - dev = get_device(d); + return NULL; - if (dev && !strncmp(bus_id, dev->bus_id, BUS_ID_SIZE)) - break; - else if (dev) { - put_device(dev); - dev = NULL; - } - } - up_read(&drv->bus->subsys.rwsem); + dev = driver_find_device(drv, NULL, (void *)bus_id, + __ccwdev_check_busid); put_driver(drv); return dev ? to_ccwdev(dev) : 0; diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index bbe9f45d143..82194c4eadf 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c @@ -56,7 +56,7 @@ #include "ioasm.h" #include "chsc.h" -#define VERSION_QDIO_C "$Revision: 1.98 $" +#define VERSION_QDIO_C "$Revision: 1.101 $" /****************** MODULE PARAMETER VARIABLES ********************/ MODULE_AUTHOR("Utz Bacher <utz.bacher@de.ibm.com>"); @@ -3342,7 +3342,7 @@ static int qdio_register_dbf_views(void) { qdio_dbf_setup=debug_register(QDIO_DBF_SETUP_NAME, - QDIO_DBF_SETUP_INDEX, + QDIO_DBF_SETUP_PAGES, QDIO_DBF_SETUP_NR_AREAS, QDIO_DBF_SETUP_LEN); if (!qdio_dbf_setup) @@ -3351,7 +3351,7 @@ qdio_register_dbf_views(void) debug_set_level(qdio_dbf_setup,QDIO_DBF_SETUP_LEVEL); qdio_dbf_sbal=debug_register(QDIO_DBF_SBAL_NAME, - QDIO_DBF_SBAL_INDEX, + QDIO_DBF_SBAL_PAGES, QDIO_DBF_SBAL_NR_AREAS, QDIO_DBF_SBAL_LEN); if (!qdio_dbf_sbal) @@ -3361,7 +3361,7 @@ qdio_register_dbf_views(void) debug_set_level(qdio_dbf_sbal,QDIO_DBF_SBAL_LEVEL); qdio_dbf_sense=debug_register(QDIO_DBF_SENSE_NAME, - QDIO_DBF_SENSE_INDEX, + QDIO_DBF_SENSE_PAGES, QDIO_DBF_SENSE_NR_AREAS, QDIO_DBF_SENSE_LEN); if (!qdio_dbf_sense) @@ -3371,7 +3371,7 @@ qdio_register_dbf_views(void) debug_set_level(qdio_dbf_sense,QDIO_DBF_SENSE_LEVEL); qdio_dbf_trace=debug_register(QDIO_DBF_TRACE_NAME, - QDIO_DBF_TRACE_INDEX, + QDIO_DBF_TRACE_PAGES, QDIO_DBF_TRACE_NR_AREAS, QDIO_DBF_TRACE_LEN); if (!qdio_dbf_trace) @@ -3382,7 +3382,7 @@ qdio_register_dbf_views(void) #ifdef CONFIG_QDIO_DEBUG qdio_dbf_slsb_out=debug_register(QDIO_DBF_SLSB_OUT_NAME, - QDIO_DBF_SLSB_OUT_INDEX, + QDIO_DBF_SLSB_OUT_PAGES, QDIO_DBF_SLSB_OUT_NR_AREAS, QDIO_DBF_SLSB_OUT_LEN); if (!qdio_dbf_slsb_out) @@ -3391,7 +3391,7 @@ qdio_register_dbf_views(void) debug_set_level(qdio_dbf_slsb_out,QDIO_DBF_SLSB_OUT_LEVEL); qdio_dbf_slsb_in=debug_register(QDIO_DBF_SLSB_IN_NAME, - QDIO_DBF_SLSB_IN_INDEX, + QDIO_DBF_SLSB_IN_PAGES, QDIO_DBF_SLSB_IN_NR_AREAS, QDIO_DBF_SLSB_IN_LEN); if (!qdio_dbf_slsb_in) diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h index b6daadac4e8..6b8aa6a852b 100644 --- a/drivers/s390/cio/qdio.h +++ b/drivers/s390/cio/qdio.h @@ -3,7 +3,7 @@ #include <asm/page.h> -#define VERSION_CIO_QDIO_H "$Revision: 1.32 $" +#define VERSION_CIO_QDIO_H "$Revision: 1.33 $" #ifdef CONFIG_QDIO_DEBUG #define QDIO_VERBOSE_LEVEL 9 @@ -132,7 +132,7 @@ enum qdio_irq_states { #define QDIO_DBF_SETUP_NAME "qdio_setup" #define QDIO_DBF_SETUP_LEN 8 -#define QDIO_DBF_SETUP_INDEX 2 +#define QDIO_DBF_SETUP_PAGES 4 #define QDIO_DBF_SETUP_NR_AREAS 1 #ifdef CONFIG_QDIO_DEBUG #define QDIO_DBF_SETUP_LEVEL 6 @@ -142,7 +142,7 @@ enum qdio_irq_states { #define QDIO_DBF_SBAL_NAME "qdio_labs" /* sbal */ #define QDIO_DBF_SBAL_LEN 256 -#define QDIO_DBF_SBAL_INDEX 2 +#define QDIO_DBF_SBAL_PAGES 4 #define QDIO_DBF_SBAL_NR_AREAS 2 #ifdef CONFIG_QDIO_DEBUG #define QDIO_DBF_SBAL_LEVEL 6 @@ -154,16 +154,16 @@ enum qdio_irq_states { #define QDIO_DBF_TRACE_LEN 8 #define QDIO_DBF_TRACE_NR_AREAS 2 #ifdef CONFIG_QDIO_DEBUG -#define QDIO_DBF_TRACE_INDEX 4 +#define QDIO_DBF_TRACE_PAGES 16 #define QDIO_DBF_TRACE_LEVEL 4 /* -------- could be even more verbose here */ #else /* CONFIG_QDIO_DEBUG */ -#define QDIO_DBF_TRACE_INDEX 2 +#define QDIO_DBF_TRACE_PAGES 4 #define QDIO_DBF_TRACE_LEVEL 2 #endif /* CONFIG_QDIO_DEBUG */ #define QDIO_DBF_SENSE_NAME "qdio_sense" #define QDIO_DBF_SENSE_LEN 64 -#define QDIO_DBF_SENSE_INDEX 1 +#define QDIO_DBF_SENSE_PAGES 2 #define QDIO_DBF_SENSE_NR_AREAS 1 #ifdef CONFIG_QDIO_DEBUG #define QDIO_DBF_SENSE_LEVEL 6 @@ -176,13 +176,13 @@ enum qdio_irq_states { #define QDIO_DBF_SLSB_OUT_NAME "qdio_slsb_out" #define QDIO_DBF_SLSB_OUT_LEN QDIO_MAX_BUFFERS_PER_Q -#define QDIO_DBF_SLSB_OUT_INDEX 8 +#define QDIO_DBF_SLSB_OUT_PAGES 256 #define QDIO_DBF_SLSB_OUT_NR_AREAS 1 #define QDIO_DBF_SLSB_OUT_LEVEL 6 #define QDIO_DBF_SLSB_IN_NAME "qdio_slsb_in" #define QDIO_DBF_SLSB_IN_LEN QDIO_MAX_BUFFERS_PER_Q -#define QDIO_DBF_SLSB_IN_INDEX 8 +#define QDIO_DBF_SLSB_IN_PAGES 256 #define QDIO_DBF_SLSB_IN_NR_AREAS 1 #define QDIO_DBF_SLSB_IN_LEVEL 6 #endif /* CONFIG_QDIO_DEBUG */ diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c index 06804d39a9c..60440dbe3a2 100644 --- a/drivers/s390/net/claw.c +++ b/drivers/s390/net/claw.c @@ -146,8 +146,8 @@ claw_unregister_debug_facility(void) static int claw_register_debug_facility(void) { - claw_dbf_setup = debug_register("claw_setup", 1, 1, 8); - claw_dbf_trace = debug_register("claw_trace", 1, 2, 8); + claw_dbf_setup = debug_register("claw_setup", 2, 1, 8); + claw_dbf_trace = debug_register("claw_trace", 2, 2, 8); if (claw_dbf_setup == NULL || claw_dbf_trace == NULL) { printk(KERN_WARNING "Not enough memory for debug facility.\n"); claw_unregister_debug_facility(); @@ -241,20 +241,20 @@ static struct sk_buff *claw_pack_skb(struct claw_privbk *privptr); static void dumpit (char *buf, int len); #endif /* sysfs Functions */ -static ssize_t claw_hname_show(struct device *dev, char *buf); -static ssize_t claw_hname_write(struct device *dev, +static ssize_t claw_hname_show(struct device *dev, struct device_attribute *attr, char *buf); +static ssize_t claw_hname_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count); -static ssize_t claw_adname_show(struct device *dev, char *buf); -static ssize_t claw_adname_write(struct device *dev, +static ssize_t claw_adname_show(struct device *dev, struct device_attribute *attr, char *buf); +static ssize_t claw_adname_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count); -static ssize_t claw_apname_show(struct device *dev, char *buf); -static ssize_t claw_apname_write(struct device *dev, +static ssize_t claw_apname_show(struct device *dev, struct device_attribute *attr, char *buf); +static ssize_t claw_apname_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count); -static ssize_t claw_wbuff_show(struct device *dev, char *buf); -static ssize_t claw_wbuff_write(struct device *dev, +static ssize_t claw_wbuff_show(struct device *dev, struct device_attribute *attr, char *buf); +static ssize_t claw_wbuff_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count); -static ssize_t claw_rbuff_show(struct device *dev, char *buf); -static ssize_t claw_rbuff_write(struct device *dev, +static ssize_t claw_rbuff_show(struct device *dev, struct device_attribute *attr, char *buf); +static ssize_t claw_rbuff_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count); static int claw_add_files(struct device *dev); static void claw_remove_files(struct device *dev); @@ -4149,7 +4149,7 @@ claw_remove_device(struct ccwgroup_device *cgdev) * sysfs attributes */ static ssize_t -claw_hname_show(struct device *dev, char *buf) +claw_hname_show(struct device *dev, struct device_attribute *attr, char *buf) { struct claw_privbk *priv; struct claw_env * p_env; @@ -4162,7 +4162,7 @@ claw_hname_show(struct device *dev, char *buf) } static ssize_t -claw_hname_write(struct device *dev, const char *buf, size_t count) +claw_hname_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct claw_privbk *priv; struct claw_env * p_env; @@ -4186,7 +4186,7 @@ claw_hname_write(struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(host_name, 0644, claw_hname_show, claw_hname_write); static ssize_t -claw_adname_show(struct device *dev, char *buf) +claw_adname_show(struct device *dev, struct device_attribute *attr, char *buf) { struct claw_privbk *priv; struct claw_env * p_env; @@ -4199,7 +4199,7 @@ claw_adname_show(struct device *dev, char *buf) } static ssize_t -claw_adname_write(struct device *dev, const char *buf, size_t count) +claw_adname_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct claw_privbk *priv; struct claw_env * p_env; @@ -4223,7 +4223,7 @@ claw_adname_write(struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(adapter_name, 0644, claw_adname_show, claw_adname_write); static ssize_t -claw_apname_show(struct device *dev, char *buf) +claw_apname_show(struct device *dev, struct device_attribute *attr, char *buf) { struct claw_privbk *priv; struct claw_env * p_env; @@ -4237,7 +4237,7 @@ claw_apname_show(struct device *dev, char *buf) } static ssize_t -claw_apname_write(struct device *dev, const char *buf, size_t count) +claw_apname_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct claw_privbk *priv; struct claw_env * p_env; @@ -4271,7 +4271,7 @@ claw_apname_write(struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(api_type, 0644, claw_apname_show, claw_apname_write); static ssize_t -claw_wbuff_show(struct device *dev, char *buf) +claw_wbuff_show(struct device *dev, struct device_attribute *attr, char *buf) { struct claw_privbk *priv; struct claw_env * p_env; @@ -4284,7 +4284,7 @@ claw_wbuff_show(struct device *dev, char *buf) } static ssize_t -claw_wbuff_write(struct device *dev, const char *buf, size_t count) +claw_wbuff_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct claw_privbk *priv; struct claw_env * p_env; @@ -4312,7 +4312,7 @@ claw_wbuff_write(struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(write_buffer, 0644, claw_wbuff_show, claw_wbuff_write); static ssize_t -claw_rbuff_show(struct device *dev, char *buf) +claw_rbuff_show(struct device *dev, struct device_attribute *attr, char *buf) { struct claw_privbk *priv; struct claw_env * p_env; @@ -4325,7 +4325,7 @@ claw_rbuff_show(struct device *dev, char *buf) } static ssize_t -claw_rbuff_write(struct device *dev, const char *buf, size_t count) +claw_rbuff_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct claw_privbk *priv; struct claw_env *p_env; diff --git a/drivers/s390/net/ctcdbug.c b/drivers/s390/net/ctcdbug.c index 2c86bfa11b2..0e2a8bb9303 100644 --- a/drivers/s390/net/ctcdbug.c +++ b/drivers/s390/net/ctcdbug.c @@ -1,6 +1,6 @@ /* * - * linux/drivers/s390/net/ctcdbug.c ($Revision: 1.4 $) + * linux/drivers/s390/net/ctcdbug.c ($Revision: 1.6 $) * * CTC / ESCON network driver - s390 dbf exploit. * @@ -9,7 +9,7 @@ * Author(s): Original Code written by * Peter Tiedemann (ptiedem@de.ibm.com) * - * $Revision: 1.4 $ $Date: 2004/08/04 10:11:59 $ + * $Revision: 1.6 $ $Date: 2005/05/11 08:10:17 $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,15 +51,15 @@ int ctc_register_dbf_views(void) { ctc_dbf_setup = debug_register(CTC_DBF_SETUP_NAME, - CTC_DBF_SETUP_INDEX, + CTC_DBF_SETUP_PAGES, CTC_DBF_SETUP_NR_AREAS, CTC_DBF_SETUP_LEN); ctc_dbf_data = debug_register(CTC_DBF_DATA_NAME, - CTC_DBF_DATA_INDEX, + CTC_DBF_DATA_PAGES, CTC_DBF_DATA_NR_AREAS, CTC_DBF_DATA_LEN); ctc_dbf_trace = debug_register(CTC_DBF_TRACE_NAME, - CTC_DBF_TRACE_INDEX, + CTC_DBF_TRACE_PAGES, CTC_DBF_TRACE_NR_AREAS, CTC_DBF_TRACE_LEN); diff --git a/drivers/s390/net/ctcdbug.h b/drivers/s390/net/ctcdbug.h index 7fe2ebd1792..7d6afa1627c 100644 --- a/drivers/s390/net/ctcdbug.h +++ b/drivers/s390/net/ctcdbug.h @@ -1,6 +1,6 @@ /* * - * linux/drivers/s390/net/ctcdbug.h ($Revision: 1.5 $) + * linux/drivers/s390/net/ctcdbug.h ($Revision: 1.6 $) * * CTC / ESCON network driver - s390 dbf exploit. * @@ -9,7 +9,7 @@ * Author(s): Original Code written by * Peter Tiedemann (ptiedem@de.ibm.com) * - * $Revision: 1.5 $ $Date: 2005/02/27 19:46:44 $ + * $Revision: 1.6 $ $Date: 2005/05/11 08:10:17 $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,19 +35,19 @@ */ #define CTC_DBF_SETUP_NAME "ctc_setup" #define CTC_DBF_SETUP_LEN 16 -#define CTC_DBF_SETUP_INDEX 3 +#define CTC_DBF_SETUP_PAGES 8 #define CTC_DBF_SETUP_NR_AREAS 1 #define CTC_DBF_SETUP_LEVEL 3 #define CTC_DBF_DATA_NAME "ctc_data" #define CTC_DBF_DATA_LEN 128 -#define CTC_DBF_DATA_INDEX 3 +#define CTC_DBF_DATA_PAGES 8 #define CTC_DBF_DATA_NR_AREAS 1 #define CTC_DBF_DATA_LEVEL 3 #define CTC_DBF_TRACE_NAME "ctc_trace" #define CTC_DBF_TRACE_LEN 16 -#define CTC_DBF_TRACE_INDEX 2 +#define CTC_DBF_TRACE_PAGES 4 #define CTC_DBF_TRACE_NR_AREAS 2 #define CTC_DBF_TRACE_LEVEL 3 diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c index ff3e95e07e8..96ca863eaff 100644 --- a/drivers/s390/net/ctcmain.c +++ b/drivers/s390/net/ctcmain.c @@ -2469,7 +2469,7 @@ ctc_stats(struct net_device * dev) */ static ssize_t -buffer_show(struct device *dev, char *buf) +buffer_show(struct device *dev, struct device_attribute *attr, char *buf) { struct ctc_priv *priv; @@ -2481,7 +2481,7 @@ buffer_show(struct device *dev, char *buf) } static ssize_t -buffer_write(struct device *dev, const char *buf, size_t count) +buffer_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct ctc_priv *priv; struct net_device *ndev; @@ -2530,13 +2530,13 @@ einval: } static ssize_t -loglevel_show(struct device *dev, char *buf) +loglevel_show(struct device *dev, struct device_attribute *attr, char *buf) { return sprintf(buf, "%d\n", loglevel); } static ssize_t -loglevel_write(struct device *dev, const char *buf, size_t count) +loglevel_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { int ll1; @@ -2589,7 +2589,7 @@ ctc_print_statistics(struct ctc_priv *priv) } static ssize_t -stats_show(struct device *dev, char *buf) +stats_show(struct device *dev, struct device_attribute *attr, char *buf) { struct ctc_priv *priv = dev->driver_data; if (!priv) @@ -2599,7 +2599,7 @@ stats_show(struct device *dev, char *buf) } static ssize_t -stats_write(struct device *dev, const char *buf, size_t count) +stats_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct ctc_priv *priv = dev->driver_data; if (!priv) @@ -2654,7 +2654,7 @@ ctc_free_netdevice(struct net_device * dev, int free_dev) } static ssize_t -ctc_proto_show(struct device *dev, char *buf) +ctc_proto_show(struct device *dev, struct device_attribute *attr, char *buf) { struct ctc_priv *priv; @@ -2666,7 +2666,7 @@ ctc_proto_show(struct device *dev, char *buf) } static ssize_t -ctc_proto_store(struct device *dev, const char *buf, size_t count) +ctc_proto_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct ctc_priv *priv; int value; @@ -2687,7 +2687,7 @@ ctc_proto_store(struct device *dev, const char *buf, size_t count) static ssize_t -ctc_type_show(struct device *dev, char *buf) +ctc_type_show(struct device *dev, struct device_attribute *attr, char *buf) { struct ccwgroup_device *cgdev; diff --git a/drivers/s390/net/iucv.h b/drivers/s390/net/iucv.h index 198330217ef..0c4644d3d2f 100644 --- a/drivers/s390/net/iucv.h +++ b/drivers/s390/net/iucv.h @@ -37,19 +37,19 @@ */ #define IUCV_DBF_SETUP_NAME "iucv_setup" #define IUCV_DBF_SETUP_LEN 32 -#define IUCV_DBF_SETUP_INDEX 1 +#define IUCV_DBF_SETUP_PAGES 2 #define IUCV_DBF_SETUP_NR_AREAS 1 #define IUCV_DBF_SETUP_LEVEL 3 #define IUCV_DBF_DATA_NAME "iucv_data" #define IUCV_DBF_DATA_LEN 128 -#define IUCV_DBF_DATA_INDEX 1 +#define IUCV_DBF_DATA_PAGES 2 #define IUCV_DBF_DATA_NR_AREAS 1 #define IUCV_DBF_DATA_LEVEL 2 #define IUCV_DBF_TRACE_NAME "iucv_trace" #define IUCV_DBF_TRACE_LEN 16 -#define IUCV_DBF_TRACE_INDEX 2 +#define IUCV_DBF_TRACE_PAGES 4 #define IUCV_DBF_TRACE_NR_AREAS 1 #define IUCV_DBF_TRACE_LEVEL 3 diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index cccfed248e7..46f34ba93ac 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c @@ -11,7 +11,7 @@ * Frank Pavlic (pavlic@de.ibm.com) and * Martin Schwidefsky <schwidefsky@de.ibm.com> * - * $Revision: 1.98 $ $Date: 2005/04/18 13:41:29 $ + * $Revision: 1.99 $ $Date: 2005/05/11 08:10:17 $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,7 +59,7 @@ /** * initialization string for output */ -#define VERSION_LCS_C "$Revision: 1.98 $" +#define VERSION_LCS_C "$Revision: 1.99 $" static char version[] __initdata = "LCS driver ("VERSION_LCS_C "/" VERSION_LCS_H ")"; static char debug_buffer[255]; @@ -93,8 +93,8 @@ lcs_unregister_debug_facility(void) static int lcs_register_debug_facility(void) { - lcs_dbf_setup = debug_register("lcs_setup", 1, 1, 8); - lcs_dbf_trace = debug_register("lcs_trace", 1, 2, 8); + lcs_dbf_setup = debug_register("lcs_setup", 2, 1, 8); + lcs_dbf_trace = debug_register("lcs_trace", 2, 2, 8); if (lcs_dbf_setup == NULL || lcs_dbf_trace == NULL) { PRINT_ERR("Not enough memory for debug facility.\n"); lcs_unregister_debug_facility(); @@ -1984,7 +1984,7 @@ lcs_open_device(struct net_device *dev) * show function for portno called by cat or similar things */ static ssize_t -lcs_portno_show (struct device *dev, char *buf) +lcs_portno_show (struct device *dev, struct device_attribute *attr, char *buf) { struct lcs_card *card; @@ -2000,7 +2000,7 @@ lcs_portno_show (struct device *dev, char *buf) * store the value which is piped to file portno */ static ssize_t -lcs_portno_store (struct device *dev, const char *buf, size_t count) +lcs_portno_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct lcs_card *card; int value; @@ -2021,7 +2021,7 @@ lcs_portno_store (struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(portno, 0644, lcs_portno_show, lcs_portno_store); static ssize_t -lcs_type_show(struct device *dev, char *buf) +lcs_type_show(struct device *dev, struct device_attribute *attr, char *buf) { struct ccwgroup_device *cgdev; @@ -2035,7 +2035,7 @@ lcs_type_show(struct device *dev, char *buf) static DEVICE_ATTR(type, 0444, lcs_type_show, NULL); static ssize_t -lcs_timeout_show(struct device *dev, char *buf) +lcs_timeout_show(struct device *dev, struct device_attribute *attr, char *buf) { struct lcs_card *card; @@ -2045,7 +2045,7 @@ lcs_timeout_show(struct device *dev, char *buf) } static ssize_t -lcs_timeout_store (struct device *dev, const char *buf, size_t count) +lcs_timeout_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct lcs_card *card; int value; diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index 16e8e69afb1..69425a7a6e9 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c @@ -1,5 +1,5 @@ /* - * $Id: netiucv.c,v 1.63 2004/07/27 13:36:05 mschwide Exp $ + * $Id: netiucv.c,v 1.66 2005/05/11 08:10:17 holzheu Exp $ * * IUCV network driver * @@ -30,7 +30,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * RELEASE-TAG: IUCV network driver $Revision: 1.63 $ + * RELEASE-TAG: IUCV network driver $Revision: 1.66 $ * */ @@ -391,15 +391,15 @@ static int iucv_register_dbf_views(void) { iucv_dbf_setup = debug_register(IUCV_DBF_SETUP_NAME, - IUCV_DBF_SETUP_INDEX, + IUCV_DBF_SETUP_PAGES, IUCV_DBF_SETUP_NR_AREAS, IUCV_DBF_SETUP_LEN); iucv_dbf_data = debug_register(IUCV_DBF_DATA_NAME, - IUCV_DBF_DATA_INDEX, + IUCV_DBF_DATA_PAGES, IUCV_DBF_DATA_NR_AREAS, IUCV_DBF_DATA_LEN); iucv_dbf_trace = debug_register(IUCV_DBF_TRACE_NAME, - IUCV_DBF_TRACE_INDEX, + IUCV_DBF_TRACE_PAGES, IUCV_DBF_TRACE_NR_AREAS, IUCV_DBF_TRACE_LEN); @@ -1356,7 +1356,7 @@ netiucv_change_mtu (struct net_device * dev, int new_mtu) *****************************************************************************/ static ssize_t -user_show (struct device *dev, char *buf) +user_show (struct device *dev, struct device_attribute *attr, char *buf) { struct netiucv_priv *priv = dev->driver_data; @@ -1365,7 +1365,7 @@ user_show (struct device *dev, char *buf) } static ssize_t -user_write (struct device *dev, const char *buf, size_t count) +user_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; struct net_device *ndev = priv->conn->netdev; @@ -1422,7 +1422,7 @@ user_write (struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(user, 0644, user_show, user_write); static ssize_t -buffer_show (struct device *dev, char *buf) +buffer_show (struct device *dev, struct device_attribute *attr, char *buf) { struct netiucv_priv *priv = dev->driver_data; @@ -1431,7 +1431,7 @@ buffer_show (struct device *dev, char *buf) } static ssize_t -buffer_write (struct device *dev, const char *buf, size_t count) +buffer_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; struct net_device *ndev = priv->conn->netdev; @@ -1486,7 +1486,7 @@ buffer_write (struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(buffer, 0644, buffer_show, buffer_write); static ssize_t -dev_fsm_show (struct device *dev, char *buf) +dev_fsm_show (struct device *dev, struct device_attribute *attr, char *buf) { struct netiucv_priv *priv = dev->driver_data; @@ -1497,7 +1497,7 @@ dev_fsm_show (struct device *dev, char *buf) static DEVICE_ATTR(device_fsm_state, 0444, dev_fsm_show, NULL); static ssize_t -conn_fsm_show (struct device *dev, char *buf) +conn_fsm_show (struct device *dev, struct device_attribute *attr, char *buf) { struct netiucv_priv *priv = dev->driver_data; @@ -1508,7 +1508,7 @@ conn_fsm_show (struct device *dev, char *buf) static DEVICE_ATTR(connection_fsm_state, 0444, conn_fsm_show, NULL); static ssize_t -maxmulti_show (struct device *dev, char *buf) +maxmulti_show (struct device *dev, struct device_attribute *attr, char *buf) { struct netiucv_priv *priv = dev->driver_data; @@ -1517,7 +1517,7 @@ maxmulti_show (struct device *dev, char *buf) } static ssize_t -maxmulti_write (struct device *dev, const char *buf, size_t count) +maxmulti_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; @@ -1529,7 +1529,7 @@ maxmulti_write (struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(max_tx_buffer_used, 0644, maxmulti_show, maxmulti_write); static ssize_t -maxcq_show (struct device *dev, char *buf) +maxcq_show (struct device *dev, struct device_attribute *attr, char *buf) { struct netiucv_priv *priv = dev->driver_data; @@ -1538,7 +1538,7 @@ maxcq_show (struct device *dev, char *buf) } static ssize_t -maxcq_write (struct device *dev, const char *buf, size_t count) +maxcq_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; @@ -1550,7 +1550,7 @@ maxcq_write (struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(max_chained_skbs, 0644, maxcq_show, maxcq_write); static ssize_t -sdoio_show (struct device *dev, char *buf) +sdoio_show (struct device *dev, struct device_attribute *attr, char *buf) { struct netiucv_priv *priv = dev->driver_data; @@ -1559,7 +1559,7 @@ sdoio_show (struct device *dev, char *buf) } static ssize_t -sdoio_write (struct device *dev, const char *buf, size_t count) +sdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; @@ -1571,7 +1571,7 @@ sdoio_write (struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(tx_single_write_ops, 0644, sdoio_show, sdoio_write); static ssize_t -mdoio_show (struct device *dev, char *buf) +mdoio_show (struct device *dev, struct device_attribute *attr, char *buf) { struct netiucv_priv *priv = dev->driver_data; @@ -1580,7 +1580,7 @@ mdoio_show (struct device *dev, char *buf) } static ssize_t -mdoio_write (struct device *dev, const char *buf, size_t count) +mdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; @@ -1592,7 +1592,7 @@ mdoio_write (struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(tx_multi_write_ops, 0644, mdoio_show, mdoio_write); static ssize_t -txlen_show (struct device *dev, char *buf) +txlen_show (struct device *dev, struct device_attribute *attr, char *buf) { struct netiucv_priv *priv = dev->driver_data; @@ -1601,7 +1601,7 @@ txlen_show (struct device *dev, char *buf) } static ssize_t -txlen_write (struct device *dev, const char *buf, size_t count) +txlen_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; @@ -1613,7 +1613,7 @@ txlen_write (struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(netto_bytes, 0644, txlen_show, txlen_write); static ssize_t -txtime_show (struct device *dev, char *buf) +txtime_show (struct device *dev, struct device_attribute *attr, char *buf) { struct netiucv_priv *priv = dev->driver_data; @@ -1622,7 +1622,7 @@ txtime_show (struct device *dev, char *buf) } static ssize_t -txtime_write (struct device *dev, const char *buf, size_t count) +txtime_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; @@ -1634,7 +1634,7 @@ txtime_write (struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(max_tx_io_time, 0644, txtime_show, txtime_write); static ssize_t -txpend_show (struct device *dev, char *buf) +txpend_show (struct device *dev, struct device_attribute *attr, char *buf) { struct netiucv_priv *priv = dev->driver_data; @@ -1643,7 +1643,7 @@ txpend_show (struct device *dev, char *buf) } static ssize_t -txpend_write (struct device *dev, const char *buf, size_t count) +txpend_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; @@ -1655,7 +1655,7 @@ txpend_write (struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(tx_pending, 0644, txpend_show, txpend_write); static ssize_t -txmpnd_show (struct device *dev, char *buf) +txmpnd_show (struct device *dev, struct device_attribute *attr, char *buf) { struct netiucv_priv *priv = dev->driver_data; @@ -1664,7 +1664,7 @@ txmpnd_show (struct device *dev, char *buf) } static ssize_t -txmpnd_write (struct device *dev, const char *buf, size_t count) +txmpnd_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; @@ -2076,7 +2076,7 @@ DRIVER_ATTR(remove, 0200, NULL, remove_write); static void netiucv_banner(void) { - char vbuf[] = "$Revision: 1.63 $"; + char vbuf[] = "$Revision: 1.66 $"; char *version = vbuf; if ((version = strchr(version, ':'))) { diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h index a755b57db46..008e0a5d2eb 100644 --- a/drivers/s390/net/qeth.h +++ b/drivers/s390/net/qeth.h @@ -42,44 +42,44 @@ */ #define QETH_DBF_SETUP_NAME "qeth_setup" #define QETH_DBF_SETUP_LEN 8 -#define QETH_DBF_SETUP_INDEX 3 +#define QETH_DBF_SETUP_PAGES 8 #define QETH_DBF_SETUP_NR_AREAS 1 #define QETH_DBF_SETUP_LEVEL 5 #define QETH_DBF_MISC_NAME "qeth_misc" #define QETH_DBF_MISC_LEN 128 -#define QETH_DBF_MISC_INDEX 1 +#define QETH_DBF_MISC_PAGES 2 #define QETH_DBF_MISC_NR_AREAS 1 #define QETH_DBF_MISC_LEVEL 2 #define QETH_DBF_DATA_NAME "qeth_data" #define QETH_DBF_DATA_LEN 96 -#define QETH_DBF_DATA_INDEX 3 +#define QETH_DBF_DATA_PAGES 8 #define QETH_DBF_DATA_NR_AREAS 1 #define QETH_DBF_DATA_LEVEL 2 #define QETH_DBF_CONTROL_NAME "qeth_control" #define QETH_DBF_CONTROL_LEN 256 -#define QETH_DBF_CONTROL_INDEX 3 +#define QETH_DBF_CONTROL_PAGES 8 #define QETH_DBF_CONTROL_NR_AREAS 2 #define QETH_DBF_CONTROL_LEVEL 5 #define QETH_DBF_TRACE_NAME "qeth_trace" #define QETH_DBF_TRACE_LEN 8 -#define QETH_DBF_TRACE_INDEX 2 +#define QETH_DBF_TRACE_PAGES 4 #define QETH_DBF_TRACE_NR_AREAS 2 #define QETH_DBF_TRACE_LEVEL 3 extern debug_info_t *qeth_dbf_trace; #define QETH_DBF_SENSE_NAME "qeth_sense" #define QETH_DBF_SENSE_LEN 64 -#define QETH_DBF_SENSE_INDEX 1 +#define QETH_DBF_SENSE_PAGES 2 #define QETH_DBF_SENSE_NR_AREAS 1 #define QETH_DBF_SENSE_LEVEL 2 #define QETH_DBF_QERR_NAME "qeth_qerr" #define QETH_DBF_QERR_LEN 8 -#define QETH_DBF_QERR_INDEX 1 +#define QETH_DBF_QERR_PAGES 2 #define QETH_DBF_QERR_NR_AREAS 2 #define QETH_DBF_QERR_LEVEL 2 diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 208127a5033..3cb88c77003 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -7639,31 +7639,31 @@ static int qeth_register_dbf_views(void) { qeth_dbf_setup = debug_register(QETH_DBF_SETUP_NAME, - QETH_DBF_SETUP_INDEX, + QETH_DBF_SETUP_PAGES, QETH_DBF_SETUP_NR_AREAS, QETH_DBF_SETUP_LEN); qeth_dbf_misc = debug_register(QETH_DBF_MISC_NAME, - QETH_DBF_MISC_INDEX, + QETH_DBF_MISC_PAGES, QETH_DBF_MISC_NR_AREAS, QETH_DBF_MISC_LEN); qeth_dbf_data = debug_register(QETH_DBF_DATA_NAME, - QETH_DBF_DATA_INDEX, + QETH_DBF_DATA_PAGES, QETH_DBF_DATA_NR_AREAS, QETH_DBF_DATA_LEN); qeth_dbf_control = debug_register(QETH_DBF_CONTROL_NAME, - QETH_DBF_CONTROL_INDEX, + QETH_DBF_CONTROL_PAGES, QETH_DBF_CONTROL_NR_AREAS, QETH_DBF_CONTROL_LEN); qeth_dbf_sense = debug_register(QETH_DBF_SENSE_NAME, - QETH_DBF_SENSE_INDEX, + QETH_DBF_SENSE_PAGES, QETH_DBF_SENSE_NR_AREAS, QETH_DBF_SENSE_LEN); qeth_dbf_qerr = debug_register(QETH_DBF_QERR_NAME, - QETH_DBF_QERR_INDEX, + QETH_DBF_QERR_PAGES, QETH_DBF_QERR_NR_AREAS, QETH_DBF_QERR_LEN); qeth_dbf_trace = debug_register(QETH_DBF_TRACE_NAME, - QETH_DBF_TRACE_INDEX, + QETH_DBF_TRACE_PAGES, QETH_DBF_TRACE_NR_AREAS, QETH_DBF_TRACE_LEN); diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c index 24034839821..98bedb0cb38 100644 --- a/drivers/s390/net/qeth_sys.c +++ b/drivers/s390/net/qeth_sys.c @@ -30,7 +30,7 @@ const char *VERSION_QETH_SYS_C = "$Revision: 1.51 $"; //low/high watermark static ssize_t -qeth_dev_state_show(struct device *dev, char *buf) +qeth_dev_state_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; if (!card) @@ -58,7 +58,7 @@ qeth_dev_state_show(struct device *dev, char *buf) static DEVICE_ATTR(state, 0444, qeth_dev_state_show, NULL); static ssize_t -qeth_dev_chpid_show(struct device *dev, char *buf) +qeth_dev_chpid_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; if (!card) @@ -70,7 +70,7 @@ qeth_dev_chpid_show(struct device *dev, char *buf) static DEVICE_ATTR(chpid, 0444, qeth_dev_chpid_show, NULL); static ssize_t -qeth_dev_if_name_show(struct device *dev, char *buf) +qeth_dev_if_name_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; if (!card) @@ -81,7 +81,7 @@ qeth_dev_if_name_show(struct device *dev, char *buf) static DEVICE_ATTR(if_name, 0444, qeth_dev_if_name_show, NULL); static ssize_t -qeth_dev_card_type_show(struct device *dev, char *buf) +qeth_dev_card_type_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; if (!card) @@ -93,7 +93,7 @@ qeth_dev_card_type_show(struct device *dev, char *buf) static DEVICE_ATTR(card_type, 0444, qeth_dev_card_type_show, NULL); static ssize_t -qeth_dev_portno_show(struct device *dev, char *buf) +qeth_dev_portno_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; if (!card) @@ -103,7 +103,7 @@ qeth_dev_portno_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_portno_store(struct device *dev, const char *buf, size_t count) +qeth_dev_portno_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; char *tmp; @@ -129,7 +129,7 @@ qeth_dev_portno_store(struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(portno, 0644, qeth_dev_portno_show, qeth_dev_portno_store); static ssize_t -qeth_dev_portname_show(struct device *dev, char *buf) +qeth_dev_portname_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; char portname[9] = {0, }; @@ -146,7 +146,7 @@ qeth_dev_portname_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_portname_store(struct device *dev, const char *buf, size_t count) +qeth_dev_portname_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; char *tmp; @@ -177,7 +177,7 @@ static DEVICE_ATTR(portname, 0644, qeth_dev_portname_show, qeth_dev_portname_store); static ssize_t -qeth_dev_checksum_show(struct device *dev, char *buf) +qeth_dev_checksum_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -188,7 +188,7 @@ qeth_dev_checksum_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_checksum_store(struct device *dev, const char *buf, size_t count) +qeth_dev_checksum_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; char *tmp; @@ -218,7 +218,7 @@ static DEVICE_ATTR(checksumming, 0644, qeth_dev_checksum_show, qeth_dev_checksum_store); static ssize_t -qeth_dev_prioqing_show(struct device *dev, char *buf) +qeth_dev_prioqing_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -237,7 +237,7 @@ qeth_dev_prioqing_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_prioqing_store(struct device *dev, const char *buf, size_t count) +qeth_dev_prioqing_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; char *tmp; @@ -290,7 +290,7 @@ static DEVICE_ATTR(priority_queueing, 0644, qeth_dev_prioqing_show, qeth_dev_prioqing_store); static ssize_t -qeth_dev_bufcnt_show(struct device *dev, char *buf) +qeth_dev_bufcnt_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -301,7 +301,7 @@ qeth_dev_bufcnt_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_bufcnt_store(struct device *dev, const char *buf, size_t count) +qeth_dev_bufcnt_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; char *tmp; @@ -360,7 +360,7 @@ qeth_dev_route_show(struct qeth_card *card, struct qeth_routing_info *route, } static ssize_t -qeth_dev_route4_show(struct device *dev, char *buf) +qeth_dev_route4_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -410,7 +410,7 @@ qeth_dev_route_store(struct qeth_card *card, struct qeth_routing_info *route, } static ssize_t -qeth_dev_route4_store(struct device *dev, const char *buf, size_t count) +qeth_dev_route4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -425,7 +425,7 @@ static DEVICE_ATTR(route4, 0644, qeth_dev_route4_show, qeth_dev_route4_store); #ifdef CONFIG_QETH_IPV6 static ssize_t -qeth_dev_route6_show(struct device *dev, char *buf) +qeth_dev_route6_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -439,7 +439,7 @@ qeth_dev_route6_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_route6_store(struct device *dev, const char *buf, size_t count) +qeth_dev_route6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -461,7 +461,7 @@ static DEVICE_ATTR(route6, 0644, qeth_dev_route6_show, qeth_dev_route6_store); #endif static ssize_t -qeth_dev_add_hhlen_show(struct device *dev, char *buf) +qeth_dev_add_hhlen_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -472,7 +472,7 @@ qeth_dev_add_hhlen_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_add_hhlen_store(struct device *dev, const char *buf, size_t count) +qeth_dev_add_hhlen_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; char *tmp; @@ -499,7 +499,7 @@ static DEVICE_ATTR(add_hhlen, 0644, qeth_dev_add_hhlen_show, qeth_dev_add_hhlen_store); static ssize_t -qeth_dev_fake_ll_show(struct device *dev, char *buf) +qeth_dev_fake_ll_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -510,7 +510,7 @@ qeth_dev_fake_ll_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_fake_ll_store(struct device *dev, const char *buf, size_t count) +qeth_dev_fake_ll_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; char *tmp; @@ -536,7 +536,7 @@ static DEVICE_ATTR(fake_ll, 0644, qeth_dev_fake_ll_show, qeth_dev_fake_ll_store); static ssize_t -qeth_dev_fake_broadcast_show(struct device *dev, char *buf) +qeth_dev_fake_broadcast_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -547,7 +547,7 @@ qeth_dev_fake_broadcast_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_fake_broadcast_store(struct device *dev, const char *buf, size_t count) +qeth_dev_fake_broadcast_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; char *tmp; @@ -574,7 +574,7 @@ static DEVICE_ATTR(fake_broadcast, 0644, qeth_dev_fake_broadcast_show, qeth_dev_fake_broadcast_store); static ssize_t -qeth_dev_recover_store(struct device *dev, const char *buf, size_t count) +qeth_dev_recover_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; char *tmp; @@ -596,7 +596,7 @@ qeth_dev_recover_store(struct device *dev, const char *buf, size_t count) static DEVICE_ATTR(recover, 0200, NULL, qeth_dev_recover_store); static ssize_t -qeth_dev_broadcast_mode_show(struct device *dev, char *buf) +qeth_dev_broadcast_mode_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -613,7 +613,7 @@ qeth_dev_broadcast_mode_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_broadcast_mode_store(struct device *dev, const char *buf, size_t count) +qeth_dev_broadcast_mode_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; char *tmp; @@ -651,7 +651,7 @@ static DEVICE_ATTR(broadcast_mode, 0644, qeth_dev_broadcast_mode_show, qeth_dev_broadcast_mode_store); static ssize_t -qeth_dev_canonical_macaddr_show(struct device *dev, char *buf) +qeth_dev_canonical_macaddr_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -667,7 +667,7 @@ qeth_dev_canonical_macaddr_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_canonical_macaddr_store(struct device *dev, const char *buf, +qeth_dev_canonical_macaddr_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -703,7 +703,7 @@ static DEVICE_ATTR(canonical_macaddr, 0644, qeth_dev_canonical_macaddr_show, qeth_dev_canonical_macaddr_store); static ssize_t -qeth_dev_layer2_show(struct device *dev, char *buf) +qeth_dev_layer2_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -714,7 +714,7 @@ qeth_dev_layer2_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_layer2_store(struct device *dev, const char *buf, size_t count) +qeth_dev_layer2_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; char *tmp; @@ -742,7 +742,7 @@ static DEVICE_ATTR(layer2, 0644, qeth_dev_layer2_show, qeth_dev_layer2_store); static ssize_t -qeth_dev_large_send_show(struct device *dev, char *buf) +qeth_dev_large_send_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -762,7 +762,7 @@ qeth_dev_large_send_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_large_send_store(struct device *dev, const char *buf, size_t count) +qeth_dev_large_send_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; enum qeth_large_send_types type; @@ -832,7 +832,7 @@ qeth_dev_blkt_store(struct qeth_card *card, const char *buf, size_t count, } static ssize_t -qeth_dev_blkt_total_show(struct device *dev, char *buf) +qeth_dev_blkt_total_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -841,7 +841,7 @@ qeth_dev_blkt_total_show(struct device *dev, char *buf) static ssize_t -qeth_dev_blkt_total_store(struct device *dev, const char *buf, size_t count) +qeth_dev_blkt_total_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -855,7 +855,7 @@ static DEVICE_ATTR(total, 0644, qeth_dev_blkt_total_show, qeth_dev_blkt_total_store); static ssize_t -qeth_dev_blkt_inter_show(struct device *dev, char *buf) +qeth_dev_blkt_inter_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -864,7 +864,7 @@ qeth_dev_blkt_inter_show(struct device *dev, char *buf) static ssize_t -qeth_dev_blkt_inter_store(struct device *dev, const char *buf, size_t count) +qeth_dev_blkt_inter_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -876,7 +876,7 @@ static DEVICE_ATTR(inter, 0644, qeth_dev_blkt_inter_show, qeth_dev_blkt_inter_store); static ssize_t -qeth_dev_blkt_inter_jumbo_show(struct device *dev, char *buf) +qeth_dev_blkt_inter_jumbo_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -886,7 +886,7 @@ qeth_dev_blkt_inter_jumbo_show(struct device *dev, char *buf) static ssize_t -qeth_dev_blkt_inter_jumbo_store(struct device *dev, const char *buf, size_t count) +qeth_dev_blkt_inter_jumbo_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -956,7 +956,7 @@ qeth_check_layer2(struct qeth_card *card) static ssize_t -qeth_dev_ipato_enable_show(struct device *dev, char *buf) +qeth_dev_ipato_enable_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -969,7 +969,7 @@ qeth_dev_ipato_enable_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_ipato_enable_store(struct device *dev, const char *buf, size_t count) +qeth_dev_ipato_enable_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; char *tmp; @@ -1004,7 +1004,7 @@ static QETH_DEVICE_ATTR(ipato_enable, enable, 0644, qeth_dev_ipato_enable_store); static ssize_t -qeth_dev_ipato_invert4_show(struct device *dev, char *buf) +qeth_dev_ipato_invert4_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -1018,7 +1018,7 @@ qeth_dev_ipato_invert4_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_ipato_invert4_store(struct device *dev, const char *buf, size_t count) +qeth_dev_ipato_invert4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; char *tmp; @@ -1084,7 +1084,7 @@ qeth_dev_ipato_add_show(char *buf, struct qeth_card *card, } static ssize_t -qeth_dev_ipato_add4_show(struct device *dev, char *buf) +qeth_dev_ipato_add4_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -1153,7 +1153,7 @@ qeth_dev_ipato_add_store(const char *buf, size_t count, } static ssize_t -qeth_dev_ipato_add4_store(struct device *dev, const char *buf, size_t count) +qeth_dev_ipato_add4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -1186,7 +1186,7 @@ qeth_dev_ipato_del_store(const char *buf, size_t count, } static ssize_t -qeth_dev_ipato_del4_store(struct device *dev, const char *buf, size_t count) +qeth_dev_ipato_del4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -1201,7 +1201,7 @@ static QETH_DEVICE_ATTR(ipato_del4, del4, 0200, NULL, #ifdef CONFIG_QETH_IPV6 static ssize_t -qeth_dev_ipato_invert6_show(struct device *dev, char *buf) +qeth_dev_ipato_invert6_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -1215,7 +1215,7 @@ qeth_dev_ipato_invert6_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_ipato_invert6_store(struct device *dev, const char *buf, size_t count) +qeth_dev_ipato_invert6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; char *tmp; @@ -1247,7 +1247,7 @@ static QETH_DEVICE_ATTR(ipato_invert6, invert6, 0644, static ssize_t -qeth_dev_ipato_add6_show(struct device *dev, char *buf) +qeth_dev_ipato_add6_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -1258,7 +1258,7 @@ qeth_dev_ipato_add6_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_ipato_add6_store(struct device *dev, const char *buf, size_t count) +qeth_dev_ipato_add6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -1273,7 +1273,7 @@ static QETH_DEVICE_ATTR(ipato_add6, add6, 0644, qeth_dev_ipato_add6_store); static ssize_t -qeth_dev_ipato_del6_store(struct device *dev, const char *buf, size_t count) +qeth_dev_ipato_del6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -1341,7 +1341,7 @@ qeth_dev_vipa_add_show(char *buf, struct qeth_card *card, } static ssize_t -qeth_dev_vipa_add4_show(struct device *dev, char *buf) +qeth_dev_vipa_add4_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -1381,7 +1381,7 @@ qeth_dev_vipa_add_store(const char *buf, size_t count, } static ssize_t -qeth_dev_vipa_add4_store(struct device *dev, const char *buf, size_t count) +qeth_dev_vipa_add4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -1413,7 +1413,7 @@ qeth_dev_vipa_del_store(const char *buf, size_t count, } static ssize_t -qeth_dev_vipa_del4_store(struct device *dev, const char *buf, size_t count) +qeth_dev_vipa_del4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -1428,7 +1428,7 @@ static QETH_DEVICE_ATTR(vipa_del4, del4, 0200, NULL, #ifdef CONFIG_QETH_IPV6 static ssize_t -qeth_dev_vipa_add6_show(struct device *dev, char *buf) +qeth_dev_vipa_add6_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -1439,7 +1439,7 @@ qeth_dev_vipa_add6_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_vipa_add6_store(struct device *dev, const char *buf, size_t count) +qeth_dev_vipa_add6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -1454,7 +1454,7 @@ static QETH_DEVICE_ATTR(vipa_add6, add6, 0644, qeth_dev_vipa_add6_store); static ssize_t -qeth_dev_vipa_del6_store(struct device *dev, const char *buf, size_t count) +qeth_dev_vipa_del6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -1522,7 +1522,7 @@ qeth_dev_rxip_add_show(char *buf, struct qeth_card *card, } static ssize_t -qeth_dev_rxip_add4_show(struct device *dev, char *buf) +qeth_dev_rxip_add4_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -1562,7 +1562,7 @@ qeth_dev_rxip_add_store(const char *buf, size_t count, } static ssize_t -qeth_dev_rxip_add4_store(struct device *dev, const char *buf, size_t count) +qeth_dev_rxip_add4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -1594,7 +1594,7 @@ qeth_dev_rxip_del_store(const char *buf, size_t count, } static ssize_t -qeth_dev_rxip_del4_store(struct device *dev, const char *buf, size_t count) +qeth_dev_rxip_del4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -1609,7 +1609,7 @@ static QETH_DEVICE_ATTR(rxip_del4, del4, 0200, NULL, #ifdef CONFIG_QETH_IPV6 static ssize_t -qeth_dev_rxip_add6_show(struct device *dev, char *buf) +qeth_dev_rxip_add6_show(struct device *dev, struct device_attribute *attr, char *buf) { struct qeth_card *card = dev->driver_data; @@ -1620,7 +1620,7 @@ qeth_dev_rxip_add6_show(struct device *dev, char *buf) } static ssize_t -qeth_dev_rxip_add6_store(struct device *dev, const char *buf, size_t count) +qeth_dev_rxip_add6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; @@ -1635,7 +1635,7 @@ static QETH_DEVICE_ATTR(rxip_add6, add6, 0644, qeth_dev_rxip_add6_store); static ssize_t -qeth_dev_rxip_del6_store(struct device *dev, const char *buf, size_t count) +qeth_dev_rxip_del6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev->driver_data; diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c index 1e3f7f3c662..d6469baa7e1 100644 --- a/drivers/s390/net/smsgiucv.c +++ b/drivers/s390/net/smsgiucv.c @@ -138,7 +138,7 @@ static void __exit smsg_exit(void) { if (smsg_handle > 0) { - cpcmd("SET SMSG OFF", 0, 0); + cpcmd("SET SMSG OFF", NULL, 0, NULL); iucv_sever(smsg_pathid, 0); iucv_unregister_program(smsg_handle); driver_unregister(&smsg_driver); @@ -177,7 +177,7 @@ smsg_init(void) smsg_handle = 0; return -EIO; } - cpcmd("SET SMSG IUCV", 0, 0); + cpcmd("SET SMSG IUCV", NULL, 0, NULL); return 0; } diff --git a/drivers/s390/s390mach.c b/drivers/s390/s390mach.c index ffa996c8a90..5bb255e02ac 100644 --- a/drivers/s390/s390mach.c +++ b/drivers/s390/s390mach.c @@ -31,14 +31,14 @@ extern void css_reiterate_subchannels(void); extern struct workqueue_struct *slow_path_wq; extern struct work_struct slow_path_work; -static void +static NORET_TYPE void s390_handle_damage(char *msg) { - printk(KERN_EMERG "%s\n", msg); #ifdef CONFIG_SMP smp_send_stop(); #endif disabled_wait((unsigned long) __builtin_return_address(0)); + for(;;); } /* @@ -122,40 +122,39 @@ repeat: return 0; } +struct mcck_struct { + int kill_task; + int channel_report; + int warning; + unsigned long long mcck_code; +}; + +static DEFINE_PER_CPU(struct mcck_struct, cpu_mcck); + /* - * machine check handler. + * Main machine check handler function. Will be called with interrupts enabled + * or disabled and machine checks enabled or disabled. */ void -s390_do_machine_check(void) +s390_handle_mcck(void) { - struct mci *mci; - - mci = (struct mci *) &S390_lowcore.mcck_interruption_code; + unsigned long flags; + struct mcck_struct mcck; - if (mci->sd) /* system damage */ - s390_handle_damage("received system damage machine check\n"); + /* + * Disable machine checks and get the current state of accumulated + * machine checks. Afterwards delete the old state and enable machine + * checks again. + */ + local_irq_save(flags); + local_mcck_disable(); + mcck = __get_cpu_var(cpu_mcck); + memset(&__get_cpu_var(cpu_mcck), 0, sizeof(struct mcck_struct)); + clear_thread_flag(TIF_MCCK_PENDING); + local_mcck_enable(); + local_irq_restore(flags); - if (mci->pd) /* instruction processing damage */ - s390_handle_damage("received instruction processing " - "damage machine check\n"); - - if (mci->se) /* storage error uncorrected */ - s390_handle_damage("received storage error uncorrected " - "machine check\n"); - - if (mci->sc) /* storage error corrected */ - printk(KERN_WARNING - "received storage error corrected machine check\n"); - - if (mci->ke) /* storage key-error uncorrected */ - s390_handle_damage("received storage key-error uncorrected " - "machine check\n"); - - if (mci->ds && mci->fa) /* storage degradation */ - s390_handle_damage("received storage degradation machine " - "check\n"); - - if (mci->cp) /* channel report word pending */ + if (mcck.channel_report) up(&m_sem); #ifdef CONFIG_MACHCHK_WARNING @@ -168,7 +167,7 @@ s390_do_machine_check(void) * On VM we only get one interrupt per virtally presented machinecheck. * Though one suffices, we may get one interrupt per (virtual) processor. */ - if (mci->w) { /* WARNING pending ? */ + if (mcck.warning) { /* WARNING pending ? */ static int mchchk_wng_posted = 0; /* * Use single machine clear, as we cannot handle smp right now @@ -178,6 +177,261 @@ s390_do_machine_check(void) kill_proc(1, SIGPWR, 1); } #endif + + if (mcck.kill_task) { + local_irq_enable(); + printk(KERN_EMERG "mcck: Terminating task because of machine " + "malfunction (code 0x%016llx).\n", mcck.mcck_code); + printk(KERN_EMERG "mcck: task: %s, pid: %d.\n", + current->comm, current->pid); + do_exit(SIGSEGV); + } +} + +/* + * returns 0 if all registers could be validated + * returns 1 otherwise + */ +static int +s390_revalidate_registers(struct mci *mci) +{ + int kill_task; + u64 tmpclock; + u64 zero; + void *fpt_save_area, *fpt_creg_save_area; + + kill_task = 0; + zero = 0; + /* General purpose registers */ + if (!mci->gr) + /* + * General purpose registers couldn't be restored and have + * unknown contents. Process needs to be terminated. + */ + kill_task = 1; + + /* Revalidate floating point registers */ + if (!mci->fp) + /* + * Floating point registers can't be restored and + * therefore the process needs to be terminated. + */ + kill_task = 1; + +#ifndef __s390x__ + asm volatile("ld 0,0(%0)\n" + "ld 2,8(%0)\n" + "ld 4,16(%0)\n" + "ld 6,24(%0)" + : : "a" (&S390_lowcore.floating_pt_save_area)); +#endif + + if (MACHINE_HAS_IEEE) { +#ifdef __s390x__ + fpt_save_area = &S390_lowcore.floating_pt_save_area; + fpt_creg_save_area = &S390_lowcore.fpt_creg_save_area; +#else + fpt_save_area = (void *) S390_lowcore.extended_save_area_addr; + fpt_creg_save_area = fpt_save_area+128; +#endif + /* Floating point control register */ + if (!mci->fc) { + /* + * Floating point control register can't be restored. + * Task will be terminated. + */ + asm volatile ("lfpc 0(%0)" : : "a" (&zero)); + kill_task = 1; + + } + else + asm volatile ( + "lfpc 0(%0)" + : : "a" (fpt_creg_save_area)); + + asm volatile("ld 0,0(%0)\n" + "ld 1,8(%0)\n" + "ld 2,16(%0)\n" + "ld 3,24(%0)\n" + "ld 4,32(%0)\n" + "ld 5,40(%0)\n" + "ld 6,48(%0)\n" + "ld 7,56(%0)\n" + "ld 8,64(%0)\n" + "ld 9,72(%0)\n" + "ld 10,80(%0)\n" + "ld 11,88(%0)\n" + "ld 12,96(%0)\n" + "ld 13,104(%0)\n" + "ld 14,112(%0)\n" + "ld 15,120(%0)\n" + : : "a" (fpt_save_area)); + } + + /* Revalidate access registers */ + asm volatile("lam 0,15,0(%0)" + : : "a" (&S390_lowcore.access_regs_save_area)); + if (!mci->ar) + /* + * Access registers have unknown contents. + * Terminating task. + */ + kill_task = 1; + + /* Revalidate control registers */ + if (!mci->cr) + /* + * Control registers have unknown contents. + * Can't recover and therefore stopping machine. + */ + s390_handle_damage("invalid control registers."); + else +#ifdef __s390x__ + asm volatile("lctlg 0,15,0(%0)" + : : "a" (&S390_lowcore.cregs_save_area)); +#else + asm volatile("lctl 0,15,0(%0)" + : : "a" (&S390_lowcore.cregs_save_area)); +#endif + + /* + * We don't even try to revalidate the TOD register, since we simply + * can't write something sensible into that register. + */ + +#ifdef __s390x__ + /* + * See if we can revalidate the TOD programmable register with its + * old contents (should be zero) otherwise set it to zero. + */ + if (!mci->pr) + asm volatile("sr 0,0\n" + "sckpf" + : : : "0", "cc"); + else + asm volatile( + "l 0,0(%0)\n" + "sckpf" + : : "a" (&S390_lowcore.tod_progreg_save_area) : "0", "cc"); +#endif + + /* Revalidate clock comparator register */ + asm volatile ("stck 0(%1)\n" + "sckc 0(%1)" + : "=m" (tmpclock) : "a" (&(tmpclock)) : "cc", "memory"); + + /* Check if old PSW is valid */ + if (!mci->wp) + /* + * Can't tell if we come from user or kernel mode + * -> stopping machine. + */ + s390_handle_damage("old psw invalid."); + + if (!mci->ms || !mci->pm || !mci->ia) + kill_task = 1; + + return kill_task; +} + +/* + * machine check handler. + */ +void +s390_do_machine_check(struct pt_regs *regs) +{ + struct mci *mci; + struct mcck_struct *mcck; + int umode; + + mci = (struct mci *) &S390_lowcore.mcck_interruption_code; + mcck = &__get_cpu_var(cpu_mcck); + umode = user_mode(regs); + + if (mci->sd) + /* System damage -> stopping machine */ + s390_handle_damage("received system damage machine check."); + + if (mci->pd) { + if (mci->b) { + /* Processing backup -> verify if we can survive this */ + u64 z_mcic, o_mcic, t_mcic; +#ifdef __s390x__ + z_mcic = (1ULL<<63 | 1ULL<<59 | 1ULL<<29); + o_mcic = (1ULL<<43 | 1ULL<<42 | 1ULL<<41 | 1ULL<<40 | + 1ULL<<36 | 1ULL<<35 | 1ULL<<34 | 1ULL<<32 | + 1ULL<<30 | 1ULL<<21 | 1ULL<<20 | 1ULL<<17 | + 1ULL<<16); +#else + z_mcic = (1ULL<<63 | 1ULL<<59 | 1ULL<<57 | 1ULL<<50 | + 1ULL<<29); + o_mcic = (1ULL<<43 | 1ULL<<42 | 1ULL<<41 | 1ULL<<40 | + 1ULL<<36 | 1ULL<<35 | 1ULL<<34 | 1ULL<<32 | + 1ULL<<30 | 1ULL<<20 | 1ULL<<17 | 1ULL<<16); +#endif + t_mcic = *(u64 *)mci; + + if (((t_mcic & z_mcic) != 0) || + ((t_mcic & o_mcic) != o_mcic)) { + s390_handle_damage("processing backup machine " + "check with damage."); + } + if (!umode) + s390_handle_damage("processing backup machine " + "check in kernel mode."); + mcck->kill_task = 1; + mcck->mcck_code = *(unsigned long long *) mci; + } + else { + /* Processing damage -> stopping machine */ + s390_handle_damage("received instruction processing " + "damage machine check."); + } + } + if (s390_revalidate_registers(mci)) { + if (umode) { + /* + * Couldn't restore all register contents while in + * user mode -> mark task for termination. + */ + mcck->kill_task = 1; + mcck->mcck_code = *(unsigned long long *) mci; + set_thread_flag(TIF_MCCK_PENDING); + } + else + /* + * Couldn't restore all register contents while in + * kernel mode -> stopping machine. + */ + s390_handle_damage("unable to revalidate registers."); + } + + if (mci->se) + /* Storage error uncorrected */ + s390_handle_damage("received storage error uncorrected " + "machine check."); + + if (mci->ke) + /* Storage key-error uncorrected */ + s390_handle_damage("received storage key-error uncorrected " + "machine check."); + + if (mci->ds && mci->fa) + /* Storage degradation */ + s390_handle_damage("received storage degradation machine " + "check."); + + if (mci->cp) { + /* Channel report word pending */ + mcck->channel_report = 1; + set_thread_flag(TIF_MCCK_PENDING); + } + + if (mci->w) { + /* Warning pending */ + mcck->warning = 1; + set_thread_flag(TIF_MCCK_PENDING); + } } /* @@ -189,9 +443,8 @@ static int machine_check_init(void) { init_MUTEX_LOCKED(&m_sem); - ctl_clear_bit(14, 25); /* disable damage MCH */ - ctl_set_bit(14, 26); /* enable degradation MCH */ - ctl_set_bit(14, 27); /* enable system recovery MCH */ + ctl_clear_bit(14, 25); /* disable external damage MCH */ + ctl_set_bit(14, 27); /* enable system recovery MCH */ #ifdef CONFIG_MACHCHK_WARNING ctl_set_bit(14, 24); /* enable warning MCH */ #endif diff --git a/drivers/s390/s390mach.h b/drivers/s390/s390mach.h index 7e26f0f1b0d..4eaa7017918 100644 --- a/drivers/s390/s390mach.h +++ b/drivers/s390/s390mach.h @@ -16,20 +16,45 @@ struct mci { __u32 sd : 1; /* 00 system damage */ __u32 pd : 1; /* 01 instruction-processing damage */ __u32 sr : 1; /* 02 system recovery */ - __u32 to_be_defined_1 : 4; /* 03-06 */ + __u32 to_be_defined_1 : 1; /* 03 */ + __u32 cd : 1; /* 04 timing-facility damage */ + __u32 ed : 1; /* 05 external damage */ + __u32 to_be_defined_2 : 1; /* 06 */ __u32 dg : 1; /* 07 degradation */ __u32 w : 1; /* 08 warning pending */ __u32 cp : 1; /* 09 channel-report pending */ - __u32 to_be_defined_2 : 6; /* 10-15 */ + __u32 sp : 1; /* 10 service-processor damage */ + __u32 ck : 1; /* 11 channel-subsystem damage */ + __u32 to_be_defined_3 : 2; /* 12-13 */ + __u32 b : 1; /* 14 backed up */ + __u32 to_be_defined_4 : 1; /* 15 */ __u32 se : 1; /* 16 storage error uncorrected */ __u32 sc : 1; /* 17 storage error corrected */ __u32 ke : 1; /* 18 storage-key error uncorrected */ __u32 ds : 1; /* 19 storage degradation */ - __u32 to_be_defined_3 : 4; /* 20-23 */ + __u32 wp : 1; /* 20 psw mwp validity */ + __u32 ms : 1; /* 21 psw mask and key validity */ + __u32 pm : 1; /* 22 psw program mask and cc validity */ + __u32 ia : 1; /* 23 psw instruction address validity */ __u32 fa : 1; /* 24 failing storage address validity */ - __u32 to_be_defined_4 : 7; /* 25-31 */ + __u32 to_be_defined_5 : 1; /* 25 */ + __u32 ec : 1; /* 26 external damage code validity */ + __u32 fp : 1; /* 27 floating point register validity */ + __u32 gr : 1; /* 28 general register validity */ + __u32 cr : 1; /* 29 control register validity */ + __u32 to_be_defined_6 : 1; /* 30 */ + __u32 st : 1; /* 31 storage logical validity */ __u32 ie : 1; /* 32 indirect storage error */ - __u32 to_be_defined_5 : 31; /* 33-63 */ + __u32 ar : 1; /* 33 access register validity */ + __u32 da : 1; /* 34 delayed access exception */ + __u32 to_be_defined_7 : 7; /* 35-41 */ + __u32 pr : 1; /* 42 tod programmable register validity */ + __u32 fc : 1; /* 43 fp control register validity */ + __u32 ap : 1; /* 44 ancillary report */ + __u32 to_be_defined_8 : 1; /* 45 */ + __u32 ct : 1; /* 46 cpu timer validity */ + __u32 cc : 1; /* 47 clock comparator validity */ + __u32 to_be_defined_9 : 16; /* 47-63 */ }; /* diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 6965992ddbb..b61d309352c 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c @@ -924,7 +924,7 @@ struct fc_function_template zfcp_transport_functions = { * Generates attribute for a unit. */ #define ZFCP_DEFINE_SCSI_ATTR(_name, _format, _value) \ -static ssize_t zfcp_sysfs_scsi_##_name##_show(struct device *dev, \ +static ssize_t zfcp_sysfs_scsi_##_name##_show(struct device *dev, struct device_attribute *attr, \ char *buf) \ { \ struct scsi_device *sdev; \ diff --git a/drivers/s390/scsi/zfcp_sysfs_adapter.c b/drivers/s390/scsi/zfcp_sysfs_adapter.c index 23e2dca55bb..e7345a74800 100644 --- a/drivers/s390/scsi/zfcp_sysfs_adapter.c +++ b/drivers/s390/scsi/zfcp_sysfs_adapter.c @@ -50,7 +50,7 @@ static const char fc_topologies[5][25] = { * Generates attributes for an adapter. */ #define ZFCP_DEFINE_ADAPTER_ATTR(_name, _format, _value) \ -static ssize_t zfcp_sysfs_adapter_##_name##_show(struct device *dev, \ +static ssize_t zfcp_sysfs_adapter_##_name##_show(struct device *dev, struct device_attribute *attr, \ char *buf) \ { \ struct zfcp_adapter *adapter; \ @@ -90,7 +90,7 @@ ZFCP_DEFINE_ADAPTER_ATTR(in_recovery, "%d\n", atomic_test_mask * Store function of the "port_add" attribute of an adapter. */ static ssize_t -zfcp_sysfs_port_add_store(struct device *dev, const char *buf, size_t count) +zfcp_sysfs_port_add_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { wwn_t wwpn; char *endp; @@ -135,7 +135,7 @@ static DEVICE_ATTR(port_add, S_IWUSR, NULL, zfcp_sysfs_port_add_store); * Store function of the "port_remove" attribute of an adapter. */ static ssize_t -zfcp_sysfs_port_remove_store(struct device *dev, const char *buf, size_t count) +zfcp_sysfs_port_remove_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct zfcp_adapter *adapter; struct zfcp_port *port; @@ -196,7 +196,7 @@ static DEVICE_ATTR(port_remove, S_IWUSR, NULL, zfcp_sysfs_port_remove_store); * started for the belonging adapter. */ static ssize_t -zfcp_sysfs_adapter_failed_store(struct device *dev, +zfcp_sysfs_adapter_failed_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct zfcp_adapter *adapter; @@ -236,7 +236,7 @@ zfcp_sysfs_adapter_failed_store(struct device *dev, * "0" if adapter is working, otherwise "1". */ static ssize_t -zfcp_sysfs_adapter_failed_show(struct device *dev, char *buf) +zfcp_sysfs_adapter_failed_show(struct device *dev, struct device_attribute *attr, char *buf) { struct zfcp_adapter *adapter; diff --git a/drivers/s390/scsi/zfcp_sysfs_port.c b/drivers/s390/scsi/zfcp_sysfs_port.c index 6aafb2abb4b..7a84c7d474d 100644 --- a/drivers/s390/scsi/zfcp_sysfs_port.c +++ b/drivers/s390/scsi/zfcp_sysfs_port.c @@ -53,7 +53,7 @@ zfcp_sysfs_port_release(struct device *dev) * Generates attributes for a port. */ #define ZFCP_DEFINE_PORT_ATTR(_name, _format, _value) \ -static ssize_t zfcp_sysfs_port_##_name##_show(struct device *dev, \ +static ssize_t zfcp_sysfs_port_##_name##_show(struct device *dev, struct device_attribute *attr, \ char *buf) \ { \ struct zfcp_port *port; \ @@ -82,7 +82,7 @@ ZFCP_DEFINE_PORT_ATTR(access_denied, "%d\n", atomic_test_mask * Store function of the "unit_add" attribute of a port. */ static ssize_t -zfcp_sysfs_unit_add_store(struct device *dev, const char *buf, size_t count) +zfcp_sysfs_unit_add_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { fcp_lun_t fcp_lun; char *endp; @@ -125,7 +125,7 @@ static DEVICE_ATTR(unit_add, S_IWUSR, NULL, zfcp_sysfs_unit_add_store); * @count: number of bytes in buffer */ static ssize_t -zfcp_sysfs_unit_remove_store(struct device *dev, const char *buf, size_t count) +zfcp_sysfs_unit_remove_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct zfcp_port *port; struct zfcp_unit *unit; @@ -186,7 +186,7 @@ static DEVICE_ATTR(unit_remove, S_IWUSR, NULL, zfcp_sysfs_unit_remove_store); * started for the belonging port. */ static ssize_t -zfcp_sysfs_port_failed_store(struct device *dev, const char *buf, size_t count) +zfcp_sysfs_port_failed_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct zfcp_port *port; unsigned int val; @@ -224,7 +224,7 @@ zfcp_sysfs_port_failed_store(struct device *dev, const char *buf, size_t count) * "0" if port is working, otherwise "1". */ static ssize_t -zfcp_sysfs_port_failed_show(struct device *dev, char *buf) +zfcp_sysfs_port_failed_show(struct device *dev, struct device_attribute *attr, char *buf) { struct zfcp_port *port; diff --git a/drivers/s390/scsi/zfcp_sysfs_unit.c b/drivers/s390/scsi/zfcp_sysfs_unit.c index 87c0b461831..0556642c9e1 100644 --- a/drivers/s390/scsi/zfcp_sysfs_unit.c +++ b/drivers/s390/scsi/zfcp_sysfs_unit.c @@ -53,7 +53,7 @@ zfcp_sysfs_unit_release(struct device *dev) * Generates attribute for a unit. */ #define ZFCP_DEFINE_UNIT_ATTR(_name, _format, _value) \ -static ssize_t zfcp_sysfs_unit_##_name##_show(struct device *dev, \ +static ssize_t zfcp_sysfs_unit_##_name##_show(struct device *dev, struct device_attribute *attr, \ char *buf) \ { \ struct zfcp_unit *unit; \ @@ -86,7 +86,7 @@ ZFCP_DEFINE_UNIT_ATTR(access_readonly, "%d\n", atomic_test_mask * started for the belonging unit. */ static ssize_t -zfcp_sysfs_unit_failed_store(struct device *dev, const char *buf, size_t count) +zfcp_sysfs_unit_failed_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct zfcp_unit *unit; unsigned int val; @@ -123,7 +123,7 @@ zfcp_sysfs_unit_failed_store(struct device *dev, const char *buf, size_t count) * "0" if unit is working, otherwise "1". */ static ssize_t -zfcp_sysfs_unit_failed_show(struct device *dev, char *buf) +zfcp_sysfs_unit_failed_show(struct device *dev, struct device_attribute *attr, char *buf) { struct zfcp_unit *unit; |