31 #include <linux/if_ether.h>
35 #define ntohll(x) be64_to_cpu(x)
36 #define htonll(x) cpu_to_be64(x)
40 return (p[0] << 16) | (p[1] << 8) | p[2];
45 p[0] = (v >> 16) & 0xff;
46 p[1] = (v >> 8) & 0xff;
56 #define FC_FRAME_HEADROOM 32
57 #define FC_FRAME_TAILROOM 8
60 #define FC_FRAME_SG_LEN (MAX_SKB_FRAGS - 1)
62 #define fp_skb(fp) (&((fp)->skb))
63 #define fr_hdr(fp) ((fp)->skb.data)
64 #define fr_len(fp) ((fp)->skb.len)
65 #define fr_cb(fp) ((struct fcoe_rcv_info *)&((fp)->skb.cb[0]))
66 #define fr_dev(fp) (fr_cb(fp)->fr_dev)
67 #define fr_seq(fp) (fr_cb(fp)->fr_seq)
68 #define fr_sof(fp) (fr_cb(fp)->fr_sof)
69 #define fr_eof(fp) (fr_cb(fp)->fr_eof)
70 #define fr_flags(fp) (fr_cb(fp)->fr_flags)
71 #define fr_encaps(fp) (fr_cb(fp)->fr_encaps)
72 #define fr_max_payload(fp) (fr_cb(fp)->fr_max_payload)
73 #define fr_fsp(fp) (fr_cb(fp)->fr_fsp)
74 #define fr_crc(fp) (fr_cb(fp)->fr_crc)
106 #define FCPHF_CRC_UNCHECKED 0x01
113 static inline void fc_frame_init(
struct fc_frame *
fp)
146 static inline void fc_frame_free(
struct fc_frame *fp)
151 static inline int fc_frame_is_linear(
struct fc_frame *fp)
153 return !skb_is_nonlinear(
fp_skb(fp));
174 return __fc_frame_header_get(fp);
180 static inline u32 fc_frame_sid(
const struct fc_frame *fp)
188 static inline u32 fc_frame_did(
const struct fc_frame *fp)
203 static inline void *fc_frame_payload_get(
const struct fc_frame *fp,
209 pp = fc_frame_header_get(fp) + 1;
218 static inline u8 fc_frame_payload_op(
const struct fc_frame *fp)
222 cp = fc_frame_payload_get(fp,
sizeof(
u8));
234 return fc_sof_class(
fr_sof(fp));
244 static inline u8 fc_frame_rctl(
const struct fc_frame *fp)
246 return fc_frame_header_get(fp)->fh_r_ctl;
249 static inline bool fc_frame_is_cmd(
const struct fc_frame *fp)