2 * advansys.h - Linux Host Driver for AdvanSys SCSI Adapters
4 * Copyright (c) 1995-2000 Advanced System Products, Inc.
5 * Copyright (c) 2000-2001 ConnectCom Solutions, Inc.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that redistributions of source
10 * code retain the above copyright notice and this comment without
13 * As of March 8, 2000 Advanced System Products, Inc. (AdvanSys)
14 * changed its name to ConnectCom Solutions, Inc.
16 * There is an AdvanSys Linux WWW page at:
17 * http://www.connectcom.net/downloads/software/os/linux.html
18 * http://www.advansys.com/linux.html
20 * The latest released version of the AdvanSys driver is available at:
21 * ftp://ftp.advansys.com/pub/linux/linux.tgz
22 * ftp://ftp.connectcom.net/pub/linux/linux.tgz
24 * Please send questions, comments, bug reports to:
25 * linux@connectcom.net or bfrey@turbolinux.com.cn
31 #include <linux/config.h>
32 #ifndef LINUX_VERSION_CODE
33 #include <linux/version.h>
34 #endif /* LINUX_VERSION_CODE */
36 /* Convert Linux Version, Patch-level, Sub-level to LINUX_VERSION_CODE. */
37 #define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S))
38 /* Driver supported only in version 2.2 and version >= 2.4. */
39 #if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,2,0) || \
40 (LINUX_VERSION_CODE > ASC_LINUX_VERSION(2,3,0) && \
41 LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,4,0))
42 #error "AdvanSys driver supported only in 2.2 and 2.4 or greater kernels."
44 #define ASC_LINUX_KERNEL22 (LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,4,0))
45 #define ASC_LINUX_KERNEL24 (LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,4,0))
48 * Scsi_Host_Template function prototypes.
50 int advansys_detect(Scsi_Host_Template *);
51 int advansys_release(struct Scsi_Host *);
52 const char *advansys_info(struct Scsi_Host *);
53 int advansys_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *));
54 int advansys_reset(Scsi_Cmnd *);
55 int advansys_biosparam(Disk *, kdev_t, int[]);
57 #if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,3,28)
58 extern struct proc_dir_entry proc_scsi_advansys;
59 #endif /* version < v2.3.28 */
60 int advansys_proc_info(char *, char **, off_t, int, int, int);
61 #else /* !defined(CONFIG_PROC_FS) */
62 #define advansys_proc_info NULL
63 #endif /* !defined(CONFIG_PROC_FS) */
65 /* init/main.c setup function */
66 void advansys_setup(char *, int *);
69 * AdvanSys Host Driver Scsi_Host_Template (struct SHT) from hosts.h.
71 #if ASC_LINUX_KERNEL24
73 proc_name: "advansys", \
74 proc_info: advansys_proc_info, \
76 detect: advansys_detect, \
77 release: advansys_release, \
78 info: advansys_info, \
79 queuecommand: advansys_queuecommand, \
81 eh_bus_reset_handler: advansys_reset, \
82 bios_param: advansys_biosparam, \
84 * Because the driver may control an ISA adapter 'unchecked_isa_dma' \
85 * must be set. The flag will be cleared in advansys_detect for non-ISA \
86 * adapters. Refer to the comment in scsi_module.c for more information. \
88 unchecked_isa_dma: 1, \
90 * All adapters controlled by this driver are capable of large \
91 * scatter-gather lists. According to the mid-level SCSI documentation \
92 * this obviates any performance gain provided by setting \
93 * 'use_clustering'. But empirically while CPU utilization is increased \
94 * by enabling clustering, I/O throughput increases as well. \
96 use_clustering: ENABLE_CLUSTERING, \
98 #elif ASC_LINUX_KERNEL22
100 proc_info: advansys_proc_info, \
102 detect: advansys_detect, \
103 release: advansys_release, \
104 info: advansys_info, \
105 queuecommand: advansys_queuecommand, \
106 use_new_eh_code: 1, \
107 eh_bus_reset_handler: advansys_reset, \
108 bios_param: advansys_biosparam, \
110 * Because the driver may control an ISA adapter 'unchecked_isa_dma' \
111 * must be set. The flag will be cleared in advansys_detect for non-ISA \
112 * adapters. Refer to the comment in scsi_module.c for more information. \
114 unchecked_isa_dma: 1, \
116 * All adapters controlled by this driver are capable of large \
117 * scatter-gather lists. According to the mid-level SCSI documentation \
118 * this obviates any performance gain provided by setting \
119 * 'use_clustering'. But empirically while CPU utilization is increased \
120 * by enabling clustering, I/O throughput increases as well. \
122 use_clustering: ENABLE_CLUSTERING, \
125 #endif /* _ADVANSYS_H */