drivers/s390/net/qeth_l3_main.c
Source file repositories/reference/linux-study-clean/drivers/s390/net/qeth_l3_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/net/qeth_l3_main.c- Extension
.c- Size
- 56675 bytes
- Lines
- 2230
- 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/bitops.hlinux/string.hlinux/errno.hlinux/kernel.hlinux/etherdevice.hlinux/ip.hlinux/in.hlinux/inet.hlinux/ipv6.hlinux/inetdevice.hlinux/igmp.hlinux/slab.hlinux/if_ether.hlinux/if_vlan.hlinux/skbuff.hnet/ip.hnet/arp.hnet/route.hnet/ipv6.hnet/ip6_route.hnet/iucv/af_iucv.hlinux/hashtable.hqeth_l3.h
Detected Declarations
struct qeth_l3_ip_event_workfunction qeth_l3_ipaddr_to_stringfunction qeth_l3_convert_addr_to_bitsfunction qeth_l3_is_addr_covered_by_ipatofunction qeth_l3_delete_ipfunction qeth_l3_add_ipfunction qeth_l3_modify_ipfunction qeth_l3_drain_rx_mode_cachefunction hash_for_each_safefunction qeth_l3_clear_ip_htablefunction hash_for_each_safefunction qeth_l3_recover_ipfunction hash_for_each_safefunction qeth_l3_setdelip_cbfunction qeth_l3_send_setdelmcfunction qeth_l3_set_ipv6_prefixfunction qeth_l3_get_setdelip_flagsfunction qeth_l3_send_setdelipfunction qeth_l3_send_setroutingfunction qeth_l3_correct_routing_typefunction qeth_l3_setrouting_v4function qeth_l3_setrouting_v6function qeth_l3_update_ipatofunction hash_for_eachfunction qeth_l3_clear_ipato_listfunction list_for_each_entry_safefunction qeth_l3_add_ipato_entryfunction list_for_each_entryfunction qeth_l3_del_ipato_entryfunction list_for_each_entry_safefunction qeth_l3_modify_rxip_vipafunction qeth_l3_modify_hsuidfunction qeth_l3_register_addr_entryfunction qeth_l3_deregister_addr_entryfunction qeth_l3_setadapter_parmsfunction qeth_l3_start_ipa_arp_processingfunction qeth_l3_start_ipa_source_macfunction qeth_l3_start_ipa_vlanfunction qeth_l3_start_ipa_multicastfunction qeth_l3_softsetup_ipv6function qeth_l3_start_ipa_ipv6function qeth_l3_start_ipa_broadcastfunction qeth_l3_start_ipassistsfunction qeth_l3_iqd_read_initial_mac_cbfunction qeth_l3_iqd_read_initial_macfunction qeth_l3_get_unique_id_cbfunction qeth_l3_get_unique_idfunction qeth_diags_trace_cb
Annotated Snippet
static const struct net_device_ops qeth_l3_netdev_ops = {
.ndo_open = qeth_open,
.ndo_stop = qeth_stop,
.ndo_get_stats64 = qeth_get_stats64,
.ndo_start_xmit = qeth_l3_hard_start_xmit,
.ndo_select_queue = qeth_l3_iqd_select_queue,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_rx_mode = qeth_l3_set_rx_mode,
.ndo_eth_ioctl = qeth_do_ioctl,
.ndo_siocdevprivate = qeth_l3_ndo_siocdevprivate,
.ndo_fix_features = qeth_fix_features,
.ndo_set_features = qeth_set_features,
.ndo_tx_timeout = qeth_tx_timeout,
};
static const struct net_device_ops qeth_l3_osa_netdev_ops = {
.ndo_open = qeth_open,
.ndo_stop = qeth_stop,
.ndo_get_stats64 = qeth_get_stats64,
.ndo_start_xmit = qeth_l3_hard_start_xmit,
.ndo_features_check = qeth_l3_osa_features_check,
.ndo_select_queue = qeth_osa_select_queue,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_rx_mode = qeth_l3_set_rx_mode,
.ndo_eth_ioctl = qeth_do_ioctl,
.ndo_siocdevprivate = qeth_l3_ndo_siocdevprivate,
.ndo_fix_features = qeth_fix_features,
.ndo_set_features = qeth_set_features,
.ndo_tx_timeout = qeth_tx_timeout,
.ndo_neigh_setup = qeth_l3_neigh_setup,
};
static int qeth_l3_setup_netdev(struct qeth_card *card)
{
struct net_device *dev = card->dev;
unsigned int headroom;
int rc;
if (IS_OSD(card) || IS_OSX(card)) {
card->dev->netdev_ops = &qeth_l3_osa_netdev_ops;
/*IPv6 address autoconfiguration stuff*/
dev->dev_id = qeth_l3_get_unique_id(card, dev->dev_id);
if (!IS_VM_NIC(card)) {
card->dev->features |= NETIF_F_SG;
card->dev->hw_features |= NETIF_F_TSO |
NETIF_F_RXCSUM | NETIF_F_IP_CSUM;
card->dev->vlan_features |= NETIF_F_TSO |
NETIF_F_RXCSUM | NETIF_F_IP_CSUM;
}
if (qeth_is_supported6(card, IPA_OUTBOUND_CHECKSUM_V6)) {
card->dev->hw_features |= NETIF_F_IPV6_CSUM;
card->dev->vlan_features |= NETIF_F_IPV6_CSUM;
}
if (qeth_is_supported6(card, IPA_OUTBOUND_TSO)) {
card->dev->hw_features |= NETIF_F_TSO6;
card->dev->vlan_features |= NETIF_F_TSO6;
}
/* allow for de-acceleration of NETIF_F_HW_VLAN_CTAG_TX: */
if (card->dev->hw_features & NETIF_F_TSO6)
headroom = sizeof(struct qeth_hdr_tso) + VLAN_HLEN;
else if (card->dev->hw_features & NETIF_F_TSO)
headroom = sizeof(struct qeth_hdr_tso);
else
headroom = sizeof(struct qeth_hdr) + VLAN_HLEN;
} else if (IS_IQD(card)) {
card->dev->flags |= IFF_NOARP;
card->dev->netdev_ops = &qeth_l3_netdev_ops;
headroom = sizeof(struct qeth_hdr) - ETH_HLEN;
rc = qeth_l3_iqd_read_initial_mac(card);
if (rc)
return rc;
} else
return -ENODEV;
card->dev->needed_headroom = headroom;
card->dev->features |= NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_CTAG_RX;
netif_keep_dst(card->dev);
if (card->dev->hw_features & (NETIF_F_TSO | NETIF_F_TSO6))
netif_set_tso_max_size(card->dev,
PAGE_SIZE * (QETH_MAX_BUFFER_ELEMENTS(card) - 1));
netif_napi_add(card->dev, &card->napi, qeth_poll);
return register_netdev(card->dev);
Annotation
- Immediate include surface: `linux/export.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/bitops.h`, `linux/string.h`, `linux/errno.h`, `linux/kernel.h`, `linux/etherdevice.h`.
- Detected declarations: `struct qeth_l3_ip_event_work`, `function qeth_l3_ipaddr_to_string`, `function qeth_l3_convert_addr_to_bits`, `function qeth_l3_is_addr_covered_by_ipato`, `function qeth_l3_delete_ip`, `function qeth_l3_add_ip`, `function qeth_l3_modify_ip`, `function qeth_l3_drain_rx_mode_cache`, `function hash_for_each_safe`, `function qeth_l3_clear_ip_htable`.
- 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.