Skip to content

Commit

Permalink
gianfar: Create net device with carrier down
Browse files Browse the repository at this point in the history
The device's carrier status is controlled via the functions
netif_carrier_on() and netif_carrier_off().  These set or clear a bit
indicating the carrier (aka lower level link) is down, and if the state
changed, they fire off a routing netlink event.

Add a call to netif_carrier_off() before register_netdev() so that the
newly created device will be set to carrier down.  Then when the carrier
comes up for the first time, a netlink event will be generated, as the
carrier changed from down to up.  Otherwise the initial carrier up will
appear to be changing the status from up to up, and so no event is
generated since that's not a change.

Signed-off-by: Trent Piepho <tpiepho@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Trent Piepho authored and David S. Miller committed Oct 9, 2008
1 parent c3efab8 commit d3eab82
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ static int gfar_probe(struct platform_device *pdev)
/* Enable most messages by default */
priv->msg_enable = (NETIF_MSG_IFUP << 1 ) - 1;

/* Carrier starts down, phylib will bring it up */
netif_carrier_off(dev);

err = register_netdev(dev);

if (err) {
Expand Down

0 comments on commit d3eab82

Please sign in to comment.