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:
parent
9d61314c09
commit
8735adee7d
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user