aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_dbf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_dbf.c')
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index 96d1462e0bf5..967e7b70e977 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -163,6 +163,42 @@ void zfcp_dbf_hba_bit_err(char *tag, struct zfcp_fsf_req *req)
163 spin_unlock_irqrestore(&dbf->hba_lock, flags); 163 spin_unlock_irqrestore(&dbf->hba_lock, flags);
164} 164}
165 165
166/**
167 * zfcp_dbf_hba_def_err - trace event for deferred error messages
168 * @adapter: pointer to struct zfcp_adapter
169 * @req_id: request id which caused the deferred error message
170 * @scount: number of sbals incl. the signaling sbal
171 * @pl: array of all involved sbals
172 */
173void zfcp_dbf_hba_def_err(struct zfcp_adapter *adapter, u64 req_id, u16 scount,
174 void **pl)
175{
176 struct zfcp_dbf *dbf = adapter->dbf;
177 struct zfcp_dbf_pay *payload = &dbf->pay_buf;
178 unsigned long flags;
179 u16 length;
180
181 if (!pl)
182 return;
183
184 spin_lock_irqsave(&dbf->pay_lock, flags);
185 memset(payload, 0, sizeof(*payload));
186
187 memcpy(payload->area, "def_err", 7);
188 payload->fsf_req_id = req_id;
189 payload->counter = 0;
190 length = min((u16)sizeof(struct qdio_buffer),
191 (u16)ZFCP_DBF_PAY_MAX_REC);
192
193 while ((char *)pl[payload->counter] && payload->counter < scount) {
194 memcpy(payload->data, (char *)pl[payload->counter], length);
195 debug_event(dbf->pay, 1, payload, zfcp_dbf_plen(length));
196 payload->counter++;
197 }
198
199 spin_unlock_irqrestore(&dbf->pay_lock, flags);
200}
201
166static void zfcp_dbf_set_common(struct zfcp_dbf_rec *rec, 202static void zfcp_dbf_set_common(struct zfcp_dbf_rec *rec,
167 struct zfcp_adapter *adapter, 203 struct zfcp_adapter *adapter,
168 struct zfcp_port *port, 204 struct zfcp_port *port,