Commit 6c9b1377 authored by Adam Wujek's avatar Adam Wujek 💬

[Feature: 1336] kernel/wr_nic: disable SFP when interface is down

Keep low enable pin on SFP when the interface is down.
This commit makes the wrs_port_tx_control tool not needed anymore.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 4dbefc9f
......@@ -212,9 +212,15 @@ int wrn_ep_open(struct net_device *dev)
int wrn_ep_close(struct net_device *dev)
{
struct wrn_ep *ep = netdev_priv(dev);
uint32_t value;
if (WR_IS_NODE)
return 0; /* No access to EP registers in the SPEC */
/* Disable SFP (put enable pin on SFP down) */
value = wrn_phy_read(dev, 0, MII_BMCR);
wrn_phy_write(dev, 0, MII_BMCR, value | BMCR_PDOWN);
/*
* Beware: the system loops in the del_timer_sync below if timer_setup
* had not been called either (see "if (WR_IS_NODE)" in ep_open above)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment