Whitespace fix (mainly tabify).
This commit is contained in:
parent
c173283618
commit
5542e458a9
|
@ -1,5 +1,5 @@
|
|||
/* $Id: at91emac.c,v 1.26 2019/05/23 10:51:38 msaitoh Exp $ */
|
||||
/* $NetBSD: at91emac.c,v 1.26 2019/05/23 10:51:38 msaitoh Exp $ */
|
||||
/* $Id: at91emac.c,v 1.27 2019/05/23 13:10:50 msaitoh Exp $ */
|
||||
/* $NetBSD: at91emac.c,v 1.27 2019/05/23 13:10:50 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Embedtronics Oy
|
||||
|
@ -33,7 +33,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.26 2019/05/23 10:51:38 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.27 2019/05/23 13:10:50 msaitoh Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
|
@ -92,7 +92,7 @@ __KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.26 2019/05/23 10:51:38 msaitoh Exp $"
|
|||
static int emac_match(device_t, cfdata_t, void *);
|
||||
static void emac_attach(device_t, device_t, void *);
|
||||
static void emac_init(struct emac_softc *);
|
||||
static int emac_intr(void* arg);
|
||||
static int emac_intr(void* arg);
|
||||
static int emac_gctx(struct emac_softc *);
|
||||
static int emac_mediachange(struct ifnet *);
|
||||
static void emac_mediastatus(struct ifnet *, struct ifmediareq *);
|
||||
|
@ -269,7 +269,7 @@ emac_intr(void *arg)
|
|||
struct mbuf *m;
|
||||
|
||||
nfo = sc->RDSC[bi].Info;
|
||||
fl = (nfo & ETH_RDSC_I_LEN) - 4;
|
||||
fl = (nfo & ETH_RDSC_I_LEN) - 4;
|
||||
DPRINTFN(2,("## nfo=0x%08X\n", nfo));
|
||||
|
||||
MGETHDR(m, M_DONTWAIT, MT_DATA);
|
||||
|
@ -492,19 +492,19 @@ emac_init(struct emac_softc *sc)
|
|||
*/
|
||||
sc->sc_ec.ec_capabilities |= ETHERCAP_VLAN_MTU;
|
||||
|
||||
strcpy(ifp->if_xname, device_xname(sc->sc_dev));
|
||||
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
|
||||
ifp->if_ioctl = emac_ifioctl;
|
||||
ifp->if_start = emac_ifstart;
|
||||
ifp->if_watchdog = emac_ifwatchdog;
|
||||
ifp->if_init = emac_ifinit;
|
||||
ifp->if_stop = emac_ifstop;
|
||||
ifp->if_timer = 0;
|
||||
strcpy(ifp->if_xname, device_xname(sc->sc_dev));
|
||||
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
|
||||
ifp->if_ioctl = emac_ifioctl;
|
||||
ifp->if_start = emac_ifstart;
|
||||
ifp->if_watchdog = emac_ifwatchdog;
|
||||
ifp->if_init = emac_ifinit;
|
||||
ifp->if_stop = emac_ifstop;
|
||||
ifp->if_timer = 0;
|
||||
ifp->if_softc = sc;
|
||||
IFQ_SET_READY(&ifp->if_snd);
|
||||
if_attach(ifp);
|
||||
IFQ_SET_READY(&ifp->if_snd);
|
||||
if_attach(ifp);
|
||||
if_deferred_start_init(ifp, NULL);
|
||||
ether_ifattach(ifp, (sc)->sc_enaddr);
|
||||
ether_ifattach(ifp, (sc)->sc_enaddr);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -565,18 +565,18 @@ emac_mii_writereg(device_t self, int phy, int reg, uint16_t val)
|
|||
void
|
||||
emac_statchg(struct ifnet *ifp)
|
||||
{
|
||||
struct emac_softc *sc = ifp->if_softc;
|
||||
uint32_t reg;
|
||||
struct emac_softc *sc = ifp->if_softc;
|
||||
uint32_t reg;
|
||||
|
||||
/*
|
||||
* We must keep the MAC and the PHY in sync as
|
||||
* to the status of full-duplex!
|
||||
*/
|
||||
/*
|
||||
* We must keep the MAC and the PHY in sync as
|
||||
* to the status of full-duplex!
|
||||
*/
|
||||
reg = EMAC_READ(ETH_CFG);
|
||||
if (sc->sc_mii.mii_media_active & IFM_FDX)
|
||||
reg |= ETH_CFG_FD;
|
||||
else
|
||||
reg &= ~ETH_CFG_FD;
|
||||
if (sc->sc_mii.mii_media_active & IFM_FDX)
|
||||
reg |= ETH_CFG_FD;
|
||||
else
|
||||
reg &= ~ETH_CFG_FD;
|
||||
EMAC_WRITE(ETH_CFG, reg);
|
||||
}
|
||||
|
||||
|
@ -723,7 +723,7 @@ emac_ifwatchdog(struct ifnet *ifp)
|
|||
|
||||
if ((ifp->if_flags & IFF_RUNNING) == 0)
|
||||
return;
|
||||
printf("%s: device timeout, CTL = 0x%08x, CFG = 0x%08x\n",
|
||||
printf("%s: device timeout, CTL = 0x%08x, CFG = 0x%08x\n",
|
||||
device_xname(sc->sc_dev), EMAC_READ(ETH_CTL), EMAC_READ(ETH_CFG));
|
||||
}
|
||||
|
||||
|
@ -746,7 +746,7 @@ emac_ifinit(struct ifnet *ifp)
|
|||
|
||||
mii_mediachg(&sc->sc_mii);
|
||||
callout_reset(&sc->emac_tick_ch, hz, emac_tick, sc);
|
||||
ifp->if_flags |= IFF_RUNNING;
|
||||
ifp->if_flags |= IFF_RUNNING;
|
||||
splx(s);
|
||||
return 0;
|
||||
}
|
||||
|
@ -800,7 +800,7 @@ emac_setaddr(struct ifnet *ifp)
|
|||
cfg &= ~(ETH_CFG_MTI | ETH_CFG_UNI | ETH_CFG_CAF | ETH_CFG_UNI);
|
||||
|
||||
if (ifp->if_flags & IFF_PROMISC) {
|
||||
cfg |= ETH_CFG_CAF;
|
||||
cfg |= ETH_CFG_CAF;
|
||||
} else {
|
||||
cfg &= ~ETH_CFG_CAF;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: epe.c,v 1.41 2019/05/23 10:30:35 msaitoh Exp $ */
|
||||
/* $NetBSD: epe.c,v 1.42 2019/05/23 13:10:50 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004 Jesse Off
|
||||
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.41 2019/05/23 10:30:35 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.42 2019/05/23 13:10:50 msaitoh Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
|
@ -94,7 +94,7 @@ __KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.41 2019/05/23 10:30:35 msaitoh Exp $");
|
|||
static int epe_match(device_t , cfdata_t, void *);
|
||||
static void epe_attach(device_t, device_t, void *);
|
||||
static void epe_init(struct epe_softc *);
|
||||
static int epe_intr(void* arg);
|
||||
static int epe_intr(void* arg);
|
||||
static int epe_gctx(struct epe_softc *);
|
||||
static int epe_mediachange(struct ifnet *);
|
||||
int epe_mii_readreg (device_t, int, int, uint16_t *);
|
||||
|
@ -147,7 +147,7 @@ epe_attach(device_t parent, device_t self, void *aux)
|
|||
sc->sc_enaddr, ETHER_ADDR_LEN);
|
||||
}
|
||||
|
||||
ep93xx_intr_establish(sc->sc_intr, IPL_NET, epe_intr, sc);
|
||||
ep93xx_intr_establish(sc->sc_intr, IPL_NET, epe_intr, sc);
|
||||
epe_init(sc);
|
||||
}
|
||||
|
||||
|
@ -258,7 +258,7 @@ begin:
|
|||
if (ndq > 0) {
|
||||
ifp->if_ipackets += ndq;
|
||||
CTRLPAGE_DMASYNC(TX_QLEN * 3 * sizeof(uint32_t),
|
||||
RX_QLEN * 4 * sizeof(uint32_t),
|
||||
RX_QLEN * 4 * sizeof(uint32_t),
|
||||
BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
|
||||
EPE_WRITE(RXStsEnq, ndq);
|
||||
EPE_WRITE(RXDEnq, ndq);
|
||||
|
@ -425,19 +425,19 @@ epe_init(struct epe_softc *sc)
|
|||
*/
|
||||
sc->sc_ec.ec_capabilities |= ETHERCAP_VLAN_MTU;
|
||||
|
||||
strcpy(ifp->if_xname, device_xname(sc->sc_dev));
|
||||
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
|
||||
ifp->if_ioctl = epe_ifioctl;
|
||||
ifp->if_start = epe_ifstart;
|
||||
ifp->if_watchdog = epe_ifwatchdog;
|
||||
ifp->if_init = epe_ifinit;
|
||||
ifp->if_stop = epe_ifstop;
|
||||
ifp->if_timer = 0;
|
||||
strcpy(ifp->if_xname, device_xname(sc->sc_dev));
|
||||
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
|
||||
ifp->if_ioctl = epe_ifioctl;
|
||||
ifp->if_start = epe_ifstart;
|
||||
ifp->if_watchdog = epe_ifwatchdog;
|
||||
ifp->if_init = epe_ifinit;
|
||||
ifp->if_stop = epe_ifstop;
|
||||
ifp->if_timer = 0;
|
||||
ifp->if_softc = sc;
|
||||
IFQ_SET_READY(&ifp->if_snd);
|
||||
if_attach(ifp);
|
||||
IFQ_SET_READY(&ifp->if_snd);
|
||||
if_attach(ifp);
|
||||
if_deferred_start_init(ifp, NULL);
|
||||
ether_ifattach(ifp, (sc)->sc_enaddr);
|
||||
ether_ifattach(ifp, (sc)->sc_enaddr);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -482,18 +482,18 @@ epe_mii_writereg(device_t self, int phy, int reg, uint16_t val)
|
|||
void
|
||||
epe_statchg(struct ifnet *ifp)
|
||||
{
|
||||
struct epe_softc *sc = ifp->if_softc;
|
||||
uint32_t reg;
|
||||
struct epe_softc *sc = ifp->if_softc;
|
||||
uint32_t reg;
|
||||
|
||||
/*
|
||||
* We must keep the MAC and the PHY in sync as
|
||||
* to the status of full-duplex!
|
||||
*/
|
||||
reg = EPE_READ(TestCtl);
|
||||
if (sc->sc_mii.mii_media_active & IFM_FDX)
|
||||
reg |= TestCtl_MFDX;
|
||||
else
|
||||
reg &= ~TestCtl_MFDX;
|
||||
/*
|
||||
* We must keep the MAC and the PHY in sync as
|
||||
* to the status of full-duplex!
|
||||
*/
|
||||
reg = EPE_READ(TestCtl);
|
||||
if (sc->sc_mii.mii_media_active & IFM_FDX)
|
||||
reg |= TestCtl_MFDX;
|
||||
else
|
||||
reg &= ~TestCtl_MFDX;
|
||||
EPE_WRITE(TestCtl, reg);
|
||||
}
|
||||
|
||||
|
@ -655,7 +655,7 @@ epe_ifwatchdog(struct ifnet *ifp)
|
|||
|
||||
if ((ifp->if_flags & IFF_RUNNING) == 0)
|
||||
return;
|
||||
printf("%s: device timeout, BMCtl = 0x%08x, BMSts = 0x%08x\n",
|
||||
printf("%s: device timeout, BMCtl = 0x%08x, BMSts = 0x%08x\n",
|
||||
device_xname(sc->sc_dev), EPE_READ(BMCtl), EPE_READ(BMSts));
|
||||
}
|
||||
|
||||
|
@ -676,7 +676,7 @@ epe_ifinit(struct ifnet *ifp)
|
|||
goto out;
|
||||
|
||||
callout_reset(&sc->epe_tick_ch, hz, epe_tick, sc);
|
||||
ifp->if_flags |= IFF_RUNNING;
|
||||
ifp->if_flags |= IFF_RUNNING;
|
||||
out:
|
||||
splx(s);
|
||||
return 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_gmc.c,v 1.9 2019/05/23 10:51:38 msaitoh Exp $ */
|
||||
/* $NetBSD: if_gmc.c,v 1.10 2019/05/23 13:10:50 msaitoh Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
|
@ -47,7 +47,7 @@
|
|||
#include <net/if_ether.h>
|
||||
#include <net/if_dl.h>
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_gmc.c,v 1.9 2019/05/23 10:51:38 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_gmc.c,v 1.10 2019/05/23 13:10:50 msaitoh Exp $");
|
||||
|
||||
#define MAX_TXSEG 32
|
||||
|
||||
|
@ -326,12 +326,12 @@ gmc_mii_statchg(struct ifnet *ifp)
|
|||
gmac_status |= STATUS_SPEED_10M;
|
||||
}
|
||||
|
||||
if (sc->sc_mii.mii_media_active & IFM_FDX)
|
||||
if (sc->sc_mii.mii_media_active & IFM_FDX)
|
||||
gmac_status |= STATUS_DUPLEX_FULL;
|
||||
else
|
||||
gmac_status &= ~STATUS_DUPLEX_FULL;
|
||||
|
||||
if (sc->sc_mii.mii_media_status & IFM_ACTIVE)
|
||||
if (sc->sc_mii.mii_media_status & IFM_ACTIVE)
|
||||
gmac_status |= STATUS_LINK_ON;
|
||||
else
|
||||
gmac_status &= ~STATUS_LINK_ON;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_enet.c,v 1.20 2019/05/23 10:40:39 msaitoh Exp $ */
|
||||
/* $NetBSD: if_enet.c,v 1.21 2019/05/23 13:10:50 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014 Ryo Shimizu <ryo@nerv.org>
|
||||
|
@ -31,7 +31,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_enet.c,v 1.20 2019/05/23 10:40:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_enet.c,v 1.21 2019/05/23 13:10:50 msaitoh Exp $");
|
||||
|
||||
#include "vlan.h"
|
||||
|
||||
|
@ -137,7 +137,7 @@ static void enet_tick(void *);
|
|||
static int enet_tx_intr(void *);
|
||||
static int enet_rx_intr(void *);
|
||||
static void enet_rx_csum(struct enet_softc *, struct ifnet *, struct mbuf *,
|
||||
int);
|
||||
int);
|
||||
|
||||
static void enet_start(struct ifnet *);
|
||||
static int enet_ifflags_cb(struct ethercom *);
|
||||
|
@ -165,7 +165,7 @@ static int enet_alloc_rxbuf(struct enet_softc *, int);
|
|||
static void enet_drain_txbuf(struct enet_softc *);
|
||||
static void enet_drain_rxbuf(struct enet_softc *);
|
||||
static int enet_alloc_dma(struct enet_softc *, size_t, void **,
|
||||
bus_dmamap_t *);
|
||||
bus_dmamap_t *);
|
||||
|
||||
CFATTACH_DECL_NEW(enet, sizeof(struct enet_softc),
|
||||
enet_match, enet_attach, NULL, NULL);
|
||||
|
@ -1905,7 +1905,7 @@ enet_init_regs(struct enet_softc *sc, int init)
|
|||
|
||||
static int
|
||||
enet_alloc_dma(struct enet_softc *sc, size_t size, void **addrp,
|
||||
bus_dmamap_t *mapp)
|
||||
bus_dmamap_t *mapp)
|
||||
{
|
||||
bus_dma_segment_t seglist[1];
|
||||
int nsegs, error;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sun4i_emac.c,v 1.9 2019/05/23 10:57:27 msaitoh Exp $ */
|
||||
/* $NetBSD: sun4i_emac.c,v 1.10 2019/05/23 13:10:50 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2013-2017 The NetBSD Foundation, Inc.
|
||||
|
@ -31,7 +31,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__KERNEL_RCSID(1, "$NetBSD: sun4i_emac.c,v 1.9 2019/05/23 10:57:27 msaitoh Exp $");
|
||||
__KERNEL_RCSID(1, "$NetBSD: sun4i_emac.c,v 1.10 2019/05/23 13:10:50 msaitoh Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/bus.h>
|
||||
|
@ -351,20 +351,20 @@ sun4i_emac_attach(device_t parent, device_t self, void *aux)
|
|||
|
||||
ifmedia_init(&mii->mii_media, 0, ether_mediachange, ether_mediastatus);
|
||||
|
||||
mii->mii_ifp = ifp;
|
||||
mii->mii_readreg = sun4i_emac_miibus_read_reg;
|
||||
mii->mii_writereg = sun4i_emac_miibus_write_reg;
|
||||
mii->mii_statchg = sun4i_emac_miibus_statchg;
|
||||
mii->mii_ifp = ifp;
|
||||
mii->mii_readreg = sun4i_emac_miibus_read_reg;
|
||||
mii->mii_writereg = sun4i_emac_miibus_write_reg;
|
||||
mii->mii_statchg = sun4i_emac_miibus_statchg;
|
||||
|
||||
mii_attach(self, mii, 0xffffffff, MII_PHY_ANY, MII_OFFSET_ANY, 0);
|
||||
mii_attach(self, mii, 0xffffffff, MII_PHY_ANY, MII_OFFSET_ANY, 0);
|
||||
|
||||
if (LIST_EMPTY(&mii->mii_phys)) {
|
||||
aprint_error_dev(self, "no PHY found!\n");
|
||||
ifmedia_add(&mii->mii_media, IFM_ETHER | IFM_MANUAL, 0, NULL);
|
||||
ifmedia_set(&mii->mii_media, IFM_ETHER | IFM_MANUAL);
|
||||
} else {
|
||||
ifmedia_set(&mii->mii_media, IFM_ETHER | IFM_AUTO);
|
||||
}
|
||||
if (LIST_EMPTY(&mii->mii_phys)) {
|
||||
aprint_error_dev(self, "no PHY found!\n");
|
||||
ifmedia_add(&mii->mii_media, IFM_ETHER | IFM_MANUAL, 0, NULL);
|
||||
ifmedia_set(&mii->mii_media, IFM_ETHER | IFM_MANUAL);
|
||||
} else {
|
||||
ifmedia_set(&mii->mii_media, IFM_ETHER | IFM_AUTO);
|
||||
}
|
||||
|
||||
/*
|
||||
* Attach the interface.
|
||||
|
@ -883,7 +883,7 @@ sun4i_emac_rx_hash(struct sun4i_emac_softc *sc)
|
|||
hash[0] = hash[1] = ~0;
|
||||
ifp->if_flags |= IFF_ALLMULTI;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
u_int crc = ether_crc32_be(enm->enm_addrlo,
|
||||
ETHER_ADDR_LEN);
|
||||
|
@ -893,7 +893,7 @@ sun4i_emac_rx_hash(struct sun4i_emac_softc *sc)
|
|||
|
||||
/* Set the corresponding bit in the filter. */
|
||||
hash[crc >> 5] |= __BIT(crc & 31);
|
||||
ETHER_NEXT_MULTI(step, enm);
|
||||
ETHER_NEXT_MULTI(step, enm);
|
||||
}
|
||||
ETHER_UNLOCK(&sc->sc_ec);
|
||||
ifp->if_flags &= ~IFF_ALLMULTI;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: if_ae.c,v 1.34 2019/05/23 10:51:38 msaitoh Exp $ */
|
||||
/* $Id: if_ae.c,v 1.35 2019/05/23 13:10:50 msaitoh Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2006 Urbana-Champaign Independent Media Center.
|
||||
* Copyright (c) 2006 Garrett D'Amore.
|
||||
|
@ -98,7 +98,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ae.c,v 1.34 2019/05/23 10:51:38 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ae.c,v 1.35 2019/05/23 13:10:50 msaitoh Exp $");
|
||||
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -143,7 +143,7 @@ static const struct {
|
|||
{ 0, NULL },
|
||||
};
|
||||
|
||||
static int ae_match(device_t, struct cfdata *, void *);
|
||||
static int ae_match(device_t, struct cfdata *, void *);
|
||||
static void ae_attach(device_t, device_t, void *);
|
||||
static int ae_detach(device_t, int);
|
||||
static int ae_activate(device_t, enum devact);
|
||||
|
@ -1375,7 +1375,7 @@ ae_init(struct ifnet *ifp)
|
|||
* Initialize the interrupt mask and enable interrupts.
|
||||
*/
|
||||
/* normal interrupts */
|
||||
sc->sc_inten = STATUS_TI | STATUS_TU | STATUS_RI | STATUS_NIS;
|
||||
sc->sc_inten = STATUS_TI | STATUS_TU | STATUS_RI | STATUS_NIS;
|
||||
|
||||
/* abnormal interrupts */
|
||||
sc->sc_inten |= STATUS_TPS | STATUS_TJT | STATUS_UNF |
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sbmac.c,v 1.58 2019/05/23 10:40:39 msaitoh Exp $ */
|
||||
/* $NetBSD: sbmac.c,v 1.59 2019/05/23 13:10:50 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2000, 2001, 2004
|
||||
|
@ -33,7 +33,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: sbmac.c,v 1.58 2019/05/23 10:40:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: sbmac.c,v 1.59 2019/05/23 13:10:50 msaitoh Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_ns.h"
|
||||
|
@ -145,7 +145,7 @@ typedef struct sbmacdma_s {
|
|||
sbmac_port_t sbdma_config0; /* DMA config register 0 */
|
||||
sbmac_port_t sbdma_config1; /* DMA config register 1 */
|
||||
sbmac_port_t sbdma_dscrbase; /* Descriptor base address */
|
||||
sbmac_port_t sbdma_dscrcnt; /* Descriptor count register */
|
||||
sbmac_port_t sbdma_dscrcnt; /* Descriptor count register */
|
||||
sbmac_port_t sbdma_curdscr; /* current descriptor address */
|
||||
|
||||
/*
|
||||
|
@ -573,7 +573,7 @@ sbdma_add_rcvbuffer(sbmacdma_t *d, struct mbuf *m)
|
|||
static int
|
||||
sbdma_add_txbuffer(sbmacdma_t *d, struct mbuf *m)
|
||||
{
|
||||
unsigned int dsc, nextdsc, prevdsc, origdesc;
|
||||
unsigned int dsc, nextdsc, prevdsc, origdesc;
|
||||
int length;
|
||||
int num_mbufs = 0;
|
||||
struct sbmac_softc *sc = d->sbdma_eth;
|
||||
|
@ -702,7 +702,7 @@ again:
|
|||
d->sbdma_ctxtable[prevdsc] = m;
|
||||
|
||||
/* Interrupt on last dscr of packet. */
|
||||
d->sbdma_dscrtable[prevdsc].dscr_a |= M_DMA_DSCRA_INTERRUPT;
|
||||
d->sbdma_dscrtable[prevdsc].dscr_a |= M_DMA_DSCRA_INTERRUPT;
|
||||
} else {
|
||||
struct mbuf *m_new = NULL;
|
||||
/*
|
||||
|
@ -1060,12 +1060,12 @@ sbmac_initctx(struct sbmac_softc *sc)
|
|||
*/
|
||||
|
||||
sc->sbm_macenable = PKSEG1(sc->sbm_base + R_MAC_ENABLE);
|
||||
sc->sbm_maccfg = PKSEG1(sc->sbm_base + R_MAC_CFG);
|
||||
sc->sbm_fifocfg = PKSEG1(sc->sbm_base + R_MAC_THRSH_CFG);
|
||||
sc->sbm_maccfg = PKSEG1(sc->sbm_base + R_MAC_CFG);
|
||||
sc->sbm_fifocfg = PKSEG1(sc->sbm_base + R_MAC_THRSH_CFG);
|
||||
sc->sbm_framecfg = PKSEG1(sc->sbm_base + R_MAC_FRAMECFG);
|
||||
sc->sbm_rxfilter = PKSEG1(sc->sbm_base + R_MAC_ADFILTER_CFG);
|
||||
sc->sbm_isr = PKSEG1(sc->sbm_base + R_MAC_STATUS);
|
||||
sc->sbm_imr = PKSEG1(sc->sbm_base + R_MAC_INT_MASK);
|
||||
sc->sbm_isr = PKSEG1(sc->sbm_base + R_MAC_STATUS);
|
||||
sc->sbm_imr = PKSEG1(sc->sbm_base + R_MAC_INT_MASK);
|
||||
|
||||
/*
|
||||
* Initialize the DMA channels. Right now, only one per MAC is used
|
||||
|
@ -2317,7 +2317,7 @@ sbmac_attach(device_t parent, device_t self, void *aux)
|
|||
/*
|
||||
* Initialize MII/media info.
|
||||
*/
|
||||
mii->mii_ifp = ifp;
|
||||
mii->mii_ifp = ifp;
|
||||
mii->mii_readreg = sbmac_mii_readreg;
|
||||
mii->mii_writereg = sbmac_mii_writereg;
|
||||
mii->mii_statchg = sbmac_mii_statchg;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_sq.c,v 1.51 2019/05/23 10:57:27 msaitoh Exp $ */
|
||||
/* $NetBSD: if_sq.c,v 1.52 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Rafal K. Boni
|
||||
|
@ -33,7 +33,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_sq.c,v 1.51 2019/05/23 10:57:27 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_sq.c,v 1.52 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -181,7 +181,7 @@ sq_attach(device_t parent, device_t self, void *aux)
|
|||
|
||||
sc->sc_dev = self;
|
||||
sc->sc_hpct = haa->ha_st;
|
||||
sc->hpc_regs = haa->hpc_regs; /* HPC register definitions */
|
||||
sc->hpc_regs = haa->hpc_regs; /* HPC register definitions */
|
||||
|
||||
if ((err = bus_space_subregion(haa->ha_st, haa->ha_sh,
|
||||
haa->ha_dmaoff, sc->hpc_regs->enet_regs_size,
|
||||
|
@ -349,7 +349,7 @@ sq_attach(device_t parent, device_t self, void *aux)
|
|||
}
|
||||
fail_4:
|
||||
for (i = 0; i < SQ_NTXDESC; i++) {
|
||||
if (sc->sc_txmap[i] != NULL)
|
||||
if (sc->sc_txmap[i] != NULL)
|
||||
bus_dmamap_destroy(sc->sc_dmat, sc->sc_txmap[i]);
|
||||
}
|
||||
bus_dmamap_unload(sc->sc_dmat, sc->sc_cdmap);
|
||||
|
@ -1322,7 +1322,7 @@ sq_dump_buffer(paddr_t addr, psize_t len)
|
|||
|
||||
for (i = 0; i < len; i++) {
|
||||
printf("%02x ", *(physaddr + i) & 0xff);
|
||||
if ((i % 16) == 15 && i != len - 1)
|
||||
if ((i % 16) == 15 && i != len - 1)
|
||||
printf("\n%p: ", physaddr + i);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_ie.c,v 1.68 2019/05/23 10:57:27 msaitoh Exp $ */
|
||||
/* $NetBSD: if_ie.c,v 1.69 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum.
|
||||
|
@ -98,7 +98,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.68 2019/05/23 10:57:27 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.69 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_ns.h"
|
||||
|
@ -163,13 +163,13 @@ __KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.68 2019/05/23 10:57:27 msaitoh Exp $");
|
|||
#ifdef IEDEBUG
|
||||
#define inline /* not */
|
||||
void print_rbd(volatile struct ie_recv_buf_desc *);
|
||||
int in_ierint = 0;
|
||||
int in_ietint = 0;
|
||||
int ie_debug_flags = 0;
|
||||
int in_ierint = 0;
|
||||
int in_ietint = 0;
|
||||
int ie_debug_flags = 0;
|
||||
#endif
|
||||
|
||||
/* XXX - Skip TDR for now - it always complains... */
|
||||
int ie_run_tdr = 0;
|
||||
int ie_run_tdr = 0;
|
||||
|
||||
static void iewatchdog(struct ifnet *);
|
||||
static int ieinit(struct ie_softc *);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_ni.c,v 1.47 2019/05/23 10:34:44 msaitoh Exp $ */
|
||||
/* $NetBSD: if_ni.c,v 1.48 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
|
||||
*
|
||||
|
@ -36,7 +36,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.47 2019/05/23 10:34:44 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.48 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
|
@ -119,7 +119,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.47 2019/05/23 10:34:44 msaitoh Exp $");
|
|||
#define bbd sc->sc_bbd
|
||||
|
||||
struct ni_softc {
|
||||
device_t sc_dev; /* Configuration common part */
|
||||
device_t sc_dev; /* Configuration common part */
|
||||
struct evcnt sc_intrcnt; /* Interrupt coounting */
|
||||
struct ethercom sc_ec; /* Ethernet common part */
|
||||
#define sc_if sc_ec.ec_if /* network-visible interface */
|
||||
|
@ -878,8 +878,8 @@ ni_shutdown(void *arg)
|
|||
{
|
||||
struct ni_softc *sc = arg;
|
||||
|
||||
WAITREG(NI_PCR, PCR_OWN);
|
||||
NI_WREG(NI_PCR, PCR_OWN | PCR_SHUTDOWN);
|
||||
WAITREG(NI_PCR, PCR_OWN);
|
||||
WAITREG(NI_PSR, PSR_OWN);
|
||||
WAITREG(NI_PCR, PCR_OWN);
|
||||
NI_WREG(NI_PCR, PCR_OWN | PCR_SHUTDOWN);
|
||||
WAITREG(NI_PCR, PCR_OWN);
|
||||
WAITREG(NI_PSR, PSR_OWN);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_cemac.c,v 1.19 2019/05/23 10:30:35 msaitoh Exp $ */
|
||||
/* $NetBSD: if_cemac.c,v 1.20 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2015 Genetec Corporation. All rights reserved.
|
||||
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.19 2019/05/23 10:30:35 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.20 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
|
@ -97,7 +97,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.19 2019/05/23 10:30:35 msaitoh Exp $"
|
|||
#define TX_QLEN 2 /* I'm very sorry but that's where we can get */
|
||||
|
||||
struct cemac_qmeta {
|
||||
struct mbuf *m;
|
||||
struct mbuf *m;
|
||||
bus_dmamap_t m_dmamap;
|
||||
};
|
||||
|
||||
|
@ -321,7 +321,7 @@ cemac_intr(void *arg)
|
|||
struct mbuf *m;
|
||||
|
||||
nfo = sc->RDSC[bi].Info;
|
||||
fl = (nfo & ETH_RDSC_I_LEN) - 4;
|
||||
fl = (nfo & ETH_RDSC_I_LEN) - 4;
|
||||
DPRINTFN(2,("## nfo=0x%08X\n", nfo));
|
||||
|
||||
MGETHDR(m, M_DONTWAIT, MT_DATA);
|
||||
|
@ -352,7 +352,7 @@ cemac_intr(void *arg)
|
|||
}
|
||||
sc->rxq[bi].m->m_pkthdr.csum_flags = csum;
|
||||
DPRINTFN(2,("received %u bytes packet\n", fl));
|
||||
if_percpuq_enqueue(ifp->if_percpuq,
|
||||
if_percpuq_enqueue(ifp->if_percpuq,
|
||||
sc->rxq[bi].m);
|
||||
if (mtod(m, intptr_t) & 3)
|
||||
m_adj(m, mtod(m, intptr_t) & 3);
|
||||
|
@ -607,18 +607,18 @@ cemac_init(struct cemac_softc *sc)
|
|||
sc->sc_ethercom.ec_capabilities |= ETHERCAP_VLAN_MTU;
|
||||
|
||||
strcpy(ifp->if_xname, device_xname(sc->sc_dev));
|
||||
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
|
||||
ifp->if_ioctl = cemac_ifioctl;
|
||||
ifp->if_start = cemac_ifstart;
|
||||
ifp->if_watchdog = cemac_ifwatchdog;
|
||||
ifp->if_init = cemac_ifinit;
|
||||
ifp->if_stop = cemac_ifstop;
|
||||
ifp->if_timer = 0;
|
||||
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
|
||||
ifp->if_ioctl = cemac_ifioctl;
|
||||
ifp->if_start = cemac_ifstart;
|
||||
ifp->if_watchdog = cemac_ifwatchdog;
|
||||
ifp->if_init = cemac_ifinit;
|
||||
ifp->if_stop = cemac_ifstop;
|
||||
ifp->if_timer = 0;
|
||||
ifp->if_softc = sc;
|
||||
IFQ_SET_READY(&ifp->if_snd);
|
||||
if_attach(ifp);
|
||||
IFQ_SET_READY(&ifp->if_snd);
|
||||
if_attach(ifp);
|
||||
if_deferred_start_init(ifp, NULL);
|
||||
ether_ifattach(ifp, (sc)->sc_enaddr);
|
||||
ether_ifattach(ifp, (sc)->sc_enaddr);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -680,18 +680,18 @@ cemac_mii_writereg(device_t self, int phy, int reg, uint16_t val)
|
|||
static void
|
||||
cemac_statchg(struct ifnet *ifp)
|
||||
{
|
||||
struct cemac_softc *sc = ifp->if_softc;
|
||||
struct cemac_softc *sc = ifp->if_softc;
|
||||
struct mii_data *mii = &sc->sc_mii;
|
||||
uint32_t reg;
|
||||
uint32_t reg;
|
||||
|
||||
/*
|
||||
* We must keep the MAC and the PHY in sync as
|
||||
* to the status of full-duplex!
|
||||
*/
|
||||
/*
|
||||
* We must keep the MAC and the PHY in sync as
|
||||
* to the status of full-duplex!
|
||||
*/
|
||||
reg = CEMAC_READ(ETH_CFG);
|
||||
reg &= ~ETH_CFG_FD;
|
||||
if (sc->sc_mii.mii_media_active & IFM_FDX)
|
||||
reg |= ETH_CFG_FD;
|
||||
if (sc->sc_mii.mii_media_active & IFM_FDX)
|
||||
reg |= ETH_CFG_FD;
|
||||
|
||||
reg &= ~ETH_CFG_SPD;
|
||||
if (ISSET(sc->cemac_flags, CEMAC_FLAG_GEM))
|
||||
|
@ -921,7 +921,7 @@ cemac_ifinit(struct ifnet *ifp)
|
|||
|
||||
mii_mediachg(&sc->sc_mii);
|
||||
callout_reset(&sc->cemac_tick_ch, hz, cemac_tick, sc);
|
||||
ifp->if_flags |= IFF_RUNNING;
|
||||
ifp->if_flags |= IFF_RUNNING;
|
||||
splx(s);
|
||||
return 0;
|
||||
}
|
||||
|
@ -979,7 +979,7 @@ cemac_setaddr(struct ifnet *ifp)
|
|||
cfg &= ~(ETH_CFG_MTI | ETH_CFG_UNI | ETH_CFG_CAF | ETH_CFG_UNI);
|
||||
|
||||
if (ifp->if_flags & IFF_PROMISC) {
|
||||
cfg |= ETH_CFG_CAF;
|
||||
cfg |= ETH_CFG_CAF;
|
||||
} else {
|
||||
cfg &= ~ETH_CFG_CAF;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ath.c,v 1.125 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: ath.c,v 1.126 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
|
||||
|
@ -41,7 +41,7 @@
|
|||
__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.104 2005/09/16 10:09:23 ru Exp $");
|
||||
#endif
|
||||
#ifdef __NetBSD__
|
||||
__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.125 2019/05/23 10:57:28 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.126 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -234,8 +234,8 @@ enum {
|
|||
ATH_DEBUG_RATE = 0x00000010, /* rate control */
|
||||
ATH_DEBUG_RESET = 0x00000020, /* reset processing */
|
||||
ATH_DEBUG_MODE = 0x00000040, /* mode init/setup */
|
||||
ATH_DEBUG_BEACON = 0x00000080, /* beacon handling */
|
||||
ATH_DEBUG_WATCHDOG = 0x00000100, /* watchdog timeout */
|
||||
ATH_DEBUG_BEACON = 0x00000080, /* beacon handling */
|
||||
ATH_DEBUG_WATCHDOG = 0x00000100, /* watchdog timeout */
|
||||
ATH_DEBUG_INTR = 0x00001000, /* ISR */
|
||||
ATH_DEBUG_TX_PROC = 0x00002000, /* tx ISR proc */
|
||||
ATH_DEBUG_RX_PROC = 0x00004000, /* rx ISR proc */
|
||||
|
@ -252,7 +252,7 @@ enum {
|
|||
};
|
||||
#define IFF_DUMPPKTS(sc, m) \
|
||||
((sc->sc_debug & (m)) || \
|
||||
(sc->sc_if.if_flags & (IFF_DEBUG | IFF_LINK2)) \
|
||||
(sc->sc_if.if_flags & (IFF_DEBUG | IFF_LINK2)) \
|
||||
== (IFF_DEBUG | IFF_LINK2))
|
||||
#define DPRINTF(sc, m, fmt, ...) do { \
|
||||
if (sc->sc_debug & (m)) \
|
||||
|
@ -265,11 +265,11 @@ enum {
|
|||
static void ath_printrxbuf(struct ath_buf *bf, int);
|
||||
static void ath_printtxbuf(struct ath_buf *bf, int);
|
||||
#else
|
||||
#define IFF_DUMPPKTS(sc, m) \
|
||||
#define IFF_DUMPPKTS(sc, m) \
|
||||
((sc->sc_if.if_flags & (IFF_DEBUG | IFF_LINK2)) \
|
||||
== (IFF_DEBUG | IFF_LINK2))
|
||||
#define DPRINTF(m, fmt, ...)
|
||||
#define KEYPRINTF(sc, k, ix, mac)
|
||||
#define DPRINTF(m, fmt, ...)
|
||||
#define KEYPRINTF(sc, k, ix, mac)
|
||||
#endif
|
||||
|
||||
MALLOC_DEFINE(M_ATHDEV, "athdev", "ath driver dma buffers");
|
||||
|
@ -1025,7 +1025,7 @@ ath_init(struct ath_softc *sc)
|
|||
if (device_is_active(sc->sc_dev)) {
|
||||
s = splnet();
|
||||
} else if (!pmf_device_subtree_resume(sc->sc_dev, &sc->sc_qual) ||
|
||||
!device_is_active(sc->sc_dev))
|
||||
!device_is_active(sc->sc_dev))
|
||||
return 0;
|
||||
else
|
||||
s = splnet();
|
||||
|
@ -1284,7 +1284,7 @@ ath_txfrag_setup(struct ath_softc *sc, ath_bufhead *frags,
|
|||
ATH_TXBUF_LOCK(sc);
|
||||
for (m = m0->m_nextpkt; m != NULL; m = m->m_nextpkt) {
|
||||
bf = STAILQ_FIRST(&sc->sc_txbuf);
|
||||
if (bf == NULL) { /* out of buffers, cleanup */
|
||||
if (bf == NULL) { /* out of buffers, cleanup */
|
||||
DPRINTF(sc, ATH_DEBUG_XMIT, "%s: out of xmit buffers\n",
|
||||
__func__);
|
||||
sc->sc_if.if_flags |= IFF_OACTIVE;
|
||||
|
@ -1423,7 +1423,7 @@ ath_start(struct ifnet *ifp)
|
|||
!ath_txfrag_setup(sc, &frags, m, ni)) {
|
||||
DPRINTF(sc, ATH_DEBUG_ANY,
|
||||
"%s: out of txfrag buffers\n", __func__);
|
||||
ic->ic_stats.is_tx_nobuf++; /* XXX */
|
||||
ic->ic_stats.is_tx_nobuf++; /* XXX */
|
||||
ath_freetx(m);
|
||||
goto bad;
|
||||
}
|
||||
|
@ -2836,7 +2836,7 @@ static void
|
|||
ath_node_free(struct ieee80211_node *ni)
|
||||
{
|
||||
struct ieee80211com *ic = ni->ni_ic;
|
||||
struct ath_softc *sc = ic->ic_ifp->if_softc;
|
||||
struct ath_softc *sc = ic->ic_ifp->if_softc;
|
||||
|
||||
DPRINTF(sc, ATH_DEBUG_NODE, "%s: ni %p\n", __func__, ni);
|
||||
|
||||
|
@ -3740,7 +3740,7 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf
|
|||
}
|
||||
DPRINTF(sc, ATH_DEBUG_XMIT, "%s: m %p len %u\n", __func__, m0, pktlen);
|
||||
bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, 0,
|
||||
bf->bf_dmamap->dm_mapsize, BUS_DMASYNC_PREWRITE);
|
||||
bf->bf_dmamap->dm_mapsize, BUS_DMASYNC_PREWRITE);
|
||||
bf->bf_m = m0;
|
||||
bf->bf_node = ni; /* NB: held reference */
|
||||
|
||||
|
@ -3913,7 +3913,7 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf
|
|||
else
|
||||
dur = rt->info[rix].lpAckDuration;
|
||||
if (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) {
|
||||
dur += dur; /* additional SIFS+ACK */
|
||||
dur += dur; /* additional SIFS+ACK */
|
||||
KASSERTMSG(m0->m_nextpkt != NULL, "no fragment");
|
||||
/*
|
||||
* Include the size of next fragment so NAV is
|
||||
|
@ -3922,7 +3922,7 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf
|
|||
*/
|
||||
dur += ath_hal_computetxtime(ah, rt,
|
||||
deduct_pad_bytes(m0->m_nextpkt->m_pkthdr.len,
|
||||
hdrlen) -
|
||||
hdrlen) -
|
||||
deduct_pad_bytes(m0->m_pkthdr.len, hdrlen) + pktlen,
|
||||
rix, shortPreamble);
|
||||
}
|
||||
|
@ -4578,9 +4578,9 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan)
|
|||
__func__,
|
||||
ath_hal_mhz2ieee(ah, sc->sc_curchan.channel,
|
||||
sc->sc_curchan.channelFlags),
|
||||
sc->sc_curchan.channel, sc->sc_curchan.channelFlags,
|
||||
sc->sc_curchan.channel, sc->sc_curchan.channelFlags,
|
||||
ath_hal_mhz2ieee(ah, hchan.channel, hchan.channelFlags),
|
||||
hchan.channel, hchan.channelFlags);
|
||||
hchan.channel, hchan.channelFlags);
|
||||
if (hchan.channel != sc->sc_curchan.channel ||
|
||||
hchan.channelFlags != sc->sc_curchan.channelFlags) {
|
||||
HAL_STATUS status;
|
||||
|
@ -4719,7 +4719,7 @@ ath_calibrate(void *arg)
|
|||
sc->sc_calinterval = ath_calinterval;
|
||||
}
|
||||
KASSERTMSG(0 < sc->sc_calinterval &&
|
||||
sc->sc_calinterval <= ath_calinterval,
|
||||
sc->sc_calinterval <= ath_calinterval,
|
||||
"bad calibration interval %u", sc->sc_calinterval);
|
||||
|
||||
DPRINTF(sc, ATH_DEBUG_CALIBRATE,
|
||||
|
@ -4745,8 +4745,8 @@ ath_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
|
|||
HAL_LED_INIT, /* IEEE80211_S_INIT */
|
||||
HAL_LED_SCAN, /* IEEE80211_S_SCAN */
|
||||
HAL_LED_AUTH, /* IEEE80211_S_AUTH */
|
||||
HAL_LED_ASSOC, /* IEEE80211_S_ASSOC */
|
||||
HAL_LED_RUN, /* IEEE80211_S_RUN */
|
||||
HAL_LED_ASSOC, /* IEEE80211_S_ASSOC */
|
||||
HAL_LED_RUN, /* IEEE80211_S_RUN */
|
||||
};
|
||||
|
||||
DPRINTF(sc, ATH_DEBUG_STATE, "%s: %s -> %s\n", __func__,
|
||||
|
@ -5445,7 +5445,7 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
|||
if (error != ENETRESET)
|
||||
;
|
||||
else if (IS_RUNNING(ifp) &&
|
||||
ic->ic_roaming != IEEE80211_ROAMING_MANUAL)
|
||||
ic->ic_roaming != IEEE80211_ROAMING_MANUAL)
|
||||
error = ath_init(sc);
|
||||
else
|
||||
error = 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: atw.c,v 1.166 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: atw.c,v 1.167 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
|
||||
|
@ -34,7 +34,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.166 2019/05/23 10:57:28 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.167 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -211,7 +211,7 @@ void atw_txintr(struct atw_softc *, uint32_t);
|
|||
static int atw_newstate(struct ieee80211com *, enum ieee80211_state, int);
|
||||
static void atw_next_scan(void *);
|
||||
static void atw_recv_mgmt(struct ieee80211com *, struct mbuf *,
|
||||
struct ieee80211_node *, int, int, uint32_t);
|
||||
struct ieee80211_node *, int, int, uint32_t);
|
||||
static int atw_tune(struct atw_softc *);
|
||||
|
||||
/* Device initialization */
|
||||
|
@ -256,7 +256,7 @@ static void atw_filter_setup(struct atw_softc *);
|
|||
/* 802.11 utilities */
|
||||
static uint64_t atw_get_tsft(struct atw_softc *);
|
||||
static inline uint32_t atw_last_even_tsft(uint32_t, uint32_t,
|
||||
uint32_t);
|
||||
uint32_t);
|
||||
static struct ieee80211_node *atw_node_alloc(struct ieee80211_node_table *);
|
||||
static void atw_node_free(struct ieee80211_node *);
|
||||
|
||||
|
@ -1065,7 +1065,7 @@ static void
|
|||
atw_txlmt_init(struct atw_softc *sc)
|
||||
{
|
||||
ATW_WRITE(sc, ATW_TXLMT, __SHIFTIN(512, ATW_TXLMT_MTMLT_MASK) |
|
||||
__SHIFTIN(1, ATW_TXLMT_SRTYLIM_MASK));
|
||||
__SHIFTIN(1, ATW_TXLMT_SRTYLIM_MASK));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1129,7 +1129,7 @@ atw_ifs_init(struct atw_softc *sc)
|
|||
*/
|
||||
ifst = __SHIFTIN(IEEE80211_DUR_DS_SLOT, ATW_IFST_SLOT_MASK) |
|
||||
__SHIFTIN(22 * 10 /* IEEE80211_DUR_DS_SIFS */ /* # of 22 MHz cycles */,
|
||||
ATW_IFST_SIFS_MASK) |
|
||||
ATW_IFST_SIFS_MASK) |
|
||||
__SHIFTIN(IEEE80211_DUR_DS_DIFS, ATW_IFST_DIFS_MASK) |
|
||||
__SHIFTIN(IEEE80211_DUR_DS_EIFS, ATW_IFST_EIFS_MASK);
|
||||
|
||||
|
@ -1213,7 +1213,7 @@ atw_init(struct ifnet *ifp)
|
|||
*/
|
||||
atw_stop(ifp, 0);
|
||||
} else if (!pmf_device_subtree_resume(sc->sc_dev, &sc->sc_qual) ||
|
||||
!device_is_active(sc->sc_dev))
|
||||
!device_is_active(sc->sc_dev))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
|
@ -1327,7 +1327,7 @@ atw_init(struct ifnet *ifp)
|
|||
* Initialize the interrupt mask and enable interrupts.
|
||||
*/
|
||||
/* normal interrupts */
|
||||
sc->sc_inten = ATW_INTR_TCI | ATW_INTR_TDU | ATW_INTR_RCI |
|
||||
sc->sc_inten = ATW_INTR_TCI | ATW_INTR_TDU | ATW_INTR_RCI |
|
||||
ATW_INTR_NISS | ATW_INTR_LINKON | ATW_INTR_BCNTC;
|
||||
|
||||
/* abnormal interrupts */
|
||||
|
@ -1552,7 +1552,7 @@ atw_si4126_tune(struct atw_softc *sc, u_int chan)
|
|||
|
||||
/* Tune IF to 748 MHz to suit the IF LO input of the
|
||||
* RF2494B, which is 2 x IF. No need to set an IF divider
|
||||
* because an IF in 526 MHz - 952 MHz is allowed.
|
||||
* because an IF in 526 MHz - 952 MHz is allowed.
|
||||
*
|
||||
* XIN is 44.000 MHz, so divide it by two to get allowable
|
||||
* range of 2-25 MHz. SiLabs tells me that this is not
|
||||
|
@ -1962,7 +1962,7 @@ atw_si4126_read(struct atw_softc *sc, u_int addr, u_int *val)
|
|||
}
|
||||
if (val != NULL)
|
||||
*val = __SHIFTOUT(ATW_READ(sc, ATW_SYNCTL),
|
||||
ATW_SYNCTL_DATA_MASK);
|
||||
ATW_SYNCTL_DATA_MASK);
|
||||
return 0;
|
||||
}
|
||||
#endif /* ATW_SYNDEBUG */
|
||||
|
@ -2190,7 +2190,7 @@ atw_write_wep(struct atw_softc *sc)
|
|||
#endif
|
||||
/* SRAM shared-key record format: key0 flags key1 ... key12 */
|
||||
uint8_t buf[IEEE80211_WEP_NKID]
|
||||
[1 /* key[0] */ + 1 /* flags */ + 12 /* key[1 .. 12] */];
|
||||
[1 /* key[0] */ + 1 /* flags */ + 12 /* key[1 .. 12] */];
|
||||
|
||||
sc->sc_wepctl = 0;
|
||||
ATW_WRITE(sc, ATW_WEPCTL, sc->sc_wepctl);
|
||||
|
@ -2470,7 +2470,7 @@ atw_predict_beacon(struct atw_softc *sc)
|
|||
__SHIFTIN(1, ATW_TOFS1_TSFTOFSR_MASK) |
|
||||
__SHIFTIN(TBTTOFS, ATW_TOFS1_TBTTOFS_MASK) |
|
||||
__SHIFTIN(__SHIFTOUT(tbtt - TBTTOFS * IEEE80211_DUR_TU,
|
||||
ATW_TBTTPRE_MASK), ATW_TOFS1_TBTTPRE_MASK));
|
||||
ATW_TBTTPRE_MASK), ATW_TOFS1_TBTTPRE_MASK));
|
||||
#undef TBTTOFS
|
||||
}
|
||||
|
||||
|
@ -2617,7 +2617,7 @@ atw_txdrain(struct atw_softc *sc)
|
|||
}
|
||||
|
||||
KASSERT((sc->sc_if.if_flags & IFF_RUNNING) == 0 ||
|
||||
!(SIMPLEQ_EMPTY(&sc->sc_txfreeq) ||
|
||||
!(SIMPLEQ_EMPTY(&sc->sc_txfreeq) ||
|
||||
sc->sc_txfree != ATW_NTXDESC));
|
||||
sc->sc_if.if_flags &= ~IFF_OACTIVE;
|
||||
sc->sc_tx_timer = 0;
|
||||
|
@ -2970,7 +2970,7 @@ atw_softintr(void *arg)
|
|||
* use single-segment receive DMA, so this
|
||||
* is mostly useless.
|
||||
*
|
||||
* TBD others
|
||||
* TBD others
|
||||
*/
|
||||
}
|
||||
|
||||
|
@ -2988,10 +2988,10 @@ atw_softintr(void *arg)
|
|||
*
|
||||
* Cause the transmit and/or receive processes to go idle.
|
||||
*
|
||||
* XXX It seems that the ADM8211 will not signal the end of the Rx/Tx
|
||||
* XXX It seems that the ADM8211 will not signal the end of the Rx/Tx
|
||||
* process in STSR if I clear SR or ST after the process has already
|
||||
* ceased. Fair enough. But the Rx process status bits in ATW_TEST0
|
||||
* do not seem to be too reliable. Perhaps I have the sense of the
|
||||
* do not seem to be too reliable. Perhaps I have the sense of the
|
||||
* Rx bits switched with the Tx bits?
|
||||
*/
|
||||
void
|
||||
|
@ -3232,7 +3232,7 @@ atw_rxintr(struct atw_softc *sc)
|
|||
|
||||
bpf_mtap2(sc->sc_radiobpf, tap, sizeof(sc->sc_rxtapu),
|
||||
m, BPF_D_IN);
|
||||
}
|
||||
}
|
||||
|
||||
sc->sc_recv_ev.ev_count++;
|
||||
|
||||
|
@ -3822,7 +3822,7 @@ atw_start(struct ifnet *ifp)
|
|||
txd->at_buf1 = htole32(dmamap->dm_segs[seg].ds_addr);
|
||||
txd->at_flags =
|
||||
htole32(__SHIFTIN(dmamap->dm_segs[seg].ds_len,
|
||||
ATW_TXFLAG_TBS1_MASK)) |
|
||||
ATW_TXFLAG_TBS1_MASK)) |
|
||||
((nexttx == (ATW_NTXDESC - 1))
|
||||
? htole32(ATW_TXFLAG_TER) : 0);
|
||||
lasttx = nexttx;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: dm9000.c,v 1.18 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: dm9000.c,v 1.19 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009 Paul Fleischer
|
||||
|
@ -179,16 +179,16 @@ void dme_mediastatus(struct ifnet *, struct ifmediareq *);
|
|||
/*** Internal methods ***/
|
||||
|
||||
/* Prepare data to be transmitted (i.e. dequeue and load it into the DM9000) */
|
||||
void dme_prepare(struct dme_softc *, struct ifnet *);
|
||||
void dme_prepare(struct dme_softc *, struct ifnet *);
|
||||
|
||||
/* Transmit prepared data */
|
||||
void dme_transmit(struct dme_softc *);
|
||||
void dme_transmit(struct dme_softc *);
|
||||
|
||||
/* Receive data */
|
||||
void dme_receive(struct dme_softc *, struct ifnet *);
|
||||
void dme_receive(struct dme_softc *, struct ifnet *);
|
||||
|
||||
/* Software Initialize/Reset of the DM9000 */
|
||||
void dme_reset(struct dme_softc *);
|
||||
void dme_reset(struct dme_softc *);
|
||||
|
||||
/* Configure multicast filter */
|
||||
void dme_set_addr_filter(struct dme_softc *);
|
||||
|
@ -924,13 +924,13 @@ dme_set_addr_filter(struct dme_softc *sc)
|
|||
if (memcpy(enm->enm_addrlo, enm->enm_addrhi,
|
||||
sizeof(enm->enm_addrlo))) {
|
||||
/*
|
||||
* We must listen to a range of multicast addresses.
|
||||
* For now, just accept all multicasts, rather than
|
||||
* trying to set only those filter bits needed to match
|
||||
* the range. (At this time, the only use of address
|
||||
* ranges is for IP multicast routing, for which the
|
||||
* range is big enough to require all bits set.)
|
||||
*/
|
||||
* We must listen to a range of multicast addresses.
|
||||
* For now, just accept all multicasts, rather than
|
||||
* trying to set only those filter bits needed to match
|
||||
* the range. (At this time, the only use of address
|
||||
* ranges is for IP multicast routing, for which the
|
||||
* range is big enough to require all bits set.)
|
||||
*/
|
||||
ifp->if_flags |= IFF_ALLMULTI;
|
||||
af[0] = af[1] = af[2] = af[3] = 0xffff;
|
||||
break;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: dwc_gmac.c,v 1.61 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: dwc_gmac.c,v 1.62 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
|
||||
|
@ -41,7 +41,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.61 2019/05/23 10:57:28 msaitoh Exp $");
|
||||
__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.62 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
/* #define DWC_GMAC_DEBUG 1 */
|
||||
|
||||
|
@ -301,20 +301,20 @@ dwc_gmac_attach(struct dwc_gmac_softc *sc, int phy_id, uint32_t mii_clk)
|
|||
*/
|
||||
sc->sc_ec.ec_mii = &sc->sc_mii;
|
||||
ifmedia_init(&mii->mii_media, 0, ether_mediachange, ether_mediastatus);
|
||||
mii->mii_ifp = ifp;
|
||||
mii->mii_readreg = dwc_gmac_miibus_read_reg;
|
||||
mii->mii_writereg = dwc_gmac_miibus_write_reg;
|
||||
mii->mii_statchg = dwc_gmac_miibus_statchg;
|
||||
mii_attach(sc->sc_dev, mii, 0xffffffff, phy_id, MII_OFFSET_ANY,
|
||||
mii->mii_ifp = ifp;
|
||||
mii->mii_readreg = dwc_gmac_miibus_read_reg;
|
||||
mii->mii_writereg = dwc_gmac_miibus_write_reg;
|
||||
mii->mii_statchg = dwc_gmac_miibus_statchg;
|
||||
mii_attach(sc->sc_dev, mii, 0xffffffff, phy_id, MII_OFFSET_ANY,
|
||||
MIIF_DOPAUSE);
|
||||
|
||||
if (LIST_EMPTY(&mii->mii_phys)) {
|
||||
aprint_error_dev(sc->sc_dev, "no PHY found!\n");
|
||||
ifmedia_add(&mii->mii_media, IFM_ETHER | IFM_MANUAL, 0, NULL);
|
||||
ifmedia_set(&mii->mii_media, IFM_ETHER | IFM_MANUAL);
|
||||
} else {
|
||||
ifmedia_set(&mii->mii_media, IFM_ETHER | IFM_AUTO);
|
||||
}
|
||||
if (LIST_EMPTY(&mii->mii_phys)) {
|
||||
aprint_error_dev(sc->sc_dev, "no PHY found!\n");
|
||||
ifmedia_add(&mii->mii_media, IFM_ETHER | IFM_MANUAL, 0, NULL);
|
||||
ifmedia_set(&mii->mii_media, IFM_ETHER | IFM_MANUAL);
|
||||
} else {
|
||||
ifmedia_set(&mii->mii_media, IFM_ETHER | IFM_AUTO);
|
||||
}
|
||||
|
||||
/*
|
||||
* We can support 802.1Q VLAN-sized frames.
|
||||
|
@ -989,12 +989,12 @@ dwc_gmac_stop_locked(struct ifnet *ifp, int disable)
|
|||
bus_space_write_4(sc->sc_bst, sc->sc_bsh,
|
||||
AWIN_GMAC_DMA_OPMODE,
|
||||
bus_space_read_4(sc->sc_bst, sc->sc_bsh,
|
||||
AWIN_GMAC_DMA_OPMODE)
|
||||
AWIN_GMAC_DMA_OPMODE)
|
||||
& ~(GMAC_DMA_OP_TXSTART | GMAC_DMA_OP_RXSTART));
|
||||
bus_space_write_4(sc->sc_bst, sc->sc_bsh,
|
||||
AWIN_GMAC_DMA_OPMODE,
|
||||
bus_space_read_4(sc->sc_bst, sc->sc_bsh,
|
||||
AWIN_GMAC_DMA_OPMODE) | GMAC_DMA_OP_FLUSHTX);
|
||||
AWIN_GMAC_DMA_OPMODE) | GMAC_DMA_OP_FLUSHTX);
|
||||
|
||||
mii_down(&sc->sc_mii);
|
||||
dwc_gmac_reset_tx_ring(sc, &sc->sc_txq);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: elinkxl.c,v 1.129 2019/05/23 10:51:39 msaitoh Exp $ */
|
||||
/* $NetBSD: elinkxl.c,v 1.130 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -30,7 +30,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.129 2019/05/23 10:51:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.130 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -216,7 +216,7 @@ ex_config(struct ex_softc *sc)
|
|||
*/
|
||||
if ((error = bus_dmamem_alloc(sc->sc_dmat,
|
||||
EX_NUPD * sizeof (struct ex_upd), PAGE_SIZE, 0, &sc->sc_useg, 1,
|
||||
&sc->sc_urseg, BUS_DMA_NOWAIT)) != 0) {
|
||||
&sc->sc_urseg, BUS_DMA_NOWAIT)) != 0) {
|
||||
aprint_error_dev(sc->sc_dev,
|
||||
"can't allocate upload descriptors, error = %d\n", error);
|
||||
goto fail;
|
||||
|
@ -1935,7 +1935,7 @@ ex_mii_statchg(struct ifnet *ifp)
|
|||
else
|
||||
mctl &= ~MAC_CONTROL_FDX;
|
||||
bus_space_write_2(iot, ioh, ELINK_W3_MAC_CONTROL, mctl);
|
||||
GO_WINDOW(1); /* back to operating window */
|
||||
GO_WINDOW(1); /* back to operating window */
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hme.c,v 1.103 2019/05/23 10:51:39 msaitoh Exp $ */
|
||||
/* $NetBSD: hme.c,v 1.104 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -34,7 +34,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.103 2019/05/23 10:51:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.104 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
/* #define HMEDEBUG */
|
||||
|
||||
|
@ -929,7 +929,7 @@ hme_start(struct ifnet *ifp)
|
|||
+ start;
|
||||
txflags = HME_XD_TXCKSUM |
|
||||
(offset << HME_XD_TXCSSTUFFSHIFT) |
|
||||
(start << HME_XD_TXCSSTARTSHIFT);
|
||||
(start << HME_XD_TXCSSTARTSHIFT);
|
||||
} else
|
||||
#endif
|
||||
txflags = 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: i82586.c,v 1.82 2019/05/23 10:40:39 msaitoh Exp $ */
|
||||
/* $NetBSD: i82586.c,v 1.83 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -137,7 +137,7 @@ Mode of operation:
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.82 2019/05/23 10:40:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.83 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -200,7 +200,7 @@ static int i82586_start_cmd(struct ie_softc *, int, int, int, int);
|
|||
static int i82586_cmd_wait(struct ie_softc *);
|
||||
|
||||
#if I82586_DEBUG
|
||||
void print_rbd(struct ie_softc *, int);
|
||||
void print_rbd(struct ie_softc *, int);
|
||||
#endif
|
||||
|
||||
static char* padbuf = NULL;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: lan9118.c,v 1.32 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: lan9118.c,v 1.33 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2008 KIYOHARA Takashi
|
||||
* All rights reserved.
|
||||
|
@ -25,7 +25,7 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: lan9118.c,v 1.32 2019/05/23 10:57:28 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: lan9118.c,v 1.33 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
/*
|
||||
* The LAN9118 Family
|
||||
|
@ -402,7 +402,7 @@ lan9118_start(struct ifnet *ifp)
|
|||
/* Copy mbuf chain. */
|
||||
MGETHDR(m, M_DONTWAIT, MT_DATA);
|
||||
if (m == NULL)
|
||||
goto discard; /* discard packet */
|
||||
goto discard; /* discard packet */
|
||||
MCLGET(m, M_DONTWAIT);
|
||||
if ((m->m_flags & M_EXT) == 0) {
|
||||
m_freem(m);
|
||||
|
@ -597,9 +597,9 @@ lan9118_init(struct ifnet *ifp)
|
|||
bus_space_write_4(sc->sc_iot, sc->sc_ioh, LAN9118_HW_CFG, hw_cfg);
|
||||
|
||||
bus_space_write_4(sc->sc_iot, sc->sc_ioh, LAN9118_GPIO_CFG,
|
||||
LAN9118_GPIO_CFG_LEDX_EN(2) |
|
||||
LAN9118_GPIO_CFG_LEDX_EN(1) |
|
||||
LAN9118_GPIO_CFG_LEDX_EN(0) |
|
||||
LAN9118_GPIO_CFG_LEDX_EN(2) |
|
||||
LAN9118_GPIO_CFG_LEDX_EN(1) |
|
||||
LAN9118_GPIO_CFG_LEDX_EN(0) |
|
||||
LAN9118_GPIO_CFG_GPIOBUFN(2) |
|
||||
LAN9118_GPIO_CFG_GPIOBUFN(1) |
|
||||
LAN9118_GPIO_CFG_GPIOBUFN(0));
|
||||
|
@ -617,10 +617,10 @@ lan9118_init(struct ifnet *ifp)
|
|||
LAN9118_INT_PHY_INT | /* PHY */
|
||||
LAN9118_INT_PME_INT | /* Power Management Event */
|
||||
#endif
|
||||
LAN9118_INT_RXE | /* Receive Error */
|
||||
LAN9118_INT_TSFL | /* TX Status FIFO Level */
|
||||
LAN9118_INT_RXE | /* Receive Error */
|
||||
LAN9118_INT_TSFL | /* TX Status FIFO Level */
|
||||
LAN9118_INT_RXDF_INT| /* RX Dropped Frame Interrupt */
|
||||
LAN9118_INT_RSFF | /* RX Status FIFO Full */
|
||||
LAN9118_INT_RSFF | /* RX Status FIFO Full */
|
||||
LAN9118_INT_RSFL); /* RX Status FIFO Level */
|
||||
|
||||
bus_space_write_4(sc->sc_iot, sc->sc_ioh, LAN9118_RX_CFG,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: mb86950.c,v 1.30 2019/04/24 08:11:35 msaitoh Exp $ */
|
||||
/* $NetBSD: mb86950.c,v 1.31 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* All Rights Reserved, Copyright (C) Fujitsu Limited 1995
|
||||
|
@ -67,7 +67,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.30 2019/04/24 08:11:35 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.31 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
/*
|
||||
* Device driver for Fujitsu mb86950 based Ethernet cards.
|
||||
|
@ -303,7 +303,7 @@ mb86950_config(struct mb86950_softc *sc, int *media, int nmedia, int defmedia)
|
|||
sc->txb_size = 1024 * (2 << ((buf_config & 0x0c) ? (((buf_config & 0x0c) >> 2) - 1) : 0));
|
||||
sc->txb_free = (sc->txb_size * sc->txb_count) / 1500;
|
||||
|
||||
sc->rxb_size = ((8 << (buf_config & 3)) * 1024) - (sc->txb_size * sc->txb_count);
|
||||
sc->rxb_size = ((8 << (buf_config & 3)) * 1024) - (sc->txb_size * sc->txb_count);
|
||||
sc->rxb_max = sc->rxb_size / 64;
|
||||
|
||||
printf("mb86950: Buffer Size %dKB with %d transmit buffer(s) %dKB each.\n",
|
||||
|
@ -654,7 +654,7 @@ mb86950_put_fifo(struct mb86950_softc *sc, struct mbuf *m)
|
|||
/* The zero fill and last byte ought to be combined somehow */
|
||||
for (len = totlen + 1; len < (ETHER_MIN_LEN - ETHER_CRC_LEN);
|
||||
len += 2)
|
||||
bus_space_write_2(bst, bsh, BMPR_FIFO, 0);
|
||||
bus_space_write_2(bst, bsh, BMPR_FIFO, 0);
|
||||
/* XXX */
|
||||
|
||||
totlen = (ETHER_MIN_LEN - ETHER_CRC_LEN);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pdq_ifsubr.c,v 1.64 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: pdq_ifsubr.c,v 1.65 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 1996 Matt Thomas <matt@3am-software.com>
|
||||
|
@ -35,7 +35,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pdq_ifsubr.c,v 1.64 2019/05/23 10:57:28 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pdq_ifsubr.c,v 1.65 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
#ifdef __NetBSD__
|
||||
#include "opt_inet.h"
|
||||
|
@ -355,7 +355,7 @@ pdq_os_update_status(pdq_t *pdq, const void *arg)
|
|||
int media = 0;
|
||||
|
||||
switch (rsp->status_chars_get.pmd_type[0]) {
|
||||
case PDQ_PMD_TYPE_ANSI_MUTLI_MODE: media = IFM_FDDI_MMF; break;
|
||||
case PDQ_PMD_TYPE_ANSI_MUTLI_MODE: media = IFM_FDDI_MMF; break;
|
||||
case PDQ_PMD_TYPE_ANSI_SINGLE_MODE_TYPE_1: media = IFM_FDDI_SMF; break;
|
||||
case PDQ_PMD_TYPE_ANSI_SIGNLE_MODE_TYPE_2: media = IFM_FDDI_SMF; break;
|
||||
case PDQ_PMD_TYPE_UNSHIELDED_TWISTED_PAIR: media = IFM_FDDI_UTP; break;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rtw.c,v 1.131 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: rtw.c,v 1.132 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2004, 2005, 2006, 2007 David Young. All rights
|
||||
* reserved.
|
||||
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.131 2019/05/23 10:57:28 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.132 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -896,7 +896,7 @@ rtw_srom_parse(struct rtw_srom *sr, uint32_t *flags, uint8_t *cs_threshold,
|
|||
rfname = "RFMD RF2948B, " /* mentioned in Realtek docs */
|
||||
"LNA: RFMD RF2494, " /* mentioned in Realtek docs */
|
||||
"SYN: Silicon Labs Si4126"; /* inferred from
|
||||
* reference driver
|
||||
* reference driver
|
||||
*/
|
||||
paname = "RFMD RF2189"; /* mentioned in Realtek docs */
|
||||
break;
|
||||
|
@ -1130,7 +1130,7 @@ rtw_identify_sta(struct rtw_regs *regs, uint8_t (*addr)[IEEE80211_ADDR_LEN],
|
|||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
uint32_t idr0 = RTW_READ(regs, RTW_IDR0),
|
||||
idr1 = RTW_READ(regs, RTW_IDR1);
|
||||
idr1 = RTW_READ(regs, RTW_IDR1);
|
||||
|
||||
(*addr)[0] = __SHIFTOUT(idr0, __BITS(0, 7));
|
||||
(*addr)[1] = __SHIFTOUT(idr0, __BITS(8, 15));
|
||||
|
@ -1379,7 +1379,7 @@ rtw_rxdesc_init(struct rtw_rxdesc_blk *rdb, struct rtw_rxsoft *rs,
|
|||
#ifdef RTW_DEBUG
|
||||
RTW_DPRINTF(
|
||||
kick ? (RTW_DEBUG_RECV_DESC | RTW_DEBUG_IO_KICK)
|
||||
: RTW_DEBUG_RECV_DESC,
|
||||
: RTW_DEBUG_RECV_DESC,
|
||||
("%s: rd %p buf %08x -> %08x ctl %08x -> %08x\n", __func__, rd,
|
||||
le32toh(obuf), le32toh(rd->rd_buf), le32toh(octl),
|
||||
le32toh(rd->rd_ctl)));
|
||||
|
@ -1495,10 +1495,10 @@ rtw_intr_rx(struct rtw_softc *sc, uint16_t isr)
|
|||
break;
|
||||
}
|
||||
|
||||
/* ieee80211_input() might reset the receive engine
|
||||
* (e.g. by indirectly calling rtw_tune()), so save
|
||||
* the next pointer here and retrieve it again on
|
||||
* the next round.
|
||||
/* ieee80211_input() might reset the receive engine
|
||||
* (e.g. by indirectly calling rtw_tune()), so save
|
||||
* the next pointer here and retrieve it again on
|
||||
* the next round.
|
||||
*/
|
||||
rdb->rdb_next = (next + 1) % rdb->rdb_ndesc;
|
||||
|
||||
|
@ -2542,7 +2542,7 @@ rtw_tune(struct rtw_softc *sc)
|
|||
|
||||
if ((rc = rtw_phy_init(&sc->sc_regs, sc->sc_rf,
|
||||
rtw_chan2txpower(&sc->sc_srom, ic, ic->ic_curchan), sc->sc_csthr,
|
||||
ic->ic_curchan->ic_freq, antdiv, dflantb, RTW_ON)) != 0) {
|
||||
ic->ic_curchan->ic_freq, antdiv, dflantb, RTW_ON)) != 0) {
|
||||
/* XXX condition on powersaving */
|
||||
aprint_error_dev(sc->sc_dev, "phy init failed\n");
|
||||
}
|
||||
|
@ -2787,7 +2787,7 @@ rtw_init(struct ifnet *ifp)
|
|||
/* Cancel pending I/O and reset. */
|
||||
rtw_stop(ifp, 0);
|
||||
} else if (!pmf_device_resume(sc->sc_dev, &sc->sc_qual) ||
|
||||
!device_is_active(sc->sc_dev))
|
||||
!device_is_active(sc->sc_dev))
|
||||
return 0;
|
||||
|
||||
DPRINTF(sc, RTW_DEBUG_TUNE, ("%s: channel %d freq %d flags 0x%04x\n",
|
||||
|
@ -2879,13 +2879,13 @@ rtw_led_init(struct rtw_regs *regs)
|
|||
}
|
||||
|
||||
/*
|
||||
* IEEE80211_S_INIT: LED1 off
|
||||
* IEEE80211_S_INIT: LED1 off
|
||||
*
|
||||
* IEEE80211_S_AUTH,
|
||||
* IEEE80211_S_ASSOC,
|
||||
* IEEE80211_S_SCAN: LED1 blinks @ 1 Hz, blinks at 5Hz for tx/rx
|
||||
* IEEE80211_S_SCAN: LED1 blinks @ 1 Hz, blinks at 5Hz for tx/rx
|
||||
*
|
||||
* IEEE80211_S_RUN: LED1 on, blinks @ 5Hz for tx/rx
|
||||
* IEEE80211_S_RUN: LED1 on, blinks @ 5Hz for tx/rx
|
||||
*/
|
||||
static void
|
||||
rtw_led_newstate(struct rtw_softc *sc, enum ieee80211_state nstate)
|
||||
|
@ -3147,14 +3147,14 @@ rtw_dequeue(struct ifnet *ifp, struct rtw_txsoft_blk **tsbp,
|
|||
|
||||
if (sc->sc_ic.ic_state == IEEE80211_S_RUN &&
|
||||
(*mp = rtw_80211_dequeue(sc, &sc->sc_beaconq, RTW_TXPRIBCN, tsbp,
|
||||
tdbp, nip, if_flagsp)) != NULL) {
|
||||
tdbp, nip, if_flagsp)) != NULL) {
|
||||
DPRINTF(sc, RTW_DEBUG_XMIT, ("%s: dequeue beacon frame\n",
|
||||
__func__));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((*mp = rtw_80211_dequeue(sc, &sc->sc_ic.ic_mgtq, RTW_TXPRIMD, tsbp,
|
||||
tdbp, nip, if_flagsp)) != NULL) {
|
||||
tdbp, nip, if_flagsp)) != NULL) {
|
||||
DPRINTF(sc, RTW_DEBUG_XMIT, ("%s: dequeue mgt frame\n",
|
||||
__func__));
|
||||
return 0;
|
||||
|
@ -3382,7 +3382,7 @@ rtw_start(struct ifnet *ifp)
|
|||
(IFF_DEBUG | IFF_LINK2)) {
|
||||
ieee80211_dump_pkt(mtod(m0, uint8_t *),
|
||||
(dmamap->dm_nsegs == 1) ? m0->m_pkthdr.len
|
||||
: sizeof(wh),
|
||||
: sizeof(wh),
|
||||
rate, 0);
|
||||
}
|
||||
#endif /* RTW_DEBUG */
|
||||
|
@ -3408,9 +3408,9 @@ rtw_start(struct ifnet *ifp)
|
|||
if (m0->m_pkthdr.len > ic->ic_rtsthreshold)
|
||||
ctl0 |= RTW_TXCTL0_RTSEN;
|
||||
|
||||
/* XXX Sometimes writes a bogus keyid; h/w doesn't
|
||||
* seem to care, since we don't activate h/w Tx
|
||||
* encryption.
|
||||
/* XXX Sometimes writes a bogus keyid; h/w doesn't
|
||||
* seem to care, since we don't activate h/w Tx
|
||||
* encryption.
|
||||
*/
|
||||
if (k != NULL &&
|
||||
k->wk_cipher->ic_cipher == IEEE80211_CIPHER_WEP) {
|
||||
|
@ -4151,7 +4151,7 @@ rtw_attach(struct rtw_softc *sc)
|
|||
|
||||
NEXT_ATTACH_STATE(sc, FINISH_TXMAPS_CREATE);
|
||||
if ((rc = rtw_rxdesc_dmamaps_create(sc->sc_dmat, &sc->sc_rxsoft[0],
|
||||
RTW_RXQLEN)) != 0) {
|
||||
RTW_RXQLEN)) != 0) {
|
||||
aprint_error_dev(sc->sc_dev,
|
||||
"could not load DMA map for hw rx descriptors, error %d\n",
|
||||
rc);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: seeq8005.c,v 1.62 2019/05/23 10:40:39 msaitoh Exp $ */
|
||||
/* $NetBSD: seeq8005.c,v 1.63 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000, 2001 Ben Harris
|
||||
|
@ -61,7 +61,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: seeq8005.c,v 1.62 2019/05/23 10:40:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: seeq8005.c,v 1.63 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -409,7 +409,7 @@ ea_stoptx(struct seeq8005_softc *sc)
|
|||
status = SEEQ_READ16(sc, iot, ioh, SEEQ_STATUS);
|
||||
delay(1);
|
||||
} while ((status & SEEQ_STATUS_TX_ON) && --timeout > 0);
|
||||
if (timeout == 0)
|
||||
if (timeout == 0)
|
||||
log(LOG_ERR, "%s: timeout waiting for tx termination\n",
|
||||
device_xname(sc->sc_dev));
|
||||
|
||||
|
@ -1256,49 +1256,49 @@ ea_read(struct seeq8005_softc *sc, int addr, int len)
|
|||
struct mbuf *
|
||||
ea_get(struct seeq8005_softc *sc, int addr, int totlen, struct ifnet *ifp)
|
||||
{
|
||||
struct mbuf *top, **mp, *m;
|
||||
int len;
|
||||
u_int cp, epkt;
|
||||
struct mbuf *top, **mp, *m;
|
||||
int len;
|
||||
u_int cp, epkt;
|
||||
|
||||
cp = addr;
|
||||
epkt = cp + totlen;
|
||||
cp = addr;
|
||||
epkt = cp + totlen;
|
||||
|
||||
MGETHDR(m, M_DONTWAIT, MT_DATA);
|
||||
if (m == NULL)
|
||||
return NULL;
|
||||
m_set_rcvif(m, ifp);
|
||||
m->m_pkthdr.len = totlen;
|
||||
m->m_len = MHLEN;
|
||||
top = NULL;
|
||||
mp = ⊤
|
||||
MGETHDR(m, M_DONTWAIT, MT_DATA);
|
||||
if (m == NULL)
|
||||
return NULL;
|
||||
m_set_rcvif(m, ifp);
|
||||
m->m_pkthdr.len = totlen;
|
||||
m->m_len = MHLEN;
|
||||
top = NULL;
|
||||
mp = ⊤
|
||||
|
||||
while (totlen > 0) {
|
||||
if (top) {
|
||||
MGET(m, M_DONTWAIT, MT_DATA);
|
||||
if (m == NULL) {
|
||||
m_freem(top);
|
||||
return NULL;
|
||||
}
|
||||
m->m_len = MLEN;
|
||||
}
|
||||
len = uimin(totlen, epkt - cp);
|
||||
if (len >= MINCLSIZE) {
|
||||
MCLGET(m, M_DONTWAIT);
|
||||
if (m->m_flags & M_EXT)
|
||||
m->m_len = len = uimin(len, MCLBYTES);
|
||||
else
|
||||
len = m->m_len;
|
||||
} else {
|
||||
/*
|
||||
* Place initial small packet/header at end of mbuf.
|
||||
*/
|
||||
if (len < m->m_len) {
|
||||
if (top == NULL && len + max_linkhdr <= m->m_len)
|
||||
m->m_data += max_linkhdr;
|
||||
m->m_len = len;
|
||||
} else
|
||||
len = m->m_len;
|
||||
}
|
||||
while (totlen > 0) {
|
||||
if (top) {
|
||||
MGET(m, M_DONTWAIT, MT_DATA);
|
||||
if (m == NULL) {
|
||||
m_freem(top);
|
||||
return NULL;
|
||||
}
|
||||
m->m_len = MLEN;
|
||||
}
|
||||
len = uimin(totlen, epkt - cp);
|
||||
if (len >= MINCLSIZE) {
|
||||
MCLGET(m, M_DONTWAIT);
|
||||
if (m->m_flags & M_EXT)
|
||||
m->m_len = len = uimin(len, MCLBYTES);
|
||||
else
|
||||
len = m->m_len;
|
||||
} else {
|
||||
/*
|
||||
* Place initial small packet/header at end of mbuf.
|
||||
*/
|
||||
if (len < m->m_len) {
|
||||
if (top == NULL && len + max_linkhdr <= m->m_len)
|
||||
m->m_data += max_linkhdr;
|
||||
m->m_len = len;
|
||||
} else
|
||||
len = m->m_len;
|
||||
}
|
||||
if (top == NULL) {
|
||||
/* Make sure the payload is aligned */
|
||||
char *newdata = (char *)
|
||||
|
@ -1309,18 +1309,18 @@ ea_get(struct seeq8005_softc *sc, int addr, int totlen, struct ifnet *ifp)
|
|||
m->m_len = len;
|
||||
m->m_data = newdata;
|
||||
}
|
||||
ea_readbuf(sc, mtod(m, u_char *),
|
||||
ea_readbuf(sc, mtod(m, u_char *),
|
||||
cp < SEEQ_MAX_BUFFER_SIZE ? cp : cp - sc->sc_rx_bufsize,
|
||||
len);
|
||||
cp += len;
|
||||
*mp = m;
|
||||
mp = &m->m_next;
|
||||
totlen -= len;
|
||||
if (cp == epkt)
|
||||
cp = addr;
|
||||
}
|
||||
cp += len;
|
||||
*mp = m;
|
||||
mp = &m->m_next;
|
||||
totlen -= len;
|
||||
if (cp == epkt)
|
||||
cp = addr;
|
||||
}
|
||||
|
||||
return top;
|
||||
return top;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1375,10 +1375,10 @@ ea_mc_reset_8004(struct seeq8005_softc *sc)
|
|||
struct ethercom *ec = &sc->sc_ethercom;
|
||||
struct ifnet *ifp = &ec->ec_if;
|
||||
struct ether_multi *enm;
|
||||
uint32_t crc;
|
||||
int i;
|
||||
struct ether_multistep step;
|
||||
uint8_t af[8];
|
||||
uint32_t crc;
|
||||
int i;
|
||||
struct ether_multistep step;
|
||||
uint8_t af[8];
|
||||
|
||||
/*
|
||||
* Set up multicast address filter by passing all multicast addresses
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sgec.c,v 1.49 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: sgec.c,v 1.50 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
|
||||
*
|
||||
|
@ -39,7 +39,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: sgec.c,v 1.49 2019/05/23 10:57:28 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: sgec.c,v 1.50 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
|
@ -90,9 +90,9 @@ sgec_attach(struct ze_softc *sc)
|
|||
bus_dma_segment_t seg;
|
||||
int i, rseg, error;
|
||||
|
||||
/*
|
||||
* Allocate DMA safe memory for descriptors and setup memory.
|
||||
*/
|
||||
/*
|
||||
* Allocate DMA safe memory for descriptors and setup memory.
|
||||
*/
|
||||
error = bus_dmamem_alloc(sc->sc_dmat, sizeof(struct ze_cdata),
|
||||
PAGE_SIZE, 0, &seg, 1, &rseg, BUS_DMA_NOWAIT);
|
||||
if (error) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: smc83c170.c,v 1.88 2019/05/23 10:51:39 msaitoh Exp $ */
|
||||
/* $NetBSD: smc83c170.c,v 1.89 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -36,7 +36,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.88 2019/05/23 10:51:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.89 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -216,7 +216,7 @@ epic_attach(struct epic_softc *sc)
|
|||
*/
|
||||
epic_read_eeprom(sc, 0, __arraycount(myea), myea);
|
||||
for (i = 0; i < __arraycount(myea); i++) {
|
||||
enaddr[i * 2] = myea[i] & 0xff;
|
||||
enaddr[i * 2] = myea[i] & 0xff;
|
||||
enaddr[i * 2 + 1] = myea[i] >> 8;
|
||||
}
|
||||
|
||||
|
@ -225,7 +225,7 @@ epic_attach(struct epic_softc *sc)
|
|||
*/
|
||||
epic_read_eeprom(sc, 0x2c, __arraycount(mydevname), mydevname);
|
||||
for (i = 0; i < __arraycount(mydevname); i++) {
|
||||
devname[i * 2] = mydevname[i] & 0xff;
|
||||
devname[i * 2] = mydevname[i] & 0xff;
|
||||
devname[i * 2 + 1] = mydevname[i] >> 8;
|
||||
}
|
||||
|
||||
|
@ -398,7 +398,7 @@ epic_start(struct ifnet *ifp)
|
|||
/*
|
||||
* Load the DMA map. If this fails, the packet either
|
||||
* didn't fit in the alloted number of frags, or we were
|
||||
* short on resources. In this case, we'll copy and try
|
||||
* short on resources. In this case, we'll copy and try
|
||||
* again.
|
||||
*/
|
||||
if ((error = bus_dmamap_load_mbuf(sc->sc_dmat, dmamap, m0,
|
||||
|
@ -504,7 +504,7 @@ epic_start(struct ifnet *ifp)
|
|||
|
||||
if (sc->sc_txpending != opending) {
|
||||
/*
|
||||
* We enqueued packets. If the transmitter was idle,
|
||||
* We enqueued packets. If the transmitter was idle,
|
||||
* reset the txdirty pointer.
|
||||
*/
|
||||
if (opending == 0)
|
||||
|
@ -566,7 +566,7 @@ epic_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
|||
if (error == ENETRESET) {
|
||||
/*
|
||||
* Multicast list has changed; set the hardware filter
|
||||
* accordingly. Update our idea of the current media;
|
||||
* accordingly. Update our idea of the current media;
|
||||
* epic_set_mchash() needs to know what it is.
|
||||
*/
|
||||
if (ifp->if_flags & IFF_RUNNING) {
|
||||
|
@ -633,7 +633,7 @@ epic_intr(void *arg)
|
|||
}
|
||||
|
||||
/*
|
||||
* Make sure the packet arrived intact. If an error
|
||||
* Make sure the packet arrived intact. If an error
|
||||
* occurred, update stats and reset the descriptor.
|
||||
* The buffer will be reused the next time the
|
||||
* descriptor comes up in the ring.
|
||||
|
@ -949,7 +949,7 @@ epic_init(struct ifnet *ifp)
|
|||
bus_space_write_4(st, sh, EPIC_LAN2, reg0);
|
||||
|
||||
/*
|
||||
* Initialize receive control. Remember the external buffer
|
||||
* Initialize receive control. Remember the external buffer
|
||||
* size setting.
|
||||
*/
|
||||
reg0 = bus_space_read_4(st, sh, EPIC_RXCON) &
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: tulip.c,v 1.194 2019/05/23 10:51:39 msaitoh Exp $ */
|
||||
/* $NetBSD: tulip.c,v 1.195 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
|
||||
|
@ -36,7 +36,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.194 2019/05/23 10:51:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.195 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -464,7 +464,7 @@ tlp_attach(struct tulip_softc *sc, const uint8_t *enaddr)
|
|||
for (i = 0; i < TULIP_NRXDESC; i++) {
|
||||
if ((error = bus_dmamap_create(sc->sc_dmat, MCLBYTES, 1,
|
||||
MCLBYTES, 0, 0, &sc->sc_rxsoft[i].rxs_dmamap)) != 0) {
|
||||
sc->sc_rxsoft[i].rxs_dmamap = NULL;
|
||||
sc->sc_rxsoft[i].rxs_dmamap = NULL;
|
||||
aprint_error_dev(self,
|
||||
"unable to create rx DMA map %d, error = %d\n", i,
|
||||
error);
|
||||
|
@ -816,7 +816,7 @@ tlp_start(struct ifnet *ifp)
|
|||
htole32(dmamap->dm_segs[seg].ds_addr);
|
||||
txd->td_ctl =
|
||||
htole32((dmamap->dm_segs[seg].ds_len <<
|
||||
TDCTL_SIZE1_SHIFT) | sc->sc_tdctl_ch |
|
||||
TDCTL_SIZE1_SHIFT) | sc->sc_tdctl_ch |
|
||||
(nexttx == (TULIP_NTXDESC - 1) ?
|
||||
sc->sc_tdctl_er : 0));
|
||||
lasttx = nexttx;
|
||||
|
@ -1826,7 +1826,7 @@ tlp_init(struct ifnet *ifp)
|
|||
* Initialize the interrupt mask and enable interrupts.
|
||||
*/
|
||||
/* normal interrupts */
|
||||
sc->sc_inten = STATUS_TI | STATUS_TU | STATUS_RI | STATUS_NIS;
|
||||
sc->sc_inten = STATUS_TI | STATUS_TU | STATUS_RI | STATUS_NIS;
|
||||
|
||||
/* abnormal interrupts */
|
||||
sc->sc_inten |= STATUS_TPS | STATUS_TJT | STATUS_UNF |
|
||||
|
@ -6118,8 +6118,8 @@ tlp_asix_tmsw_init(struct tulip_softc *sc)
|
|||
uint32_t opmode;
|
||||
|
||||
mii->mii_ifp = ifp;
|
||||
mii->mii_readreg = tlp_bitbang_mii_readreg;
|
||||
mii->mii_writereg = tlp_bitbang_mii_writereg;
|
||||
mii->mii_readreg = tlp_bitbang_mii_readreg;
|
||||
mii->mii_writereg = tlp_bitbang_mii_writereg;
|
||||
mii->mii_statchg = sc->sc_statchg;
|
||||
sc->sc_ethercom.ec_mii = mii;
|
||||
ifmedia_init(&mii->mii_media, 0, tlp_mediachange, tlp_mediastatus);
|
||||
|
@ -6132,10 +6132,10 @@ tlp_asix_tmsw_init(struct tulip_softc *sc)
|
|||
case TULIP_CHIP_AX88141:
|
||||
opmode = OPMODE_HBD | OPMODE_PS;
|
||||
break;
|
||||
default:
|
||||
opmode = 0;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
opmode = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
TULIP_WRITE(sc, CSR_OPMODE, opmode);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: wi.c,v 1.251 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: wi.c,v 1.252 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2004 The NetBSD Foundation, Inc.
|
||||
|
@ -99,7 +99,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.251 2019/05/23 10:57:28 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.252 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
#define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */
|
||||
#define WI_HERMES_STATS_WAR /* Work around stats counter bug. */
|
||||
|
@ -363,10 +363,10 @@ wi_attach(struct wi_softc *sc, const uint8_t *macaddr)
|
|||
struct ifnet *ifp = &sc->sc_if;
|
||||
int chan, nrate, buflen;
|
||||
uint16_t val, chanavail;
|
||||
struct {
|
||||
uint16_t nrates;
|
||||
char rates[IEEE80211_RATE_SIZE];
|
||||
} ratebuf;
|
||||
struct {
|
||||
uint16_t nrates;
|
||||
char rates[IEEE80211_RATE_SIZE];
|
||||
} ratebuf;
|
||||
static const uint8_t empty_macaddr[IEEE80211_ADDR_LEN] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
@ -429,7 +429,7 @@ wi_attach(struct wi_softc *sc, const uint8_t *macaddr)
|
|||
|
||||
/* Find available channel */
|
||||
if (wi_read_xrid(sc, WI_RID_CHANNEL_LIST, &chanavail,
|
||||
sizeof(chanavail)) != 0) {
|
||||
sizeof(chanavail)) != 0) {
|
||||
aprint_normal_dev(sc->sc_dev, "using default channel list\n");
|
||||
chanavail = htole16(0x1fff); /* assume 1-13 */
|
||||
}
|
||||
|
@ -1165,7 +1165,7 @@ wi_start(struct ifnet *ifp)
|
|||
m_copydata(m0, 4, ETHER_ADDR_LEN * 2,
|
||||
(void *)&frmhdr.wi_ehdr);
|
||||
frmhdr.wi_ehdr.ether_type = 0;
|
||||
wh = mtod(m0, struct ieee80211_frame *);
|
||||
wh = mtod(m0, struct ieee80211_frame *);
|
||||
ni = M_GETCTX(m0, struct ieee80211_node *);
|
||||
M_CLEARCTX(m0);
|
||||
} else if (ic->ic_state == IEEE80211_S_RUN) {
|
||||
|
@ -1622,7 +1622,7 @@ wi_sync_bssid(struct wi_softc *sc, uint8_t new_bssid[IEEE80211_ADDR_LEN])
|
|||
*/
|
||||
if ((ifp->if_flags & IFF_PROMISC) != 0 &&
|
||||
!ppsratecheck(&sc->sc_last_syn, &sc->sc_false_syns,
|
||||
WI_MAX_FALSE_SYNS))
|
||||
WI_MAX_FALSE_SYNS))
|
||||
return;
|
||||
|
||||
sc->sc_false_syns = MAX(0, sc->sc_false_syns - 1);
|
||||
|
@ -1634,7 +1634,7 @@ wi_sync_bssid(struct wi_softc *sc, uint8_t new_bssid[IEEE80211_ADDR_LEN])
|
|||
* called and it will overwrite the node state.
|
||||
*/
|
||||
s = splnet();
|
||||
ieee80211_sta_join(ic, ieee80211_ref_node(ni));
|
||||
ieee80211_sta_join(ic, ieee80211_ref_node(ni));
|
||||
splx(s);
|
||||
}
|
||||
|
||||
|
@ -1979,7 +1979,7 @@ wi_tx_intr(struct wi_softc *sc)
|
|||
fid = CSR_READ_2(sc, WI_TX_CMP_FID);
|
||||
/* Read in the frame header */
|
||||
if (wi_read_bap(sc, fid, offsetof(struct wi_frame, wi_tx_swsup2),
|
||||
&frmhdr.wi_tx_swsup2, 2) != 0) {
|
||||
&frmhdr.wi_tx_swsup2, 2) != 0) {
|
||||
aprint_error_dev(sc->sc_dev, "%s read fid %x failed\n",
|
||||
__func__, fid);
|
||||
wi_rssdescs_reset(ic, &sc->sc_rssd, &sc->sc_rssdfree,
|
||||
|
@ -2399,7 +2399,7 @@ wi_set_cfg(struct ifnet *ifp, u_long cmd, void *data)
|
|||
return error;
|
||||
len = (wreq.wi_len - 1) * 2;
|
||||
switch (wreq.wi_type) {
|
||||
case WI_RID_MAC_NODE:
|
||||
case WI_RID_MAC_NODE:
|
||||
/* XXX convert to SIOCALIFADDR, AF_LINK, IFLR_ACTIVE */
|
||||
(void)memcpy(ic->ic_myaddr, wreq.wi_val, ETHER_ADDR_LEN);
|
||||
if_set_sadl(ifp, ic->ic_myaddr, ETHER_ADDR_LEN, false);
|
||||
|
@ -2793,7 +2793,7 @@ wi_cmd_start(struct wi_softc *sc, int cmd, int val0, int val1, int val2)
|
|||
if (i == 0) {
|
||||
aprint_error_dev(sc->sc_dev, "wi_cmd: busy bit won't clear.\n");
|
||||
return (ETIMEDOUT);
|
||||
}
|
||||
}
|
||||
#ifdef WI_HISTOGRAM
|
||||
if (i > 490)
|
||||
hist1[500 - i]++;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_iy.c,v 1.106 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: if_iy.c,v 1.107 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
/* #define IYDEBUG */
|
||||
/* #define IYMEMDEBUG */
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1.106 2019/05/23 10:57:28 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1.107 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
|
@ -327,12 +327,12 @@ iyattach(device_t parent, device_t self, void *aux)
|
|||
aprint_error("EEPROM Ethernet address differs from copy\n");
|
||||
#endif
|
||||
|
||||
myaddr[1] = eaddr[EEPPEther0] & 0xFF;
|
||||
myaddr[0] = eaddr[EEPPEther0] >> 8;
|
||||
myaddr[3] = eaddr[EEPPEther1] & 0xFF;
|
||||
myaddr[2] = eaddr[EEPPEther1] >> 8;
|
||||
myaddr[5] = eaddr[EEPPEther2] & 0xFF;
|
||||
myaddr[4] = eaddr[EEPPEther2] >> 8;
|
||||
myaddr[1] = eaddr[EEPPEther0] & 0xFF;
|
||||
myaddr[0] = eaddr[EEPPEther0] >> 8;
|
||||
myaddr[3] = eaddr[EEPPEther1] & 0xFF;
|
||||
myaddr[2] = eaddr[EEPPEther1] >> 8;
|
||||
myaddr[5] = eaddr[EEPPEther2] & 0xFF;
|
||||
myaddr[4] = eaddr[EEPPEther2] >> 8;
|
||||
|
||||
ifmedia_init(&sc->iy_ifmedia, 0, iy_mediachange, iy_mediastatus);
|
||||
ifmedia_add(&sc->iy_ifmedia, IFM_ETHER | IFM_10_2, 0, NULL);
|
||||
|
@ -637,7 +637,7 @@ iystart(struct ifnet *ifp)
|
|||
sc = ifp->if_softc;
|
||||
|
||||
if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
|
||||
return;
|
||||
return;
|
||||
|
||||
iy_intr_tx(sc);
|
||||
|
||||
|
@ -667,13 +667,13 @@ iystart(struct ifnet *ifp)
|
|||
pad = ETHER_MIN_LEN - ETHER_CRC_LEN - len;
|
||||
}
|
||||
|
||||
if (len + pad > ETHER_MAX_LEN) {
|
||||
/* packet is obviously too large: toss it */
|
||||
++ifp->if_oerrors;
|
||||
IFQ_DEQUEUE(&ifp->if_snd, m0);
|
||||
m_freem(m0);
|
||||
if (len + pad > ETHER_MAX_LEN) {
|
||||
/* packet is obviously too large: toss it */
|
||||
++ifp->if_oerrors;
|
||||
IFQ_DEQUEUE(&ifp->if_snd, m0);
|
||||
m_freem(m0);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
bpf_mtap(ifp, m0, BPF_D_OUT);
|
||||
|
||||
|
@ -689,7 +689,7 @@ iystart(struct ifnet *ifp)
|
|||
* XXX todo: or even turn off the boards ints ??? hm...
|
||||
*/
|
||||
|
||||
/* See if there is room to put another packet in the buffer. */
|
||||
/* See if there is room to put another packet in the buffer. */
|
||||
|
||||
if ((len+pad+2*I595_XMT_HDRLEN) > avail) {
|
||||
#ifdef IYDEBUG
|
||||
|
@ -704,7 +704,7 @@ iystart(struct ifnet *ifp)
|
|||
|
||||
temp = bus_space_read_1(iot, ioh, REG1);
|
||||
bus_space_write_1(iot, ioh, REG1,
|
||||
temp & ~XMT_CHAIN_INT);
|
||||
temp & ~XMT_CHAIN_INT);
|
||||
|
||||
bus_space_write_1(iot, ioh, 0, BANK_SEL(0));
|
||||
|
||||
|
@ -1349,7 +1349,7 @@ iy_mc_setup(struct iy_softc *sc)
|
|||
bus_space_write_1(iot, ioh, 0, MC_SETUP_CMD);
|
||||
|
||||
|
||||
sc->tx_start = sc->rx_size;
|
||||
sc->tx_start = sc->rx_size;
|
||||
sc->tx_end = sc->rx_size + I595_XMT_HDRLEN + len;
|
||||
|
||||
for (timeout=0; timeout<100; timeout++) {
|
||||
|
@ -1414,7 +1414,7 @@ iy_mc_reset(struct iy_softc *sc)
|
|||
!= IFF_RUNNING) {
|
||||
ifp->if_flags |= IFF_OACTIVE;
|
||||
sc->want_mc_setup = 1;
|
||||
return;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
iy_mc_setup(sc);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_gfe.c,v 1.52 2019/05/23 10:40:39 msaitoh Exp $ */
|
||||
/* $NetBSD: if_gfe.c,v 1.53 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
|
||||
|
@ -42,7 +42,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.52 2019/05/23 10:40:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.53 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
|
@ -1751,16 +1751,16 @@ gfe_hash_compute(struct gfe_softc *sc, const uint8_t eaddr[ETHER_ADDR_LEN])
|
|||
uint32_t result;
|
||||
|
||||
GE_FUNC_ENTER(sc, "gfe_hash_compute");
|
||||
add0 = ((uint32_t) eaddr[5] << 0) |
|
||||
((uint32_t) eaddr[4] << 8) |
|
||||
add0 = ((uint32_t) eaddr[5] << 0) |
|
||||
((uint32_t) eaddr[4] << 8) |
|
||||
((uint32_t) eaddr[3] << 16);
|
||||
|
||||
add0 = ((add0 & 0x00f0f0f0) >> 4) | ((add0 & 0x000f0f0f) << 4);
|
||||
add0 = ((add0 & 0x00cccccc) >> 2) | ((add0 & 0x00333333) << 2);
|
||||
add0 = ((add0 & 0x00aaaaaa) >> 1) | ((add0 & 0x00555555) << 1);
|
||||
|
||||
add1 = ((uint32_t) eaddr[2] << 0) |
|
||||
((uint32_t) eaddr[1] << 8) |
|
||||
add1 = ((uint32_t) eaddr[2] << 0) |
|
||||
((uint32_t) eaddr[1] << 8) |
|
||||
((uint32_t) eaddr[0] << 16);
|
||||
|
||||
add1 = ((add1 & 0x00f0f0f0) >> 4) | ((add1 & 0x000f0f0f) << 4);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_mvgbe.c,v 1.55 2019/05/23 10:51:39 msaitoh Exp $ */
|
||||
/* $NetBSD: if_mvgbe.c,v 1.56 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2007, 2008, 2013 KIYOHARA Takashi
|
||||
* All rights reserved.
|
||||
|
@ -25,7 +25,7 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.55 2019/05/23 10:51:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.56 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
#include "opt_multiprocessor.h"
|
||||
|
||||
|
@ -779,11 +779,11 @@ mvgbe_attach(device_t parent, device_t self, void *aux)
|
|||
|
||||
if (enaddrp) {
|
||||
memcpy(enaddr, prop_data_data_nocopy(enaddrp), ETHER_ADDR_LEN);
|
||||
maddrh = enaddr[0] << 24;
|
||||
maddrh = enaddr[0] << 24;
|
||||
maddrh |= enaddr[1] << 16;
|
||||
maddrh |= enaddr[2] << 8;
|
||||
maddrh |= enaddr[3];
|
||||
maddrl = enaddr[4] << 8;
|
||||
maddrl = enaddr[4] << 8;
|
||||
maddrl |= enaddr[5];
|
||||
MVGBE_WRITE(sc, MVGBE_MACAH, maddrh);
|
||||
MVGBE_WRITE(sc, MVGBE_MACAL, maddrl);
|
||||
|
@ -1345,8 +1345,8 @@ mvgbe_stop(struct ifnet *ifp, int disable)
|
|||
txfifoemp = MVGBE_PS_TXFIFOEMP;
|
||||
}
|
||||
|
||||
#define RX_DISABLE_TIMEOUT 0x1000000
|
||||
#define TX_FIFO_EMPTY_TIMEOUT 0x1000000
|
||||
#define RX_DISABLE_TIMEOUT 0x1000000
|
||||
#define TX_FIFO_EMPTY_TIMEOUT 0x1000000
|
||||
/* Wait for all Rx activity to terminate. */
|
||||
cnt = 0;
|
||||
do {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_mvxpe.c,v 1.24 2019/05/23 10:51:39 msaitoh Exp $ */
|
||||
/* $NetBSD: if_mvxpe.c,v 1.25 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2015 Internet Initiative Japan Inc.
|
||||
* All rights reserved.
|
||||
|
@ -25,7 +25,7 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_mvxpe.c,v 1.24 2019/05/23 10:51:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_mvxpe.c,v 1.25 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
#include "opt_multiprocessor.h"
|
||||
|
||||
|
@ -1138,7 +1138,7 @@ mvxpe_ring_init_queue(struct mvxpe_softc *sc, int q)
|
|||
tx->tx_queue_len = tx_default_queue_len[q];
|
||||
if (tx->tx_queue_len > MVXPE_TX_RING_CNT)
|
||||
tx->tx_queue_len = MVXPE_TX_RING_CNT;
|
||||
tx->tx_used = 0;
|
||||
tx->tx_used = 0;
|
||||
tx->tx_queue_th_free = tx->tx_queue_len / MVXPE_TXTH_RATIO;
|
||||
}
|
||||
|
||||
|
@ -1175,7 +1175,7 @@ mvxpe_ring_flush_queue(struct mvxpe_softc *sc, int q)
|
|||
m_freem(m);
|
||||
}
|
||||
tx->tx_dma = tx->tx_cpu = 0;
|
||||
tx->tx_used = 0;
|
||||
tx->tx_used = 0;
|
||||
}
|
||||
|
||||
STATIC void
|
||||
|
@ -2216,7 +2216,7 @@ mvxpe_tx_set_csumflag(struct ifnet *ifp,
|
|||
int csum_flags;
|
||||
uint32_t iphl = 0, ipoff = 0;
|
||||
|
||||
csum_flags = ifp->if_csum_flags_tx & m->m_pkthdr.csum_flags;
|
||||
csum_flags = ifp->if_csum_flags_tx & m->m_pkthdr.csum_flags;
|
||||
|
||||
eh = mtod(m, struct ether_header *);
|
||||
switch (htons(eh->ether_type)) {
|
||||
|
@ -2773,7 +2773,7 @@ set:
|
|||
}
|
||||
}
|
||||
else {
|
||||
i = sc->sc_enaddr[5] & 0xf; /* last nibble */
|
||||
i = sc->sc_enaddr[5] & 0xf; /* last nibble */
|
||||
dfut[i>>2] = MVXPE_DF(i&3, MVXPE_DF_QUEUE(0) | MVXPE_DF_PASS);
|
||||
}
|
||||
MVXPE_WRITE_REGION(sc, MVXPE_DFUT(0), dfut, MVXPE_NDFUT);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_age.c,v 1.57 2019/05/23 10:51:39 msaitoh Exp $ */
|
||||
/* $NetBSD: if_age.c,v 1.58 2019/05/23 13:10:51 msaitoh Exp $ */
|
||||
/* $OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -31,7 +31,7 @@
|
|||
/* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.57 2019/05/23 10:51:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.58 2019/05/23 13:10:51 msaitoh Exp $");
|
||||
|
||||
#include "vlan.h"
|
||||
|
||||
|
@ -161,11 +161,11 @@ age_attach(device_t parent, device_t self, void *aux)
|
|||
*/
|
||||
memtype = pci_mapreg_type(sc->sc_pct, sc->sc_pcitag, AGE_PCIR_BAR);
|
||||
switch (memtype) {
|
||||
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT:
|
||||
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT_1M:
|
||||
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:
|
||||
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT:
|
||||
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT_1M:
|
||||
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
aprint_error_dev(self, "invalid base address register\n");
|
||||
break;
|
||||
}
|
||||
|
@ -370,7 +370,7 @@ age_miibus_readreg(device_t dev, int phy, int reg, uint16_t *val)
|
|||
}
|
||||
|
||||
/*
|
||||
* Write a PHY register on the MII of the L1.
|
||||
* Write a PHY register on the MII of the L1.
|
||||
*/
|
||||
static int
|
||||
age_miibus_writereg(device_t dev, int phy, int reg, uint16_t val)
|
||||
|
@ -483,10 +483,10 @@ age_mediachange(struct ifnet *ifp)
|
|||
static int
|
||||
age_intr(void *arg)
|
||||
{
|
||||
struct age_softc *sc = arg;
|
||||
struct ifnet *ifp = &sc->sc_ec.ec_if;
|
||||
struct age_softc *sc = arg;
|
||||
struct ifnet *ifp = &sc->sc_ec.ec_if;
|
||||
struct cmb *cmb;
|
||||
uint32_t status;
|
||||
uint32_t status;
|
||||
|
||||
status = CSR_READ_4(sc, AGE_INTR_STATUS);
|
||||
if (status == 0 || (status & AGE_INTRS) == 0)
|
||||
|
@ -1024,8 +1024,8 @@ age_dma_free(struct age_softc *sc)
|
|||
static void
|
||||
age_start(struct ifnet *ifp)
|
||||
{
|
||||
struct age_softc *sc = ifp->if_softc;
|
||||
struct mbuf *m_head;
|
||||
struct age_softc *sc = ifp->if_softc;
|
||||
struct mbuf *m_head;
|
||||
int enq;
|
||||
|
||||
if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
|
||||
|
@ -1214,7 +1214,7 @@ age_encap(struct age_softc *sc, struct mbuf **m_head)
|
|||
}
|
||||
|
||||
error = bus_dmamap_load_mbuf(sc->sc_dmat, map, *m_head,
|
||||
BUS_DMA_NOWAIT);
|
||||
BUS_DMA_NOWAIT);
|
||||
|
||||
if (error != 0) {
|
||||
printf("%s: could not load defragged TX mbuf\n",
|
||||
|
@ -1628,11 +1628,11 @@ age_init(struct ifnet *ifp)
|
|||
|
||||
/* Initialize descriptors. */
|
||||
error = age_init_rx_ring(sc);
|
||||
if (error != 0) {
|
||||
if (error != 0) {
|
||||
printf("%s: no memory for Rx buffers.\n", device_xname(sc->sc_dev));
|
||||
age_stop(ifp, 0);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
age_init_rr_ring(sc);
|
||||
age_init_tx_ring(sc);
|
||||
age_init_cmb_block(sc);
|
||||
|
@ -1671,7 +1671,7 @@ age_init(struct ifnet *ifp)
|
|||
/* Tell hardware that we're ready to load descriptors. */
|
||||
CSR_WRITE_4(sc, AGE_DMA_BLOCK, DMA_BLOCK_LOAD);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Initialize mailbox register.
|
||||
* Updated producer/consumer index information is exchanged
|
||||
* through this mailbox register. However Tx producer and
|
||||
|
@ -1842,7 +1842,7 @@ age_init(struct ifnet *ifp)
|
|||
*/
|
||||
CSR_WRITE_4(sc, AGE_WOL_CFG, 0);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Configure Tx/Rx MACs.
|
||||
* - Auto-padding for short frames.
|
||||
* - Enable CRC generation.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_alc.c,v 1.35 2019/05/23 10:51:39 msaitoh Exp $ */
|
||||
/* $NetBSD: if_alc.c,v 1.36 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
/* $OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2009, Pyun YongHyeon <yongari@FreeBSD.org>
|
||||
|
@ -534,7 +534,7 @@ alc_dsp_fixup(struct alc_softc *sc, int media)
|
|||
val |= (DBG_MSE20DB_TH_DEFAULT << DBG_MSE20DB_TH_SHIFT);
|
||||
alc_miidbg_writereg(sc, MII_DBG_MSE20DB, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -756,7 +756,7 @@ alc_get_macaddr_816x(struct alc_softc *sc)
|
|||
}
|
||||
} else if (alcdebug)
|
||||
printf("%s: reloading EEPROM/FLASH timed out!\n",
|
||||
device_xname(sc->sc_dev));
|
||||
device_xname(sc->sc_dev));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1273,16 +1273,16 @@ alc_attach(device_t parent, device_t self, void *aux)
|
|||
CSR_WRITE_4(sc, ALC_PEX_UNC_ERR_SEV, val);
|
||||
|
||||
if ((sc->alc_flags & ALC_FLAG_AR816X_FAMILY) == 0) {
|
||||
CSR_WRITE_4(sc, ALC_LTSSM_ID_CFG,
|
||||
CSR_READ_4(sc, ALC_LTSSM_ID_CFG) & ~LTSSM_ID_WRO_ENB);
|
||||
CSR_WRITE_4(sc, ALC_PCIE_PHYMISC,
|
||||
CSR_READ_4(sc, ALC_PCIE_PHYMISC) |
|
||||
PCIE_PHYMISC_FORCE_RCV_DET);
|
||||
if (sc->alc_ident->deviceid == PCI_PRODUCT_ATTANSIC_AR8152_B &&
|
||||
CSR_WRITE_4(sc, ALC_LTSSM_ID_CFG,
|
||||
CSR_READ_4(sc, ALC_LTSSM_ID_CFG) & ~LTSSM_ID_WRO_ENB);
|
||||
CSR_WRITE_4(sc, ALC_PCIE_PHYMISC,
|
||||
CSR_READ_4(sc, ALC_PCIE_PHYMISC) |
|
||||
PCIE_PHYMISC_FORCE_RCV_DET);
|
||||
if (sc->alc_ident->deviceid == PCI_PRODUCT_ATTANSIC_AR8152_B &&
|
||||
sc->alc_rev == ATHEROS_AR8152_B_V10) {
|
||||
val = CSR_READ_4(sc, ALC_PCIE_PHYMISC2);
|
||||
val &= ~(PCIE_PHYMISC2_SERDES_CDR_MASK |
|
||||
PCIE_PHYMISC2_SERDES_TH_MASK);
|
||||
val = CSR_READ_4(sc, ALC_PCIE_PHYMISC2);
|
||||
val &= ~(PCIE_PHYMISC2_SERDES_CDR_MASK |
|
||||
PCIE_PHYMISC2_SERDES_TH_MASK);
|
||||
val |= 3 << PCIE_PHYMISC2_SERDES_CDR_SHIFT;
|
||||
val |= 3 << PCIE_PHYMISC2_SERDES_TH_SHIFT;
|
||||
CSR_WRITE_4(sc, ALC_PCIE_PHYMISC2, val);
|
||||
|
@ -2365,7 +2365,7 @@ alc_txeof(struct alc_softc *sc)
|
|||
|
||||
if ((sc->alc_flags & ALC_FLAG_CMB_BUG) == 0)
|
||||
bus_dmamap_sync(sc->sc_dmat, sc->alc_cdata.alc_cmb_map, 0,
|
||||
sc->alc_cdata.alc_cmb_map->dm_mapsize, BUS_DMASYNC_PREREAD);
|
||||
sc->alc_cdata.alc_cmb_map->dm_mapsize, BUS_DMASYNC_PREREAD);
|
||||
sc->alc_cdata.alc_tx_cons = cons;
|
||||
/*
|
||||
* Unarm watchdog timer only when there is no pending
|
||||
|
@ -3049,7 +3049,7 @@ alc_init_backend(struct ifnet *ifp, bool init)
|
|||
RXQ_CFG_816X_IDT_TBL_SIZE_MASK;
|
||||
if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0 &&
|
||||
sc->alc_ident->deviceid != PCI_PRODUCT_ATTANSIC_AR8151_V2)
|
||||
reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_1M;
|
||||
reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_1M;
|
||||
CSR_WRITE_4(sc, ALC_RXQ_CFG, reg);
|
||||
|
||||
/* Configure DMA parameters. */
|
||||
|
@ -3273,7 +3273,7 @@ alc_stop_queue(struct alc_softc *sc)
|
|||
reg &= ~RXQ_CFG_QUEUE0_ENB;
|
||||
CSR_WRITE_4(sc, ALC_RXQ_CFG, reg);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Disable TxQ. */
|
||||
reg = CSR_READ_4(sc, ALC_TXQ_CFG);
|
||||
if ((reg & TXQ_CFG_ENB) != 0) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_ale.c,v 1.29 2019/05/23 10:51:39 msaitoh Exp $ */
|
||||
/* $NetBSD: if_ale.c,v 1.30 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org>
|
||||
|
@ -32,7 +32,7 @@
|
|||
/* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.29 2019/05/23 10:51:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.30 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#include "vlan.h"
|
||||
|
||||
|
@ -1041,7 +1041,7 @@ ale_encap(struct ale_softc *sc, struct mbuf **m_head)
|
|||
static void
|
||||
ale_start(struct ifnet *ifp)
|
||||
{
|
||||
struct ale_softc *sc = ifp->if_softc;
|
||||
struct ale_softc *sc = ifp->if_softc;
|
||||
struct mbuf *m_head;
|
||||
int enq;
|
||||
|
||||
|
@ -1894,7 +1894,7 @@ ale_stop(struct ifnet *ifp, int disable)
|
|||
m_freem(txd->tx_m);
|
||||
txd->tx_m = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_bnx.c,v 1.83 2019/05/23 10:51:39 msaitoh Exp $ */
|
||||
/* $NetBSD: if_bnx.c,v 1.84 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
/* $OpenBSD: if_bnx.c,v 1.101 2013/03/28 17:21:44 brad Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -35,7 +35,7 @@
|
|||
#if 0
|
||||
__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $");
|
||||
#endif
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.83 2019/05/23 10:51:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.84 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
/*
|
||||
* The following controllers are supported by this driver:
|
||||
|
@ -578,7 +578,7 @@ bnx_attach(device_t parent, device_t self, void *aux)
|
|||
struct pci_attach_args *pa = aux;
|
||||
pci_chipset_tag_t pc = pa->pa_pc;
|
||||
pci_intr_handle_t ih;
|
||||
const char *intrstr = NULL;
|
||||
const char *intrstr = NULL;
|
||||
uint32_t command;
|
||||
struct ifnet *ifp;
|
||||
struct mii_data * const mii = &sc->bnx_mii;
|
||||
|
@ -806,23 +806,23 @@ bnx_attach(device_t parent, device_t self, void *aux)
|
|||
/* Force more frequent interrupts. */
|
||||
sc->bnx_tx_quick_cons_trip_int = 1;
|
||||
sc->bnx_tx_quick_cons_trip = 1;
|
||||
sc->bnx_tx_ticks_int = 0;
|
||||
sc->bnx_tx_ticks = 0;
|
||||
sc->bnx_tx_ticks_int = 0;
|
||||
sc->bnx_tx_ticks = 0;
|
||||
|
||||
sc->bnx_rx_quick_cons_trip_int = 1;
|
||||
sc->bnx_rx_quick_cons_trip = 1;
|
||||
sc->bnx_rx_ticks_int = 0;
|
||||
sc->bnx_rx_ticks = 0;
|
||||
sc->bnx_rx_ticks_int = 0;
|
||||
sc->bnx_rx_ticks = 0;
|
||||
#else
|
||||
sc->bnx_tx_quick_cons_trip_int = 20;
|
||||
sc->bnx_tx_quick_cons_trip = 20;
|
||||
sc->bnx_tx_ticks_int = 80;
|
||||
sc->bnx_tx_ticks = 80;
|
||||
sc->bnx_tx_ticks_int = 80;
|
||||
sc->bnx_tx_ticks = 80;
|
||||
|
||||
sc->bnx_rx_quick_cons_trip_int = 6;
|
||||
sc->bnx_rx_quick_cons_trip = 6;
|
||||
sc->bnx_rx_ticks_int = 18;
|
||||
sc->bnx_rx_ticks = 18;
|
||||
sc->bnx_rx_ticks_int = 18;
|
||||
sc->bnx_rx_ticks = 18;
|
||||
#endif
|
||||
|
||||
/* Update statistics once every second. */
|
||||
|
@ -1037,7 +1037,7 @@ bnx_reg_rd_ind(struct bnx_softc *sc, uint32_t offset)
|
|||
void
|
||||
bnx_reg_wr_ind(struct bnx_softc *sc, uint32_t offset, uint32_t val)
|
||||
{
|
||||
struct pci_attach_args *pa = &(sc->bnx_pa);
|
||||
struct pci_attach_args *pa = &(sc->bnx_pa);
|
||||
|
||||
DBPRINT(sc, BNX_EXCESSIVE, "%s(); offset = 0x%08X, val = 0x%08X\n",
|
||||
__func__, offset, val);
|
||||
|
@ -2747,7 +2747,7 @@ bnx_fw_sync(struct bnx_softc *sc, uint32_t msg_data)
|
|||
sc->bnx_fw_wr_seq++;
|
||||
msg_data |= sc->bnx_fw_wr_seq;
|
||||
|
||||
DBPRINT(sc, BNX_VERBOSE, "bnx_fw_sync(): msg_data = 0x%08X\n",
|
||||
DBPRINT(sc, BNX_VERBOSE, "bnx_fw_sync(): msg_data = 0x%08X\n",
|
||||
msg_data);
|
||||
|
||||
/* Send the message to the bootcode driver mailbox. */
|
||||
|
@ -3744,7 +3744,7 @@ int
|
|||
bnx_blockinit(struct bnx_softc *sc)
|
||||
{
|
||||
uint32_t reg, val;
|
||||
int rc = 0;
|
||||
int rc = 0;
|
||||
|
||||
DBPRINT(sc, BNX_VERBOSE_RESET, "Entering %s()\n", __func__);
|
||||
|
||||
|
@ -3970,7 +3970,7 @@ int
|
|||
bnx_get_buf(struct bnx_softc *sc, uint16_t *prod,
|
||||
uint16_t *chain_prod, uint32_t *prod_bseq)
|
||||
{
|
||||
struct mbuf *m_new = NULL;
|
||||
struct mbuf *m_new = NULL;
|
||||
int rc = 0;
|
||||
uint16_t min_free_bd;
|
||||
|
||||
|
@ -3980,7 +3980,7 @@ bnx_get_buf(struct bnx_softc *sc, uint16_t *prod,
|
|||
/* Make sure the inputs are valid. */
|
||||
DBRUNIF((*chain_prod > MAX_RX_BD),
|
||||
aprint_error_dev(sc->bnx_dev,
|
||||
"RX producer out of range: 0x%04X > 0x%04X\n",
|
||||
"RX producer out of range: 0x%04X > 0x%04X\n",
|
||||
*chain_prod, (uint16_t)MAX_RX_BD));
|
||||
|
||||
DBPRINT(sc, BNX_VERBOSE_RECV, "%s(enter): prod = 0x%04X, chain_prod = "
|
||||
|
@ -4274,7 +4274,7 @@ bnx_free_tx_chain(struct bnx_softc *sc)
|
|||
/* Check if we lost any mbufs in the process. */
|
||||
DBRUNIF((sc->tx_mbuf_alloc),
|
||||
aprint_error_dev(sc->bnx_dev,
|
||||
"Memory leak! Lost %d mbufs from tx chain!\n",
|
||||
"Memory leak! Lost %d mbufs from tx chain!\n",
|
||||
sc->tx_mbuf_alloc));
|
||||
|
||||
DBPRINT(sc, BNX_VERBOSE_RESET, "Exiting %s()\n", __func__);
|
||||
|
@ -4298,7 +4298,7 @@ bnx_init_rx_context(struct bnx_softc *sc)
|
|||
if (sc->bnx_flowflags & IFM_ETH_TXPAUSE)
|
||||
val |= 0x000000ff;
|
||||
|
||||
CTX_WR(sc, GET_CID_ADDR(RX_CID), BNX_L2CTX_CTX_TYPE, val);
|
||||
CTX_WR(sc, GET_CID_ADDR(RX_CID), BNX_L2CTX_CTX_TYPE, val);
|
||||
|
||||
/* Setup the MQ BIN mapping for l2_ctx_host_bseq. */
|
||||
if (BNX_CHIP_NUM(sc) == BNX_CHIP_NUM_5709) {
|
||||
|
@ -4429,7 +4429,7 @@ bnx_free_rx_chain(struct bnx_softc *sc)
|
|||
/* Check if we lost any mbufs in the process. */
|
||||
DBRUNIF((sc->rx_mbuf_alloc),
|
||||
aprint_error_dev(sc->bnx_dev,
|
||||
"Memory leak! Lost %d mbufs from rx chain!\n",
|
||||
"Memory leak! Lost %d mbufs from rx chain!\n",
|
||||
sc->rx_mbuf_alloc));
|
||||
|
||||
DBPRINT(sc, BNX_VERBOSE_RESET, "Exiting %s()\n", __func__);
|
||||
|
@ -4611,8 +4611,8 @@ bnx_rx_intr(struct bnx_softc *sc)
|
|||
/* Validate that this is the last rx_bd. */
|
||||
if ((rxbd->rx_bd_flags & RX_BD_FLAGS_END) == 0) {
|
||||
printf("%s: Unexpected mbuf found in "
|
||||
"rx_bd[0x%04X]!\n", device_xname(sc->bnx_dev),
|
||||
sw_chain_cons);
|
||||
"rx_bd[0x%04X]!\n", device_xname(sc->bnx_dev),
|
||||
sw_chain_cons);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -4670,7 +4670,7 @@ bnx_rx_intr(struct bnx_softc *sc)
|
|||
DBRUNIF(((len < BNX_MIN_MTU) ||
|
||||
(len > BNX_MAX_JUMBO_ETHER_MTU_VLAN)),
|
||||
aprint_error_dev(sc->bnx_dev,
|
||||
"Unusual frame size found. "
|
||||
"Unusual frame size found. "
|
||||
"Min(%d), Actual(%d), Max(%d)\n",
|
||||
(int)BNX_MIN_MTU, len,
|
||||
(int)BNX_MAX_JUMBO_ETHER_MTU_VLAN);
|
||||
|
@ -4757,7 +4757,7 @@ bnx_rx_intr(struct bnx_softc *sc)
|
|||
else
|
||||
DBPRINT(sc, BNX_WARN_SEND,
|
||||
"%s(): Invalid IP checksum "
|
||||
"= 0x%04X!\n",
|
||||
"= 0x%04X!\n",
|
||||
__func__,
|
||||
l2fhdr->l2_fhdr_ip_xsum
|
||||
);
|
||||
|
@ -4882,7 +4882,7 @@ bnx_tx_intr(struct bnx_softc *sc)
|
|||
|
||||
DBRUNIF((sw_tx_chain_cons > MAX_TX_BD),
|
||||
aprint_error_dev(sc->bnx_dev,
|
||||
"TX chain consumer out of range! 0x%04X > 0x%04X\n",
|
||||
"TX chain consumer out of range! 0x%04X > 0x%04X\n",
|
||||
sw_tx_chain_cons, (int)MAX_TX_BD); bnx_breakpoint(sc));
|
||||
|
||||
DBRUNIF(1, txbd = &sc->tx_bd_chain
|
||||
|
@ -4890,7 +4890,7 @@ bnx_tx_intr(struct bnx_softc *sc)
|
|||
|
||||
DBRUNIF((txbd == NULL),
|
||||
aprint_error_dev(sc->bnx_dev,
|
||||
"Unexpected NULL tx_bd[0x%04X]!\n", sw_tx_chain_cons);
|
||||
"Unexpected NULL tx_bd[0x%04X]!\n", sw_tx_chain_cons);
|
||||
bnx_breakpoint(sc));
|
||||
|
||||
DBRUN(BNX_INFO_SEND, aprint_debug("%s: ", __func__);
|
||||
|
@ -4949,7 +4949,7 @@ bnx_tx_intr(struct bnx_softc *sc)
|
|||
if (sc->used_tx_bd < sc->max_tx_bd) {
|
||||
DBRUNIF((ifp->if_flags & IFF_OACTIVE),
|
||||
aprint_debug_dev(sc->bnx_dev,
|
||||
"Open TX chain! %d/%d (used/total)\n",
|
||||
"Open TX chain! %d/%d (used/total)\n",
|
||||
sc->used_tx_bd, sc->max_tx_bd));
|
||||
ifp->if_flags &= ~IFF_OACTIVE;
|
||||
}
|
||||
|
@ -5106,7 +5106,7 @@ bnx_mgmt_init(struct bnx_softc *sc)
|
|||
bnx_ifmedia_upd(ifp);
|
||||
|
||||
bnx_mgmt_init_exit:
|
||||
DBPRINT(sc, BNX_VERBOSE_RESET, "Exiting %s()\n", __func__);
|
||||
DBPRINT(sc, BNX_VERBOSE_RESET, "Exiting %s()\n", __func__);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
@ -5970,7 +5970,7 @@ bnx_dump_tx_mbuf_chain(struct bnx_softc *sc, int chain_prod, int count)
|
|||
"----------------------------\n");
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
m = sc->tx_mbuf_ptr[chain_prod];
|
||||
m = sc->tx_mbuf_ptr[chain_prod];
|
||||
BNX_PRINTF(sc, "txmbuf[%d]\n", chain_prod);
|
||||
bnx_dump_mbuf(sc, m);
|
||||
chain_prod = TX_CHAIN_IDX(NEXT_TX_BD(chain_prod));
|
||||
|
@ -5997,7 +5997,7 @@ bnx_dump_rx_mbuf_chain(struct bnx_softc *sc, int chain_prod, int count)
|
|||
"----------------------------\n");
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
m = sc->rx_mbuf_ptr[chain_prod];
|
||||
m = sc->rx_mbuf_ptr[chain_prod];
|
||||
BNX_PRINTF(sc, "rxmbuf[0x%04X]\n", chain_prod);
|
||||
bnx_dump_mbuf(sc, m);
|
||||
chain_prod = RX_CHAIN_IDX(NEXT_RX_BD(chain_prod));
|
||||
|
@ -6091,7 +6091,7 @@ bnx_dump_tx_chain(struct bnx_softc *sc, int tx_prod, int count)
|
|||
|
||||
/* Now print out the tx_bd's themselves. */
|
||||
for (i = 0; i < count; i++) {
|
||||
txbd = &sc->tx_bd_chain[TX_PAGE(tx_prod)][TX_IDX(tx_prod)];
|
||||
txbd = &sc->tx_bd_chain[TX_PAGE(tx_prod)][TX_IDX(tx_prod)];
|
||||
bnx_dump_txbd(sc, tx_prod, txbd);
|
||||
tx_prod = TX_CHAIN_IDX(NEXT_TX_BD(tx_prod));
|
||||
}
|
||||
|
@ -6159,7 +6159,7 @@ bnx_dump_status_block(struct bnx_softc *sc)
|
|||
|
||||
sblk = sc->status_block;
|
||||
|
||||
aprint_debug_dev(sc->bnx_dev, "----------------------------- "
|
||||
aprint_debug_dev(sc->bnx_dev, "----------------------------- "
|
||||
"Status Block -----------------------------\n");
|
||||
|
||||
BNX_PRINTF(sc,
|
||||
|
@ -6650,7 +6650,7 @@ bnx_breakpoint(struct bnx_softc *sc)
|
|||
{
|
||||
/* Unreachable code to shut the compiler up about unused functions. */
|
||||
if (0) {
|
||||
bnx_dump_txbd(sc, 0, NULL);
|
||||
bnx_dump_txbd(sc, 0, NULL);
|
||||
bnx_dump_rxbd(sc, 0, NULL);
|
||||
bnx_dump_tx_mbuf_chain(sc, 0, USABLE_TX_BD);
|
||||
bnx_dump_rx_mbuf_chain(sc, 0, sc->max_rx_bd);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_cas.c,v 1.33 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: if_cas.c,v 1.34 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
/* $OpenBSD: if_cas.c,v 1.29 2009/11/29 16:19:38 kettenis Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -44,7 +44,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_cas.c,v 1.33 2019/05/23 10:57:28 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_cas.c,v 1.34 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#ifndef _MODULE
|
||||
#include "opt_inet.h"
|
||||
|
@ -558,7 +558,7 @@ cas_config(struct cas_softc *sc, const uint8_t *enaddr)
|
|||
if (sc->sc_mif_config & CAS_MIF_CONFIG_MDI1) {
|
||||
sc->sc_mif_config |= CAS_MIF_CONFIG_PHY_SEL;
|
||||
bus_space_write_4(sc->sc_memt, sc->sc_memh,
|
||||
CAS_MIF_CONFIG, sc->sc_mif_config);
|
||||
CAS_MIF_CONFIG, sc->sc_mif_config);
|
||||
}
|
||||
|
||||
mii_attach(sc->sc_dev, mii, 0xffffffff, MII_PHY_ANY,
|
||||
|
@ -1911,7 +1911,7 @@ cas_iff(struct cas_softc *sc)
|
|||
rxcfg |= CAS_MAC_RX_PROMISCUOUS;
|
||||
else
|
||||
rxcfg |= CAS_MAC_RX_PROMISC_GRP;
|
||||
} else {
|
||||
} else {
|
||||
/*
|
||||
* Set up multicast address filter by passing all multicast
|
||||
* addresses through a crc generator, and then using the
|
||||
|
@ -1929,14 +1929,14 @@ cas_iff(struct cas_softc *sc)
|
|||
|
||||
ETHER_FIRST_MULTI(step, ec, enm);
|
||||
while (enm != NULL) {
|
||||
crc = ether_crc32_le(enm->enm_addrlo,
|
||||
ETHER_ADDR_LEN);
|
||||
crc = ether_crc32_le(enm->enm_addrlo,
|
||||
ETHER_ADDR_LEN);
|
||||
|
||||
/* Just want the 8 most significant bits. */
|
||||
crc >>= 24;
|
||||
/* Just want the 8 most significant bits. */
|
||||
crc >>= 24;
|
||||
|
||||
/* Set the corresponding bit in the filter. */
|
||||
hash[crc >> 4] |= 1 << (15 - (crc & 15));
|
||||
/* Set the corresponding bit in the filter. */
|
||||
hash[crc >> 4] |= 1 << (15 - (crc & 15));
|
||||
|
||||
ETHER_NEXT_MULTI(step, enm);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_jme.c,v 1.40 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: if_jme.c,v 1.41 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008 Manuel Bouyer. All rights reserved.
|
||||
|
@ -58,7 +58,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_jme.c,v 1.40 2019/05/23 10:57:28 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_jme.c,v 1.41 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -128,9 +128,9 @@ struct jme_product_desc {
|
|||
struct jme_softc {
|
||||
device_t jme_dev; /* base device */
|
||||
bus_space_tag_t jme_bt_mac;
|
||||
bus_space_handle_t jme_bh_mac; /* Mac registers */
|
||||
bus_space_handle_t jme_bh_mac; /* Mac registers */
|
||||
bus_space_tag_t jme_bt_phy;
|
||||
bus_space_handle_t jme_bh_phy; /* PHY registers */
|
||||
bus_space_handle_t jme_bh_phy; /* PHY registers */
|
||||
bus_space_tag_t jme_bt_misc;
|
||||
bus_space_handle_t jme_bh_misc; /* Misc registers */
|
||||
bus_dma_tag_t jme_dmatag;
|
||||
|
@ -1049,7 +1049,7 @@ jme_intr_rx(jme_softc_t *sc) {
|
|||
struct mbuf *m, *mhead;
|
||||
bus_dmamap_t mmap;
|
||||
struct ifnet *ifp = &sc->jme_if;
|
||||
uint32_t flags, buflen;
|
||||
uint32_t flags, buflen;
|
||||
int i, ipackets, nsegs, seg, error;
|
||||
struct jme_desc *desc;
|
||||
|
||||
|
@ -1067,7 +1067,7 @@ jme_intr_rx(jme_softc_t *sc) {
|
|||
desc = &sc->jme_rxring[i];
|
||||
#ifdef JMEDEBUG_RX
|
||||
printf("rxintr i %d flags 0x%x buflen 0x%x\n",
|
||||
i, le32toh(desc->flags), le32toh(desc->buflen));
|
||||
i, le32toh(desc->flags), le32toh(desc->buflen));
|
||||
#endif
|
||||
if (sc->jme_rxmbuf[i] == NULL) {
|
||||
if ((error = jme_add_rxbuf(sc, NULL)) != 0) {
|
||||
|
@ -1914,7 +1914,7 @@ jme_multicast_hash(uint8_t *a)
|
|||
|
||||
#define DA(addr, bit) (addr[5 - (bit / 8)] & (1 << (bit % 8)))
|
||||
#define xor8(a,b,c,d,e,f,g,h) \
|
||||
(((a != 0) + (b != 0) + (c != 0) + (d != 0) + \
|
||||
(((a != 0) + (b != 0) + (c != 0) + (d != 0) + \
|
||||
(e != 0) + (f != 0) + (g != 0) + (h != 0)) & 1)
|
||||
|
||||
hash = xor8(DA(a,0), DA(a, 6), DA(a,12), DA(a,18), DA(a,24), DA(a,30),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_lii.c,v 1.23 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: if_lii.c,v 1.24 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008 The NetBSD Foundation.
|
||||
|
@ -31,7 +31,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_lii.c,v 1.23 2019/05/23 10:57:28 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_lii.c,v 1.24 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -472,17 +472,17 @@ lii_spi_configure(struct lii_softc *sc)
|
|||
|
||||
#define MAKE_SFC(cssetup, clkhi, clklo, cshold, cshi, ins) \
|
||||
( (((cssetup) & SFC_CS_SETUP_MASK) \
|
||||
<< SFC_CS_SETUP_SHIFT) \
|
||||
<< SFC_CS_SETUP_SHIFT) \
|
||||
| (((clkhi) & SFC_CLK_HI_MASK) \
|
||||
<< SFC_CLK_HI_SHIFT) \
|
||||
<< SFC_CLK_HI_SHIFT) \
|
||||
| (((clklo) & SFC_CLK_LO_MASK) \
|
||||
<< SFC_CLK_LO_SHIFT) \
|
||||
<< SFC_CLK_LO_SHIFT) \
|
||||
| (((cshold) & SFC_CS_HOLD_MASK) \
|
||||
<< SFC_CS_HOLD_SHIFT) \
|
||||
<< SFC_CS_HOLD_SHIFT) \
|
||||
| (((cshi) & SFC_CS_HI_MASK) \
|
||||
<< SFC_CS_HI_SHIFT) \
|
||||
<< SFC_CS_HI_SHIFT) \
|
||||
| (((ins) & SFC_INS_MASK) \
|
||||
<< SFC_INS_SHIFT))
|
||||
<< SFC_INS_SHIFT))
|
||||
|
||||
/* Magic settings from the Linux driver */
|
||||
|
||||
|
@ -503,7 +503,7 @@ lii_spi_read(struct lii_softc *sc, uint32_t reg, uint32_t *val)
|
|||
|
||||
v = SFC_WAIT_READY |
|
||||
MAKE_SFC(CUSTOM_SPI_CS_SETUP, CUSTOM_SPI_CLK_HI,
|
||||
CUSTOM_SPI_CLK_LO, CUSTOM_SPI_CS_HOLD, CUSTOM_SPI_CS_HI, 1);
|
||||
CUSTOM_SPI_CLK_LO, CUSTOM_SPI_CS_HOLD, CUSTOM_SPI_CS_HI, 1);
|
||||
|
||||
AT_WRITE_4(sc, ATL2_SFC, v);
|
||||
v |= SFC_START;
|
||||
|
@ -1034,7 +1034,7 @@ lii_txintr(struct lii_softc *sc)
|
|||
|
||||
txs->txps_update = 0;
|
||||
|
||||
txph = (struct tx_pkt_header *)
|
||||
txph = (struct tx_pkt_header *)
|
||||
(sc->sc_txdbase + sc->sc_txd_ack);
|
||||
|
||||
if (txph->txph_size != txs->txps_size)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_msk.c,v 1.88 2019/05/23 10:51:39 msaitoh Exp $ */
|
||||
/* $NetBSD: if_msk.c,v 1.89 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
/* $OpenBSD: if_msk.c,v 1.79 2009/10/15 17:54:56 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -52,7 +52,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.88 2019/05/23 10:51:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.89 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -150,13 +150,13 @@ void msk_dump_bytes(const char *, int);
|
|||
static int msk_sysctl_handler(SYSCTLFN_PROTO);
|
||||
static int msk_root_num;
|
||||
|
||||
#define MSK_ADDR_LO(x) ((uint64_t) (x) & 0xffffffffUL)
|
||||
#define MSK_ADDR_HI(x) ((uint64_t) (x) >> 32)
|
||||
#define MSK_ADDR_LO(x) ((uint64_t) (x) & 0xffffffffUL)
|
||||
#define MSK_ADDR_HI(x) ((uint64_t) (x) >> 32)
|
||||
|
||||
/* supported device vendors */
|
||||
static const struct msk_product {
|
||||
pci_vendor_id_t msk_vendor;
|
||||
pci_product_id_t msk_product;
|
||||
pci_vendor_id_t msk_vendor;
|
||||
pci_product_id_t msk_product;
|
||||
} msk_products[] = {
|
||||
{ PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_DGE550SX },
|
||||
{ PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_DGE550T_B1 },
|
||||
|
@ -260,7 +260,7 @@ msk_miibus_readreg(device_t dev, int phy, int reg, uint16_t *val)
|
|||
return ETIMEDOUT;
|
||||
}
|
||||
|
||||
DPRINTFN(9, ("msk_miibus_readreg: i=%d, timeout=%d\n", i, SK_TIMEOUT));
|
||||
DPRINTFN(9, ("msk_miibus_readreg: i=%d, timeout=%d\n", i, SK_TIMEOUT));
|
||||
|
||||
*val = SK_YU_READ_2(sc_if, YUKON_SMIDR);
|
||||
|
||||
|
@ -585,7 +585,7 @@ msk_alloc_jumbo_mem(struct sk_if_softc *sc_if)
|
|||
struct sk_softc *sc = sc_if->sk_softc;
|
||||
char *ptr, *kva;
|
||||
int i, state, error;
|
||||
struct sk_jpool_entry *entry;
|
||||
struct sk_jpool_entry *entry;
|
||||
|
||||
state = error = 0;
|
||||
|
||||
|
@ -696,7 +696,7 @@ msk_free_jumbo_mem(struct sk_if_softc *sc_if)
|
|||
void *
|
||||
msk_jalloc(struct sk_if_softc *sc_if)
|
||||
{
|
||||
struct sk_jpool_entry *entry;
|
||||
struct sk_jpool_entry *entry;
|
||||
|
||||
mutex_enter(&sc_if->sk_jpool_mtx);
|
||||
entry = LIST_FIRST(&sc_if->sk_jfree_listhead);
|
||||
|
@ -1241,7 +1241,7 @@ msk_attach(device_t parent, device_t self, void *aux)
|
|||
*/
|
||||
msk_init_yukon(sc_if);
|
||||
|
||||
DPRINTFN(2, ("msk_attach: 1\n"));
|
||||
DPRINTFN(2, ("msk_attach: 1\n"));
|
||||
|
||||
mii->mii_ifp = ifp;
|
||||
mii->mii_readreg = msk_miibus_readreg;
|
||||
|
@ -2166,7 +2166,7 @@ msk_fill_rx_tick(void *xsc_if)
|
|||
struct sk_if_softc *sc_if = xsc_if;
|
||||
int s, rx_prod;
|
||||
|
||||
KASSERT(KERNEL_LOCKED_P()); /* XXXSMP */
|
||||
KASSERT(KERNEL_LOCKED_P()); /* XXXSMP */
|
||||
|
||||
s = splnet();
|
||||
rx_prod = sc_if->sk_cdata.sk_rx_prod;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_pcn.c,v 1.69 2019/05/23 10:51:39 msaitoh Exp $ */
|
||||
/* $NetBSD: if_pcn.c,v 1.70 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Wasabi Systems, Inc.
|
||||
|
@ -65,7 +65,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_pcn.c,v 1.69 2019/05/23 10:51:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_pcn.c,v 1.70 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -375,7 +375,7 @@ do { \
|
|||
__rmd->rmd0 = \
|
||||
htole32(__rxs->rxs_dmamap->dm_segs[0].ds_addr + 2); \
|
||||
} \
|
||||
__rmd->rmd1 = htole32(LE_R1_OWN | LE_R1_ONES | \
|
||||
__rmd->rmd1 = htole32(LE_R1_OWN | LE_R1_ONES | \
|
||||
(LE_BCNT(MCLBYTES - 2) & LE_R1_BCNT_MASK)); \
|
||||
PCN_CDRXSYNC((sc), (x), BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);\
|
||||
} while(/*CONSTCOND*/0)
|
||||
|
@ -634,7 +634,7 @@ pcn_attach(device_t parent, device_t self, void *aux)
|
|||
obj = prop_dictionary_get(device_properties(sc->sc_dev),
|
||||
"am79c970-no-eeprom");
|
||||
if (prop_bool_true(obj)) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
uint32_t val;
|
||||
val = pcn_csr_read(sc, LE_CSR12 + i);
|
||||
enaddr[2 * i] = val & 0xff;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_ste.c,v 1.54 2019/05/23 10:51:39 msaitoh Exp $ */
|
||||
/* $NetBSD: if_ste.c,v 1.55 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
|
@ -35,7 +35,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ste.c,v 1.54 2019/05/23 10:51:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ste.c,v 1.55 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -250,7 +250,7 @@ static const struct ste_product {
|
|||
pci_product_id_t ste_product;
|
||||
const char *ste_name;
|
||||
} ste_products[] = {
|
||||
{ PCI_VENDOR_SUNDANCETI, PCI_PRODUCT_SUNDANCETI_IP100A,
|
||||
{ PCI_VENDOR_SUNDANCETI, PCI_PRODUCT_SUNDANCETI_IP100A,
|
||||
"IC Plus Corp. IP00A 10/100 Fast Ethernet Adapter" },
|
||||
|
||||
{ PCI_VENDOR_SUNDANCETI, PCI_PRODUCT_SUNDANCETI_ST201,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_tl.c,v 1.114 2019/05/23 10:51:39 msaitoh Exp $ */
|
||||
/* $NetBSD: if_tl.c,v 1.115 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Manuel Bouyer. All rights reserved.
|
||||
|
@ -31,7 +31,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_tl.c,v 1.114 2019/05/23 10:51:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_tl.c,v 1.115 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#undef TLDEBUG
|
||||
#define TL_PRIV_STATS
|
||||
|
@ -818,7 +818,7 @@ tl_mii_sendbits(struct tl_softc *sc, uint32_t data, int nbits)
|
|||
int i;
|
||||
|
||||
netsio_set(sc, TL_NETSIO_MTXEN);
|
||||
for (i = 1 << (nbits - 1); i; i = i >> 1) {
|
||||
for (i = 1 << (nbits - 1); i; i = i >> 1) {
|
||||
netsio_clr(sc, TL_NETSIO_MCLK);
|
||||
netsio_read(sc, TL_NETSIO_MCLK);
|
||||
if (data & i)
|
||||
|
@ -1349,8 +1349,8 @@ tbdinit:
|
|||
}
|
||||
#endif
|
||||
/*
|
||||
* add the nullbuf in the seg
|
||||
*/
|
||||
* add the nullbuf in the seg
|
||||
*/
|
||||
Tx->hw_list->seg[segment].data_count =
|
||||
htole32(ETHER_MIN_TX - size);
|
||||
Tx->hw_list->seg[segment].data_addr =
|
||||
|
@ -1610,7 +1610,7 @@ tl_multicast_hash(uint8_t *a)
|
|||
|
||||
#define DA(addr, bit) (addr[5 - (bit / 8)] & (1 << (bit % 8)))
|
||||
#define xor8(a, b, c, d, e, f, g, h) \
|
||||
(((a != 0) + (b != 0) + (c != 0) + (d != 0) + \
|
||||
(((a != 0) + (b != 0) + (c != 0) + (d != 0) + \
|
||||
(e != 0) + (f != 0) + (g != 0) + (h != 0)) & 1)
|
||||
|
||||
hash = xor8(DA(a,0), DA(a, 6), DA(a,12), DA(a,18), DA(a,24), DA(a,30),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_vge.c,v 1.70 2019/05/23 10:40:39 msaitoh Exp $ */
|
||||
/* $NetBSD: if_vge.c,v 1.71 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2004
|
||||
|
@ -35,7 +35,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.70 2019/05/23 10:40:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.71 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
/*
|
||||
* VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver.
|
||||
|
@ -285,8 +285,8 @@ struct vge_softc {
|
|||
|
||||
#define VGE_TIMEOUT 10000
|
||||
|
||||
#define VGE_PCI_LOIO 0x10
|
||||
#define VGE_PCI_LOMEM 0x14
|
||||
#define VGE_PCI_LOIO 0x10
|
||||
#define VGE_PCI_LOMEM 0x14
|
||||
|
||||
static inline void vge_set_txaddr(struct vge_txfrag *, bus_addr_t);
|
||||
static inline void vge_set_rxaddr(struct vge_rxdesc *, bus_addr_t);
|
||||
|
@ -893,7 +893,7 @@ vge_attach(device_t parent, device_t self, void *aux)
|
|||
pci_aprint_devinfo_fancy(pa, NULL, "VIA VT612X Gigabit Ethernet", 1);
|
||||
|
||||
/* Make sure bus-mastering is enabled */
|
||||
pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
|
||||
pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
|
||||
pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG) |
|
||||
PCI_COMMAND_MASTER_ENABLE);
|
||||
|
||||
|
@ -906,9 +906,9 @@ vge_attach(device_t parent, device_t self, void *aux)
|
|||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Map and establish our interrupt.
|
||||
*/
|
||||
/*
|
||||
* Map and establish our interrupt.
|
||||
*/
|
||||
if (pci_intr_map(pa, &ih)) {
|
||||
aprint_error_dev(self, "unable to map interrupt\n");
|
||||
return;
|
||||
|
@ -2082,7 +2082,7 @@ vge_suspend(device_t dev)
|
|||
|
||||
vge_stop(sc);
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
for (i = 0; i < 5; i++)
|
||||
sc->sc_saved_maps[i] =
|
||||
pci_read_config(dev, PCIR_MAPS + i * 4, 4);
|
||||
sc->sc_saved_biosaddr = pci_read_config(dev, PCIR_BIOS, 4);
|
||||
|
@ -2110,7 +2110,7 @@ vge_resume(device_t dev)
|
|||
sc = device_private(dev);
|
||||
ifp = &sc->sc_ethercom.ec_if;
|
||||
|
||||
/* better way to do this? */
|
||||
/* better way to do this? */
|
||||
for (i = 0; i < 5; i++)
|
||||
pci_write_config(dev, PCIR_MAPS + i * 4,
|
||||
sc->sc_saved_maps[i], 4);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_vioif.c,v 1.48 2019/05/23 10:40:39 msaitoh Exp $ */
|
||||
/* $NetBSD: if_vioif.c,v 1.49 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010 Minoura Makoto.
|
||||
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.48 2019/05/23 10:40:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.49 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_net_mpsafe.h"
|
||||
|
@ -1175,7 +1175,7 @@ vioif_send_common_locked(struct ifnet *ifp, struct vioif_txqueue *txq,
|
|||
m, BUS_DMA_WRITE | BUS_DMA_NOWAIT);
|
||||
if (r != 0) {
|
||||
aprint_error_dev(sc->sc_dev,
|
||||
"tx dmamap load failed, error code %d\n",
|
||||
"tx dmamap load failed, error code %d\n",
|
||||
r);
|
||||
skip:
|
||||
m_freem(m);
|
||||
|
@ -1189,7 +1189,7 @@ skip:
|
|||
txq->txq_dmamaps[slot]->dm_nsegs + 1);
|
||||
if (r != 0) {
|
||||
aprint_error_dev(sc->sc_dev,
|
||||
"virtio_enqueue_reserve failed, error code %d\n",
|
||||
"virtio_enqueue_reserve failed, error code %d\n",
|
||||
r);
|
||||
bus_dmamap_unload(virtio_dmat(vsc),
|
||||
txq->txq_dmamaps[slot]);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_vr.c,v 1.128 2019/05/23 10:40:40 msaitoh Exp $ */
|
||||
/* $NetBSD: if_vr.c,v 1.129 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -97,7 +97,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.128 2019/05/23 10:40:40 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.129 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
|
||||
|
||||
|
@ -199,7 +199,7 @@ struct vr_softc {
|
|||
pci_chipset_tag_t vr_pc; /* PCI chipset info */
|
||||
pcitag_t vr_tag; /* PCI tag */
|
||||
struct ethercom vr_ec; /* Ethernet common info */
|
||||
uint8_t vr_enaddr[ETHER_ADDR_LEN];
|
||||
uint8_t vr_enaddr[ETHER_ADDR_LEN];
|
||||
struct mii_data vr_mii; /* MII/media info */
|
||||
|
||||
pcireg_t vr_id; /* vendor/product ID */
|
||||
|
@ -655,7 +655,7 @@ vr_rxeof(struct vr_softc *sc)
|
|||
|
||||
continue;
|
||||
} else if (!(rxstat & VR_RXSTAT_FIRSTFRAG) ||
|
||||
!(rxstat & VR_RXSTAT_LASTFRAG)) {
|
||||
!(rxstat & VR_RXSTAT_LASTFRAG)) {
|
||||
/*
|
||||
* This driver expects to receive whole packets every
|
||||
* time. In case we receive a fragment that is not
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_vte.c,v 1.24 2019/05/23 10:51:39 msaitoh Exp $ */
|
||||
/* $NetBSD: if_vte.c,v 1.25 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011 Manuel Bouyer. All rights reserved.
|
||||
|
@ -55,7 +55,7 @@
|
|||
/* Driver for DM&P Electronics, Inc, Vortex86 RDC R6040 FastEthernet. */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.24 2019/05/23 10:51:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.25 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -258,26 +258,26 @@ vte_attach(device_t parent, device_t self, void *aux)
|
|||
*/
|
||||
sc->vte_ec.ec_capabilities |= ETHERCAP_VLAN_MTU;
|
||||
|
||||
strlcpy(ifp->if_xname, device_xname(self), IFNAMSIZ);
|
||||
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
|
||||
ifp->if_ioctl = vte_ifioctl;
|
||||
ifp->if_start = vte_ifstart;
|
||||
ifp->if_watchdog = vte_ifwatchdog;
|
||||
ifp->if_init = vte_init;
|
||||
ifp->if_stop = vte_stop;
|
||||
ifp->if_timer = 0;
|
||||
IFQ_SET_READY(&ifp->if_snd);
|
||||
if_attach(ifp);
|
||||
strlcpy(ifp->if_xname, device_xname(self), IFNAMSIZ);
|
||||
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
|
||||
ifp->if_ioctl = vte_ifioctl;
|
||||
ifp->if_start = vte_ifstart;
|
||||
ifp->if_watchdog = vte_ifwatchdog;
|
||||
ifp->if_init = vte_init;
|
||||
ifp->if_stop = vte_stop;
|
||||
ifp->if_timer = 0;
|
||||
IFQ_SET_READY(&ifp->if_snd);
|
||||
if_attach(ifp);
|
||||
if_deferred_start_init(ifp, NULL);
|
||||
ether_ifattach(&(sc)->vte_if, (sc)->vte_eaddr);
|
||||
ether_ifattach(&(sc)->vte_if, (sc)->vte_eaddr);
|
||||
|
||||
if (pmf_device_register1(self, vte_suspend, vte_resume, vte_shutdown))
|
||||
pmf_class_network_register(self, ifp);
|
||||
else
|
||||
aprint_error_dev(self, "couldn't establish power handler\n");
|
||||
|
||||
rnd_attach_source(&sc->rnd_source, device_xname(self),
|
||||
RND_TYPE_NET, RND_FLAG_DEFAULT);
|
||||
rnd_attach_source(&sc->rnd_source, device_xname(self),
|
||||
RND_TYPE_NET, RND_FLAG_DEFAULT);
|
||||
|
||||
if (sysctl_createv(&sc->vte_clog, 0, NULL, &node,
|
||||
0, CTLTYPE_NODE, device_xname(sc->vte_dev),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_wm.c,v 1.637 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: if_wm.c,v 1.638 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
|
||||
|
@ -82,7 +82,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.637 2019/05/23 10:57:28 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.638 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_net_mpsafe.h"
|
||||
|
@ -390,7 +390,7 @@ struct wm_txqueue {
|
|||
WM_Q_EVCNT_DEFINE(txq, tusum6) /* TCP/UDP v6 cksums comp. */
|
||||
WM_Q_EVCNT_DEFINE(txq, tso) /* TCP seg offload (IPv4) */
|
||||
WM_Q_EVCNT_DEFINE(txq, tso6) /* TCP seg offload (IPv6) */
|
||||
WM_Q_EVCNT_DEFINE(txq, tsopain) /* Painful header manip. for TSO */
|
||||
WM_Q_EVCNT_DEFINE(txq, tsopain) /* Painful header manip. for TSO */
|
||||
WM_Q_EVCNT_DEFINE(txq, pcqdrop) /* Pkt dropped in pcq */
|
||||
WM_Q_EVCNT_DEFINE(txq, descdrop) /* Pkt dropped in MAC desc ring */
|
||||
/* other than toomanyseg */
|
||||
|
@ -11831,7 +11831,7 @@ wm_tbi_mediachange(struct ifnet *ifp)
|
|||
CSR_WRITE_FLUSH(sc);
|
||||
delay(1000);
|
||||
|
||||
ctrl = CSR_READ(sc, WMREG_CTRL);
|
||||
ctrl = CSR_READ(sc, WMREG_CTRL);
|
||||
signal = wm_tbi_havesignal(sc, ctrl);
|
||||
|
||||
DPRINTF(WM_DEBUG_LINK, ("%s: signal = %d\n", device_xname(sc->sc_dev),
|
||||
|
@ -15777,7 +15777,7 @@ wm_set_mdio_slow_mode_hv(struct wm_softc *sc)
|
|||
if (rv != 0)
|
||||
return rv;
|
||||
|
||||
return wm_gmii_hv_writereg(sc->sc_dev, 1, HV_KMRN_MODE_CTRL,
|
||||
return wm_gmii_hv_writereg(sc->sc_dev, 1, HV_KMRN_MODE_CTRL,
|
||||
reg | HV_KMRN_MDIO_SLOW);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ixgbe.c,v 1.185 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: ixgbe.c,v 1.186 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
|
@ -152,39 +152,39 @@ static const char *ixgbe_strings[] = {
|
|||
/************************************************************************
|
||||
* Function prototypes
|
||||
************************************************************************/
|
||||
static int ixgbe_probe(device_t, cfdata_t, void *);
|
||||
static void ixgbe_attach(device_t, device_t, void *);
|
||||
static int ixgbe_detach(device_t, int);
|
||||
static int ixgbe_probe(device_t, cfdata_t, void *);
|
||||
static void ixgbe_attach(device_t, device_t, void *);
|
||||
static int ixgbe_detach(device_t, int);
|
||||
#if 0
|
||||
static int ixgbe_shutdown(device_t);
|
||||
static int ixgbe_shutdown(device_t);
|
||||
#endif
|
||||
static bool ixgbe_suspend(device_t, const pmf_qual_t *);
|
||||
static bool ixgbe_resume(device_t, const pmf_qual_t *);
|
||||
static int ixgbe_ifflags_cb(struct ethercom *);
|
||||
static int ixgbe_ioctl(struct ifnet *, u_long, void *);
|
||||
static int ixgbe_ioctl(struct ifnet *, u_long, void *);
|
||||
static void ixgbe_ifstop(struct ifnet *, int);
|
||||
static int ixgbe_init(struct ifnet *);
|
||||
static void ixgbe_init_locked(struct adapter *);
|
||||
static void ixgbe_stop(void *);
|
||||
static void ixgbe_init_device_features(struct adapter *);
|
||||
static void ixgbe_check_fan_failure(struct adapter *, u32, bool);
|
||||
static void ixgbe_stop(void *);
|
||||
static void ixgbe_init_device_features(struct adapter *);
|
||||
static void ixgbe_check_fan_failure(struct adapter *, u32, bool);
|
||||
static void ixgbe_add_media_types(struct adapter *);
|
||||
static void ixgbe_media_status(struct ifnet *, struct ifmediareq *);
|
||||
static int ixgbe_media_change(struct ifnet *);
|
||||
static int ixgbe_allocate_pci_resources(struct adapter *,
|
||||
static void ixgbe_media_status(struct ifnet *, struct ifmediareq *);
|
||||
static int ixgbe_media_change(struct ifnet *);
|
||||
static int ixgbe_allocate_pci_resources(struct adapter *,
|
||||
const struct pci_attach_args *);
|
||||
static void ixgbe_free_softint(struct adapter *);
|
||||
static void ixgbe_free_softint(struct adapter *);
|
||||
static void ixgbe_get_slot_info(struct adapter *);
|
||||
static int ixgbe_allocate_msix(struct adapter *,
|
||||
static int ixgbe_allocate_msix(struct adapter *,
|
||||
const struct pci_attach_args *);
|
||||
static int ixgbe_allocate_legacy(struct adapter *,
|
||||
static int ixgbe_allocate_legacy(struct adapter *,
|
||||
const struct pci_attach_args *);
|
||||
static int ixgbe_configure_interrupts(struct adapter *);
|
||||
static int ixgbe_configure_interrupts(struct adapter *);
|
||||
static void ixgbe_free_pciintr_resources(struct adapter *);
|
||||
static void ixgbe_free_pci_resources(struct adapter *);
|
||||
static void ixgbe_local_timer(void *);
|
||||
static void ixgbe_local_timer1(void *);
|
||||
static void ixgbe_recovery_mode_timer(void *);
|
||||
static void ixgbe_recovery_mode_timer(void *);
|
||||
static int ixgbe_setup_interface(device_t, struct adapter *);
|
||||
static void ixgbe_config_gpie(struct adapter *);
|
||||
static void ixgbe_config_dmac(struct adapter *);
|
||||
|
@ -196,18 +196,18 @@ static int ixgbe_setup_low_power_mode(struct adapter *);
|
|||
static void ixgbe_rearm_queues(struct adapter *, u64);
|
||||
#endif
|
||||
|
||||
static void ixgbe_initialize_transmit_units(struct adapter *);
|
||||
static void ixgbe_initialize_receive_units(struct adapter *);
|
||||
static void ixgbe_initialize_transmit_units(struct adapter *);
|
||||
static void ixgbe_initialize_receive_units(struct adapter *);
|
||||
static void ixgbe_enable_rx_drop(struct adapter *);
|
||||
static void ixgbe_disable_rx_drop(struct adapter *);
|
||||
static void ixgbe_initialize_rss_mapping(struct adapter *);
|
||||
|
||||
static void ixgbe_enable_intr(struct adapter *);
|
||||
static void ixgbe_disable_intr(struct adapter *);
|
||||
static void ixgbe_update_stats_counters(struct adapter *);
|
||||
static void ixgbe_set_promisc(struct adapter *);
|
||||
static void ixgbe_set_multi(struct adapter *);
|
||||
static void ixgbe_update_link_status(struct adapter *);
|
||||
static void ixgbe_enable_intr(struct adapter *);
|
||||
static void ixgbe_disable_intr(struct adapter *);
|
||||
static void ixgbe_update_stats_counters(struct adapter *);
|
||||
static void ixgbe_set_promisc(struct adapter *);
|
||||
static void ixgbe_set_multi(struct adapter *);
|
||||
static void ixgbe_update_link_status(struct adapter *);
|
||||
static void ixgbe_set_ivar(struct adapter *, u8, u8, s8);
|
||||
static void ixgbe_configure_ivars(struct adapter *);
|
||||
static u8 * ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *);
|
||||
|
@ -220,18 +220,18 @@ static void ixgbe_unregister_vlan(void *, struct ifnet *, u16);
|
|||
#endif
|
||||
|
||||
static void ixgbe_add_device_sysctls(struct adapter *);
|
||||
static void ixgbe_add_hw_stats(struct adapter *);
|
||||
static void ixgbe_add_hw_stats(struct adapter *);
|
||||
static void ixgbe_clear_evcnt(struct adapter *);
|
||||
static int ixgbe_set_flowcntl(struct adapter *, int);
|
||||
static int ixgbe_set_advertise(struct adapter *, int);
|
||||
static int ixgbe_get_advertise(struct adapter *);
|
||||
static int ixgbe_get_advertise(struct adapter *);
|
||||
|
||||
/* Sysctl handlers */
|
||||
static void ixgbe_set_sysctl_value(struct adapter *, const char *,
|
||||
const char *, int *, int);
|
||||
static int ixgbe_sysctl_flowcntl(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_advertise(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_interrupt_rate_handler(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_interrupt_rate_handler(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_dmac(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_phy_temp(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_phy_overtemp_occurred(SYSCTLFN_PROTO);
|
||||
|
@ -239,12 +239,12 @@ static int ixgbe_sysctl_phy_overtemp_occurred(SYSCTLFN_PROTO);
|
|||
static int ixgbe_sysctl_power_state(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_print_rss_config(SYSCTLFN_PROTO);
|
||||
#endif
|
||||
static int ixgbe_sysctl_next_to_check_handler(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_rdh_handler(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_rdt_handler(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_tdt_handler(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_tdh_handler(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_eee_state(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_next_to_check_handler(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_rdh_handler(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_rdt_handler(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_tdt_handler(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_tdh_handler(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_eee_state(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_debug(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_wol_enable(SYSCTLFN_PROTO);
|
||||
static int ixgbe_sysctl_wufc(SYSCTLFN_PROTO);
|
||||
|
@ -419,10 +419,10 @@ static void
|
|||
ixgbe_initialize_rss_mapping(struct adapter *adapter)
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
u32 reta = 0, mrqc, rss_key[10];
|
||||
int queue_id, table_size, index_mult;
|
||||
int i, j;
|
||||
u32 rss_hash_config;
|
||||
u32 reta = 0, mrqc, rss_key[10];
|
||||
int queue_id, table_size, index_mult;
|
||||
int i, j;
|
||||
u32 rss_hash_config;
|
||||
|
||||
/* force use default RSS key. */
|
||||
#ifdef __NetBSD__
|
||||
|
@ -499,11 +499,11 @@ ixgbe_initialize_rss_mapping(struct adapter *adapter)
|
|||
* traffic.
|
||||
*/
|
||||
rss_hash_config = RSS_HASHTYPE_RSS_IPV4
|
||||
| RSS_HASHTYPE_RSS_TCP_IPV4
|
||||
| RSS_HASHTYPE_RSS_IPV6
|
||||
| RSS_HASHTYPE_RSS_TCP_IPV6
|
||||
| RSS_HASHTYPE_RSS_IPV6_EX
|
||||
| RSS_HASHTYPE_RSS_TCP_IPV6_EX;
|
||||
| RSS_HASHTYPE_RSS_TCP_IPV4
|
||||
| RSS_HASHTYPE_RSS_IPV6
|
||||
| RSS_HASHTYPE_RSS_TCP_IPV6
|
||||
| RSS_HASHTYPE_RSS_IPV6_EX
|
||||
| RSS_HASHTYPE_RSS_TCP_IPV6_EX;
|
||||
}
|
||||
|
||||
mrqc = IXGBE_MRQC_RSSEN;
|
||||
|
@ -539,8 +539,8 @@ ixgbe_initialize_receive_units(struct adapter *adapter)
|
|||
{
|
||||
struct rx_ring *rxr = adapter->rx_rings;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
int i, j;
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
int i, j;
|
||||
u32 bufsz, fctrl, srrctl, rxcsum;
|
||||
u32 hlreg;
|
||||
|
||||
|
@ -633,9 +633,9 @@ ixgbe_initialize_receive_units(struct adapter *adapter)
|
|||
|
||||
if (adapter->hw.mac.type != ixgbe_mac_82598EB) {
|
||||
u32 psrtype = IXGBE_PSRTYPE_TCPHDR
|
||||
| IXGBE_PSRTYPE_UDPHDR
|
||||
| IXGBE_PSRTYPE_IPV4HDR
|
||||
| IXGBE_PSRTYPE_IPV6HDR;
|
||||
| IXGBE_PSRTYPE_UDPHDR
|
||||
| IXGBE_PSRTYPE_IPV4HDR
|
||||
| IXGBE_PSRTYPE_IPV6HDR;
|
||||
IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(0), psrtype);
|
||||
}
|
||||
|
||||
|
@ -665,7 +665,7 @@ ixgbe_initialize_receive_units(struct adapter *adapter)
|
|||
static void
|
||||
ixgbe_initialize_transmit_units(struct adapter *adapter)
|
||||
{
|
||||
struct tx_ring *txr = adapter->tx_rings;
|
||||
struct tx_ring *txr = adapter->tx_rings;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
int i;
|
||||
|
||||
|
@ -763,9 +763,9 @@ ixgbe_initialize_transmit_units(struct adapter *adapter)
|
|||
static void
|
||||
ixgbe_attach(device_t parent, device_t dev, void *aux)
|
||||
{
|
||||
struct adapter *adapter;
|
||||
struct adapter *adapter;
|
||||
struct ixgbe_hw *hw;
|
||||
int error = -1;
|
||||
int error = -1;
|
||||
u32 ctrl_ext;
|
||||
u16 high, low, nvmreg;
|
||||
pcireg_t id, subid;
|
||||
|
@ -1262,7 +1262,7 @@ static void
|
|||
ixgbe_check_wol_support(struct adapter *adapter)
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
u16 dev_caps = 0;
|
||||
u16 dev_caps = 0;
|
||||
|
||||
/* Find out WoL support for port */
|
||||
adapter->wol_support = hw->wol_enabled = 0;
|
||||
|
@ -1345,15 +1345,15 @@ ixgbe_setup_interface(device_t dev, struct adapter *adapter)
|
|||
|
||||
/* Set capability flags */
|
||||
ifp->if_capabilities |= IFCAP_RXCSUM
|
||||
| IFCAP_TXCSUM
|
||||
| IFCAP_TSOv4
|
||||
| IFCAP_TSOv6;
|
||||
| IFCAP_TXCSUM
|
||||
| IFCAP_TSOv4
|
||||
| IFCAP_TSOv6;
|
||||
ifp->if_capenable = 0;
|
||||
|
||||
ec->ec_capabilities |= ETHERCAP_VLAN_HWTAGGING
|
||||
| ETHERCAP_VLAN_HWCSUM
|
||||
| ETHERCAP_JUMBO_MTU
|
||||
| ETHERCAP_VLAN_MTU;
|
||||
| ETHERCAP_VLAN_HWCSUM
|
||||
| ETHERCAP_JUMBO_MTU
|
||||
| ETHERCAP_VLAN_MTU;
|
||||
|
||||
/* Enable the above capabilities by default */
|
||||
ec->ec_capenable = ec->ec_capabilities;
|
||||
|
@ -1393,8 +1393,8 @@ static void
|
|||
ixgbe_add_media_types(struct adapter *adapter)
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
device_t dev = adapter->dev;
|
||||
u64 layer;
|
||||
device_t dev = adapter->dev;
|
||||
u64 layer;
|
||||
|
||||
layer = adapter->phy_layer;
|
||||
|
||||
|
@ -1503,8 +1503,8 @@ static void
|
|||
ixgbe_config_link(struct adapter *adapter)
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
u32 autoneg, err = 0;
|
||||
bool sfp, negotiate = false;
|
||||
u32 autoneg, err = 0;
|
||||
bool sfp, negotiate = false;
|
||||
|
||||
sfp = ixgbe_is_sfp(hw);
|
||||
|
||||
|
@ -1519,7 +1519,7 @@ ixgbe_config_link(struct adapter *adapter)
|
|||
softint_schedule(adapter->mod_si);
|
||||
kpreempt_enable();
|
||||
} else {
|
||||
struct ifmedia *ifm = &adapter->media;
|
||||
struct ifmedia *ifm = &adapter->media;
|
||||
|
||||
if (hw->mac.ops.check_link)
|
||||
err = ixgbe_check_link(hw, &adapter->link_speed,
|
||||
|
@ -1534,12 +1534,12 @@ ixgbe_config_link(struct adapter *adapter)
|
|||
autoneg = hw->phy.autoneg_advertised;
|
||||
if ((IFM_SUBTYPE(ifm->ifm_cur->ifm_media) != IFM_NONE)
|
||||
&& ((!autoneg) && (hw->mac.ops.get_link_capabilities)))
|
||||
err = hw->mac.ops.get_link_capabilities(hw, &autoneg,
|
||||
err = hw->mac.ops.get_link_capabilities(hw, &autoneg,
|
||||
&negotiate);
|
||||
if (err)
|
||||
return;
|
||||
if (hw->mac.ops.setup_link)
|
||||
err = hw->mac.ops.setup_link(hw, autoneg,
|
||||
err = hw->mac.ops.setup_link(hw, autoneg,
|
||||
adapter->link_up);
|
||||
}
|
||||
|
||||
|
@ -1551,13 +1551,13 @@ ixgbe_config_link(struct adapter *adapter)
|
|||
static void
|
||||
ixgbe_update_stats_counters(struct adapter *adapter)
|
||||
{
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct ixgbe_hw_stats *stats = &adapter->stats.pf;
|
||||
u32 missed_rx = 0, bprc, lxon, lxoff, total;
|
||||
u64 total_missed_rx = 0;
|
||||
uint64_t crcerrs, rlec;
|
||||
unsigned int queue_counters;
|
||||
u32 missed_rx = 0, bprc, lxon, lxoff, total;
|
||||
u64 total_missed_rx = 0;
|
||||
uint64_t crcerrs, rlec;
|
||||
unsigned int queue_counters;
|
||||
int i;
|
||||
|
||||
crcerrs = IXGBE_READ_REG(hw, IXGBE_CRCERRS);
|
||||
|
@ -2354,7 +2354,7 @@ ixgbe_setup_vlan_hw_support(struct adapter *adapter)
|
|||
struct ethercom *ec = &adapter->osdep.ec;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct rx_ring *rxr;
|
||||
int i;
|
||||
int i;
|
||||
u32 ctrl;
|
||||
bool hwtagging;
|
||||
|
||||
|
@ -2420,9 +2420,9 @@ ixgbe_get_slot_info(struct adapter *adapter)
|
|||
{
|
||||
device_t dev = adapter->dev;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
u32 offset;
|
||||
u32 offset;
|
||||
u16 link;
|
||||
int bus_info_valid = TRUE;
|
||||
int bus_info_valid = TRUE;
|
||||
|
||||
/* Some devices are behind an internal bridge */
|
||||
switch (hw->device_id) {
|
||||
|
@ -2483,9 +2483,9 @@ get_parent_info:
|
|||
|
||||
display:
|
||||
device_printf(dev, "PCI Express Bus: Speed %s Width %s\n",
|
||||
((hw->bus.speed == ixgbe_bus_speed_8000) ? "8.0GT/s" :
|
||||
(hw->bus.speed == ixgbe_bus_speed_5000) ? "5.0GT/s" :
|
||||
(hw->bus.speed == ixgbe_bus_speed_2500) ? "2.5GT/s" :
|
||||
((hw->bus.speed == ixgbe_bus_speed_8000) ? "8.0GT/s" :
|
||||
(hw->bus.speed == ixgbe_bus_speed_5000) ? "5.0GT/s" :
|
||||
(hw->bus.speed == ixgbe_bus_speed_2500) ? "2.5GT/s" :
|
||||
"Unknown"),
|
||||
((hw->bus.width == ixgbe_bus_width_pcie_x8) ? "x8" :
|
||||
(hw->bus.width == ixgbe_bus_width_pcie_x4) ? "x4" :
|
||||
|
@ -2525,8 +2525,8 @@ ixgbe_enable_queue(struct adapter *adapter, u32 vector)
|
|||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct ix_queue *que = &adapter->queues[vector];
|
||||
u64 queue = (u64)(1ULL << vector);
|
||||
u32 mask;
|
||||
u64 queue = (u64)(1ULL << vector);
|
||||
u32 mask;
|
||||
|
||||
mutex_enter(&que->dc_mtx);
|
||||
if (que->disabled_count > 0 && --que->disabled_count > 0)
|
||||
|
@ -2555,8 +2555,8 @@ ixgbe_disable_queue_internal(struct adapter *adapter, u32 vector, bool nestok)
|
|||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct ix_queue *que = &adapter->queues[vector];
|
||||
u64 queue = (u64)(1ULL << vector);
|
||||
u32 mask;
|
||||
u64 queue = (u64)(1ULL << vector);
|
||||
u32 mask;
|
||||
|
||||
mutex_enter(&que->dc_mtx);
|
||||
|
||||
|
@ -2629,8 +2629,8 @@ static int
|
|||
ixgbe_msix_que(void *arg)
|
||||
{
|
||||
struct ix_queue *que = arg;
|
||||
struct adapter *adapter = que->adapter;
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
struct adapter *adapter = que->adapter;
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
struct tx_ring *txr = que->txr;
|
||||
struct rx_ring *rxr = que->rxr;
|
||||
bool more;
|
||||
|
@ -2676,8 +2676,8 @@ ixgbe_msix_que(void *arg)
|
|||
que->eitr_setting = 0;
|
||||
|
||||
/* Idle, do nothing */
|
||||
if ((txr->bytes == 0) && (rxr->bytes == 0))
|
||||
goto no_calc;
|
||||
if ((txr->bytes == 0) && (rxr->bytes == 0))
|
||||
goto no_calc;
|
||||
|
||||
if ((txr->bytes) && (txr->packets))
|
||||
newitr = txr->bytes/txr->packets;
|
||||
|
@ -2706,8 +2706,8 @@ ixgbe_msix_que(void *arg)
|
|||
newitr = IXGBE_MIN_RSC_EITR_10G1G;
|
||||
}
|
||||
|
||||
/* save for next interrupt */
|
||||
que->eitr_setting = newitr;
|
||||
/* save for next interrupt */
|
||||
que->eitr_setting = newitr;
|
||||
|
||||
/* Reset state */
|
||||
txr->bytes = 0;
|
||||
|
@ -2881,9 +2881,9 @@ ixgbe_media_status(struct ifnet *ifp, struct ifmediareq *ifmr)
|
|||
static int
|
||||
ixgbe_media_change(struct ifnet *ifp)
|
||||
{
|
||||
struct adapter *adapter = ifp->if_softc;
|
||||
struct ifmedia *ifm = &adapter->media;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct adapter *adapter = ifp->if_softc;
|
||||
struct ifmedia *ifm = &adapter->media;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
ixgbe_link_speed speed = 0;
|
||||
ixgbe_link_speed link_caps = 0;
|
||||
bool negotiate = false;
|
||||
|
@ -2985,8 +2985,8 @@ static void
|
|||
ixgbe_set_promisc(struct adapter *adapter)
|
||||
{
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
int mcnt = 0;
|
||||
u32 rctl;
|
||||
int mcnt = 0;
|
||||
u32 rctl;
|
||||
struct ether_multi *enm;
|
||||
struct ether_multistep step;
|
||||
struct ethercom *ec = &adapter->osdep.ec;
|
||||
|
@ -3030,7 +3030,7 @@ ixgbe_msix_link(void *arg)
|
|||
struct adapter *adapter = arg;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
u32 eicr, eicr_mask;
|
||||
s32 retval;
|
||||
s32 retval;
|
||||
|
||||
++adapter->link_irq.ev_count;
|
||||
|
||||
|
@ -3139,7 +3139,7 @@ ixgbe_msix_link(void *arg)
|
|||
(eicr & IXGBE_EICR_GPI_SDP0_X540)) {
|
||||
IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP0_X540);
|
||||
softint_schedule(adapter->phy_si);
|
||||
}
|
||||
}
|
||||
|
||||
/* Re-enable other interrupts */
|
||||
IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_OTHER);
|
||||
|
@ -3150,10 +3150,10 @@ static void
|
|||
ixgbe_eitr_write(struct adapter *adapter, uint32_t index, uint32_t itr)
|
||||
{
|
||||
|
||||
if (adapter->hw.mac.type == ixgbe_mac_82598EB)
|
||||
itr |= itr << 16;
|
||||
else
|
||||
itr |= IXGBE_EITR_CNT_WDIS;
|
||||
if (adapter->hw.mac.type == ixgbe_mac_82598EB)
|
||||
itr |= itr << 16;
|
||||
else
|
||||
itr |= IXGBE_EITR_CNT_WDIS;
|
||||
|
||||
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(index), itr);
|
||||
}
|
||||
|
@ -3167,7 +3167,7 @@ ixgbe_sysctl_interrupt_rate_handler(SYSCTLFN_ARGS)
|
|||
{
|
||||
struct sysctlnode node = *rnode;
|
||||
struct ix_queue *que = (struct ix_queue *)node.sysctl_data;
|
||||
struct adapter *adapter;
|
||||
struct adapter *adapter;
|
||||
uint32_t reg, usec, rate;
|
||||
int error;
|
||||
|
||||
|
@ -3245,8 +3245,8 @@ err:
|
|||
static void
|
||||
ixgbe_add_device_sysctls(struct adapter *adapter)
|
||||
{
|
||||
device_t dev = adapter->dev;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
device_t dev = adapter->dev;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct sysctllog **log;
|
||||
const struct sysctlnode *rnode, *cnode;
|
||||
|
||||
|
@ -3414,7 +3414,7 @@ ixgbe_allocate_pci_resources(struct adapter *adapter,
|
|||
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:
|
||||
adapter->osdep.mem_bus_space_tag = pa->pa_memt;
|
||||
if (pci_mapreg_info(pa->pa_pc, pa->pa_tag, PCI_BAR(0),
|
||||
memtype, &addr, &adapter->osdep.mem_size, &flags) != 0)
|
||||
memtype, &addr, &adapter->osdep.mem_size, &flags) != 0)
|
||||
goto map_err;
|
||||
if ((flags & BUS_SPACE_MAP_PREFETCHABLE) != 0) {
|
||||
aprint_normal_dev(dev, "clearing prefetchable bit\n");
|
||||
|
@ -3709,8 +3709,8 @@ static int
|
|||
ixgbe_setup_low_power_mode(struct adapter *adapter)
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
device_t dev = adapter->dev;
|
||||
s32 error = 0;
|
||||
device_t dev = adapter->dev;
|
||||
s32 error = 0;
|
||||
|
||||
KASSERT(mutex_owned(&adapter->core_mtx));
|
||||
|
||||
|
@ -3789,7 +3789,7 @@ static bool
|
|||
ixgbe_suspend(device_t dev, const pmf_qual_t *qual)
|
||||
{
|
||||
struct adapter *adapter = device_private(dev);
|
||||
int error = 0;
|
||||
int error = 0;
|
||||
|
||||
INIT_DEBUGOUT("ixgbe_suspend: begin");
|
||||
|
||||
|
@ -3810,10 +3810,10 @@ ixgbe_suspend(device_t dev, const pmf_qual_t *qual)
|
|||
static bool
|
||||
ixgbe_resume(device_t dev, const pmf_qual_t *qual)
|
||||
{
|
||||
struct adapter *adapter = device_private(dev);
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
struct adapter *adapter = device_private(dev);
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
u32 wus;
|
||||
u32 wus;
|
||||
|
||||
INIT_DEBUGOUT("ixgbe_resume: begin");
|
||||
|
||||
|
@ -3867,15 +3867,15 @@ static void
|
|||
ixgbe_init_locked(struct adapter *adapter)
|
||||
{
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
device_t dev = adapter->dev;
|
||||
device_t dev = adapter->dev;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct ix_queue *que;
|
||||
struct tx_ring *txr;
|
||||
struct rx_ring *rxr;
|
||||
struct tx_ring *txr;
|
||||
struct rx_ring *rxr;
|
||||
u32 txdctl, mhadd;
|
||||
u32 rxdctl, rxctrl;
|
||||
u32 ctrl_ext;
|
||||
int i, j, err;
|
||||
u32 ctrl_ext;
|
||||
int i, j, err;
|
||||
|
||||
/* XXX check IFF_UP and IFF_RUNNING, power-saving state! */
|
||||
|
||||
|
@ -3884,7 +3884,7 @@ ixgbe_init_locked(struct adapter *adapter)
|
|||
|
||||
hw->adapter_stopped = FALSE;
|
||||
ixgbe_stop_adapter(hw);
|
||||
callout_stop(&adapter->timer);
|
||||
callout_stop(&adapter->timer);
|
||||
for (i = 0, que = adapter->queues; i < adapter->num_queues; i++, que++)
|
||||
que->disabled_count = 0;
|
||||
|
||||
|
@ -4056,10 +4056,10 @@ ixgbe_init_locked(struct adapter *adapter)
|
|||
if (hw->phy.type == ixgbe_phy_none) {
|
||||
err = hw->phy.ops.identify(hw);
|
||||
if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) {
|
||||
device_printf(dev,
|
||||
device_printf(dev,
|
||||
"Unsupported SFP+ module type was detected.\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Set moderation on the Link interrupt */
|
||||
|
@ -4182,7 +4182,7 @@ static void
|
|||
ixgbe_configure_ivars(struct adapter *adapter)
|
||||
{
|
||||
struct ix_queue *que = adapter->queues;
|
||||
u32 newitr;
|
||||
u32 newitr;
|
||||
|
||||
if (ixgbe_max_interrupt_rate > 0)
|
||||
newitr = (4000000 / ixgbe_max_interrupt_rate) & 0x0FF8;
|
||||
|
@ -4195,11 +4195,11 @@ ixgbe_configure_ivars(struct adapter *adapter)
|
|||
newitr = 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < adapter->num_queues; i++, que++) {
|
||||
for (int i = 0; i < adapter->num_queues; i++, que++) {
|
||||
struct rx_ring *rxr = &adapter->rx_rings[i];
|
||||
struct tx_ring *txr = &adapter->tx_rings[i];
|
||||
/* First the RX queue entry */
|
||||
ixgbe_set_ivar(adapter, rxr->me, que->msix, 0);
|
||||
ixgbe_set_ivar(adapter, rxr->me, que->msix, 0);
|
||||
/* ... and the TX */
|
||||
ixgbe_set_ivar(adapter, txr->me, que->msix, 1);
|
||||
/* Set an Initial EITR value */
|
||||
|
@ -4214,7 +4214,7 @@ ixgbe_configure_ivars(struct adapter *adapter)
|
|||
}
|
||||
|
||||
/* For the Link interrupt */
|
||||
ixgbe_set_ivar(adapter, 1, adapter->vector, -1);
|
||||
ixgbe_set_ivar(adapter, 1, adapter->vector, -1);
|
||||
} /* ixgbe_configure_ivars */
|
||||
|
||||
/************************************************************************
|
||||
|
@ -4224,16 +4224,16 @@ static void
|
|||
ixgbe_config_gpie(struct adapter *adapter)
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
u32 gpie;
|
||||
u32 gpie;
|
||||
|
||||
gpie = IXGBE_READ_REG(hw, IXGBE_GPIE);
|
||||
|
||||
if (adapter->feat_en & IXGBE_FEATURE_MSIX) {
|
||||
/* Enable Enhanced MSI-X mode */
|
||||
gpie |= IXGBE_GPIE_MSIX_MODE
|
||||
| IXGBE_GPIE_EIAME
|
||||
| IXGBE_GPIE_PBA_SUPPORT
|
||||
| IXGBE_GPIE_OCD;
|
||||
| IXGBE_GPIE_EIAME
|
||||
| IXGBE_GPIE_PBA_SUPPORT
|
||||
| IXGBE_GPIE_OCD;
|
||||
}
|
||||
|
||||
/* Fan Failure Interrupt */
|
||||
|
@ -4270,7 +4270,7 @@ static void
|
|||
ixgbe_config_delay_values(struct adapter *adapter)
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
u32 rxpb, frame, size, tmp;
|
||||
u32 rxpb, frame, size, tmp;
|
||||
|
||||
frame = adapter->max_frame_size;
|
||||
|
||||
|
@ -4428,7 +4428,7 @@ ixgbe_local_timer1(void *arg)
|
|||
v0 = v1 = v2 = v3 = v4 = v5 = v6 = v7 = 0;
|
||||
que = adapter->queues;
|
||||
for (i = 0; i < adapter->num_queues; i++, que++) {
|
||||
struct tx_ring *txr = que->txr;
|
||||
struct tx_ring *txr = que->txr;
|
||||
|
||||
v0 += txr->q_efbig_tx_dma_setup;
|
||||
v1 += txr->q_mbuf_defrag_failed;
|
||||
|
@ -4450,8 +4450,8 @@ ixgbe_local_timer1(void *arg)
|
|||
|
||||
/*
|
||||
* Check the TX queues status
|
||||
* - mark hung queues so we don't schedule on them
|
||||
* - watchdog only if all queues show hung
|
||||
* - mark hung queues so we don't schedule on them
|
||||
* - watchdog only if all queues show hung
|
||||
*/
|
||||
que = adapter->queues;
|
||||
for (i = 0; i < adapter->num_queues; i++, que++) {
|
||||
|
@ -4557,7 +4557,7 @@ ixgbe_sfp_probe(struct adapter *adapter)
|
|||
device_printf(dev,"Unsupported SFP+ module detected!");
|
||||
device_printf(dev,
|
||||
"Reload driver with supported module.\n");
|
||||
goto out;
|
||||
goto out;
|
||||
} else
|
||||
device_printf(dev, "SFP+ module detected!\n");
|
||||
/* We now have supported optics */
|
||||
|
@ -4574,10 +4574,10 @@ out:
|
|||
static void
|
||||
ixgbe_handle_mod(void *context)
|
||||
{
|
||||
struct adapter *adapter = context;
|
||||
struct adapter *adapter = context;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
device_t dev = adapter->dev;
|
||||
u32 err, cage_full = 0;
|
||||
u32 err, cage_full = 0;
|
||||
|
||||
++adapter->mod_sicount.ev_count;
|
||||
if (adapter->hw.need_crosstalk_fix) {
|
||||
|
@ -4626,10 +4626,10 @@ ixgbe_handle_mod(void *context)
|
|||
static void
|
||||
ixgbe_handle_msf(void *context)
|
||||
{
|
||||
struct adapter *adapter = context;
|
||||
struct adapter *adapter = context;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
u32 autoneg;
|
||||
bool negotiate;
|
||||
u32 autoneg;
|
||||
bool negotiate;
|
||||
|
||||
IXGBE_CORE_LOCK(adapter);
|
||||
++adapter->msf_sicount.ev_count;
|
||||
|
@ -4657,7 +4657,7 @@ ixgbe_handle_msf(void *context)
|
|||
static void
|
||||
ixgbe_handle_phy(void *context)
|
||||
{
|
||||
struct adapter *adapter = context;
|
||||
struct adapter *adapter = context;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
int error;
|
||||
|
||||
|
@ -4691,8 +4691,8 @@ ixgbe_ifstop(struct ifnet *ifp, int disable)
|
|||
static void
|
||||
ixgbe_stop(void *arg)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
struct adapter *adapter = arg;
|
||||
struct ifnet *ifp;
|
||||
struct adapter *adapter = arg;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
|
||||
ifp = adapter->ifp;
|
||||
|
@ -4728,14 +4728,14 @@ ixgbe_stop(void *arg)
|
|||
* ixgbe_update_link_status - Update OS on link state
|
||||
*
|
||||
* Note: Only updates the OS on the cached link state.
|
||||
* The real check of the hardware only happens with
|
||||
* a link interrupt.
|
||||
* The real check of the hardware only happens with
|
||||
* a link interrupt.
|
||||
************************************************************************/
|
||||
static void
|
||||
ixgbe_update_link_status(struct adapter *adapter)
|
||||
{
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
device_t dev = adapter->dev;
|
||||
device_t dev = adapter->dev;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
|
||||
KASSERT(mutex_owned(&adapter->core_mtx));
|
||||
|
@ -4804,7 +4804,7 @@ ixgbe_update_link_status(struct adapter *adapter)
|
|||
/*
|
||||
* Do it when link active changes to DOWN. i.e.
|
||||
* a) LINK_STATE_UNKNOWN -> LINK_STATE_DOWN
|
||||
* b) LINK_STATE_UP -> LINK_STATE_DOWN
|
||||
* b) LINK_STATE_UP -> LINK_STATE_DOWN
|
||||
*/
|
||||
if (adapter->link_active != LINK_STATE_DOWN) {
|
||||
if (bootverbose)
|
||||
|
@ -4921,8 +4921,8 @@ ixgbe_enable_intr(struct adapter *adapter)
|
|||
* allow for handling the extended (beyond 32) MSI-X
|
||||
* vectors that can be used by 82599
|
||||
*/
|
||||
for (int i = 0; i < adapter->num_queues; i++, que++)
|
||||
ixgbe_enable_queue(adapter, que->msix);
|
||||
for (int i = 0; i < adapter->num_queues; i++, que++)
|
||||
ixgbe_enable_queue(adapter, que->msix);
|
||||
|
||||
IXGBE_WRITE_FLUSH(hw);
|
||||
|
||||
|
@ -4978,10 +4978,10 @@ ixgbe_legacy_irq(void *arg)
|
|||
struct ix_queue *que = arg;
|
||||
struct adapter *adapter = que->adapter;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
struct tx_ring *txr = adapter->tx_rings;
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
struct tx_ring *txr = adapter->tx_rings;
|
||||
bool more = false;
|
||||
u32 eicr, eicr_mask;
|
||||
u32 eicr, eicr_mask;
|
||||
|
||||
/* Silicon errata #26 on 82598 */
|
||||
IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_IRQ_CLEAR_MASK);
|
||||
|
@ -5126,7 +5126,7 @@ static void
|
|||
ixgbe_set_sysctl_value(struct adapter *adapter, const char *name,
|
||||
const char *description, int *limit, int value)
|
||||
{
|
||||
device_t dev = adapter->dev;
|
||||
device_t dev = adapter->dev;
|
||||
struct sysctllog **log;
|
||||
const struct sysctlnode *rnode, *cnode;
|
||||
|
||||
|
@ -5227,8 +5227,8 @@ static void
|
|||
ixgbe_enable_rx_drop(struct adapter *adapter)
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct rx_ring *rxr;
|
||||
u32 srrctl;
|
||||
struct rx_ring *rxr;
|
||||
u32 srrctl;
|
||||
|
||||
for (int i = 0; i < adapter->num_queues; i++) {
|
||||
rxr = &adapter->rx_rings[i];
|
||||
|
@ -5252,14 +5252,14 @@ static void
|
|||
ixgbe_disable_rx_drop(struct adapter *adapter)
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct rx_ring *rxr;
|
||||
u32 srrctl;
|
||||
struct rx_ring *rxr;
|
||||
u32 srrctl;
|
||||
|
||||
for (int i = 0; i < adapter->num_queues; i++) {
|
||||
rxr = &adapter->rx_rings[i];
|
||||
srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(rxr->me));
|
||||
srrctl &= ~IXGBE_SRRCTL_DROP_EN;
|
||||
IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(rxr->me), srrctl);
|
||||
srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(rxr->me));
|
||||
srrctl &= ~IXGBE_SRRCTL_DROP_EN;
|
||||
IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(rxr->me), srrctl);
|
||||
}
|
||||
|
||||
/* disable drop for each vf */
|
||||
|
@ -5279,7 +5279,7 @@ ixgbe_sysctl_advertise(SYSCTLFN_ARGS)
|
|||
{
|
||||
struct sysctlnode node = *rnode;
|
||||
struct adapter *adapter = (struct adapter *)node.sysctl_data;
|
||||
int error = 0, advertise;
|
||||
int error = 0, advertise;
|
||||
|
||||
if (ixgbe_fw_recovery_mode_swflag(adapter))
|
||||
return (EPERM);
|
||||
|
@ -5308,12 +5308,12 @@ ixgbe_sysctl_advertise(SYSCTLFN_ARGS)
|
|||
static int
|
||||
ixgbe_set_advertise(struct adapter *adapter, int advertise)
|
||||
{
|
||||
device_t dev;
|
||||
struct ixgbe_hw *hw;
|
||||
device_t dev;
|
||||
struct ixgbe_hw *hw;
|
||||
ixgbe_link_speed speed = 0;
|
||||
ixgbe_link_speed link_caps = 0;
|
||||
s32 err = IXGBE_NOT_IMPLEMENTED;
|
||||
bool negotiate = FALSE;
|
||||
s32 err = IXGBE_NOT_IMPLEMENTED;
|
||||
bool negotiate = FALSE;
|
||||
|
||||
/* Checks to validate new value */
|
||||
if (adapter->advertise == advertise) /* no change */
|
||||
|
@ -5417,11 +5417,11 @@ ixgbe_set_advertise(struct adapter *adapter, int advertise)
|
|||
static int
|
||||
ixgbe_get_advertise(struct adapter *adapter)
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
int speed;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
int speed;
|
||||
ixgbe_link_speed link_caps = 0;
|
||||
s32 err;
|
||||
bool negotiate = FALSE;
|
||||
s32 err;
|
||||
bool negotiate = FALSE;
|
||||
|
||||
/*
|
||||
* Advertised speed means nothing unless it's copper or
|
||||
|
@ -5463,8 +5463,8 @@ ixgbe_sysctl_dmac(SYSCTLFN_ARGS)
|
|||
struct sysctlnode node = *rnode;
|
||||
struct adapter *adapter = (struct adapter *)node.sysctl_data;
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
int error;
|
||||
int newval;
|
||||
int error;
|
||||
int newval;
|
||||
|
||||
if (ixgbe_fw_recovery_mode_swflag(adapter))
|
||||
return (EPERM);
|
||||
|
@ -5524,7 +5524,7 @@ ixgbe_sysctl_power_state(SYSCTLFN_ARGS)
|
|||
struct sysctlnode node = *rnode;
|
||||
struct adapter *adapter = (struct adapter *)node.sysctl_data;
|
||||
device_t dev = adapter->dev;
|
||||
int curr_ps, new_ps, error = 0;
|
||||
int curr_ps, new_ps, error = 0;
|
||||
|
||||
if (ixgbe_fw_recovery_mode_swflag(adapter))
|
||||
return (EPERM);
|
||||
|
@ -5568,10 +5568,10 @@ static int
|
|||
ixgbe_sysctl_wol_enable(SYSCTLFN_ARGS)
|
||||
{
|
||||
struct sysctlnode node = *rnode;
|
||||
struct adapter *adapter = (struct adapter *)node.sysctl_data;
|
||||
struct adapter *adapter = (struct adapter *)node.sysctl_data;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
bool new_wol_enabled;
|
||||
int error = 0;
|
||||
bool new_wol_enabled;
|
||||
int error = 0;
|
||||
|
||||
/*
|
||||
* It's not required to check recovery mode because this function never
|
||||
|
@ -5649,12 +5649,12 @@ ixgbe_sysctl_print_rss_config(SYSCTLFN_ARGS)
|
|||
{
|
||||
#ifdef notyet
|
||||
struct sysctlnode node = *rnode;
|
||||
struct adapter *adapter = (struct adapter *)node.sysctl_data;
|
||||
struct adapter *adapter = (struct adapter *)node.sysctl_data;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
device_t dev = adapter->dev;
|
||||
struct sbuf *buf;
|
||||
int error = 0, reta_size;
|
||||
u32 reg;
|
||||
device_t dev = adapter->dev;
|
||||
struct sbuf *buf;
|
||||
int error = 0, reta_size;
|
||||
u32 reg;
|
||||
|
||||
if (ixgbe_fw_recovery_mode_swflag(adapter))
|
||||
return (EPERM);
|
||||
|
@ -5804,8 +5804,8 @@ ixgbe_sysctl_eee_state(SYSCTLFN_ARGS)
|
|||
struct adapter *adapter = (struct adapter *)node.sysctl_data;
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
device_t dev = adapter->dev;
|
||||
int curr_eee, new_eee, error = 0;
|
||||
s32 retval;
|
||||
int curr_eee, new_eee, error = 0;
|
||||
s32 retval;
|
||||
|
||||
if (ixgbe_fw_recovery_mode_swflag(adapter))
|
||||
return (EPERM);
|
||||
|
@ -5872,8 +5872,8 @@ ixgbe_sysctl_eee_state(SYSCTLFN_ARGS)
|
|||
static void
|
||||
ixgbe_print_debug_info(struct adapter *adapter)
|
||||
{
|
||||
device_t dev = adapter->dev;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
device_t dev = adapter->dev;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
int table_size;
|
||||
int i;
|
||||
|
||||
|
@ -5943,7 +5943,7 @@ ixgbe_sysctl_debug(SYSCTLFN_ARGS)
|
|||
{
|
||||
struct sysctlnode node = *rnode;
|
||||
struct adapter *adapter = (struct adapter *)node.sysctl_data;
|
||||
int error, result = 0;
|
||||
int error, result = 0;
|
||||
|
||||
if (ixgbe_fw_recovery_mode_swflag(adapter))
|
||||
return (EPERM);
|
||||
|
@ -5967,11 +5967,11 @@ static void
|
|||
ixgbe_init_device_features(struct adapter *adapter)
|
||||
{
|
||||
adapter->feat_cap = IXGBE_FEATURE_NETMAP
|
||||
| IXGBE_FEATURE_RSS
|
||||
| IXGBE_FEATURE_MSI
|
||||
| IXGBE_FEATURE_MSIX
|
||||
| IXGBE_FEATURE_LEGACY_IRQ
|
||||
| IXGBE_FEATURE_LEGACY_TX;
|
||||
| IXGBE_FEATURE_RSS
|
||||
| IXGBE_FEATURE_MSI
|
||||
| IXGBE_FEATURE_MSIX
|
||||
| IXGBE_FEATURE_LEGACY_IRQ
|
||||
| IXGBE_FEATURE_LEGACY_TX;
|
||||
|
||||
/* Set capabilities first... */
|
||||
switch (adapter->hw.mac.type) {
|
||||
|
@ -6165,7 +6165,7 @@ ixgbe_ioctl(struct ifnet * ifp, u_long command, void *data)
|
|||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct ifcapreq *ifcr = data;
|
||||
struct ifreq *ifr = data;
|
||||
int error = 0;
|
||||
int error = 0;
|
||||
int l4csum_en;
|
||||
const int l4csum = IFCAP_CSUM_TCPv4_Rx | IFCAP_CSUM_UDPv4_Rx |
|
||||
IFCAP_CSUM_TCPv6_Rx | IFCAP_CSUM_UDPv6_Rx;
|
||||
|
@ -6318,9 +6318,9 @@ static void
|
|||
ixgbe_handle_que(void *context)
|
||||
{
|
||||
struct ix_queue *que = context;
|
||||
struct adapter *adapter = que->adapter;
|
||||
struct tx_ring *txr = que->txr;
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
struct adapter *adapter = que->adapter;
|
||||
struct tx_ring *txr = que->txr;
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
bool more = false;
|
||||
|
||||
que->handleq.ev_count++;
|
||||
|
@ -6376,10 +6376,10 @@ ixgbe_allocate_legacy(struct adapter *adapter,
|
|||
{
|
||||
device_t dev = adapter->dev;
|
||||
struct ix_queue *que = adapter->queues;
|
||||
struct tx_ring *txr = adapter->tx_rings;
|
||||
struct tx_ring *txr = adapter->tx_rings;
|
||||
int counts[PCI_INTR_TYPE_SIZE];
|
||||
pci_intr_type_t intr_type, max_type;
|
||||
char intrbuf[PCI_INTRSTR_LEN];
|
||||
char intrbuf[PCI_INTRSTR_LEN];
|
||||
const char *intrstr = NULL;
|
||||
|
||||
/* We allocate a single interrupt resource */
|
||||
|
@ -6468,19 +6468,19 @@ alloc_retry:
|
|||
static int
|
||||
ixgbe_allocate_msix(struct adapter *adapter, const struct pci_attach_args *pa)
|
||||
{
|
||||
device_t dev = adapter->dev;
|
||||
struct ix_queue *que = adapter->queues;
|
||||
struct tx_ring *txr = adapter->tx_rings;
|
||||
device_t dev = adapter->dev;
|
||||
struct ix_queue *que = adapter->queues;
|
||||
struct tx_ring *txr = adapter->tx_rings;
|
||||
pci_chipset_tag_t pc;
|
||||
char intrbuf[PCI_INTRSTR_LEN];
|
||||
char intr_xname[32];
|
||||
char wqname[MAXCOMLEN];
|
||||
const char *intrstr = NULL;
|
||||
int error, vector = 0;
|
||||
int error, vector = 0;
|
||||
int cpu_id = 0;
|
||||
kcpuset_t *affinity;
|
||||
#ifdef RSS
|
||||
unsigned int rss_buckets = 0;
|
||||
unsigned int rss_buckets = 0;
|
||||
kcpuset_t cpu_mask;
|
||||
#endif
|
||||
|
||||
|
@ -6742,7 +6742,7 @@ ixgbe_configure_interrupts(struct adapter *adapter)
|
|||
if (msgs >= want)
|
||||
msgs = want;
|
||||
else {
|
||||
aprint_error_dev(dev, "MSI-X Configuration Problem, "
|
||||
aprint_error_dev(dev, "MSI-X Configuration Problem, "
|
||||
"%d vectors but %d queues wanted!\n",
|
||||
msgs, want);
|
||||
goto msi;
|
||||
|
@ -6763,7 +6763,7 @@ msi:
|
|||
adapter->feat_cap &= ~IXGBE_FEATURE_SRIOV;
|
||||
adapter->feat_en &= ~IXGBE_FEATURE_SRIOV;
|
||||
|
||||
msgs = pci_msi_count(adapter->osdep.pc, adapter->osdep.tag);
|
||||
msgs = pci_msi_count(adapter->osdep.pc, adapter->osdep.tag);
|
||||
adapter->msix_mem = NULL; /* XXX */
|
||||
if (msgs > 1)
|
||||
msgs = 1;
|
||||
|
@ -6793,7 +6793,7 @@ msi:
|
|||
static void
|
||||
ixgbe_handle_link(void *context)
|
||||
{
|
||||
struct adapter *adapter = context;
|
||||
struct adapter *adapter = context;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
|
||||
IXGBE_CORE_LOCK(adapter);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*$NetBSD: ixv.c,v 1.113 2019/05/23 10:57:28 msaitoh Exp $*/
|
||||
/*$NetBSD: ixv.c,v 1.114 2019/05/23 13:10:52 msaitoh Exp $*/
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
|
@ -78,41 +78,41 @@ static const char *ixv_strings[] = {
|
|||
/*********************************************************************
|
||||
* Function prototypes
|
||||
*********************************************************************/
|
||||
static int ixv_probe(device_t, cfdata_t, void *);
|
||||
static int ixv_probe(device_t, cfdata_t, void *);
|
||||
static void ixv_attach(device_t, device_t, void *);
|
||||
static int ixv_detach(device_t, int);
|
||||
static int ixv_detach(device_t, int);
|
||||
#if 0
|
||||
static int ixv_shutdown(device_t);
|
||||
static int ixv_shutdown(device_t);
|
||||
#endif
|
||||
static int ixv_ifflags_cb(struct ethercom *);
|
||||
static int ixv_ioctl(struct ifnet *, u_long, void *);
|
||||
static int ixv_ioctl(struct ifnet *, u_long, void *);
|
||||
static int ixv_init(struct ifnet *);
|
||||
static void ixv_init_locked(struct adapter *);
|
||||
static void ixv_ifstop(struct ifnet *, int);
|
||||
static void ixv_stop(void *);
|
||||
static void ixv_init_device_features(struct adapter *);
|
||||
static void ixv_media_status(struct ifnet *, struct ifmediareq *);
|
||||
static int ixv_media_change(struct ifnet *);
|
||||
static int ixv_allocate_pci_resources(struct adapter *,
|
||||
static void ixv_stop(void *);
|
||||
static void ixv_init_device_features(struct adapter *);
|
||||
static void ixv_media_status(struct ifnet *, struct ifmediareq *);
|
||||
static int ixv_media_change(struct ifnet *);
|
||||
static int ixv_allocate_pci_resources(struct adapter *,
|
||||
const struct pci_attach_args *);
|
||||
static int ixv_allocate_msix(struct adapter *,
|
||||
static int ixv_allocate_msix(struct adapter *,
|
||||
const struct pci_attach_args *);
|
||||
static int ixv_configure_interrupts(struct adapter *);
|
||||
static int ixv_configure_interrupts(struct adapter *);
|
||||
static void ixv_free_pci_resources(struct adapter *);
|
||||
static void ixv_local_timer(void *);
|
||||
static void ixv_local_timer_locked(void *);
|
||||
static int ixv_setup_interface(device_t, struct adapter *);
|
||||
static int ixv_negotiate_api(struct adapter *);
|
||||
static void ixv_local_timer(void *);
|
||||
static void ixv_local_timer_locked(void *);
|
||||
static int ixv_setup_interface(device_t, struct adapter *);
|
||||
static int ixv_negotiate_api(struct adapter *);
|
||||
|
||||
static void ixv_initialize_transmit_units(struct adapter *);
|
||||
static void ixv_initialize_receive_units(struct adapter *);
|
||||
static void ixv_initialize_rss_mapping(struct adapter *);
|
||||
static void ixv_check_link(struct adapter *);
|
||||
static void ixv_initialize_transmit_units(struct adapter *);
|
||||
static void ixv_initialize_receive_units(struct adapter *);
|
||||
static void ixv_initialize_rss_mapping(struct adapter *);
|
||||
static void ixv_check_link(struct adapter *);
|
||||
|
||||
static void ixv_enable_intr(struct adapter *);
|
||||
static void ixv_disable_intr(struct adapter *);
|
||||
static void ixv_set_multi(struct adapter *);
|
||||
static void ixv_update_link_status(struct adapter *);
|
||||
static void ixv_enable_intr(struct adapter *);
|
||||
static void ixv_disable_intr(struct adapter *);
|
||||
static void ixv_set_multi(struct adapter *);
|
||||
static void ixv_update_link_status(struct adapter *);
|
||||
static int ixv_sysctl_debug(SYSCTLFN_PROTO);
|
||||
static void ixv_set_ivar(struct adapter *, u8, u8, s8);
|
||||
static void ixv_configure_ivars(struct adapter *);
|
||||
|
@ -135,12 +135,12 @@ static void ixv_add_stats_sysctls(struct adapter *);
|
|||
/* Sysctl handlers */
|
||||
static void ixv_set_sysctl_value(struct adapter *, const char *,
|
||||
const char *, int *, int);
|
||||
static int ixv_sysctl_interrupt_rate_handler(SYSCTLFN_PROTO);
|
||||
static int ixv_sysctl_next_to_check_handler(SYSCTLFN_PROTO);
|
||||
static int ixv_sysctl_rdh_handler(SYSCTLFN_PROTO);
|
||||
static int ixv_sysctl_rdt_handler(SYSCTLFN_PROTO);
|
||||
static int ixv_sysctl_tdt_handler(SYSCTLFN_PROTO);
|
||||
static int ixv_sysctl_tdh_handler(SYSCTLFN_PROTO);
|
||||
static int ixv_sysctl_interrupt_rate_handler(SYSCTLFN_PROTO);
|
||||
static int ixv_sysctl_next_to_check_handler(SYSCTLFN_PROTO);
|
||||
static int ixv_sysctl_rdh_handler(SYSCTLFN_PROTO);
|
||||
static int ixv_sysctl_rdt_handler(SYSCTLFN_PROTO);
|
||||
static int ixv_sysctl_tdt_handler(SYSCTLFN_PROTO);
|
||||
static int ixv_sysctl_tdh_handler(SYSCTLFN_PROTO);
|
||||
|
||||
/* The MSI-X Interrupt handlers */
|
||||
static int ixv_msix_que(void *);
|
||||
|
@ -148,7 +148,7 @@ static int ixv_msix_mbx(void *);
|
|||
|
||||
/* Deferred interrupt tasklets */
|
||||
static void ixv_handle_que(void *);
|
||||
static void ixv_handle_link(void *);
|
||||
static void ixv_handle_link(void *);
|
||||
|
||||
/* Workqueue handler for deferred work */
|
||||
static void ixv_handle_que_work(struct work *, void *);
|
||||
|
@ -300,7 +300,7 @@ ixv_attach(device_t parent, device_t dev, void *aux)
|
|||
{
|
||||
struct adapter *adapter;
|
||||
struct ixgbe_hw *hw;
|
||||
int error = 0;
|
||||
int error = 0;
|
||||
pcireg_t id, subid;
|
||||
const ixgbe_vendor_info_t *ent;
|
||||
const struct pci_attach_args *pa = aux;
|
||||
|
@ -573,7 +573,7 @@ err_out:
|
|||
static int
|
||||
ixv_detach(device_t dev, int flags)
|
||||
{
|
||||
struct adapter *adapter = device_private(dev);
|
||||
struct adapter *adapter = device_private(dev);
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct ix_queue *que = adapter->queues;
|
||||
struct tx_ring *txr = adapter->tx_rings;
|
||||
|
@ -717,10 +717,10 @@ static void
|
|||
ixv_init_locked(struct adapter *adapter)
|
||||
{
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
device_t dev = adapter->dev;
|
||||
device_t dev = adapter->dev;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct ix_queue *que;
|
||||
int error = 0;
|
||||
int error = 0;
|
||||
uint32_t mask;
|
||||
int i;
|
||||
|
||||
|
@ -839,8 +839,8 @@ ixv_enable_queue(struct adapter *adapter, u32 vector)
|
|||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct ix_queue *que = &adapter->queues[vector];
|
||||
u32 queue = 1 << vector;
|
||||
u32 mask;
|
||||
u32 queue = 1 << vector;
|
||||
u32 mask;
|
||||
|
||||
mutex_enter(&que->dc_mtx);
|
||||
if (que->disabled_count > 0 && --que->disabled_count > 0)
|
||||
|
@ -860,8 +860,8 @@ ixv_disable_queue(struct adapter *adapter, u32 vector)
|
|||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct ix_queue *que = &adapter->queues[vector];
|
||||
u64 queue = (u64)(1 << vector);
|
||||
u32 mask;
|
||||
u64 queue = (u64)(1 << vector);
|
||||
u32 mask;
|
||||
|
||||
mutex_enter(&que->dc_mtx);
|
||||
if (que->disabled_count++ > 0)
|
||||
|
@ -890,7 +890,7 @@ static int
|
|||
ixv_msix_que(void *arg)
|
||||
{
|
||||
struct ix_queue *que = arg;
|
||||
struct adapter *adapter = que->adapter;
|
||||
struct adapter *adapter = que->adapter;
|
||||
struct tx_ring *txr = que->txr;
|
||||
struct rx_ring *rxr = que->rxr;
|
||||
bool more;
|
||||
|
@ -1100,10 +1100,10 @@ static int
|
|||
ixv_negotiate_api(struct adapter *adapter)
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
int mbx_api[] = { ixgbe_mbox_api_11,
|
||||
ixgbe_mbox_api_10,
|
||||
ixgbe_mbox_api_unknown };
|
||||
int i = 0;
|
||||
int mbx_api[] = { ixgbe_mbox_api_11,
|
||||
ixgbe_mbox_api_10,
|
||||
ixgbe_mbox_api_unknown };
|
||||
int i = 0;
|
||||
|
||||
while (mbx_api[i] != ixgbe_mbox_api_unknown) {
|
||||
if (ixgbevf_negotiate_api_version(hw, mbx_api[i]) == 0)
|
||||
|
@ -1127,8 +1127,8 @@ ixv_set_multi(struct adapter *adapter)
|
|||
struct ether_multistep step;
|
||||
struct ethercom *ec = &adapter->osdep.ec;
|
||||
u8 mta[MAX_NUM_MULTICAST_ADDRESSES * IXGBE_ETH_LENGTH_OF_ADDRESS];
|
||||
u8 *update_ptr;
|
||||
int mcnt = 0;
|
||||
u8 *update_ptr;
|
||||
int mcnt = 0;
|
||||
|
||||
KASSERT(mutex_owned(&adapter->core_mtx));
|
||||
IOCTL_DEBUGOUT("ixv_set_multi: begin");
|
||||
|
@ -1212,7 +1212,7 @@ ixv_local_timer_locked(void *arg)
|
|||
v0 = v1 = v2 = v3 = v4 = v5 = v6 = v7 = 0;
|
||||
que = adapter->queues;
|
||||
for (i = 0; i < adapter->num_queues; i++, que++) {
|
||||
struct tx_ring *txr = que->txr;
|
||||
struct tx_ring *txr = que->txr;
|
||||
|
||||
v0 += txr->q_efbig_tx_dma_setup;
|
||||
v1 += txr->q_mbuf_defrag_failed;
|
||||
|
@ -1234,8 +1234,8 @@ ixv_local_timer_locked(void *arg)
|
|||
|
||||
/*
|
||||
* Check the TX queues status
|
||||
* - mark hung queues so we don't schedule on them
|
||||
* - watchdog only if all queues show hung
|
||||
* - mark hung queues so we don't schedule on them
|
||||
* - watchdog only if all queues show hung
|
||||
*/
|
||||
que = adapter->queues;
|
||||
for (i = 0; i < adapter->num_queues; i++, que++) {
|
||||
|
@ -1290,8 +1290,8 @@ watchdog:
|
|||
* ixv_update_link_status - Update OS on link state
|
||||
*
|
||||
* Note: Only updates the OS on the cached link state.
|
||||
* The real check of the hardware only happens with
|
||||
* a link interrupt.
|
||||
* The real check of the hardware only happens with
|
||||
* a link interrupt.
|
||||
************************************************************************/
|
||||
static void
|
||||
ixv_update_link_status(struct adapter *adapter)
|
||||
|
@ -1339,7 +1339,7 @@ ixv_update_link_status(struct adapter *adapter)
|
|||
/*
|
||||
* Do it when link active changes to DOWN. i.e.
|
||||
* a) LINK_STATE_UNKNOWN -> LINK_STATE_DOWN
|
||||
* b) LINK_STATE_UP -> LINK_STATE_DOWN
|
||||
* b) LINK_STATE_UP -> LINK_STATE_DOWN
|
||||
*/
|
||||
if (adapter->link_active != LINK_STATE_DOWN) {
|
||||
if (bootverbose)
|
||||
|
@ -1370,8 +1370,8 @@ ixv_ifstop(struct ifnet *ifp, int disable)
|
|||
static void
|
||||
ixv_stop(void *arg)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
struct adapter *adapter = arg;
|
||||
struct ifnet *ifp;
|
||||
struct adapter *adapter = arg;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
|
||||
ifp = adapter->ifp;
|
||||
|
@ -1404,7 +1404,7 @@ ixv_allocate_pci_resources(struct adapter *adapter,
|
|||
const struct pci_attach_args *pa)
|
||||
{
|
||||
pcireg_t memtype, csr;
|
||||
device_t dev = adapter->dev;
|
||||
device_t dev = adapter->dev;
|
||||
bus_addr_t addr;
|
||||
int flags;
|
||||
|
||||
|
@ -1414,7 +1414,7 @@ ixv_allocate_pci_resources(struct adapter *adapter,
|
|||
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:
|
||||
adapter->osdep.mem_bus_space_tag = pa->pa_memt;
|
||||
if (pci_mapreg_info(pa->pa_pc, pa->pa_tag, PCI_BAR(0),
|
||||
memtype, &addr, &adapter->osdep.mem_size, &flags) != 0)
|
||||
memtype, &addr, &adapter->osdep.mem_size, &flags) != 0)
|
||||
goto map_err;
|
||||
if ((flags & BUS_SPACE_MAP_PREFETCHABLE) != 0) {
|
||||
aprint_normal_dev(dev, "clearing prefetchable bit\n");
|
||||
|
@ -1455,7 +1455,7 @@ map_err:
|
|||
static void
|
||||
ixv_free_pci_resources(struct adapter * adapter)
|
||||
{
|
||||
struct ix_queue *que = adapter->queues;
|
||||
struct ix_queue *que = adapter->queues;
|
||||
int rid;
|
||||
|
||||
/*
|
||||
|
@ -1550,8 +1550,8 @@ ixv_setup_interface(device_t dev, struct adapter *adapter)
|
|||
|
||||
/* Set capability flags */
|
||||
ifp->if_capabilities |= IFCAP_HWCSUM
|
||||
| IFCAP_TSOv4
|
||||
| IFCAP_TSOv6;
|
||||
| IFCAP_TSOv4
|
||||
| IFCAP_TSOv6;
|
||||
ifp->if_capenable = 0;
|
||||
|
||||
ec->ec_capabilities |= ETHERCAP_VLAN_HWTAGGING
|
||||
|
@ -1639,10 +1639,10 @@ static void
|
|||
ixv_initialize_rss_mapping(struct adapter *adapter)
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
u32 reta = 0, mrqc, rss_key[10];
|
||||
int queue_id;
|
||||
int i, j;
|
||||
u32 rss_hash_config;
|
||||
u32 reta = 0, mrqc, rss_key[10];
|
||||
int queue_id;
|
||||
int i, j;
|
||||
u32 rss_hash_config;
|
||||
|
||||
/* force use default RSS key. */
|
||||
#ifdef __NetBSD__
|
||||
|
@ -1699,9 +1699,9 @@ ixv_initialize_rss_mapping(struct adapter *adapter)
|
|||
* traffic.
|
||||
*/
|
||||
rss_hash_config = RSS_HASHTYPE_RSS_IPV4
|
||||
| RSS_HASHTYPE_RSS_TCP_IPV4
|
||||
| RSS_HASHTYPE_RSS_IPV6
|
||||
| RSS_HASHTYPE_RSS_TCP_IPV6;
|
||||
| RSS_HASHTYPE_RSS_TCP_IPV4
|
||||
| RSS_HASHTYPE_RSS_IPV6
|
||||
| RSS_HASHTYPE_RSS_TCP_IPV6;
|
||||
}
|
||||
|
||||
mrqc = IXGBE_MRQC_RSSEN;
|
||||
|
@ -1747,10 +1747,10 @@ ixv_initialize_receive_units(struct adapter *adapter)
|
|||
bufsz = 2048 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT;
|
||||
|
||||
psrtype = IXGBE_PSRTYPE_TCPHDR
|
||||
| IXGBE_PSRTYPE_UDPHDR
|
||||
| IXGBE_PSRTYPE_IPV4HDR
|
||||
| IXGBE_PSRTYPE_IPV6HDR
|
||||
| IXGBE_PSRTYPE_L2HDR;
|
||||
| IXGBE_PSRTYPE_UDPHDR
|
||||
| IXGBE_PSRTYPE_IPV4HDR
|
||||
| IXGBE_PSRTYPE_IPV6HDR
|
||||
| IXGBE_PSRTYPE_L2HDR;
|
||||
|
||||
if (adapter->num_queues > 1)
|
||||
psrtype |= 1 << 29;
|
||||
|
@ -1970,7 +1970,7 @@ ixv_setup_vlan_support(struct adapter *adapter)
|
|||
{
|
||||
struct ethercom *ec = &adapter->osdep.ec;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct rx_ring *rxr;
|
||||
struct rx_ring *rxr;
|
||||
u32 ctrl, vid, vfta, retry;
|
||||
bool hwtagging;
|
||||
|
||||
|
@ -2097,7 +2097,7 @@ ixv_enable_intr(struct adapter *adapter)
|
|||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct ix_queue *que = adapter->queues;
|
||||
u32 mask;
|
||||
u32 mask;
|
||||
int i;
|
||||
|
||||
/* For VTEIAC */
|
||||
|
@ -2146,7 +2146,7 @@ static void
|
|||
ixv_set_ivar(struct adapter *adapter, u8 entry, u8 vector, s8 type)
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
u32 ivar, index;
|
||||
u32 ivar, index;
|
||||
|
||||
vector |= IXGBE_IVAR_ALLOC_VAL;
|
||||
|
||||
|
@ -2155,7 +2155,7 @@ ixv_set_ivar(struct adapter *adapter, u8 entry, u8 vector, s8 type)
|
|||
ivar &= ~0xFF;
|
||||
ivar |= vector;
|
||||
IXGBE_WRITE_REG(hw, IXGBE_VTIVAR_MISC, ivar);
|
||||
} else { /* RX/TX IVARS */
|
||||
} else { /* RX/TX IVARS */
|
||||
index = (16 * (entry & 1)) + (8 * type);
|
||||
ivar = IXGBE_READ_REG(hw, IXGBE_VTIVAR(entry >> 1));
|
||||
ivar &= ~(0xFF << index);
|
||||
|
@ -2243,7 +2243,7 @@ ixv_init_stats(struct adapter *adapter)
|
|||
} /* ixv_init_stats */
|
||||
|
||||
#define UPDATE_STAT_32(reg, last, count) \
|
||||
{ \
|
||||
{ \
|
||||
u32 current = IXGBE_READ_REG(hw, (reg)); \
|
||||
if (current < (last)) \
|
||||
count.ev_count += 0x100000000LL; \
|
||||
|
@ -2252,11 +2252,11 @@ ixv_init_stats(struct adapter *adapter)
|
|||
count.ev_count |= current; \
|
||||
}
|
||||
|
||||
#define UPDATE_STAT_36(lsb, msb, last, count) \
|
||||
{ \
|
||||
#define UPDATE_STAT_36(lsb, msb, last, count) \
|
||||
{ \
|
||||
u64 cur_lsb = IXGBE_READ_REG(hw, (lsb)); \
|
||||
u64 cur_msb = IXGBE_READ_REG(hw, (msb)); \
|
||||
u64 current = ((cur_msb << 32) | cur_lsb); \
|
||||
u64 current = ((cur_msb << 32) | cur_lsb); \
|
||||
if (current < (last)) \
|
||||
count.ev_count += 0x1000000000LL; \
|
||||
(last) = current; \
|
||||
|
@ -2297,7 +2297,7 @@ ixv_sysctl_interrupt_rate_handler(SYSCTLFN_ARGS)
|
|||
{
|
||||
struct sysctlnode node = *rnode;
|
||||
struct ix_queue *que = (struct ix_queue *)node.sysctl_data;
|
||||
struct adapter *adapter = que->adapter;
|
||||
struct adapter *adapter = que->adapter;
|
||||
uint32_t reg, usec, rate;
|
||||
int error;
|
||||
|
||||
|
@ -2401,9 +2401,9 @@ ixv_add_device_sysctls(struct adapter *adapter)
|
|||
static void
|
||||
ixv_add_stats_sysctls(struct adapter *adapter)
|
||||
{
|
||||
device_t dev = adapter->dev;
|
||||
struct tx_ring *txr = adapter->tx_rings;
|
||||
struct rx_ring *rxr = adapter->rx_rings;
|
||||
device_t dev = adapter->dev;
|
||||
struct tx_ring *txr = adapter->tx_rings;
|
||||
struct rx_ring *rxr = adapter->rx_rings;
|
||||
struct ixgbevf_hw_stats *stats = &adapter->stats.vf;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
const struct sysctlnode *rnode, *cnode;
|
||||
|
@ -2587,7 +2587,7 @@ static void
|
|||
ixv_set_sysctl_value(struct adapter *adapter, const char *name,
|
||||
const char *description, int *limit, int value)
|
||||
{
|
||||
device_t dev = adapter->dev;
|
||||
device_t dev = adapter->dev;
|
||||
struct sysctllog **log;
|
||||
const struct sysctlnode *rnode, *cnode;
|
||||
|
||||
|
@ -2614,13 +2614,13 @@ ixv_set_sysctl_value(struct adapter *adapter, const char *name,
|
|||
static void
|
||||
ixv_print_debug_info(struct adapter *adapter)
|
||||
{
|
||||
device_t dev = adapter->dev;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct ix_queue *que = adapter->queues;
|
||||
struct rx_ring *rxr;
|
||||
struct tx_ring *txr;
|
||||
device_t dev = adapter->dev;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
struct ix_queue *que = adapter->queues;
|
||||
struct rx_ring *rxr;
|
||||
struct tx_ring *txr;
|
||||
#ifdef LRO
|
||||
struct lro_ctrl *lro;
|
||||
struct lro_ctrl *lro;
|
||||
#endif /* LRO */
|
||||
|
||||
device_printf(dev, "Error Byte Count = %u \n",
|
||||
|
@ -2662,7 +2662,7 @@ ixv_sysctl_debug(SYSCTLFN_ARGS)
|
|||
{
|
||||
struct sysctlnode node = *rnode;
|
||||
struct adapter *adapter = (struct adapter *)node.sysctl_data;
|
||||
int error, result;
|
||||
int error, result;
|
||||
|
||||
node.sysctl_data = &result;
|
||||
error = sysctl_lookup(SYSCTLFN_CALL(&node));
|
||||
|
@ -2683,9 +2683,9 @@ static void
|
|||
ixv_init_device_features(struct adapter *adapter)
|
||||
{
|
||||
adapter->feat_cap = IXGBE_FEATURE_NETMAP
|
||||
| IXGBE_FEATURE_VF
|
||||
| IXGBE_FEATURE_RSS
|
||||
| IXGBE_FEATURE_LEGACY_TX;
|
||||
| IXGBE_FEATURE_VF
|
||||
| IXGBE_FEATURE_RSS
|
||||
| IXGBE_FEATURE_LEGACY_TX;
|
||||
|
||||
/* A tad short on feature flags for VFs, atm. */
|
||||
switch (adapter->hw.mac.type) {
|
||||
|
@ -2777,7 +2777,7 @@ ixv_ioctl(struct ifnet *ifp, u_long command, void *data)
|
|||
struct adapter *adapter = ifp->if_softc;
|
||||
struct ifcapreq *ifcr = data;
|
||||
struct ifreq *ifr = data;
|
||||
int error = 0;
|
||||
int error = 0;
|
||||
int l4csum_en;
|
||||
const int l4csum = IFCAP_CSUM_TCPv4_Rx | IFCAP_CSUM_UDPv4_Rx |
|
||||
IFCAP_CSUM_TCPv6_Rx | IFCAP_CSUM_UDPv6_Rx;
|
||||
|
@ -2867,9 +2867,9 @@ static void
|
|||
ixv_handle_que(void *context)
|
||||
{
|
||||
struct ix_queue *que = context;
|
||||
struct adapter *adapter = que->adapter;
|
||||
struct adapter *adapter = que->adapter;
|
||||
struct tx_ring *txr = que->txr;
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
bool more;
|
||||
|
||||
que->handleq.ev_count++;
|
||||
|
@ -2932,7 +2932,7 @@ ixv_allocate_msix(struct adapter *adapter, const struct pci_attach_args *pa)
|
|||
device_t dev = adapter->dev;
|
||||
struct ix_queue *que = adapter->queues;
|
||||
struct tx_ring *txr = adapter->tx_rings;
|
||||
int error, msix_ctrl, rid, vector = 0;
|
||||
int error, msix_ctrl, rid, vector = 0;
|
||||
pci_chipset_tag_t pc;
|
||||
pcitag_t tag;
|
||||
char intrbuf[PCI_INTRSTR_LEN];
|
||||
|
@ -2976,7 +2976,7 @@ ixv_allocate_msix(struct adapter *adapter, const struct pci_attach_args *pa)
|
|||
return (ENXIO);
|
||||
}
|
||||
que->msix = vector;
|
||||
adapter->active_queues |= (u64)(1 << que->msix);
|
||||
adapter->active_queues |= (u64)(1 << que->msix);
|
||||
|
||||
cpu_id = i;
|
||||
/* Round-robin affinity */
|
||||
|
@ -3112,7 +3112,7 @@ ixv_configure_interrupts(struct adapter *adapter)
|
|||
if (msgs >= want)
|
||||
msgs = want;
|
||||
else {
|
||||
aprint_error_dev(dev,
|
||||
aprint_error_dev(dev,
|
||||
"MSI-X Configuration Problem, "
|
||||
"%d vectors but %d queues wanted!\n",
|
||||
msgs, want);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_xi.c,v 1.88 2019/05/23 10:51:39 msaitoh Exp $ */
|
||||
/* $NetBSD: if_xi.c,v 1.89 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
/* OpenBSD: if_xe.c,v 1.9 1999/09/16 11:28:42 niklas Exp */
|
||||
|
||||
/*
|
||||
|
@ -55,7 +55,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_xi.c,v 1.88 2019/05/23 10:51:39 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_xi.c,v 1.89 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
|
@ -451,7 +451,7 @@ xi_get(struct xi_softc *sc)
|
|||
len = uimin(pktlen, len);
|
||||
data = mtod(m, uint8_t *);
|
||||
if (len > 1) {
|
||||
len &= ~1;
|
||||
len &= ~1;
|
||||
bus_space_read_multi_2(sc->sc_bst, sc->sc_bsh, EDP,
|
||||
(uint16_t *)data, len>>1);
|
||||
} else
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_il.c,v 1.30 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: if_il.c,v 1.31 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1982, 1986 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
|
@ -35,7 +35,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_il.c,v 1.30 2019/05/23 10:57:28 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_il.c,v 1.31 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
|
@ -83,10 +83,10 @@ __KERNEL_RCSID(0, "$NetBSD: if_il.c,v 1.30 2019/05/23 10:57:28 msaitoh Exp $");
|
|||
|
||||
struct il_softc {
|
||||
device_t sc_dev; /* Configuration common part */
|
||||
struct ethercom sc_ec; /* Ethernet common part */
|
||||
struct ethercom sc_ec; /* Ethernet common part */
|
||||
#define sc_if sc_ec.ec_if /* network-visible interface */
|
||||
struct evcnt sc_cintrcnt; /* Command interrupts */
|
||||
struct evcnt sc_rintrcnt; /* Receive interrupts */
|
||||
struct evcnt sc_cintrcnt; /* Command interrupts */
|
||||
struct evcnt sc_rintrcnt; /* Receive interrupts */
|
||||
bus_space_tag_t sc_iot;
|
||||
bus_addr_t sc_ioh;
|
||||
bus_dma_tag_t sc_dmat;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: qe.c,v 1.72 2019/05/23 10:57:28 msaitoh Exp $ */
|
||||
/* $NetBSD: qe.c,v 1.73 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -66,7 +66,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: qe.c,v 1.72 2019/05/23 10:57:28 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: qe.c,v 1.73 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#define QEDEBUG
|
||||
|
||||
|
@ -262,8 +262,8 @@ qeattach(device_t parent, device_t self, void *aux)
|
|||
|
||||
/* Map DMA buffer in CPU addressable space */
|
||||
if ((error = bus_dmamem_map(dmatag, &seg, rseg, size,
|
||||
&sc->sc_rb.rb_membase,
|
||||
BUS_DMA_NOWAIT | BUS_DMA_COHERENT)) != 0) {
|
||||
&sc->sc_rb.rb_membase,
|
||||
BUS_DMA_NOWAIT | BUS_DMA_COHERENT)) != 0) {
|
||||
aprint_error_dev(self, "DMA buffer map error %d\n",
|
||||
error);
|
||||
bus_dmamem_free(dmatag, &seg, rseg);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_se.c,v 1.100 2019/05/23 10:30:36 msaitoh Exp $ */
|
||||
/* $NetBSD: if_se.c,v 1.101 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Ian W. Dall <ian.dall@dsto.defence.gov.au>
|
||||
|
@ -59,7 +59,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_se.c,v 1.100 2019/05/23 10:30:36 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_se.c,v 1.101 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_inet.h"
|
||||
|
@ -154,7 +154,7 @@ int se_max_received = 0; /* Instrumentation */
|
|||
static const struct __CONCAT(scsi_, name) name
|
||||
|
||||
/* Command initializers for commands using scsi_ctron_ether_generic */
|
||||
PROTOCMD_DECL(ctron_ether_send) = {CTRON_ETHER_SEND, 0, {0,0}, 0};
|
||||
PROTOCMD_DECL(ctron_ether_send) = {CTRON_ETHER_SEND, 0, {0,0}, 0};
|
||||
PROTOCMD_DECL(ctron_ether_add_proto) = {CTRON_ETHER_ADD_PROTO, 0, {0,0}, 0};
|
||||
PROTOCMD_DECL(ctron_ether_get_addr) = {CTRON_ETHER_GET_ADDR, 0, {0,0}, 0};
|
||||
PROTOCMD_DECL(ctron_ether_set_media) = {CTRON_ETHER_SET_MEDIA, 0, {0,0}, 0};
|
||||
|
@ -262,9 +262,9 @@ const struct scsipi_periphsw se_switch = {
|
|||
|
||||
const struct scsipi_inquiry_pattern se_patterns[] = {
|
||||
{T_PROCESSOR, T_FIXED,
|
||||
"CABLETRN", "EA412", ""},
|
||||
"CABLETRN", "EA412", ""},
|
||||
{T_PROCESSOR, T_FIXED,
|
||||
"Cabletrn", "EA412", ""},
|
||||
"Cabletrn", "EA412", ""},
|
||||
};
|
||||
|
||||
#if 0
|
||||
|
@ -532,15 +532,15 @@ sedone(struct scsipi_xfer *xs, int error)
|
|||
se_poll: ntimeo);
|
||||
}
|
||||
sc->sc_last_timeout = ntimeo;
|
||||
if (ntimeo == se_poll0 &&
|
||||
if (ntimeo == se_poll0 &&
|
||||
IFQ_IS_EMPTY(&ifp->if_snd) == 0)
|
||||
/* Output is pending. Do next recv
|
||||
* after the next send. */
|
||||
* after the next send. */
|
||||
sc->sc_flags |= SE_NEED_RECV;
|
||||
else {
|
||||
callout_reset(&sc->sc_recv_ch, ntimeo,
|
||||
se_recv, (void *)sc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
splx(s);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_aue.c,v 1.152 2019/05/23 10:57:29 msaitoh Exp $ */
|
||||
/* $NetBSD: if_aue.c,v 1.153 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997, 1998, 1999, 2000
|
||||
|
@ -77,7 +77,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.152 2019/05/23 10:57:29 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.153 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_usb.h"
|
||||
|
@ -167,7 +167,7 @@ Static const struct aue_type aue_devs[] = {
|
|||
{{ USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USBLP100}, PNA },
|
||||
{{ USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USBEL100}, 0 },
|
||||
{{ USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USBE100}, PII },
|
||||
{{ USB_VENDOR_COMPAQ, USB_PRODUCT_COMPAQ_HNE200}, PII },
|
||||
{{ USB_VENDOR_COMPAQ, USB_PRODUCT_COMPAQ_HNE200}, PII },
|
||||
{{ USB_VENDOR_COREGA, USB_PRODUCT_COREGA_FETHER_USB_TX}, 0 },
|
||||
{{ USB_VENDOR_COREGA, USB_PRODUCT_COREGA_FETHER_USB_TXS},PII },
|
||||
{{ USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX4}, LSYS | PII },
|
||||
|
@ -188,18 +188,18 @@ Static const struct aue_type aue_devs[] = {
|
|||
{{ USB_VENDOR_IODATA, USB_PRODUCT_IODATA_USBETTX}, 0 },
|
||||
{{ USB_VENDOR_IODATA, USB_PRODUCT_IODATA_USBETTXS}, PII },
|
||||
{{ USB_VENDOR_IODATA, USB_PRODUCT_IODATA_ETXUS2}, PII },
|
||||
{{ USB_VENDOR_KINGSTON, USB_PRODUCT_KINGSTON_KNU101TX}, 0 },
|
||||
{{ USB_VENDOR_KINGSTON, USB_PRODUCT_KINGSTON_KNU101TX}, 0 },
|
||||
{{ USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB10TX1}, LSYS | PII },
|
||||
{{ USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB10T}, LSYS },
|
||||
{{ USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB100TX}, LSYS },
|
||||
{{ USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB100H1}, LSYS | PNA },
|
||||
{{ USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB10TA}, LSYS },
|
||||
{{ USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB10TX2}, LSYS | PII },
|
||||
{{ USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUATX1}, 0 },
|
||||
{{ USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUATX5}, 0 },
|
||||
{{ USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUA2TX5}, PII },
|
||||
{{ USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUATX1}, 0 },
|
||||
{{ USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUATX5}, 0 },
|
||||
{{ USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUA2TX5}, PII },
|
||||
{{ USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_MN110}, PII },
|
||||
{{ USB_VENDOR_NETGEAR, USB_PRODUCT_NETGEAR_FA101}, PII },
|
||||
{{ USB_VENDOR_NETGEAR, USB_PRODUCT_NETGEAR_FA101}, PII },
|
||||
{{ USB_VENDOR_SIEMENS, USB_PRODUCT_SIEMENS_SPEEDSTREAM}, PII },
|
||||
{{ USB_VENDOR_SMARTBRIDGES, USB_PRODUCT_SMARTBRIDGES_SMARTNIC},PII },
|
||||
{{ USB_VENDOR_SMC, USB_PRODUCT_SMC_2202USB}, 0 },
|
||||
|
@ -1534,7 +1534,7 @@ Static int
|
|||
aue_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||
{
|
||||
struct aue_softc *sc = ifp->if_softc;
|
||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||
struct ifreq *ifr = (struct ifreq *)data;
|
||||
int s, error = 0;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_axe.c,v 1.96 2019/05/23 10:57:29 msaitoh Exp $ */
|
||||
/* $NetBSD: if_axe.c,v 1.97 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
/* $OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -87,7 +87,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.96 2019/05/23 10:57:29 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.97 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_inet.h"
|
||||
|
@ -210,7 +210,7 @@ static const struct axe_type axe_devs[] = {
|
|||
{ { USB_VENDOR_IODATA, USB_PRODUCT_IODATA_ETGUS2 }, AX178 },
|
||||
{ { USB_VENDOR_JVC, USB_PRODUCT_JVC_MP_PRX1}, 0 },
|
||||
{ { USB_VENDOR_LENOVO, USB_PRODUCT_LENOVO_ETHERNET }, AX772B },
|
||||
{ { USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_HG20F9}, AX772B },
|
||||
{ { USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_HG20F9}, AX772B },
|
||||
{ { USB_VENDOR_LINKSYS2, USB_PRODUCT_LINKSYS2_USB200M}, 0 },
|
||||
{ { USB_VENDOR_LINKSYS4, USB_PRODUCT_LINKSYS4_USB1000 }, AX178 },
|
||||
{ { USB_VENDOR_LOGITEC, USB_PRODUCT_LOGITEC_LAN_GTJU2}, AX178 },
|
||||
|
@ -1317,7 +1317,7 @@ axe_rxeof(struct usbd_xfer *xfer, void * priv, usbd_status status)
|
|||
} else if ((sc->axe_flags & AXCSUM_FRAME) != 0) {
|
||||
struct axe_csum_hdr csum_hdr;
|
||||
|
||||
if (total_len < sizeof(csum_hdr)) {
|
||||
if (total_len < sizeof(csum_hdr)) {
|
||||
ifp->if_ierrors++;
|
||||
goto done;
|
||||
}
|
||||
|
@ -1547,7 +1547,7 @@ axe_encap(struct axe_softc *sc, struct mbuf *m, int idx)
|
|||
* bytes at the beginning to hold the frame length.
|
||||
*/
|
||||
if (AXE_IS_178_FAMILY(sc)) {
|
||||
struct axe_sframe_hdr hdr;
|
||||
struct axe_sframe_hdr hdr;
|
||||
|
||||
boundary = (sc->axe_udev->ud_speed == USB_SPEED_HIGH) ? 512 : 64;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_axen.c,v 1.39 2019/05/23 10:57:29 msaitoh Exp $ */
|
||||
/* $NetBSD: if_axen.c,v 1.40 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
/* $OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.39 2019/05/23 10:57:29 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.40 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_inet.h"
|
||||
|
@ -801,7 +801,7 @@ axen_attach(device_t parent, device_t self, void *aux)
|
|||
|
||||
/* Adapter does not support TSOv6 (They call it LSOv2). */
|
||||
ifp->if_capabilities |= IFCAP_TSOv4 |
|
||||
IFCAP_CSUM_IPv4_Rx | IFCAP_CSUM_IPv4_Tx |
|
||||
IFCAP_CSUM_IPv4_Rx | IFCAP_CSUM_IPv4_Tx |
|
||||
IFCAP_CSUM_TCPv4_Rx | IFCAP_CSUM_TCPv4_Tx |
|
||||
IFCAP_CSUM_UDPv4_Rx | IFCAP_CSUM_UDPv4_Tx |
|
||||
IFCAP_CSUM_TCPv6_Rx | IFCAP_CSUM_TCPv6_Tx |
|
||||
|
@ -1083,7 +1083,7 @@ axen_rxeof(struct usbd_xfer *xfer, void * priv, usbd_status status)
|
|||
if ((buf[0] != 0xee) || (buf[1] != 0xee)) {
|
||||
aprint_error_dev(sc->axen_dev,
|
||||
"invalid buffer(pkt#%d), continue\n", pkt_count);
|
||||
ifp->if_ierrors += pkt_count;
|
||||
ifp->if_ierrors += pkt_count;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -1094,7 +1094,7 @@ axen_rxeof(struct usbd_xfer *xfer, void * priv, usbd_status status)
|
|||
device_xname(sc->axen_dev), pkt_count, pkt_hdr, pkt_len));
|
||||
|
||||
if (pkt_hdr & (AXEN_RXHDR_CRC_ERR | AXEN_RXHDR_DROP_ERR)) {
|
||||
ifp->if_ierrors++;
|
||||
ifp->if_ierrors++;
|
||||
/* move to next pkt header */
|
||||
DPRINTF(("%s: %s err (pkt#%d)\n",
|
||||
device_xname(sc->axen_dev),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_cue.c,v 1.82 2019/05/23 10:57:29 msaitoh Exp $ */
|
||||
/* $NetBSD: if_cue.c,v 1.83 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1997, 1998, 1999, 2000
|
||||
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
|
||||
|
@ -56,7 +56,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.82 2019/05/23 10:57:29 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.83 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_inet.h"
|
||||
|
@ -1099,7 +1099,7 @@ Static int
|
|||
cue_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||
{
|
||||
struct cue_softc *sc = ifp->if_softc;
|
||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||
struct ifreq *ifr = (struct ifreq *)data;
|
||||
int s, error = 0;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_kue.c,v 1.94 2019/05/23 10:57:29 msaitoh Exp $ */
|
||||
/* $NetBSD: if_kue.c,v 1.95 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997, 1998, 1999, 2000
|
||||
|
@ -71,7 +71,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.94 2019/05/23 10:57:29 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.95 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_inet.h"
|
||||
|
@ -957,7 +957,7 @@ static int
|
|||
kue_ioctl(struct ifnet *ifp, u_long command, void *data)
|
||||
{
|
||||
struct kue_softc *sc = ifp->if_softc;
|
||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||
struct ifreq *ifr = (struct ifreq *)data;
|
||||
int s, error = 0;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_mue.c,v 1.44 2019/05/23 10:57:29 msaitoh Exp $ */
|
||||
/* $NetBSD: if_mue.c,v 1.45 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
/* $OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -20,7 +20,7 @@
|
|||
/* Driver for Microchip LAN7500/LAN7800 chipsets. */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.44 2019/05/23 10:57:29 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.45 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_usb.h"
|
||||
|
@ -70,8 +70,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.44 2019/05/23 10:57:29 msaitoh Exp $");
|
|||
|
||||
#ifdef USB_DEBUG
|
||||
int muedebug = 0;
|
||||
#define DPRINTF(sc, fmt, args...) \
|
||||
do { \
|
||||
#define DPRINTF(sc, fmt, args...) \
|
||||
do { \
|
||||
if (muedebug) \
|
||||
MUE_PRINTF(sc, fmt, ##args); \
|
||||
} while (0 /* CONSTCOND */)
|
||||
|
@ -886,7 +886,8 @@ mue_get_macaddr(struct mue_softc *sc, prop_dictionary_t dict)
|
|||
|
||||
|
||||
/*
|
||||
* Probe for a Microchip chip. */
|
||||
* Probe for a Microchip chip.
|
||||
*/
|
||||
static int
|
||||
mue_match(device_t parent, cfdata_t match, void *aux)
|
||||
{
|
||||
|
@ -1862,7 +1863,7 @@ mue_stop(struct ifnet *ifp, int disable __unused)
|
|||
callout_stop(&sc->mue_stat_ch);
|
||||
sc->mue_link = 0;
|
||||
|
||||
/* Stop transfers. */
|
||||
/* Stop transfers. */
|
||||
for (i = 0; i < __arraycount(sc->mue_ep); i++)
|
||||
if (sc->mue_ep[i] != NULL) {
|
||||
err = usbd_abort_pipe(sc->mue_ep[i]);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_otus.c,v 1.36 2019/05/23 10:57:29 msaitoh Exp $ */
|
||||
/* $NetBSD: if_otus.c,v 1.37 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
/* $OpenBSD: if_otus.c,v 1.18 2010/08/27 17:08:00 jsg Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_otus.c,v 1.36 2019/05/23 10:57:29 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_otus.c,v 1.37 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_usb.h"
|
||||
|
@ -811,7 +811,7 @@ otus_attachhook(device_t arg)
|
|||
aprint_normal_dev(sc->sc_dev,
|
||||
"MAC/BBP AR9170, RF AR%X, MIMO %dT%dR, address %s\n",
|
||||
(sc->sc_capflags & AR5416_OPFLAGS_11A) ?
|
||||
0x9104 : ((sc->sc_txmask == 0x5) ? 0x9102 : 0x9101),
|
||||
0x9104 : ((sc->sc_txmask == 0x5) ? 0x9102 : 0x9101),
|
||||
(sc->sc_txmask == 0x5) ? 2 : 1, (sc->sc_rxmask == 0x5) ? 2 : 1,
|
||||
ether_sprintf(ic->ic_myaddr));
|
||||
|
||||
|
@ -860,7 +860,7 @@ otus_attachhook(device_t arg)
|
|||
ieee80211_ifattach(ic);
|
||||
|
||||
ic->ic_node_alloc = otus_node_alloc;
|
||||
ic->ic_newassoc = otus_newassoc;
|
||||
ic->ic_newassoc = otus_newassoc;
|
||||
ic->ic_updateslot = otus_updateslot;
|
||||
#ifdef HAVE_EDCA
|
||||
ic->ic_updateedca = otus_updateedca;
|
||||
|
@ -1132,7 +1132,7 @@ otus_alloc_tx_data_list(struct otus_softc *sc)
|
|||
for (i = 0; i < OTUS_TX_DATA_LIST_COUNT; i++) {
|
||||
data = &sc->sc_tx_data[i];
|
||||
|
||||
data->sc = sc; /* Backpointer for callbacks. */
|
||||
data->sc = sc; /* Backpointer for callbacks. */
|
||||
|
||||
error = usbd_create_xfer(sc->sc_data_tx_pipe, OTUS_TXBUFSZ,
|
||||
USBD_FORCE_SHORT_XFER, 0, &data->xfer);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_smsc.c,v 1.44 2019/05/23 10:40:40 msaitoh Exp $ */
|
||||
/* $NetBSD: if_smsc.c,v 1.45 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
|
||||
/* $OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $ */
|
||||
/* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
|
||||
|
@ -61,7 +61,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.44 2019/05/23 10:40:40 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.45 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_usb.h"
|
||||
|
@ -1441,8 +1441,8 @@ smsc_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
|
|||
ifp->if_collisions++;
|
||||
|
||||
if (rxhdr & (SMSC_RX_STAT_ERROR
|
||||
| SMSC_RX_STAT_LENGTH_ERROR
|
||||
| SMSC_RX_STAT_MII_ERROR)) {
|
||||
| SMSC_RX_STAT_LENGTH_ERROR
|
||||
| SMSC_RX_STAT_MII_ERROR)) {
|
||||
smsc_dbg_printf(sc, "rx error (hdr 0x%08x)\n", rxhdr);
|
||||
ifp->if_ierrors++;
|
||||
goto done;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_ure.c,v 1.5 2019/05/23 10:57:29 msaitoh Exp $ */
|
||||
/* $NetBSD: if_ure.c,v 1.6 2019/05/23 13:10:52 msaitoh Exp $ */
|
||||
/* $OpenBSD: if_ure.c,v 1.10 2018/11/02 21:32:30 jcs Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2015-2016 Kevin Lo <kevlo@FreeBSD.org>
|
||||
|
@ -29,7 +29,7 @@
|
|||
/* RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.5 2019/05/23 10:57:29 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.6 2019/05/23 13:10:52 msaitoh Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_usb.h"
|
||||
|
@ -757,7 +757,7 @@ ure_rtl8153_init(struct ure_softc *sc)
|
|||
ure_write_mem(sc, URE_USB_TOLERANCE,
|
||||
URE_MCU_TYPE_USB | URE_BYTE_EN_SIX_BYTES, u1u2, sizeof(u1u2));
|
||||
|
||||
for (i = 0; i < URE_TIMEOUT; i++) {
|
||||
for (i = 0; i < URE_TIMEOUT; i++) {
|
||||
if (ure_read_2(sc, URE_PLA_BOOT_CTRL, URE_MCU_TYPE_PLA) &
|
||||
URE_AUTOLOAD_DONE)
|
||||
break;
|
||||
|
@ -862,7 +862,7 @@ ure_rtl8153_init(struct ure_softc *sc)
|
|||
ure_write_2(sc, URE_USB_U2P3_CTRL, URE_MCU_TYPE_USB, val);
|
||||
|
||||
memset(u1u2, 0x00, sizeof(u1u2));
|
||||
ure_write_mem(sc, URE_USB_TOLERANCE,
|
||||
ure_write_mem(sc, URE_USB_TOLERANCE,
|
||||
URE_MCU_TYPE_USB | URE_BYTE_EN_SIX_BYTES, u1u2, sizeof(u1u2));
|
||||
|
||||
/* Disable ALDPS. */
|
||||
|
@ -1446,13 +1446,13 @@ ure_rxcsum(struct ifnet *ifp, struct ure_rxpkt *rp)
|
|||
flags |= M_CSUM_TCPv4;
|
||||
if (csum & URE_RXPKT_UDP_CS)
|
||||
flags |= M_CSUM_UDPv4;
|
||||
} else if (csum & URE_RXPKT_IPV6_CS) {
|
||||
} else if (csum & URE_RXPKT_IPV6_CS) {
|
||||
flags = 0;
|
||||
if (csum & URE_RXPKT_TCP_CS)
|
||||
flags |= M_CSUM_TCPv6;
|
||||
if (csum & URE_RXPKT_UDP_CS)
|
||||
flags |= M_CSUM_UDPv6;
|
||||
}
|
||||
}
|
||||
|
||||
flags &= enabled;
|
||||
if (__predict_false((flags & M_CSUM_IPv4) &&
|
||||
|
|
Loading…
Reference in New Issue