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 * drew@colorado.edu 8 * +1 (303) 440-4894 9 * 10 * NCR53C400 extensions (c) 1994,1995,1996, Kevin Lentin 11 * K.Lentin@cs.monash.edu.au 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.1.1 2008/10/15 03:26:52 james26_jang 31 * Initial. 32 * 33 * Revision 1.1.1.1 2008/07/21 09:15:23 james26_jang 34 * New UI, New QoS, New wireless driver(4.151.10.29), ipmonitor. 35 * 36 * Revision 1.1.1.1 2008/07/02 14:39:38 james26_jang 37 * 4.100.10.29, New QoS and New UI. 38 * 39 * Revision 1.1.1.1 2003/02/03 22:37:53 mhuang 40 * LINUX_2_4 branch snapshot from linux-mips.org CVS 41 * 42 */ 43 44#ifndef GENERIC_NCR5380_H 45#define GENERIC_NCR5380_H 46 47#include <linux/config.h> 48 49#define GENERIC_NCR5380_PUBLIC_RELEASE 1 50 51#ifdef NCR53C400 52#define BIOSPARAM 53#define NCR5380_BIOSPARAM generic_NCR5380_biosparam 54#else 55#define NCR5380_BIOSPARAM NULL 56#endif 57 58int generic_NCR5380_abort(Scsi_Cmnd *); 59int generic_NCR5380_detect(Scsi_Host_Template *); 60int generic_NCR5380_release_resources(struct Scsi_Host *); 61int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *)); 62int generic_NCR5380_reset(Scsi_Cmnd *, unsigned int); 63int notyet_generic_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int inout); 64const char *generic_NCR5380_info(struct Scsi_Host *); 65#ifdef BIOSPARAM 66int generic_NCR5380_biosparam(Disk *, kdev_t, int *); 67#endif 68 69int generic_NCR5380_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int inout); 70 71#ifndef CMD_PER_LUN 72#define CMD_PER_LUN 2 73#endif 74 75#ifndef CAN_QUEUE 76#define CAN_QUEUE 16 77#endif 78 79#define GENERIC_NCR5380 { \ 80 proc_info: generic_NCR5380_proc_info, \ 81 name: "Generic NCR5380/NCR53C400 Scsi Driver", \ 82 detect: generic_NCR5380_detect, \ 83 release: generic_NCR5380_release_resources, \ 84 info: (void *)generic_NCR5380_info, \ 85 queuecommand: generic_NCR5380_queue_command, \ 86 abort: generic_NCR5380_abort, \ 87 reset: generic_NCR5380_reset, \ 88 bios_param: NCR5380_BIOSPARAM, \ 89 can_queue: CAN_QUEUE, \ 90 this_id: 7, \ 91 sg_tablesize: SG_ALL, \ 92 cmd_per_lun: CMD_PER_LUN , \ 93 use_clustering: DISABLE_CLUSTERING} 94 95#ifndef HOSTS_C 96 97#define __STRVAL(x) #x 98#define STRVAL(x) __STRVAL(x) 99 100#ifdef CONFIG_SCSI_G_NCR5380_PORT 101#define NCR5380_map_config port 102#define NCR5380_map_type int 103#define NCR5380_map_name port 104#define NCR5380_instance_name io_port 105#define NCR53C400_register_offset 0 106#define NCR53C400_address_adjust 8 107#ifdef NCR53C400 108#define NCR5380_region_size 16 109#else 110#define NCR5380_region_size 8 111#endif 112 113#define NCR5380_read(reg) (inb(NCR5380_map_name + (reg))) 114#define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg)))) 115 116#else 117/* therefore CONFIG_SCSI_G_NCR5380_MEM */ 118 119#define NCR5380_map_config memory 120#define NCR5380_map_type unsigned long 121#define NCR5380_map_name base 122#define NCR5380_instance_name base 123#define NCR53C400_register_offset 0x108 124#define NCR53C400_address_adjust 0 125#define NCR53C400_mem_base 0x3880 126#define NCR53C400_host_buffer 0x3900 127#define NCR5380_region_size 0x3a00 128 129#define NCR5380_read(reg) isa_readb(NCR5380_map_name + NCR53C400_mem_base + (reg)) 130#define NCR5380_write(reg, value) isa_writeb(NCR5380_map_name + NCR53C400_mem_base + (reg), value) 131 132#endif 133 134#define NCR5380_implementation_fields \ 135 NCR5380_map_type NCR5380_map_name 136 137#define NCR5380_local_declare() \ 138 register NCR5380_implementation_fields 139 140#define NCR5380_setup(instance) \ 141 NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name) 142 143#define NCR5380_intr generic_NCR5380_intr 144#define do_NCR5380_intr do_generic_NCR5380_intr 145#define NCR5380_queue_command generic_NCR5380_queue_command 146#define NCR5380_abort generic_NCR5380_abort 147#define NCR5380_reset generic_NCR5380_reset 148#define NCR5380_pread generic_NCR5380_pread 149#define NCR5380_pwrite generic_NCR5380_pwrite 150#define NCR5380_proc_info notyet_generic_proc_info 151 152#define BOARD_NCR5380 0 153#define BOARD_NCR53C400 1 154#define BOARD_NCR53C400A 2 155#define BOARD_DTC3181E 3 156 157#endif /* else def HOSTS_C */ 158#endif /* GENERIC_NCR5380_H */ 159