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