From: Andy P. <at...@us...> - 2002-04-11 14:31:33
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/s390 In directory usw-pr-cvs1:/tmp/cvs-serv8509/s390 Modified Files: Config.in Makefile ccwcache.c idals.c s390dyn.c s390io.c s390mach.c Log Message: synch 2.4.15 commit 52 Index: Config.in =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/s390/Config.in,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- Config.in 25 Feb 2001 23:15:14 -0000 1.1.1.2 +++ Config.in 11 Apr 2002 12:55:53 -0000 1.2 @@ -7,19 +7,28 @@ if [ "$CONFIG_BLK_DEV_RAM" = "y" -o "$CONFIG_BLK_DEV_RAM" = "m" ]; then int ' Default RAM disk size' CONFIG_BLK_DEV_RAM_SIZE 24576 fi -dep_bool ' Initial RAM disk (initrd) support' CONFIG_BLK_DEV_INITRD +dep_bool ' Initial RAM disk (initrd) support' CONFIG_BLK_DEV_INITRD $CONFIG_BLK_DEV_RAM tristate 'XPRAM disk support' CONFIG_BLK_DEV_XPRAM comment 'S/390 block device drivers' tristate 'Support for DASD devices' CONFIG_DASD if [ "$CONFIG_DASD" != "n" ]; then - bool ' Support for ECKD Disks' CONFIG_DASD_ECKD - bool ' Support for FBA Disks' CONFIG_DASD_FBA -# bool ' Support for CKD Disks' CONFIG_DASD_CKD - if [ "$CONFIG_ARCH_S390" = "y" ]; then - bool ' Support for DIAG access to CMS reserved Disks' CONFIG_DASD_MDSK + dep_tristate ' Support for ECKD Disks' CONFIG_DASD_ECKD $CONFIG_DASD + if [ "$CONFIG_DASD_ECKD" = "m" ]; then + bool ' Automatic activation of ECKD module' CONFIG_DASD_AUTO_ECKD fi; + dep_tristate ' Support for FBA Disks' CONFIG_DASD_FBA $CONFIG_DASD + if [ "$CONFIG_DASD_FBA" = "m" ]; then + bool ' Automatic activation of FBA module' CONFIG_DASD_AUTO_FBA + fi; +# dep_tristate ' Support for CKD Disks' CONFIG_DASD_CKD $CONFIG_DASD + if [ "$CONFIG_ARCH_S390X" != "y" ]; then + dep_tristate ' Support for DIAG access to CMS reserved Disks' CONFIG_DASD_DIAG $CONFIG_DASD + if [ "$CONFIG_DASD_DIAG" = "m" ]; then + bool ' Automatic activation of DIAG module' CONFIG_DASD_AUTO_DIAG + fi; + fi; fi endmenu @@ -35,13 +44,18 @@ comment 'S/390 character device drivers' -bool 'Support for 3215 line mode terminal' CONFIG_3215 -if [ "$CONFIG_3215" = "y" ]; then - bool 'Support for console on 3215 line mode terminal' CONFIG_3215_CONSOLE +tristate 'Support for locally attached 3270 tubes' CONFIG_TN3270 +if [ "$CONFIG_TN3270" = "y" ]; then + bool 'Support for console on 3270 line mode terminal' CONFIG_TN3270_CONSOLE +fi +bool 'Support for 3215 line mode terminal' CONFIG_TN3215 +if [ "$CONFIG_TN3215" = "y" ]; then + bool 'Support for console on 3215 line mode terminal' CONFIG_TN3215_CONSOLE fi bool 'Support for HWC line mode terminal' CONFIG_HWC if [ "$CONFIG_HWC" = "y" ]; then - bool 'console on HWC line mode terminal' CONFIG_HWC_CONSOLE + bool ' console on HWC line mode terminal' CONFIG_HWC_CONSOLE + tristate ' Control-Program Identification' CONFIG_HWC_CPI fi tristate 'S/390 tape device support' CONFIG_S390_TAPE if [ "$CONFIG_S390_TAPE" != "n" ]; then @@ -61,11 +75,18 @@ if [ "$CONFIG_NETDEVICES" = "y" ]; then tristate 'Dummy net driver support' CONFIG_DUMMY + tristate 'Bonding driver support' CONFIG_BONDING + tristate 'EQL (serial line load balancing) support' CONFIG_EQUALIZER + tristate 'Universal TUN/TAP device driver support' CONFIG_TUN bool 'Ethernet (10 or 100Mbit)' CONFIG_NET_ETHERNET bool 'Token Ring driver support' CONFIG_TR bool 'FDDI driver support' CONFIG_FDDI comment 'S/390 network device drivers' - bool 'Channel Device Configuration (Temporary Option)' CONFIG_CHANDEV + bool 'Channel Device Configuration' CONFIG_CHANDEV + if [ "$CONFIG_CHANDEV" = "y" ]; then + define_bool CONFIG_HOTPLUG y + fi + tristate 'CTC device support' CONFIG_CTC tristate 'IUCV device support (VM only)' CONFIG_IUCV fi Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/s390/Makefile,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- Makefile 25 Feb 2001 23:15:14 -0000 1.1.1.2 +++ Makefile 11 Apr 2002 12:55:53 -0000 1.2 @@ -1,39 +1,15 @@ # -# Makefile for the linux i386-specific parts of the memory manager. +# Makefile for the S/390 specific device drivers # -# Note! Dependencies are done automagically by 'make dep', which also -# removes any old dependencies. DON'T put your own dependencies here -# unless it's something special (ie not a .c file). -# -# Note 2! The CFLAGS definition is now in the main makefile... - -all: io.o -CFLAGS += O_TARGET := io.o -obj-y := s390io.o s390mach.o s390dyn.o idals.o ccwcache.o - subdir-y := block char misc net subdir-m := $(subdir-y) -obj-y += block/s390-block.o \ - char/s390-char.o \ - misc/s390-misc.o \ - net/s390-net.o - -io.o: $(obj-y) - -block/s390-block.o: dummy - $(MAKE) -C block - -char/s390-char.o: dummy - $(MAKE) -C char - -misc/s390-misc.o: dummy - $(MAKE) -C misc +obj-y := s390io.o s390mach.o s390dyn.o idals.o ccwcache.o +export-objs += ccwcache.o idals.o s390dyn.o s390io.o -net/s390-net.o: dummy - $(MAKE) -C net +obj-y += $(foreach dir,$(subdir-y),$(dir)/s390-$(dir).o) include $(TOPDIR)/Rules.make Index: ccwcache.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/s390/ccwcache.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ccwcache.c 25 Feb 2001 23:15:14 -0000 1.1.1.1 +++ ccwcache.c 11 Apr 2002 12:55:53 -0000 1.2 @@ -9,7 +9,8 @@ * 11/14/00 redesign by Martin Schwidefsky */ -#include <linux/malloc.h> +#include <linux/module.h> +#include <linux/slab.h> #include <linux/version.h> #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,3,98)) @@ -31,9 +32,7 @@ #define kmem_cache_destroy(x) do {} while(0) #endif -#ifdef PRINTK_HEADER #undef PRINTK_HEADER -#endif #define PRINTK_HEADER "ccwcache" /* pointer to list of allocated requests */ @@ -300,4 +299,7 @@ } debug_unregister( debug_area ); } + +EXPORT_SYMBOL(ccw_alloc_request); +EXPORT_SYMBOL(ccw_free_request); Index: idals.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/s390/idals.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- idals.c 25 Feb 2001 23:15:14 -0000 1.1.1.1 +++ idals.c 11 Apr 2002 12:55:53 -0000 1.2 @@ -9,39 +9,35 @@ * 12/13/00 changed IDALs to 4kByte-IDALs */ +#include <linux/module.h> #include <linux/config.h> -#include <linux/malloc.h> +#include <linux/slab.h> #include <asm/irq.h> #include <asm/idals.h> #ifdef CONFIG_ARCH_S390X -void -set_normalized_cda ( ccw1_t * cp, unsigned long address ) + +unsigned long __create_idal (unsigned long address, int count) { int nridaws; - idaw_t *idal; - int count = cp->count; + unsigned long *idal, *tmp; - if (cp->flags & CCW_FLAG_IDA) - BUG(); - if (((address + count) >> 31) == 0) { /* do we really need '+count'? */ - cp -> cda = address; - return; - } - nridaws = ((address & 4095L) + count + 4095L) >> 12; + nridaws = ((address & (IDA_BLOCK_SIZE-1)) + count + + (IDA_BLOCK_SIZE-1)) >> IDA_SIZE_LOG; idal = idal_alloc(nridaws); - if ( idal == NULL ) { - /* probably we should have a fallback here */ - panic ("Cannot allocate memory for IDAL\n"); + if (idal != NULL) { + tmp = idal; + *tmp++ = address; + address &= -IDA_BLOCK_SIZE; + while (--nridaws > 0) { + address += IDA_BLOCK_SIZE; + *tmp++ = address; + } } - cp->flags |= CCW_FLAG_IDA; - cp->cda = (__u32)(unsigned long)(idaw_t *)idal; - do { - *idal++ = address; - address = (address & -4096L) + 4096; - nridaws --; - } while ( nridaws > 0 ); - return; + return (unsigned long) idal; } + +EXPORT_SYMBOL (__create_idal); + #endif Index: s390dyn.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/s390/s390dyn.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- s390dyn.c 25 Feb 2001 23:15:14 -0000 1.1.1.1 +++ s390dyn.c 11 Apr 2002 12:55:53 -0000 1.2 @@ -7,6 +7,7 @@ * Author(s): Ingo Adlung (ad...@de...) */ +#include <linux/module.h> #include <linux/init.h> #include <linux/smp_lock.h> @@ -14,200 +15,140 @@ #include <asm/s390io.h> #include <asm/s390dyn.h> -static devreg_t *devreg_anchor = NULL; -static spinlock_t dyn_lock = SPIN_LOCK_UNLOCKED; +static struct list_head devreg_anchor = LIST_HEAD_INIT(devreg_anchor); +static spinlock_t dyn_lock = SPIN_LOCK_UNLOCKED; - -int s390_device_register( devreg_t *drinfo ) +static inline int s390_device_register_internal(devreg_t *drinfo) { - unsigned long flags; - int pdevflag,drflag; - - int ret = 0; - devreg_t *pdevreg = devreg_anchor; - - if ( drinfo == NULL ) - return( -EINVAL ); - - drflag = drinfo->flag; - - if ( (drflag & DEVREG_TYPE_DEVNO) == (drflag & DEVREG_TYPE_DEVCHARS) ) - return( -EINVAL ); - - spin_lock_irqsave( &dyn_lock, flags ); - - while ( (pdevreg != NULL) && (ret ==0) ) - { - if ( pdevreg == drinfo ) - { - ret = -EINVAL; - } - else - { - pdevflag = pdevreg->flag; - - /* - * we don't allow multiple drivers to register - * for the same device number - */ - if ( ( (pdevflag & DEVREG_TYPE_DEVNO) - && (pdevreg->ci.devno ) ) - && ( (drflag & DEVREG_TYPE_DEVNO ) - && (drinfo->ci.devno ) ) ) - { - ret = -EBUSY; - } - else if ( drflag == ( DEVREG_TYPE_DEVCHARS - | DEVREG_EXACT_MATCH )) - { - if ( !memcmp(&drinfo->ci.hc, - &pdevreg->ci.hc, - sizeof(devreg_hc_t))) - ret=-EBUSY; - } /* endif */ + struct list_head *p; - } /* endif */ - - pdevreg = pdevreg->next; + list_for_each(p, &devreg_anchor) { + devreg_t *pdevreg = list_entry(p, devreg_t, list); + + if (pdevreg == drinfo) + return -EINVAL; + /* + * We don't allow multiple drivers to register + * for the same device number + */ + if (pdevreg->ci.devno == drinfo->ci.devno && + (pdevreg->flag & DEVREG_TYPE_DEVNO) && + (drinfo->flag & DEVREG_TYPE_DEVNO)) + return -EBUSY; + + if (drinfo->flag == (DEVREG_TYPE_DEVCHARS | + DEVREG_EXACT_MATCH) && + !memcmp(&drinfo->ci.hc, &pdevreg->ci.hc, + sizeof(devreg_hc_t))) + return -EBUSY; + } + + /* + * no collision found, enqueue + */ + list_add (&drinfo->list, &devreg_anchor); - } /* endwhile */ - - /* - * only enqueue if no collision was found ... - */ - if(ret==0) - { - drinfo->next = devreg_anchor; - drinfo->prev = NULL; - - if ( devreg_anchor != NULL ) - { - devreg_anchor->prev = drinfo; + return 0; +} - } /* endif */ - - devreg_anchor=drinfo; +int s390_device_register( devreg_t *drinfo ) +{ + unsigned long flags; + int ret; - } /* endif */ + if (drinfo == NULL || + !(drinfo->flag & (DEVREG_TYPE_DEVNO | DEVREG_TYPE_DEVCHARS))) + return -EINVAL; + spin_lock_irqsave (&dyn_lock, flags); + ret = s390_device_register_internal(drinfo); spin_unlock_irqrestore( &dyn_lock, flags ); - return( ret); + return ret; } - -int s390_device_unregister( devreg_t *dreg ) +static inline int s390_device_unregister_internal(devreg_t *dreg) { - unsigned long flags; - - int ret = -EINVAL; - devreg_t *pdevreg = devreg_anchor; + struct list_head *p; - if ( dreg == NULL ) - return( -EINVAL ); + list_for_each(p, &devreg_anchor) { + devreg_t *pdevreg = list_entry(p, devreg_t, list); - spin_lock_irqsave( &dyn_lock, flags ); - - while ( (pdevreg != NULL ) - && ( ret != 0 ) ) - { - if ( pdevreg == dreg ) - { - devreg_t *dprev = pdevreg->prev; - devreg_t *dnext = pdevreg->next; - - if ( (dprev != NULL) && (dnext != NULL) ) - { - dnext->prev = dprev; - dprev->next = dnext; - } - if ( (dprev != NULL) && (dnext == NULL) ) - { - dprev->next = NULL; - } - if ( (dprev == NULL) && (dnext != NULL) ) - { - dnext->prev = NULL; - - } /* else */ - - ret = 0; + if (pdevreg == dreg) { + list_del (&dreg->list); + return 0; } - else - { - pdevreg = pdevreg->next; + } + return -EINVAL; +} - } /* endif */ +int s390_device_unregister(devreg_t *dreg) +{ + unsigned long flags; + int ret; - } /* endwhile */ + if (dreg == NULL) + return -EINVAL; - spin_unlock_irqrestore( &dyn_lock, flags ); + spin_lock_irqsave(&dyn_lock, flags); + ret = s390_device_unregister_internal(dreg); + spin_unlock_irqrestore(&dyn_lock, flags); - return( ret); + return ret; } +static inline devreg_t *s390_search_devreg_internal(ioinfo_t *ioinfo) +{ + struct list_head *p; + + list_for_each(p, &devreg_anchor) { + devreg_t *pdevreg = list_entry(p, devreg_t, list); + senseid_t *sid; + int flag; + + flag = pdevreg->flag; + sid = &ioinfo->senseid; + if (flag & DEVREG_TYPE_DEVNO) { + if (ioinfo->ui.flags.dval != 1 || + ioinfo->devno != pdevreg->ci.devno) + continue; + } else if (flag & DEVREG_TYPE_DEVCHARS) { + if ( (flag & DEVREG_MATCH_CU_TYPE) && + pdevreg->ci.hc.ctype != sid->cu_type ) + continue; + if ( (flag & DEVREG_MATCH_CU_MODEL) && + pdevreg->ci.hc.cmode != sid->cu_model ) + continue; + if ( (flag & DEVREG_MATCH_DEV_TYPE) && + pdevreg->ci.hc.dtype != sid->dev_type ) + continue; + if ( (flag & DEVREG_MATCH_DEV_MODEL) && + pdevreg->ci.hc.dmode != sid->dev_model ) + continue; + } else { + continue; + } + + return pdevreg; + } + return NULL; +} devreg_t * s390_search_devreg( ioinfo_t *ioinfo ) { unsigned long flags; - devreg_hc_t match; - devreg_t *pdevreg = devreg_anchor; - - if ( ioinfo == NULL ) - return( NULL ); - - spin_lock_irqsave( &dyn_lock, flags ); + devreg_t *pdevreg; - while ( pdevreg != NULL ) - { - int flag = pdevreg->flag; - - if ( (flag & DEVREG_TYPE_DEVNO ) - && (ioinfo->ui.flags.dval == 1 ) - && (ioinfo->devno == pdevreg->ci.devno) ) - { - break; - } - else if (flag & DEVREG_TYPE_DEVCHARS ) - { - if ( flag & DEVREG_EXACT_MATCH ) - { - if ( !memcmp( &pdevreg->ci.hc, - &ioinfo->senseid.cu_type, - sizeof(devreg_hc_t))) - break; - } - else - { - memcpy( &match, &ioinfo->senseid.cu_type, - sizeof(match)); - - if( flag & DEVREG_NO_CU_INFO ) - { - match.ctype = pdevreg->ci.hc.ctype; - match.cmode = pdevreg->ci.hc.cmode; - } - if( flag & DEVREG_NO_DEV_INFO ) - { - match.dtype = pdevreg->ci.hc.dtype; - match.dmode = pdevreg->ci.hc.dmode; - } - if ( flag & DEVREG_MATCH_CU_TYPE ) - match.cmode = pdevreg->ci.hc.cmode; - if( flag & DEVREG_MATCH_DEV_TYPE) - match.dmode = pdevreg->ci.hc.dmode; - if ( !memcmp( &pdevreg->ci.hc, - &match, sizeof(match))) - break; - } /* endif */ - } /* endif */ + if (ioinfo == NULL) + return NULL; - pdevreg = pdevreg->next; - - } /* endwhile */ - - spin_unlock_irqrestore( &dyn_lock, flags ); + spin_lock_irqsave(&dyn_lock, flags); + pdevreg = s390_search_devreg_internal(ioinfo); + spin_unlock_irqrestore(&dyn_lock, flags); - return( pdevreg); + return pdevreg; } + +EXPORT_SYMBOL(s390_device_register); +EXPORT_SYMBOL(s390_device_unregister); Index: s390io.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/s390/s390io.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- s390io.c 25 Feb 2001 23:15:14 -0000 1.1.1.1 +++ s390io.c 11 Apr 2002 12:55:53 -0000 1.2 @@ -1,29 +1,48 @@ /* - * arch/s390/kernel/s390io.c + * drivers/s390/s390io.c * S/390 common I/O routines * * S390 version * Copyright (C) 1999, 2000 IBM Deutschland Entwicklung GmbH, * IBM Corporation * Author(s): Ingo Adlung (ad...@de...) - * ChangeLog: 01/04/2001 Holger Smolinski (smo...@de...) + * ChangeLog: 01/07/2001 Blacklist cleanup (djb...@de...,bar...@ya...) [...5290 lines suppressed...] +} + + +EXPORT_SYMBOL(halt_IO); +EXPORT_SYMBOL(clear_IO); +EXPORT_SYMBOL(do_IO); +EXPORT_SYMBOL(resume_IO); +EXPORT_SYMBOL(ioinfo); +EXPORT_SYMBOL(get_dev_info_by_irq); +EXPORT_SYMBOL(get_dev_info_by_devno); +EXPORT_SYMBOL(get_irq_by_devno); +EXPORT_SYMBOL(get_devno_by_irq); +EXPORT_SYMBOL(get_irq_first); +EXPORT_SYMBOL(get_irq_next); +EXPORT_SYMBOL(read_conf_data); +EXPORT_SYMBOL(read_dev_chars); +EXPORT_SYMBOL(s390_request_irq_special); +EXPORT_SYMBOL(s390_get_schib); +EXPORT_SYMBOL(s390_register_adapter_interrupt); +EXPORT_SYMBOL(s390_unregister_adapter_interrupt); Index: s390mach.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/s390/s390mach.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- s390mach.c 25 Feb 2001 23:15:14 -0000 1.1.1.1 +++ s390mach.c 11 Apr 2002 12:55:53 -0000 1.2 @@ -11,7 +11,7 @@ #include <linux/config.h> #include <linux/spinlock.h> #include <linux/init.h> -#include <linux/malloc.h> +#include <linux/slab.h> #ifdef CONFIG_SMP #include <linux/smp.h> #endif @@ -139,7 +139,7 @@ #endif memcpy( &mcic, - &S390_lowcore.mcck_interuption_code, + &S390_lowcore.mcck_interruption_code, sizeof(__u64)); if ( mcic.mcc.mcd.cp ) // CRW pending ? @@ -170,7 +170,7 @@ static int s390_machine_check_handler( void *parm) { struct semaphore *sem = parm; - int flags; + unsigned long flags; mache_t *pmache; int found = 0; |