aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libfc/fc_fcp.c
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2010-07-20 18:21:01 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-28 10:06:00 -0400
commit24f089e2f2c800f88039e9d536d558ec6e349fad (patch)
tree59cf263f112e176015a3a37c3928cc3d2a4dfcb5 /drivers/scsi/libfc/fc_fcp.c
parent251748a99e631a2c46edcf9e519cfc60fae8153d (diff)
[SCSI] libfc: add fc_fill_reply_hdr() and fc_fill_hdr()
Add functions to fill in an FC header given a request header. These reduces code lines in fc_lport and fc_rport and works without an exchange/sequence assigned. fc_fill_reply_hdr() fills a header for a final reply frame. fc_fill_hdr() which is similar but allows specifying the f_ctl parameter. Add defines for F_CTL values FC_FCTL_REQ and FC_FCTL_RESP. These can be used for most request and response sequences. v2 of patch adds a line to copy the frame encapsulation info from the received frame. Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/libfc/fc_fcp.c')
-rw-r--r--drivers/scsi/libfc/fc_fcp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 61a12970bd14..eac4d09314eb 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -1108,7 +1108,7 @@ static int fc_fcp_cmd_send(struct fc_lport *lport, struct fc_fcp_pkt *fsp,
1108 1108
1109 fc_fill_fc_hdr(fp, FC_RCTL_DD_UNSOL_CMD, rport->port_id, 1109 fc_fill_fc_hdr(fp, FC_RCTL_DD_UNSOL_CMD, rport->port_id,
1110 rpriv->local_port->port_id, FC_TYPE_FCP, 1110 rpriv->local_port->port_id, FC_TYPE_FCP,
1111 FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); 1111 FC_FCTL_REQ, 0);
1112 1112
1113 seq = lport->tt.exch_seq_send(lport, fp, resp, fc_fcp_pkt_destroy, 1113 seq = lport->tt.exch_seq_send(lport, fp, resp, fc_fcp_pkt_destroy,
1114 fsp, 0); 1114 fsp, 0);
@@ -1381,7 +1381,7 @@ static void fc_fcp_rec(struct fc_fcp_pkt *fsp)
1381 fr_seq(fp) = fsp->seq_ptr; 1381 fr_seq(fp) = fsp->seq_ptr;
1382 fc_fill_fc_hdr(fp, FC_RCTL_ELS_REQ, rport->port_id, 1382 fc_fill_fc_hdr(fp, FC_RCTL_ELS_REQ, rport->port_id,
1383 rpriv->local_port->port_id, FC_TYPE_ELS, 1383 rpriv->local_port->port_id, FC_TYPE_ELS,
1384 FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); 1384 FC_FCTL_REQ, 0);
1385 if (lport->tt.elsct_send(lport, rport->port_id, fp, ELS_REC, 1385 if (lport->tt.elsct_send(lport, rport->port_id, fp, ELS_REC,
1386 fc_fcp_rec_resp, fsp, 1386 fc_fcp_rec_resp, fsp,
1387 jiffies_to_msecs(FC_SCSI_REC_TOV))) { 1387 jiffies_to_msecs(FC_SCSI_REC_TOV))) {
@@ -1639,7 +1639,7 @@ static void fc_fcp_srr(struct fc_fcp_pkt *fsp, enum fc_rctl r_ctl, u32 offset)
1639 1639
1640 fc_fill_fc_hdr(fp, FC_RCTL_ELS4_REQ, rport->port_id, 1640 fc_fill_fc_hdr(fp, FC_RCTL_ELS4_REQ, rport->port_id,
1641 rpriv->local_port->port_id, FC_TYPE_FCP, 1641 rpriv->local_port->port_id, FC_TYPE_FCP,
1642 FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); 1642 FC_FCTL_REQ, 0);
1643 1643
1644 seq = lport->tt.exch_seq_send(lport, fp, fc_fcp_srr_resp, NULL, 1644 seq = lport->tt.exch_seq_send(lport, fp, fc_fcp_srr_resp, NULL,
1645 fsp, jiffies_to_msecs(FC_SCSI_REC_TOV)); 1645 fsp, jiffies_to_msecs(FC_SCSI_REC_TOV));