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