aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.(none)>2005-10-28 12:41:41 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-10-28 12:41:41 -0400
commit38a9a621aba953ddb8051547e98c10ec3c741312 (patch)
tree53fc96a2902d2c5bf2a82d97d99b78570c76291e /drivers/scsi/aacraid
parent27d1097d39509494706eaa2620ef3b1e780a3224 (diff)
parente75d51761debffbc5e556e02c8ceda4f8c1a3e83 (diff)
Merge HEAD from ../scsi-misc-2.6-old
Diffstat (limited to 'drivers/scsi/aacraid')
-rw-r--r--drivers/scsi/aacraid/aachba.c57
-rw-r--r--drivers/scsi/aacraid/aacraid.h2
-rw-r--r--drivers/scsi/aacraid/commctrl.c6
-rw-r--r--drivers/scsi/aacraid/linit.c10
4 files changed, 51 insertions, 24 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 93416f760e5a..a913196459d5 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -608,17 +608,43 @@ static char *container_types[] = {
608 * files instead of in OS dependant driver source. 608 * files instead of in OS dependant driver source.
609 */ 609 */
610 610
611static void setinqstr(int devtype, void *data, int tindex) 611static void setinqstr(struct aac_dev *dev, void *data, int tindex)
612{ 612{
613 struct scsi_inq *str; 613 struct scsi_inq *str;
614 struct aac_driver_ident *mp;
615 614
616 mp = aac_get_driver_ident(devtype);
617
618 str = (struct scsi_inq *)(data); /* cast data to scsi inq block */ 615 str = (struct scsi_inq *)(data); /* cast data to scsi inq block */
619 616 memset(str, ' ', sizeof(*str));
620 inqstrcpy (mp->vname, str->vid); 617
621 inqstrcpy (mp->model, str->pid); /* last six chars reserved for vol type */ 618 if (dev->supplement_adapter_info.AdapterTypeText[0]) {
619 char * cp = dev->supplement_adapter_info.AdapterTypeText;
620 int c = sizeof(str->vid);
621 while (*cp && *cp != ' ' && --c)
622 ++cp;
623 c = *cp;
624 *cp = '\0';
625 inqstrcpy (dev->supplement_adapter_info.AdapterTypeText,
626 str->vid);
627 *cp = c;
628 while (*cp && *cp != ' ')
629 ++cp;
630 while (*cp == ' ')
631 ++cp;
632 /* last six chars reserved for vol type */
633 c = 0;
634 if (strlen(cp) > sizeof(str->pid)) {
635 c = cp[sizeof(str->pid)];
636 cp[sizeof(str->pid)] = '\0';
637 }
638 inqstrcpy (cp, str->pid);
639 if (c)
640 cp[sizeof(str->pid)] = c;
641 } else {
642 struct aac_driver_ident *mp = aac_get_driver_ident(dev->cardtype);
643
644 inqstrcpy (mp->vname, str->vid);
645 /* last six chars reserved for vol type */
646 inqstrcpy (mp->model, str->pid);
647 }
622 648
623 if (tindex < (sizeof(container_types)/sizeof(char *))){ 649 if (tindex < (sizeof(container_types)/sizeof(char *))){
624 char *findit = str->pid; 650 char *findit = str->pid;
@@ -627,7 +653,9 @@ static void setinqstr(int devtype, void *data, int tindex)
627 /* RAID is superfluous in the context of a RAID device */ 653 /* RAID is superfluous in the context of a RAID device */
628 if (memcmp(findit-4, "RAID", 4) == 0) 654 if (memcmp(findit-4, "RAID", 4) == 0)
629 *(findit -= 4) = ' '; 655 *(findit -= 4) = ' ';
630 inqstrcpy (container_types[tindex], findit + 1); 656 if (((findit - str->pid) + strlen(container_types[tindex]))
657 < (sizeof(str->pid) + sizeof(str->prl)))
658 inqstrcpy (container_types[tindex], findit + 1);
631 } 659 }
632 inqstrcpy ("V1.0", str->prl); 660 inqstrcpy ("V1.0", str->prl);
633} 661}
@@ -822,12 +850,12 @@ int aac_get_adapter_info(struct aac_dev* dev)
822 dev->dac_support = (dacmode!=0); 850 dev->dac_support = (dacmode!=0);
823 } 851 }
824 if(dev->dac_support != 0) { 852 if(dev->dac_support != 0) {
825 if (!pci_set_dma_mask(dev->pdev, 0xFFFFFFFFFFFFFFFFULL) && 853 if (!pci_set_dma_mask(dev->pdev, DMA_64BIT_MASK) &&
826 !pci_set_consistent_dma_mask(dev->pdev, 0xFFFFFFFFFFFFFFFFULL)) { 854 !pci_set_consistent_dma_mask(dev->pdev, DMA_64BIT_MASK)) {
827 printk(KERN_INFO"%s%d: 64 Bit DAC enabled\n", 855 printk(KERN_INFO"%s%d: 64 Bit DAC enabled\n",
828 dev->name, dev->id); 856 dev->name, dev->id);
829 } else if (!pci_set_dma_mask(dev->pdev, 0xFFFFFFFFULL) && 857 } else if (!pci_set_dma_mask(dev->pdev, DMA_32BIT_MASK) &&
830 !pci_set_consistent_dma_mask(dev->pdev, 0xFFFFFFFFULL)) { 858 !pci_set_consistent_dma_mask(dev->pdev, DMA_32BIT_MASK)) {
831 printk(KERN_INFO"%s%d: DMA mask set failed, 64 Bit DAC disabled\n", 859 printk(KERN_INFO"%s%d: DMA mask set failed, 64 Bit DAC disabled\n",
832 dev->name, dev->id); 860 dev->name, dev->id);
833 dev->dac_support = 0; 861 dev->dac_support = 0;
@@ -1438,7 +1466,6 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1438 struct Scsi_Host *host = scsicmd->device->host; 1466 struct Scsi_Host *host = scsicmd->device->host;
1439 struct aac_dev *dev = (struct aac_dev *)host->hostdata; 1467 struct aac_dev *dev = (struct aac_dev *)host->hostdata;
1440 struct fsa_dev_info *fsa_dev_ptr = dev->fsa_dev; 1468 struct fsa_dev_info *fsa_dev_ptr = dev->fsa_dev;
1441 int cardtype = dev->cardtype;
1442 int ret; 1469 int ret;
1443 1470
1444 /* 1471 /*
@@ -1542,14 +1569,14 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1542 * see: <vendor>.c i.e. aac.c 1569 * see: <vendor>.c i.e. aac.c
1543 */ 1570 */
1544 if (scsicmd->device->id == host->this_id) { 1571 if (scsicmd->device->id == host->this_id) {
1545 setinqstr(cardtype, (void *) (inq_data.inqd_vid), (sizeof(container_types)/sizeof(char *))); 1572 setinqstr(dev, (void *) (inq_data.inqd_vid), (sizeof(container_types)/sizeof(char *)));
1546 inq_data.inqd_pdt = INQD_PDT_PROC; /* Processor device */ 1573 inq_data.inqd_pdt = INQD_PDT_PROC; /* Processor device */
1547 aac_internal_transfer(scsicmd, &inq_data, 0, sizeof(inq_data)); 1574 aac_internal_transfer(scsicmd, &inq_data, 0, sizeof(inq_data));
1548 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD; 1575 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
1549 scsicmd->scsi_done(scsicmd); 1576 scsicmd->scsi_done(scsicmd);
1550 return 0; 1577 return 0;
1551 } 1578 }
1552 setinqstr(cardtype, (void *) (inq_data.inqd_vid), fsa_dev_ptr[cid].type); 1579 setinqstr(dev, (void *) (inq_data.inqd_vid), fsa_dev_ptr[cid].type);
1553 inq_data.inqd_pdt = INQD_PDT_DA; /* Direct/random access device */ 1580 inq_data.inqd_pdt = INQD_PDT_DA; /* Direct/random access device */
1554 aac_internal_transfer(scsicmd, &inq_data, 0, sizeof(inq_data)); 1581 aac_internal_transfer(scsicmd, &inq_data, 0, sizeof(inq_data));
1555 return aac_get_container_name(scsicmd, cid); 1582 return aac_get_container_name(scsicmd, cid);
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index d54b1cc88d0d..2ebe402bc31a 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -1560,7 +1560,7 @@ struct fib_ioctl
1560 1560
1561struct revision 1561struct revision
1562{ 1562{
1563 __le32 compat; 1563 u32 compat;
1564 __le32 version; 1564 __le32 version;
1565 __le32 build; 1565 __le32 build;
1566}; 1566};
diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
index 71f1cad9b5f0..ef623bd965f5 100644
--- a/drivers/scsi/aacraid/commctrl.c
+++ b/drivers/scsi/aacraid/commctrl.c
@@ -408,7 +408,7 @@ static int check_revision(struct aac_dev *dev, void __user *arg)
408 char *driver_version = aac_driver_version; 408 char *driver_version = aac_driver_version;
409 u32 version; 409 u32 version;
410 410
411 response.compat = cpu_to_le32(1); 411 response.compat = 1;
412 version = (simple_strtol(driver_version, 412 version = (simple_strtol(driver_version,
413 &driver_version, 10) << 24) | 0x00000400; 413 &driver_version, 10) << 24) | 0x00000400;
414 version += simple_strtol(driver_version + 1, &driver_version, 10) << 16; 414 version += simple_strtol(driver_version + 1, &driver_version, 10) << 16;
@@ -574,7 +574,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
574 rcode = -ENOMEM; 574 rcode = -ENOMEM;
575 goto cleanup; 575 goto cleanup;
576 } 576 }
577 sg_user[i] = (void __user *)usg->sg[i].addr; 577 sg_user[i] = (void __user *)(long)usg->sg[i].addr;
578 sg_list[i] = p; // save so we can clean up later 578 sg_list[i] = p; // save so we can clean up later
579 sg_indx = i; 579 sg_indx = i;
580 580
@@ -624,7 +624,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
624 rcode = -ENOMEM; 624 rcode = -ENOMEM;
625 goto cleanup; 625 goto cleanup;
626 } 626 }
627 sg_user[i] = (void __user *)upsg->sg[i].addr; 627 sg_user[i] = (void __user *)(long)upsg->sg[i].addr;
628 sg_list[i] = p; // save so we can clean up later 628 sg_list[i] = p; // save so we can clean up later
629 sg_indx = i; 629 sg_indx = i;
630 630
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index a1f9ceef0ac9..c235d0c0e7a7 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -752,8 +752,8 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
752 if (error) 752 if (error)
753 goto out; 753 goto out;
754 754
755 if (pci_set_dma_mask(pdev, 0xFFFFFFFFULL) || 755 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) ||
756 pci_set_consistent_dma_mask(pdev, 0xFFFFFFFFULL)) 756 pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK))
757 goto out; 757 goto out;
758 /* 758 /*
759 * If the quirk31 bit is set, the adapter needs adapter 759 * If the quirk31 bit is set, the adapter needs adapter
@@ -797,9 +797,9 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
797 * address space. 797 * address space.
798 */ 798 */
799 if (aac_drivers[index].quirks & AAC_QUIRK_31BIT) 799 if (aac_drivers[index].quirks & AAC_QUIRK_31BIT)
800 if (pci_set_dma_mask(pdev, 0xFFFFFFFFULL)) 800 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK))
801 goto out_free_fibs; 801 goto out_deinit;
802 802
803 aac->maximum_num_channels = aac_drivers[index].channels; 803 aac->maximum_num_channels = aac_drivers[index].channels;
804 error = aac_get_adapter_info(aac); 804 error = aac_get_adapter_info(aac);
805 if (error < 0) 805 if (error < 0)