Skip to content

Commit

Permalink
net/farady: Keep MAC always active for NCSI packets
Browse files Browse the repository at this point in the history
The status of MAC and NCSI interface are sychronized. When NCSI
interface is down, the MAC is brought down. It means the NCSI
packets (especially AEN packets) cannot be received by the MAC's
driver even they're transmitted by far end. It causes one issue:
the ethernet cable is unplugged initially and system boots up
with down NCSI interface. The MAC stops receiving any ingress
traffic including NCSI packets. At later point, one NCSI (AEN)
packet is sent from far end when the ethernet cable is plugged.
We're going to miss the AEN on local end and the interface has
to be down for ever.

This keeps the receive/transmit buffer, IRQ and NAPI are always
enabled so that we won't miss any NCSI packets even the interrupt
is currently in link down state.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
  • Loading branch information
Gavin Shan authored and Joel Stanley committed May 11, 2016
1 parent 4657b13 commit 9371b4d
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions drivers/net/ethernet/faraday/ftgmac100.c
Original file line number Diff line number Diff line change
Expand Up @@ -1320,18 +1320,9 @@ static const struct net_device_ops ftgmac100_netdev_ops = {

static void ftgmac100_ncsi_handler(struct ncsi_dev *nd)
{
struct net_device *netdev = nd->nd_dev;

if (nd->nd_state != ncsi_dev_state_functional)
return;

if (nd->nd_link_up) {
pr_info("NCSI dev is up\n");
netif_start_queue(netdev);
} else {
pr_info("NCSI dev is down\n");
ftgmac100_stop_dev(netdev);
}
if (nd->nd_state == ncsi_dev_state_functional)
pr_info("NCSI interface %s\n",
nd->nd_link_up ? "up" : "down");
}
/******************************************************************************
* struct platform_driver functions
Expand Down

0 comments on commit 9371b4d

Please sign in to comment.