diff options
Diffstat (limited to 'drivers/scsi/aacraid/linit.c')
-rw-r--r-- | drivers/scsi/aacraid/linit.c | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 242fa77513f5..6f05d86c7bb3 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c | |||
@@ -215,7 +215,7 @@ static int aac_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd | |||
215 | * Returns a static string describing the device in question | 215 | * Returns a static string describing the device in question |
216 | */ | 216 | */ |
217 | 217 | ||
218 | const char *aac_info(struct Scsi_Host *shost) | 218 | static const char *aac_info(struct Scsi_Host *shost) |
219 | { | 219 | { |
220 | struct aac_dev *dev = (struct aac_dev *)shost->hostdata; | 220 | struct aac_dev *dev = (struct aac_dev *)shost->hostdata; |
221 | return aac_drivers[dev->cardtype].name; | 221 | return aac_drivers[dev->cardtype].name; |
@@ -288,7 +288,7 @@ static int aac_biosparm(struct scsi_device *sdev, struct block_device *bdev, | |||
288 | * translations ( 64/32, 128/32, 255/63 ). | 288 | * translations ( 64/32, 128/32, 255/63 ). |
289 | */ | 289 | */ |
290 | buf = scsi_bios_ptable(bdev); | 290 | buf = scsi_bios_ptable(bdev); |
291 | if(*(unsigned short *)(buf + 0x40) == cpu_to_le16(0xaa55)) { | 291 | if(*(__le16 *)(buf + 0x40) == cpu_to_le16(0xaa55)) { |
292 | struct partition *first = (struct partition * )buf; | 292 | struct partition *first = (struct partition * )buf; |
293 | struct partition *entry = first; | 293 | struct partition *entry = first; |
294 | int saved_cylinders = param->cylinders; | 294 | int saved_cylinders = param->cylinders; |
@@ -347,10 +347,16 @@ static int aac_biosparm(struct scsi_device *sdev, struct block_device *bdev, | |||
347 | 347 | ||
348 | static int aac_slave_configure(struct scsi_device *sdev) | 348 | static int aac_slave_configure(struct scsi_device *sdev) |
349 | { | 349 | { |
350 | struct Scsi_Host *host = sdev->host; | ||
351 | |||
350 | if (sdev->tagged_supported) | 352 | if (sdev->tagged_supported) |
351 | scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, 128); | 353 | scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, 128); |
352 | else | 354 | else |
353 | scsi_adjust_queue_depth(sdev, 0, 1); | 355 | scsi_adjust_queue_depth(sdev, 0, 1); |
356 | |||
357 | if (host->max_sectors < AAC_MAX_32BIT_SGBCOUNT) | ||
358 | blk_queue_max_segment_size(sdev->request_queue, 65536); | ||
359 | |||
354 | return 0; | 360 | return 0; |
355 | } | 361 | } |
356 | 362 | ||
@@ -439,11 +445,11 @@ static int aac_eh_reset(struct scsi_cmnd* cmd) | |||
439 | static int aac_cfg_open(struct inode *inode, struct file *file) | 445 | static int aac_cfg_open(struct inode *inode, struct file *file) |
440 | { | 446 | { |
441 | struct aac_dev *aac; | 447 | struct aac_dev *aac; |
442 | unsigned minor = iminor(inode); | 448 | unsigned minor_number = iminor(inode); |
443 | int err = -ENODEV; | 449 | int err = -ENODEV; |
444 | 450 | ||
445 | list_for_each_entry(aac, &aac_devices, entry) { | 451 | list_for_each_entry(aac, &aac_devices, entry) { |
446 | if (aac->id == minor) { | 452 | if (aac->id == minor_number) { |
447 | file->private_data = aac; | 453 | file->private_data = aac; |
448 | err = 0; | 454 | err = 0; |
449 | break; | 455 | break; |
@@ -489,6 +495,7 @@ static long aac_compat_do_ioctl(struct aac_dev *dev, unsigned cmd, unsigned long | |||
489 | case FSACTL_DELETE_DISK: | 495 | case FSACTL_DELETE_DISK: |
490 | case FSACTL_FORCE_DELETE_DISK: | 496 | case FSACTL_FORCE_DELETE_DISK: |
491 | case FSACTL_GET_CONTAINERS: | 497 | case FSACTL_GET_CONTAINERS: |
498 | case FSACTL_SEND_LARGE_FIB: | ||
492 | ret = aac_do_ioctl(dev, cmd, (void __user *)arg); | 499 | ret = aac_do_ioctl(dev, cmd, (void __user *)arg); |
493 | break; | 500 | break; |
494 | 501 | ||
@@ -538,7 +545,7 @@ static struct file_operations aac_cfg_fops = { | |||
538 | static struct scsi_host_template aac_driver_template = { | 545 | static struct scsi_host_template aac_driver_template = { |
539 | .module = THIS_MODULE, | 546 | .module = THIS_MODULE, |
540 | .name = "AAC", | 547 | .name = "AAC", |
541 | .proc_name = "aacraid", | 548 | .proc_name = AAC_DRIVERNAME, |
542 | .info = aac_info, | 549 | .info = aac_info, |
543 | .ioctl = aac_ioctl, | 550 | .ioctl = aac_ioctl, |
544 | #ifdef CONFIG_COMPAT | 551 | #ifdef CONFIG_COMPAT |
@@ -612,7 +619,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev, | |||
612 | aac->cardtype = index; | 619 | aac->cardtype = index; |
613 | INIT_LIST_HEAD(&aac->entry); | 620 | INIT_LIST_HEAD(&aac->entry); |
614 | 621 | ||
615 | aac->fibs = kmalloc(sizeof(struct fib) * AAC_NUM_FIB, GFP_KERNEL); | 622 | aac->fibs = kmalloc(sizeof(struct fib) * (shost->can_queue + AAC_NUM_MGT_FIB), GFP_KERNEL); |
616 | if (!aac->fibs) | 623 | if (!aac->fibs) |
617 | goto out_free_host; | 624 | goto out_free_host; |
618 | spin_lock_init(&aac->fib_lock); | 625 | spin_lock_init(&aac->fib_lock); |
@@ -632,6 +639,24 @@ static int __devinit aac_probe_one(struct pci_dev *pdev, | |||
632 | aac_get_adapter_info(aac); | 639 | aac_get_adapter_info(aac); |
633 | 640 | ||
634 | /* | 641 | /* |
642 | * Lets override negotiations and drop the maximum SG limit to 34 | ||
643 | */ | ||
644 | if ((aac_drivers[index].quirks & AAC_QUIRK_34SG) && | ||
645 | (aac->scsi_host_ptr->sg_tablesize > 34)) { | ||
646 | aac->scsi_host_ptr->sg_tablesize = 34; | ||
647 | aac->scsi_host_ptr->max_sectors | ||
648 | = (aac->scsi_host_ptr->sg_tablesize * 8) + 112; | ||
649 | } | ||
650 | |||
651 | /* | ||
652 | * Firware printf works only with older firmware. | ||
653 | */ | ||
654 | if (aac_drivers[index].quirks & AAC_QUIRK_34SG) | ||
655 | aac->printf_enabled = 1; | ||
656 | else | ||
657 | aac->printf_enabled = 0; | ||
658 | |||
659 | /* | ||
635 | * max channel will be the physical channels plus 1 virtual channel | 660 | * max channel will be the physical channels plus 1 virtual channel |
636 | * all containers are on the virtual channel 0 | 661 | * all containers are on the virtual channel 0 |
637 | * physical channels are address by their actual physical number+1 | 662 | * physical channels are address by their actual physical number+1 |