aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/fc_frame.h
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2010-07-20 18:20:14 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-28 10:05:54 -0400
commitf60e12e9c778c8256a646f80603d1b88ba5ce891 (patch)
tree732e918fc85cc441cd539be5e389e0dfd29a2199 /include/scsi/fc_frame.h
parenta7b12a279faaad26837276065104a1f9cf60e962 (diff)
[SCSI] libfc: track FIP exchanges
When an exchange is received with a FIP encapsulation, we need to know that the response must be sent via FIP and what the original ELS opcode was. This becomes important for VN2VN mode, where we may receive FLOGI or LOGO from several peer VN_ports, and the LS_ACC or LS_RJT must be sent FIP-encapsulated with the correct sub-type. Add a field to the struct fc_frame, fr_encaps, to indicate the encapsulation values. That term is chosen to be neutral and LLD-agnostic in case non-FCoE/FIP LLDs might find it useful. The frame fr_encaps is transferred from the ingress frame to the exchange by fc_exch_recv_req(), and back to the outgoing frame by fc_seq_send(). This is taking the last byte in the skb->cb array. If needed, we could combine the info in sof, eof, flags, and encaps together into one field, but it'd be better to do that if and when its needed. 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_frame.h')
-rw-r--r--include/scsi/fc_frame.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/scsi/fc_frame.h b/include/scsi/fc_frame.h
index 15427fab8a57..29dd97d5b53a 100644
--- a/include/scsi/fc_frame.h
+++ b/include/scsi/fc_frame.h
@@ -51,6 +51,7 @@
51#define fr_sof(fp) (fr_cb(fp)->fr_sof) 51#define fr_sof(fp) (fr_cb(fp)->fr_sof)
52#define fr_eof(fp) (fr_cb(fp)->fr_eof) 52#define fr_eof(fp) (fr_cb(fp)->fr_eof)
53#define fr_flags(fp) (fr_cb(fp)->fr_flags) 53#define fr_flags(fp) (fr_cb(fp)->fr_flags)
54#define fr_encaps(fp) (fr_cb(fp)->fr_encaps)
54#define fr_max_payload(fp) (fr_cb(fp)->fr_max_payload) 55#define fr_max_payload(fp) (fr_cb(fp)->fr_max_payload)
55#define fr_fsp(fp) (fr_cb(fp)->fr_fsp) 56#define fr_fsp(fp) (fr_cb(fp)->fr_fsp)
56#define fr_crc(fp) (fr_cb(fp)->fr_crc) 57#define fr_crc(fp) (fr_cb(fp)->fr_crc)
@@ -69,6 +70,7 @@ struct fcoe_rcv_info {
69 u8 fr_sof; /* start of frame delimiter */ 70 u8 fr_sof; /* start of frame delimiter */
70 u8 fr_eof; /* end of frame delimiter */ 71 u8 fr_eof; /* end of frame delimiter */
71 u8 fr_flags; /* flags - see below */ 72 u8 fr_flags; /* flags - see below */
73 u8 fr_encaps; /* LLD encapsulation info (e.g. FIP) */
72 u8 granted_mac[ETH_ALEN]; /* FCoE MAC address */ 74 u8 granted_mac[ETH_ALEN]; /* FCoE MAC address */
73}; 75};
74 76
@@ -97,6 +99,7 @@ static inline void fc_frame_init(struct fc_frame *fp)
97 fr_dev(fp) = NULL; 99 fr_dev(fp) = NULL;
98 fr_seq(fp) = NULL; 100 fr_seq(fp) = NULL;
99 fr_flags(fp) = 0; 101 fr_flags(fp) = 0;
102 fr_encaps(fp) = 0;
100} 103}
101 104
102struct fc_frame *fc_frame_alloc_fill(struct fc_lport *, size_t payload_len); 105struct fc_frame *fc_frame_alloc_fill(struct fc_lport *, size_t payload_len);