drivers/scsi/bfa/bfa_fcbuild.c
Source file repositories/reference/linux-study-clean/drivers/scsi/bfa/bfa_fcbuild.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/bfa/bfa_fcbuild.c- Extension
.c- Size
- 23025 bytes
- Lines
- 867
- Domain
- Driver Families
- Bucket
- drivers/scsi
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
bfad_drv.hbfa_fcbuild.h
Detected Declarations
function fcbuild_initfunction fc_gs_fchdr_buildfunction fc_gsresp_fchdr_buildfunction fc_els_req_buildfunction fc_els_rsp_buildfunction fc_bls_rsp_buildfunction fc_plogi_x_buildfunction fc_flogi_acc_buildfunction fc_plogi_buildfunction fc_plogi_acc_buildfunction fc_plogi_parsefunction fc_prli_buildfunction fc_prli_acc_buildfunction fc_prli_rsp_parsefunction fc_logo_buildfunction fc_adisc_x_buildfunction fc_adisc_buildfunction fc_adisc_acc_buildfunction fc_adisc_rsp_parsefunction fc_logo_acc_buildfunction fc_ls_rjt_buildfunction fc_ba_acc_buildfunction fc_ls_acc_buildfunction fc_logout_params_pagesfunction fc_prlo_acc_buildfunction fc_rnid_acc_buildfunction fc_rpsc2_buildfunction fc_rpsc_acc_buildfunction fc_gs_cthdr_buildfunction fc_gs_fdmi_cthdr_buildfunction fc_gs_ms_cthdr_buildfunction fc_gidpn_buildfunction fc_gpnid_buildfunction fc_gs_rjt_buildfunction fc_scr_buildfunction fc_rftid_buildfunction fc_rffid_buildfunction fc_rspnid_buildfunction fc_rsnn_nn_buildfunction fc_gid_ft_buildfunction fc_rnnid_buildfunction fc_fdmi_reqhdr_buildfunction fc_get_fc4type_bitmaskfunction fc_gmal_req_buildfunction GFN
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
* Copyright (c) 2014- QLogic Corporation.
* All rights reserved
* www.qlogic.com
*
* Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter.
*/
/*
* fcbuild.c - FC link service frame building and parsing routines
*/
#include "bfad_drv.h"
#include "bfa_fcbuild.h"
/*
* static build functions
*/
static void fc_els_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
__be16 ox_id);
static void fc_bls_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
__be16 ox_id);
static struct fchs_s fc_els_req_tmpl;
static struct fchs_s fc_els_rsp_tmpl;
static struct fchs_s fc_bls_req_tmpl;
static struct fchs_s fc_bls_rsp_tmpl;
static struct fc_ba_acc_s ba_acc_tmpl;
static struct fc_logi_s plogi_tmpl;
static struct fc_prli_s prli_tmpl;
static struct fc_rrq_s rrq_tmpl;
static struct fchs_s fcp_fchs_tmpl;
void
fcbuild_init(void)
{
/*
* fc_els_req_tmpl
*/
fc_els_req_tmpl.routing = FC_RTG_EXT_LINK;
fc_els_req_tmpl.cat_info = FC_CAT_LD_REQUEST;
fc_els_req_tmpl.type = FC_TYPE_ELS;
fc_els_req_tmpl.f_ctl =
bfa_hton3b(FCTL_SEQ_INI | FCTL_FS_EXCH | FCTL_END_SEQ |
FCTL_SI_XFER);
fc_els_req_tmpl.rx_id = FC_RXID_ANY;
/*
* fc_els_rsp_tmpl
*/
fc_els_rsp_tmpl.routing = FC_RTG_EXT_LINK;
fc_els_rsp_tmpl.cat_info = FC_CAT_LD_REPLY;
fc_els_rsp_tmpl.type = FC_TYPE_ELS;
fc_els_rsp_tmpl.f_ctl =
bfa_hton3b(FCTL_EC_RESP | FCTL_SEQ_INI | FCTL_LS_EXCH |
FCTL_END_SEQ | FCTL_SI_XFER);
fc_els_rsp_tmpl.rx_id = FC_RXID_ANY;
/*
* fc_bls_req_tmpl
*/
fc_bls_req_tmpl.routing = FC_RTG_BASIC_LINK;
fc_bls_req_tmpl.type = FC_TYPE_BLS;
fc_bls_req_tmpl.f_ctl = bfa_hton3b(FCTL_END_SEQ | FCTL_SI_XFER);
fc_bls_req_tmpl.rx_id = FC_RXID_ANY;
/*
* fc_bls_rsp_tmpl
*/
fc_bls_rsp_tmpl.routing = FC_RTG_BASIC_LINK;
fc_bls_rsp_tmpl.cat_info = FC_CAT_BA_ACC;
fc_bls_rsp_tmpl.type = FC_TYPE_BLS;
fc_bls_rsp_tmpl.f_ctl =
bfa_hton3b(FCTL_EC_RESP | FCTL_SEQ_INI | FCTL_LS_EXCH |
FCTL_END_SEQ | FCTL_SI_XFER);
fc_bls_rsp_tmpl.rx_id = FC_RXID_ANY;
/*
* ba_acc_tmpl
*/
ba_acc_tmpl.seq_id_valid = 0;
ba_acc_tmpl.low_seq_cnt = 0;
ba_acc_tmpl.high_seq_cnt = 0xFFFF;
/*
* plogi_tmpl
*/
plogi_tmpl.csp.verhi = FC_PH_VER_PH_3;
plogi_tmpl.csp.verlo = FC_PH_VER_4_3;
plogi_tmpl.csp.ciro = 0x1;
Annotation
- Immediate include surface: `bfad_drv.h`, `bfa_fcbuild.h`.
- Detected declarations: `function fcbuild_init`, `function fc_gs_fchdr_build`, `function fc_gsresp_fchdr_build`, `function fc_els_req_build`, `function fc_els_rsp_build`, `function fc_bls_rsp_build`, `function fc_plogi_x_build`, `function fc_flogi_acc_build`, `function fc_plogi_build`, `function fc_plogi_acc_build`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.