/* Enable/Disable PHC by the kernel, affects on the next init flow */ void ena_phc_enable(struct ena_adapter *adapter, bool enable)
{ struct ena_phc_info *phc_info = adapter->phc_info;
if (!phc_info) {
netdev_err(adapter->netdev, "phc_info is not allocated\n"); return;
}
phc_info->enabled = enable;
}
/* Check if PHC is enabled by the kernel */ bool ena_phc_is_enabled(struct ena_adapter *adapter)
{ struct ena_phc_info *phc_info = adapter->phc_info;
return (phc_info && phc_info->enabled);
}
/* PHC is activated if ptp clock is registered in the kernel */ bool ena_phc_is_active(struct ena_adapter *adapter)
{ struct ena_phc_info *phc_info = adapter->phc_info;
int ena_phc_init(struct ena_adapter *adapter)
{ struct ena_com_dev *ena_dev = adapter->ena_dev; struct net_device *netdev = adapter->netdev; int rc = -EOPNOTSUPP;
/* Validate PHC feature is supported in the device */ if (!ena_com_phc_supported(ena_dev)) {
netdev_dbg(netdev, "PHC feature is not supported by the device\n"); goto err_ena_com_phc_init;
}
/* Validate PHC feature is enabled by the kernel */ if (!ena_phc_is_enabled(adapter)) {
netdev_dbg(netdev, "PHC feature is not enabled by the kernel\n"); goto err_ena_com_phc_init;
}
/* Initialize device specific PHC info */
rc = ena_com_phc_init(ena_dev); if (unlikely(rc)) {
netdev_err(netdev, "Failed to init phc, error: %d\n", rc); goto err_ena_com_phc_init;
}
/* Configure PHC feature in driver and device */
rc = ena_com_phc_config(ena_dev); if (unlikely(rc)) {
netdev_err(netdev, "Failed to config phc, error: %d\n", rc); goto err_ena_com_phc_config;
}
/* Register to PTP class driver */
rc = ena_phc_register(adapter); if (unlikely(rc)) {
netdev_err(netdev, "Failed to register phc, error: %d\n", rc); goto err_ena_com_phc_config;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.