Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208298
b: refs/heads/master
c: 4809d09
h: refs/heads/master
v: v3
  • Loading branch information
Stephen M. Cameron authored and Jens Axboe committed Aug 7, 2010
1 parent 6a21bef commit 4a9bc41
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e99ba1362723df14bbe36da6eeaadf81d95782e6
refs/heads/master: 4809d0988f10e305511d1a3e223880fa4b21f90e
68 changes: 34 additions & 34 deletions trunk/drivers/block/cciss.c
Original file line number Diff line number Diff line change
Expand Up @@ -4041,13 +4041,40 @@ static int __devinit cciss_wait_for_board_ready(ctlr_info_t *h)
return -ENODEV;
}

static int __devinit cciss_find_cfgtables(ctlr_info_t *h)
{
u64 cfg_offset;
u32 cfg_base_addr;
u64 cfg_base_addr_index;
u32 trans_offset;

/* get the address index number */
cfg_base_addr = readl(h->vaddr + SA5_CTCFG_OFFSET);
cfg_base_addr &= (u32) 0x0000ffff;
cfg_base_addr_index = find_PCI_BAR_index(h->pdev, cfg_base_addr);
if (cfg_base_addr_index == -1) {
dev_warn(&h->pdev->dev, "cannot find cfg_base_addr_index\n");
return -ENODEV;
}
cfg_offset = readl(h->vaddr + SA5_CTMEM_OFFSET);
h->cfgtable = remap_pci_mem(pci_resource_start(h->pdev,
cfg_base_addr_index) + cfg_offset,
sizeof(h->cfgtable));
if (!h->cfgtable)
return -ENOMEM;
/* Find performant mode table. */
trans_offset = readl(&(h->cfgtable->TransMethodOffset));
h->transtable = remap_pci_mem(pci_resource_start(h->pdev,
cfg_base_addr_index)+cfg_offset+trans_offset,
sizeof(*h->transtable));
if (!h->transtable)
return -ENOMEM;
return 0;
}

static int __devinit cciss_pci_init(ctlr_info_t *c)
{
__u64 cfg_offset;
__u32 cfg_base_addr;
__u64 cfg_base_addr_index;
__u32 trans_offset;
int i, prod_index, err;
int prod_index, err;

prod_index = cciss_lookup_board_id(c->pdev, &c->board_id);
if (prod_index < 0)
Expand Down Expand Up @@ -4090,36 +4117,9 @@ static int __devinit cciss_pci_init(ctlr_info_t *c)
err = cciss_wait_for_board_ready(c);
if (err)
goto err_out_free_res;

/* get the address index number */
cfg_base_addr = readl(c->vaddr + SA5_CTCFG_OFFSET);
cfg_base_addr &= (__u32) 0x0000ffff;
#ifdef CCISS_DEBUG
printk("cfg base address = %x\n", cfg_base_addr);
#endif /* CCISS_DEBUG */
cfg_base_addr_index = find_PCI_BAR_index(c->pdev, cfg_base_addr);
#ifdef CCISS_DEBUG
printk("cfg base address index = %llx\n",
(unsigned long long)cfg_base_addr_index);
#endif /* CCISS_DEBUG */
if (cfg_base_addr_index == -1) {
printk(KERN_WARNING "cciss: Cannot find cfg_base_addr_index\n");
err = -ENODEV;
err = cciss_find_cfgtables(c);
if (err)
goto err_out_free_res;
}

cfg_offset = readl(c->vaddr + SA5_CTMEM_OFFSET);
#ifdef CCISS_DEBUG
printk("cfg offset = %llx\n", (unsigned long long)cfg_offset);
#endif /* CCISS_DEBUG */
c->cfgtable = remap_pci_mem(pci_resource_start(c->pdev,
cfg_base_addr_index) +
cfg_offset, sizeof(CfgTable_struct));
/* Find performant mode table. */
trans_offset = readl(&(c->cfgtable->TransMethodOffset));
c->transtable = remap_pci_mem(pci_resource_start(c->pdev,
cfg_base_addr_index) + cfg_offset+trans_offset,
sizeof(*c->transtable));
#ifdef CCISS_DEBUG
print_cfg_table(c->cfgtable);
#endif /* CCISS_DEBUG */
Expand Down

0 comments on commit 4a9bc41

Please sign in to comment.