drivers/net/ethernet/broadcom/bnge/bnge_link.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/broadcom/bnge/bnge_link.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/broadcom/bnge/bnge_link.h
Extension
.h
Size
6168 bytes
Lines
174
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct bnge_link_info {
	u8			phy_type;
	u8			media_type;
	u8			phy_addr;
	u8			phy_link_status;
	bool			phy_enabled;

	u8			link_state;
	u8			active_lanes;
	u8			duplex;
	u8			pause;
	u8			lp_pause;
	u8			auto_pause_setting;
	u8			force_pause_setting;
	u8			duplex_setting;
	u8			auto_mode;
	u16			link_speed;
	u16			support_speeds2;
	u16			auto_link_speeds2;
	u16			support_auto_speeds2;
	u16			lp_auto_link_speeds;
	u16			force_link_speed2;

	u8			module_status;
	u8			active_fec_sig_mode;
	u16			fec_cfg;

	/* A copy of phy_qcfg output used to report link
	 * info to VF
	 */
	struct hwrm_port_phy_qcfg_output phy_qcfg_resp;

	bool			phy_retry;
	unsigned long		phy_retry_expires;
};

#define BNGE_AUTONEG_SPEED		1
#define BNGE_AUTONEG_FLOW_CTRL		2

#define BNGE_SIG_MODE_NRZ	PORT_PHY_QCFG_RESP_SIGNAL_MODE_NRZ
#define BNGE_SIG_MODE_PAM4	PORT_PHY_QCFG_RESP_SIGNAL_MODE_PAM4
#define BNGE_SIG_MODE_PAM4_112	PORT_PHY_QCFG_RESP_SIGNAL_MODE_PAM4_112
#define BNGE_SIG_MODE_MAX	(PORT_PHY_QCFG_RESP_SIGNAL_MODE_LAST + 1)

struct bnge_ethtool_link_info {
	/* copy of requested setting from ethtool cmd */
	u8			autoneg;
	u8			req_signal_mode;
	u8			req_duplex;
	u8			req_flow_ctrl;
	u16			req_link_speed;
	u16			advertising;	/* user adv setting */
	bool			force_link_chng;
};

void bnge_hwrm_set_link_common(struct bnge_net *bn,
			       struct hwrm_port_phy_cfg_input *req);
void bnge_hwrm_set_pause_common(struct bnge_net *bn,
				struct hwrm_port_phy_cfg_input *req);
int bnge_update_phy_setting(struct bnge_net *bn);
void bnge_get_port_module_status(struct bnge_net *bn);
void bnge_report_link(struct bnge_dev *bd);
bool bnge_support_speed_dropped(struct bnge_net *bn);
void bnge_init_ethtool_link_settings(struct bnge_net *bn);
int bnge_probe_phy(struct bnge_net *bn, bool fw_dflt);
int bnge_set_link_ksettings(struct net_device *dev,
			    const struct ethtool_link_ksettings *lk_ksettings);
int bnge_get_link_ksettings(struct net_device *dev,
			    struct ethtool_link_ksettings *lk_ksettings);
u32 bnge_get_link(struct net_device *dev);
void bnge_link_async_event_process(struct bnge_net *bn, u16 event_id);
#endif /* _BNGE_LINK_H_ */

Annotation

Implementation Notes