mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 10:11:26 +03:00
nvethernet:MACSEC suspend/resume changes
Added functionality to support MACSEC suspend and resume by disabling/enabling MACSEC CAR as part of ether suspend and resume and using macsec_open and macsec_close Bug 3399462 Change-Id: I296675ea62e99922bd20cd805a40afa805b08214 Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2610649 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: Mahesh Patil <maheshp@nvidia.com> Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Revanth Kumar Uppala
parent
538c60bba4
commit
818847a4e8
@@ -6449,6 +6449,20 @@ static int ether_suspend_noirq(struct device *dev)
|
||||
if (!netif_running(ndev))
|
||||
return 0;
|
||||
|
||||
/* Keep MACSEC to suspend if MACSEC is supported on this platform */
|
||||
#ifdef MACSEC_SUPPORT
|
||||
if ((osi_core->mac == OSI_MAC_HW_EQOS && osi_core->mac_ver == OSI_EQOS_MAC_5_30) ||
|
||||
(osi_core->mac == OSI_MAC_HW_MGBE && osi_core->mac_ver == OSI_MGBE_MAC_3_10)) {
|
||||
pdata->macsec_pdata->enabled_before_suspend =
|
||||
pdata->macsec_pdata->enabled;
|
||||
if (pdata->macsec_pdata->enabled != OSI_DISABLE) {
|
||||
ret = macsec_suspend(pdata->macsec_pdata);
|
||||
if (ret < 0)
|
||||
dev_err(pdata->dev, "Failed to suspend macsec");
|
||||
}
|
||||
}
|
||||
#endif /* MACSEC_SUPPORT */
|
||||
|
||||
/* Since MAC is placed in reset during suspend, take a backup of
|
||||
* current configuration so that SW view of HW is maintained across
|
||||
* suspend/resume.
|
||||
@@ -6626,6 +6640,18 @@ static int ether_resume(struct ether_priv_data *pdata)
|
||||
/* re-start workqueue */
|
||||
ether_stats_work_queue_start(pdata);
|
||||
|
||||
/* Keep MACSEC also to Resume if MACSEC is supported on this platform */
|
||||
#ifdef MACSEC_SUPPORT
|
||||
if ((osi_core->mac == OSI_MAC_HW_EQOS && osi_core->mac_ver == OSI_EQOS_MAC_5_30) ||
|
||||
(osi_core->mac == OSI_MAC_HW_MGBE && osi_core->mac_ver == OSI_MGBE_MAC_3_10)) {
|
||||
if (pdata->macsec_pdata->enabled_before_suspend != OSI_DISABLE) {
|
||||
ret = macsec_resume(pdata->macsec_pdata);
|
||||
if (ret < 0)
|
||||
dev_err(pdata->dev, "Failed to resume MACSEC ");
|
||||
}
|
||||
}
|
||||
#endif /* MACSEC_SUPPORT */
|
||||
|
||||
return 0;
|
||||
err_start_mac:
|
||||
ether_napi_disable(pdata);
|
||||
|
||||
Reference in New Issue
Block a user