drivers/net/dsa/vitesse-vsc73xx-core.c
Source file repositories/reference/linux-study-clean/drivers/net/dsa/vitesse-vsc73xx-core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/dsa/vitesse-vsc73xx-core.c- Extension
.c- Size
- 69180 bytes
- Lines
- 2417
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/kernel.hlinux/module.hlinux/device.hlinux/iopoll.hlinux/of.hlinux/of_mdio.hlinux/bitops.hlinux/bitfield.hlinux/if_bridge.hlinux/if_vlan.hlinux/etherdevice.hlinux/gpio/consumer.hlinux/gpio/driver.hlinux/dsa/8021q.hlinux/random.hnet/dsa.hvitesse-vsc73xx.h
Detected Declarations
struct vsc73xx_counterstruct vsc73xx_fdbstruct vsc73xx_vlan_summaryenum vsc73xx_port_vlan_conffunction vsc73xx_is_addr_validfunction vsc73xx_readfunction vsc73xx_writefunction vsc73xx_update_bitsfunction vsc73xx_detectfunction vsc73xx_mdio_busy_checkfunction vsc73xx_phy_readfunction vsc73xx_phy_writefunction vsc73xx_get_tag_protocolfunction vsc73xx_wait_for_vlan_table_cmdfunction vsc73xx_read_vlan_table_entryfunction vsc73xx_write_vlan_table_entryfunction vsc73xx_update_vlan_tablefunction vsc73xx_configure_rgmii_port_delayfunction vsc73xx_setupfunction vsc73xx_teardownfunction vsc73xx_init_portfunction vsc73xx_reset_portfunction vsc73xx_mac_configfunction vsc73xx_mac_link_downfunction vsc73xx_mac_link_upfunction vsc73xx_tag_8021q_activefunction vsc73xx_bridge_vlan_findfunction vsc73xx_bridge_vlan_remove_portfunction vsc73xx_bridge_vlan_summaryfunction list_for_each_entryfunction vsc73xx_find_first_vlan_untaggedfunction vsc73xx_set_vlan_conffunction vsc73xx_vlan_commit_conffunction vsc73xx_vlan_change_untaggedfunction portfunction vsc73xx_vlan_change_pvidfunction vsc73xx_vlan_commit_pvidfunction vsc73xx_vlan_commit_settingsfunction vsc73xx_port_enablefunction vsc73xx_port_disablefunction vsc73xx_find_counterfunction vsc73xx_get_stringsfunction vsc73xx_get_sset_countfunction vsc73xx_get_ethtool_statsfunction vsc73xx_change_mtufunction vsc73xx_get_max_mtufunction vsc73xx_phylink_get_capsfunction vsc73xx_port_vlan_filtering
Annotated Snippet
struct vsc73xx_counter {
u8 counter;
const char *name;
};
struct vsc73xx_fdb {
u16 vid;
u8 port;
u8 mac[ETH_ALEN];
bool valid;
};
/* Counters are named according to the MIB standards where applicable.
* Some counters are custom, non-standard. The standard counters are
* named in accordance with RFC2819, RFC2021 and IEEE Std 802.3-2002 Annex
* 30A Counters.
*/
static const struct vsc73xx_counter vsc73xx_rx_counters[] = {
{ 0, "RxEtherStatsPkts" },
{ 1, "RxBroadcast+MulticastPkts" }, /* non-standard counter */
{ 2, "RxTotalErrorPackets" }, /* non-standard counter */
{ 3, "RxEtherStatsBroadcastPkts" },
{ 4, "RxEtherStatsMulticastPkts" },
{ 5, "RxEtherStatsPkts64Octets" },
{ 6, "RxEtherStatsPkts65to127Octets" },
{ 7, "RxEtherStatsPkts128to255Octets" },
{ 8, "RxEtherStatsPkts256to511Octets" },
{ 9, "RxEtherStatsPkts512to1023Octets" },
{ 10, "RxEtherStatsPkts1024to1518Octets" },
{ 11, "RxJumboFrames" }, /* non-standard counter */
{ 12, "RxaPauseMACControlFramesTransmitted" },
{ 13, "RxFIFODrops" }, /* non-standard counter */
{ 14, "RxBackwardDrops" }, /* non-standard counter */
{ 15, "RxClassifierDrops" }, /* non-standard counter */
{ 16, "RxEtherStatsCRCAlignErrors" },
{ 17, "RxEtherStatsUndersizePkts" },
{ 18, "RxEtherStatsOversizePkts" },
{ 19, "RxEtherStatsFragments" },
{ 20, "RxEtherStatsJabbers" },
{ 21, "RxaMACControlFramesReceived" },
/* 22-24 are undefined */
{ 25, "RxaFramesReceivedOK" },
{ 26, "RxQoSClass0" }, /* non-standard counter */
{ 27, "RxQoSClass1" }, /* non-standard counter */
{ 28, "RxQoSClass2" }, /* non-standard counter */
{ 29, "RxQoSClass3" }, /* non-standard counter */
};
static const struct vsc73xx_counter vsc73xx_tx_counters[] = {
{ 0, "TxEtherStatsPkts" },
{ 1, "TxBroadcast+MulticastPkts" }, /* non-standard counter */
{ 2, "TxTotalErrorPackets" }, /* non-standard counter */
{ 3, "TxEtherStatsBroadcastPkts" },
{ 4, "TxEtherStatsMulticastPkts" },
{ 5, "TxEtherStatsPkts64Octets" },
{ 6, "TxEtherStatsPkts65to127Octets" },
{ 7, "TxEtherStatsPkts128to255Octets" },
{ 8, "TxEtherStatsPkts256to511Octets" },
{ 9, "TxEtherStatsPkts512to1023Octets" },
{ 10, "TxEtherStatsPkts1024to1518Octets" },
{ 11, "TxJumboFrames" }, /* non-standard counter */
{ 12, "TxaPauseMACControlFramesTransmitted" },
{ 13, "TxFIFODrops" }, /* non-standard counter */
{ 14, "TxDrops" }, /* non-standard counter */
{ 15, "TxEtherStatsCollisions" },
{ 16, "TxEtherStatsCRCAlignErrors" },
{ 17, "TxEtherStatsUndersizePkts" },
{ 18, "TxEtherStatsOversizePkts" },
{ 19, "TxEtherStatsFragments" },
{ 20, "TxEtherStatsJabbers" },
/* 21-24 are undefined */
{ 25, "TxaFramesReceivedOK" },
{ 26, "TxQoSClass0" }, /* non-standard counter */
{ 27, "TxQoSClass1" }, /* non-standard counter */
{ 28, "TxQoSClass2" }, /* non-standard counter */
{ 29, "TxQoSClass3" }, /* non-standard counter */
};
struct vsc73xx_vlan_summary {
size_t num_tagged;
size_t num_untagged;
};
enum vsc73xx_port_vlan_conf {
VSC73XX_VLAN_FILTER,
VSC73XX_VLAN_FILTER_UNTAG_ALL,
VSC73XX_VLAN_IGNORE,
};
int vsc73xx_is_addr_valid(u8 block, u8 subblock)
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/device.h`, `linux/iopoll.h`, `linux/of.h`, `linux/of_mdio.h`, `linux/bitops.h`, `linux/bitfield.h`.
- Detected declarations: `struct vsc73xx_counter`, `struct vsc73xx_fdb`, `struct vsc73xx_vlan_summary`, `enum vsc73xx_port_vlan_conf`, `function vsc73xx_is_addr_valid`, `function vsc73xx_read`, `function vsc73xx_write`, `function vsc73xx_update_bits`, `function vsc73xx_detect`, `function vsc73xx_mdio_busy_check`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.