aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/gdth.c396
-rw-r--r--drivers/scsi/gdth.h1
-rw-r--r--drivers/scsi/gdth_kcompat.h31
-rw-r--r--drivers/scsi/gdth_proc.c27
4 files changed, 2 insertions, 453 deletions
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index 9e4dd48899b6..a3b0190028f6 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -27,280 +27,8 @@
27 * along with this kernel; if not, write to the Free Software * 27 * along with this kernel; if not, write to the Free Software *
28 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 28 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
29 * * 29 * *
30 * Linux kernel 2.4.x, 2.6.x supported * 30 * Linux kernel 2.6.x supported *
31 * * 31 * *
32 * $Log: gdth.c,v $
33 * Revision 1.74 2006/04/10 13:44:47 achim
34 * Community changes for 2.6.x
35 * Kernel 2.2.x no longer supported
36 * scsi_request interface removed, thanks to Christoph Hellwig
37 *
38 * Revision 1.73 2004/03/31 13:33:03 achim
39 * Special command 0xfd implemented to detect 64-bit DMA support
40 *
41 * Revision 1.72 2004/03/17 08:56:04 achim
42 * 64-bit DMA only enabled if FW >= x.43
43 *
44 * Revision 1.71 2004/03/05 15:51:29 achim
45 * Screen service: separate message buffer, bugfixes
46 *
47 * Revision 1.70 2004/02/27 12:19:07 achim
48 * Bugfix: Reset bit in config (0xfe) call removed
49 *
50 * Revision 1.69 2004/02/20 09:50:24 achim
51 * Compatibility changes for kernels < 2.4.20
52 * Bugfix screen service command size
53 * pci_set_dma_mask() error handling added
54 *
55 * Revision 1.68 2004/02/19 15:46:54 achim
56 * 64-bit DMA bugfixes
57 * Drive size bugfix for drives > 1TB
58 *
59 * Revision 1.67 2004/01/14 13:11:57 achim
60 * Tool access over /proc no longer supported
61 * Bugfixes IOCTLs
62 *
63 * Revision 1.66 2003/12/19 15:04:06 achim
64 * Bugfixes support for drives > 2TB
65 *
66 * Revision 1.65 2003/12/15 11:21:56 achim
67 * 64-bit DMA support added
68 * Support for drives > 2 TB implemented
69 * Kernels 2.2.x, 2.4.x, 2.6.x supported
70 *
71 * Revision 1.64 2003/09/17 08:30:26 achim
72 * EISA/ISA controller scan disabled
73 * Command line switch probe_eisa_isa added
74 *
75 * Revision 1.63 2003/07/12 14:01:00 Daniele Bellucci <bellucda@tiscali.it>
76 * Minor cleanups in gdth_ioctl.
77 *
78 * Revision 1.62 2003/02/27 15:01:59 achim
79 * Dynamic DMA mapping implemented
80 * New (character device) IOCTL interface added
81 * Other controller related changes made
82 *
83 * Revision 1.61 2002/11/08 13:09:52 boji
84 * Added support for XSCALE based RAID Controllers
85 * Fixed SCREENSERVICE initialization in SMP cases
86 * Added checks for gdth_polling before GDTH_HA_LOCK
87 *
88 * Revision 1.60 2002/02/05 09:35:22 achim
89 * MODULE_LICENSE only if kernel >= 2.4.11
90 *
91 * Revision 1.59 2002/01/30 09:46:33 achim
92 * Small changes
93 *
94 * Revision 1.58 2002/01/29 15:30:02 achim
95 * Set default value of shared_access to Y
96 * New status S_CACHE_RESERV for clustering added
97 *
98 * Revision 1.57 2001/08/21 11:16:35 achim
99 * Bugfix free_irq()
100 *
101 * Revision 1.56 2001/08/09 11:19:39 achim
102 * Scsi_Host_Template changes
103 *
104 * Revision 1.55 2001/08/09 10:11:28 achim
105 * Command HOST_UNFREEZE_IO before cache service init.
106 *
107 * Revision 1.54 2001/07/20 13:48:12 achim
108 * Expand: gdth_analyse_hdrive() removed
109 *
110 * Revision 1.53 2001/07/17 09:52:49 achim
111 * Small OEM related change
112 *
113 * Revision 1.52 2001/06/19 15:06:20 achim
114 * New host command GDT_UNFREEZE_IO added
115 *
116 * Revision 1.51 2001/05/22 06:42:37 achim
117 * PCI: Subdevice ID added
118 *
119 * Revision 1.50 2001/05/17 13:42:16 achim
120 * Support for Intel Storage RAID Controllers added
121 *
122 * Revision 1.50 2001/05/17 12:12:34 achim
123 * Support for Intel Storage RAID Controllers added
124 *
125 * Revision 1.49 2001/03/15 15:07:17 achim
126 * New __setup interface for boot command line options added
127 *
128 * Revision 1.48 2001/02/06 12:36:28 achim
129 * Bugfix Cluster protocol
130 *
131 * Revision 1.47 2001/01/10 14:42:06 achim
132 * New switch shared_access added
133 *
134 * Revision 1.46 2001/01/09 08:11:35 achim
135 * gdth_command() removed
136 * meaning of Scsi_Pointer members changed
137 *
138 * Revision 1.45 2000/11/16 12:02:24 achim
139 * Changes for kernel 2.4
140 *
141 * Revision 1.44 2000/10/11 08:44:10 achim
142 * Clustering changes: New flag media_changed added
143 *
144 * Revision 1.43 2000/09/20 12:59:01 achim
145 * DPMEM remap functions for all PCI controller types implemented
146 * Small changes for ia64 platform
147 *
148 * Revision 1.42 2000/07/20 09:04:50 achim
149 * Small changes for kernel 2.4
150 *
151 * Revision 1.41 2000/07/04 14:11:11 achim
152 * gdth_analyse_hdrive() added to rescan drives after online expansion
153 *
154 * Revision 1.40 2000/06/27 11:24:16 achim
155 * Changes Clustering, Screenservice
156 *
157 * Revision 1.39 2000/06/15 13:09:04 achim
158 * Changes for gdth_do_cmd()
159 *
160 * Revision 1.38 2000/06/15 12:08:43 achim
161 * Bugfix gdth_sync_event(), service SCREENSERVICE
162 * Data direction for command 0xc2 changed to DOU
163 *
164 * Revision 1.37 2000/05/25 13:50:10 achim
165 * New driver parameter virt_ctr added
166 *
167 * Revision 1.36 2000/05/04 08:50:46 achim
168 * Event buffer now in gdth_ha_str
169 *
170 * Revision 1.35 2000/03/03 10:44:08 achim
171 * New event_string only valid for the RP controller family
172 *
173 * Revision 1.34 2000/03/02 14:55:29 achim
174 * New mechanism for async. event handling implemented
175 *
176 * Revision 1.33 2000/02/21 15:37:37 achim
177 * Bugfix Alpha platform + DPMEM above 4GB
178 *
179 * Revision 1.32 2000/02/14 16:17:37 achim
180 * Bugfix sense_buffer[] + raw devices
181 *
182 * Revision 1.31 2000/02/10 10:29:00 achim
183 * Delete sense_buffer[0], if command OK
184 *
185 * Revision 1.30 1999/11/02 13:42:39 achim
186 * ARRAY_DRV_LIST2 implemented
187 * Now 255 log. and 100 host drives supported
188 *
189 * Revision 1.29 1999/10/05 13:28:47 achim
190 * GDT_CLUST_RESET added
191 *
192 * Revision 1.28 1999/08/12 13:44:54 achim
193 * MOUNTALL removed
194 * Cluster drives -> removeable drives
195 *
196 * Revision 1.27 1999/06/22 07:22:38 achim
197 * Small changes
198 *
199 * Revision 1.26 1999/06/10 16:09:12 achim
200 * Cluster Host Drive support: Bugfixes
201 *
202 * Revision 1.25 1999/06/01 16:03:56 achim
203 * gdth_init_pci(): Manipulate config. space to start RP controller
204 *
205 * Revision 1.24 1999/05/26 11:53:06 achim
206 * Cluster Host Drive support added
207 *
208 * Revision 1.23 1999/03/26 09:12:31 achim
209 * Default value for hdr_channel set to 0
210 *
211 * Revision 1.22 1999/03/22 16:27:16 achim
212 * Bugfix: gdth_store_event() must not be locked with GDTH_LOCK_HA()
213 *
214 * Revision 1.21 1999/03/16 13:40:34 achim
215 * Problems with reserved drives solved
216 * gdth_eh_bus_reset() implemented
217 *
218 * Revision 1.20 1999/03/10 09:08:13 achim
219 * Bugfix: Corrections in gdth_direction_tab[] made
220 * Bugfix: Increase command timeout (gdth_update_timeout()) NOT in gdth_putq()
221 *
222 * Revision 1.19 1999/03/05 14:38:16 achim
223 * Bugfix: Heads/Sectors mapping for reserved devices possibly wrong
224 * -> gdth_eval_mapping() implemented, changes in gdth_bios_param()
225 * INIT_RETRIES set to 100s to avoid DEINIT-Timeout for controllers
226 * with BIOS disabled and memory test set to Intensive
227 * Enhanced /proc support
228 *
229 * Revision 1.18 1999/02/24 09:54:33 achim
230 * Command line parameter hdr_channel implemented
231 * Bugfix for EISA controllers + Linux 2.2.x
232 *
233 * Revision 1.17 1998/12/17 15:58:11 achim
234 * Command line parameters implemented
235 * Changes for Alpha platforms
236 * PCI controller scan changed
237 * SMP support improved (spin_lock_irqsave(),...)
238 * New async. events, new scan/reserve commands included
239 *
240 * Revision 1.16 1998/09/28 16:08:46 achim
241 * GDT_PCIMPR: DPMEM remapping, if required
242 * mdelay() added
243 *
244 * Revision 1.15 1998/06/03 14:54:06 achim
245 * gdth_delay(), gdth_flush() implemented
246 * Bugfix: gdth_release() changed
247 *
248 * Revision 1.14 1998/05/22 10:01:17 achim
249 * mj: pcibios_strerror() removed
250 * Improved SMP support (if version >= 2.1.95)
251 * gdth_halt(): halt_called flag added (if version < 2.1)
252 *
253 * Revision 1.13 1998/04/16 09:14:57 achim
254 * Reserve drives (for raw service) implemented
255 * New error handling code enabled
256 * Get controller name from board_info() IOCTL
257 * Final round of PCI device driver patches by Martin Mares
258 *
259 * Revision 1.12 1998/03/03 09:32:37 achim
260 * Fibre channel controller support added
261 *
262 * Revision 1.11 1998/01/27 16:19:14 achim
263 * SA_SHIRQ added
264 * add_timer()/del_timer() instead of GDTH_TIMER
265 * scsi_add_timer()/scsi_del_timer() instead of SCSI_TIMER
266 * New error handling included
267 *
268 * Revision 1.10 1997/10/31 12:29:57 achim
269 * Read heads/sectors from host drive
270 *
271 * Revision 1.9 1997/09/04 10:07:25 achim
272 * IO-mapping with virt_to_bus(), gdth_readb(), gdth_writeb(), ...
273 * register_reboot_notifier() to get a notify on shutown used
274 *
275 * Revision 1.8 1997/04/02 12:14:30 achim
276 * Version 1.00 (see gdth.h), tested with kernel 2.0.29
277 *
278 * Revision 1.7 1997/03/12 13:33:37 achim
279 * gdth_reset() changed, new async. events
280 *
281 * Revision 1.6 1997/03/04 14:01:11 achim
282 * Shutdown routine gdth_halt() implemented
283 *
284 * Revision 1.5 1997/02/21 09:08:36 achim
285 * New controller included (RP, RP1, RP2 series)
286 * IOCTL interface implemented
287 *
288 * Revision 1.4 1996/07/05 12:48:55 achim
289 * Function gdth_bios_param() implemented
290 * New constant GDTH_MAXC_P_L inserted
291 * GDT_WRITE_THR, GDT_EXT_INFO implemented
292 * Function gdth_reset() changed
293 *
294 * Revision 1.3 1996/05/10 09:04:41 achim
295 * Small changes for Linux 1.2.13
296 *
297 * Revision 1.2 1996/05/09 12:45:27 achim
298 * Loadable module support implemented
299 * /proc support corrections made
300 *
301 * Revision 1.1 1996/04/11 07:35:57 achim
302 * Initial revision
303 *
304 ************************************************************************/ 32 ************************************************************************/
305 33
306/* All GDT Disk Array Controllers are fully supported by this driver. 34/* All GDT Disk Array Controllers are fully supported by this driver.
@@ -392,12 +120,7 @@
392#include <linux/proc_fs.h> 120#include <linux/proc_fs.h>
393#include <linux/time.h> 121#include <linux/time.h>
394#include <linux/timer.h> 122#include <linux/timer.h>
395#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,6)
396#include <linux/dma-mapping.h> 123#include <linux/dma-mapping.h>
397#else
398#define DMA_32BIT_MASK 0x00000000ffffffffULL
399#define DMA_64BIT_MASK 0xffffffffffffffffULL
400#endif
401 124
402#ifdef GDTH_RTC 125#ifdef GDTH_RTC
403#include <linux/mc146818rtc.h> 126#include <linux/mc146818rtc.h>
@@ -409,16 +132,10 @@
409#include <asm/io.h> 132#include <asm/io.h>
410#include <asm/uaccess.h> 133#include <asm/uaccess.h>
411#include <linux/spinlock.h> 134#include <linux/spinlock.h>
412#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
413#include <linux/blkdev.h> 135#include <linux/blkdev.h>
414#else
415#include <linux/blk.h>
416#include "sd.h"
417#endif
418 136
419#include "scsi.h" 137#include "scsi.h"
420#include <scsi/scsi_host.h> 138#include <scsi/scsi_host.h>
421#include "gdth_kcompat.h"
422#include "gdth.h" 139#include "gdth.h"
423 140
424static void gdth_delay(int milliseconds); 141static void gdth_delay(int milliseconds);
@@ -658,7 +375,6 @@ static int probe_eisa_isa = 0;
658static int force_dma32 = 0; 375static int force_dma32 = 0;
659 376
660/* parameters for modprobe/insmod */ 377/* parameters for modprobe/insmod */
661#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
662module_param_array(irq, int, NULL, 0); 378module_param_array(irq, int, NULL, 0);
663module_param(disable, int, 0); 379module_param(disable, int, 0);
664module_param(reserve_mode, int, 0); 380module_param(reserve_mode, int, 0);
@@ -671,20 +387,6 @@ module_param(virt_ctr, int, 0);
671module_param(shared_access, int, 0); 387module_param(shared_access, int, 0);
672module_param(probe_eisa_isa, int, 0); 388module_param(probe_eisa_isa, int, 0);
673module_param(force_dma32, int, 0); 389module_param(force_dma32, int, 0);
674#else
675MODULE_PARM(irq, "i");
676MODULE_PARM(disable, "i");
677MODULE_PARM(reserve_mode, "i");
678MODULE_PARM(reserve_list, "4-" __MODULE_STRING(MAX_RES_ARGS) "i");
679MODULE_PARM(reverse_scan, "i");
680MODULE_PARM(hdr_channel, "i");
681MODULE_PARM(max_ids, "i");
682MODULE_PARM(rescan, "i");
683MODULE_PARM(virt_ctr, "i");
684MODULE_PARM(shared_access, "i");
685MODULE_PARM(probe_eisa_isa, "i");
686MODULE_PARM(force_dma32, "i");
687#endif
688MODULE_AUTHOR("Achim Leubner"); 390MODULE_AUTHOR("Achim Leubner");
689MODULE_LICENSE("GPL"); 391MODULE_LICENSE("GPL");
690 392
@@ -716,7 +418,6 @@ static void gdth_delay(int milliseconds)
716 } 418 }
717} 419}
718 420
719#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
720static void gdth_scsi_done(struct scsi_cmnd *scp) 421static void gdth_scsi_done(struct scsi_cmnd *scp)
721{ 422{
722 TRACE2(("gdth_scsi_done()\n")); 423 TRACE2(("gdth_scsi_done()\n"));
@@ -756,42 +457,6 @@ int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd,
756 kfree(scp); 457 kfree(scp);
757 return rval; 458 return rval;
758} 459}
759#else
760static void gdth_scsi_done(Scsi_Cmnd *scp)
761{
762 TRACE2(("gdth_scsi_done()\n"));
763
764 scp->request.rq_status = RQ_SCSI_DONE;
765 if (scp->request.waiting)
766 complete(scp->request.waiting);
767}
768
769int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd,
770 int timeout, u32 *info)
771{
772 Scsi_Cmnd *scp = scsi_allocate_device(sdev, 1, FALSE);
773 unsigned bufflen = gdtcmd ? sizeof(gdth_cmd_str) : 0;
774 DECLARE_COMPLETION_ONSTACK(wait);
775 int rval;
776
777 if (!scp)
778 return -ENOMEM;
779 scp->cmd_len = 12;
780 scp->use_sg = 0;
781 scp->SCp.this_residual = IOCTL_PRI; /* priority */
782 scp->request.rq_status = RQ_SCSI_BUSY;
783 scp->request.waiting = &wait;
784 scsi_do_cmd(scp, cmnd, gdtcmd, bufflen, gdth_scsi_done, timeout*HZ, 1);
785 wait_for_completion(&wait);
786
787 rval = scp->SCp.Status;
788 if (info)
789 *info = scp->SCp.Message;
790
791 scsi_release_command(scp);
792 return rval;
793}
794#endif
795 460
796int gdth_execute(struct Scsi_Host *shost, gdth_cmd_str *gdtcmd, char *cmnd, 461int gdth_execute(struct Scsi_Host *shost, gdth_cmd_str *gdtcmd, char *cmnd,
797 int timeout, u32 *info) 462 int timeout, u32 *info)
@@ -2258,29 +1923,17 @@ static int __init gdth_search_drives(int hanum)
2258 printk("GDT-HA %d: Vendor: %s Name: %s\n", 1923 printk("GDT-HA %d: Vendor: %s Name: %s\n",
2259 hanum,oemstr->text.oem_company_name,ha->binfo.type_string); 1924 hanum,oemstr->text.oem_company_name,ha->binfo.type_string);
2260 /* Save the Host Drive inquiry data */ 1925 /* Save the Host Drive inquiry data */
2261#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
2262 strlcpy(ha->oem_name,oemstr->text.scsi_host_drive_inquiry_vendor_id, 1926 strlcpy(ha->oem_name,oemstr->text.scsi_host_drive_inquiry_vendor_id,
2263 sizeof(ha->oem_name)); 1927 sizeof(ha->oem_name));
2264#else
2265 strncpy(ha->oem_name,oemstr->text.scsi_host_drive_inquiry_vendor_id,7);
2266 ha->oem_name[7] = '\0';
2267#endif
2268 } else { 1928 } else {
2269 /* Old method, based on PCI ID */ 1929 /* Old method, based on PCI ID */
2270 TRACE2(("gdth_search_drives(): CACHE_READ_OEM_STRING_RECORD failed\n")); 1930 TRACE2(("gdth_search_drives(): CACHE_READ_OEM_STRING_RECORD failed\n"));
2271 printk("GDT-HA %d: Name: %s\n", 1931 printk("GDT-HA %d: Name: %s\n",
2272 hanum,ha->binfo.type_string); 1932 hanum,ha->binfo.type_string);
2273#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
2274 if (ha->oem_id == OEM_ID_INTEL) 1933 if (ha->oem_id == OEM_ID_INTEL)
2275 strlcpy(ha->oem_name,"Intel ", sizeof(ha->oem_name)); 1934 strlcpy(ha->oem_name,"Intel ", sizeof(ha->oem_name));
2276 else 1935 else
2277 strlcpy(ha->oem_name,"ICP ", sizeof(ha->oem_name)); 1936 strlcpy(ha->oem_name,"ICP ", sizeof(ha->oem_name));
2278#else
2279 if (ha->oem_id == OEM_ID_INTEL)
2280 strcpy(ha->oem_name,"Intel ");
2281 else
2282 strcpy(ha->oem_name,"ICP ");
2283#endif
2284 } 1937 }
2285 1938
2286 /* scanning for host drives */ 1939 /* scanning for host drives */
@@ -2689,17 +2342,10 @@ static void gdth_copy_internal_data(int hanum,Scsi_Cmnd *scp,
2689 return; 2342 return;
2690 } 2343 }
2691 local_irq_save(flags); 2344 local_irq_save(flags);
2692#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
2693 address = kmap_atomic(sl->page, KM_BIO_SRC_IRQ) + sl->offset; 2345 address = kmap_atomic(sl->page, KM_BIO_SRC_IRQ) + sl->offset;
2694 memcpy(address,buffer,cpnow); 2346 memcpy(address,buffer,cpnow);
2695 flush_dcache_page(sl->page); 2347 flush_dcache_page(sl->page);
2696 kunmap_atomic(address, KM_BIO_SRC_IRQ); 2348 kunmap_atomic(address, KM_BIO_SRC_IRQ);
2697#else
2698 address = kmap_atomic(sl->page, KM_BH_IRQ) + sl->offset;
2699 memcpy(address,buffer,cpnow);
2700 flush_dcache_page(sl->page);
2701 kunmap_atomic(address, KM_BH_IRQ);
2702#endif
2703 local_irq_restore(flags); 2349 local_irq_restore(flags);
2704 if (cpsum == cpcount) 2350 if (cpsum == cpcount)
2705 break; 2351 break;
@@ -4293,11 +3939,7 @@ int __init option_setup(char *str)
4293} 3939}
4294 3940
4295 3941
4296#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
4297static int __init gdth_detect(struct scsi_host_template *shtp) 3942static int __init gdth_detect(struct scsi_host_template *shtp)
4298#else
4299static int __init gdth_detect(Scsi_Host_Template *shtp)
4300#endif
4301{ 3943{
4302#ifdef DEBUG_GDTH 3944#ifdef DEBUG_GDTH
4303 printk("GDT: This driver contains debugging information !! Trace level = %d\n", 3945 printk("GDT: This driver contains debugging information !! Trace level = %d\n",
@@ -4539,11 +4181,7 @@ static int gdth_eh_bus_reset(Scsi_Cmnd *scp)
4539 return SUCCESS; 4181 return SUCCESS;
4540} 4182}
4541 4183
4542#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
4543static int gdth_bios_param(struct scsi_device *sdev,struct block_device *bdev,sector_t cap,int *ip) 4184static int gdth_bios_param(struct scsi_device *sdev,struct block_device *bdev,sector_t cap,int *ip)
4544#else
4545static int gdth_bios_param(Disk *disk,kdev_t dev,int *ip)
4546#endif
4547{ 4185{
4548 unchar b, t; 4186 unchar b, t;
4549 int hanum; 4187 int hanum;
@@ -4551,13 +4189,8 @@ static int gdth_bios_param(Disk *disk,kdev_t dev,int *ip)
4551 struct scsi_device *sd; 4189 struct scsi_device *sd;
4552 unsigned capacity; 4190 unsigned capacity;
4553 4191
4554#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
4555 sd = sdev; 4192 sd = sdev;
4556 capacity = cap; 4193 capacity = cap;
4557#else
4558 sd = disk->device;
4559 capacity = disk->capacity;
4560#endif
4561 hanum = NUMDATA(sd->host)->hanum; 4194 hanum = NUMDATA(sd->host)->hanum;
4562 b = virt_ctr ? NUMDATA(sd->host)->busnum : sd->channel; 4195 b = virt_ctr ? NUMDATA(sd->host)->busnum : sd->channel;
4563 t = sd->id; 4196 t = sd->id;
@@ -5173,7 +4806,6 @@ static int gdth_ioctl(struct inode *inode, struct file *filep,
5173 hanum = res.ionode; 4806 hanum = res.ionode;
5174 ha = HADATA(gdth_ctr_tab[hanum]); 4807 ha = HADATA(gdth_ctr_tab[hanum]);
5175 4808
5176#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
5177 scp = kzalloc(sizeof(*scp), GFP_KERNEL); 4809 scp = kzalloc(sizeof(*scp), GFP_KERNEL);
5178 if (!scp) 4810 if (!scp)
5179 return -ENOMEM; 4811 return -ENOMEM;
@@ -5184,17 +4816,7 @@ static int gdth_ioctl(struct inode *inode, struct file *filep,
5184 rval = gdth_eh_bus_reset(scp); 4816 rval = gdth_eh_bus_reset(scp);
5185 res.status = (rval == SUCCESS ? S_OK : S_GENERR); 4817 res.status = (rval == SUCCESS ? S_OK : S_GENERR);
5186 kfree(scp); 4818 kfree(scp);
5187#else 4819
5188 scp = scsi_allocate_device(ha->sdev, 1, FALSE);
5189 if (!scp)
5190 return -ENOMEM;
5191 scp->cmd_len = 12;
5192 scp->use_sg = 0;
5193 scp->channel = virt_ctr ? 0 : res.number;
5194 rval = gdth_eh_bus_reset(scp);
5195 res.status = (rval == SUCCESS ? S_OK : S_GENERR);
5196 scsi_release_command(scp);
5197#endif
5198 if (copy_to_user(argp, &res, sizeof(gdth_ioctl_reset))) 4820 if (copy_to_user(argp, &res, sizeof(gdth_ioctl_reset)))
5199 return -EFAULT; 4821 return -EFAULT;
5200 break; 4822 break;
@@ -5282,7 +4904,6 @@ static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
5282 return NOTIFY_OK; 4904 return NOTIFY_OK;
5283} 4905}
5284 4906
5285#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
5286/* configure lun */ 4907/* configure lun */
5287static int gdth_slave_configure(struct scsi_device *sdev) 4908static int gdth_slave_configure(struct scsi_device *sdev)
5288{ 4909{
@@ -5291,13 +4912,8 @@ static int gdth_slave_configure(struct scsi_device *sdev)
5291 sdev->skip_ms_page_8 = 1; 4912 sdev->skip_ms_page_8 = 1;
5292 return 0; 4913 return 0;
5293} 4914}
5294#endif
5295 4915
5296#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
5297static struct scsi_host_template driver_template = { 4916static struct scsi_host_template driver_template = {
5298#else
5299static Scsi_Host_Template driver_template = {
5300#endif
5301 .proc_name = "gdth", 4917 .proc_name = "gdth",
5302 .proc_info = gdth_proc_info, 4918 .proc_info = gdth_proc_info,
5303 .name = "GDT SCSI Disk Array Controller", 4919 .name = "GDT SCSI Disk Array Controller",
@@ -5308,20 +4924,12 @@ static Scsi_Host_Template driver_template = {
5308 .eh_bus_reset_handler = gdth_eh_bus_reset, 4924 .eh_bus_reset_handler = gdth_eh_bus_reset,
5309 .bios_param = gdth_bios_param, 4925 .bios_param = gdth_bios_param,
5310 .can_queue = GDTH_MAXCMDS, 4926 .can_queue = GDTH_MAXCMDS,
5311#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
5312 .slave_configure = gdth_slave_configure, 4927 .slave_configure = gdth_slave_configure,
5313#endif
5314 .this_id = -1, 4928 .this_id = -1,
5315 .sg_tablesize = GDTH_MAXSG, 4929 .sg_tablesize = GDTH_MAXSG,
5316 .cmd_per_lun = GDTH_MAXC_P_L, 4930 .cmd_per_lun = GDTH_MAXC_P_L,
5317 .unchecked_isa_dma = 1, 4931 .unchecked_isa_dma = 1,
5318 .use_clustering = ENABLE_CLUSTERING, 4932 .use_clustering = ENABLE_CLUSTERING,
5319#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
5320 .use_new_eh_code = 1,
5321#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,20)
5322 .highmem_io = 1,
5323#endif
5324#endif
5325}; 4933};
5326 4934
5327#ifdef CONFIG_ISA 4935#ifdef CONFIG_ISA
diff --git a/drivers/scsi/gdth.h b/drivers/scsi/gdth.h
index 37423300592e..68845873cf9d 100644
--- a/drivers/scsi/gdth.h
+++ b/drivers/scsi/gdth.h
@@ -13,7 +13,6 @@
13 * $Id: gdth.h,v 1.58 2006/01/11 16:14:09 achim Exp $ 13 * $Id: gdth.h,v 1.58 2006/01/11 16:14:09 achim Exp $
14 */ 14 */
15 15
16#include <linux/version.h>
17#include <linux/types.h> 16#include <linux/types.h>
18 17
19#ifndef TRUE 18#ifndef TRUE
diff --git a/drivers/scsi/gdth_kcompat.h b/drivers/scsi/gdth_kcompat.h
deleted file mode 100644
index 2a302eee669a..000000000000
--- a/drivers/scsi/gdth_kcompat.h
+++ /dev/null
@@ -1,31 +0,0 @@
1#ifndef IRQ_HANDLED
2typedef void irqreturn_t;
3#define IRQ_NONE
4#define IRQ_HANDLED
5#endif
6
7#ifndef MODULE_LICENSE
8#define MODULE_LICENSE(x)
9#endif
10
11#ifndef __iomem
12#define __iomem
13#endif
14
15#ifndef __attribute_used__
16#define __attribute_used__ __devinitdata
17#endif
18
19#ifndef __user
20#define __user
21#endif
22
23#ifndef SERVICE_ACTION_IN
24#define SERVICE_ACTION_IN 0x9e
25#endif
26#ifndef READ_16
27#define READ_16 0x88
28#endif
29#ifndef WRITE_16
30#define WRITE_16 0x8a
31#endif
diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c
index 1f8d9a53003b..cece6f2bdc2e 100644
--- a/drivers/scsi/gdth_proc.c
+++ b/drivers/scsi/gdth_proc.c
@@ -4,7 +4,6 @@
4 4
5#include <linux/completion.h> 5#include <linux/completion.h>
6 6
7#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
8int gdth_proc_info(struct Scsi_Host *host, char *buffer,char **start,off_t offset,int length, 7int gdth_proc_info(struct Scsi_Host *host, char *buffer,char **start,off_t offset,int length,
9 int inout) 8 int inout)
10{ 9{
@@ -21,32 +20,6 @@ int gdth_proc_info(struct Scsi_Host *host, char *buffer,char **start,off_t offse
21 else 20 else
22 return(gdth_get_info(buffer,start,offset,length,host,hanum,busnum)); 21 return(gdth_get_info(buffer,start,offset,length,host,hanum,busnum));
23} 22}
24#else
25int gdth_proc_info(char *buffer,char **start,off_t offset,int length,int hostno,
26 int inout)
27{
28 int hanum,busnum,i;
29
30 TRACE2(("gdth_proc_info() length %d offs %d inout %d\n",
31 length,(int)offset,inout));
32
33 for (i = 0; i < gdth_ctr_vcount; ++i) {
34 if (gdth_ctr_vtab[i]->host_no == hostno)
35 break;
36 }
37 if (i == gdth_ctr_vcount)
38 return(-EINVAL);
39
40 hanum = NUMDATA(gdth_ctr_vtab[i])->hanum;
41 busnum= NUMDATA(gdth_ctr_vtab[i])->busnum;
42
43 if (inout)
44 return(gdth_set_info(buffer,length,gdth_ctr_vtab[i],hanum,busnum));
45 else
46 return(gdth_get_info(buffer,start,offset,length,
47 gdth_ctr_vtab[i],hanum,busnum));
48}
49#endif
50 23
51static int gdth_set_info(char *buffer,int length,struct Scsi_Host *host, 24static int gdth_set_info(char *buffer,int length,struct Scsi_Host *host,
52 int hanum,int busnum) 25 int hanum,int busnum)