* [PATCH 6/8] stex: add new device type support
@ 2006-12-02 4:44 Ed Lin
2006-12-02 5:04 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Ed Lin @ 2006-12-02 4:44 UTC (permalink / raw)
To: linux-scsi; +Cc: James.Bottomley, jeff, promise_linux
Add support for st_vsc1 type device (st_vsc0 is ok because it does not
require extra buffer).
Signed-off-by: Ed Lin <ed.lin@promise.com>
---
diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index c4ee038..ce7edf5 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -152,6 +152,8 @@ enum {
MGT_CMD_SIGNATURE = 0xba,
INQUIRY_EVPD = 0x01,
+
+ ST_ADDITIONAL_MEM = 0x200000,
};
/* SCSI inquiry data */
@@ -213,7 +215,9 @@ struct handshake_frame {
__le32 partner_ver_minor;
__le32 partner_ver_oem;
__le32 partner_ver_build;
- u32 reserved1[4];
+ __le32 extra_offset; /* NEW */
+ __le32 extra_size; /* NEW */
+ u32 reserved1[2];
};
struct req_msg {
@@ -304,6 +308,7 @@ struct st_hba {
void __iomem *mmio_base; /* iomapped PCI memory space */
void *dma_mem;
dma_addr_t dma_handle;
+ size_t dma_size;
struct Scsi_Host *host;
struct pci_dev *pdev;
@@ -942,6 +947,11 @@ static int stex_handshake(struct st_hba
h->status_cnt = cpu_to_le16(MU_STATUS_COUNT);
stex_gettime(&h->hosttime);
h->partner_type = HMU_PARTNER_TYPE;
+ if (hba->dma_size > STEX_BUFFER_SIZE) {
+ h->extra_offset = cpu_to_le32(STEX_BUFFER_SIZE);
+ h->extra_size = cpu_to_le32(ST_ADDITIONAL_MEM);
+ } else
+ h->extra_offset = h->extra_size = 0;
status_phys = hba->dma_handle + MU_REQ_BUFFER_SIZE;
writel(status_phys, base + IMR0);
@@ -1204,8 +1214,11 @@ stex_probe(struct pci_dev *pdev, const s
goto out_iounmap;
}
+ hba->cardtype = (unsigned int) id->driver_data;
+ hba->dma_size = (hba->cardtype == st_vsc1) ?
+ (STEX_BUFFER_SIZE + ST_ADDITIONAL_MEM) : (STEX_BUFFER_SIZE);
hba->dma_mem = dma_alloc_coherent(&pdev->dev,
- STEX_BUFFER_SIZE, &hba->dma_handle, GFP_KERNEL);
+ hba->dma_size, &hba->dma_handle, GFP_KERNEL);
if (!hba->dma_mem) {
err = -ENOMEM;
printk(KERN_ERR DRV_NAME "(%s): dma mem alloc failed\n",
@@ -1218,8 +1231,6 @@ stex_probe(struct pci_dev *pdev, const s
hba->copy_buffer = hba->dma_mem + MU_BUFFER_SIZE;
hba->mu_status = MU_STATE_STARTING;
- hba->cardtype = (unsigned int) id->driver_data;
-
/* firmware uses id/lun pair for a logical drive, but lun would be
always 0 if CONFIG_SCSI_MULTI_LUN not configured, so we use
channel to map lun here */
@@ -1267,7 +1278,7 @@ stex_probe(struct pci_dev *pdev, const s
out_free_irq:
free_irq(pdev->irq, hba);
out_pci_free:
- dma_free_coherent(&pdev->dev, STEX_BUFFER_SIZE,
+ dma_free_coherent(&pdev->dev, hba->dma_size,
hba->dma_mem, hba->dma_handle);
out_iounmap:
iounmap(hba->mmio_base);
@@ -1328,7 +1339,7 @@ static void stex_hba_free(struct st_hba
pci_release_regions(hba->pdev);
- dma_free_coherent(&hba->pdev->dev, STEX_BUFFER_SIZE,
+ dma_free_coherent(&hba->pdev->dev, hba->dma_size,
hba->dma_mem, hba->dma_handle);
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 6/8] stex: add new device type support
2006-12-02 4:44 [PATCH 6/8] stex: add new device type support Ed Lin
@ 2006-12-02 5:04 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2006-12-02 5:04 UTC (permalink / raw)
To: Ed Lin; +Cc: linux-scsi, James.Bottomley, promise_linux
Ed Lin wrote:
> Add support for st_vsc1 type device (st_vsc0 is ok because it does not
> require extra buffer).
>
> Signed-off-by: Ed Lin <ed.lin@promise.com>
ACK patches 6-8
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-12-02 5:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-02 4:44 [PATCH 6/8] stex: add new device type support Ed Lin
2006-12-02 5:04 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).