From 5c07a311a80adb0138fc08e8279c60255d88d0b8 Mon Sep 17 00:00:00 2001 From: Don Brace Date: Thu, 12 Nov 2009 12:50:01 -0600 Subject: cciss: Add enhanced scatter-gather support. cciss: Add enhanced scatter-gather support. For controllers which supported, more than 512 scatter-gather elements per command may be used, and the max transfer size can be increased to 8192 blocks. Signed-off-by: Don Brace Signed-off-by: Stephen M. Cameron Signed-off-by: Jens Axboe --- drivers/block/cciss.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'drivers/block/cciss.h') diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h index 31524cf42c7..e5c63e579ff 100644 --- a/drivers/block/cciss.h +++ b/drivers/block/cciss.h @@ -55,7 +55,13 @@ typedef struct _drive_info_struct char device_initialized; /* indicates whether dev is initialized */ } drive_info_struct; -struct ctlr_info +struct Cmd_sg_list { + SGDescriptor_struct *sgchain; + dma64_addr_t sg_chain_dma; + int chain_block_size; +}; + +struct ctlr_info { int ctlr; char devname[8]; @@ -75,6 +81,16 @@ struct ctlr_info int num_luns; int highest_lun; int usage_count; /* number of opens all all minor devices */ + /* Need space for temp sg list + * number of scatter/gathers supported + * number of scatter/gathers in chained block + */ + struct scatterlist **scatter_list; + int maxsgentries; + int chainsize; + int max_cmd_sgentries; + struct Cmd_sg_list **cmd_sg_list; + # define DOORBELL_INT 0 # define PERF_MODE_INT 1 # define SIMPLE_MODE_INT 2 -- cgit From 32a87c0114f37871aefb12a30de3e0c3300e3646 Mon Sep 17 00:00:00 2001 From: Alex Chiang Date: Mon, 23 Nov 2009 09:35:06 +0100 Subject: cciss: change Cmd_sg_list.sg_chain_dma type to dma_addr_t A recent commit broke the ia64 build: Author: Don Brace Date: Thu Nov 12 12:50:01 2009 -0600 cciss: Add enhanced scatter-gather support. because of this hunk: --- a/drivers/block/cciss.h +++ b/drivers/block/cciss.h +struct Cmd_sg_list { + SGDescriptor_struct *sgchain; + dma64_addr_t sg_chain_dma; + int chain_block_size; +}; The issue is that dma64_addr_t isn't #define'd on ia64. The way that we're using Cmd_sg_list.sg_chain_dma is to hold an address returned from pci_map_single(). + temp64.val = pci_map_single(h->pdev, + h->cmd_sg_list[c->cmdindex]->sgchain, + len, dir); + + h->cmd_sg_list[c->cmdindex]->sg_chain_dma = temp64.val; pci_map_single() returns a dma_addr_t too. This code will still work even on a 32-bit x86 build, where dma_addr_t is defined to be a u32 because it will simply be promoted to the __u64 that temp64.val is defined as. Thus, declaring Cmd_sg_list.sg_chain_dma as dma_addr_t is safe. Cc: Don Brace Cc: Stephen M. Cameron Signed-off-by: Alex Chiang Signed-off-by: Jens Axboe --- drivers/block/cciss.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/block/cciss.h') diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h index e5c63e579ff..1d95db25406 100644 --- a/drivers/block/cciss.h +++ b/drivers/block/cciss.h @@ -57,7 +57,7 @@ typedef struct _drive_info_struct struct Cmd_sg_list { SGDescriptor_struct *sgchain; - dma64_addr_t sg_chain_dma; + dma_addr_t sg_chain_dma; int chain_block_size; }; -- cgit