aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/fc_encode.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi/fc_encode.h')
-rw-r--r--include/scsi/fc_encode.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/include/scsi/fc_encode.h b/include/scsi/fc_encode.h
index 8eb0a0fc0a71..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
24struct fc_ns_rft { 31struct 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 */
@@ -74,7 +81,7 @@ static inline void fc_adisc_fill(struct fc_lport *lport, struct fc_frame *fp)
74 adisc->adisc_cmd = ELS_ADISC; 81 adisc->adisc_cmd = ELS_ADISC;
75 put_unaligned_be64(lport->wwpn, &adisc->adisc_wwpn); 82 put_unaligned_be64(lport->wwpn, &adisc->adisc_wwpn);
76 put_unaligned_be64(lport->wwnn, &adisc->adisc_wwnn); 83 put_unaligned_be64(lport->wwnn, &adisc->adisc_wwnn);
77 hton24(adisc->adisc_port_id, fc_host_port_id(lport->host)); 84 hton24(adisc->adisc_port_id, lport->port_id);
78} 85}
79 86
80/** 87/**
@@ -127,15 +134,13 @@ static inline int fc_ct_fill(struct fc_lport *lport,
127 134
128 case FC_NS_RFT_ID: 135 case FC_NS_RFT_ID:
129 ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rft)); 136 ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rft));
130 hton24(ct->payload.rft.fid.fp_fid, 137 hton24(ct->payload.rft.fid.fp_fid, lport->port_id);
131 fc_host_port_id(lport->host));
132 ct->payload.rft.fts = lport->fcts; 138 ct->payload.rft.fts = lport->fcts;
133 break; 139 break;
134 140
135 case FC_NS_RFF_ID: 141 case FC_NS_RFF_ID:
136 ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rff_id)); 142 ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rff_id));
137 hton24(ct->payload.rff.fr_fid.fp_fid, 143 hton24(ct->payload.rff.fr_fid.fp_fid, lport->port_id);
138 fc_host_port_id(lport->host));
139 ct->payload.rff.fr_type = FC_TYPE_FCP; 144 ct->payload.rff.fr_type = FC_TYPE_FCP;
140 if (lport->service_params & FCP_SPPF_INIT_FCN) 145 if (lport->service_params & FCP_SPPF_INIT_FCN)
141 ct->payload.rff.fr_feat = FCP_FEAT_INIT; 146 ct->payload.rff.fr_feat = FCP_FEAT_INIT;
@@ -145,16 +150,14 @@ static inline int fc_ct_fill(struct fc_lport *lport,
145 150
146 case FC_NS_RNN_ID: 151 case FC_NS_RNN_ID:
147 ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rn_id)); 152 ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rn_id));
148 hton24(ct->payload.rn.fr_fid.fp_fid, 153 hton24(ct->payload.rn.fr_fid.fp_fid, lport->port_id);
149 fc_host_port_id(lport->host));
150 put_unaligned_be64(lport->wwnn, &ct->payload.rn.fr_wwn); 154 put_unaligned_be64(lport->wwnn, &ct->payload.rn.fr_wwn);
151 break; 155 break;
152 156
153 case FC_NS_RSPN_ID: 157 case FC_NS_RSPN_ID:
154 len = strnlen(fc_host_symbolic_name(lport->host), 255); 158 len = strnlen(fc_host_symbolic_name(lport->host), 255);
155 ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rspn) + len); 159 ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rspn) + len);
156 hton24(ct->payload.spn.fr_fid.fp_fid, 160 hton24(ct->payload.spn.fr_fid.fp_fid, lport->port_id);
157 fc_host_port_id(lport->host));
158 strncpy(ct->payload.spn.fr_name, 161 strncpy(ct->payload.spn.fr_name,
159 fc_host_symbolic_name(lport->host), len); 162 fc_host_symbolic_name(lport->host), len);
160 ct->payload.spn.fr_name_len = len; 163 ct->payload.spn.fr_name_len = len;
@@ -268,7 +271,7 @@ static inline void fc_logo_fill(struct fc_lport *lport, struct fc_frame *fp)
268 logo = fc_frame_payload_get(fp, sizeof(*logo)); 271 logo = fc_frame_payload_get(fp, sizeof(*logo));
269 memset(logo, 0, sizeof(*logo)); 272 memset(logo, 0, sizeof(*logo));
270 logo->fl_cmd = ELS_LOGO; 273 logo->fl_cmd = ELS_LOGO;
271 hton24(logo->fl_n_port_id, fc_host_port_id(lport->host)); 274 hton24(logo->fl_n_port_id, lport->port_id);
272 logo->fl_n_port_wwn = htonll(lport->wwpn); 275 logo->fl_n_port_wwn = htonll(lport->wwpn);
273} 276}
274 277
@@ -295,7 +298,7 @@ static inline void fc_rec_fill(struct fc_lport *lport, struct fc_frame *fp)
295 rec = fc_frame_payload_get(fp, sizeof(*rec)); 298 rec = fc_frame_payload_get(fp, sizeof(*rec));
296 memset(rec, 0, sizeof(*rec)); 299 memset(rec, 0, sizeof(*rec));
297 rec->rec_cmd = ELS_REC; 300 rec->rec_cmd = ELS_REC;
298 hton24(rec->rec_s_id, fc_host_port_id(lport->host)); 301 hton24(rec->rec_s_id, lport->port_id);
299 rec->rec_ox_id = htons(ep->oxid); 302 rec->rec_ox_id = htons(ep->oxid);
300 rec->rec_rx_id = htons(ep->rxid); 303 rec->rec_rx_id = htons(ep->rxid);
301} 304}