drivers/scsi/be2iscsi/be_mgmt.c
Source file repositories/reference/linux-study-clean/drivers/scsi/be2iscsi/be_mgmt.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/be2iscsi/be_mgmt.c- Extension
.c- Size
- 46415 bytes
- Lines
- 1561
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bsg-lib.hscsi/scsi_transport_iscsi.hscsi/scsi_bsg_iscsi.hbe_mgmt.hbe_iscsi.hbe_main.h
Detected Declarations
function mgmt_vendor_specific_fw_cmdfunction mgmt_open_connectionfunction beiscsi_exec_nemb_cmdfunction beiscsi_prep_nemb_cmdfunction beiscsi_free_nemb_cmdfunction __beiscsi_eq_delay_complfunction beiscsi_modify_eq_delayfunction beiscsi_get_initiator_namefunction beiscsi_if_get_handlefunction beiscsi_if_zero_ipfunction beiscsi_if_mod_gwfunction beiscsi_if_set_gwfunction beiscsi_if_get_gwfunction beiscsi_if_clr_ipfunction beiscsi_if_set_ipfunction beiscsi_if_en_staticfunction beiscsi_if_en_dhcpfunction beiscsi_if_set_vlanfunction beiscsi_if_get_infofunction mgmt_get_nic_conffunction beiscsi_boot_process_complfunction beiscsi_boot_logout_sessfunction beiscsi_boot_reopen_sessfunction beiscsi_boot_get_sinfofunction __beiscsi_boot_get_shandlefunction beiscsi_boot_get_shandlefunction beiscsi_drvr_ver_dispfunction beiscsi_fw_ver_dispfunction beiscsi_active_session_dispfunction beiscsi_free_session_dispfunction beiscsi_adap_family_dispfunction beiscsi_phys_port_dispfunction beiscsi_offload_cxn_v0function beiscsi_offload_cxn_v2function beiscsi_invalidate_cxnfunction beiscsi_upload_cxnfunction beiscsi_mgmt_invalidate_icds
Annotated Snippet
if (rt_val) {
beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
"BG_%d : Failed to clear Gateway Addr Set\n");
return rt_val;
}
}
rt_val = beiscsi_if_mod_gw(phba, IP_ACTION_ADD, ip_type, gw);
if (rt_val)
beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
"BG_%d : Failed to Set Gateway Addr\n");
return rt_val;
}
int beiscsi_if_get_gw(struct beiscsi_hba *phba, u32 ip_type,
struct be_cmd_get_def_gateway_resp *resp)
{
struct be_cmd_get_def_gateway_req *req;
struct be_dma_mem nonemb_cmd;
int rc;
rc = beiscsi_prep_nemb_cmd(phba, &nonemb_cmd, CMD_SUBSYSTEM_ISCSI,
OPCODE_COMMON_ISCSI_NTWK_GET_DEFAULT_GATEWAY,
sizeof(*resp));
if (rc)
return rc;
req = nonemb_cmd.va;
req->ip_type = ip_type;
rc = beiscsi_exec_nemb_cmd(phba, &nonemb_cmd, NULL, resp,
sizeof(*resp));
beiscsi_free_nemb_cmd(phba, &nonemb_cmd, rc);
return rc;
}
static int
beiscsi_if_clr_ip(struct beiscsi_hba *phba,
struct be_cmd_get_if_info_resp *if_info)
{
struct be_cmd_set_ip_addr_req *req;
struct be_dma_mem nonemb_cmd;
int rc;
rc = beiscsi_prep_nemb_cmd(phba, &nonemb_cmd, CMD_SUBSYSTEM_ISCSI,
OPCODE_COMMON_ISCSI_NTWK_MODIFY_IP_ADDR,
sizeof(*req));
if (rc)
return rc;
req = nonemb_cmd.va;
req->ip_params.record_entry_count = 1;
req->ip_params.ip_record.action = IP_ACTION_DEL;
req->ip_params.ip_record.interface_hndl =
phba->interface_handle;
req->ip_params.ip_record.ip_addr.size_of_structure =
sizeof(struct be_ip_addr_subnet_format);
req->ip_params.ip_record.ip_addr.ip_type = if_info->ip_addr.ip_type;
memcpy(req->ip_params.ip_record.ip_addr.addr,
if_info->ip_addr.addr,
sizeof(if_info->ip_addr.addr));
memcpy(req->ip_params.ip_record.ip_addr.subnet_mask,
if_info->ip_addr.subnet_mask,
sizeof(if_info->ip_addr.subnet_mask));
rc = beiscsi_exec_nemb_cmd(phba, &nonemb_cmd, NULL, NULL, 0);
if (rc < 0 || req->ip_params.ip_record.status) {
beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
"BG_%d : failed to clear IP: rc %d status %d\n",
rc, req->ip_params.ip_record.status);
}
beiscsi_free_nemb_cmd(phba, &nonemb_cmd, rc);
return rc;
}
static int
beiscsi_if_set_ip(struct beiscsi_hba *phba, u8 *ip,
u8 *subnet, u32 ip_type)
{
struct be_cmd_set_ip_addr_req *req;
struct be_dma_mem nonemb_cmd;
uint32_t ip_len;
int rc;
rc = beiscsi_prep_nemb_cmd(phba, &nonemb_cmd, CMD_SUBSYSTEM_ISCSI,
OPCODE_COMMON_ISCSI_NTWK_MODIFY_IP_ADDR,
sizeof(*req));
if (rc)
return rc;
Annotation
- Immediate include surface: `linux/bsg-lib.h`, `scsi/scsi_transport_iscsi.h`, `scsi/scsi_bsg_iscsi.h`, `be_mgmt.h`, `be_iscsi.h`, `be_main.h`.
- Detected declarations: `function mgmt_vendor_specific_fw_cmd`, `function mgmt_open_connection`, `function beiscsi_exec_nemb_cmd`, `function beiscsi_prep_nemb_cmd`, `function beiscsi_free_nemb_cmd`, `function __beiscsi_eq_delay_compl`, `function beiscsi_modify_eq_delay`, `function beiscsi_get_initiator_name`, `function beiscsi_if_get_handle`, `function beiscsi_if_zero_ip`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.