aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi/be.h
diff options
context:
space:
mode:
authorJayamohan Kallickal <jayamohank@serverengines.com>2010-01-04 18:40:46 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-01-18 11:48:23 -0500
commit756d29c8c7ed8887ed7d752371ce2f6d12399267 (patch)
treeeb70b756dc22a798538b306010647b72709a6206 /drivers/scsi/be2iscsi/be.h
parent51a462500fbed4a1e8110dc60a421a3f12b9580b (diff)
[SCSI] be2iscsi: Enable async mode for mcc rings
This patches enables async mode for mcc rings so that multiple requests can be queued. Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/be2iscsi/be.h')
-rw-r--r--drivers/scsi/be2iscsi/be.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/scsi/be2iscsi/be.h b/drivers/scsi/be2iscsi/be.h
index a93a5040f087..3861cf44dc15 100644
--- a/drivers/scsi/be2iscsi/be.h
+++ b/drivers/scsi/be2iscsi/be.h
@@ -24,6 +24,7 @@
24#define FW_VER_LEN 32 24#define FW_VER_LEN 32
25#define MCC_Q_LEN 128 25#define MCC_Q_LEN 128
26#define MCC_CQ_LEN 256 26#define MCC_CQ_LEN 256
27#define MAX_MCC_CMD 16
27 28
28struct be_dma_mem { 29struct be_dma_mem {
29 void *va; 30 void *va;
@@ -57,6 +58,11 @@ static inline void *queue_head_node(struct be_queue_info *q)
57 return q->dma_mem.va + q->head * q->entry_size; 58 return q->dma_mem.va + q->head * q->entry_size;
58} 59}
59 60
61static inline void *queue_get_wrb(struct be_queue_info *q, unsigned int wrb_num)
62{
63 return q->dma_mem.va + wrb_num * q->entry_size;
64}
65
60static inline void *queue_tail_node(struct be_queue_info *q) 66static inline void *queue_tail_node(struct be_queue_info *q)
61{ 67{
62 return q->dma_mem.va + q->tail * q->entry_size; 68 return q->dma_mem.va + q->tail * q->entry_size;
@@ -104,15 +110,19 @@ struct be_ctrl_info {
104 spinlock_t mcc_lock; /* For serializing mcc cmds to BE card */ 110 spinlock_t mcc_lock; /* For serializing mcc cmds to BE card */
105 spinlock_t mcc_cq_lock; 111 spinlock_t mcc_cq_lock;
106 112
107 /* MCC Async callback */ 113 wait_queue_head_t mcc_wait[MAX_MCC_CMD + 1];
108 void (*async_cb) (void *adapter, bool link_up); 114 unsigned int mcc_tag[MAX_MCC_CMD];
109 void *adapter_ctxt; 115 unsigned int mcc_numtag[MAX_MCC_CMD + 1];
116 unsigned short mcc_alloc_index;
117 unsigned short mcc_free_index;
118 unsigned int mcc_tag_available;
110}; 119};
111 120
112#include "be_cmds.h" 121#include "be_cmds.h"
113 122
114#define PAGE_SHIFT_4K 12 123#define PAGE_SHIFT_4K 12
115#define PAGE_SIZE_4K (1 << PAGE_SHIFT_4K) 124#define PAGE_SIZE_4K (1 << PAGE_SHIFT_4K)
125#define mcc_timeout 120000 /* 5s timeout */
116 126
117/* Returns number of pages spanned by the data starting at the given addr */ 127/* Returns number of pages spanned by the data starting at the given addr */
118#define PAGES_4K_SPANNED(_address, size) \ 128#define PAGES_4K_SPANNED(_address, size) \