]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/scsi/fc_encode.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
[karo-tx-linux.git] / include / scsi / fc_encode.h
index 9b4867c9c2d2e6cf8c433ef903b2d4d168b1848e..be418d8448a565ebfcf02f1675164447bb32fd1c 100644 (file)
 #define _FC_ENCODE_H_
 #include <asm/unaligned.h>
 
+/*
+ * F_CTL values for simple requests and responses.
+ */
+#define FC_FCTL_REQ    (FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT)
+#define FC_FCTL_RESP   (FC_FC_EX_CTX | FC_FC_LAST_SEQ | \
+                       FC_FC_END_SEQ | FC_FC_SEQ_INIT)
+
 struct fc_ns_rft {
        struct fc_ns_fid fid;   /* port ID object */
        struct fc_ns_fts fts;   /* FC4-types object */
@@ -39,16 +46,11 @@ struct fc_ct_req {
        } payload;
 };
 
-/**
- * fill FC header fields in specified fc_frame
- */
-static inline void fc_fill_fc_hdr(struct fc_frame *fp, enum fc_rctl r_ctl,
-                                 u32 did, u32 sid, enum fc_fh_type type,
-                                 u32 f_ctl, u32 parm_offset)
+static inline void __fc_fill_fc_hdr(struct fc_frame_header *fh,
+                                   enum fc_rctl r_ctl,
+                                   u32 did, u32 sid, enum fc_fh_type type,
+                                   u32 f_ctl, u32 parm_offset)
 {
-       struct fc_frame_header *fh;
-
-       fh = fc_frame_header_get(fp);
        WARN_ON(r_ctl == 0);
        fh->fh_r_ctl = r_ctl;
        hton24(fh->fh_d_id, did);
@@ -60,6 +62,19 @@ static inline void fc_fill_fc_hdr(struct fc_frame *fp, enum fc_rctl r_ctl,
        fh->fh_parm_offset = htonl(parm_offset);
 }
 
+/**
+ * fill FC header fields in specified fc_frame
+ */
+static inline void fc_fill_fc_hdr(struct fc_frame *fp, enum fc_rctl r_ctl,
+                                 u32 did, u32 sid, enum fc_fh_type type,
+                                 u32 f_ctl, u32 parm_offset)
+{
+       struct fc_frame_header *fh;
+
+       fh = fc_frame_header_get(fp);
+       __fc_fill_fc_hdr(fh, r_ctl, did, sid, type, f_ctl, parm_offset);
+}
+
 /**
  * fc_adisc_fill() - Fill in adisc request frame
  * @lport: local port.