aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEd Lin <ed.lin@promise.com>2006-12-04 20:49:34 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-12-05 12:32:46 -0500
commit529e7a62c8016ab7d3ef4ef6d39de23c0569781f (patch)
tree4b903a2effa41fc6f66837af1fc9bbe5b183aedd /drivers
parent47c4f997c7bd9ab142c65950317232728b921aa0 (diff)
[SCSI] stex: adjust default queue length
Firmware of new version may adjust default queue length. It is backward compatible. Signed-off-by: Ed Lin <ed.lin@promise.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/stex.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index 92dbac03c2e5..a20cbd9d325a 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -78,6 +78,7 @@ enum {
78 78
79 MU_MAX_DELAY_TIME = 240000, 79 MU_MAX_DELAY_TIME = 240000,
80 MU_HANDSHAKE_SIGNATURE = 0x55aaaa55, 80 MU_HANDSHAKE_SIGNATURE = 0x55aaaa55,
81 MU_HANDSHAKE_SIGNATURE_HALF = 0x5a5a0000,
81 HMU_PARTNER_TYPE = 2, 82 HMU_PARTNER_TYPE = 2,
82 83
83 /* firmware returned values */ 84 /* firmware returned values */
@@ -902,6 +903,7 @@ static int stex_handshake(struct st_hba *hba)
902 void __iomem *base = hba->mmio_base; 903 void __iomem *base = hba->mmio_base;
903 struct handshake_frame *h; 904 struct handshake_frame *h;
904 dma_addr_t status_phys; 905 dma_addr_t status_phys;
906 u32 data;
905 int i; 907 int i;
906 908
907 if (readl(base + OMR0) != MU_HANDSHAKE_SIGNATURE) { 909 if (readl(base + OMR0) != MU_HANDSHAKE_SIGNATURE) {
@@ -923,6 +925,13 @@ static int stex_handshake(struct st_hba *hba)
923 925
924 udelay(10); 926 udelay(10);
925 927
928 data = readl(base + OMR1);
929 if ((data & 0xffff0000) == MU_HANDSHAKE_SIGNATURE_HALF) {
930 data &= 0x0000ffff;
931 if (hba->host->can_queue > data)
932 hba->host->can_queue = data;
933 }
934
926 h = (struct handshake_frame *)(hba->dma_mem + MU_REQ_BUFFER_SIZE); 935 h = (struct handshake_frame *)(hba->dma_mem + MU_REQ_BUFFER_SIZE);
927 h->rb_phy = cpu_to_le32(hba->dma_handle); 936 h->rb_phy = cpu_to_le32(hba->dma_handle);
928 h->rb_phy_hi = cpu_to_le32((hba->dma_handle >> 16) >> 16); 937 h->rb_phy_hi = cpu_to_le32((hba->dma_handle >> 16) >> 16);
@@ -1234,7 +1243,7 @@ stex_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1234 if (err) 1243 if (err)
1235 goto out_free_irq; 1244 goto out_free_irq;
1236 1245
1237 err = scsi_init_shared_tag_map(host, ST_CAN_QUEUE); 1246 err = scsi_init_shared_tag_map(host, host->can_queue);
1238 if (err) { 1247 if (err) {
1239 printk(KERN_ERR DRV_NAME "(%s): init shared queue failed\n", 1248 printk(KERN_ERR DRV_NAME "(%s): init shared queue failed\n",
1240 pci_name(pdev)); 1249 pci_name(pdev));