Skip to content

Commit

Permalink
via-velocity: the link is not correctly detected when the device starts
Browse files Browse the repository at this point in the history
The patch fixes http://bugzilla.kernel.org/show_bug.cgi?id=6711

Signed-off-by: Roy Marples <uberlord@gentoo.org>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
  • Loading branch information
Francois Romieu authored and Francois Romieu committed Jun 22, 2006
1 parent 612eff0 commit 8a22ddd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/via-velocity.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ static void velocity_free_rd_ring(struct velocity_info *vptr);
static void velocity_free_tx_buf(struct velocity_info *vptr, struct velocity_td_info *);
static int velocity_soft_reset(struct velocity_info *vptr);
static void mii_init(struct velocity_info *vptr, u32 mii_status);
static u32 velocity_get_link(struct net_device *dev);
static u32 velocity_get_opt_media_mode(struct velocity_info *vptr);
static void velocity_print_link_status(struct velocity_info *vptr);
static void safe_disable_mii_autopoll(struct mac_regs __iomem * regs);
Expand Down Expand Up @@ -798,6 +799,9 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
if (ret < 0)
goto err_iounmap;

if (velocity_get_link(dev))
netif_carrier_off(dev);

velocity_print_info(vptr);
pci_set_drvdata(pdev, dev);

Expand Down Expand Up @@ -1653,8 +1657,10 @@ static void velocity_error(struct velocity_info *vptr, int status)

if (linked) {
vptr->mii_status &= ~VELOCITY_LINK_FAIL;
netif_carrier_on(vptr->dev);
} else {
vptr->mii_status |= VELOCITY_LINK_FAIL;
netif_carrier_off(vptr->dev);
}

velocity_print_link_status(vptr);
Expand Down

0 comments on commit 8a22ddd

Please sign in to comment.