diff options
Diffstat (limited to 'drivers/scsi/be2iscsi/be.h')
-rw-r--r-- | drivers/scsi/be2iscsi/be.h | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/drivers/scsi/be2iscsi/be.h b/drivers/scsi/be2iscsi/be.h index b36020dcf012..136b49cea791 100644 --- a/drivers/scsi/be2iscsi/be.h +++ b/drivers/scsi/be2iscsi/be.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /** | 1 | /** |
2 | * Copyright (C) 2005 - 2009 ServerEngines | 2 | * Copyright (C) 2005 - 2010 ServerEngines |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or | 5 | * This program is free software; you can redistribute it and/or |
@@ -20,8 +20,14 @@ | |||
20 | 20 | ||
21 | #include <linux/pci.h> | 21 | #include <linux/pci.h> |
22 | #include <linux/if_vlan.h> | 22 | #include <linux/if_vlan.h> |
23 | 23 | #include <linux/blk-iopoll.h> | |
24 | #define FW_VER_LEN 32 | 24 | #define FW_VER_LEN 32 |
25 | #define MCC_Q_LEN 128 | ||
26 | #define MCC_CQ_LEN 256 | ||
27 | #define MAX_MCC_CMD 16 | ||
28 | /* BladeEngine Generation numbers */ | ||
29 | #define BE_GEN2 2 | ||
30 | #define BE_GEN3 3 | ||
25 | 31 | ||
26 | struct be_dma_mem { | 32 | struct be_dma_mem { |
27 | void *va; | 33 | void *va; |
@@ -55,6 +61,11 @@ static inline void *queue_head_node(struct be_queue_info *q) | |||
55 | return q->dma_mem.va + q->head * q->entry_size; | 61 | return q->dma_mem.va + q->head * q->entry_size; |
56 | } | 62 | } |
57 | 63 | ||
64 | static inline void *queue_get_wrb(struct be_queue_info *q, unsigned int wrb_num) | ||
65 | { | ||
66 | return q->dma_mem.va + wrb_num * q->entry_size; | ||
67 | } | ||
68 | |||
58 | static inline void *queue_tail_node(struct be_queue_info *q) | 69 | static inline void *queue_tail_node(struct be_queue_info *q) |
59 | { | 70 | { |
60 | return q->dma_mem.va + q->tail * q->entry_size; | 71 | return q->dma_mem.va + q->tail * q->entry_size; |
@@ -74,18 +85,14 @@ static inline void queue_tail_inc(struct be_queue_info *q) | |||
74 | 85 | ||
75 | struct be_eq_obj { | 86 | struct be_eq_obj { |
76 | struct be_queue_info q; | 87 | struct be_queue_info q; |
77 | char desc[32]; | 88 | struct beiscsi_hba *phba; |
78 | 89 | struct be_queue_info *cq; | |
79 | /* Adaptive interrupt coalescing (AIC) info */ | 90 | struct blk_iopoll iopoll; |
80 | bool enable_aic; | ||
81 | u16 min_eqd; /* in usecs */ | ||
82 | u16 max_eqd; /* in usecs */ | ||
83 | u16 cur_eqd; /* in usecs */ | ||
84 | }; | 91 | }; |
85 | 92 | ||
86 | struct be_mcc_obj { | 93 | struct be_mcc_obj { |
87 | struct be_queue_info *q; | 94 | struct be_queue_info q; |
88 | struct be_queue_info *cq; | 95 | struct be_queue_info cq; |
89 | }; | 96 | }; |
90 | 97 | ||
91 | struct be_ctrl_info { | 98 | struct be_ctrl_info { |
@@ -106,15 +113,19 @@ struct be_ctrl_info { | |||
106 | spinlock_t mcc_lock; /* For serializing mcc cmds to BE card */ | 113 | spinlock_t mcc_lock; /* For serializing mcc cmds to BE card */ |
107 | spinlock_t mcc_cq_lock; | 114 | spinlock_t mcc_cq_lock; |
108 | 115 | ||
109 | /* MCC Async callback */ | 116 | wait_queue_head_t mcc_wait[MAX_MCC_CMD + 1]; |
110 | void (*async_cb) (void *adapter, bool link_up); | 117 | unsigned int mcc_tag[MAX_MCC_CMD]; |
111 | void *adapter_ctxt; | 118 | unsigned int mcc_numtag[MAX_MCC_CMD + 1]; |
119 | unsigned short mcc_alloc_index; | ||
120 | unsigned short mcc_free_index; | ||
121 | unsigned int mcc_tag_available; | ||
112 | }; | 122 | }; |
113 | 123 | ||
114 | #include "be_cmds.h" | 124 | #include "be_cmds.h" |
115 | 125 | ||
116 | #define PAGE_SHIFT_4K 12 | 126 | #define PAGE_SHIFT_4K 12 |
117 | #define PAGE_SIZE_4K (1 << PAGE_SHIFT_4K) | 127 | #define PAGE_SIZE_4K (1 << PAGE_SHIFT_4K) |
128 | #define mcc_timeout 120000 /* 5s timeout */ | ||
118 | 129 | ||
119 | /* Returns number of pages spanned by the data starting at the given addr */ | 130 | /* Returns number of pages spanned by the data starting at the given addr */ |
120 | #define PAGES_4K_SPANNED(_address, size) \ | 131 | #define PAGES_4K_SPANNED(_address, size) \ |
@@ -176,8 +187,4 @@ static inline void swap_dws(void *wrb, int len) | |||
176 | } while (len); | 187 | } while (len); |
177 | #endif /* __BIG_ENDIAN */ | 188 | #endif /* __BIG_ENDIAN */ |
178 | } | 189 | } |
179 | |||
180 | extern void beiscsi_cq_notify(struct be_ctrl_info *ctrl, u16 qid, bool arm, | ||
181 | u16 num_popped); | ||
182 | |||
183 | #endif /* BEISCSI_H */ | 190 | #endif /* BEISCSI_H */ |