drivers/scsi/be2iscsi/be_iscsi.c
Source file repositories/reference/linux-study-clean/drivers/scsi/be2iscsi/be_iscsi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/be2iscsi/be_iscsi.c- Extension
.c- Size
- 39019 bytes
- Lines
- 1416
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
scsi/libiscsi.hscsi/scsi_transport_iscsi.hscsi/scsi_transport.hscsi/scsi_cmnd.hscsi/scsi_device.hscsi/scsi_host.hscsi/scsi_netlink.hnet/netlink.hscsi/scsi.hbe_iscsi.h
Detected Declarations
function beiscsi_session_destroyfunction beiscsi_session_failfunction beiscsi_conn_createfunction beiscsi_conn_bindfunction beiscsi_iface_create_ipv4function beiscsi_iface_create_ipv6function beiscsi_iface_create_defaultfunction beiscsi_iface_destroy_defaultfunction beiscsi_iface_config_vlanfunction beiscsi_iface_config_ipv4function beiscsi_iface_config_ipv6function beiscsi_iface_set_paramfunction nla_for_each_attrfunction __beiscsi_iface_get_paramfunction beiscsi_iface_get_paramfunction beiscsi_ep_get_paramfunction beiscsi_set_paramfunction beiscsi_get_port_statefunction beiscsi_get_port_speedfunction beiscsi_get_host_paramfunction beiscsi_get_macaddrfunction beiscsi_conn_get_statsfunction beiscsi_set_params_for_offldfunction beiscsi_conn_startfunction beiscsi_get_cidfunction beiscsi_put_cidfunction beiscsi_free_epfunction beiscsi_open_connfunction beiscsi_ep_connectfunction beiscsi_ep_pollfunction beiscsi_flush_cqfunction beiscsi_conn_closefunction beiscsi_ep_disconnectfunction beiscsi_attr_is_visible
Annotated Snippet
if (nla) {
info = nla_data(nla);
subnet = info->value;
}
ret = beiscsi_if_en_static(phba, BEISCSI_IP_TYPE_V4,
ip, subnet);
break;
case ISCSI_NET_PARAM_IPV4_SUBNET:
/*
* OPCODE_COMMON_ISCSI_NTWK_MODIFY_IP_ADDR ioctl needs IP
* and subnet both. Find IP to be applied for this subnet.
*/
subnet = info->value;
nla = nla_find(data, dt_len, ISCSI_NET_PARAM_IPV4_ADDR);
if (nla) {
info = nla_data(nla);
ip = info->value;
}
ret = beiscsi_if_en_static(phba, BEISCSI_IP_TYPE_V4,
ip, subnet);
break;
}
return ret;
}
static int
beiscsi_iface_config_ipv6(struct Scsi_Host *shost,
struct iscsi_iface_param_info *iface_param,
void *data, uint32_t dt_len)
{
struct beiscsi_hba *phba = iscsi_host_priv(shost);
int ret = -EPERM;
switch (iface_param->param) {
case ISCSI_NET_PARAM_IFACE_ENABLE:
if (iface_param->value[0] == ISCSI_IFACE_ENABLE)
ret = beiscsi_iface_create_ipv6(phba);
else {
iscsi_destroy_iface(phba->ipv6_iface);
phba->ipv6_iface = NULL;
}
break;
case ISCSI_NET_PARAM_IPV6_ADDR:
ret = beiscsi_if_en_static(phba, BEISCSI_IP_TYPE_V6,
iface_param->value, NULL);
break;
}
return ret;
}
int beiscsi_iface_set_param(struct Scsi_Host *shost,
void *data, uint32_t dt_len)
{
struct iscsi_iface_param_info *iface_param = NULL;
struct beiscsi_hba *phba = iscsi_host_priv(shost);
struct nlattr *attrib;
uint32_t rm_len = dt_len;
int ret;
if (!beiscsi_hba_is_online(phba)) {
beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
"BS_%d : HBA in error 0x%lx\n", phba->state);
return -EBUSY;
}
/* update interface_handle */
ret = beiscsi_if_get_handle(phba);
if (ret) {
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
"BS_%d : Getting Interface Handle Failed\n");
return ret;
}
nla_for_each_attr(attrib, data, dt_len, rm_len) {
/* ignore nla_type as it is never used */
if (nla_len(attrib) < sizeof(*iface_param))
return -EINVAL;
iface_param = nla_data(attrib);
if (iface_param->param_type != ISCSI_NET_PARAM)
continue;
/*
* BE2ISCSI only supports 1 interface
*/
if (iface_param->iface_num) {
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
Annotation
- Immediate include surface: `scsi/libiscsi.h`, `scsi/scsi_transport_iscsi.h`, `scsi/scsi_transport.h`, `scsi/scsi_cmnd.h`, `scsi/scsi_device.h`, `scsi/scsi_host.h`, `scsi/scsi_netlink.h`, `net/netlink.h`.
- Detected declarations: `function beiscsi_session_destroy`, `function beiscsi_session_fail`, `function beiscsi_conn_create`, `function beiscsi_conn_bind`, `function beiscsi_iface_create_ipv4`, `function beiscsi_iface_create_ipv6`, `function beiscsi_iface_create_default`, `function beiscsi_iface_destroy_default`, `function beiscsi_iface_config_vlan`, `function beiscsi_iface_config_ipv4`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
- 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.