diff options
author | Joe Eykholt <jeykholt@cisco.com> | 2010-07-20 18:21:01 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-28 10:06:00 -0400 |
commit | 24f089e2f2c800f88039e9d536d558ec6e349fad (patch) | |
tree | 59cf263f112e176015a3a37c3928cc3d2a4dfcb5 /include/scsi/fc_encode.h | |
parent | 251748a99e631a2c46edcf9e519cfc60fae8153d (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 'include/scsi/fc_encode.h')
-rw-r--r-- | include/scsi/fc_encode.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/scsi/fc_encode.h b/include/scsi/fc_encode.h index 9b4867c9c2d2..6d293c846a46 100644 --- a/include/scsi/fc_encode.h +++ b/include/scsi/fc_encode.h | |||
@@ -21,6 +21,13 @@ | |||
21 | #define _FC_ENCODE_H_ | 21 | #define _FC_ENCODE_H_ |
22 | #include <asm/unaligned.h> | 22 | #include <asm/unaligned.h> |
23 | 23 | ||
24 | /* | ||
25 | * F_CTL values for simple requests and responses. | ||
26 | */ | ||
27 | #define FC_FCTL_REQ (FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT) | ||
28 | #define FC_FCTL_RESP (FC_FC_EX_CTX | FC_FC_LAST_SEQ | \ | ||
29 | FC_FC_END_SEQ | FC_FC_SEQ_INIT) | ||
30 | |||
24 | struct fc_ns_rft { | 31 | struct fc_ns_rft { |
25 | struct fc_ns_fid fid; /* port ID object */ | 32 | struct fc_ns_fid fid; /* port ID object */ |
26 | struct fc_ns_fts fts; /* FC4-types object */ | 33 | struct fc_ns_fts fts; /* FC4-types object */ |