parent
ffb2095341
commit
af1ca0f86d
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_vge.c,v 1.31 2006/11/26 16:11:51 tsutsui Exp $ */
|
||||
/* $NetBSD: if_vge.c,v 1.32 2006/12/01 11:06:59 tsutsui Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2004
|
||||
|
@ -35,7 +35,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.31 2006/11/26 16:11:51 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.32 2006/12/01 11:06:59 tsutsui Exp $");
|
||||
|
||||
/*
|
||||
* VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver.
|
||||
|
@ -295,7 +295,7 @@ struct vge_softc {
|
|||
static inline void vge_set_txaddr(struct vge_txfrag *, bus_addr_t);
|
||||
static inline void vge_set_rxaddr(struct vge_rxdesc *, bus_addr_t);
|
||||
|
||||
static int vge_probe(struct device *, struct cfdata *, void *);
|
||||
static int vge_match(struct device *, struct cfdata *, void *);
|
||||
static void vge_attach(struct device *, struct device *, void *);
|
||||
|
||||
static int vge_encap(struct vge_softc *, struct mbuf *, int);
|
||||
|
@ -336,7 +336,7 @@ static void vge_setmulti(struct vge_softc *);
|
|||
static void vge_reset(struct vge_softc *);
|
||||
|
||||
CFATTACH_DECL(vge, sizeof(struct vge_softc),
|
||||
vge_probe, vge_attach, NULL, NULL);
|
||||
vge_match, vge_attach, NULL, NULL);
|
||||
|
||||
static inline void
|
||||
vge_set_txaddr(struct vge_txfrag *f, bus_addr_t daddr)
|
||||
|
@ -811,8 +811,7 @@ vge_reset(struct vge_softc *sc)
|
|||
* IDs against our list and return a device name if we find a match.
|
||||
*/
|
||||
static int
|
||||
vge_probe(struct device *parent, struct cfdata *match,
|
||||
void *aux)
|
||||
vge_match(struct device *parent, struct cfdata *match, void *aux)
|
||||
{
|
||||
struct pci_attach_args *pa = aux;
|
||||
|
||||
|
@ -925,7 +924,7 @@ vge_attach(struct device *parent, struct device *self, void *aux)
|
|||
uint16_t val;
|
||||
|
||||
aprint_normal(": VIA VT612X Gigabit Ethernet (rev. %#x)\n",
|
||||
PCI_REVISION(pa->pa_class));
|
||||
PCI_REVISION(pa->pa_class));
|
||||
|
||||
/* Make sure bus-mastering is enabled */
|
||||
pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
|
||||
|
@ -987,7 +986,7 @@ vge_attach(struct device *parent, struct device *self, void *aux)
|
|||
*/
|
||||
sc->sc_dmat = pa->pa_dmat;
|
||||
|
||||
if (vge_allocmem(sc))
|
||||
if (vge_allocmem(sc) != 0)
|
||||
return;
|
||||
|
||||
ifp = &sc->sc_ethercom.ec_if;
|
||||
|
@ -1246,8 +1245,9 @@ vge_rxeof(struct vge_softc *sc)
|
|||
* We don't want to drop the frame though: our VLAN
|
||||
* filtering is done in software.
|
||||
*/
|
||||
if (!(rxstat & VGE_RDSTS_RXOK) && !(rxstat & VGE_RDSTS_VIDM)
|
||||
&& !(rxstat & VGE_RDSTS_CSUMERR)) {
|
||||
if ((rxstat & VGE_RDSTS_RXOK) == 0 &&
|
||||
(rxstat & VGE_RDSTS_VIDM) == 0 &&
|
||||
(rxstat & VGE_RDSTS_CSUMERR) == 0) {
|
||||
ifp->if_ierrors++;
|
||||
/*
|
||||
* If this is part of a multi-fragment packet,
|
||||
|
@ -1357,7 +1357,6 @@ vge_rxeof(struct vge_softc *sc)
|
|||
lim++;
|
||||
if (lim == VGE_NRXDESC)
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
sc->sc_rx_prodidx = idx;
|
||||
|
@ -1435,7 +1434,7 @@ vge_tick(void *xsc)
|
|||
|
||||
mii_tick(mii);
|
||||
if (sc->sc_link) {
|
||||
if (!(mii->mii_media_status & IFM_ACTIVE))
|
||||
if ((mii->mii_media_status & IFM_ACTIVE) == 0)
|
||||
sc->sc_link = 0;
|
||||
} else {
|
||||
if (mii->mii_media_status & IFM_ACTIVE &&
|
||||
|
@ -1465,7 +1464,7 @@ vge_intr(void *arg)
|
|||
|
||||
ifp = &sc->sc_ethercom.ec_if;
|
||||
|
||||
if (!(ifp->if_flags & IFF_UP)) {
|
||||
if ((ifp->if_flags & IFF_UP) == 0) {
|
||||
return claim;
|
||||
}
|
||||
|
||||
|
@ -2043,12 +2042,12 @@ vge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
|||
if (ifp->if_flags & IFF_UP) {
|
||||
if (ifp->if_flags & IFF_RUNNING &&
|
||||
ifp->if_flags & IFF_PROMISC &&
|
||||
!(sc->sc_if_flags & IFF_PROMISC)) {
|
||||
(sc->sc_if_flags & IFF_PROMISC) == 0) {
|
||||
CSR_SETBIT_1(sc, VGE_RXCTL,
|
||||
VGE_RXCTL_RX_PROMISC);
|
||||
vge_setmulti(sc);
|
||||
} else if (ifp->if_flags & IFF_RUNNING &&
|
||||
!(ifp->if_flags & IFF_PROMISC) &&
|
||||
(ifp->if_flags & IFF_PROMISC) == 0 &&
|
||||
sc->sc_if_flags & IFF_PROMISC) {
|
||||
CSR_CLRBIT_1(sc, VGE_RXCTL,
|
||||
VGE_RXCTL_RX_PROMISC);
|
||||
|
|
Loading…
Reference in New Issue