<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Dear Andrew,</p>
<p>You're correct. In the <code>stmmac_hw_init</code> function
within <code>stmmac_main.c</code>, whether <code>pmt</code> is <code>true</code>
is determined by checking the <code>pmt_remote_wake_up</code> bit
in the hardware feature register. However, our hardware
configuration only supports magic packet and not remote wakeup, so
it must be overwritten in the glue driver. I'm not sure why the
original code doesn't include magic packet as part of <code>pmt</code>.</p>
<p>source code:<br>
</p>
<p> stmmac_hw_init()
@net/ethernet/stmicro/stmmac/stmmac_main.c</p>
<p><b> priv->plat->enh_desc =
priv->dma_cap.enh_desc;<br>
priv->plat->pmt =
priv->dma_cap.pmt_remote_wake_up &&<br>
!(priv->plat->flags &
STMMAC_FLAG_USE_PHY_WOL);<br>
priv->hw->pmt = priv->plat->pmt;</b></p>
<p>Or modify the condition as follows:<br>
</p>
<p><b> priv->plat->pmt =
(priv->dma_cap.pmt_remote_wake_up<font color="#ff0000"> ||
priv->dma_cap.pmt_magic_frame</font>) &&<br>
!(priv->plat->flags &
STMMAC_FLAG_USE_PHY_WOL);</b></p>
<p>Thanks!</p>
<p>BR,</p>
<p>Joey<b><br>
</b></p>
<div class="moz-cite-prefix">Andrew Lunn 於 12/3/2024 9:43 AM 寫道:<br>
</div>
<blockquote type="cite"
cite="mid:9f2c8532-8e52-439a-b253-ad2ceb07b21b@lunn.ch">
<blockquote type="cite">
<pre wrap="" class="moz-quote-pre">+ /* We support WoL by magic packet, override pmt to make it work! */
+ plat_dat->pmt = 1;
+ device_set_wakeup_capable(&pdev->dev, 1);
</pre>
</blockquote>
<pre wrap="" class="moz-quote-pre">
It seems odd to me that there is no WoL support in this glue
driver. So i assume the core driver is doing it? So why does the core
driver not set pmt and wakeup_capable ?
Andrew
</pre>
</blockquote>
</body>
</html>