Annotation of Gnu-Mach/linux/src/drivers/scsi/g_NCR5380.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Generic Generic NCR5380 driver defines
                      3:  *
                      4:  * Copyright 1993, Drew Eckhardt
                      5:  *     Visionary Computing
                      6:  *     (Unix and Linux consulting and custom programming)
                      7:  *     [email protected]
                      8:  *      +1 (303) 440-4894
                      9:  *
                     10:  * NCR53C400 extensions (c) 1994,1995,1996, Kevin Lentin
                     11:  *    [email protected]
                     12:  *
                     13:  * ALPHA RELEASE 1. 
                     14:  *
                     15:  * For more information, please consult 
                     16:  *
                     17:  * NCR 5380 Family
                     18:  * SCSI Protocol Controller
                     19:  * Databook
                     20:  *
                     21:  * NCR Microelectronics
                     22:  * 1635 Aeroplaza Drive
                     23:  * Colorado Springs, CO 80916
                     24:  * 1+ (719) 578-3400
                     25:  * 1+ (800) 334-5454
                     26:  */
                     27: 
                     28: /*
                     29:  * $Log: g_NCR5380.h,v $
                     30:  * Revision 1.1  1999/04/26 05:54:34  tb
                     31:  * 1998-11-30  OKUJI Yoshinori  <[email protected]>
                     32:  *
                     33:  *     Clean up linux emulation code to make it architecture-independent
                     34:  *     as much as possible.
                     35:  *
                     36:  *     * linux: Renamed from linuxdev.
                     37:  *     * Makefile.in (objfiles): Add linux.o instead of linuxdev.o.
                     38:  *     (MAKE): New variable. Used for the linux.o target.
                     39:  *     * configure.in: Add AC_CHECK_TOOL(MAKE, make).
                     40:  *     * i386/i386/spl.h: Include <i386/ipl.h>, for compatibility with
                     41:  *     OSF Mach 3.0. Suggested by Elgin Lee <[email protected]>.
                     42:  *     * linux/src: Renamed from linux/linux.
                     43:  *     * linux/dev: Renamed from linux/mach.
                     44:  *     * linux/Drivers.in (AC_INIT): Use dev/include/linux/autoconf.h,
                     45:  *     instead of mach/include/linux/autoconf.h.
                     46:  *     * Makefile.in (all): Target ../linux.o instead of ../linuxdev.o.
                     47:  *     * linux/dev/drivers/block/genhd.c: Include <machine/spl.h> instead
                     48:  *     of <i386/ipl.h>.
                     49:  *     * linux/dev/drivers/net/auto_irq.c: Remove unneeded header files,
                     50:  *     <i386/ipl.h> and <i386/pic.h>.
                     51:  *     * linux/dev/init/main.c: Many i386-dependent codes moved to ...
                     52:  *     * linux/dev/arch/i386/irq.c: ... here.
                     53:  *     * linux/dev/arch/i386/setup.c: New file.
                     54:  *     * linux/dev/arch/i386/linux_emul.h: Likewise.
                     55:  *     * linux/dev/arch/i386/glue/timer.c: Merged into sched.c.
                     56:  *     * linux/dev/arch/i386/glue/sched.c: Include <machine/spl.h> instead
                     57:  *     of <i386/ipl.h>, and moved to ...
                     58:  *     * linux/dev/kernel/sched.c: ... here.
                     59:  *     * linux/dev/arch/i386/glue/block.c: Include <machine/spl.h> and
                     60:  *     <linux_emul.h>, instead of i386-dependent header files, and
                     61:  *     moved to ...
                     62:  *     * linux/dev/glue/blocl.c: ... here.
                     63:  *     * linux/dev/arch/i386/glue/net.c: Include <machine/spl.h> and
                     64:  *     <linux_emul.h>, instead of i386-dependent header files, and
                     65:  *     moved to ...
                     66:  *     * linux/dev/glue/net.c: ... here.
                     67:  *     * linux/dev/arch/i386/glue/misc.c: Remove `x86' and moved to ...
                     68:  *     * linux/dev/glue/misc.c: ... here.
                     69:  *     * linux/dev/arch/i386/glue/kmem.c: Moved to ...
                     70:  *     * linux/dev/glue/kmem.c: ... here.
                     71:  *
                     72:  */
                     73: 
                     74: #ifndef GENERIC_NCR5380_H
                     75: #define GENERIC_NCR5380_H
                     76: 
                     77: #include <linux/config.h>
                     78: 
                     79: #define GENERIC_NCR5380_PUBLIC_RELEASE 1
                     80: 
                     81: #ifdef NCR53C400
                     82: #define BIOSPARAM
                     83: #define NCR5380_BIOSPARAM generic_NCR5380_biosparam
                     84: #else
                     85: #define NCR5380_BIOSPARAM NULL
                     86: #endif
                     87: 
                     88: #ifndef ASM
                     89: int generic_NCR5380_abort(Scsi_Cmnd *);
                     90: int generic_NCR5380_detect(Scsi_Host_Template *);
                     91: int generic_NCR5380_release_resources(struct Scsi_Host *);
                     92: int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
                     93: int generic_NCR5380_reset(Scsi_Cmnd *, unsigned int);
                     94: int notyet_generic_proc_info (char *buffer ,char **start, off_t offset,
                     95:                      int length, int hostno, int inout);
                     96: const char* generic_NCR5380_info(struct Scsi_Host *);
                     97: #ifdef BIOSPARAM
                     98: int generic_NCR5380_biosparam(Disk *, kdev_t, int *);
                     99: #endif
                    100: 
                    101: int generic_NCR5380_proc_info(char* buffer, char** start, off_t offset, int length, int hostno, int inout);
                    102: 
                    103: #ifndef NULL
                    104: #define NULL 0
                    105: #endif
                    106: 
                    107: #ifndef CMD_PER_LUN
                    108: #define CMD_PER_LUN 2
                    109: #endif
                    110: 
                    111: #ifndef CAN_QUEUE
                    112: #define CAN_QUEUE 16
                    113: #endif
                    114: 
                    115: #if defined(HOSTS_C) || defined(MODULE)
                    116: 
                    117: #define GENERIC_NCR5380 {NULL, NULL, NULL,                             \
                    118:        generic_NCR5380_proc_info,                                      \
                    119:        "Generic NCR5380/NCR53C400 Scsi Driver",                        \
                    120:        generic_NCR5380_detect, generic_NCR5380_release_resources,      \
                    121:        (void *)generic_NCR5380_info, NULL,                             \
                    122:        generic_NCR5380_queue_command, generic_NCR5380_abort,           \
                    123:        generic_NCR5380_reset, NULL,                                    \
                    124:        NCR5380_BIOSPARAM,                                              \
                    125:        /* can queue */ CAN_QUEUE, /* id */ 7, SG_ALL,                  \
                    126:        /* cmd per lun */ CMD_PER_LUN , 0, 0, DISABLE_CLUSTERING}
                    127: 
                    128: #endif
                    129: 
                    130: #ifndef HOSTS_C
                    131: 
                    132: #define __STRVAL(x) #x
                    133: #define STRVAL(x) __STRVAL(x)
                    134: 
                    135: #ifdef CONFIG_SCSI_G_NCR5380_PORT
                    136: 
                    137: #define NCR5380_map_config port
                    138: 
                    139: #define NCR5380_map_type int
                    140: 
                    141: #define NCR5380_map_name port
                    142: 
                    143: #define NCR5380_instance_name io_port
                    144: 
                    145: #define NCR53C400_register_offset 0
                    146: 
                    147: #define NCR53C400_address_adjust 8
                    148: 
                    149: #ifdef NCR53C400
                    150: #define NCR5380_region_size 16
                    151: #else
                    152: #define NCR5380_region_size 8
                    153: #endif
                    154: 
                    155: #define NCR5380_read(reg) (inb(NCR5380_map_name + (reg)))
                    156: #define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg))))
                    157: 
                    158: #else 
                    159: /* therefore CONFIG_SCSI_G_NCR5380_MEM */
                    160: 
                    161: #define NCR5380_map_config memory
                    162: 
                    163: #define NCR5380_map_type volatile unsigned char*
                    164: 
                    165: #define NCR5380_map_name base
                    166: 
                    167: #define NCR5380_instance_name base
                    168: 
                    169: #define NCR53C400_register_offset 0x108
                    170: 
                    171: #define NCR53C400_address_adjust 0
                    172: 
                    173: #define NCR53C400_mem_base 0x3880
                    174: 
                    175: #define NCR53C400_host_buffer 0x3900
                    176: 
                    177: #define NCR5380_region_size 0x3a00
                    178: 
                    179: 
                    180: #define NCR5380_read(reg) (*(NCR5380_map_name + NCR53C400_mem_base + (reg)))
                    181: #define NCR5380_write(reg, value) (*(NCR5380_map_name + NCR53C400_mem_base + (reg)) = value)
                    182: 
                    183: #endif
                    184: 
                    185: #define NCR5380_implementation_fields \
                    186:     NCR5380_map_type NCR5380_map_name
                    187: 
                    188: #define NCR5380_local_declare() \
                    189:     register NCR5380_implementation_fields
                    190: 
                    191: #define NCR5380_setup(instance) \
                    192:     NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name)
                    193: 
                    194: #define NCR5380_intr generic_NCR5380_intr
                    195: #define NCR5380_queue_command generic_NCR5380_queue_command
                    196: #define NCR5380_abort generic_NCR5380_abort
                    197: #define NCR5380_reset generic_NCR5380_reset
                    198: #define NCR5380_pread generic_NCR5380_pread
                    199: #define NCR5380_pwrite generic_NCR5380_pwrite
                    200: #define NCR5380_proc_info notyet_generic_proc_info
                    201: 
                    202: #define BOARD_NCR5380  0
                    203: #define BOARD_NCR53C400        1
                    204: 
                    205: #endif /* else def HOSTS_C */
                    206: #endif /* ndef ASM */
                    207: #endif /* GENERIC_NCR5380_H */
                    208: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.