drivers/s390/net/qeth_core_main.c
Source file repositories/reference/linux-study-clean/drivers/s390/net/qeth_core_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/net/qeth_core_main.c- Extension
.c- Size
- 191053 bytes
- Lines
- 7184
- Domain
- Driver Families
- Bucket
- drivers/s390
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/export.hlinux/module.hlinux/moduleparam.hlinux/string.hlinux/errno.hlinux/kernel.hlinux/log2.hlinux/io.hlinux/ip.hlinux/tcp.hlinux/mii.hlinux/mm.hlinux/kthread.hlinux/slab.hlinux/if_vlan.hlinux/netdevice.hlinux/netdev_features.hlinux/rcutree.hlinux/skbuff.hlinux/vmalloc.hnet/iucv/af_iucv.hnet/dsfield.hnet/sock.hasm/ebcdic.hasm/chpid.hasm/sysinfo.hasm/diag.hasm/cio.hasm/ccwdev.hasm/cpcmd.hqeth_core.h
Detected Declarations
struct qeth_node_descstruct qeth_dbf_entryfunction qeth_set_allowed_threadsfunction qeth_threads_runningfunction qeth_clear_working_pool_listfunction qeth_free_pool_entryfunction qeth_free_buffer_poolfunction list_for_each_entry_safefunction qeth_alloc_buffer_poolfunction qeth_resize_buffer_poolfunction qeth_free_qdio_queuefunction qeth_cq_initfunction qeth_free_cqfunction qeth_alloc_cqfunction qeth_compute_cq_notificationfunction qeth_put_cmdfunction qeth_setup_ccwfunction __qeth_issue_next_readfunction qeth_issue_next_readfunction qeth_enqueue_cmdfunction qeth_dequeue_cmdfunction qeth_notify_cmdfunction qeth_flush_local_addrs4function qeth_flush_local_addrs6function qeth_flush_local_addrsfunction qeth_add_local_addrs4function hash_for_each_possiblefunction qeth_add_local_addrs6function hash_for_each_possiblefunction qeth_del_local_addrs4function hash_for_each_possiblefunction qeth_del_local_addrs6function hash_for_each_possiblefunction qeth_next_hop_is_local_v4function hash_for_each_possible_rcufunction qeth_next_hop_is_local_v6function hash_for_each_possible_rcufunction qeth_debugfs_local_addr_showfunction qeth_issue_ipa_msgfunction qeth_default_link_infofunction qeth_clear_ipacmd_listfunction qeth_check_idx_responsefunction qeth_release_buffer_cbfunction qeth_cancel_cmdfunction qeth_issue_next_read_cbfunction qeth_set_thread_start_bitfunction qeth_clear_thread_start_bitfunction qeth_clear_thread_running_bit
Annotated Snippet
static ssize_t group_store(struct device_driver *ddrv, const char *buf,
size_t count)
{
int err;
err = ccwgroup_create_dev(qeth_core_root_dev, to_ccwgroupdrv(ddrv), 3,
buf);
return err ? err : count;
}
static DRIVER_ATTR_WO(group);
static struct attribute *qeth_drv_attrs[] = {
&driver_attr_group.attr,
NULL,
};
static struct attribute_group qeth_drv_attr_group = {
.attrs = qeth_drv_attrs,
};
static const struct attribute_group *qeth_drv_attr_groups[] = {
&qeth_drv_attr_group,
NULL,
};
static struct ccwgroup_driver qeth_core_ccwgroup_driver = {
.driver = {
.groups = qeth_drv_attr_groups,
.owner = THIS_MODULE,
.name = "qeth",
},
.ccw_driver = &qeth_ccw_driver,
.setup = qeth_core_probe_device,
.remove = qeth_core_remove_device,
.set_online = qeth_core_set_online,
.set_offline = qeth_core_set_offline,
.shutdown = qeth_core_shutdown,
};
int qeth_siocdevprivate(struct net_device *dev, struct ifreq *rq, void __user *data, int cmd)
{
struct qeth_card *card = dev->ml_priv;
int rc = 0;
switch (cmd) {
case SIOC_QETH_ADP_SET_SNMP_CONTROL:
rc = qeth_snmp_command(card, data);
break;
case SIOC_QETH_GET_CARD_TYPE:
if ((IS_OSD(card) || IS_OSM(card) || IS_OSX(card)) &&
!IS_VM_NIC(card))
return 1;
return 0;
case SIOC_QETH_QUERY_OAT:
rc = qeth_query_oat_command(card, data);
break;
default:
rc = -EOPNOTSUPP;
}
if (rc)
QETH_CARD_TEXT_(card, 2, "ioce%x", rc);
return rc;
}
EXPORT_SYMBOL_GPL(qeth_siocdevprivate);
int qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
struct qeth_card *card = dev->ml_priv;
struct mii_ioctl_data *mii_data;
int rc = 0;
switch (cmd) {
case SIOCGMIIPHY:
mii_data = if_mii(rq);
mii_data->phy_id = 0;
break;
case SIOCGMIIREG:
mii_data = if_mii(rq);
if (mii_data->phy_id != 0)
rc = -EINVAL;
else
mii_data->val_out = qeth_mdio_read(dev,
mii_data->phy_id, mii_data->reg_num);
break;
default:
return -EOPNOTSUPP;
}
if (rc)
QETH_CARD_TEXT_(card, 2, "ioce%x", rc);
return rc;
}
Annotation
- Immediate include surface: `linux/export.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/string.h`, `linux/errno.h`, `linux/kernel.h`, `linux/log2.h`, `linux/io.h`.
- Detected declarations: `struct qeth_node_desc`, `struct qeth_dbf_entry`, `function qeth_set_allowed_threads`, `function qeth_threads_running`, `function qeth_clear_working_pool_list`, `function qeth_free_pool_entry`, `function qeth_free_buffer_pool`, `function list_for_each_entry_safe`, `function qeth_alloc_buffer_pool`, `function qeth_resize_buffer_pool`.
- Atlas domain: Driver Families / drivers/s390.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.