1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#ifndef __BFA_PORTLOG_H__
19#define __BFA_PORTLOG_H__
20
21#include "bfa_fc.h"
22#include "bfa_defs.h"
23
24#define BFA_PL_NLOG_ENTS 256
25#define BFA_PL_LOG_REC_INCR(_x) ((_x)++, (_x) %= BFA_PL_NLOG_ENTS)
26
27#define BFA_PL_STRING_LOG_SZ 32
28#define BFA_PL_INT_LOG_SZ 8
29
30enum bfa_plog_log_type {
31 BFA_PL_LOG_TYPE_INVALID = 0,
32 BFA_PL_LOG_TYPE_INT = 1,
33 BFA_PL_LOG_TYPE_STRING = 2,
34};
35
36
37
38
39struct bfa_plog_rec_s {
40 u64 tv;
41 u8 port;
42 u8 mid;
43 u8 eid;
44 u8 log_type;
45 u8 log_num_ints;
46
47
48
49
50 u8 rsvd;
51 u16 misc;
52 union {
53 char string_log[BFA_PL_STRING_LOG_SZ];
54 u32 int_log[BFA_PL_INT_LOG_SZ];
55 } log_entry;
56
57};
58
59
60
61
62
63
64
65
66
67
68enum bfa_plog_mid {
69 BFA_PL_MID_INVALID = 0,
70 BFA_PL_MID_DEBUG = 1,
71 BFA_PL_MID_DRVR = 2,
72 BFA_PL_MID_HAL = 3,
73 BFA_PL_MID_HAL_FCXP = 4,
74 BFA_PL_MID_HAL_UF = 5,
75 BFA_PL_MID_FCS = 6,
76 BFA_PL_MID_LPS = 7,
77 BFA_PL_MID_MAX = 8
78};
79
80#define BFA_PL_MID_STRLEN 8
81struct bfa_plog_mid_strings_s {
82 char m_str[BFA_PL_MID_STRLEN];
83};
84
85
86
87
88
89
90
91
92
93
94enum bfa_plog_eid {
95 BFA_PL_EID_INVALID = 0,
96 BFA_PL_EID_IOC_DISABLE = 1,
97 BFA_PL_EID_IOC_ENABLE = 2,
98 BFA_PL_EID_PORT_DISABLE = 3,
99 BFA_PL_EID_PORT_ENABLE = 4,
100 BFA_PL_EID_PORT_ST_CHANGE = 5,
101 BFA_PL_EID_TX = 6,
102 BFA_PL_EID_TX_ACK1 = 7,
103 BFA_PL_EID_TX_RJT = 8,
104 BFA_PL_EID_TX_BSY = 9,
105 BFA_PL_EID_RX = 10,
106 BFA_PL_EID_RX_ACK1 = 11,
107 BFA_PL_EID_RX_RJT = 12,
108 BFA_PL_EID_RX_BSY = 13,
109 BFA_PL_EID_CT_IN = 14,
110 BFA_PL_EID_CT_OUT = 15,
111 BFA_PL_EID_DRIVER_START = 16,
112 BFA_PL_EID_RSCN = 17,
113 BFA_PL_EID_DEBUG = 18,
114 BFA_PL_EID_MISC = 19,
115 BFA_PL_EID_FIP_FCF_DISC = 20,
116 BFA_PL_EID_FIP_FCF_CVL = 21,
117 BFA_PL_EID_LOGIN = 22,
118 BFA_PL_EID_LOGO = 23,
119 BFA_PL_EID_TRUNK_SCN = 24,
120 BFA_PL_EID_MAX
121};
122
123#define BFA_PL_ENAME_STRLEN 8
124struct bfa_plog_eid_strings_s {
125 char e_str[BFA_PL_ENAME_STRLEN];
126};
127
128#define BFA_PL_SIG_LEN 8
129#define BFA_PL_SIG_STR "12pl123"
130
131
132
133
134struct bfa_plog_s {
135 char plog_sig[BFA_PL_SIG_LEN];
136 u8 plog_enabled;
137 u8 rsvd[7];
138 u32 ticks;
139 u16 head;
140 u16 tail;
141 struct bfa_plog_rec_s plog_recs[BFA_PL_NLOG_ENTS];
142};
143
144void bfa_plog_init(struct bfa_plog_s *plog);
145void bfa_plog_str(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
146 enum bfa_plog_eid event, u16 misc, char *log_str);
147void bfa_plog_intarr(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
148 enum bfa_plog_eid event, u16 misc,
149 u32 *intarr, u32 num_ints);
150void bfa_plog_fchdr(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
151 enum bfa_plog_eid event, u16 misc, struct fchs_s *fchdr);
152void bfa_plog_fchdr_and_pl(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
153 enum bfa_plog_eid event, u16 misc,
154 struct fchs_s *fchdr, u32 pld_w0);
155
156#endif
157