diff options
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r-- | drivers/block/cciss.c | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 4023885353e0..9364dc554257 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -96,6 +96,8 @@ static const struct pci_device_id cciss_pci_device_id[] = { | |||
96 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3245}, | 96 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3245}, |
97 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3247}, | 97 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3247}, |
98 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3249}, | 98 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3249}, |
99 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x324A}, | ||
100 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x324B}, | ||
99 | {PCI_VENDOR_ID_HP, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, | 101 | {PCI_VENDOR_ID_HP, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
100 | PCI_CLASS_STORAGE_RAID << 8, 0xffff << 8, 0}, | 102 | PCI_CLASS_STORAGE_RAID << 8, 0xffff << 8, 0}, |
101 | {0,} | 103 | {0,} |
@@ -133,6 +135,8 @@ static struct board_type products[] = { | |||
133 | {0x3245103C, "Smart Array P410i", &SA5_access}, | 135 | {0x3245103C, "Smart Array P410i", &SA5_access}, |
134 | {0x3247103C, "Smart Array P411", &SA5_access}, | 136 | {0x3247103C, "Smart Array P411", &SA5_access}, |
135 | {0x3249103C, "Smart Array P812", &SA5_access}, | 137 | {0x3249103C, "Smart Array P812", &SA5_access}, |
138 | {0x324A103C, "Smart Array P712m", &SA5_access}, | ||
139 | {0x324B103C, "Smart Array P711m", &SA5_access}, | ||
136 | {0xFFFF103C, "Unknown Smart Array", &SA5_access}, | 140 | {0xFFFF103C, "Unknown Smart Array", &SA5_access}, |
137 | }; | 141 | }; |
138 | 142 | ||
@@ -1366,6 +1370,7 @@ static void cciss_add_disk(ctlr_info_t *h, struct gendisk *disk, | |||
1366 | disk->first_minor = drv_index << NWD_SHIFT; | 1370 | disk->first_minor = drv_index << NWD_SHIFT; |
1367 | disk->fops = &cciss_fops; | 1371 | disk->fops = &cciss_fops; |
1368 | disk->private_data = &h->drv[drv_index]; | 1372 | disk->private_data = &h->drv[drv_index]; |
1373 | disk->driverfs_dev = &h->pdev->dev; | ||
1369 | 1374 | ||
1370 | /* Set up queue information */ | 1375 | /* Set up queue information */ |
1371 | blk_queue_bounce_limit(disk->queue, h->pdev->dma_mask); | 1376 | blk_queue_bounce_limit(disk->queue, h->pdev->dma_mask); |
@@ -2842,7 +2847,7 @@ static void do_cciss_request(struct request_queue *q) | |||
2842 | h->maxSG = seg; | 2847 | h->maxSG = seg; |
2843 | 2848 | ||
2844 | #ifdef CCISS_DEBUG | 2849 | #ifdef CCISS_DEBUG |
2845 | printk(KERN_DEBUG "cciss: Submitting %d sectors in %d segments\n", | 2850 | printk(KERN_DEBUG "cciss: Submitting %lu sectors in %d segments\n", |
2846 | creq->nr_sectors, seg); | 2851 | creq->nr_sectors, seg); |
2847 | #endif /* CCISS_DEBUG */ | 2852 | #endif /* CCISS_DEBUG */ |
2848 | 2853 | ||
@@ -3192,7 +3197,7 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev) | |||
3192 | 3197 | ||
3193 | c->paddr = pci_resource_start(pdev, 0); /* addressing mode bits already removed */ | 3198 | c->paddr = pci_resource_start(pdev, 0); /* addressing mode bits already removed */ |
3194 | #ifdef CCISS_DEBUG | 3199 | #ifdef CCISS_DEBUG |
3195 | printk("address 0 = %x\n", c->paddr); | 3200 | printk("address 0 = %lx\n", c->paddr); |
3196 | #endif /* CCISS_DEBUG */ | 3201 | #endif /* CCISS_DEBUG */ |
3197 | c->vaddr = remap_pci_mem(c->paddr, 0x250); | 3202 | c->vaddr = remap_pci_mem(c->paddr, 0x250); |
3198 | 3203 | ||
@@ -3219,7 +3224,8 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev) | |||
3219 | #endif /* CCISS_DEBUG */ | 3224 | #endif /* CCISS_DEBUG */ |
3220 | cfg_base_addr_index = find_PCI_BAR_index(pdev, cfg_base_addr); | 3225 | cfg_base_addr_index = find_PCI_BAR_index(pdev, cfg_base_addr); |
3221 | #ifdef CCISS_DEBUG | 3226 | #ifdef CCISS_DEBUG |
3222 | printk("cfg base address index = %x\n", cfg_base_addr_index); | 3227 | printk("cfg base address index = %llx\n", |
3228 | (unsigned long long)cfg_base_addr_index); | ||
3223 | #endif /* CCISS_DEBUG */ | 3229 | #endif /* CCISS_DEBUG */ |
3224 | if (cfg_base_addr_index == -1) { | 3230 | if (cfg_base_addr_index == -1) { |
3225 | printk(KERN_WARNING "cciss: Cannot find cfg_base_addr_index\n"); | 3231 | printk(KERN_WARNING "cciss: Cannot find cfg_base_addr_index\n"); |
@@ -3229,7 +3235,7 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev) | |||
3229 | 3235 | ||
3230 | cfg_offset = readl(c->vaddr + SA5_CTMEM_OFFSET); | 3236 | cfg_offset = readl(c->vaddr + SA5_CTMEM_OFFSET); |
3231 | #ifdef CCISS_DEBUG | 3237 | #ifdef CCISS_DEBUG |
3232 | printk("cfg offset = %x\n", cfg_offset); | 3238 | printk("cfg offset = %llx\n", (unsigned long long)cfg_offset); |
3233 | #endif /* CCISS_DEBUG */ | 3239 | #endif /* CCISS_DEBUG */ |
3234 | c->cfgtable = remap_pci_mem(pci_resource_start(pdev, | 3240 | c->cfgtable = remap_pci_mem(pci_resource_start(pdev, |
3235 | cfg_base_addr_index) + | 3241 | cfg_base_addr_index) + |
@@ -3404,7 +3410,8 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, | |||
3404 | int i; | 3410 | int i; |
3405 | int j = 0; | 3411 | int j = 0; |
3406 | int rc; | 3412 | int rc; |
3407 | int dac; | 3413 | int dac, return_code; |
3414 | InquiryData_struct *inq_buff = NULL; | ||
3408 | 3415 | ||
3409 | i = alloc_cciss_hba(); | 3416 | i = alloc_cciss_hba(); |
3410 | if (i < 0) | 3417 | if (i < 0) |
@@ -3510,6 +3517,25 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, | |||
3510 | /* Turn the interrupts on so we can service requests */ | 3517 | /* Turn the interrupts on so we can service requests */ |
3511 | hba[i]->access.set_intr_mask(hba[i], CCISS_INTR_ON); | 3518 | hba[i]->access.set_intr_mask(hba[i], CCISS_INTR_ON); |
3512 | 3519 | ||
3520 | /* Get the firmware version */ | ||
3521 | inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL); | ||
3522 | if (inq_buff == NULL) { | ||
3523 | printk(KERN_ERR "cciss: out of memory\n"); | ||
3524 | goto clean4; | ||
3525 | } | ||
3526 | |||
3527 | return_code = sendcmd_withirq(CISS_INQUIRY, i, inq_buff, | ||
3528 | sizeof(InquiryData_struct), 0, 0 , 0, TYPE_CMD); | ||
3529 | if (return_code == IO_OK) { | ||
3530 | hba[i]->firm_ver[0] = inq_buff->data_byte[32]; | ||
3531 | hba[i]->firm_ver[1] = inq_buff->data_byte[33]; | ||
3532 | hba[i]->firm_ver[2] = inq_buff->data_byte[34]; | ||
3533 | hba[i]->firm_ver[3] = inq_buff->data_byte[35]; | ||
3534 | } else { /* send command failed */ | ||
3535 | printk(KERN_WARNING "cciss: unable to determine firmware" | ||
3536 | " version of controller\n"); | ||
3537 | } | ||
3538 | |||
3513 | cciss_procinit(i); | 3539 | cciss_procinit(i); |
3514 | 3540 | ||
3515 | hba[i]->cciss_max_sectors = 2048; | 3541 | hba[i]->cciss_max_sectors = 2048; |
@@ -3520,6 +3546,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, | |||
3520 | return 1; | 3546 | return 1; |
3521 | 3547 | ||
3522 | clean4: | 3548 | clean4: |
3549 | kfree(inq_buff); | ||
3523 | #ifdef CONFIG_CISS_SCSI_TAPE | 3550 | #ifdef CONFIG_CISS_SCSI_TAPE |
3524 | kfree(hba[i]->scsi_rejects.complete); | 3551 | kfree(hba[i]->scsi_rejects.complete); |
3525 | #endif | 3552 | #endif |