aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_intr.c
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@pathscale.com>2006-09-28 12:00:08 -0400
committerRoland Dreier <rolandd@cisco.com>2006-09-28 14:16:43 -0400
commit8d588f8bb79c86a5826f66946c1ea026b6b07bd8 (patch)
tree472dfec24f59ac565cd97e67dd62f8df4fa93d24 /drivers/infiniband/hw/ipath/ipath_intr.c
parent6a553af286653818bb5831f1b351eefdc8a93b61 (diff)
IB/ipath: Print more informative parity error messages
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_intr.c')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_intr.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_intr.c b/drivers/infiniband/hw/ipath/ipath_intr.c
index 5762b87d12e..b58d35e85b5 100644
--- a/drivers/infiniband/hw/ipath/ipath_intr.c
+++ b/drivers/infiniband/hw/ipath/ipath_intr.c
@@ -132,6 +132,82 @@ static u64 handle_e_sum_errs(struct ipath_devdata *dd, ipath_err_t errs)
132 return ignore_this_time; 132 return ignore_this_time;
133} 133}
134 134
135/* generic hw error messages... */
136#define INFINIPATH_HWE_TXEMEMPARITYERR_MSG(a) \
137 { \
138 .mask = ( INFINIPATH_HWE_TXEMEMPARITYERR_##a << \
139 INFINIPATH_HWE_TXEMEMPARITYERR_SHIFT ), \
140 .msg = "TXE " #a " Memory Parity" \
141 }
142#define INFINIPATH_HWE_RXEMEMPARITYERR_MSG(a) \
143 { \
144 .mask = ( INFINIPATH_HWE_RXEMEMPARITYERR_##a << \
145 INFINIPATH_HWE_RXEMEMPARITYERR_SHIFT ), \
146 .msg = "RXE " #a " Memory Parity" \
147 }
148
149static const struct ipath_hwerror_msgs ipath_generic_hwerror_msgs[] = {
150 INFINIPATH_HWE_MSG(IBCBUSFRSPCPARITYERR, "IPATH2IB Parity"),
151 INFINIPATH_HWE_MSG(IBCBUSTOSPCPARITYERR, "IB2IPATH Parity"),
152
153 INFINIPATH_HWE_TXEMEMPARITYERR_MSG(PIOBUF),
154 INFINIPATH_HWE_TXEMEMPARITYERR_MSG(PIOPBC),
155 INFINIPATH_HWE_TXEMEMPARITYERR_MSG(PIOLAUNCHFIFO),
156
157 INFINIPATH_HWE_RXEMEMPARITYERR_MSG(RCVBUF),
158 INFINIPATH_HWE_RXEMEMPARITYERR_MSG(LOOKUPQ),
159 INFINIPATH_HWE_RXEMEMPARITYERR_MSG(EAGERTID),
160 INFINIPATH_HWE_RXEMEMPARITYERR_MSG(EXPTID),
161 INFINIPATH_HWE_RXEMEMPARITYERR_MSG(FLAGBUF),
162 INFINIPATH_HWE_RXEMEMPARITYERR_MSG(DATAINFO),
163 INFINIPATH_HWE_RXEMEMPARITYERR_MSG(HDRINFO),
164};
165
166/**
167 * ipath_format_hwmsg - format a single hwerror message
168 * @msg message buffer
169 * @msgl length of message buffer
170 * @hwmsg message to add to message buffer
171 */
172static void ipath_format_hwmsg(char *msg, size_t msgl, const char *hwmsg)
173{
174 strlcat(msg, "[", msgl);
175 strlcat(msg, hwmsg, msgl);
176 strlcat(msg, "]", msgl);
177}
178
179/**
180 * ipath_format_hwerrors - format hardware error messages for display
181 * @hwerrs hardware errors bit vector
182 * @hwerrmsgs hardware error descriptions
183 * @nhwerrmsgs number of hwerrmsgs
184 * @msg message buffer
185 * @msgl message buffer length
186 */
187void ipath_format_hwerrors(u64 hwerrs,
188 const struct ipath_hwerror_msgs *hwerrmsgs,
189 size_t nhwerrmsgs,
190 char *msg, size_t msgl)
191{
192 int i;
193 const int glen =
194 sizeof(ipath_generic_hwerror_msgs) /
195 sizeof(ipath_generic_hwerror_msgs[0]);
196
197 for (i=0; i<glen; i++) {
198 if (hwerrs & ipath_generic_hwerror_msgs[i].mask) {
199 ipath_format_hwmsg(msg, msgl,
200 ipath_generic_hwerror_msgs[i].msg);
201 }
202 }
203
204 for (i=0; i<nhwerrmsgs; i++) {
205 if (hwerrs & hwerrmsgs[i].mask) {
206 ipath_format_hwmsg(msg, msgl, hwerrmsgs[i].msg);
207 }
208 }
209}
210
135/* return the strings for the most common link states */ 211/* return the strings for the most common link states */
136static char *ib_linkstate(u32 linkstate) 212static char *ib_linkstate(u32 linkstate)
137{ 213{