- patches.suse/slab-handle-memoryless-nodes-v2a.patch: Refresh.
[linux-flexiantxendom0-3.2.10.git] / drivers / scsi / bfa / include / fcs / bfa_fcs.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_FCS_H__
19 #define __BFA_FCS_H__
20
21 #include <cs/bfa_debug.h>
22 #include <defs/bfa_defs_status.h>
23 #include <defs/bfa_defs_version.h>
24 #include <bfa.h>
25 #include <fcs/bfa_fcs_fabric.h>
26
27 #define BFA_FCS_OS_STR_LEN              64
28
29 struct bfa_fcs_stats_s {
30         struct {
31                 u32        untagged; /*  untagged receive frames */
32                 u32        tagged;      /*  tagged receive frames */
33                 u32        vfid_unknown;        /*  VF id is unknown */
34         } uf;
35 };
36
37 struct bfa_fcs_driver_info_s {
38         u8  version[BFA_VERSION_LEN];           /*  Driver Version */
39         u8  host_machine_name[BFA_FCS_OS_STR_LEN];
40         u8  host_os_name[BFA_FCS_OS_STR_LEN]; /*  OS name and version */
41         u8  host_os_patch[BFA_FCS_OS_STR_LEN];/*  patch or service pack */
42         u8  os_device_name[BFA_FCS_OS_STR_LEN]; /*  Driver Device Name */
43 };
44
45 struct bfa_fcs_s {
46         struct bfa_s      *bfa; /*  corresponding BFA bfa instance */
47         struct bfad_s         *bfad; /*  corresponding BDA driver instance */
48         struct bfa_log_mod_s  *logm;    /*  driver logging module instance */
49         struct bfa_trc_mod_s  *trcmod;  /*  tracing module */
50         struct bfa_aen_s      *aen;     /*  aen component */
51         bfa_boolean_t   vf_enabled;     /*  VF mode is enabled */
52         bfa_boolean_t min_cfg;          /* min cfg enabled/disabled */
53         u16        port_vfid;   /*  port default VF ID */
54         struct bfa_fcs_driver_info_s driver_info;
55         struct bfa_fcs_fabric_s fabric; /*  base fabric state machine */
56         struct bfa_fcs_stats_s  stats;  /*  FCS statistics */
57         struct bfa_wc_s         wc;     /*  waiting counter */
58 };
59
60 /*
61  * bfa fcs API functions
62  */
63 void bfa_fcs_init(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
64                         bfa_boolean_t min_cfg);
65 void bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs,
66                         struct bfa_fcs_driver_info_s *driver_info);
67 void bfa_fcs_exit(struct bfa_fcs_s *fcs);
68 void bfa_fcs_trc_init(struct bfa_fcs_s *fcs, struct bfa_trc_mod_s *trcmod);
69 void bfa_fcs_log_init(struct bfa_fcs_s *fcs, struct bfa_log_mod_s *logmod);
70 void bfa_fcs_aen_init(struct bfa_fcs_s *fcs, struct bfa_aen_s *aen);
71 void            bfa_fcs_start(struct bfa_fcs_s *fcs);
72
73 #endif /* __BFA_FCS_H__ */