aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2010-05-27 16:14:19 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-27 13:01:14 -0400
commit6c311b5725b9500bdd0f527cd97496b11999fbbd (patch)
treec7158c4a9a35edaf096a8e8631ff58ec90c571c5 /drivers/scsi/hpsa.c
parentec18d2abad04091c5125b0a37ad80a00099d8ac0 (diff)
[SCSI] hpsa: factor out hpsa_enter_performant_mode
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c54
1 files changed, 30 insertions, 24 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index ad70f3e29c2..3c51544db95 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3808,36 +3808,16 @@ static void calc_bucket_map(int bucket[], int num_buckets,
3808 } 3808 }
3809} 3809}
3810 3810
3811static __devinit void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h) 3811static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h)
3812{ 3812{
3813 u32 trans_support; 3813 int i;
3814 unsigned long register_value;
3815 int bft[8] = {5, 6, 8, 10, 12, 20, 28, 35}; /* for scatter/gathers */
3814 /* 5 = 1 s/g entry or 4k 3816 /* 5 = 1 s/g entry or 4k
3815 * 6 = 2 s/g entry or 8k 3817 * 6 = 2 s/g entry or 8k
3816 * 8 = 4 s/g entry or 16k 3818 * 8 = 4 s/g entry or 16k
3817 * 10 = 6 s/g entry or 24k 3819 * 10 = 6 s/g entry or 24k
3818 */ 3820 */
3819 int bft[8] = {5, 6, 8, 10, 12, 20, 28, 35}; /* for scatter/gathers */
3820 int i = 0;
3821 unsigned long register_value;
3822
3823 trans_support = readl(&(h->cfgtable->TransportSupport));
3824 if (!(trans_support & PERFORMANT_MODE))
3825 return;
3826
3827 h->max_commands = readl(&(h->cfgtable->MaxPerformantModeCommands));
3828 h->max_sg_entries = 32;
3829 /* Performant mode ring buffer and supporting data structures */
3830 h->reply_pool_size = h->max_commands * sizeof(u64);
3831 h->reply_pool = pci_alloc_consistent(h->pdev, h->reply_pool_size,
3832 &(h->reply_pool_dhandle));
3833
3834 /* Need a block fetch table for performant mode */
3835 h->blockFetchTable = kmalloc(((h->max_sg_entries+1) *
3836 sizeof(u32)), GFP_KERNEL);
3837
3838 if ((h->reply_pool == NULL)
3839 || (h->blockFetchTable == NULL))
3840 goto clean_up;
3841 3821
3842 h->reply_pool_wraparound = 1; /* spec: init to 1 */ 3822 h->reply_pool_wraparound = 1; /* spec: init to 1 */
3843 3823
@@ -3867,6 +3847,32 @@ static __devinit void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h)
3867 " performant mode\n"); 3847 " performant mode\n");
3868 return; 3848 return;
3869 } 3849 }
3850}
3851
3852static __devinit void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h)
3853{
3854 u32 trans_support;
3855
3856 trans_support = readl(&(h->cfgtable->TransportSupport));
3857 if (!(trans_support & PERFORMANT_MODE))
3858 return;
3859
3860 h->max_commands = readl(&(h->cfgtable->MaxPerformantModeCommands));
3861 h->max_sg_entries = 32;
3862 /* Performant mode ring buffer and supporting data structures */
3863 h->reply_pool_size = h->max_commands * sizeof(u64);
3864 h->reply_pool = pci_alloc_consistent(h->pdev, h->reply_pool_size,
3865 &(h->reply_pool_dhandle));
3866
3867 /* Need a block fetch table for performant mode */
3868 h->blockFetchTable = kmalloc(((h->max_sg_entries+1) *
3869 sizeof(u32)), GFP_KERNEL);
3870
3871 if ((h->reply_pool == NULL)
3872 || (h->blockFetchTable == NULL))
3873 goto clean_up;
3874
3875 hpsa_enter_performant_mode(h);
3870 3876
3871 /* Change the access methods to the performant access methods */ 3877 /* Change the access methods to the performant access methods */
3872 h->access = SA5_performant_access; 3878 h->access = SA5_performant_access;