summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/include/defs/bfa_defs_ioc.h
blob: b1d532da3a9d4258254cc91dc6aaebbdeb01d9ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/*
 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
 * All rights reserved
 * www.brocade.com
 *
 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License (GPL) Version 2 as
 * published by the Free Software Foundation
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 */

#ifndef __BFA_DEFS_IOC_H__
#define __BFA_DEFS_IOC_H__

#include <protocol/types.h>
#include <defs/bfa_defs_types.h>
#include <defs/bfa_defs_version.h>
#include <defs/bfa_defs_adapter.h>
#include <defs/bfa_defs_pm.h>

enum {
	BFA_IOC_DRIVER_LEN	= 16,
	BFA_IOC_CHIP_REV_LEN 	= 8,
};

/**
 * Driver and firmware versions.
 */
struct bfa_ioc_driver_attr_s {
	char            driver[BFA_IOC_DRIVER_LEN];	/*  driver name */
	char            driver_ver[BFA_VERSION_LEN];	/*  driver version */
	char            fw_ver[BFA_VERSION_LEN];	/*  firmware version*/
	char            bios_ver[BFA_VERSION_LEN];	/*  bios version */
	char            efi_ver[BFA_VERSION_LEN];	/*  EFI version */
	char            ob_ver[BFA_VERSION_LEN];	/*  openboot version*/
};

/**
 * IOC PCI device attributes
 */
struct bfa_ioc_pci_attr_s {
	u16        vendor_id;	/*  PCI vendor ID */
	u16        device_id;	/*  PCI device ID */
	u16        ssid;		/*  subsystem ID */
	u16        ssvid;		/*  subsystem vendor ID */
	u32        pcifn;		/*  PCI device function */
	u32        rsvd;		/* padding */
	u8         chip_rev[BFA_IOC_CHIP_REV_LEN];	 /*  chip revision */
};

/**
 * IOC states
 */
enum bfa_ioc_state {
	BFA_IOC_RESET       = 1,  /*  IOC is in reset state */
	BFA_IOC_SEMWAIT     = 2,  /*  Waiting for IOC hardware semaphore */
	BFA_IOC_HWINIT 	    = 3,  /*  IOC hardware is being initialized */
	BFA_IOC_GETATTR     = 4,  /*  IOC is being configured */
	BFA_IOC_OPERATIONAL = 5,  /*  IOC is operational */
	BFA_IOC_INITFAIL    = 6,  /*  IOC hardware failure */
	BFA_IOC_HBFAIL      = 7,  /*  IOC heart-beat failure */
	BFA_IOC_DISABLING   = 8,  /*  IOC is being disabled */
	BFA_IOC_DISABLED    = 9,  /*  IOC is disabled */
	BFA_IOC_FWMISMATCH  = 10, /*  IOC firmware different from drivers */
};

/**
 * IOC firmware stats
 */
struct bfa_fw_ioc_stats_s {
	u32        hb_count;
	u32        cfg_reqs;
	u32        enable_reqs;
	u32        disable_reqs;
	u32        stats_reqs;
	u32        clrstats_reqs;
	u32        unknown_reqs;
	u32        ic_reqs;		/*  interrupt coalesce reqs */
};

/**
 * IOC driver stats
 */
struct bfa_ioc_drv_stats_s {
	u32	ioc_isrs;
	u32	ioc_enables;
	u32	ioc_disables;
	u32	ioc_hbfails;
	u32	ioc_boots;
	u32	stats_tmos;
	u32        hb_count;
	u32        disable_reqs;
	u32        enable_reqs;
	u32        disable_replies;
	u32        enable_replies;
};

/**
 * IOC statistics
 */
struct bfa_ioc_stats_s {
	struct bfa_ioc_drv_stats_s	drv_stats; /*  driver IOC stats */
	struct bfa_fw_ioc_stats_s 	fw_stats;  /*  firmware IOC stats */
};


enum bfa_ioc_type_e {
	BFA_IOC_TYPE_FC	  = 1,
	BFA_IOC_TYPE_FCoE = 2,
	BFA_IOC_TYPE_LL	  = 3,
};

/**
 * IOC attributes returned in queries
 */
struct bfa_ioc_attr_s {
	enum bfa_ioc_type_e		ioc_type;
	enum bfa_ioc_state 		state;		/*  IOC state      */
	struct bfa_adapter_attr_s	adapter_attr;	/*  HBA attributes */
	struct bfa_ioc_driver_attr_s 	driver_attr;	/*  driver attr    */
	struct bfa_ioc_pci_attr_s	pci_attr;
	u8				port_id;	/*  port number    */
};

/**
 * BFA IOC level events
 */
enum bfa_ioc_aen_event {
	BFA_IOC_AEN_HBGOOD	= 1,	/*  Heart Beat restore event	*/
	BFA_IOC_AEN_HBFAIL	= 2,	/*  Heart Beat failure event	*/
	BFA_IOC_AEN_ENABLE	= 3,	/*  IOC enabled event		*/
	BFA_IOC_AEN_DISABLE	= 4,	/*  IOC disabled event		*/
	BFA_IOC_AEN_FWMISMATCH	= 5,	/*  IOC firmware mismatch	*/
};

/**
 * BFA IOC level event data, now just a place holder
 */
struct bfa_ioc_aen_data_s {
	enum bfa_ioc_type_e ioc_type;
	wwn_t	pwwn;
	mac_t	mac;
};

#endif /* __BFA_DEFS_IOC_H__ */