Commit 7ab24dd1 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen

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

The 'seq_els_rsp_send' callback only ever had one implementation,
so we might as well drop it and use the function directly.
Signed-off-by: default avatarHannes Reinecke <hare@suse.com>
Acked-by: default avatarJohannes Thumshirn <jth@kernel.org>
Acked-by: default avatarJohannes Thumshirn <jth@kernel.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 11950d70
...@@ -3031,7 +3031,7 @@ static void fcoe_ctlr_disc_recv(struct fc_lport *lport, struct fc_frame *fp) ...@@ -3031,7 +3031,7 @@ static void fcoe_ctlr_disc_recv(struct fc_lport *lport, struct fc_frame *fp)
rjt_data.reason = ELS_RJT_UNSUP; rjt_data.reason = ELS_RJT_UNSUP;
rjt_data.explan = ELS_EXPL_NONE; rjt_data.explan = ELS_EXPL_NONE;
lport->tt.seq_els_rsp_send(fp, ELS_LS_RJT, &rjt_data); fc_seq_els_rsp_send(fp, ELS_LS_RJT, &rjt_data);
fc_frame_free(fp); fc_frame_free(fp);
} }
......
...@@ -154,7 +154,7 @@ static void fc_disc_recv_rscn_req(struct fc_disc *disc, struct fc_frame *fp) ...@@ -154,7 +154,7 @@ static void fc_disc_recv_rscn_req(struct fc_disc *disc, struct fc_frame *fp)
break; break;
} }
} }
lport->tt.seq_els_rsp_send(fp, ELS_LS_ACC, NULL); fc_seq_els_rsp_send(fp, ELS_LS_ACC, NULL);
/* /*
* If not doing a complete rediscovery, do GPN_ID on * If not doing a complete rediscovery, do GPN_ID on
...@@ -182,7 +182,7 @@ static void fc_disc_recv_rscn_req(struct fc_disc *disc, struct fc_frame *fp) ...@@ -182,7 +182,7 @@ static void fc_disc_recv_rscn_req(struct fc_disc *disc, struct fc_frame *fp)
FC_DISC_DBG(disc, "Received a bad RSCN frame\n"); FC_DISC_DBG(disc, "Received a bad RSCN frame\n");
rjt_data.reason = ELS_RJT_LOGIC; rjt_data.reason = ELS_RJT_LOGIC;
rjt_data.explan = ELS_EXPL_NONE; rjt_data.explan = ELS_EXPL_NONE;
lport->tt.seq_els_rsp_send(fp, ELS_LS_RJT, &rjt_data); fc_seq_els_rsp_send(fp, ELS_LS_RJT, &rjt_data);
fc_frame_free(fp); fc_frame_free(fp);
} }
......
...@@ -1222,8 +1222,8 @@ static void fc_exch_set_addr(struct fc_exch *ep, ...@@ -1222,8 +1222,8 @@ static void fc_exch_set_addr(struct fc_exch *ep,
* *
* The received frame is not freed. * The received frame is not freed.
*/ */
static void fc_seq_els_rsp_send(struct fc_frame *fp, enum fc_els_cmd els_cmd, void fc_seq_els_rsp_send(struct fc_frame *fp, enum fc_els_cmd els_cmd,
struct fc_seq_els_data *els_data) struct fc_seq_els_data *els_data)
{ {
switch (els_cmd) { switch (els_cmd) {
case ELS_LS_RJT: case ELS_LS_RJT:
...@@ -1242,6 +1242,7 @@ static void fc_seq_els_rsp_send(struct fc_frame *fp, enum fc_els_cmd els_cmd, ...@@ -1242,6 +1242,7 @@ static void fc_seq_els_rsp_send(struct fc_frame *fp, enum fc_els_cmd els_cmd,
FC_LPORT_DBG(fr_dev(fp), "Invalid ELS CMD:%x\n", els_cmd); FC_LPORT_DBG(fr_dev(fp), "Invalid ELS CMD:%x\n", els_cmd);
} }
} }
EXPORT_SYMBOL_GPL(fc_seq_els_rsp_send);
/** /**
* fc_seq_send_last() - Send a sequence that is the last in the exchange * fc_seq_send_last() - Send a sequence that is the last in the exchange
...@@ -2635,9 +2636,6 @@ int fc_exch_init(struct fc_lport *lport) ...@@ -2635,9 +2636,6 @@ int fc_exch_init(struct fc_lport *lport)
if (!lport->tt.seq_send) if (!lport->tt.seq_send)
lport->tt.seq_send = fc_seq_send; lport->tt.seq_send = fc_seq_send;
if (!lport->tt.seq_els_rsp_send)
lport->tt.seq_els_rsp_send = fc_seq_els_rsp_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;
......
...@@ -412,7 +412,7 @@ static void fc_lport_recv_rlir_req(struct fc_lport *lport, struct fc_frame *fp) ...@@ -412,7 +412,7 @@ static void fc_lport_recv_rlir_req(struct fc_lport *lport, struct fc_frame *fp)
FC_LPORT_DBG(lport, "Received RLIR request while in state %s\n", FC_LPORT_DBG(lport, "Received RLIR request while in state %s\n",
fc_lport_state(lport)); fc_lport_state(lport));
lport->tt.seq_els_rsp_send(fp, ELS_LS_ACC, NULL); fc_seq_els_rsp_send(fp, ELS_LS_ACC, NULL);
fc_frame_free(fp); fc_frame_free(fp);
} }
...@@ -481,7 +481,7 @@ static void fc_lport_recv_rnid_req(struct fc_lport *lport, ...@@ -481,7 +481,7 @@ static void fc_lport_recv_rnid_req(struct fc_lport *lport,
if (!req) { if (!req) {
rjt_data.reason = ELS_RJT_LOGIC; rjt_data.reason = ELS_RJT_LOGIC;
rjt_data.explan = ELS_EXPL_NONE; rjt_data.explan = ELS_EXPL_NONE;
lport->tt.seq_els_rsp_send(in_fp, ELS_LS_RJT, &rjt_data); fc_seq_els_rsp_send(in_fp, ELS_LS_RJT, &rjt_data);
} else { } else {
fmt = req->rnid_fmt; fmt = req->rnid_fmt;
len = sizeof(*rp); len = sizeof(*rp);
...@@ -521,7 +521,7 @@ static void fc_lport_recv_rnid_req(struct fc_lport *lport, ...@@ -521,7 +521,7 @@ static void fc_lport_recv_rnid_req(struct fc_lport *lport,
*/ */
static void fc_lport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp) static void fc_lport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp)
{ {
lport->tt.seq_els_rsp_send(fp, ELS_LS_ACC, NULL); fc_seq_els_rsp_send(fp, ELS_LS_ACC, NULL);
fc_lport_enter_reset(lport); fc_lport_enter_reset(lport);
fc_frame_free(fp); fc_frame_free(fp);
} }
......
...@@ -967,7 +967,7 @@ static void fc_rport_recv_flogi_req(struct fc_lport *lport, ...@@ -967,7 +967,7 @@ static void fc_rport_recv_flogi_req(struct fc_lport *lport,
reject_put: reject_put:
kref_put(&rdata->kref, lport->tt.rport_destroy); kref_put(&rdata->kref, lport->tt.rport_destroy);
reject: reject:
lport->tt.seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data); fc_seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
fc_frame_free(rx_fp); fc_frame_free(rx_fp);
} }
...@@ -1416,7 +1416,7 @@ static void fc_rport_recv_rtv_req(struct fc_rport_priv *rdata, ...@@ -1416,7 +1416,7 @@ static void fc_rport_recv_rtv_req(struct fc_rport_priv *rdata,
if (!fp) { if (!fp) {
rjt_data.reason = ELS_RJT_UNAB; rjt_data.reason = ELS_RJT_UNAB;
rjt_data.reason = ELS_EXPL_INSUF_RES; rjt_data.reason = ELS_EXPL_INSUF_RES;
lport->tt.seq_els_rsp_send(in_fp, ELS_LS_RJT, &rjt_data); fc_seq_els_rsp_send(in_fp, ELS_LS_RJT, &rjt_data);
goto drop; goto drop;
} }
rtv = fc_frame_payload_get(fp, sizeof(*rtv)); rtv = fc_frame_payload_get(fp, sizeof(*rtv));
...@@ -1591,7 +1591,7 @@ static void fc_rport_recv_adisc_req(struct fc_rport_priv *rdata, ...@@ -1591,7 +1591,7 @@ static void fc_rport_recv_adisc_req(struct fc_rport_priv *rdata,
if (!adisc) { if (!adisc) {
rjt_data.reason = ELS_RJT_PROT; rjt_data.reason = ELS_RJT_PROT;
rjt_data.explan = ELS_EXPL_INV_LEN; rjt_data.explan = ELS_EXPL_INV_LEN;
lport->tt.seq_els_rsp_send(in_fp, ELS_LS_RJT, &rjt_data); fc_seq_els_rsp_send(in_fp, ELS_LS_RJT, &rjt_data);
goto drop; goto drop;
} }
...@@ -1667,7 +1667,7 @@ static void fc_rport_recv_rls_req(struct fc_rport_priv *rdata, ...@@ -1667,7 +1667,7 @@ static void fc_rport_recv_rls_req(struct fc_rport_priv *rdata,
goto out; goto out;
out_rjt: out_rjt:
lport->tt.seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data); fc_seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
out: out:
fc_frame_free(rx_fp); fc_frame_free(rx_fp);
} }
...@@ -1734,11 +1734,11 @@ static void fc_rport_recv_els_req(struct fc_lport *lport, struct fc_frame *fp) ...@@ -1734,11 +1734,11 @@ static void fc_rport_recv_els_req(struct fc_lport *lport, struct fc_frame *fp)
fc_rport_recv_adisc_req(rdata, fp); fc_rport_recv_adisc_req(rdata, fp);
break; break;
case ELS_RRQ: case ELS_RRQ:
lport->tt.seq_els_rsp_send(fp, ELS_RRQ, NULL); fc_seq_els_rsp_send(fp, ELS_RRQ, NULL);
fc_frame_free(fp); fc_frame_free(fp);
break; break;
case ELS_REC: case ELS_REC:
lport->tt.seq_els_rsp_send(fp, ELS_REC, NULL); fc_seq_els_rsp_send(fp, ELS_REC, NULL);
fc_frame_free(fp); fc_frame_free(fp);
break; break;
case ELS_RLS: case ELS_RLS:
...@@ -1759,14 +1759,14 @@ static void fc_rport_recv_els_req(struct fc_lport *lport, struct fc_frame *fp) ...@@ -1759,14 +1759,14 @@ static void fc_rport_recv_els_req(struct fc_lport *lport, struct fc_frame *fp)
reject: reject:
els_data.reason = ELS_RJT_UNAB; els_data.reason = ELS_RJT_UNAB;
els_data.explan = ELS_EXPL_PLOGI_REQD; els_data.explan = ELS_EXPL_PLOGI_REQD;
lport->tt.seq_els_rsp_send(fp, ELS_LS_RJT, &els_data); fc_seq_els_rsp_send(fp, ELS_LS_RJT, &els_data);
fc_frame_free(fp); fc_frame_free(fp);
return; return;
busy: busy:
els_data.reason = ELS_RJT_BUSY; els_data.reason = ELS_RJT_BUSY;
els_data.explan = ELS_EXPL_NONE; els_data.explan = ELS_EXPL_NONE;
lport->tt.seq_els_rsp_send(fp, ELS_LS_RJT, &els_data); fc_seq_els_rsp_send(fp, ELS_LS_RJT, &els_data);
fc_frame_free(fp); fc_frame_free(fp);
return; return;
} }
...@@ -1812,7 +1812,7 @@ static void fc_rport_recv_req(struct fc_lport *lport, struct fc_frame *fp) ...@@ -1812,7 +1812,7 @@ static void fc_rport_recv_req(struct fc_lport *lport, struct fc_frame *fp)
default: default:
els_data.reason = ELS_RJT_UNSUP; els_data.reason = ELS_RJT_UNSUP;
els_data.explan = ELS_EXPL_NONE; els_data.explan = ELS_EXPL_NONE;
lport->tt.seq_els_rsp_send(fp, ELS_LS_RJT, &els_data); fc_seq_els_rsp_send(fp, ELS_LS_RJT, &els_data);
fc_frame_free(fp); fc_frame_free(fp);
break; break;
} }
...@@ -1939,7 +1939,7 @@ static void fc_rport_recv_plogi_req(struct fc_lport *lport, ...@@ -1939,7 +1939,7 @@ static void fc_rport_recv_plogi_req(struct fc_lport *lport,
return; return;
reject: reject:
lport->tt.seq_els_rsp_send(fp, ELS_LS_RJT, &rjt_data); fc_seq_els_rsp_send(fp, ELS_LS_RJT, &rjt_data);
fc_frame_free(fp); fc_frame_free(fp);
} }
...@@ -2055,7 +2055,7 @@ static void fc_rport_recv_prli_req(struct fc_rport_priv *rdata, ...@@ -2055,7 +2055,7 @@ static void fc_rport_recv_prli_req(struct fc_rport_priv *rdata,
rjt_data.reason = ELS_RJT_PROT; rjt_data.reason = ELS_RJT_PROT;
rjt_data.explan = ELS_EXPL_INV_LEN; rjt_data.explan = ELS_EXPL_INV_LEN;
reject: reject:
lport->tt.seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data); fc_seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
drop: drop:
fc_frame_free(rx_fp); fc_frame_free(rx_fp);
} }
...@@ -2126,7 +2126,7 @@ static void fc_rport_recv_prlo_req(struct fc_rport_priv *rdata, ...@@ -2126,7 +2126,7 @@ static void fc_rport_recv_prlo_req(struct fc_rport_priv *rdata,
rjt_data.reason = ELS_RJT_PROT; rjt_data.reason = ELS_RJT_PROT;
rjt_data.explan = ELS_EXPL_INV_LEN; rjt_data.explan = ELS_EXPL_INV_LEN;
reject: reject:
lport->tt.seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data); fc_seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
drop: drop:
fc_frame_free(rx_fp); fc_frame_free(rx_fp);
} }
...@@ -2146,7 +2146,7 @@ static void fc_rport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp) ...@@ -2146,7 +2146,7 @@ static void fc_rport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp)
struct fc_rport_priv *rdata; struct fc_rport_priv *rdata;
u32 sid; u32 sid;
lport->tt.seq_els_rsp_send(fp, ELS_LS_ACC, NULL); fc_seq_els_rsp_send(fp, ELS_LS_ACC, NULL);
sid = fc_frame_sid(fp); sid = fc_frame_sid(fp);
......
...@@ -552,14 +552,6 @@ struct libfc_function_template { ...@@ -552,14 +552,6 @@ struct libfc_function_template {
int (*seq_send)(struct fc_lport *, struct fc_seq *, int (*seq_send)(struct fc_lport *, struct fc_seq *,
struct fc_frame *); struct fc_frame *);
/*
* Send an ELS response using information from the received frame.
*
* STATUS: OPTIONAL
*/
void (*seq_els_rsp_send)(struct fc_frame *, enum fc_els_cmd,
struct fc_seq_els_data *);
/* /*
* Abort an exchange and sequence. Generally called because of a * Abort an exchange and sequence. Generally called because of a
* exchange timeout or an abort from the upper layer. * exchange timeout or an abort from the upper layer.
...@@ -1138,6 +1130,8 @@ void fc_fill_hdr(struct fc_frame *, const struct fc_frame *, ...@@ -1138,6 +1130,8 @@ void fc_fill_hdr(struct fc_frame *, const struct fc_frame *,
*****************************/ *****************************/
int fc_exch_init(struct fc_lport *); int fc_exch_init(struct fc_lport *);
void fc_exch_update_stats(struct fc_lport *lport); void fc_exch_update_stats(struct fc_lport *lport);
void fc_seq_els_rsp_send(struct fc_frame *, enum fc_els_cmd,
struct fc_seq_els_data *);
struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *, struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *,
struct fc_exch_mgr *, struct fc_exch_mgr *,
bool (*match)(struct fc_frame *)); bool (*match)(struct fc_frame *));
......
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