1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

enc28j60: add link status support

This commit is contained in:
Koen Zandberg 2018-02-20 12:08:38 +01:00
parent 9d61314c09
commit 8735adee7d
No known key found for this signature in database
GPG Key ID: BA1718B37D79F51C

View File

@ -454,6 +454,14 @@ static int nd_get(netdev_t *netdev, netopt_t opt, void *value, size_t max_len)
assert(max_len >= ETHERNET_ADDR_LEN);
mac_get(dev, (uint8_t *)value);
return ETHERNET_ADDR_LEN;
case NETOPT_LINK_CONNECTED:
if (cmd_r_phy(dev, REG_PHY_PHSTAT2) & PHSTAT2_LSTAT) {
*((netopt_enable_t *)value) = NETOPT_ENABLE;
}
else {
*((netopt_enable_t *)value) = NETOPT_DISABLE;
}
return sizeof(netopt_enable_t);
default:
return netdev_eth_get(netdev, opt, value, max_len);
}