diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.h')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.h | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h index 41c38d324ab0..76058505795e 100644 --- a/drivers/scsi/lpfc/lpfc_sli.h +++ b/drivers/scsi/lpfc/lpfc_sli.h | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | /* forward declaration for LPFC_IOCB_t's use */ | 21 | /* forward declaration for LPFC_IOCB_t's use */ |
22 | struct lpfc_hba; | 22 | struct lpfc_hba; |
23 | struct lpfc_vport; | ||
23 | 24 | ||
24 | /* Define the context types that SLI handles for abort and sums. */ | 25 | /* Define the context types that SLI handles for abort and sums. */ |
25 | typedef enum _lpfc_ctx_cmd { | 26 | typedef enum _lpfc_ctx_cmd { |
@@ -43,10 +44,12 @@ struct lpfc_iocbq { | |||
43 | #define LPFC_IO_WAKE 2 /* High Priority Queue signal flag */ | 44 | #define LPFC_IO_WAKE 2 /* High Priority Queue signal flag */ |
44 | #define LPFC_IO_FCP 4 /* FCP command -- iocbq in scsi_buf */ | 45 | #define LPFC_IO_FCP 4 /* FCP command -- iocbq in scsi_buf */ |
45 | #define LPFC_DRIVER_ABORTED 8 /* driver aborted this request */ | 46 | #define LPFC_DRIVER_ABORTED 8 /* driver aborted this request */ |
47 | #define LPFC_IO_FABRIC 0x10 /* Iocb send using fabric scheduler */ | ||
46 | 48 | ||
47 | uint8_t abort_count; | 49 | uint8_t abort_count; |
48 | uint8_t rsvd2; | 50 | uint8_t rsvd2; |
49 | uint32_t drvrTimeout; /* driver timeout in seconds */ | 51 | uint32_t drvrTimeout; /* driver timeout in seconds */ |
52 | struct lpfc_vport *vport;/* virtual port pointer */ | ||
50 | void *context1; /* caller context information */ | 53 | void *context1; /* caller context information */ |
51 | void *context2; /* caller context information */ | 54 | void *context2; /* caller context information */ |
52 | void *context3; /* caller context information */ | 55 | void *context3; /* caller context information */ |
@@ -56,6 +59,8 @@ struct lpfc_iocbq { | |||
56 | struct lpfcMboxq *mbox; | 59 | struct lpfcMboxq *mbox; |
57 | } context_un; | 60 | } context_un; |
58 | 61 | ||
62 | void (*fabric_iocb_cmpl) (struct lpfc_hba *, struct lpfc_iocbq *, | ||
63 | struct lpfc_iocbq *); | ||
59 | void (*iocb_cmpl) (struct lpfc_hba *, struct lpfc_iocbq *, | 64 | void (*iocb_cmpl) (struct lpfc_hba *, struct lpfc_iocbq *, |
60 | struct lpfc_iocbq *); | 65 | struct lpfc_iocbq *); |
61 | 66 | ||
@@ -68,12 +73,14 @@ struct lpfc_iocbq { | |||
68 | #define IOCB_ERROR 2 | 73 | #define IOCB_ERROR 2 |
69 | #define IOCB_TIMEDOUT 3 | 74 | #define IOCB_TIMEDOUT 3 |
70 | 75 | ||
71 | #define LPFC_MBX_WAKE 1 | 76 | #define LPFC_MBX_WAKE 1 |
77 | #define LPFC_MBX_IMED_UNREG 2 | ||
72 | 78 | ||
73 | typedef struct lpfcMboxq { | 79 | typedef struct lpfcMboxq { |
74 | /* MBOXQs are used in single linked lists */ | 80 | /* MBOXQs are used in single linked lists */ |
75 | struct list_head list; /* ptr to next mailbox command */ | 81 | struct list_head list; /* ptr to next mailbox command */ |
76 | MAILBOX_t mb; /* Mailbox cmd */ | 82 | MAILBOX_t mb; /* Mailbox cmd */ |
83 | struct lpfc_vport *vport;/* virutal port pointer */ | ||
77 | void *context1; /* caller context information */ | 84 | void *context1; /* caller context information */ |
78 | void *context2; /* caller context information */ | 85 | void *context2; /* caller context information */ |
79 | 86 | ||
@@ -135,6 +142,8 @@ struct lpfc_sli_ring { | |||
135 | uint8_t ringno; /* ring number */ | 142 | uint8_t ringno; /* ring number */ |
136 | uint16_t numCiocb; /* number of command iocb's per ring */ | 143 | uint16_t numCiocb; /* number of command iocb's per ring */ |
137 | uint16_t numRiocb; /* number of rsp iocb's per ring */ | 144 | uint16_t numRiocb; /* number of rsp iocb's per ring */ |
145 | uint16_t sizeCiocb; /* Size of command iocb's in this ring */ | ||
146 | uint16_t sizeRiocb; /* Size of response iocb's in this ring */ | ||
138 | 147 | ||
139 | uint32_t fast_iotag; /* max fastlookup based iotag */ | 148 | uint32_t fast_iotag; /* max fastlookup based iotag */ |
140 | uint32_t iotag_ctr; /* keeps track of the next iotag to use */ | 149 | uint32_t iotag_ctr; /* keeps track of the next iotag to use */ |
@@ -165,6 +174,34 @@ struct lpfc_sli_ring { | |||
165 | struct lpfc_sli_ring *); | 174 | struct lpfc_sli_ring *); |
166 | }; | 175 | }; |
167 | 176 | ||
177 | /* Structure used for configuring rings to a specific profile or rctl / type */ | ||
178 | struct lpfc_hbq_init { | ||
179 | uint32_t rn; /* Receive buffer notification */ | ||
180 | uint32_t entry_count; /* max # of entries in HBQ */ | ||
181 | uint32_t headerLen; /* 0 if not profile 4 or 5 */ | ||
182 | uint32_t logEntry; /* Set to 1 if this HBQ used for LogEntry */ | ||
183 | uint32_t profile; /* Selection profile 0=all, 7=logentry */ | ||
184 | uint32_t ring_mask; /* Binds HBQ to a ring e.g. Ring0=b0001, | ||
185 | * ring2=b0100 */ | ||
186 | uint32_t hbq_index; /* index of this hbq in ring .HBQs[] */ | ||
187 | |||
188 | uint32_t seqlenoff; | ||
189 | uint32_t maxlen; | ||
190 | uint32_t seqlenbcnt; | ||
191 | uint32_t cmdcodeoff; | ||
192 | uint32_t cmdmatch[8]; | ||
193 | uint32_t mask_count; /* number of mask entries in prt array */ | ||
194 | struct hbq_mask hbqMasks[6]; | ||
195 | |||
196 | /* Non-config rings fields to keep track of buffer allocations */ | ||
197 | uint32_t buffer_count; /* number of buffers allocated */ | ||
198 | uint32_t init_count; /* number to allocate when initialized */ | ||
199 | uint32_t add_count; /* number to allocate when starved */ | ||
200 | } ; | ||
201 | |||
202 | #define LPFC_MAX_HBQ 16 | ||
203 | |||
204 | |||
168 | /* Structure used to hold SLI statistical counters and info */ | 205 | /* Structure used to hold SLI statistical counters and info */ |
169 | struct lpfc_sli_stat { | 206 | struct lpfc_sli_stat { |
170 | uint64_t mbox_stat_err; /* Mbox cmds completed status error */ | 207 | uint64_t mbox_stat_err; /* Mbox cmds completed status error */ |
@@ -197,6 +234,7 @@ struct lpfc_sli { | |||
197 | #define LPFC_SLI_MBOX_ACTIVE 0x100 /* HBA mailbox is currently active */ | 234 | #define LPFC_SLI_MBOX_ACTIVE 0x100 /* HBA mailbox is currently active */ |
198 | #define LPFC_SLI2_ACTIVE 0x200 /* SLI2 overlay in firmware is active */ | 235 | #define LPFC_SLI2_ACTIVE 0x200 /* SLI2 overlay in firmware is active */ |
199 | #define LPFC_PROCESS_LA 0x400 /* Able to process link attention */ | 236 | #define LPFC_PROCESS_LA 0x400 /* Able to process link attention */ |
237 | #define LPFC_BLOCK_MGMT_IO 0x800 /* Don't allow mgmt mbx or iocb cmds */ | ||
200 | 238 | ||
201 | struct lpfc_sli_ring ring[LPFC_MAX_RING]; | 239 | struct lpfc_sli_ring ring[LPFC_MAX_RING]; |
202 | int fcp_ring; /* ring used for FCP initiator commands */ | 240 | int fcp_ring; /* ring used for FCP initiator commands */ |
@@ -209,6 +247,7 @@ struct lpfc_sli { | |||
209 | uint16_t mboxq_cnt; /* current length of queue */ | 247 | uint16_t mboxq_cnt; /* current length of queue */ |
210 | uint16_t mboxq_max; /* max length */ | 248 | uint16_t mboxq_max; /* max length */ |
211 | LPFC_MBOXQ_t *mbox_active; /* active mboxq information */ | 249 | LPFC_MBOXQ_t *mbox_active; /* active mboxq information */ |
250 | struct list_head mboxq_cmpl; | ||
212 | 251 | ||
213 | struct timer_list mbox_tmo; /* Hold clk to timeout active mbox | 252 | struct timer_list mbox_tmo; /* Hold clk to timeout active mbox |
214 | cmd */ | 253 | cmd */ |
@@ -221,12 +260,6 @@ struct lpfc_sli { | |||
221 | struct lpfc_lnk_stat lnk_stat_offsets; | 260 | struct lpfc_lnk_stat lnk_stat_offsets; |
222 | }; | 261 | }; |
223 | 262 | ||
224 | /* Given a pointer to the start of the ring, and the slot number of | ||
225 | * the desired iocb entry, calc a pointer to that entry. | ||
226 | * (assume iocb entry size is 32 bytes, or 8 words) | ||
227 | */ | ||
228 | #define IOCB_ENTRY(ring,slot) ((IOCB_t *)(((char *)(ring)) + ((slot) * 32))) | ||
229 | |||
230 | #define LPFC_MBOX_TMO 30 /* Sec tmo for outstanding mbox | 263 | #define LPFC_MBOX_TMO 30 /* Sec tmo for outstanding mbox |
231 | command */ | 264 | command */ |
232 | #define LPFC_MBOX_TMO_FLASH_CMD 300 /* Sec tmo for outstanding FLASH write | 265 | #define LPFC_MBOX_TMO_FLASH_CMD 300 /* Sec tmo for outstanding FLASH write |