drivers/net/bonding/bond_3ad.c
Source file repositories/reference/linux-study-clean/drivers/net/bonding/bond_3ad.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/bonding/bond_3ad.c- Extension
.c- Size
- 95501 bytes
- Lines
- 3054
- Domain
- Driver Families
- Bucket
- drivers/net
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/skbuff.hlinux/if_ether.hlinux/netdevice.hlinux/spinlock.hlinux/ethtool.hlinux/etherdevice.hlinux/if_bonding.hlinux/pkt_sched.hnet/net_namespace.hnet/bonding.hnet/bond_3ad.hnet/netlink.h
Detected Declarations
enum ad_link_speed_typefunction partnerfunction __disable_distributing_portfunction __enable_collecting_portfunction __disable_portfunction __enable_portfunction __port_move_to_attached_statefunction __port_is_collecting_distributingfunction __get_agg_selection_modefunction __check_agg_selection_timerfunction __get_link_speedfunction __get_duplexfunction __ad_actor_update_portfunction __ad_timer_to_ticksfunction __choose_matchedfunction __record_pdufunction __record_defaultfunction valuefunction valuefunction valuefunction __agg_ports_are_readyfunction __set_agg_ports_readyfunction __agg_usable_portsfunction __agg_active_portsfunction __agg_ports_priorityfunction __get_agg_bandwidthfunction __update_lacpdu_from_portfunction ad_lacpdu_sendfunction ad_marker_sendfunction ad_cond_set_peer_notiffunction ad_mux_machinefunction ad_rx_machinefunction ad_churn_machinefunction ad_tx_machinefunction ad_periodic_machinefunction inititalizationfunction agg_device_upfunction __get_active_aggfunction bond_for_each_slave_rcufunction bond_for_each_slave_rcufunction ad_clear_aggfunction ad_initialize_aggfunction ad_initialize_portfunction ad_enable_collectingfunction ad_disable_distributingfunction ad_enable_collecting_distributingfunction ad_disable_collecting_distributingfunction ad_marker_info_received
Annotated Snippet
switch (slave->speed) {
case SPEED_10:
speed = AD_LINK_SPEED_10MBPS;
break;
case SPEED_100:
speed = AD_LINK_SPEED_100MBPS;
break;
case SPEED_1000:
speed = AD_LINK_SPEED_1000MBPS;
break;
case SPEED_2500:
speed = AD_LINK_SPEED_2500MBPS;
break;
case SPEED_5000:
speed = AD_LINK_SPEED_5000MBPS;
break;
case SPEED_10000:
speed = AD_LINK_SPEED_10000MBPS;
break;
case SPEED_14000:
speed = AD_LINK_SPEED_14000MBPS;
break;
case SPEED_20000:
speed = AD_LINK_SPEED_20000MBPS;
break;
case SPEED_25000:
speed = AD_LINK_SPEED_25000MBPS;
break;
case SPEED_40000:
speed = AD_LINK_SPEED_40000MBPS;
break;
case SPEED_50000:
speed = AD_LINK_SPEED_50000MBPS;
break;
case SPEED_56000:
speed = AD_LINK_SPEED_56000MBPS;
break;
case SPEED_80000:
speed = AD_LINK_SPEED_80000MBPS;
break;
case SPEED_100000:
speed = AD_LINK_SPEED_100000MBPS;
break;
case SPEED_200000:
speed = AD_LINK_SPEED_200000MBPS;
break;
case SPEED_400000:
speed = AD_LINK_SPEED_400000MBPS;
break;
case SPEED_800000:
speed = AD_LINK_SPEED_800000MBPS;
break;
case SPEED_1600000:
speed = AD_LINK_SPEED_1600000MBPS;
break;
default:
/* unknown speed value from ethtool. shouldn't happen */
if (slave->speed != SPEED_UNKNOWN)
pr_err_once("%s: (slave %s): unknown ethtool speed (%d) for port %d (set it to 0)\n",
slave->bond->dev->name,
slave->dev->name, slave->speed,
port->actor_port_number);
speed = 0;
break;
}
}
slave_dbg(slave->bond->dev, slave->dev, "Port %d Received link speed %d update from adapter\n",
port->actor_port_number, speed);
return speed;
}
Annotation
- Immediate include surface: `linux/skbuff.h`, `linux/if_ether.h`, `linux/netdevice.h`, `linux/spinlock.h`, `linux/ethtool.h`, `linux/etherdevice.h`, `linux/if_bonding.h`, `linux/pkt_sched.h`.
- Detected declarations: `enum ad_link_speed_type`, `function partner`, `function __disable_distributing_port`, `function __enable_collecting_port`, `function __disable_port`, `function __enable_port`, `function __port_move_to_attached_state`, `function __port_is_collecting_distributing`, `function __get_agg_selection_mode`, `function __check_agg_selection_timer`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.