Lines Matching +full:mac +full:- +full:wol
1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
57 /* WoL Registers */
64 /* WoL bits */
98 struct ethtool_wolinfo *wol) in dp83811_set_wol() argument
100 struct net_device *ndev = phydev->attached_dev; in dp83811_set_wol()
101 const u8 *mac; in dp83811_set_wol() local
104 if (wol->wolopts & (WAKE_MAGIC | WAKE_MAGICSECURE)) { in dp83811_set_wol()
105 mac = (const u8 *)ndev->dev_addr; in dp83811_set_wol()
107 if (!is_valid_ether_addr(mac)) in dp83811_set_wol()
108 return -EINVAL; in dp83811_set_wol()
110 /* MAC addresses start with byte 5, but stored in mac[0]. in dp83811_set_wol()
114 (mac[1] << 8) | mac[0]); in dp83811_set_wol()
116 (mac[3] << 8) | mac[2]); in dp83811_set_wol()
118 (mac[5] << 8) | mac[4]); in dp83811_set_wol()
122 if (wol->wolopts & WAKE_MAGIC) in dp83811_set_wol()
127 if (wol->wolopts & WAKE_MAGICSECURE) { in dp83811_set_wol()
130 (wol->sopass[1] << 8) | wol->sopass[0]); in dp83811_set_wol()
133 (wol->sopass[3] << 8) | wol->sopass[2]); in dp83811_set_wol()
136 (wol->sopass[5] << 8) | wol->sopass[4]); in dp83811_set_wol()
142 /* Clear any pending WoL interrupt */ in dp83811_set_wol()
158 struct ethtool_wolinfo *wol) in dp83811_get_wol() argument
163 wol->supported = (WAKE_MAGIC | WAKE_MAGICSECURE); in dp83811_get_wol()
164 wol->wolopts = 0; in dp83811_get_wol()
169 wol->wolopts |= WAKE_MAGIC; in dp83811_get_wol()
174 wol->sopass[0] = (sopass_val & 0xff); in dp83811_get_wol()
175 wol->sopass[1] = (sopass_val >> 8); in dp83811_get_wol()
179 wol->sopass[2] = (sopass_val & 0xff); in dp83811_get_wol()
180 wol->sopass[3] = (sopass_val >> 8); in dp83811_get_wol()
184 wol->sopass[4] = (sopass_val & 0xff); in dp83811_get_wol()
185 wol->sopass[5] = (sopass_val >> 8); in dp83811_get_wol()
187 wol->wolopts |= WAKE_MAGICSECURE; in dp83811_get_wol()
190 /* WoL is not enabled so set wolopts to 0 */ in dp83811_get_wol()
192 wol->wolopts = 0; in dp83811_get_wol()
199 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in dp83811_config_intr()
313 if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { in dp83811_config_aneg()
315 if (phydev->autoneg == AUTONEG_ENABLE) { in dp83811_config_aneg()
336 if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { in dp83811_config_init()