Skip to content

Commit 575143a

Browse files
Dr. David Alan Gilbertmartinkpetersen
authored andcommitted
scsi: bfa: Remove unused parsers
bfa has a set of structure parsers, of which quite a few are unused. Remove the unused set. Signed-off-by: Dr. David Alan Gilbert <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 52172a3 commit 575143a

File tree

2 files changed

+0
-151
lines changed

2 files changed

+0
-151
lines changed

drivers/scsi/bfa/bfa_fcbuild.c

Lines changed: 0 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -259,40 +259,6 @@ fc_plogi_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id,
259259
node_name, pdu_size, bb_cr, FC_ELS_ACC);
260260
}
261261

262-
enum fc_parse_status
263-
fc_plogi_rsp_parse(struct fchs_s *fchs, int len, wwn_t port_name)
264-
{
265-
struct fc_els_cmd_s *els_cmd = (struct fc_els_cmd_s *) (fchs + 1);
266-
struct fc_logi_s *plogi;
267-
struct fc_ls_rjt_s *ls_rjt;
268-
269-
switch (els_cmd->els_code) {
270-
case FC_ELS_LS_RJT:
271-
ls_rjt = (struct fc_ls_rjt_s *) (fchs + 1);
272-
if (ls_rjt->reason_code == FC_LS_RJT_RSN_LOGICAL_BUSY)
273-
return FC_PARSE_BUSY;
274-
else
275-
return FC_PARSE_FAILURE;
276-
case FC_ELS_ACC:
277-
plogi = (struct fc_logi_s *) (fchs + 1);
278-
if (len < sizeof(struct fc_logi_s))
279-
return FC_PARSE_FAILURE;
280-
281-
if (!wwn_is_equal(plogi->port_name, port_name))
282-
return FC_PARSE_FAILURE;
283-
284-
if (!plogi->class3.class_valid)
285-
return FC_PARSE_FAILURE;
286-
287-
if (be16_to_cpu(plogi->class3.rxsz) < (FC_MIN_PDUSZ))
288-
return FC_PARSE_FAILURE;
289-
290-
return FC_PARSE_OK;
291-
default:
292-
return FC_PARSE_FAILURE;
293-
}
294-
}
295-
296262
enum fc_parse_status
297263
fc_plogi_parse(struct fchs_s *fchs)
298264
{
@@ -365,21 +331,6 @@ fc_prli_rsp_parse(struct fc_prli_s *prli, int len)
365331
return FC_PARSE_OK;
366332
}
367333

368-
enum fc_parse_status
369-
fc_prli_parse(struct fc_prli_s *prli)
370-
{
371-
if (prli->parampage.type != FC_TYPE_FCP)
372-
return FC_PARSE_FAILURE;
373-
374-
if (!prli->parampage.imagepair)
375-
return FC_PARSE_FAILURE;
376-
377-
if (!prli->parampage.servparams.initiator)
378-
return FC_PARSE_FAILURE;
379-
380-
return FC_PARSE_OK;
381-
}
382-
383334
u16
384335
fc_logo_build(struct fchs_s *fchs, struct fc_logo_s *logo, u32 d_id, u32 s_id,
385336
u16 ox_id, wwn_t port_name)
@@ -450,55 +401,6 @@ fc_adisc_rsp_parse(struct fc_adisc_s *adisc, int len, wwn_t port_name,
450401
return FC_PARSE_OK;
451402
}
452403

453-
enum fc_parse_status
454-
fc_adisc_parse(struct fchs_s *fchs, void *pld, u32 host_dap, wwn_t node_name,
455-
wwn_t port_name)
456-
{
457-
struct fc_adisc_s *adisc = (struct fc_adisc_s *) pld;
458-
459-
if (adisc->els_cmd.els_code != FC_ELS_ACC)
460-
return FC_PARSE_FAILURE;
461-
462-
if ((adisc->nport_id == (host_dap))
463-
&& wwn_is_equal(adisc->orig_port_name, port_name)
464-
&& wwn_is_equal(adisc->orig_node_name, node_name))
465-
return FC_PARSE_OK;
466-
467-
return FC_PARSE_FAILURE;
468-
}
469-
470-
enum fc_parse_status
471-
fc_pdisc_parse(struct fchs_s *fchs, wwn_t node_name, wwn_t port_name)
472-
{
473-
struct fc_logi_s *pdisc = (struct fc_logi_s *) (fchs + 1);
474-
475-
if (pdisc->class3.class_valid != 1)
476-
return FC_PARSE_FAILURE;
477-
478-
if ((be16_to_cpu(pdisc->class3.rxsz) <
479-
(FC_MIN_PDUSZ - sizeof(struct fchs_s)))
480-
|| (pdisc->class3.rxsz == 0))
481-
return FC_PARSE_FAILURE;
482-
483-
if (!wwn_is_equal(pdisc->port_name, port_name))
484-
return FC_PARSE_FAILURE;
485-
486-
if (!wwn_is_equal(pdisc->node_name, node_name))
487-
return FC_PARSE_FAILURE;
488-
489-
return FC_PARSE_OK;
490-
}
491-
492-
enum fc_parse_status
493-
fc_abts_rsp_parse(struct fchs_s *fchs, int len)
494-
{
495-
if ((fchs->cat_info == FC_CAT_BA_ACC)
496-
|| (fchs->cat_info == FC_CAT_BA_RJT))
497-
return FC_PARSE_OK;
498-
499-
return FC_PARSE_FAILURE;
500-
}
501-
502404
u16
503405
fc_logo_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id,
504406
__be16 ox_id)
@@ -666,29 +568,6 @@ fc_rpsc_acc_build(struct fchs_s *fchs, struct fc_rpsc_acc_s *rpsc_acc,
666568
return sizeof(struct fc_rpsc_acc_s);
667569
}
668570

669-
u16
670-
fc_pdisc_rsp_parse(struct fchs_s *fchs, int len, wwn_t port_name)
671-
{
672-
struct fc_logi_s *pdisc = (struct fc_logi_s *) (fchs + 1);
673-
674-
if (len < sizeof(struct fc_logi_s))
675-
return FC_PARSE_LEN_INVAL;
676-
677-
if (pdisc->els_cmd.els_code != FC_ELS_ACC)
678-
return FC_PARSE_ACC_INVAL;
679-
680-
if (!wwn_is_equal(pdisc->port_name, port_name))
681-
return FC_PARSE_PWWN_NOT_EQUAL;
682-
683-
if (!pdisc->class3.class_valid)
684-
return FC_PARSE_NWWN_NOT_EQUAL;
685-
686-
if (be16_to_cpu(pdisc->class3.rxsz) < (FC_MIN_PDUSZ))
687-
return FC_PARSE_RXSZ_INVAL;
688-
689-
return FC_PARSE_OK;
690-
}
691-
692571
static void
693572
fc_gs_cthdr_build(struct ct_hdr_s *cthdr, u32 s_id, u16 cmd_code)
694573
{
@@ -752,19 +631,6 @@ fc_gpnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
752631
return sizeof(fcgs_gpnid_req_t) + sizeof(struct ct_hdr_s);
753632
}
754633

755-
u16
756-
fc_ct_rsp_parse(struct ct_hdr_s *cthdr)
757-
{
758-
if (be16_to_cpu(cthdr->cmd_rsp_code) != CT_RSP_ACCEPT) {
759-
if (cthdr->reason_code == CT_RSN_LOGICAL_BUSY)
760-
return FC_PARSE_BUSY;
761-
else
762-
return FC_PARSE_FAILURE;
763-
}
764-
765-
return FC_PARSE_OK;
766-
}
767-
768634
u16
769635
fc_gs_rjt_build(struct fchs_s *fchs, struct ct_hdr_s *cthdr,
770636
u32 d_id, u32 s_id, u16 ox_id, u8 reason_code,

drivers/scsi/bfa/bfa_fcbuild.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ u16 fc_plogi_build(struct fchs_s *fchs, void *pld, u32 d_id,
139139

140140
enum fc_parse_status fc_plogi_parse(struct fchs_s *fchs);
141141

142-
enum fc_parse_status fc_abts_rsp_parse(struct fchs_s *buf, int len);
143-
144142
u16 fc_rspnid_build(struct fchs_s *fchs, void *pld, u32 s_id,
145143
u16 ox_id, u8 *name);
146144
u16 fc_rsnn_nn_build(struct fchs_s *fchs, void *pld, u32 s_id,
@@ -174,9 +172,6 @@ u16 fc_adisc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc,
174172
u32 d_id, u32 s_id, __be16 ox_id, wwn_t port_name,
175173
wwn_t node_name);
176174

177-
enum fc_parse_status fc_adisc_parse(struct fchs_s *fchs, void *pld,
178-
u32 host_dap, wwn_t node_name, wwn_t port_name);
179-
180175
enum fc_parse_status fc_adisc_rsp_parse(struct fc_adisc_s *adisc, int len,
181176
wwn_t port_name, wwn_t node_name);
182177

@@ -230,14 +225,6 @@ void fc_get_fc4type_bitmask(u8 fc4_type, u8 *bit_mask);
230225
void fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
231226
__be16 ox_id);
232227

233-
enum fc_parse_status fc_plogi_rsp_parse(struct fchs_s *fchs, int len,
234-
wwn_t port_name);
235-
236-
enum fc_parse_status fc_prli_parse(struct fc_prli_s *prli);
237-
238-
enum fc_parse_status fc_pdisc_parse(struct fchs_s *fchs, wwn_t node_name,
239-
wwn_t port_name);
240-
241228
u16 fc_ba_acc_build(struct fchs_s *fchs, struct fc_ba_acc_s *ba_acc, u32 d_id,
242229
u32 s_id, __be16 ox_id, u16 rx_id);
243230

@@ -246,12 +233,8 @@ int fc_logout_params_pages(struct fchs_s *fc_frame, u8 els_code);
246233
u16 fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc,
247234
u32 d_id, u32 s_id, __be16 ox_id, int num_pages);
248235

249-
u16 fc_pdisc_rsp_parse(struct fchs_s *fchs, int len, wwn_t port_name);
250-
251236
u16 fc_tprlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
252237
u16 ox_id, int num_pages, enum fc_tprlo_type tprlo_type,
253238
u32 tpr_id);
254239

255-
u16 fc_ct_rsp_parse(struct ct_hdr_s *cthdr);
256-
257240
#endif

0 commit comments

Comments
 (0)