drivers/s390/net/qeth_l2_main.c
Source file repositories/reference/linux-study-clean/drivers/s390/net/qeth_l2_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/net/qeth_l2_main.c- Extension
.c- Size
- 69057 bytes
- Lines
- 2473
- 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.
- 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/slab.hlinux/etherdevice.hlinux/if_bridge.hlinux/list.hlinux/hash.hlinux/hashtable.hnet/switchdev.hasm/machine.hasm/chsc.hasm/css_chars.hasm/setup.hqeth_core.hqeth_l2.h
Detected Declarations
struct qeth_l2_br2dev_event_workstruct qeth_bridge_state_datastruct qeth_addr_change_datastruct _qeth_sbp_cbctlenum qeth_an_event_typefunction Authorfunction qeth_l2_send_setdelmac_cbfunction qeth_l2_send_setdelmacfunction qeth_l2_send_setmacfunction qeth_l2_write_macfunction qeth_l2_remove_macfunction qeth_l2_drain_rx_mode_cachefunction hash_for_each_safefunction qeth_l2_fill_headerfunction qeth_l2_setdelvlan_makercfunction qeth_l2_send_setdelvlan_cbfunction qeth_l2_send_setdelvlanfunction qeth_l2_vlan_rx_add_vidfunction qeth_l2_vlan_rx_kill_vidfunction qeth_l2_set_pnso_modefunction qeth_l2_dev2br_fdb_flushfunction qeth_l2_request_initial_macfunction qeth_l2_register_dev_addrfunction qeth_l2_validate_addrfunction qeth_l2_set_mac_addressfunction qeth_l2_promisc_to_bridgefunction qeth_l2_set_promisc_modefunction qeth_l2_add_macfunction hash_for_each_possiblefunction qeth_l2_rx_mode_workfunction hash_for_each_safefunction qeth_l2_hard_start_xmitfunction qeth_l2_iqd_select_queuefunction qeth_l2_set_rx_modefunction qeth_l2_pnsofunction qeth_is_my_net_if_tokenfunction qeth_l2_dev2br_fdb_notifyfunction qeth_l2_dev2br_an_set_cbfunction qeth_l2_dev2br_an_setfunction qeth_l2_must_learnfunction qeth_l2_br2dev_workerfunction qeth_l2_br2dev_queue_workfunction qeth_l2_switchdev_eventfunction qeth_l2_br2dev_getfunction qeth_l2_br2dev_putfunction qeth_l2_bridge_getlinkfunction qeth_l2_bridge_setlinkfunction nlmsg_for_each_attr
Annotated Snippet
static const struct net_device_ops qeth_l2_iqd_netdev_ops;
static const struct net_device_ops qeth_l2_osa_netdev_ops;
static bool qeth_l2_must_learn(struct net_device *netdev,
struct net_device *dstdev)
{
struct qeth_priv *priv;
priv = netdev_priv(netdev);
return (netdev != dstdev &&
(priv->brport_features & BR_LEARNING_SYNC) &&
!(br_port_flag_is_set(netdev, BR_ISOLATED) &&
br_port_flag_is_set(dstdev, BR_ISOLATED)) &&
(netdev->netdev_ops == &qeth_l2_iqd_netdev_ops ||
netdev->netdev_ops == &qeth_l2_osa_netdev_ops));
}
/**
* qeth_l2_br2dev_worker() - update local MACs
* @work: bridge to device FDB update
*
* Update local MACs of a learning_sync bridgeport so it can receive
* messages for a destination port.
* In case of an isolated learning_sync port, also update its isolated
* siblings.
*/
static void qeth_l2_br2dev_worker(struct work_struct *work)
{
struct qeth_l2_br2dev_event_work *br2dev_event_work =
container_of(work, struct qeth_l2_br2dev_event_work, work);
struct net_device *lsyncdev = br2dev_event_work->lsync_dev;
struct net_device *dstdev = br2dev_event_work->dst_dev;
struct net_device *brdev = br2dev_event_work->br_dev;
unsigned long event = br2dev_event_work->event;
unsigned char *addr = br2dev_event_work->addr;
struct qeth_card *card = lsyncdev->ml_priv;
struct net_device *lowerdev;
struct list_head *iter;
int err = 0;
QETH_CARD_TEXT_(card, 4, "b2dw%04lx", event);
QETH_CARD_TEXT_(card, 4, "ma%012llx", ether_addr_to_u64(addr));
rcu_read_lock();
/* Verify preconditions are still valid: */
if (!netif_is_bridge_port(lsyncdev) ||
brdev != netdev_master_upper_dev_get_rcu(lsyncdev))
goto unlock;
if (!qeth_l2_must_learn(lsyncdev, dstdev))
goto unlock;
if (br_port_flag_is_set(lsyncdev, BR_ISOLATED)) {
/* Update lsyncdev and its isolated sibling(s): */
iter = &brdev->adj_list.lower;
lowerdev = netdev_next_lower_dev_rcu(brdev, &iter);
while (lowerdev) {
if (br_port_flag_is_set(lowerdev, BR_ISOLATED)) {
switch (event) {
case SWITCHDEV_FDB_ADD_TO_DEVICE:
err = dev_uc_add(lowerdev, addr);
break;
case SWITCHDEV_FDB_DEL_TO_DEVICE:
err = dev_uc_del(lowerdev, addr);
break;
default:
break;
}
if (err) {
QETH_CARD_TEXT(card, 2, "b2derris");
QETH_CARD_TEXT_(card, 2,
"err%02lx%03d", event,
lowerdev->ifindex);
}
}
lowerdev = netdev_next_lower_dev_rcu(brdev, &iter);
}
} else {
switch (event) {
case SWITCHDEV_FDB_ADD_TO_DEVICE:
err = dev_uc_add(lsyncdev, addr);
break;
case SWITCHDEV_FDB_DEL_TO_DEVICE:
err = dev_uc_del(lsyncdev, addr);
break;
default:
break;
}
if (err)
QETH_CARD_TEXT_(card, 2, "b2derr%02lx", event);
}
Annotation
- Immediate include surface: `linux/export.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/string.h`, `linux/errno.h`, `linux/kernel.h`, `linux/slab.h`, `linux/etherdevice.h`.
- Detected declarations: `struct qeth_l2_br2dev_event_work`, `struct qeth_bridge_state_data`, `struct qeth_addr_change_data`, `struct _qeth_sbp_cbctl`, `enum qeth_an_event_type`, `function Author`, `function qeth_l2_send_setdelmac_cb`, `function qeth_l2_send_setdelmac`, `function qeth_l2_send_setmac`, `function qeth_l2_write_mac`.
- Atlas domain: Driver Families / drivers/s390.
- Implementation status: pattern implementation candidate.
- 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.