[SCSI] bfa: Rename pport to fcport in BFA FCS.
[safe/jmp/linux-2.6] / drivers / scsi / bfa / include / defs / bfa_defs_iocfc.h
1 /*
2  * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
3  * All rights reserved
4  * www.brocade.com
5  *
6  * Linux driver for Brocade Fibre Channel Host Bus Adapter.
7  *
8  * This program is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License (GPL) Version 2 as
10  * published by the Free Software Foundation
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License for more details.
16  */
17
18 #ifndef __BFA_DEFS_IOCFC_H__
19 #define __BFA_DEFS_IOCFC_H__
20
21 #include <protocol/types.h>
22 #include <defs/bfa_defs_types.h>
23 #include <defs/bfa_defs_version.h>
24 #include <defs/bfa_defs_adapter.h>
25 #include <defs/bfa_defs_pm.h>
26
27 #define BFA_IOCFC_INTR_DELAY    1125
28 #define BFA_IOCFC_INTR_LATENCY  225
29 #define BFA_IOCFCOE_INTR_DELAY  25
30 #define BFA_IOCFCOE_INTR_LATENCY 5
31
32 /**
33  * Interrupt coalescing configuration.
34  */
35 struct bfa_iocfc_intr_attr_s {
36         bfa_boolean_t   coalesce;       /*  enable/disable coalescing */
37         u16     latency;        /*  latency in microseconds   */
38         u16     delay;          /*  delay in microseconds     */
39 };
40
41 /**
42  * IOC firmware configuraton
43  */
44 struct bfa_iocfc_fwcfg_s {
45         u16        num_fabrics; /*  number of fabrics           */
46         u16        num_lports;  /*  number of local lports      */
47         u16        num_rports;  /*  number of remote ports      */
48         u16        num_ioim_reqs;       /*  number of IO reqs           */
49         u16        num_tskim_reqs;      /*  task management requests    */
50         u16        num_iotm_reqs;       /*  number of TM IO reqs        */
51         u16        num_tsktm_reqs;      /*  TM task management requests*/
52         u16        num_fcxp_reqs;       /*  unassisted FC exchanges     */
53         u16        num_uf_bufs; /*  unsolicited recv buffers    */
54         u8              num_cqs;
55         u8              rsvd[5];
56 };
57
58 struct bfa_iocfc_drvcfg_s {
59         u16        num_reqq_elems;      /*  number of req queue elements */
60         u16        num_rspq_elems;      /*  number of rsp queue elements */
61         u16        num_sgpgs;   /*  number of total SG pages      */
62         u16        num_sboot_tgts;      /*  number of SAN boot targets    */
63         u16        num_sboot_luns;      /*  number of SAN boot luns       */
64         u16         ioc_recover;        /*  IOC recovery mode             */
65         u16         min_cfg;    /*  minimum configuration         */
66         u16        path_tov;    /*  device path timeout   */
67         bfa_boolean_t   delay_comp; /*  delay completion of
68                                                         failed inflight IOs */
69         u32             rsvd;
70 };
71 /**
72  * IOC configuration
73  */
74 struct bfa_iocfc_cfg_s {
75         struct bfa_iocfc_fwcfg_s        fwcfg;  /*  firmware side config */
76         struct bfa_iocfc_drvcfg_s       drvcfg; /*  driver side config    */
77 };
78
79 /**
80  * IOC firmware IO stats
81  */
82 struct bfa_fw_io_stats_s {
83         u32     host_abort;             /*  IO aborted by host driver*/
84         u32     host_cleanup;           /*  IO clean up by host driver */
85
86         u32     fw_io_timeout;          /*  IOs timedout */
87         u32     fw_frm_parse;           /*  frame parsed by f/w */
88         u32     fw_frm_data;            /*  fcp_data frame parsed by f/w */
89         u32     fw_frm_rsp;             /*  fcp_rsp frame parsed by f/w */
90         u32     fw_frm_xfer_rdy;        /*  xfer_rdy frame parsed by f/w */
91         u32     fw_frm_bls_acc;         /*  BLS ACC  frame parsed by f/w */
92         u32     fw_frm_tgt_abort;       /*  target ABTS parsed by f/w */
93         u32     fw_frm_unknown;         /*  unknown parsed by f/w */
94         u32     fw_data_dma;            /*  f/w DMA'ed the data frame */
95         u32     fw_frm_drop;            /*  f/w drop the frame */
96
97         u32     rec_timeout;            /*  FW rec timed out */
98         u32     error_rec;                      /*  FW sending rec on
99                                                         * an error condition*/
100         u32     wait_for_si;            /*  FW wait for SI */
101         u32     rec_rsp_inval;          /*  REC rsp invalid */
102         u32     seqr_io_abort;          /*  target does not know cmd so abort */
103         u32     seqr_io_retry;          /*  SEQR failed so retry IO */
104
105         u32     itn_cisc_upd_rsp;       /*  ITN cisc updated on fcp_rsp */
106         u32     itn_cisc_upd_data;      /*  ITN cisc updated on fcp_data */
107         u32     itn_cisc_upd_xfer_rdy;  /*  ITN cisc updated on fcp_data */
108
109         u32     fcp_data_lost;          /*  fcp data lost */
110
111         u32     ro_set_in_xfer_rdy;     /*  Target set RO in Xfer_rdy frame */
112         u32     xfer_rdy_ooo_err;       /*  Out of order Xfer_rdy received */
113         u32     xfer_rdy_unknown_err;   /*  unknown error in xfer_rdy frame */
114
115         u32     io_abort_timeout;       /*  ABTS timedout  */
116         u32     sler_initiated;         /*  SLER initiated */
117
118         u32     unexp_fcp_rsp;          /*  fcp response in wrong state */
119
120         u32     fcp_rsp_under_run;      /*  fcp rsp IO underrun */
121         u32        fcp_rsp_under_run_wr;   /*  fcp rsp IO underrun for write */
122         u32     fcp_rsp_under_run_err;  /*  fcp rsp IO underrun error */
123         u32        fcp_rsp_resid_inval;    /*  invalid residue */
124         u32     fcp_rsp_over_run;       /*  fcp rsp IO overrun */
125         u32     fcp_rsp_over_run_err;   /*  fcp rsp IO overrun error */
126         u32     fcp_rsp_proto_err;      /*  protocol error in fcp rsp */
127         u32     fcp_rsp_sense_err;      /*  error in sense info in fcp rsp */
128         u32     fcp_conf_req;           /*  FCP conf requested */
129
130         u32     tgt_aborted_io;         /*  target initiated abort */
131
132         u32     ioh_edtov_timeout_event;/*  IOH edtov timer popped */
133         u32     ioh_fcp_rsp_excp_event; /*  IOH FCP_RSP exception */
134         u32     ioh_fcp_conf_event;     /*  IOH FCP_CONF */
135         u32     ioh_mult_frm_rsp_event; /*  IOH multi_frame FCP_RSP */
136         u32     ioh_hit_class2_event;   /*  IOH hit class2 */
137         u32     ioh_miss_other_event;   /*  IOH miss other */
138         u32     ioh_seq_cnt_err_event;  /*  IOH seq cnt error */
139         u32     ioh_len_err_event;              /*  IOH len error - fcp_dl !=
140                                                         * bytes xfered */
141         u32     ioh_seq_len_err_event;  /*  IOH seq len error */
142         u32     ioh_data_oor_event;     /*  Data out of range */
143         u32     ioh_ro_ooo_event;       /*  Relative offset out of range */
144         u32     ioh_cpu_owned_event;    /*  IOH hit -iost owned by f/w */
145         u32     ioh_unexp_frame_event;  /*  unexpected frame recieved
146                                                  *   count */
147         u32     ioh_err_int;            /*  IOH error int during data-phase
148                                                  *   for scsi write
149                                                  */
150 };
151
152 /**
153  * IOC port firmware stats
154  */
155
156 struct bfa_fw_port_fpg_stats_s {
157     u32    intr_evt;
158     u32    intr;
159     u32    intr_excess;
160     u32    intr_cause0;
161     u32    intr_other;
162     u32    intr_other_ign;
163     u32    sig_lost;
164     u32    sig_regained;
165     u32    sync_lost;
166     u32    sync_to;
167     u32    sync_regained;
168     u32    div2_overflow;
169     u32    div2_underflow;
170     u32    efifo_overflow;
171     u32    efifo_underflow;
172     u32    idle_rx;
173     u32    lrr_rx;
174     u32    lr_rx;
175     u32    ols_rx;
176     u32    nos_rx;
177     u32    lip_rx;
178     u32    arbf0_rx;
179     u32    mrk_rx;
180     u32    const_mrk_rx;
181     u32    prim_unknown;
182     u32    rsvd;
183 };
184
185
186 struct bfa_fw_port_lksm_stats_s {
187     u32    hwsm_success;       /*  hwsm state machine success          */
188     u32    hwsm_fails;         /*  hwsm fails                          */
189     u32    hwsm_wdtov;         /*  hwsm timed out                      */
190     u32    swsm_success;       /*  swsm success                        */
191     u32    swsm_fails;         /*  swsm fails                          */
192     u32    swsm_wdtov;         /*  swsm timed out                      */
193     u32    busybufs;           /*  link init failed due to busybuf     */
194     u32    buf_waits;          /*  bufwait state entries               */
195     u32    link_fails;         /*  link failures                       */
196     u32    psp_errors;         /*  primitive sequence protocol errors  */
197     u32    lr_unexp;           /*  No. of times LR rx-ed unexpectedly  */
198     u32    lrr_unexp;          /*  No. of times LRR rx-ed unexpectedly */
199     u32    lr_tx;              /*  No. of times LR tx started          */
200     u32    lrr_tx;             /*  No. of times LRR tx started         */
201     u32    ols_tx;             /*  No. of times OLS tx started         */
202     u32    nos_tx;             /*  No. of times NOS tx started         */
203 };
204
205
206 struct bfa_fw_port_snsm_stats_s {
207     u32    hwsm_success;       /*  Successful hwsm terminations        */
208     u32    hwsm_fails;         /*  hwsm fail count                     */
209     u32    hwsm_wdtov;         /*  hwsm timed out                      */
210     u32    swsm_success;       /*  swsm success                        */
211     u32    swsm_wdtov;         /*  swsm timed out                      */
212     u32    error_resets;       /*  error resets initiated by upsm      */
213     u32    sync_lost;          /*  Sync loss count                     */
214     u32    sig_lost;           /*  Signal loss count                   */
215 };
216
217
218 struct bfa_fw_port_physm_stats_s {
219     u32    module_inserts;     /*  Module insert count                 */
220     u32    module_xtracts;     /*  Module extracts count               */
221     u32    module_invalids;    /*  Invalid module inserted count       */
222     u32    module_read_ign;    /*  Module validation status ignored    */
223     u32    laser_faults;       /*  Laser fault count                   */
224     u32    rsvd;
225 };
226
227
228 struct bfa_fw_fip_stats_s {
229     u32    vlan_req;           /*  vlan discovery requests             */
230     u32    vlan_notify;        /*  vlan notifications                  */
231     u32    vlan_err;           /*  vlan response error                 */
232     u32    vlan_timeouts;      /*  vlan disvoery timeouts              */
233     u32    vlan_invalids;      /*  invalid vlan in discovery advert.   */
234     u32    disc_req;           /*  Discovery solicit requests          */
235     u32    disc_rsp;           /*  Discovery solicit response          */
236     u32    disc_err;           /*  Discovery advt. parse errors        */
237     u32    disc_unsol;         /*  Discovery unsolicited               */
238     u32    disc_timeouts;      /*  Discovery timeouts                  */
239     u32    disc_fcf_unavail;   /*  Discovery FCF Not Avail.            */
240     u32    linksvc_unsupp;     /*  Unsupported link service req        */
241     u32    linksvc_err;        /*  Parse error in link service req     */
242     u32    logo_req;           /*  Number of FIP logos received        */
243     u32    clrvlink_req;       /*  Clear virtual link req              */
244     u32    op_unsupp;          /*  Unsupported FIP operation           */
245     u32    untagged;           /*  Untagged frames (ignored)           */
246     u32    invalid_version;    /*!< Invalid FIP version           */
247 };
248
249
250 struct bfa_fw_lps_stats_s {
251     u32    mac_invalids;       /*  Invalid mac assigned                */
252     u32    rsvd;
253 };
254
255
256 struct bfa_fw_fcoe_stats_s {
257     u32    cee_linkups;        /*  CEE link up count                   */
258     u32    cee_linkdns;        /*  CEE link down count                 */
259     u32    fip_linkups;        /*  FIP link up count                   */
260     u32    fip_linkdns;        /*  FIP link up count                   */
261     u32    fip_fails;          /*  FIP fail count                      */
262     u32    mac_invalids;       /*  Invalid mac assigned                */
263 };
264
265 /**
266  * IOC firmware FCoE port stats
267  */
268 struct bfa_fw_fcoe_port_stats_s {
269     struct bfa_fw_fcoe_stats_s  fcoe_stats;
270     struct bfa_fw_fip_stats_s   fip_stats;
271 };
272
273 /**
274  * IOC firmware FC port stats
275  */
276 struct bfa_fw_fc_port_stats_s {
277         struct bfa_fw_port_fpg_stats_s          fpg_stats;
278         struct bfa_fw_port_physm_stats_s        physm_stats;
279         struct bfa_fw_port_snsm_stats_s         snsm_stats;
280         struct bfa_fw_port_lksm_stats_s         lksm_stats;
281 };
282
283 /**
284  * IOC firmware FC port stats
285  */
286 union bfa_fw_port_stats_s {
287         struct bfa_fw_fc_port_stats_s   fc_stats;
288         struct bfa_fw_fcoe_port_stats_s fcoe_stats;
289 };
290
291 /**
292  * IOC firmware stats
293  */
294 struct bfa_fw_stats_s {
295         struct bfa_fw_ioc_stats_s       ioc_stats;
296         struct bfa_fw_io_stats_s        io_stats;
297         union  bfa_fw_port_stats_s      port_stats;
298 };
299
300 /**
301  * IOC statistics
302  */
303 struct bfa_iocfc_stats_s {
304         struct bfa_fw_stats_s   fw_stats;       /*  firmware IOC stats      */
305 };
306
307 /**
308  * IOC attributes returned in queries
309  */
310 struct bfa_iocfc_attr_s {
311         struct bfa_iocfc_cfg_s          config;         /*  IOCFC config   */
312         struct bfa_iocfc_intr_attr_s    intr_attr;      /*  interrupt attr */
313 };
314
315 #define BFA_IOCFC_PATHTOV_MAX   60
316 #define BFA_IOCFC_QDEPTH_MAX    2000
317
318 #endif /* __BFA_DEFS_IOC_H__ */