diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/gdth.c | 88 | ||||
-rw-r--r-- | drivers/scsi/gdth_proc.c | 28 | ||||
-rw-r--r-- | drivers/scsi/gdth_proc.h | 4 |
3 files changed, 25 insertions, 95 deletions
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index dba27b3b979a..c4db926a7dd8 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c | |||
@@ -56,8 +56,6 @@ | |||
56 | * max_ids:x x - target ID count per channel (1..MAXID) | 56 | * max_ids:x x - target ID count per channel (1..MAXID) |
57 | * rescan:Y rescan all channels/IDs | 57 | * rescan:Y rescan all channels/IDs |
58 | * rescan:N use all devices found until now | 58 | * rescan:N use all devices found until now |
59 | * virt_ctr:Y map every channel to a virtual controller | ||
60 | * virt_ctr:N use multi channel support | ||
61 | * hdr_channel:x x - number of virtual bus for host drives | 59 | * hdr_channel:x x - number of virtual bus for host drives |
62 | * shared_access:Y disable driver reserve/release protocol to | 60 | * shared_access:Y disable driver reserve/release protocol to |
63 | * access a shared resource from several nodes, | 61 | * access a shared resource from several nodes, |
@@ -69,7 +67,7 @@ | |||
69 | * force_dma32:N use 64 bit DMA mode, if supported | 67 | * force_dma32:N use 64 bit DMA mode, if supported |
70 | * | 68 | * |
71 | * The default values are: "gdth=disable:N,reserve_mode:1,reverse_scan:N, | 69 | * The default values are: "gdth=disable:N,reserve_mode:1,reverse_scan:N, |
72 | * max_ids:127,rescan:N,virt_ctr:N,hdr_channel:0, | 70 | * max_ids:127,rescan:N,hdr_channel:0, |
73 | * shared_access:Y,probe_eisa_isa:N,force_dma32:N". | 71 | * shared_access:Y,probe_eisa_isa:N,force_dma32:N". |
74 | * Here is another example: "gdth=reserve_list:0,1,2,0,0,1,3,0,rescan:Y". | 72 | * Here is another example: "gdth=reserve_list:0,1,2,0,0,1,3,0,rescan:Y". |
75 | * | 73 | * |
@@ -80,7 +78,7 @@ | |||
80 | * '1' in place of 'Y' and '0' in place of 'N'. | 78 | * '1' in place of 'Y' and '0' in place of 'N'. |
81 | * | 79 | * |
82 | * Default: "modprobe gdth disable=0 reserve_mode=1 reverse_scan=0 | 80 | * Default: "modprobe gdth disable=0 reserve_mode=1 reverse_scan=0 |
83 | * max_ids=127 rescan=0 virt_ctr=0 hdr_channel=0 shared_access=0 | 81 | * max_ids=127 rescan=0 hdr_channel=0 shared_access=0 |
84 | * probe_eisa_isa=0 force_dma32=0" | 82 | * probe_eisa_isa=0 force_dma32=0" |
85 | * The other example: "modprobe gdth reserve_list=0,1,2,0,0,1,3,0 rescan=1". | 83 | * The other example: "modprobe gdth reserve_list=0,1,2,0,0,1,3,0 rescan=1". |
86 | */ | 84 | */ |
@@ -303,10 +301,8 @@ static unchar gdth_polling; /* polling if TRUE */ | |||
303 | static unchar gdth_from_wait = FALSE; /* gdth_wait() */ | 301 | static unchar gdth_from_wait = FALSE; /* gdth_wait() */ |
304 | static int wait_index,wait_hanum; /* gdth_wait() */ | 302 | static int wait_index,wait_hanum; /* gdth_wait() */ |
305 | static int gdth_ctr_count = 0; /* controller count */ | 303 | static int gdth_ctr_count = 0; /* controller count */ |
306 | static int gdth_ctr_vcount = 0; /* virt. ctr. count */ | ||
307 | static int gdth_ctr_released = 0; /* gdth_release() */ | 304 | static int gdth_ctr_released = 0; /* gdth_release() */ |
308 | static struct Scsi_Host *gdth_ctr_tab[MAXHA]; /* controller table */ | 305 | static struct Scsi_Host *gdth_ctr_tab[MAXHA]; /* controller table */ |
309 | static struct Scsi_Host *gdth_ctr_vtab[MAXHA*MAXBUS]; /* virt. ctr. table */ | ||
310 | static unchar gdth_write_through = FALSE; /* write through */ | 306 | static unchar gdth_write_through = FALSE; /* write through */ |
311 | static gdth_evt_str ebuffer[MAX_EVENTS]; /* event buffer */ | 307 | static gdth_evt_str ebuffer[MAX_EVENTS]; /* event buffer */ |
312 | static int elastidx; | 308 | static int elastidx; |
@@ -358,8 +354,6 @@ static int hdr_channel = 0; | |||
358 | static int max_ids = MAXID; | 354 | static int max_ids = MAXID; |
359 | /* rescan all IDs */ | 355 | /* rescan all IDs */ |
360 | static int rescan = 0; | 356 | static int rescan = 0; |
361 | /* map channels to virtual controllers */ | ||
362 | static int virt_ctr = 0; | ||
363 | /* shared access */ | 357 | /* shared access */ |
364 | static int shared_access = 1; | 358 | static int shared_access = 1; |
365 | /* enable support for EISA and ISA controllers */ | 359 | /* enable support for EISA and ISA controllers */ |
@@ -376,7 +370,6 @@ module_param(reverse_scan, int, 0); | |||
376 | module_param(hdr_channel, int, 0); | 370 | module_param(hdr_channel, int, 0); |
377 | module_param(max_ids, int, 0); | 371 | module_param(max_ids, int, 0); |
378 | module_param(rescan, int, 0); | 372 | module_param(rescan, int, 0); |
379 | module_param(virt_ctr, int, 0); | ||
380 | module_param(shared_access, int, 0); | 373 | module_param(shared_access, int, 0); |
381 | module_param(probe_eisa_isa, int, 0); | 374 | module_param(probe_eisa_isa, int, 0); |
382 | module_param(force_dma32, int, 0); | 375 | module_param(force_dma32, int, 0); |
@@ -2018,7 +2011,7 @@ static void gdth_putq(int hanum,Scsi_Cmnd *scp,unchar priority) | |||
2018 | 2011 | ||
2019 | if (!IS_GDTH_INTERNAL_CMD(scp)) { | 2012 | if (!IS_GDTH_INTERNAL_CMD(scp)) { |
2020 | scp->SCp.this_residual = (int)priority; | 2013 | scp->SCp.this_residual = (int)priority; |
2021 | b = virt_ctr ? NUMDATA(scp->device->host)->busnum:scp->device->channel; | 2014 | b = scp->device->channel; |
2022 | t = scp->device->id; | 2015 | t = scp->device->id; |
2023 | if (priority >= DEFAULT_PRI) { | 2016 | if (priority >= DEFAULT_PRI) { |
2024 | if ((b != ha->virt_bus && ha->raw[BUS_L2P(ha,b)].lock) || | 2017 | if ((b != ha->virt_bus && ha->raw[BUS_L2P(ha,b)].lock) || |
@@ -2080,8 +2073,7 @@ static void gdth_next(int hanum) | |||
2080 | if (nscp != pscp && nscp != (Scsi_Cmnd *)pscp->SCp.ptr) | 2073 | if (nscp != pscp && nscp != (Scsi_Cmnd *)pscp->SCp.ptr) |
2081 | pscp = (Scsi_Cmnd *)pscp->SCp.ptr; | 2074 | pscp = (Scsi_Cmnd *)pscp->SCp.ptr; |
2082 | if (!IS_GDTH_INTERNAL_CMD(nscp)) { | 2075 | if (!IS_GDTH_INTERNAL_CMD(nscp)) { |
2083 | b = virt_ctr ? | 2076 | b = nscp->device->channel; |
2084 | NUMDATA(nscp->device->host)->busnum : nscp->device->channel; | ||
2085 | t = nscp->device->id; | 2077 | t = nscp->device->id; |
2086 | l = nscp->device->lun; | 2078 | l = nscp->device->lun; |
2087 | if (nscp->SCp.this_residual >= DEFAULT_PRI) { | 2079 | if (nscp->SCp.this_residual >= DEFAULT_PRI) { |
@@ -3397,7 +3389,7 @@ static int gdth_sync_event(int hanum,int service,unchar index,Scsi_Cmnd *scp) | |||
3397 | printk("\n"); | 3389 | printk("\n"); |
3398 | 3390 | ||
3399 | } else { | 3391 | } else { |
3400 | b = virt_ctr ? NUMDATA(scp->device->host)->busnum : scp->device->channel; | 3392 | b = scp->device->channel; |
3401 | t = scp->device->id; | 3393 | t = scp->device->id; |
3402 | if (scp->SCp.sent_command == -1 && b != ha->virt_bus) { | 3394 | if (scp->SCp.sent_command == -1 && b != ha->virt_bus) { |
3403 | ha->raw[BUS_L2P(ha,b)].io_cnt[t]--; | 3395 | ha->raw[BUS_L2P(ha,b)].io_cnt[t]--; |
@@ -3883,8 +3875,6 @@ static void __init internal_setup(char *str,int *ints) | |||
3883 | max_ids = val; | 3875 | max_ids = val; |
3884 | else if (!strncmp(argv, "rescan:", 7)) | 3876 | else if (!strncmp(argv, "rescan:", 7)) |
3885 | rescan = val; | 3877 | rescan = val; |
3886 | else if (!strncmp(argv, "virt_ctr:", 9)) | ||
3887 | virt_ctr = val; | ||
3888 | else if (!strncmp(argv, "shared_access:", 14)) | 3878 | else if (!strncmp(argv, "shared_access:", 14)) |
3889 | shared_access = val; | 3879 | shared_access = val; |
3890 | else if (!strncmp(argv, "probe_eisa_isa:", 15)) | 3880 | else if (!strncmp(argv, "probe_eisa_isa:", 15)) |
@@ -3931,7 +3921,6 @@ int __init option_setup(char *str) | |||
3931 | return 1; | 3921 | return 1; |
3932 | } | 3922 | } |
3933 | 3923 | ||
3934 | |||
3935 | static int __init gdth_detect(struct scsi_host_template *shtp) | 3924 | static int __init gdth_detect(struct scsi_host_template *shtp) |
3936 | { | 3925 | { |
3937 | #ifdef DEBUG_GDTH | 3926 | #ifdef DEBUG_GDTH |
@@ -4018,7 +4007,7 @@ static int __init gdth_detect(struct scsi_host_template *shtp) | |||
4018 | register_reboot_notifier(&gdth_notifier); | 4007 | register_reboot_notifier(&gdth_notifier); |
4019 | } | 4008 | } |
4020 | gdth_polling = FALSE; | 4009 | gdth_polling = FALSE; |
4021 | return gdth_ctr_vcount; | 4010 | return gdth_ctr_count; |
4022 | } | 4011 | } |
4023 | 4012 | ||
4024 | static int gdth_release(struct Scsi_Host *shp) | 4013 | static int gdth_release(struct Scsi_Host *shp) |
@@ -4027,7 +4016,6 @@ static int gdth_release(struct Scsi_Host *shp) | |||
4027 | gdth_ha_str *ha; | 4016 | gdth_ha_str *ha; |
4028 | 4017 | ||
4029 | TRACE2(("gdth_release()\n")); | 4018 | TRACE2(("gdth_release()\n")); |
4030 | if (NUMDATA(shp)->busnum == 0) { | ||
4031 | hanum = NUMDATA(shp)->hanum; | 4019 | hanum = NUMDATA(shp)->hanum; |
4032 | ha = HADATA(gdth_ctr_tab[hanum]); | 4020 | ha = HADATA(gdth_ctr_tab[hanum]); |
4033 | if (ha->sdev) { | 4021 | if (ha->sdev) { |
@@ -4069,7 +4057,6 @@ static int gdth_release(struct Scsi_Host *shp) | |||
4069 | unregister_chrdev(major,"gdth"); | 4057 | unregister_chrdev(major,"gdth"); |
4070 | unregister_reboot_notifier(&gdth_notifier); | 4058 | unregister_reboot_notifier(&gdth_notifier); |
4071 | } | 4059 | } |
4072 | } | ||
4073 | 4060 | ||
4074 | scsi_unregister(shp); | 4061 | scsi_unregister(shp); |
4075 | return 0; | 4062 | return 0; |
@@ -4131,7 +4118,7 @@ static int gdth_eh_bus_reset(Scsi_Cmnd *scp) | |||
4131 | TRACE2(("gdth_eh_bus_reset()\n")); | 4118 | TRACE2(("gdth_eh_bus_reset()\n")); |
4132 | 4119 | ||
4133 | hanum = NUMDATA(scp->device->host)->hanum; | 4120 | hanum = NUMDATA(scp->device->host)->hanum; |
4134 | b = virt_ctr ? NUMDATA(scp->device->host)->busnum : scp->device->channel; | 4121 | b = scp->device->channel; |
4135 | ha = HADATA(gdth_ctr_tab[hanum]); | 4122 | ha = HADATA(gdth_ctr_tab[hanum]); |
4136 | 4123 | ||
4137 | /* clear command tab */ | 4124 | /* clear command tab */ |
@@ -4185,7 +4172,7 @@ static int gdth_bios_param(struct scsi_device *sdev,struct block_device *bdev,se | |||
4185 | sd = sdev; | 4172 | sd = sdev; |
4186 | capacity = cap; | 4173 | capacity = cap; |
4187 | hanum = NUMDATA(sd->host)->hanum; | 4174 | hanum = NUMDATA(sd->host)->hanum; |
4188 | b = virt_ctr ? NUMDATA(sd->host)->busnum : sd->channel; | 4175 | b = sd->channel; |
4189 | t = sd->id; | 4176 | t = sd->id; |
4190 | TRACE2(("gdth_bios_param() ha %d bus %d target %d\n", hanum, b, t)); | 4177 | TRACE2(("gdth_bios_param() ha %d bus %d target %d\n", hanum, b, t)); |
4191 | ha = HADATA(gdth_ctr_tab[hanum]); | 4178 | ha = HADATA(gdth_ctr_tab[hanum]); |
@@ -4805,7 +4792,7 @@ static int gdth_ioctl(struct inode *inode, struct file *filep, | |||
4805 | scp->device = ha->sdev; | 4792 | scp->device = ha->sdev; |
4806 | scp->cmd_len = 12; | 4793 | scp->cmd_len = 12; |
4807 | scp->use_sg = 0; | 4794 | scp->use_sg = 0; |
4808 | scp->device->channel = virt_ctr ? 0 : res.number; | 4795 | scp->device->channel = res.number; |
4809 | rval = gdth_eh_bus_reset(scp); | 4796 | rval = gdth_eh_bus_reset(scp); |
4810 | res.status = (rval == SUCCESS ? S_OK : S_GENERR); | 4797 | res.status = (rval == SUCCESS ? S_OK : S_GENERR); |
4811 | kfree(scp); | 4798 | kfree(scp); |
@@ -4932,7 +4919,6 @@ static int gdth_isa_probe_one(struct scsi_host_template *shtp, ulong32 isa_bios) | |||
4932 | gdth_ha_str *ha; | 4919 | gdth_ha_str *ha; |
4933 | dma_addr_t scratch_dma_handle = 0; | 4920 | dma_addr_t scratch_dma_handle = 0; |
4934 | int error, hanum, i; | 4921 | int error, hanum, i; |
4935 | u8 b; | ||
4936 | 4922 | ||
4937 | if (!gdth_search_isa(isa_bios)) | 4923 | if (!gdth_search_isa(isa_bios)) |
4938 | return -ENXIO; | 4924 | return -ENXIO; |
@@ -4969,10 +4955,8 @@ static int gdth_isa_probe_one(struct scsi_host_template *shtp, ulong32 isa_bios) | |||
4969 | shp->dma_channel = ha->drq; | 4955 | shp->dma_channel = ha->drq; |
4970 | hanum = gdth_ctr_count; | 4956 | hanum = gdth_ctr_count; |
4971 | gdth_ctr_tab[gdth_ctr_count++] = shp; | 4957 | gdth_ctr_tab[gdth_ctr_count++] = shp; |
4972 | gdth_ctr_vtab[gdth_ctr_vcount++] = shp; | ||
4973 | 4958 | ||
4974 | NUMDATA(shp)->hanum = (ushort)hanum; | 4959 | NUMDATA(shp)->hanum = (ushort)hanum; |
4975 | NUMDATA(shp)->busnum= 0; | ||
4976 | 4960 | ||
4977 | ha->pccb = CMDDATA(shp); | 4961 | ha->pccb = CMDDATA(shp); |
4978 | ha->ccb_phys = 0L; | 4962 | ha->ccb_phys = 0L; |
@@ -5025,20 +5009,7 @@ static int gdth_isa_probe_one(struct scsi_host_template *shtp, ulong32 isa_bios) | |||
5025 | 5009 | ||
5026 | shp->max_id = ha->tid_cnt; | 5010 | shp->max_id = ha->tid_cnt; |
5027 | shp->max_lun = MAXLUN; | 5011 | shp->max_lun = MAXLUN; |
5028 | shp->max_channel = virt_ctr ? 0 : ha->bus_cnt; | 5012 | shp->max_channel = ha->bus_cnt; |
5029 | if (virt_ctr) { | ||
5030 | virt_ctr = 1; | ||
5031 | /* register addit. SCSI channels as virtual controllers */ | ||
5032 | for (b = 1; b < ha->bus_cnt + 1; ++b) { | ||
5033 | shp = scsi_register(shtp,sizeof(gdth_num_str)); | ||
5034 | shp->unchecked_isa_dma = 1; | ||
5035 | shp->irq = ha->irq; | ||
5036 | shp->dma_channel = ha->drq; | ||
5037 | gdth_ctr_vtab[gdth_ctr_vcount++] = shp; | ||
5038 | NUMDATA(shp)->hanum = (ushort)hanum; | ||
5039 | NUMDATA(shp)->busnum = b; | ||
5040 | } | ||
5041 | } | ||
5042 | 5013 | ||
5043 | spin_lock_init(&ha->smp_lock); | 5014 | spin_lock_init(&ha->smp_lock); |
5044 | gdth_enable_int(hanum); | 5015 | gdth_enable_int(hanum); |
@@ -5058,7 +5029,6 @@ static int gdth_isa_probe_one(struct scsi_host_template *shtp, ulong32 isa_bios) | |||
5058 | ha->pscratch, ha->scratch_phys); | 5029 | ha->pscratch, ha->scratch_phys); |
5059 | out_dec_counters: | 5030 | out_dec_counters: |
5060 | gdth_ctr_count--; | 5031 | gdth_ctr_count--; |
5061 | gdth_ctr_vcount--; | ||
5062 | out_free_irq: | 5032 | out_free_irq: |
5063 | free_irq(ha->irq, ha); | 5033 | free_irq(ha->irq, ha); |
5064 | out_host_put: | 5034 | out_host_put: |
@@ -5075,7 +5045,6 @@ static int gdth_eisa_probe_one(struct scsi_host_template *shtp, | |||
5075 | gdth_ha_str *ha; | 5045 | gdth_ha_str *ha; |
5076 | dma_addr_t scratch_dma_handle = 0; | 5046 | dma_addr_t scratch_dma_handle = 0; |
5077 | int error, hanum, i; | 5047 | int error, hanum, i; |
5078 | u8 b; | ||
5079 | 5048 | ||
5080 | if (!gdth_search_eisa(eisa_slot)) | 5049 | if (!gdth_search_eisa(eisa_slot)) |
5081 | return -ENXIO; | 5050 | return -ENXIO; |
@@ -5104,10 +5073,8 @@ static int gdth_eisa_probe_one(struct scsi_host_template *shtp, | |||
5104 | shp->dma_channel = 0xff; | 5073 | shp->dma_channel = 0xff; |
5105 | hanum = gdth_ctr_count; | 5074 | hanum = gdth_ctr_count; |
5106 | gdth_ctr_tab[gdth_ctr_count++] = shp; | 5075 | gdth_ctr_tab[gdth_ctr_count++] = shp; |
5107 | gdth_ctr_vtab[gdth_ctr_vcount++] = shp; | ||
5108 | 5076 | ||
5109 | NUMDATA(shp)->hanum = (ushort)hanum; | 5077 | NUMDATA(shp)->hanum = (ushort)hanum; |
5110 | NUMDATA(shp)->busnum= 0; | ||
5111 | TRACE2(("EISA detect Bus 0: hanum %d\n", | 5078 | TRACE2(("EISA detect Bus 0: hanum %d\n", |
5112 | NUMDATA(shp)->hanum)); | 5079 | NUMDATA(shp)->hanum)); |
5113 | 5080 | ||
@@ -5167,20 +5134,7 @@ static int gdth_eisa_probe_one(struct scsi_host_template *shtp, | |||
5167 | 5134 | ||
5168 | shp->max_id = ha->tid_cnt; | 5135 | shp->max_id = ha->tid_cnt; |
5169 | shp->max_lun = MAXLUN; | 5136 | shp->max_lun = MAXLUN; |
5170 | shp->max_channel = virt_ctr ? 0 : ha->bus_cnt; | 5137 | shp->max_channel = ha->bus_cnt; |
5171 | if (virt_ctr) { | ||
5172 | virt_ctr = 1; | ||
5173 | /* register addit. SCSI channels as virtual controllers */ | ||
5174 | for (b = 1; b < ha->bus_cnt + 1; ++b) { | ||
5175 | shp = scsi_register(shtp,sizeof(gdth_num_str)); | ||
5176 | shp->unchecked_isa_dma = 0; | ||
5177 | shp->irq = ha->irq; | ||
5178 | shp->dma_channel = 0xff; | ||
5179 | gdth_ctr_vtab[gdth_ctr_vcount++] = shp; | ||
5180 | NUMDATA(shp)->hanum = (ushort)hanum; | ||
5181 | NUMDATA(shp)->busnum = b; | ||
5182 | } | ||
5183 | } | ||
5184 | 5138 | ||
5185 | spin_lock_init(&ha->smp_lock); | 5139 | spin_lock_init(&ha->smp_lock); |
5186 | gdth_enable_int(hanum); | 5140 | gdth_enable_int(hanum); |
@@ -5203,7 +5157,6 @@ static int gdth_eisa_probe_one(struct scsi_host_template *shtp, | |||
5203 | out_free_irq: | 5157 | out_free_irq: |
5204 | free_irq(ha->irq, ha); | 5158 | free_irq(ha->irq, ha); |
5205 | gdth_ctr_count--; | 5159 | gdth_ctr_count--; |
5206 | gdth_ctr_vcount--; | ||
5207 | out_host_put: | 5160 | out_host_put: |
5208 | scsi_unregister(shp); | 5161 | scsi_unregister(shp); |
5209 | return error; | 5162 | return error; |
@@ -5218,7 +5171,6 @@ static int gdth_pci_probe_one(struct scsi_host_template *shtp, | |||
5218 | gdth_ha_str *ha; | 5171 | gdth_ha_str *ha; |
5219 | dma_addr_t scratch_dma_handle = 0; | 5172 | dma_addr_t scratch_dma_handle = 0; |
5220 | int error, hanum, i; | 5173 | int error, hanum, i; |
5221 | u8 b; | ||
5222 | 5174 | ||
5223 | shp = scsi_register(shtp,sizeof(gdth_ext_str)); | 5175 | shp = scsi_register(shtp,sizeof(gdth_ext_str)); |
5224 | if (!shp) | 5176 | if (!shp) |
@@ -5247,10 +5199,8 @@ static int gdth_pci_probe_one(struct scsi_host_template *shtp, | |||
5247 | shp->dma_channel = 0xff; | 5199 | shp->dma_channel = 0xff; |
5248 | hanum = gdth_ctr_count; | 5200 | hanum = gdth_ctr_count; |
5249 | gdth_ctr_tab[gdth_ctr_count++] = shp; | 5201 | gdth_ctr_tab[gdth_ctr_count++] = shp; |
5250 | gdth_ctr_vtab[gdth_ctr_vcount++] = shp; | ||
5251 | 5202 | ||
5252 | NUMDATA(shp)->hanum = (ushort)hanum; | 5203 | NUMDATA(shp)->hanum = (ushort)hanum; |
5253 | NUMDATA(shp)->busnum= 0; | ||
5254 | 5204 | ||
5255 | ha->pccb = CMDDATA(shp); | 5205 | ha->pccb = CMDDATA(shp); |
5256 | ha->ccb_phys = 0L; | 5206 | ha->ccb_phys = 0L; |
@@ -5318,20 +5268,7 @@ static int gdth_pci_probe_one(struct scsi_host_template *shtp, | |||
5318 | 5268 | ||
5319 | shp->max_id = ha->tid_cnt; | 5269 | shp->max_id = ha->tid_cnt; |
5320 | shp->max_lun = MAXLUN; | 5270 | shp->max_lun = MAXLUN; |
5321 | shp->max_channel = virt_ctr ? 0 : ha->bus_cnt; | 5271 | shp->max_channel = ha->bus_cnt; |
5322 | if (virt_ctr) { | ||
5323 | virt_ctr = 1; | ||
5324 | /* register addit. SCSI channels as virtual controllers */ | ||
5325 | for (b = 1; b < ha->bus_cnt + 1; ++b) { | ||
5326 | shp = scsi_register(shtp,sizeof(gdth_num_str)); | ||
5327 | shp->unchecked_isa_dma = 0; | ||
5328 | shp->irq = ha->irq; | ||
5329 | shp->dma_channel = 0xff; | ||
5330 | gdth_ctr_vtab[gdth_ctr_vcount++] = shp; | ||
5331 | NUMDATA(shp)->hanum = (ushort)hanum; | ||
5332 | NUMDATA(shp)->busnum = b; | ||
5333 | } | ||
5334 | } | ||
5335 | 5272 | ||
5336 | spin_lock_init(&ha->smp_lock); | 5273 | spin_lock_init(&ha->smp_lock); |
5337 | gdth_enable_int(hanum); | 5274 | gdth_enable_int(hanum); |
@@ -5351,7 +5288,6 @@ static int gdth_pci_probe_one(struct scsi_host_template *shtp, | |||
5351 | out_free_irq: | 5288 | out_free_irq: |
5352 | free_irq(ha->irq, ha); | 5289 | free_irq(ha->irq, ha); |
5353 | gdth_ctr_count--; | 5290 | gdth_ctr_count--; |
5354 | gdth_ctr_vcount--; | ||
5355 | out_host_put: | 5291 | out_host_put: |
5356 | scsi_unregister(shp); | 5292 | scsi_unregister(shp); |
5357 | return error; | 5293 | return error; |
diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c index cece6f2bdc2e..b060bd6ffe17 100644 --- a/drivers/scsi/gdth_proc.c +++ b/drivers/scsi/gdth_proc.c | |||
@@ -7,26 +7,25 @@ | |||
7 | int gdth_proc_info(struct Scsi_Host *host, char *buffer,char **start,off_t offset,int length, | 7 | int gdth_proc_info(struct Scsi_Host *host, char *buffer,char **start,off_t offset,int length, |
8 | int inout) | 8 | int inout) |
9 | { | 9 | { |
10 | int hanum,busnum; | 10 | int hanum; |
11 | 11 | ||
12 | TRACE2(("gdth_proc_info() length %d offs %d inout %d\n", | 12 | TRACE2(("gdth_proc_info() length %d offs %d inout %d\n", |
13 | length,(int)offset,inout)); | 13 | length,(int)offset,inout)); |
14 | 14 | ||
15 | hanum = NUMDATA(host)->hanum; | 15 | hanum = NUMDATA(host)->hanum; |
16 | busnum= NUMDATA(host)->busnum; | ||
17 | 16 | ||
18 | if (inout) | 17 | if (inout) |
19 | return(gdth_set_info(buffer,length,host,hanum,busnum)); | 18 | return(gdth_set_info(buffer,length,host,hanum)); |
20 | else | 19 | else |
21 | return(gdth_get_info(buffer,start,offset,length,host,hanum,busnum)); | 20 | return(gdth_get_info(buffer,start,offset,length,host,hanum)); |
22 | } | 21 | } |
23 | 22 | ||
24 | static int gdth_set_info(char *buffer,int length,struct Scsi_Host *host, | 23 | static int gdth_set_info(char *buffer,int length,struct Scsi_Host *host, |
25 | int hanum,int busnum) | 24 | int hanum) |
26 | { | 25 | { |
27 | int ret_val = -EINVAL; | 26 | int ret_val = -EINVAL; |
28 | 27 | ||
29 | TRACE2(("gdth_set_info() ha %d bus %d\n",hanum,busnum)); | 28 | TRACE2(("gdth_set_info() ha %d\n",hanum,)); |
30 | 29 | ||
31 | if (length >= 4) { | 30 | if (length >= 4) { |
32 | if (strncmp(buffer,"gdth",4) == 0) { | 31 | if (strncmp(buffer,"gdth",4) == 0) { |
@@ -154,7 +153,7 @@ static int gdth_set_asc_info(struct Scsi_Host *host, char *buffer, | |||
154 | } | 153 | } |
155 | 154 | ||
156 | static int gdth_get_info(char *buffer,char **start,off_t offset,int length, | 155 | static int gdth_get_info(char *buffer,char **start,off_t offset,int length, |
157 | struct Scsi_Host *host,int hanum,int busnum) | 156 | struct Scsi_Host *host,int hanum) |
158 | { | 157 | { |
159 | int size = 0,len = 0; | 158 | int size = 0,len = 0; |
160 | off_t begin = 0,pos = 0; | 159 | off_t begin = 0,pos = 0; |
@@ -187,7 +186,7 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length, | |||
187 | memset(cmnd, 0xff, 12); | 186 | memset(cmnd, 0xff, 12); |
188 | memset(gdtcmd, 0, sizeof(gdth_cmd_str)); | 187 | memset(gdtcmd, 0, sizeof(gdth_cmd_str)); |
189 | 188 | ||
190 | TRACE2(("gdth_get_info() ha %d bus %d\n",hanum,busnum)); | 189 | TRACE2(("gdth_get_info() ha %d\n",hanum)); |
191 | ha = HADATA(gdth_ctr_tab[hanum]); | 190 | ha = HADATA(gdth_ctr_tab[hanum]); |
192 | 191 | ||
193 | 192 | ||
@@ -218,10 +217,7 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length, | |||
218 | /* controller information */ | 217 | /* controller information */ |
219 | size = sprintf(buffer+len,"\nDisk Array Controller Information:\n"); | 218 | size = sprintf(buffer+len,"\nDisk Array Controller Information:\n"); |
220 | len += size; pos = begin + len; | 219 | len += size; pos = begin + len; |
221 | if (virt_ctr) | 220 | strcpy(hrec, ha->binfo.type_string); |
222 | sprintf(hrec, "%s (Bus %d)", ha->binfo.type_string, busnum); | ||
223 | else | ||
224 | strcpy(hrec, ha->binfo.type_string); | ||
225 | size = sprintf(buffer+len, | 221 | size = sprintf(buffer+len, |
226 | " Number: \t%d \tName: \t%s\n", | 222 | " Number: \t%d \tName: \t%s\n", |
227 | hanum, hrec); | 223 | hanum, hrec); |
@@ -753,7 +749,7 @@ static void gdth_wait_completion(int hanum, int busnum, int id) | |||
753 | for (i = 0; i < GDTH_MAXCMDS; ++i) { | 749 | for (i = 0; i < GDTH_MAXCMDS; ++i) { |
754 | scp = ha->cmd_tab[i].cmnd; | 750 | scp = ha->cmd_tab[i].cmnd; |
755 | 751 | ||
756 | b = virt_ctr ? NUMDATA(scp->device->host)->busnum : scp->device->channel; | 752 | b = scp->device->channel; |
757 | t = scp->device->id; | 753 | t = scp->device->id; |
758 | if (!SPECIAL_SCP(scp) && t == (unchar)id && | 754 | if (!SPECIAL_SCP(scp) && t == (unchar)id && |
759 | b == (unchar)busnum) { | 755 | b == (unchar)busnum) { |
@@ -779,8 +775,7 @@ static void gdth_stop_timeout(int hanum, int busnum, int id) | |||
779 | 775 | ||
780 | for (scp = ha->req_first; scp; scp = (Scsi_Cmnd *)scp->SCp.ptr) { | 776 | for (scp = ha->req_first; scp; scp = (Scsi_Cmnd *)scp->SCp.ptr) { |
781 | if (!IS_GDTH_INTERNAL_CMD(scp)) { | 777 | if (!IS_GDTH_INTERNAL_CMD(scp)) { |
782 | b = virt_ctr ? | 778 | b = scp->device->channel; |
783 | NUMDATA(scp->device->host)->busnum : scp->device->channel; | ||
784 | t = scp->device->id; | 779 | t = scp->device->id; |
785 | if (t == (unchar)id && b == (unchar)busnum) { | 780 | if (t == (unchar)id && b == (unchar)busnum) { |
786 | TRACE2(("gdth_stop_timeout(): update_timeout()\n")); | 781 | TRACE2(("gdth_stop_timeout(): update_timeout()\n")); |
@@ -803,8 +798,7 @@ static void gdth_start_timeout(int hanum, int busnum, int id) | |||
803 | 798 | ||
804 | for (scp = ha->req_first; scp; scp = (Scsi_Cmnd *)scp->SCp.ptr) { | 799 | for (scp = ha->req_first; scp; scp = (Scsi_Cmnd *)scp->SCp.ptr) { |
805 | if (!IS_GDTH_INTERNAL_CMD(scp)) { | 800 | if (!IS_GDTH_INTERNAL_CMD(scp)) { |
806 | b = virt_ctr ? | 801 | b = scp->device->channel; |
807 | NUMDATA(scp->device->host)->busnum : scp->device->channel; | ||
808 | t = scp->device->id; | 802 | t = scp->device->id; |
809 | if (t == (unchar)id && b == (unchar)busnum) { | 803 | if (t == (unchar)id && b == (unchar)busnum) { |
810 | TRACE2(("gdth_start_timeout(): update_timeout()\n")); | 804 | TRACE2(("gdth_start_timeout(): update_timeout()\n")); |
diff --git a/drivers/scsi/gdth_proc.h b/drivers/scsi/gdth_proc.h index a679eeb6820b..dd717776e6b5 100644 --- a/drivers/scsi/gdth_proc.h +++ b/drivers/scsi/gdth_proc.h | |||
@@ -9,9 +9,9 @@ int gdth_execute(struct Scsi_Host *shost, gdth_cmd_str *gdtcmd, char *cmnd, | |||
9 | int timeout, u32 *info); | 9 | int timeout, u32 *info); |
10 | 10 | ||
11 | static int gdth_set_info(char *buffer,int length,struct Scsi_Host *host, | 11 | static int gdth_set_info(char *buffer,int length,struct Scsi_Host *host, |
12 | int hanum,int busnum); | 12 | int hanum); |
13 | static int gdth_get_info(char *buffer,char **start,off_t offset,int length, | 13 | static int gdth_get_info(char *buffer,char **start,off_t offset,int length, |
14 | struct Scsi_Host *host,int hanum,int busnum); | 14 | struct Scsi_Host *host,int hanum); |
15 | 15 | ||
16 | static int gdth_set_asc_info(struct Scsi_Host *host, char *buffer, | 16 | static int gdth_set_asc_info(struct Scsi_Host *host, char *buffer, |
17 | int length, int hanum); | 17 | int length, int hanum); |