Commit 0cac937d authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen

scsi: libfc: Replace ->seq_send callback with function call

The ->seq_send callback only ever had one implementation,
so we can as well call it directly and drop the callback.
Signed-off-by: default avatarHannes Reinecke <hare@suse.com>
Acked-by: default avatarJohannes Thumshirn <jth@kernel.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent a8220ded
...@@ -533,8 +533,7 @@ static int fc_seq_send_locked(struct fc_lport *lport, struct fc_seq *sp, ...@@ -533,8 +533,7 @@ static int fc_seq_send_locked(struct fc_lport *lport, struct fc_seq *sp,
* Note: The frame will be freed either by a direct call to fc_frame_free(fp) * Note: The frame will be freed either by a direct call to fc_frame_free(fp)
* or indirectly by calling libfc_function_template.frame_send(). * or indirectly by calling libfc_function_template.frame_send().
*/ */
static int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp, int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp, struct fc_frame *fp)
struct fc_frame *fp)
{ {
struct fc_exch *ep; struct fc_exch *ep;
int error; int error;
...@@ -544,6 +543,7 @@ static int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp, ...@@ -544,6 +543,7 @@ static int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp,
spin_unlock_bh(&ep->ex_lock); spin_unlock_bh(&ep->ex_lock);
return error; return error;
} }
EXPORT_SYMBOL(fc_seq_send);
/** /**
* fc_seq_alloc() - Allocate a sequence for a given exchange * fc_seq_alloc() - Allocate a sequence for a given exchange
...@@ -2648,9 +2648,6 @@ int fc_exch_init(struct fc_lport *lport) ...@@ -2648,9 +2648,6 @@ int fc_exch_init(struct fc_lport *lport)
if (!lport->tt.seq_set_resp) if (!lport->tt.seq_set_resp)
lport->tt.seq_set_resp = fc_seq_set_resp; lport->tt.seq_set_resp = fc_seq_set_resp;
if (!lport->tt.seq_send)
lport->tt.seq_send = fc_seq_send;
if (!lport->tt.exch_done) if (!lport->tt.exch_done)
lport->tt.exch_done = fc_exch_done; lport->tt.exch_done = fc_exch_done;
......
...@@ -731,7 +731,7 @@ static int fc_fcp_send_data(struct fc_fcp_pkt *fsp, struct fc_seq *seq, ...@@ -731,7 +731,7 @@ static int fc_fcp_send_data(struct fc_fcp_pkt *fsp, struct fc_seq *seq,
/* /*
* send fragment using for a sequence. * send fragment using for a sequence.
*/ */
error = lport->tt.seq_send(lport, seq, fp); error = fc_seq_send(lport, seq, fp);
if (error) { if (error) {
WARN_ON(1); /* send error should be rare */ WARN_ON(1); /* send error should be rare */
return error; return error;
...@@ -1033,7 +1033,7 @@ static void fc_fcp_complete_locked(struct fc_fcp_pkt *fsp) ...@@ -1033,7 +1033,7 @@ static void fc_fcp_complete_locked(struct fc_fcp_pkt *fsp)
fc_fill_fc_hdr(conf_frame, FC_RCTL_DD_SOL_CTL, fc_fill_fc_hdr(conf_frame, FC_RCTL_DD_SOL_CTL,
ep->did, ep->sid, ep->did, ep->sid,
FC_TYPE_FCP, f_ctl, 0); FC_TYPE_FCP, f_ctl, 0);
lport->tt.seq_send(lport, csp, conf_frame); fc_seq_send(lport, csp, conf_frame);
} }
} }
lport->tt.exch_done(seq); lport->tt.exch_done(seq);
......
...@@ -165,7 +165,7 @@ int ft_queue_status(struct se_cmd *se_cmd) ...@@ -165,7 +165,7 @@ int ft_queue_status(struct se_cmd *se_cmd)
fc_fill_fc_hdr(fp, FC_RCTL_DD_CMD_STATUS, ep->did, ep->sid, FC_TYPE_FCP, fc_fill_fc_hdr(fp, FC_RCTL_DD_CMD_STATUS, ep->did, ep->sid, FC_TYPE_FCP,
FC_FC_EX_CTX | FC_FC_LAST_SEQ | FC_FC_END_SEQ, 0); FC_FC_EX_CTX | FC_FC_LAST_SEQ | FC_FC_END_SEQ, 0);
rc = lport->tt.seq_send(lport, cmd->seq, fp); rc = fc_seq_send(lport, cmd->seq, fp);
if (rc) { if (rc) {
pr_info_ratelimited("%s: Failed to send response frame %p, " pr_info_ratelimited("%s: Failed to send response frame %p, "
"xid <0x%x>\n", __func__, fp, ep->xid); "xid <0x%x>\n", __func__, fp, ep->xid);
...@@ -242,7 +242,7 @@ int ft_write_pending(struct se_cmd *se_cmd) ...@@ -242,7 +242,7 @@ int ft_write_pending(struct se_cmd *se_cmd)
cmd->was_ddp_setup = 1; cmd->was_ddp_setup = 1;
} }
} }
lport->tt.seq_send(lport, cmd->seq, fp); fc_seq_send(lport, cmd->seq, fp);
return 0; return 0;
} }
...@@ -323,7 +323,7 @@ static void ft_send_resp_status(struct fc_lport *lport, ...@@ -323,7 +323,7 @@ static void ft_send_resp_status(struct fc_lport *lport,
fc_fill_reply_hdr(fp, rx_fp, FC_RCTL_DD_CMD_STATUS, 0); fc_fill_reply_hdr(fp, rx_fp, FC_RCTL_DD_CMD_STATUS, 0);
sp = fr_seq(fp); sp = fr_seq(fp);
if (sp) { if (sp) {
lport->tt.seq_send(lport, sp, fp); fc_seq_send(lport, sp, fp);
lport->tt.exch_done(sp); lport->tt.exch_done(sp);
} else { } else {
lport->tt.frame_send(lport, fp); lport->tt.frame_send(lport, fp);
......
...@@ -174,7 +174,7 @@ int ft_queue_data_in(struct se_cmd *se_cmd) ...@@ -174,7 +174,7 @@ int ft_queue_data_in(struct se_cmd *se_cmd)
f_ctl |= FC_FC_END_SEQ; f_ctl |= FC_FC_END_SEQ;
fc_fill_fc_hdr(fp, FC_RCTL_DD_SOL_DATA, ep->did, ep->sid, fc_fill_fc_hdr(fp, FC_RCTL_DD_SOL_DATA, ep->did, ep->sid,
FC_TYPE_FCP, f_ctl, fh_off); FC_TYPE_FCP, f_ctl, fh_off);
error = lport->tt.seq_send(lport, seq, fp); error = fc_seq_send(lport, seq, fp);
if (error) { if (error) {
pr_info_ratelimited("%s: Failed to send frame %p, " pr_info_ratelimited("%s: Failed to send frame %p, "
"xid <0x%x>, remaining %zu, " "xid <0x%x>, remaining %zu, "
......
...@@ -513,13 +513,6 @@ struct libfc_function_template { ...@@ -513,13 +513,6 @@ struct libfc_function_template {
* STATUS: OPTIONAL * STATUS: OPTIONAL
*/ */
void (*get_lesb)(struct fc_lport *, struct fc_els_lesb *lesb); void (*get_lesb)(struct fc_lport *, struct fc_els_lesb *lesb);
/*
* Send a frame using an existing sequence and exchange.
*
* STATUS: OPTIONAL
*/
int (*seq_send)(struct fc_lport *, struct fc_seq *,
struct fc_frame *);
/* /*
* Abort an exchange and sequence. Generally called because of a * Abort an exchange and sequence. Generally called because of a
...@@ -1058,6 +1051,7 @@ struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *, enum fc_class class, ...@@ -1058,6 +1051,7 @@ struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *, enum fc_class class,
void fc_exch_mgr_free(struct fc_lport *); void fc_exch_mgr_free(struct fc_lport *);
void fc_exch_recv(struct fc_lport *, struct fc_frame *); void fc_exch_recv(struct fc_lport *, struct fc_frame *);
void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id); void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id);
int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp, struct fc_frame *fp);
/* /*
* Functions for fc_functions_template * Functions for fc_functions_template
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment