Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/alc/if_alc.c
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
#include <net/if_media.h> | #include <net/if_media.h> | ||||
#include <net/if_types.h> | #include <net/if_types.h> | ||||
#include <net/if_vlan_var.h> | #include <net/if_vlan_var.h> | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#include <netinet/in_systm.h> | #include <netinet/in_systm.h> | ||||
#include <netinet/ip.h> | #include <netinet/ip.h> | ||||
#include <netinet/tcp.h> | #include <netinet/tcp.h> | ||||
#include <netinet/netdump/netdump.h> | #include <net/panicnet.h> | ||||
emaste: should sort with other //net///?
presumably because it's basically an independent stack the… | |||||
cemAuthorUnsubmitted Done Inline ActionsAgree re: sort. Driver changes like this were done with simplistic mechanical sed so missed subtleties like header sorting. Re netinet/6, yeah long term we should support both. Having worked on netdump a little in the past, I’d prefer to keep the level of subdirectory nesting to the minimum acceptable level. Net/ seemed appropriate although admittedly it is outside of my general domain expertise. cem: Agree re: sort. Driver changes like this were done with simplistic mechanical sed so missed… | |||||
emasteUnsubmitted Not Done Inline Actionsought to sort while here emaste: ought to sort while here | |||||
cemAuthorUnsubmitted Done Inline Actionswell, ok cem: well, ok | |||||
#include <dev/mii/mii.h> | #include <dev/mii/mii.h> | ||||
#include <dev/mii/miivar.h> | #include <dev/mii/miivar.h> | ||||
#include <dev/pci/pcireg.h> | #include <dev/pci/pcireg.h> | ||||
#include <dev/pci/pcivar.h> | #include <dev/pci/pcivar.h> | ||||
#include <machine/bus.h> | #include <machine/bus.h> | ||||
▲ Show 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | |||||
static void alc_sysctl_node(struct alc_softc *); | static void alc_sysctl_node(struct alc_softc *); | ||||
static void alc_tick(void *); | static void alc_tick(void *); | ||||
static void alc_txeof(struct alc_softc *); | static void alc_txeof(struct alc_softc *); | ||||
static void alc_watchdog(struct alc_softc *); | static void alc_watchdog(struct alc_softc *); | ||||
static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); | static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); | ||||
static int sysctl_hw_alc_proc_limit(SYSCTL_HANDLER_ARGS); | static int sysctl_hw_alc_proc_limit(SYSCTL_HANDLER_ARGS); | ||||
static int sysctl_hw_alc_int_mod(SYSCTL_HANDLER_ARGS); | static int sysctl_hw_alc_int_mod(SYSCTL_HANDLER_ARGS); | ||||
NETDUMP_DEFINE(alc); | PANICNET_DEFINE(alc); | ||||
static device_method_t alc_methods[] = { | static device_method_t alc_methods[] = { | ||||
/* Device interface. */ | /* Device interface. */ | ||||
DEVMETHOD(device_probe, alc_probe), | DEVMETHOD(device_probe, alc_probe), | ||||
DEVMETHOD(device_attach, alc_attach), | DEVMETHOD(device_attach, alc_attach), | ||||
DEVMETHOD(device_detach, alc_detach), | DEVMETHOD(device_detach, alc_detach), | ||||
DEVMETHOD(device_shutdown, alc_shutdown), | DEVMETHOD(device_shutdown, alc_shutdown), | ||||
DEVMETHOD(device_suspend, alc_suspend), | DEVMETHOD(device_suspend, alc_suspend), | ||||
▲ Show 20 Lines • Show All 1,425 Lines • ▼ Show 20 Lines | alc_attach(device_t dev) | ||||
if (error != 0) { | if (error != 0) { | ||||
device_printf(dev, "could not set up interrupt handler.\n"); | device_printf(dev, "could not set up interrupt handler.\n"); | ||||
taskqueue_free(sc->alc_tq); | taskqueue_free(sc->alc_tq); | ||||
sc->alc_tq = NULL; | sc->alc_tq = NULL; | ||||
ether_ifdetach(ifp); | ether_ifdetach(ifp); | ||||
goto fail; | goto fail; | ||||
} | } | ||||
/* Attach driver netdump methods. */ | /* Attach driver panicnet methods. */ | ||||
NETDUMP_SET(ifp, alc); | PANICNET_SET(ifp, alc); | ||||
fail: | fail: | ||||
if (error != 0) | if (error != 0) | ||||
alc_detach(dev); | alc_detach(dev); | ||||
return (error); | return (error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 2,983 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
sysctl_hw_alc_int_mod(SYSCTL_HANDLER_ARGS) | sysctl_hw_alc_int_mod(SYSCTL_HANDLER_ARGS) | ||||
{ | { | ||||
return (sysctl_int_range(oidp, arg1, arg2, req, | return (sysctl_int_range(oidp, arg1, arg2, req, | ||||
ALC_IM_TIMER_MIN, ALC_IM_TIMER_MAX)); | ALC_IM_TIMER_MIN, ALC_IM_TIMER_MAX)); | ||||
} | } | ||||
#ifdef NETDUMP | #ifdef PANICNET | ||||
static void | static void | ||||
alc_netdump_init(struct ifnet *ifp, int *nrxr, int *ncl, int *clsize) | alc_panicnet_init(struct ifnet *ifp, int *nrxr, int *ncl, int *clsize) | ||||
{ | { | ||||
struct alc_softc *sc; | struct alc_softc *sc; | ||||
sc = if_getsoftc(ifp); | sc = if_getsoftc(ifp); | ||||
KASSERT(sc->alc_buf_size <= MCLBYTES, ("incorrect cluster size")); | KASSERT(sc->alc_buf_size <= MCLBYTES, ("incorrect cluster size")); | ||||
*nrxr = ALC_RX_RING_CNT; | *nrxr = ALC_RX_RING_CNT; | ||||
*ncl = NETDUMP_MAX_IN_FLIGHT; | *ncl = PANICNET_MAX_IN_FLIGHT; | ||||
*clsize = MCLBYTES; | *clsize = MCLBYTES; | ||||
} | } | ||||
static void | static void | ||||
alc_netdump_event(struct ifnet *ifp __unused, enum netdump_ev event __unused) | alc_panicnet_event(struct ifnet *ifp __unused, enum panicnet_ev event __unused) | ||||
{ | { | ||||
} | } | ||||
static int | static int | ||||
alc_netdump_transmit(struct ifnet *ifp, struct mbuf *m) | alc_panicnet_transmit(struct ifnet *ifp, struct mbuf *m) | ||||
{ | { | ||||
struct alc_softc *sc; | struct alc_softc *sc; | ||||
int error; | int error; | ||||
sc = if_getsoftc(ifp); | sc = if_getsoftc(ifp); | ||||
if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != | if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != | ||||
IFF_DRV_RUNNING) | IFF_DRV_RUNNING) | ||||
return (EBUSY); | return (EBUSY); | ||||
error = alc_encap(sc, &m); | error = alc_encap(sc, &m); | ||||
if (error == 0) | if (error == 0) | ||||
alc_start_tx(sc); | alc_start_tx(sc); | ||||
return (error); | return (error); | ||||
} | } | ||||
static int | static int | ||||
alc_netdump_poll(struct ifnet *ifp, int count) | alc_panicnet_poll(struct ifnet *ifp, int count) | ||||
{ | { | ||||
struct alc_softc *sc; | struct alc_softc *sc; | ||||
sc = if_getsoftc(ifp); | sc = if_getsoftc(ifp); | ||||
if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != | if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != | ||||
IFF_DRV_RUNNING) | IFF_DRV_RUNNING) | ||||
return (EBUSY); | return (EBUSY); | ||||
alc_txeof(sc); | alc_txeof(sc); | ||||
return (alc_rxintr(sc, count)); | return (alc_rxintr(sc, count)); | ||||
} | } | ||||
#endif /* NETDUMP */ | #endif /* PANICNET */ |
should sort with other net/?
presumably because it's basically an independent stack the IPv4/IPv6 bits ought not be split out into netinet/ or netinet6/?