drivers/net/dsa/mt7530.h
Source file repositories/reference/linux-study-clean/drivers/net/dsa/mt7530.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/dsa/mt7530.h- Extension
.h- Size
- 29785 bytes
- Lines
- 953
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct mt7530_mib_descstruct mt7530_fdbstruct mt7530_portstruct mt7530_privstruct mt753x_pcsstruct mt753x_infostruct mt7530_privstruct mt7530_hw_vlan_entrystruct mt7530_hw_statsstruct mt7530_dummy_pollenum mt753x_idenum mt753x_to_cpu_fwenum mt7530_fdb_cmdenum mt7530_vlan_cmdenum mt7530_fidenum mt7530_vlan_egress_attrenum mt7530_stp_stateenum mt7530_port_modeenum mt7530_vlan_port_eg_tagenum mt7530_vlan_port_attrenum mt7530_vlan_port_acc_frmenum mt7531_phy_iac_cmdenum mt7531_mdio_stenum mt7531_gp_modeenum mt7531_clk_skewenum mt7531_xtal_fselenum mt7530_p5_modefunction mt7530_hw_vlan_entry_initfunction INIT_MT7530_DUMMY_POLL
Annotated Snippet
struct mt7530_mib_desc {
unsigned int size;
unsigned int offset;
const char *name;
};
struct mt7530_fdb {
u16 vid;
u8 port_mask;
u8 aging;
u8 mac[6];
bool noarp;
};
/* struct mt7530_port - This is the main data structure for holding the state
* of the port.
* @enable: The status used for show port is enabled or not.
* @pm: The matrix used to show all connections with the port.
* @pvid: The VLAN specified is to be considered a PVID at ingress. Any
* untagged frames will be assigned to the related VLAN.
* @sgmii_pcs: Pointer to PCS instance for SerDes ports
* @stats: Cached port statistics for MDIO-connected switches
*/
struct mt7530_port {
bool enable;
bool isolated;
u32 pm;
u16 pvid;
struct phylink_pcs *sgmii_pcs;
struct rtnl_link_stats64 stats;
};
/* Port 5 mode definitions of the MT7530 switch */
enum mt7530_p5_mode {
GMAC5,
MUX_PHY_P0,
MUX_PHY_P4,
};
struct mt7530_priv;
struct mt753x_pcs {
struct phylink_pcs pcs;
struct mt7530_priv *priv;
int port;
};
/* struct mt753x_info - This is the main data structure for holding the specific
* part for each supported device
* @id: Holding the identifier to a switch model
* @pcs_ops: Holding the pointer to the MAC PCS operations structure
* @sw_setup: Holding the handler to a device initialization
* @phy_read_c22: Holding the way reading PHY port using C22
* @phy_write_c22: Holding the way writing PHY port using C22
* @phy_read_c45: Holding the way reading PHY port using C45
* @phy_write_c45: Holding the way writing PHY port using C45
* @mac_port_get_caps: Holding the handler that provides MAC capabilities
* @mac_port_config: Holding the way setting up the PHY attribute to a
* certain MAC port
*/
struct mt753x_info {
enum mt753x_id id;
const struct phylink_pcs_ops *pcs_ops;
int (*sw_setup)(struct dsa_switch *ds);
int (*phy_read_c22)(struct mt7530_priv *priv, int port, int regnum);
int (*phy_write_c22)(struct mt7530_priv *priv, int port, int regnum,
u16 val);
int (*phy_read_c45)(struct mt7530_priv *priv, int port, int devad,
int regnum);
int (*phy_write_c45)(struct mt7530_priv *priv, int port, int devad,
int regnum, u16 val);
void (*mac_port_get_caps)(struct dsa_switch *ds, int port,
struct phylink_config *config);
void (*mac_port_config)(struct dsa_switch *ds, int port,
unsigned int mode,
phy_interface_t interface);
};
/* struct mt7530_priv - This is the main data structure for holding the state
* of the driver
* @dev: The device pointer
* @ds: The pointer to the dsa core structure
* @bus: The bus used for the device and built-in PHY
* @regmap: The regmap instance representing all switch registers
* @rstc: The pointer to reset control used by MCM
* @core_pwr: The power supplied into the core
* @io_pwr: The power supplied into the I/O
* @reset: The descriptor for GPIO line tied to its reset pin
Annotation
- Detected declarations: `struct mt7530_mib_desc`, `struct mt7530_fdb`, `struct mt7530_port`, `struct mt7530_priv`, `struct mt753x_pcs`, `struct mt753x_info`, `struct mt7530_priv`, `struct mt7530_hw_vlan_entry`, `struct mt7530_hw_stats`, `struct mt7530_dummy_poll`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.