linux wake on lan功能通过ethtool配置【转】
转自:https://blog.csdn.net/fanlilei/article/details/38042063
ethtool工具中的wol功能一直很迷惑。今天看了代码将其帮助中下面的参数说明下,如果有不懂wake on lan的请自己到
intel官网查下。
p|u|m|b|a|g|s|d
if (wolopts & WAKE_PHY)//物理接口
*p++ = 'p';
if (wolopts & WAKE_UCAST)//单播
*p++ = 'u';
if (wolopts & WAKE_MCAST)//多播
*p++ = 'm';
if (wolopts & WAKE_BCAST)//广播
*p++ = 'b';
if (wolopts & WAKE_ARP)//arp包
*p++ = 'a';
if (wolopts & WAKE_MAGIC)//magic 包
*p++ = 'g';
if (wolopts & WAKE_MAGICSECURE)//magic 加密包
*p++ = 's';
d很明显了是关闭。
ethtool.c: if (adapter->wol & E1000_WUFC_EX)
ethtool.c: wol->wolopts |= WAKE_UCAST; u
ethtool.c: if (adapter->wol & E1000_WUFC_MC)
ethtool.c: wol->wolopts |= WAKE_MCAST; m
ethtool.c: if (adapter->wol & E1000_WUFC_BC)
ethtool.c: wol->wolopts |= WAKE_BCAST; b
ethtool.c: if (adapter->wol & E1000_WUFC_MAG)
ethtool.c: wol->wolopts |= WAKE_MAGIC; g
ethtool.c: if (adapter->wol & E1000_WUFC_LNKC)
ethtool.c: wol->wolopts |= WAKE_PHY; p
ethtool.c: if (adapter->wol & E1000_WUFC_ARP)
ethtool.c: wol->wolopts |= WAKE_ARP; a
ethtool.c:static int e1000_set_wol(struct net_device *netdev,
ethtool.c: struct ethtool_wolinfo *wol)
ethtool.c: (wol->wolopts & ~(WAKE_UCAST | WAKE_MCAST | WAKE_BCAST |
ethtool.c: adapter->wol = 0;
ethtool.c: if (wol->wolopts & WAKE_UCAST)
ethtool.c: adapter->wol |= E1000_WUFC_EX;
ethtool.c: if (wol->wolopts & WAKE_MCAST)
ethtool.c: adapter->wol |= E1000_WUFC_MC;
ethtool.c: if (wol->wolopts & WAKE_BCAST)
ethtool.c: adapter->wol |= E1000_WUFC_BC;
ethtool.c: if (wol->wolopts & WAKE_MAGIC)
ethtool.c: adapter->wol |= E1000_WUFC_MAG;
ethtool.c: if (wol->wolopts & WAKE_PHY)
ethtool.c: adapter->wol |= E1000_WUFC_LNKC;
ethtool.c: if (wol->wolopts & WAKE_ARP)
ethtool.c: adapter->wol |= E1000_WUFC_ARP;
---------------------
作者:尖椒炒肉
来源:CSDN
原文:https://blog.csdn.net/fanlilei/article/details/38042063
版权声明:本文为博主原创文章,转载请附上博文链接!