There are no available options for this view.

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by vladb38, Sun Jul 8 19:06:43 2012 UTC revision 1.2 by vladb38, Tue Jul 31 13:24:06 2012 UTC
# Line 1  Line 1 
1  /*      $NetBSD: if_ale.c,v 1.13 2011/01/22 08:13:47 cegger Exp $       */  /*      $NetBSD: if_ale.c,v 1.14 2012/07/22 14:33:01 matt Exp $ */
2    
3  /*-  /*-
4   * Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org>   * Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org>
# Line 32  Line 32 
32  /* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */  /* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */
33    
34  #include <sys/cdefs.h>  #include <sys/cdefs.h>
35  __KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.13 2011/01/22 08:13:47 cegger Exp $");  __KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.14 2012/07/22 14:33:01 matt Exp $");
36    
37  #include "vlan.h"  #include "vlan.h"
38    
# Line 86  Line 86 
86    
87  static int      ale_miibus_readreg(device_t, int, int);  static int      ale_miibus_readreg(device_t, int, int);
88  static void     ale_miibus_writereg(device_t, int, int, int);  static void     ale_miibus_writereg(device_t, int, int, int);
89  static void     ale_miibus_statchg(device_t);  static void     ale_miibus_statchg(struct ifnet *);
90    
91  static int      ale_init(struct ifnet *);  static int      ale_init(struct ifnet *);
92  static void     ale_start(struct ifnet *);  static void     ale_start(struct ifnet *);
# Line 205  Line 205 
205  }  }
206    
207  static void  static void
208  ale_miibus_statchg(device_t dev)  ale_miibus_statchg(struct ifnet *ifp)
209  {  {
210          struct ale_softc *sc = device_private(dev);          struct ale_softc *sc = ifp->if_softc;
211          struct ifnet *ifp = &sc->sc_ec.ec_if;          struct mii_data *mii = &sc->sc_miibus;
         struct mii_data *mii;  
212          uint32_t reg;          uint32_t reg;
213    
214          if ((ifp->if_flags & IFF_RUNNING) == 0)          if ((ifp->if_flags & IFF_RUNNING) == 0)
215                  return;                  return;
216    
         mii = &sc->sc_miibus;  
   
217          sc->ale_flags &= ~ALE_FLAG_LINK;          sc->ale_flags &= ~ALE_FLAG_LINK;
218          if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) ==          if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) ==
219              (IFM_ACTIVE | IFM_AVALID)) {              (IFM_ACTIVE | IFM_AVALID)) {

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2