diff options
Diffstat (limited to 'drivers/scsi/aacraid/linit.c')
-rw-r--r-- | drivers/scsi/aacraid/linit.c | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 143e4c16b079..6650f6fa9890 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c | |||
@@ -159,7 +159,7 @@ static struct pci_device_id aac_pci_tbl[] = { | |||
159 | MODULE_DEVICE_TABLE(pci, aac_pci_tbl); | 159 | MODULE_DEVICE_TABLE(pci, aac_pci_tbl); |
160 | 160 | ||
161 | /* | 161 | /* |
162 | * dmb - For now we add the number of channels to this structure. | 162 | * dmb - For now we add the number of channels to this structure. |
163 | * In the future we should add a fib that reports the number of channels | 163 | * In the future we should add a fib that reports the number of channels |
164 | * for the card. At that time we can remove the channels from here | 164 | * for the card. At that time we can remove the channels from here |
165 | */ | 165 | */ |
@@ -239,7 +239,7 @@ static struct aac_driver_ident aac_drivers[] = { | |||
239 | * Queues a command for execution by the associated Host Adapter. | 239 | * Queues a command for execution by the associated Host Adapter. |
240 | * | 240 | * |
241 | * TODO: unify with aac_scsi_cmd(). | 241 | * TODO: unify with aac_scsi_cmd(). |
242 | */ | 242 | */ |
243 | 243 | ||
244 | static int aac_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) | 244 | static int aac_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) |
245 | { | 245 | { |
@@ -258,7 +258,7 @@ static int aac_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd | |||
258 | } | 258 | } |
259 | cmd->SCp.phase = AAC_OWNER_LOWLEVEL; | 259 | cmd->SCp.phase = AAC_OWNER_LOWLEVEL; |
260 | return (aac_scsi_cmd(cmd) ? FAILED : 0); | 260 | return (aac_scsi_cmd(cmd) ? FAILED : 0); |
261 | } | 261 | } |
262 | 262 | ||
263 | /** | 263 | /** |
264 | * aac_info - Returns the host adapter name | 264 | * aac_info - Returns the host adapter name |
@@ -292,21 +292,21 @@ struct aac_driver_ident* aac_get_driver_ident(int devtype) | |||
292 | * @capacity: the sector capacity of the disk | 292 | * @capacity: the sector capacity of the disk |
293 | * @geom: geometry block to fill in | 293 | * @geom: geometry block to fill in |
294 | * | 294 | * |
295 | * Return the Heads/Sectors/Cylinders BIOS Disk Parameters for Disk. | 295 | * Return the Heads/Sectors/Cylinders BIOS Disk Parameters for Disk. |
296 | * The default disk geometry is 64 heads, 32 sectors, and the appropriate | 296 | * The default disk geometry is 64 heads, 32 sectors, and the appropriate |
297 | * number of cylinders so as not to exceed drive capacity. In order for | 297 | * number of cylinders so as not to exceed drive capacity. In order for |
298 | * disks equal to or larger than 1 GB to be addressable by the BIOS | 298 | * disks equal to or larger than 1 GB to be addressable by the BIOS |
299 | * without exceeding the BIOS limitation of 1024 cylinders, Extended | 299 | * without exceeding the BIOS limitation of 1024 cylinders, Extended |
300 | * Translation should be enabled. With Extended Translation enabled, | 300 | * Translation should be enabled. With Extended Translation enabled, |
301 | * drives between 1 GB inclusive and 2 GB exclusive are given a disk | 301 | * drives between 1 GB inclusive and 2 GB exclusive are given a disk |
302 | * geometry of 128 heads and 32 sectors, and drives above 2 GB inclusive | 302 | * geometry of 128 heads and 32 sectors, and drives above 2 GB inclusive |
303 | * are given a disk geometry of 255 heads and 63 sectors. However, if | 303 | * are given a disk geometry of 255 heads and 63 sectors. However, if |
304 | * the BIOS detects that the Extended Translation setting does not match | 304 | * the BIOS detects that the Extended Translation setting does not match |
305 | * the geometry in the partition table, then the translation inferred | 305 | * the geometry in the partition table, then the translation inferred |
306 | * from the partition table will be used by the BIOS, and a warning may | 306 | * from the partition table will be used by the BIOS, and a warning may |
307 | * be displayed. | 307 | * be displayed. |
308 | */ | 308 | */ |
309 | 309 | ||
310 | static int aac_biosparm(struct scsi_device *sdev, struct block_device *bdev, | 310 | static int aac_biosparm(struct scsi_device *sdev, struct block_device *bdev, |
311 | sector_t capacity, int *geom) | 311 | sector_t capacity, int *geom) |
312 | { | 312 | { |
@@ -333,10 +333,10 @@ static int aac_biosparm(struct scsi_device *sdev, struct block_device *bdev, | |||
333 | 333 | ||
334 | param->cylinders = cap_to_cyls(capacity, param->heads * param->sectors); | 334 | param->cylinders = cap_to_cyls(capacity, param->heads * param->sectors); |
335 | 335 | ||
336 | /* | 336 | /* |
337 | * Read the first 1024 bytes from the disk device, if the boot | 337 | * Read the first 1024 bytes from the disk device, if the boot |
338 | * sector partition table is valid, search for a partition table | 338 | * sector partition table is valid, search for a partition table |
339 | * entry whose end_head matches one of the standard geometry | 339 | * entry whose end_head matches one of the standard geometry |
340 | * translations ( 64/32, 128/32, 255/63 ). | 340 | * translations ( 64/32, 128/32, 255/63 ). |
341 | */ | 341 | */ |
342 | buf = scsi_bios_ptable(bdev); | 342 | buf = scsi_bios_ptable(bdev); |
@@ -596,7 +596,7 @@ static int aac_eh_reset(struct scsi_cmnd* cmd) | |||
596 | cmd->SCp.phase = AAC_OWNER_ERROR_HANDLER; | 596 | cmd->SCp.phase = AAC_OWNER_ERROR_HANDLER; |
597 | } | 597 | } |
598 | } | 598 | } |
599 | printk(KERN_ERR "%s: Host adapter reset request. SCSI hang ?\n", | 599 | printk(KERN_ERR "%s: Host adapter reset request. SCSI hang ?\n", |
600 | AAC_DRIVERNAME); | 600 | AAC_DRIVERNAME); |
601 | 601 | ||
602 | if ((count = aac_check_health(aac))) | 602 | if ((count = aac_check_health(aac))) |
@@ -687,8 +687,8 @@ static int aac_cfg_open(struct inode *inode, struct file *file) | |||
687 | * Bugs: Needs locking against parallel ioctls lower down | 687 | * Bugs: Needs locking against parallel ioctls lower down |
688 | * Bugs: Needs to handle hot plugging | 688 | * Bugs: Needs to handle hot plugging |
689 | */ | 689 | */ |
690 | 690 | ||
691 | static int aac_cfg_ioctl(struct inode *inode, struct file *file, | 691 | static int aac_cfg_ioctl(struct inode *inode, struct file *file, |
692 | unsigned int cmd, unsigned long arg) | 692 | unsigned int cmd, unsigned long arg) |
693 | { | 693 | { |
694 | if (!capable(CAP_SYS_RAWIO)) | 694 | if (!capable(CAP_SYS_RAWIO)) |
@@ -701,7 +701,7 @@ static long aac_compat_do_ioctl(struct aac_dev *dev, unsigned cmd, unsigned long | |||
701 | { | 701 | { |
702 | long ret; | 702 | long ret; |
703 | lock_kernel(); | 703 | lock_kernel(); |
704 | switch (cmd) { | 704 | switch (cmd) { |
705 | case FSACTL_MINIPORT_REV_CHECK: | 705 | case FSACTL_MINIPORT_REV_CHECK: |
706 | case FSACTL_SENDFIB: | 706 | case FSACTL_SENDFIB: |
707 | case FSACTL_OPEN_GET_ADAPTER_FIB: | 707 | case FSACTL_OPEN_GET_ADAPTER_FIB: |
@@ -711,14 +711,14 @@ static long aac_compat_do_ioctl(struct aac_dev *dev, unsigned cmd, unsigned long | |||
711 | case FSACTL_QUERY_DISK: | 711 | case FSACTL_QUERY_DISK: |
712 | case FSACTL_DELETE_DISK: | 712 | case FSACTL_DELETE_DISK: |
713 | case FSACTL_FORCE_DELETE_DISK: | 713 | case FSACTL_FORCE_DELETE_DISK: |
714 | case FSACTL_GET_CONTAINERS: | 714 | case FSACTL_GET_CONTAINERS: |
715 | case FSACTL_SEND_LARGE_FIB: | 715 | case FSACTL_SEND_LARGE_FIB: |
716 | ret = aac_do_ioctl(dev, cmd, (void __user *)arg); | 716 | ret = aac_do_ioctl(dev, cmd, (void __user *)arg); |
717 | break; | 717 | break; |
718 | 718 | ||
719 | case FSACTL_GET_NEXT_ADAPTER_FIB: { | 719 | case FSACTL_GET_NEXT_ADAPTER_FIB: { |
720 | struct fib_ioctl __user *f; | 720 | struct fib_ioctl __user *f; |
721 | 721 | ||
722 | f = compat_alloc_user_space(sizeof(*f)); | 722 | f = compat_alloc_user_space(sizeof(*f)); |
723 | ret = 0; | 723 | ret = 0; |
724 | if (clear_user(f, sizeof(*f))) | 724 | if (clear_user(f, sizeof(*f))) |
@@ -731,9 +731,9 @@ static long aac_compat_do_ioctl(struct aac_dev *dev, unsigned cmd, unsigned long | |||
731 | } | 731 | } |
732 | 732 | ||
733 | default: | 733 | default: |
734 | ret = -ENOIOCTLCMD; | 734 | ret = -ENOIOCTLCMD; |
735 | break; | 735 | break; |
736 | } | 736 | } |
737 | unlock_kernel(); | 737 | unlock_kernel(); |
738 | return ret; | 738 | return ret; |
739 | } | 739 | } |
@@ -797,7 +797,7 @@ static ssize_t aac_show_kernel_version(struct class_device *class_dev, | |||
797 | int len, tmp; | 797 | int len, tmp; |
798 | 798 | ||
799 | tmp = le32_to_cpu(dev->adapter_info.kernelrev); | 799 | tmp = le32_to_cpu(dev->adapter_info.kernelrev); |
800 | len = snprintf(buf, PAGE_SIZE, "%d.%d-%d[%d]\n", | 800 | len = snprintf(buf, PAGE_SIZE, "%d.%d-%d[%d]\n", |
801 | tmp >> 24, (tmp >> 16) & 0xff, tmp & 0xff, | 801 | tmp >> 24, (tmp >> 16) & 0xff, tmp & 0xff, |
802 | le32_to_cpu(dev->adapter_info.kernelbuild)); | 802 | le32_to_cpu(dev->adapter_info.kernelbuild)); |
803 | return len; | 803 | return len; |
@@ -810,7 +810,7 @@ static ssize_t aac_show_monitor_version(struct class_device *class_dev, | |||
810 | int len, tmp; | 810 | int len, tmp; |
811 | 811 | ||
812 | tmp = le32_to_cpu(dev->adapter_info.monitorrev); | 812 | tmp = le32_to_cpu(dev->adapter_info.monitorrev); |
813 | len = snprintf(buf, PAGE_SIZE, "%d.%d-%d[%d]\n", | 813 | len = snprintf(buf, PAGE_SIZE, "%d.%d-%d[%d]\n", |
814 | tmp >> 24, (tmp >> 16) & 0xff, tmp & 0xff, | 814 | tmp >> 24, (tmp >> 16) & 0xff, tmp & 0xff, |
815 | le32_to_cpu(dev->adapter_info.monitorbuild)); | 815 | le32_to_cpu(dev->adapter_info.monitorbuild)); |
816 | return len; | 816 | return len; |
@@ -823,7 +823,7 @@ static ssize_t aac_show_bios_version(struct class_device *class_dev, | |||
823 | int len, tmp; | 823 | int len, tmp; |
824 | 824 | ||
825 | tmp = le32_to_cpu(dev->adapter_info.biosrev); | 825 | tmp = le32_to_cpu(dev->adapter_info.biosrev); |
826 | len = snprintf(buf, PAGE_SIZE, "%d.%d-%d[%d]\n", | 826 | len = snprintf(buf, PAGE_SIZE, "%d.%d-%d[%d]\n", |
827 | tmp >> 24, (tmp >> 16) & 0xff, tmp & 0xff, | 827 | tmp >> 24, (tmp >> 16) & 0xff, tmp & 0xff, |
828 | le32_to_cpu(dev->adapter_info.biosbuild)); | 828 | le32_to_cpu(dev->adapter_info.biosbuild)); |
829 | return len; | 829 | return len; |
@@ -983,22 +983,22 @@ static struct scsi_host_template aac_driver_template = { | |||
983 | .compat_ioctl = aac_compat_ioctl, | 983 | .compat_ioctl = aac_compat_ioctl, |
984 | #endif | 984 | #endif |
985 | .queuecommand = aac_queuecommand, | 985 | .queuecommand = aac_queuecommand, |
986 | .bios_param = aac_biosparm, | 986 | .bios_param = aac_biosparm, |
987 | .shost_attrs = aac_attrs, | 987 | .shost_attrs = aac_attrs, |
988 | .slave_configure = aac_slave_configure, | 988 | .slave_configure = aac_slave_configure, |
989 | .change_queue_depth = aac_change_queue_depth, | 989 | .change_queue_depth = aac_change_queue_depth, |
990 | .sdev_attrs = aac_dev_attrs, | 990 | .sdev_attrs = aac_dev_attrs, |
991 | .eh_abort_handler = aac_eh_abort, | 991 | .eh_abort_handler = aac_eh_abort, |
992 | .eh_host_reset_handler = aac_eh_reset, | 992 | .eh_host_reset_handler = aac_eh_reset, |
993 | .can_queue = AAC_NUM_IO_FIB, | 993 | .can_queue = AAC_NUM_IO_FIB, |
994 | .this_id = MAXIMUM_NUM_CONTAINERS, | 994 | .this_id = MAXIMUM_NUM_CONTAINERS, |
995 | .sg_tablesize = 16, | 995 | .sg_tablesize = 16, |
996 | .max_sectors = 128, | 996 | .max_sectors = 128, |
997 | #if (AAC_NUM_IO_FIB > 256) | 997 | #if (AAC_NUM_IO_FIB > 256) |
998 | .cmd_per_lun = 256, | 998 | .cmd_per_lun = 256, |
999 | #else | 999 | #else |
1000 | .cmd_per_lun = AAC_NUM_IO_FIB, | 1000 | .cmd_per_lun = AAC_NUM_IO_FIB, |
1001 | #endif | 1001 | #endif |
1002 | .use_clustering = ENABLE_CLUSTERING, | 1002 | .use_clustering = ENABLE_CLUSTERING, |
1003 | .use_sg_chaining = ENABLE_SG_CHAINING, | 1003 | .use_sg_chaining = ENABLE_SG_CHAINING, |
1004 | .emulated = 1, | 1004 | .emulated = 1, |
@@ -1035,18 +1035,18 @@ static int __devinit aac_probe_one(struct pci_dev *pdev, | |||
1035 | goto out; | 1035 | goto out; |
1036 | error = -ENODEV; | 1036 | error = -ENODEV; |
1037 | 1037 | ||
1038 | if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) || | 1038 | if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) || |
1039 | pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK)) | 1039 | pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK)) |
1040 | goto out_disable_pdev; | 1040 | goto out_disable_pdev; |
1041 | /* | 1041 | /* |
1042 | * If the quirk31 bit is set, the adapter needs adapter | 1042 | * If the quirk31 bit is set, the adapter needs adapter |
1043 | * to driver communication memory to be allocated below 2gig | 1043 | * to driver communication memory to be allocated below 2gig |
1044 | */ | 1044 | */ |
1045 | if (aac_drivers[index].quirks & AAC_QUIRK_31BIT) | 1045 | if (aac_drivers[index].quirks & AAC_QUIRK_31BIT) |
1046 | if (pci_set_dma_mask(pdev, DMA_31BIT_MASK) || | 1046 | if (pci_set_dma_mask(pdev, DMA_31BIT_MASK) || |
1047 | pci_set_consistent_dma_mask(pdev, DMA_31BIT_MASK)) | 1047 | pci_set_consistent_dma_mask(pdev, DMA_31BIT_MASK)) |
1048 | goto out_disable_pdev; | 1048 | goto out_disable_pdev; |
1049 | 1049 | ||
1050 | pci_set_master(pdev); | 1050 | pci_set_master(pdev); |
1051 | 1051 | ||
1052 | shost = scsi_host_alloc(&aac_driver_template, sizeof(struct aac_dev)); | 1052 | shost = scsi_host_alloc(&aac_driver_template, sizeof(struct aac_dev)); |
@@ -1059,7 +1059,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev, | |||
1059 | shost->max_cmd_len = 16; | 1059 | shost->max_cmd_len = 16; |
1060 | 1060 | ||
1061 | aac = (struct aac_dev *)shost->hostdata; | 1061 | aac = (struct aac_dev *)shost->hostdata; |
1062 | aac->scsi_host_ptr = shost; | 1062 | aac->scsi_host_ptr = shost; |
1063 | aac->pdev = pdev; | 1063 | aac->pdev = pdev; |
1064 | aac->name = aac_driver_template.name; | 1064 | aac->name = aac_driver_template.name; |
1065 | aac->id = shost->unique_id; | 1065 | aac->id = shost->unique_id; |
@@ -1096,7 +1096,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev, | |||
1096 | if (aac_drivers[index].quirks & AAC_QUIRK_31BIT) | 1096 | if (aac_drivers[index].quirks & AAC_QUIRK_31BIT) |
1097 | if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) | 1097 | if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) |
1098 | goto out_deinit; | 1098 | goto out_deinit; |
1099 | 1099 | ||
1100 | aac->maximum_num_channels = aac_drivers[index].channels; | 1100 | aac->maximum_num_channels = aac_drivers[index].channels; |
1101 | error = aac_get_adapter_info(aac); | 1101 | error = aac_get_adapter_info(aac); |
1102 | if (error < 0) | 1102 | if (error < 0) |
@@ -1105,7 +1105,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev, | |||
1105 | /* | 1105 | /* |
1106 | * Lets override negotiations and drop the maximum SG limit to 34 | 1106 | * Lets override negotiations and drop the maximum SG limit to 34 |
1107 | */ | 1107 | */ |
1108 | if ((aac_drivers[index].quirks & AAC_QUIRK_34SG) && | 1108 | if ((aac_drivers[index].quirks & AAC_QUIRK_34SG) && |
1109 | (aac->scsi_host_ptr->sg_tablesize > 34)) { | 1109 | (aac->scsi_host_ptr->sg_tablesize > 34)) { |
1110 | aac->scsi_host_ptr->sg_tablesize = 34; | 1110 | aac->scsi_host_ptr->sg_tablesize = 34; |
1111 | aac->scsi_host_ptr->max_sectors | 1111 | aac->scsi_host_ptr->max_sectors |
@@ -1122,11 +1122,11 @@ static int __devinit aac_probe_one(struct pci_dev *pdev, | |||
1122 | /* | 1122 | /* |
1123 | * Firware printf works only with older firmware. | 1123 | * Firware printf works only with older firmware. |
1124 | */ | 1124 | */ |
1125 | if (aac_drivers[index].quirks & AAC_QUIRK_34SG) | 1125 | if (aac_drivers[index].quirks & AAC_QUIRK_34SG) |
1126 | aac->printf_enabled = 1; | 1126 | aac->printf_enabled = 1; |
1127 | else | 1127 | else |
1128 | aac->printf_enabled = 0; | 1128 | aac->printf_enabled = 0; |
1129 | 1129 | ||
1130 | /* | 1130 | /* |
1131 | * max channel will be the physical channels plus 1 virtual channel | 1131 | * max channel will be the physical channels plus 1 virtual channel |
1132 | * all containers are on the virtual channel 0 (CONTAINER_CHANNEL) | 1132 | * all containers are on the virtual channel 0 (CONTAINER_CHANNEL) |
@@ -1204,10 +1204,10 @@ static void __devexit aac_remove_one(struct pci_dev *pdev) | |||
1204 | kfree(aac->queues); | 1204 | kfree(aac->queues); |
1205 | 1205 | ||
1206 | aac_adapter_ioremap(aac, 0); | 1206 | aac_adapter_ioremap(aac, 0); |
1207 | 1207 | ||
1208 | kfree(aac->fibs); | 1208 | kfree(aac->fibs); |
1209 | kfree(aac->fsa_dev); | 1209 | kfree(aac->fsa_dev); |
1210 | 1210 | ||
1211 | list_del(&aac->entry); | 1211 | list_del(&aac->entry); |
1212 | scsi_host_put(shost); | 1212 | scsi_host_put(shost); |
1213 | pci_disable_device(pdev); | 1213 | pci_disable_device(pdev); |
@@ -1228,7 +1228,7 @@ static struct pci_driver aac_pci_driver = { | |||
1228 | static int __init aac_init(void) | 1228 | static int __init aac_init(void) |
1229 | { | 1229 | { |
1230 | int error; | 1230 | int error; |
1231 | 1231 | ||
1232 | printk(KERN_INFO "Adaptec %s driver %s\n", | 1232 | printk(KERN_INFO "Adaptec %s driver %s\n", |
1233 | AAC_DRIVERNAME, aac_driver_version); | 1233 | AAC_DRIVERNAME, aac_driver_version); |
1234 | 1234 | ||