Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173756
b: refs/heads/master
c: 7c7dc19
h: refs/heads/master
v: v3
  • Loading branch information
Christof Schmitt authored and James Bottomley committed Dec 4, 2009
1 parent ae7e83c commit 617192f
Show file tree
Hide file tree
Showing 10 changed files with 161 additions and 286 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 800c0cad962dcf630cabf3efdc5983619e73d4c9
refs/heads/master: 7c7dc196814b9e1d5cc254dc579a5fa78ae524f7
56 changes: 21 additions & 35 deletions trunk/drivers/s390/scsi/zfcp_dbf.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ void _zfcp_dbf_hba_fsf_response(const char *tag2, int level,
case FSF_QTCB_SEND_ELS:
send_els = (struct zfcp_send_els *)fsf_req->data;
response->u.els.d_id = ntoh24(qtcb->bottom.support.d_id);
response->u.els.ls_code = send_els->ls_code >> 24;
break;

case FSF_QTCB_ABORT_FCP_CMND:
Expand Down Expand Up @@ -349,7 +348,6 @@ static void zfcp_dbf_hba_view_response(char **p,

case FSF_QTCB_SEND_ELS:
zfcp_dbf_out(p, "d_id", "0x%06x", r->u.els.d_id);
zfcp_dbf_out(p, "ls_code", "0x%02x", r->u.els.ls_code);
break;

case FSF_QTCB_ABORT_FCP_CMND:
Expand Down Expand Up @@ -678,12 +676,12 @@ void zfcp_dbf_rec_action(char *id2, struct zfcp_erp_action *erp_action)
/**
* zfcp_dbf_san_ct_request - trace event for issued CT request
* @fsf_req: request containing issued CT data
* @d_id: destination id where ct request is sent to
*/
void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *fsf_req)
void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *fsf_req, u32 d_id)
{
struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data;
struct zfcp_fc_wka_port *wka_port = ct->wka_port;
struct zfcp_adapter *adapter = wka_port->adapter;
struct zfcp_fsf_ct_els *ct = (struct zfcp_fsf_ct_els *)fsf_req->data;
struct zfcp_adapter *adapter = fsf_req->adapter;
struct zfcp_dbf *dbf = adapter->dbf;
struct fc_ct_hdr *hdr = sg_virt(ct->req);
struct zfcp_dbf_san_record *r = &dbf->san_buf;
Expand All @@ -696,8 +694,7 @@ void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *fsf_req)
strncpy(r->tag, "octc", ZFCP_DBF_TAG_SIZE);
r->fsf_reqid = fsf_req->req_id;
r->fsf_seqno = fsf_req->seq_no;
r->s_id = fc_host_port_id(adapter->scsi_host);
r->d_id = wka_port->d_id;
oct->d_id = d_id;
oct->cmd_req_code = hdr->ct_cmd;
oct->revision = hdr->ct_rev;
oct->gs_type = hdr->ct_fs_type;
Expand All @@ -718,9 +715,8 @@ void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *fsf_req)
*/
void zfcp_dbf_san_ct_response(struct zfcp_fsf_req *fsf_req)
{
struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data;
struct zfcp_fc_wka_port *wka_port = ct->wka_port;
struct zfcp_adapter *adapter = wka_port->adapter;
struct zfcp_fsf_ct_els *ct = (struct zfcp_fsf_ct_els *)fsf_req->data;
struct zfcp_adapter *adapter = fsf_req->adapter;
struct fc_ct_hdr *hdr = sg_virt(ct->resp);
struct zfcp_dbf *dbf = adapter->dbf;
struct zfcp_dbf_san_record *r = &dbf->san_buf;
Expand All @@ -733,8 +729,6 @@ void zfcp_dbf_san_ct_response(struct zfcp_fsf_req *fsf_req)
strncpy(r->tag, "rctc", ZFCP_DBF_TAG_SIZE);
r->fsf_reqid = fsf_req->req_id;
r->fsf_seqno = fsf_req->seq_no;
r->s_id = wka_port->d_id;
r->d_id = fc_host_port_id(adapter->scsi_host);
rct->cmd_rsp_code = hdr->ct_cmd;
rct->revision = hdr->ct_rev;
rct->reason_code = hdr->ct_reason;
Expand All @@ -750,8 +744,8 @@ void zfcp_dbf_san_ct_response(struct zfcp_fsf_req *fsf_req)
}

static void zfcp_dbf_san_els(const char *tag, int level,
struct zfcp_fsf_req *fsf_req, u32 s_id, u32 d_id,
u8 ls_code, void *buffer, int buflen)
struct zfcp_fsf_req *fsf_req, u32 d_id,
void *buffer, int buflen)
{
struct zfcp_adapter *adapter = fsf_req->adapter;
struct zfcp_dbf *dbf = adapter->dbf;
Expand All @@ -763,9 +757,7 @@ static void zfcp_dbf_san_els(const char *tag, int level,
strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE);
rec->fsf_reqid = fsf_req->req_id;
rec->fsf_seqno = fsf_req->seq_no;
rec->s_id = s_id;
rec->d_id = d_id;
rec->u.els.ls_code = ls_code;
rec->u.els.d_id = d_id;
debug_event(dbf->san, level, rec, sizeof(*rec));
zfcp_dbf_hexdump(dbf->san, rec, sizeof(*rec), level,
buffer, min(buflen, ZFCP_DBF_SAN_MAX_PAYLOAD));
Expand All @@ -778,12 +770,11 @@ static void zfcp_dbf_san_els(const char *tag, int level,
*/
void zfcp_dbf_san_els_request(struct zfcp_fsf_req *fsf_req)
{
struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data;
struct zfcp_fsf_ct_els *els = (struct zfcp_fsf_ct_els *)fsf_req->data;
u32 d_id = ntoh24(fsf_req->qtcb->bottom.support.d_id);

zfcp_dbf_san_els("oels", 2, fsf_req,
fc_host_port_id(els->adapter->scsi_host),
els->d_id, *(u8 *) sg_virt(els->req),
sg_virt(els->req), els->req->length);
zfcp_dbf_san_els("oels", 2, fsf_req, d_id,
sg_virt(els->req), els->req->length);
}

/**
Expand All @@ -792,12 +783,11 @@ void zfcp_dbf_san_els_request(struct zfcp_fsf_req *fsf_req)
*/
void zfcp_dbf_san_els_response(struct zfcp_fsf_req *fsf_req)
{
struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data;
struct zfcp_fsf_ct_els *els = (struct zfcp_fsf_ct_els *)fsf_req->data;
u32 d_id = ntoh24(fsf_req->qtcb->bottom.support.d_id);

zfcp_dbf_san_els("rels", 2, fsf_req, els->d_id,
fc_host_port_id(els->adapter->scsi_host),
*(u8 *)sg_virt(els->req), sg_virt(els->resp),
els->resp->length);
zfcp_dbf_san_els("rels", 2, fsf_req, d_id,
sg_virt(els->resp), els->resp->length);
}

/**
Expand All @@ -806,16 +796,13 @@ void zfcp_dbf_san_els_response(struct zfcp_fsf_req *fsf_req)
*/
void zfcp_dbf_san_incoming_els(struct zfcp_fsf_req *fsf_req)
{
struct zfcp_adapter *adapter = fsf_req->adapter;
struct fsf_status_read_buffer *buf =
(struct fsf_status_read_buffer *)fsf_req->data;
int length = (int)buf->length -
(int)((void *)&buf->payload - (void *)buf);

zfcp_dbf_san_els("iels", 1, fsf_req, ntoh24(buf->d_id),
fc_host_port_id(adapter->scsi_host),
buf->payload.data[0], (void *)buf->payload.data,
length);
(void *)buf->payload.data, length);
}

static int zfcp_dbf_san_view_format(debug_info_t *id, struct debug_view *view,
Expand All @@ -830,11 +817,10 @@ static int zfcp_dbf_san_view_format(debug_info_t *id, struct debug_view *view,
zfcp_dbf_tag(&p, "tag", r->tag);
zfcp_dbf_out(&p, "fsf_reqid", "0x%0Lx", r->fsf_reqid);
zfcp_dbf_out(&p, "fsf_seqno", "0x%08x", r->fsf_seqno);
zfcp_dbf_out(&p, "s_id", "0x%06x", r->s_id);
zfcp_dbf_out(&p, "d_id", "0x%06x", r->d_id);

if (strncmp(r->tag, "octc", ZFCP_DBF_TAG_SIZE) == 0) {
struct zfcp_dbf_san_record_ct_request *ct = &r->u.ct_req;
zfcp_dbf_out(&p, "d_id", "0x%06x", ct->d_id);
zfcp_dbf_out(&p, "cmd_req_code", "0x%04x", ct->cmd_req_code);
zfcp_dbf_out(&p, "revision", "0x%02x", ct->revision);
zfcp_dbf_out(&p, "gs_type", "0x%02x", ct->gs_type);
Expand All @@ -853,7 +839,7 @@ static int zfcp_dbf_san_view_format(debug_info_t *id, struct debug_view *view,
strncmp(r->tag, "rels", ZFCP_DBF_TAG_SIZE) == 0 ||
strncmp(r->tag, "iels", ZFCP_DBF_TAG_SIZE) == 0) {
struct zfcp_dbf_san_record_els *els = &r->u.els;
zfcp_dbf_out(&p, "ls_code", "0x%02x", els->ls_code);
zfcp_dbf_out(&p, "d_id", "0x%06x", els->d_id);
}
return p - out_buf;
}
Expand Down
7 changes: 2 additions & 5 deletions trunk/drivers/s390/scsi/zfcp_dbf.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ struct zfcp_dbf_hba_record_response {
} unit;
struct {
u32 d_id;
u8 ls_code;
} els;
} u;
} __attribute__ ((packed));
Expand Down Expand Up @@ -167,6 +166,7 @@ struct zfcp_dbf_san_record_ct_request {
u8 options;
u16 max_res_size;
u32 len;
u32 d_id;
} __attribute__ ((packed));

struct zfcp_dbf_san_record_ct_response {
Expand All @@ -180,16 +180,13 @@ struct zfcp_dbf_san_record_ct_response {
} __attribute__ ((packed));

struct zfcp_dbf_san_record_els {
u8 ls_code;
u32 len;
u32 d_id;
} __attribute__ ((packed));

struct zfcp_dbf_san_record {
u8 tag[ZFCP_DBF_TAG_SIZE];
u64 fsf_reqid;
u32 fsf_seqno;
u32 s_id;
u32 d_id;
union {
struct zfcp_dbf_san_record_ct_request ct_req;
struct zfcp_dbf_san_record_ct_response ct_resp;
Expand Down
46 changes: 0 additions & 46 deletions trunk/drivers/s390/scsi/zfcp_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,52 +132,6 @@ struct zfcp_adapter_mempool {
mempool_t *qtcb_pool;
};

/**
* struct zfcp_send_ct - used to pass parameters to function zfcp_fsf_send_ct
* @wka_port: port where the request is sent to
* @req: scatter-gather list for request
* @resp: scatter-gather list for response
* @handler: handler function (called for response to the request)
* @handler_data: data passed to handler function
* @completion: completion for synchronization purposes
* @status: used to pass error status to calling function
*/
struct zfcp_send_ct {
struct zfcp_fc_wka_port *wka_port;
struct scatterlist *req;
struct scatterlist *resp;
void (*handler)(unsigned long);
unsigned long handler_data;
struct completion *completion;
int status;
};

/**
* struct zfcp_send_els - used to pass parameters to function zfcp_fsf_send_els
* @adapter: adapter where request is sent from
* @port: port where ELS is destinated (port reference count has to be increased)
* @d_id: destiniation id of port where request is sent to
* @req: scatter-gather list for request
* @resp: scatter-gather list for response
* @handler: handler function (called for response to the request)
* @handler_data: data passed to handler function
* @completion: completion for synchronization purposes
* @ls_code: hex code of ELS command
* @status: used to pass error status to calling function
*/
struct zfcp_send_els {
struct zfcp_adapter *adapter;
struct zfcp_port *port;
u32 d_id;
struct scatterlist *req;
struct scatterlist *resp;
void (*handler)(unsigned long);
unsigned long handler_data;
struct completion *completion;
int ls_code;
int status;
};

struct zfcp_qdio_queue {
struct qdio_buffer *sbal[QDIO_MAX_BUFFERS_PER_Q];
u8 first; /* index of next free bfr in queue */
Expand Down
12 changes: 7 additions & 5 deletions trunk/drivers/s390/scsi/zfcp_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/types.h>
#include <scsi/fc/fc_els.h>
#include "zfcp_def.h"
#include "zfcp_fc.h"

/* zfcp_aux.c */
extern struct zfcp_unit *zfcp_get_unit_by_lun(struct zfcp_port *, u64);
Expand Down Expand Up @@ -55,7 +56,7 @@ extern void _zfcp_dbf_hba_fsf_unsol(const char *, int level, struct zfcp_dbf *,
struct fsf_status_read_buffer *);
extern void zfcp_dbf_hba_qdio(struct zfcp_dbf *, unsigned int, int, int);
extern void zfcp_dbf_hba_berr(struct zfcp_dbf *, struct zfcp_fsf_req *);
extern void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *);
extern void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *, u32);
extern void zfcp_dbf_san_ct_response(struct zfcp_fsf_req *);
extern void zfcp_dbf_san_els_request(struct zfcp_fsf_req *);
extern void zfcp_dbf_san_els_response(struct zfcp_fsf_req *);
Expand Down Expand Up @@ -106,8 +107,7 @@ extern void zfcp_fc_link_test_work(struct work_struct *);
extern void zfcp_fc_wka_ports_force_offline(struct zfcp_fc_wka_ports *);
extern int zfcp_fc_gs_setup(struct zfcp_adapter *);
extern void zfcp_fc_gs_destroy(struct zfcp_adapter *);
extern int zfcp_fc_execute_els_fc_job(struct fc_bsg_job *);
extern int zfcp_fc_execute_ct_fc_job(struct fc_bsg_job *);
extern int zfcp_fc_exec_bsg_job(struct fc_bsg_job *);

/* zfcp_fsf.c */
extern int zfcp_fsf_open_port(struct zfcp_erp_action *);
Expand All @@ -128,8 +128,10 @@ extern struct zfcp_fsf_req *zfcp_fsf_control_file(struct zfcp_adapter *,
extern void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *);
extern int zfcp_fsf_status_read(struct zfcp_qdio *);
extern int zfcp_status_read_refill(struct zfcp_adapter *adapter);
extern int zfcp_fsf_send_ct(struct zfcp_send_ct *, mempool_t *);
extern int zfcp_fsf_send_els(struct zfcp_send_els *);
extern int zfcp_fsf_send_ct(struct zfcp_fc_wka_port *, struct zfcp_fsf_ct_els *,
mempool_t *);
extern int zfcp_fsf_send_els(struct zfcp_adapter *, u32,
struct zfcp_fsf_ct_els *);
extern int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *,
struct scsi_cmnd *);
extern void zfcp_fsf_req_free(struct zfcp_fsf_req *);
Expand Down
Loading

0 comments on commit 617192f

Please sign in to comment.