Commit e1438581 authored by Mike Miller's avatar Mike Miller Committed by Jens Axboe

cciss: change to discover first memory BAR

Add a method for discovering the first memory BAR.  All Smart Array
controllers to date have always had the the memory BAR as the first BAR.
A new controller to be released later this year breaks that model.
Signed-off-by: default avatarMike Miller <mike.miller@hp.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 0a9279cc
...@@ -3265,12 +3265,21 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev) ...@@ -3265,12 +3265,21 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
*/ */
cciss_interrupt_mode(c, pdev, board_id); cciss_interrupt_mode(c, pdev, board_id);
/* /* find the memory BAR */
* Memory base addr is first addr , the second points to the config for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
* table if (pci_resource_flags(pdev, i) & IORESOURCE_MEM)
*/ break;
}
if (i == DEVICE_COUNT_RESOURCE) {
printk(KERN_WARNING "cciss: No memory BAR found\n");
err = -ENODEV;
goto err_out_free_res;
}
c->paddr = pci_resource_start(pdev, i); /* addressing mode bits
* already removed
*/
c->paddr = pci_resource_start(pdev, 0); /* addressing mode bits already removed */
#ifdef CCISS_DEBUG #ifdef CCISS_DEBUG
printk("address 0 = %lx\n", c->paddr); printk("address 0 = %lx\n", c->paddr);
#endif /* CCISS_DEBUG */ #endif /* CCISS_DEBUG */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment