aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/fc_frame.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi/fc_frame.h')
-rw-r--r--include/scsi/fc_frame.h22
1 files changed, 9 insertions, 13 deletions
diff --git a/include/scsi/fc_frame.h b/include/scsi/fc_frame.h
index c35d2383cc26..4d3e9c7b7c57 100644
--- a/include/scsi/fc_frame.h
+++ b/include/scsi/fc_frame.h
@@ -28,6 +28,8 @@
28#include <scsi/fc/fc_fcp.h> 28#include <scsi/fc/fc_fcp.h>
29#include <scsi/fc/fc_encaps.h> 29#include <scsi/fc/fc_encaps.h>
30 30
31#include <linux/if_ether.h>
32
31/* 33/*
32 * The fc_frame interface is used to pass frame data between functions. 34 * The fc_frame interface is used to pass frame data between functions.
33 * The frame includes the data buffer, length, and SOF / EOF delimiter types. 35 * The frame includes the data buffer, length, and SOF / EOF delimiter types.
@@ -37,6 +39,9 @@
37#define FC_FRAME_HEADROOM 32 /* headroom for VLAN + FCoE headers */ 39#define FC_FRAME_HEADROOM 32 /* headroom for VLAN + FCoE headers */
38#define FC_FRAME_TAILROOM 8 /* trailer space for FCoE */ 40#define FC_FRAME_TAILROOM 8 /* trailer space for FCoE */
39 41
42/* Max number of skb frags allowed, reserving one for fcoe_crc_eof page */
43#define FC_FRAME_SG_LEN (MAX_SKB_FRAGS - 1)
44
40#define fp_skb(fp) (&((fp)->skb)) 45#define fp_skb(fp) (&((fp)->skb))
41#define fr_hdr(fp) ((fp)->skb.data) 46#define fr_hdr(fp) ((fp)->skb.data)
42#define fr_len(fp) ((fp)->skb.len) 47#define fr_len(fp) ((fp)->skb.len)
@@ -64,6 +69,7 @@ struct fcoe_rcv_info {
64 enum fc_sof fr_sof; /* start of frame delimiter */ 69 enum fc_sof fr_sof; /* start of frame delimiter */
65 enum fc_eof fr_eof; /* end of frame delimiter */ 70 enum fc_eof fr_eof; /* end of frame delimiter */
66 u8 fr_flags; /* flags - see below */ 71 u8 fr_flags; /* flags - see below */
72 u8 granted_mac[ETH_ALEN]; /* FCoE MAC address */
67}; 73};
68 74
69 75
@@ -94,17 +100,7 @@ static inline void fc_frame_init(struct fc_frame *fp)
94} 100}
95 101
96struct fc_frame *fc_frame_alloc_fill(struct fc_lport *, size_t payload_len); 102struct fc_frame *fc_frame_alloc_fill(struct fc_lport *, size_t payload_len);
97 103struct fc_frame *_fc_frame_alloc(size_t payload_len);
98struct fc_frame *__fc_frame_alloc(size_t payload_len);
99
100/*
101 * Get frame for sending via port.
102 */
103static inline struct fc_frame *_fc_frame_alloc(struct fc_lport *dev,
104 size_t payload_len)
105{
106 return __fc_frame_alloc(payload_len);
107}
108 104
109/* 105/*
110 * Allocate fc_frame structure and buffer. Set the initial length to 106 * Allocate fc_frame structure and buffer. Set the initial length to
@@ -118,10 +114,10 @@ static inline struct fc_frame *fc_frame_alloc(struct fc_lport *dev, size_t len)
118 * Note: Since len will often be a constant multiple of 4, 114 * Note: Since len will often be a constant multiple of 4,
119 * this check will usually be evaluated and eliminated at compile time. 115 * this check will usually be evaluated and eliminated at compile time.
120 */ 116 */
121 if ((len % 4) != 0) 117 if (len && len % 4)
122 fp = fc_frame_alloc_fill(dev, len); 118 fp = fc_frame_alloc_fill(dev, len);
123 else 119 else
124 fp = _fc_frame_alloc(dev, len); 120 fp = _fc_frame_alloc(len);
125 return fp; 121 return fp;
126} 122}
127 123