32#include <machine/_inttypes.h>
34#define em_mac_min e1000_82571
35#define igb_mac_min e1000_82575
313static int em_get_rs(SYSCTL_HANDLER_ARGS);
354 DEVMETHOD(device_probe, iflib_device_probe),
355 DEVMETHOD(device_attach, iflib_device_attach),
356 DEVMETHOD(device_detach, iflib_device_detach),
357 DEVMETHOD(device_shutdown, iflib_device_shutdown),
358 DEVMETHOD(device_suspend, iflib_device_suspend),
359 DEVMETHOD(device_resume, iflib_device_resume),
366 DEVMETHOD(device_probe, iflib_device_probe),
367 DEVMETHOD(device_attach, iflib_device_attach),
368 DEVMETHOD(device_detach, iflib_device_detach),
369 DEVMETHOD(device_shutdown, iflib_device_shutdown),
370 DEVMETHOD(device_suspend, iflib_device_suspend),
371 DEVMETHOD(device_resume, iflib_device_resume),
482#define EM_TICKS_TO_USECS(ticks) ((1024 * (ticks) + 500) / 1000)
483#define EM_USECS_TO_TICKS(usecs) ((1000 * (usecs) + 512) / 1024)
485#define MAX_INTS_PER_SEC 8000
486#define DEFAULT_ITR (1000000000/(MAX_INTS_PER_SEC * 256))
493static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
494 "EM driver parameters");
497SYSCTL_INT(_hw_em, OID_AUTO, disable_crc_stripping, CTLFLAG_RDTUN,
503 0,
"Default transmit interrupt delay in usecs");
505 0,
"Default receive interrupt delay in usecs");
511 "Default transmit interrupt delay limit in usecs");
514 "Default receive interrupt delay limit in usecs");
518 0,
"Set to true to leave smart power down enabled on newer adapters");
523 "Show bad packets in promiscuous mode");
529 "Maximum number of received packets to process "
530 "at a time, -1 means unlimited");
535 "Enable Energy Efficient Ethernet");
541SYSCTL_INT(_hw_em, OID_AUTO, max_interrupt_rate, CTLFLAG_RDTUN,
554 .isc_magic = IFLIB_MAGIC,
555 .isc_q_align = PAGE_SIZE,
556 .isc_tx_maxsize =
EM_TSO_SIZE +
sizeof(
struct ether_vlan_header),
557 .isc_tx_maxsegsize = PAGE_SIZE,
558 .isc_tso_maxsize =
EM_TSO_SIZE +
sizeof(
struct ether_vlan_header),
560 .isc_rx_maxsize = MJUM9BYTES,
561 .isc_rx_nsegments = 1,
562 .isc_rx_maxsegsize = MJUM9BYTES,
566 .isc_admin_intrcnt = 1,
570 .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_TSO_INIT_IP | IFLIB_NEED_ZERO_CSUM,
581 .isc_magic = IFLIB_MAGIC,
582 .isc_q_align = PAGE_SIZE,
583 .isc_tx_maxsize =
EM_TSO_SIZE +
sizeof(
struct ether_vlan_header),
584 .isc_tx_maxsegsize = PAGE_SIZE,
585 .isc_tso_maxsize =
EM_TSO_SIZE +
sizeof(
struct ether_vlan_header),
587 .isc_rx_maxsize = MJUM9BYTES,
588 .isc_rx_nsegments = 1,
589 .isc_rx_maxsegsize = MJUM9BYTES,
593 .isc_admin_intrcnt = 1,
597 .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_TSO_INIT_IP | IFLIB_NEED_ZERO_CSUM,
612#define IGB_REGS_LEN 739
625 rc = sysctl_wire_old_buffer(req, 0);
628 free(regs_buff, M_DEVBUF);
632 sb = sbuf_new_for_sysctl(NULL, NULL, 32*400, req);
635 free(regs_buff, M_DEVBUF);
663 sbuf_printf(sb,
"General Registers\n");
664 sbuf_printf(sb,
"\tCTRL\t %08x\n", regs_buff[0]);
665 sbuf_printf(sb,
"\tSTATUS\t %08x\n", regs_buff[1]);
666 sbuf_printf(sb,
"\tCTRL_EXT\t %08x\n\n", regs_buff[2]);
668 sbuf_printf(sb,
"Interrupt Registers\n");
669 sbuf_printf(sb,
"\tICR\t %08x\n\n", regs_buff[3]);
671 sbuf_printf(sb,
"RX Registers\n");
672 sbuf_printf(sb,
"\tRCTL\t %08x\n", regs_buff[4]);
673 sbuf_printf(sb,
"\tRDLEN\t %08x\n", regs_buff[5]);
674 sbuf_printf(sb,
"\tRDH\t %08x\n", regs_buff[6]);
675 sbuf_printf(sb,
"\tRDT\t %08x\n", regs_buff[7]);
676 sbuf_printf(sb,
"\tRXDCTL\t %08x\n", regs_buff[8]);
677 sbuf_printf(sb,
"\tRDBAL\t %08x\n", regs_buff[9]);
678 sbuf_printf(sb,
"\tRDBAH\t %08x\n\n", regs_buff[10]);
680 sbuf_printf(sb,
"TX Registers\n");
681 sbuf_printf(sb,
"\tTCTL\t %08x\n", regs_buff[11]);
682 sbuf_printf(sb,
"\tTDBAL\t %08x\n", regs_buff[12]);
683 sbuf_printf(sb,
"\tTDBAH\t %08x\n", regs_buff[13]);
684 sbuf_printf(sb,
"\tTDLEN\t %08x\n", regs_buff[14]);
685 sbuf_printf(sb,
"\tTDH\t %08x\n", regs_buff[15]);
686 sbuf_printf(sb,
"\tTDT\t %08x\n", regs_buff[16]);
687 sbuf_printf(sb,
"\tTXDCTL\t %08x\n", regs_buff[17]);
688 sbuf_printf(sb,
"\tTDFH\t %08x\n", regs_buff[18]);
689 sbuf_printf(sb,
"\tTDFT\t %08x\n", regs_buff[19]);
690 sbuf_printf(sb,
"\tTDFHS\t %08x\n", regs_buff[20]);
691 sbuf_printf(sb,
"\tTDFPC\t %08x\n\n", regs_buff[21]);
693 free(regs_buff, M_DEVBUF);
697 if_softc_ctx_t scctx = sc->
shared;
698 struct rx_ring *rxr = &rx_que->rxr;
699 struct tx_ring *txr = &tx_que->txr;
700 int ntxd = scctx->isc_ntxd[0];
701 int nrxd = scctx->isc_nrxd[0];
704 for (j = 0; j < nrxd; j++) {
707 sbuf_printf(sb,
"\tReceive Descriptor Address %d: %08" PRIx64
" Error:%d Length:%d\n", j, rxr->
rx_base[j].
read.
buffer_addr, staterr, length);
710 for (j = 0; j < min(ntxd, 256); j++) {
711 unsigned int *ptr = (
unsigned int *)&txr->
tx_base[j];
713 sbuf_printf(sb,
"\tTXD[%03d] [0]: %08x [1]: %08x [2]: %08x [3]: %08x eop: %d DD=%d\n",
714 j, ptr[0], ptr[1], ptr[2], ptr[3], buf->eop,
721 rc = sbuf_finish(sb);
769 IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \
770 IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER
773 IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \
774 IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \
775 IFCAP_LRO | IFCAP_VLAN_HWTSO
778 IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \
779 IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \
780 IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 |\
796 if_softc_ctx_t scctx;
799 struct sysctl_oid_list *child;
800 struct sysctl_ctx_list *ctx_list;
804 dev = iflib_get_dev(ctx);
805 sc = iflib_get_softc(ctx);
809 scctx = sc->
shared = iflib_get_softc_ctx(ctx);
810 sc->
media = iflib_get_media(ctx);
819 ctx_list = device_get_sysctl_ctx(dev);
820 child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev));
822 SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO,
"nvm",
823 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0,
826 SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO,
"fw_version",
827 CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0,
829 "Prints FW/NVM Versions");
831 SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO,
"debug",
832 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0,
835 SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO,
"fc",
836 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0,
839 SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO,
"reg_dump",
840 CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0,
843 SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO,
"rs_dump",
844 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0,
850 device_printf(dev,
"attach_pre capping queues at %d\n",
851 scctx->isc_ntxqsets_max);
862 scctx->isc_capabilities = scctx->isc_capenable =
IGB_CAPS;
863 scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP |
CSUM_TSO |
864 CSUM_IP6_TCP | CSUM_IP6_UDP;
866 scctx->isc_tx_csum_flags |= CSUM_SCTP | CSUM_IP6_SCTP;
872 scctx->isc_msix_bar = pci_msix_table_bar(dev);
882 scctx->isc_capabilities = scctx->isc_capenable =
EM_CAPS;
899 scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO);
900 scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO;
906 scctx->isc_msix_bar = pci_msix_table_bar(dev);;
908 scctx->isc_msix_bar = -1;
909 scctx->isc_disable_msix = 1;
916 scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP;
920 scctx->isc_capabilities &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM);
923 scctx->isc_capabilities &= ~IFCAP_VLAN_HWTAGGING;
925 scctx->isc_msix_bar = 0;
926 scctx->isc_capenable = scctx->isc_capabilities;
931 device_printf(dev,
"Allocation of PCI resources failed\n");
949 sc->
flash = bus_alloc_resource_any(dev,
950 SYS_RES_MEMORY, &rid, RF_ACTIVE);
951 if (sc->
flash == NULL) {
952 device_printf(dev,
"Mapping of Flash failed\n");
959 rman_get_bustag(sc->
flash);
961 rman_get_bushandle(sc->
flash);
980 device_printf(dev,
"Setup of Shared code failed, error %d\n",
997 "receive interrupt delay limit in usecs",
1002 "transmit interrupt delay limit in usecs",
1007 "interrupt delay limit in usecs/4",
1041 sc->
mta = malloc(
sizeof(
u8) * ETHER_ADDR_LEN *
1043 if (sc->
mta == NULL) {
1044 device_printf(dev,
"Can not allocate multicast setup array\n");
1051 device_printf(dev,
"PHY reset is blocked"
1052 " due to SOL/IDER session.\n");
1056 SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO,
"eee_control",
1057 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0,
1076 "The EEPROM Checksum Is Not Valid\n");
1084 device_printf(dev,
"EEPROM read error while reading MAC"
1092 ether_gen_addr(iflib_get_ifp(ctx),
1093 (
struct ether_addr *)hw->
mac.
addr);
1095 device_printf(dev,
"Invalid MAC address\n");
1115 scctx->isc_capenable &= ~IFCAP_WOL;
1117 scctx->isc_capenable |= IFCAP_WOL_MAGIC;
1119 iflib_set_mac(ctx, hw->
mac.
addr);
1127 free(sc->
mta, M_DEVBUF);
1142 device_printf(sc->
dev,
"Interface setup failed: %d\n", error);
1188 free(sc->
mta, M_DEVBUF);
1238 if_softc_ctx_t scctx = iflib_get_softc_ctx(
ctx);
1258 max_frame_size = 9234;
1261 max_frame_size = 4096;
1266 max_frame_size = ETHER_MAX_LEN;
1270 max_frame_size = 9234;
1274 if (mtu > max_frame_size - ETHER_HDR_LEN - ETHER_CRC_LEN) {
1279 mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
1296 if_softc_ctx_t scctx = sc->
shared;
1297 struct ifnet *ifp = iflib_get_ifp(ctx);
1374 }
else if (
sc->intr_type == IFLIB_INTR_MSIX)
1410 if (reg_icr == 0xffffffff)
1411 return FILTER_STRAY;
1415 return FILTER_STRAY;
1423 return FILTER_STRAY;
1431 IFDI_INTR_DISABLE(
ctx);
1440 return (FILTER_SCHEDULE_THREAD);
1495 return (FILTER_SCHEDULE_THREAD);
1510 MPASS(sc->
hw.
back != NULL);
1536 return (FILTER_HANDLED);
1542 if_ctx_t
ctx = context;
1546 iflib_admin_intr_deferred(
ctx);
1561 u_char fiber_type = IFM_1000_SX;
1565 iflib_admin_intr_deferred(
ctx);
1567 ifmr->ifm_status = IFM_AVALID;
1568 ifmr->ifm_active = IFM_ETHER;
1574 ifmr->ifm_status |= IFM_ACTIVE;
1579 fiber_type = IFM_1000_LX;
1580 ifmr->ifm_active |= fiber_type | IFM_FDX;
1584 ifmr->ifm_active |= IFM_10_T;
1587 ifmr->ifm_active |= IFM_100_TX;
1590 ifmr->ifm_active |= IFM_1000_T;
1594 ifmr->ifm_active |= IFM_FDX;
1596 ifmr->ifm_active |= IFM_HDX;
1612 struct ifmedia *ifm = iflib_get_media(ctx);
1616 if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
1619 switch (IFM_SUBTYPE(ifm->ifm_media)) {
1633 if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX)
1641 if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX)
1647 device_printf(sc->
dev,
"Unsupported media type\n");
1659 struct ifnet *ifp = iflib_get_ifp(ctx);
1665 if (flags & IFF_ALLMULTI)
1671 reg_rctl &= (~E1000_RCTL_MPE);
1674 if (flags & IFF_PROMISC) {
1682 if (flags & IFF_ALLMULTI) {
1684 reg_rctl &= ~E1000_RCTL_UPE;
1701 bcopy(LLADDR(sdl), &mta[idx * ETHER_ADDR_LEN], ETHER_ADDR_LEN);
1716 struct ifnet *ifp = iflib_get_ifp(ctx);
1740 if (if_getflags(ifp) & IFF_PROMISC)
1743 if_getflags(ifp) & IFF_ALLMULTI) {
1745 reg_rctl &= ~E1000_RCTL_UPE;
1757 reg_rctl &= ~E1000_RCTL_RST;
1780 iflib_admin_intr_deferred(ctx);
1788 device_t dev = iflib_get_dev(ctx);
1789 u32 link_check, thstat, ctrl;
1791 link_check = thstat = ctrl = 0;
1841 tarc0 &= ~TARC_SPEED_MODE_BIT;
1845 device_printf(dev,
"Link is up %d Mbps %s\n",
1848 "Full Duplex" :
"Half Duplex"));
1854 device_printf(dev,
"Link: thermal downshift\n");
1867 iflib_link_state_change(ctx, LINK_STATE_UP,
1869 }
else if (!link_check && (sc->
link_active == 1)) {
1873 iflib_link_state_change(ctx, LINK_STATE_DOWN, 0);
1926 device_t
dev = iflib_get_dev(
ctx);
1937 pci_read_config(
dev, PCIR_SUBVEND_0, 2);
1939 pci_read_config(
dev, PCIR_SUBDEV_0, 2);
1943 device_printf(
dev,
"Setup init failure\n");
1959 device_t
dev = iflib_get_dev(
ctx);
1963 sc->
memory = bus_alloc_resource_any(
dev, SYS_RES_MEMORY,
1965 if (sc->
memory == NULL) {
1966 device_printf(
dev,
"Unable to allocate bus resource: memory\n");
1971 rman_get_bushandle(sc->
memory);
1978 for (rid = PCIR_BAR(0); rid < PCIR_CIS;) {
1979 val = pci_read_config(
dev, rid, 4);
1988 if (rid >= PCIR_CIS) {
1989 device_printf(
dev,
"Unable to locate IO BAR\n");
1992 sc->
ioport = bus_alloc_resource_any(
dev, SYS_RES_IOPORT,
1994 if (sc->
ioport == NULL) {
1995 device_printf(
dev,
"Unable to allocate bus resource: "
2001 rman_get_bustag(sc->
ioport);
2003 rman_get_bushandle(sc->
ioport);
2022 int error, rid, i, vector = 0, rx_vectors;
2026 for (i = 0; i <
sc->rx_num_queues; i++, rx_que++, vector++) {
2028 snprintf(buf,
sizeof(buf),
"rxq%d", i);
2029 error = iflib_irq_alloc_generic(ctx, &rx_que->
que_irq, rid, IFLIB_INTR_RXTX,
em_msix_que, rx_que, rx_que->
me, buf);
2031 device_printf(iflib_get_dev(ctx),
"Failed to allocate que int %d err: %d", i, error);
2032 sc->rx_num_queues = i + 1;
2036 rx_que->
msix = vector;
2045 rx_que->
eims = 1 << (20 + i);
2051 rx_que->
eims = 1 << vector;
2053 rx_vectors = vector;
2056 for (i = 0; i <
sc->tx_num_queues; i++, tx_que++, vector++) {
2057 snprintf(buf,
sizeof(buf),
"txq%d", i);
2059 iflib_softirq_alloc_generic(ctx,
2061 IFLIB_INTR_TX, tx_que, tx_que->
me, buf);
2063 tx_que->
msix = (vector %
sc->rx_num_queues);
2072 tx_que->
eims = 1 << (22 + i);
2078 tx_que->
eims = 1 << i;
2083 rid = rx_vectors + 1;
2084 error = iflib_irq_alloc_generic(ctx, &
sc->
irq, rid, IFLIB_INTR_ADMIN,
em_msix_link,
sc, 0,
"aq");
2087 device_printf(iflib_get_dev(ctx),
"Failed to register admin handler");
2092 sc->
ivars |= (8 | rx_vectors) << 16;
2100 iflib_irq_free(ctx, &
sc->
irq);
2102 for (
int i = 0; i <
sc->rx_num_queues; i++, rx_que++)
2103 iflib_irq_free(ctx, &rx_que->
que_irq);
2113 u32 tmp, ivar = 0, newitr = 0;
2131 for (
int i = 0; i <
sc->rx_num_queues; i++) {
2145 for (
int i = 0; i <
sc->tx_num_queues; i++) {
2167 for (
int i = 0; i <
sc->rx_num_queues; i++) {
2168 u32 index = i & 0x7;
2182 for (
int i = 0; i <
sc->tx_num_queues; i++) {
2183 u32 index = i & 0x7;
2213 for (
int i = 0; i <
sc->rx_num_queues; i++) {
2236 newitr |= newitr << 16;
2240 for (
int i = 0; i <
sc->rx_num_queues; i++) {
2253 device_t dev = iflib_get_dev(ctx);
2256 if (
sc->intr_type == IFLIB_INTR_MSIX)
2257 iflib_irq_free(ctx, &
sc->
irq);
2260 for (
int i = 0; i <
sc->rx_num_queues; i++, que++) {
2261 iflib_irq_free(ctx, &que->
que_irq);
2266 bus_release_resource(dev, SYS_RES_MEMORY,
2272 bus_release_resource(dev, SYS_RES_MEMORY,
2278 bus_release_resource(dev, SYS_RES_IOPORT,
2322 phy_tmp &= ~CR_1000T_MS_ENABLE;
2366 u32 dmac, reg = ~E1000_DMACR_DMAC_EN;
2373 max_frame_size = sc->
shared->isc_max_frame_size;
2376 if (sc->
dmac == 0) {
2380 device_printf(dev,
"DMA Coalescing enabled\n");
2385 hwm = 64 * pba - max_frame_size / 16;
2386 if (hwm < 64 * (pba - 6))
2387 hwm = 64 * (pba - 6);
2389 reg &= ~E1000_FCRTC_RTH_COAL_MASK;
2395 dmac = pba - max_frame_size / 512;
2396 if (dmac < pba - 10)
2399 reg &= ~E1000_DMACR_DMACTHR_MASK;
2416 reg |= ((sc->
dmac * 5) >> 6);
2418 reg |= (sc->
dmac >> 5);
2420 reg |= (sc->
dmac >> 5);
2450 (2 * max_frame_size)) >> 6);
2454 reg &= ~E1000_PCIEMISC_LX_DECISION;
2474 device_t dev = iflib_get_dev(ctx);
2476 struct ifnet *ifp = iflib_get_ifp(ctx);
2492 phy_tmp &= ~IGP02E1000_PM_SPD;
2574 u32 tx_space, min_tx, min_rx;
2576 tx_space = pba >> 16;
2580 min_tx = roundup2(min_tx, 1024);
2583 min_rx = roundup2(min_rx, 1024);
2585 if (tx_space < min_tx &&
2586 ((min_tx - tx_space) < pba)) {
2587 pba = pba - (min_tx - tx_space);
2617 rx_buffer_size = (pba & 0xffff) << 10;
2640 if (if_getmtu(ifp) > ETHERMTU) {
2661 if (if_getmtu(ifp) > ETHERMTU)
2683 if (if_getmtu(ifp) > ETHERMTU) {
2706 sc->
flags &= ~IGB_MEDIA_RESET;
2710 device_printf(dev,
"Hardware Initialization Failed\n");
2738 arc4rand(rss_key,
sizeof(rss_key), 0);
2750 for (i = 0; i <
sizeof(reta); ++i) {
2753 q = (i % sc->rx_num_queues) << 7;
2754 reta |= q << (8 * i);
2757 for (i = 0; i < 32; ++i)
2775 u32 rss_key[10], mrqc, shift = 0;
2796 for (i = 0; i < 128; i++) {
2798 queue_id = rss_get_indirection_to_bucket(i);
2812 queue_id = queue_id % sc->rx_num_queues;
2814 queue_id = (i % sc->rx_num_queues);
2817 queue_id = queue_id << shift;
2824 reta = reta | ( ((uint32_t) queue_id) << 24);
2841 rss_getkey((uint8_t *) &rss_key);
2843 arc4rand(&rss_key,
sizeof(rss_key), 0);
2845 for (i = 0; i < 10; i++)
2871 struct ifnet *ifp = iflib_get_ifp(ctx);
2873 if_softc_ctx_t scctx = sc->
shared;
2878 if (sc->tx_num_queues == 1) {
2879 if_setsendqlen(ifp, scctx->isc_ntxd[0] - 1);
2880 if_setsendqready(ifp);
2889 u_char fiber_type = IFM_1000_SX;
2892 fiber_type = IFM_1000_LX;
2893 ifmedia_add(sc->
media, IFM_ETHER | fiber_type | IFM_FDX, 0, NULL);
2894 ifmedia_add(sc->
media, IFM_ETHER | fiber_type, 0, NULL);
2896 ifmedia_add(sc->
media, IFM_ETHER | IFM_10_T, 0, NULL);
2897 ifmedia_add(sc->
media, IFM_ETHER | IFM_10_T | IFM_FDX, 0, NULL);
2898 ifmedia_add(sc->
media, IFM_ETHER | IFM_100_TX, 0, NULL);
2899 ifmedia_add(sc->
media, IFM_ETHER | IFM_100_TX | IFM_FDX, 0, NULL);
2901 ifmedia_add(sc->
media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL);
2902 ifmedia_add(sc->
media, IFM_ETHER | IFM_1000_T, 0, NULL);
2905 ifmedia_add(sc->
media, IFM_ETHER | IFM_AUTO, 0, NULL);
2906 ifmedia_set(sc->
media, IFM_ETHER | IFM_AUTO);
2914 if_softc_ctx_t scctx = sc->
shared;
2919 MPASS(
sc->tx_num_queues > 0);
2920 MPASS(
sc->tx_num_queues == ntxqsets);
2925 sc->tx_num_queues, M_DEVBUF, M_NOWAIT | M_ZERO))) {
2926 device_printf(iflib_get_dev(ctx),
"Unable to allocate queue memory\n");
2935 que->
me = txr->
me = i;
2938 if (!(txr->
tx_rsq = (qidx_t *) malloc(
sizeof(qidx_t) * scctx->isc_ntxd[0], M_DEVBUF, M_NOWAIT | M_ZERO))) {
2939 device_printf(iflib_get_dev(ctx),
"failed to allocate rs_idxs memory\n");
2943 for (j = 0; j < scctx->isc_ntxd[0]; j++)
2944 txr->
tx_rsq[j] = QIDX_INVALID;
2951 device_printf(iflib_get_dev(ctx),
2952 "allocated for %d tx_queues\n",
sc->tx_num_queues);
2967 MPASS(
sc->rx_num_queues > 0);
2968 MPASS(
sc->rx_num_queues == nrxqsets);
2973 sc->rx_num_queues, M_DEVBUF, M_NOWAIT | M_ZERO))) {
2974 device_printf(iflib_get_dev(ctx),
"Unable to allocate queue memory\n");
2979 for (i = 0, que =
sc->
rx_queues; i < nrxqsets; i++, que++) {
2992 device_printf(iflib_get_dev(ctx),
2993 "allocated for %d rx_queues\n", sc->rx_num_queues);
3008 if (tx_que != NULL) {
3009 for (
int i = 0; i <
sc->tx_num_queues; i++, tx_que++) {
3014 free(txr->
tx_rsq, M_DEVBUF);
3021 if (rx_que != NULL) {
3036 if_softc_ctx_t scctx = sc->
shared;
3040 u32 tctl, txdctl = 0, tarc, tipg = 0;
3044 for (
int i = 0; i < sc->tx_num_queues; i++, txr++) {
3054 endp = (caddr_t)(txr + 1);
3055 bzero(offp, endp - offp);
3061 (
u32)(bus_addr >> 32));
3127 if ( sc->tx_num_queues > 1) {
3140 tctl &= ~E1000_TCTL_CT;
3158 reg &= ~E1000_TARC0_CB_MULTIQ_3_REQ;
3169#define BSIZEPKT_ROUNDUP ((1<<E1000_SRRCTL_BSIZEPKT_SHIFT)-1)
3175 if_softc_ctx_t scctx = sc->
shared;
3176 struct ifnet *ifp = iflib_get_ifp(ctx);
3180 uint32_t rctl, rxcsum;
3200 rctl &= ~E1000_RCTL_SBP;
3203 if (if_getmtu(ifp) > ETHERMTU)
3206 rctl &= ~E1000_RCTL_LPE;
3235 for (
int i = 0; i < 4; i++)
3246 if (if_getcapenable(ifp) & IFCAP_RXCSUM) {
3251 if_getcapenable(ifp) & IFCAP_HWCSUM_IPV6)
3256 rxcsum &= ~E1000_RXCSUM_CRCOFL;
3258 rxcsum &= ~E1000_RXCSUM_IPV6OFL;
3261 if (
sc->rx_num_queues > 1) {
3287 u32 rdt =
sc->rx_num_queues -1;
3311 for (
int i = 0; i <
sc->rx_num_queues; i++) {
3320 u32 psize, srrctl = 0;
3322 if (if_getmtu(ifp) > ETHERMTU) {
3323 psize = scctx->isc_max_frame_size;
3325 if (ifp->if_vlantrunk != NULL)
3344 if ((
sc->rx_num_queues > 1) &&
3357 rxr->hdr_split = igb_header_split;
3365 (uint32_t)(bus_addr >> 32));
3367 (uint32_t)bus_addr);
3372 rxdctl &= 0xFFF00000;
3379 if (if_getmtu(ifp) > ETHERMTU)
3386 rctl &= ~E1000_RCTL_VFE;
3398 rctl &= ~E1000_RCTL_BSEX;
3410 rctl &= ~0x00000C00;
3424 index = (vtag >> 5) & 0x7F;
3437 index = (vtag >> 5) & 0x7F;
3447 if_t ifp = iflib_get_ifp(
ctx);
3449 if ((if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) &&
3478 reg &= ~E1000_RCTL_CFIEN;
3525 struct ifnet *ifp = iflib_get_ifp(ctx);
3534 if (if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING &&
3541 reg &= ~E1000_CTRL_VME;
3568 if (sc->intr_type == IFLIB_INTR_MSIX) {
3570 ims_mask |= sc->
ims;
3582 if (sc->intr_type == IFLIB_INTR_MSIX)
3595 if (__predict_true(sc->intr_type == IFLIB_INTR_MSIX)) {
3612 if (__predict_true(sc->intr_type == IFLIB_INTR_MSIX)) {
3629#define E1000_82542_MANC2H E1000_MANC2H
3639#define E1000_MNG2HOST_PORT_623 (1 << 5)
3640#define E1000_MNG2HOST_PORT_664 (1 << 6)
3660 manc &= ~E1000_MANC_EN_MNG2HOST;
3722 char zero_addr[6] = { 0, 0, 0, 0, 0, 0 };
3724 if ((addr[0] & 1) || (!bcmp(addr, zero_addr, ETHER_ADDR_LEN))) {
3740 device_t
dev = iflib_get_dev(
ctx);
3741 u16 eeprom_data = 0, device_id, apme_mask;
3805 if (eeprom_data & apme_mask)
3812 device_id = pci_get_device(
dev);
3813 switch (device_id) {
3862 device_t
dev = iflib_get_dev(
ctx);
3863 if_t ifp = iflib_get_ifp(
ctx);
3865 u32 pmc, ctrl, ctrl_ext, rctl;
3868 if (pci_find_cap(
dev, PCIY_PMG, &pmc) != 0)
3875 if ((if_getcapenable(ifp) & IFCAP_WOL_MAGIC) == 0)
3876 sc->
wol &= ~E1000_WUFC_MAG;
3878 if ((if_getcapenable(ifp) & IFCAP_WOL_UCAST) == 0)
3879 sc->
wol &= ~E1000_WUFC_EX;
3881 if ((if_getcapenable(ifp) & IFCAP_WOL_MCAST) == 0)
3882 sc->
wol &= ~E1000_WUFC_MC;
3925 status = pci_read_config(
dev, pmc + PCIR_POWER_STATUS, 2);
3926 status &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE);
3927 if (!error && (if_getcapenable(ifp) & IFCAP_WOL))
3928 status |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE;
3929 pci_write_config(
dev, pmc + PCIR_POWER_STATUS, status, 2);
3953 (
u16)((mreg >> 16) & 0xFFFF));
3988 printf(
"Could not acquire PHY\n");
3995 printf(
"Could not read PHY page 769\n");
4001 printf(
"Could not set PHY Host Wakeup bit\n");
4029 u16 link_cap,link_ctrl;
4040 if (pci_find_cap(
dev, PCIY_EXPRESS, &base) != 0)
4042 reg = base + PCIER_LINK_CAP;
4043 link_cap = pci_read_config(
dev, reg, 2);
4044 if ((link_cap & PCIEM_LINK_CAP_ASPM) == 0)
4046 reg = base + PCIER_LINK_CTL;
4047 link_ctrl = pci_read_config(
dev, reg, 2);
4048 link_ctrl &= ~PCIEM_LINK_CTL_ASPMC;
4049 pci_write_config(
dev, reg, link_ctrl, 2);
4086 sc->
shared->isc_pause_frames = 1;
4160 struct ifnet *ifp = iflib_get_ifp(ctx);
4163 case IFCOUNTER_COLLISIONS:
4165 case IFCOUNTER_IERRORS:
4170 case IFCOUNTER_OERRORS:
4174 return (if_get_counter_default(ifp, cnt));
4190 case IFLIB_RESTART_VLAN_CONFIG:
4204 sc = oidp->oid_arg1;
4206 return (sysctl_handle_int(oidp, &val, 0, req));
4215 device_t
dev = iflib_get_dev(sc->
ctx);
4219 struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev);
4220 struct sysctl_oid *tree = device_get_sysctl_tree(dev);
4221 struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree);
4224 struct sysctl_oid *stat_node, *queue_node, *int_node;
4225 struct sysctl_oid_list *stat_list, *queue_list, *int_list;
4227#define QUEUE_NAME_LEN 32
4231 SYSCTL_ADD_ULONG(ctx, child, OID_AUTO,
"dropped",
4233 "Driver dropped packets");
4234 SYSCTL_ADD_ULONG(ctx, child, OID_AUTO,
"link_irq",
4236 "Link MSI-X IRQ Handled");
4237 SYSCTL_ADD_ULONG(ctx, child, OID_AUTO,
"rx_overruns",
4240 SYSCTL_ADD_ULONG(ctx, child, OID_AUTO,
"watchdog_timeouts",
4242 "Watchdog timeouts");
4243 SYSCTL_ADD_PROC(ctx, child, OID_AUTO,
"device_control",
4244 CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT,
4246 "Device Control Register");
4247 SYSCTL_ADD_PROC(ctx, child, OID_AUTO,
"rx_control",
4248 CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT,
4250 "Receiver Control Register");
4251 SYSCTL_ADD_UINT(ctx, child, OID_AUTO,
"fc_high_water",
4253 "Flow Control High Watermark");
4254 SYSCTL_ADD_UINT(ctx, child, OID_AUTO,
"fc_low_water",
4256 "Flow Control Low Watermark");
4258 for (
int i = 0; i < sc->tx_num_queues; i++, tx_que++) {
4261 queue_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf,
4262 CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
"TX Queue Name");
4263 queue_list = SYSCTL_CHILDREN(queue_node);
4265 SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO,
"txd_head",
4266 CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT,
sc,
4268 "Transmit Descriptor Head");
4269 SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO,
"txd_tail",
4270 CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT,
sc,
4272 "Transmit Descriptor Tail");
4273 SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
"tx_irq",
4274 CTLFLAG_RD, &txr->
tx_irq,
4275 "Queue MSI-X Transmit Interrupts");
4278 for (
int j = 0; j <
sc->rx_num_queues; j++, rx_que++) {
4281 queue_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf,
4282 CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
"RX Queue Name");
4283 queue_list = SYSCTL_CHILDREN(queue_node);
4285 SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO,
"rxd_head",
4286 CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT,
sc,
4288 "Receive Descriptor Head");
4289 SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO,
"rxd_tail",
4290 CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT,
sc,
4292 "Receive Descriptor Tail");
4293 SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
"rx_irq",
4294 CTLFLAG_RD, &rxr->
rx_irq,
4295 "Queue MSI-X Receive Interrupts");
4300 stat_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO,
"mac_stats",
4301 CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
"Statistics");
4302 stat_list = SYSCTL_CHILDREN(stat_node);
4304 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"excess_coll",
4305 CTLFLAG_RD, &stats->
ecol,
4306 "Excessive collisions");
4307 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"single_coll",
4308 CTLFLAG_RD, &stats->
scc,
4309 "Single collisions");
4310 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"multiple_coll",
4311 CTLFLAG_RD, &stats->
mcc,
4312 "Multiple collisions");
4313 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"late_coll",
4316 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"collision_count",
4317 CTLFLAG_RD, &stats->
colc,
4319 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"symbol_errors",
4322 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"sequence_errors",
4325 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"defer_count",
4328 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"missed_packets",
4331 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"recv_no_buff",
4333 "Receive No Buffers");
4334 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"recv_undersize",
4336 "Receive Undersize");
4337 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"recv_fragmented",
4339 "Fragmented Packets Received ");
4340 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"recv_oversize",
4342 "Oversized Packets Received");
4343 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"recv_jabber",
4346 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"recv_errs",
4349 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"crc_errs",
4352 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"alignment_errs",
4354 "Alignment Errors");
4356 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"coll_ext_errs",
4358 "Collision/Carrier extension errors");
4359 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"xon_recvd",
4362 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"xon_txd",
4365 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"xoff_recvd",
4368 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"xoff_txd",
4370 "XOFF Transmitted");
4373 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"total_pkts_recvd",
4375 "Total Packets Received ");
4376 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"good_pkts_recvd",
4378 "Good Packets Received");
4379 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"bcast_pkts_recvd",
4381 "Broadcast Packets Received");
4382 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"mcast_pkts_recvd",
4384 "Multicast Packets Received");
4385 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"rx_frames_64",
4387 "64 byte frames received ");
4388 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"rx_frames_65_127",
4390 "65-127 byte frames received");
4391 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"rx_frames_128_255",
4393 "128-255 byte frames received");
4394 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"rx_frames_256_511",
4396 "256-511 byte frames received");
4397 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"rx_frames_512_1023",
4399 "512-1023 byte frames received");
4400 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"rx_frames_1024_1522",
4402 "1023-1522 byte frames received");
4403 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"good_octets_recvd",
4405 "Good Octets Received");
4408 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"good_octets_txd",
4410 "Good Octets Transmitted");
4411 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"total_pkts_txd",
4413 "Total Packets Transmitted");
4414 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"good_pkts_txd",
4416 "Good Packets Transmitted");
4417 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"bcast_pkts_txd",
4419 "Broadcast Packets Transmitted");
4420 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"mcast_pkts_txd",
4422 "Multicast Packets Transmitted");
4423 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"tx_frames_64",
4425 "64 byte frames transmitted ");
4426 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"tx_frames_65_127",
4428 "65-127 byte frames transmitted");
4429 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"tx_frames_128_255",
4431 "128-255 byte frames transmitted");
4432 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"tx_frames_256_511",
4434 "256-511 byte frames transmitted");
4435 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"tx_frames_512_1023",
4437 "512-1023 byte frames transmitted");
4438 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"tx_frames_1024_1522",
4440 "1024-1522 byte frames transmitted");
4441 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"tso_txd",
4443 "TSO Contexts Transmitted");
4444 SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO,
"tso_ctx_fail",
4446 "TSO Contexts Failed");
4451 int_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO,
"interrupts",
4452 CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
"Interrupt Statistics");
4453 int_list = SYSCTL_CHILDREN(int_node);
4455 SYSCTL_ADD_UQUAD(ctx, int_list, OID_AUTO,
"asserts",
4457 "Interrupt Assertion Count");
4459 SYSCTL_ADD_UQUAD(ctx, int_list, OID_AUTO,
"rx_pkt_timer",
4461 "Interrupt Cause Rx Pkt Timer Expire Count");
4463 SYSCTL_ADD_UQUAD(ctx, int_list, OID_AUTO,
"rx_abs_timer",
4465 "Interrupt Cause Rx Abs Timer Expire Count");
4467 SYSCTL_ADD_UQUAD(ctx, int_list, OID_AUTO,
"tx_pkt_timer",
4469 "Interrupt Cause Tx Pkt Timer Expire Count");
4471 SYSCTL_ADD_UQUAD(ctx, int_list, OID_AUTO,
"tx_abs_timer",
4473 "Interrupt Cause Tx Abs Timer Expire Count");
4475 SYSCTL_ADD_UQUAD(ctx, int_list, OID_AUTO,
"tx_queue_empty",
4477 "Interrupt Cause Tx Queue Empty Count");
4479 SYSCTL_ADD_UQUAD(ctx, int_list, OID_AUTO,
"tx_queue_min_thresh",
4481 "Interrupt Cause Tx Queue Min Thresh Count");
4483 SYSCTL_ADD_UQUAD(ctx, int_list, OID_AUTO,
"rx_desc_min_thresh",
4485 "Interrupt Cause Rx Desc Min Thresh Count");
4487 SYSCTL_ADD_UQUAD(ctx, int_list, OID_AUTO,
"rx_overrun",
4489 "Interrupt Cause Receiver Overrun Count");
4533 const char *space =
"";
4536 sbuf_printf(buf,
"EEPROM V%d.%d-%d", fw_ver->
eep_major,
4542 sbuf_printf(buf,
"%sNVM V%d.%d imgtype%d",
4549 sbuf_printf(buf,
"%sOption ROM V%d-b%d-p%d",
4556 sbuf_printf(buf,
"%seTrack 0x%08x", space, fw_ver->
etrack_id);
4562 device_t dev = sc->
dev;
4566 buf = sbuf_new_auto();
4568 device_printf(dev,
"Could not allocate sbuf for output.\n");
4574 error = sbuf_finish(buf);
4576 device_printf(dev,
"Error finishing sbuf: %d\n", error);
4577 else if (sbuf_len(buf))
4578 device_printf(dev,
"%s\n", sbuf_data(buf));
4591 buf = sbuf_new_for_sysctl(NULL, NULL, 128, req);
4593 device_printf(dev,
"Could not allocate sbuf for output.\n");
4599 error = sbuf_finish(buf);
4601 device_printf(dev,
"Error finishing sbuf: %d\n", error);
4623 error = sysctl_handle_int(oidp, &result, 0, req);
4625 if (error || !req->newptr)
4643 struct sx *iflib_ctx_lock = iflib_ctx_lock_get(sc->
ctx);
4648 printf(
"\nInterface EEPROM Dump:\n");
4649 printf(
"Offset\n0x0000 ");
4652 sx_xlock(iflib_ctx_lock);
4654 for (i = 0, j = 0; i < 32; i++, j++) {
4657 printf(
"\n0x00%x0 ",row);
4660 printf(
"%04x ", eeprom_data);
4662 sx_xunlock(iflib_ctx_lock);
4672 int error, usecs, ticks;
4675 usecs = info->
value;
4676 error = sysctl_handle_int(oidp, &usecs, 0, req);
4677 if (error != 0 || req->newptr == NULL)
4681 info->
value = usecs;
4689 regval = (regval & ~0xffff) | (ticks & 0xffff);
4715 SYSCTL_ADD_PROC(device_get_sysctl_ctx(
sc->
dev),
4716 SYSCTL_CHILDREN(device_get_sysctl_tree(
sc->
dev)),
4717 OID_AUTO, name, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
4733 static int input = 3;
4736 error = sysctl_handle_int(oidp, &input, 0, req);
4738 if ((error) || (req->newptr == NULL))
4741 if (input == sc->
fc)
4774 error = sysctl_handle_int(oidp, &value, 0, req);
4775 if (error || req->newptr == NULL)
4791 error = sysctl_handle_int(oidp, &result, 0, req);
4793 if (error || !req->newptr)
4812 error = sysctl_handle_int(oidp, &result, 0, req);
4814 if (error || !req->newptr || result != 1)
4834 device_t
dev = iflib_get_dev(sc->
ctx);
4835 struct ifnet *ifp = iflib_get_ifp(sc->
ctx);
4839 if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
4840 printf(
"Interface is RUNNING ");
4842 printf(
"Interface is NOT RUNNING\n");
4844 if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE)
4845 printf(
"and INACTIVE\n");
4847 printf(
"and ACTIVE\n");
4849 for (
int i = 0; i <
sc->tx_num_queues; i++, txr++) {
4850 device_printf(dev,
"TX Queue %d ------\n", i);
4851 device_printf(dev,
"hw tdh = %d, hw tdt = %d\n",
4856 for (
int j=0; j <
sc->rx_num_queues; j++, rxr++) {
4857 device_printf(dev,
"RX Queue %d ------\n", j);
4858 device_printf(dev,
"hw rdh = %d, hw rdt = %d\n",
4874 device_t dev = iflib_get_dev(ctx);
4879 device_printf(dev,
"EM_NVM_PCIE_CTRL = %#06x\n", edata);
4881 device_printf(dev,
"Writing to eeprom: increasing "
4882 "reported MSI-X vectors from 3 to 5...\n");
4887 device_printf(dev,
"Writing to eeprom: done\n");
void e1000_init_script_state_82541(struct e1000_hw *hw, bool state)
void e1000_set_tbi_compatibility_82543(struct e1000_hw *hw, bool state)
bool e1000_get_laa_state_82571(struct e1000_hw *hw)
void e1000_set_laa_state_82571(struct e1000_hw *hw, bool state)
#define E1000_EITR_82574(_n)
u16 e1000_rxpbs_adjust_82580(u32 data)
s32 e1000_set_eee_i350(struct e1000_hw *hw, bool adv1G, bool adv100M)
s32 e1000_set_eee_i354(struct e1000_hw *hw, bool adv1G, bool adv100M)
void e1000_vfta_set_vf(struct e1000_hw *, u16, bool)
#define E1000_SRRCTL_DROP_EN
void e1000_rlpml_set_vf(struct e1000_hw *, u16)
#define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF
#define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX
#define E1000_MRQC_ENABLE_RSS_MQ
#define E1000_RXPBS_SIZE_MASK_82576
#define E1000_RXDCTL_QUEUE_ENABLE
#define E1000_SRRCTL_BSIZEPKT_SHIFT
#define E1000_MRQC_RSS_FIELD_IPV6_UDP
#define E1000_MRQC_RSS_FIELD_IPV4_UDP
s32 e1000_set_mac_type(struct e1000_hw *hw)
s32 e1000_force_mac_fc(struct e1000_hw *hw)
s32 e1000_led_on(struct e1000_hw *hw)
s32 e1000_check_for_link(struct e1000_hw *hw)
s32 e1000_phy_hw_reset(struct e1000_hw *hw)
s32 e1000_get_bus_info(struct e1000_hw *hw)
s32 e1000_reset_hw(struct e1000_hw *hw)
s32 e1000_get_speed_and_duplex(struct e1000_hw *hw, u16 *speed, u16 *duplex)
s32 e1000_check_reset_block(struct e1000_hw *hw)
int e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
s32 e1000_init_hw(struct e1000_hw *hw)
void e1000_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
s32 e1000_cleanup_led(struct e1000_hw *hw)
s32 e1000_write_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
s32 e1000_get_phy_info(struct e1000_hw *hw)
s32 e1000_update_nvm_checksum(struct e1000_hw *hw)
s32 e1000_validate_nvm_checksum(struct e1000_hw *hw)
s32 e1000_led_off(struct e1000_hw *hw)
s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device)
s32 e1000_read_mac_addr(struct e1000_hw *hw)
s32 e1000_setup_led(struct e1000_hw *hw)
s32 e1000_cfg_on_link_up(struct e1000_hw *hw)
s32 e1000_write_phy_reg(struct e1000_hw *hw, u32 offset, u16 data)
void e1000_update_mc_addr_list(struct e1000_hw *hw, u8 *mc_addr_list, u32 mc_addr_count)
s32 e1000_read_phy_reg(struct e1000_hw *hw, u32 offset, u16 *data)
void e1000_rx_fifo_flush_base(struct e1000_hw *hw)
#define E1000_FCRTC_RTH_COAL_MASK
#define NVM_INIT_CONTROL3_PORT_B
#define E1000_COLLISION_THRESHOLD
#define E1000_TXD_CMD_IDE
#define DEFAULT_82542_TIPG_IPGR2
#define E1000_RCTL_SZ_16384
#define E1000_CTRL_EXT_LINK_MODE_GMII
#define ETHERNET_FCS_SIZE
#define E1000_RCTL_RDMTS_HEX
#define E1000_RCTL_RDMTS_HALF
#define E1000_RCTL_MO_SHIFT
#define NVM_INIT_CONTROL2_REG
#define E1000_DMACR_DMACTHR_SHIFT
#define E1000_RCTL_SZ_2048
#define E1000_GPIE_MSIX_MODE
#define E1000_MRQC_RSS_FIELD_IPV4
#define E1000_MRQC_RSS_FIELD_IPV4_TCP
#define DEFAULT_82543_TIPG_IPGT_FIBER
#define E1000_MANC_EN_MNG2HOST
#define E1000_STATUS_2P5_SKU_OVER
#define E1000_TXD_STAT_DD
#define E1000_RXCSUM_PCSD
#define E1000_CTRL_SWDPIN2
#define E1000_PCIEMISC_LX_DECISION
#define E1000_SWSM_DRV_LOAD
#define E1000_MRQC_RSS_FIELD_IPV6_TCP_EX
#define E1000_CTRL_EXT_EIAME
#define E1000_RCTL_SZ_8192
#define DEFAULT_82543_TIPG_IPGR1
#define E1000_CTRL_EXT_PBA_CLR
#define E1000_RXCSUM_IPOFL
#define E1000_TIPG_IPGR1_SHIFT
#define ADVERTISE_10_FULL
#define E1000_RFCTL_ACK_DIS
#define E1000_RXCSUM_IPV6OFL
#define E1000_CTRL_EXT_LINK_MODE_MASK
#define E1000_WUC_PHY_WAKE
#define E1000_STATUS_2P5_SKU
#define E1000_RXCSUM_TUOFL
#define E1000_DMACR_DMACTHR_MASK
#define E1000_THSTAT_LINK_THROTTLE
#define SR_1000T_MS_CONFIG_FAULT
#define E1000_FCRTC_RTH_COAL_SHIFT
#define E1000_STATUS_FUNC_1
#define E1000_RCTL_LBM_NO
#define E1000_RFCTL_EXTEN
#define E1000_CTRL_EXT_IRCA
#define E1000_EICR_TX_QUEUE0
#define NVM_IMAGE_ID_MASK
#define ADVERTISE_10_HALF
#define MAX_JUMBO_FRAME_SIZE
#define MII_CR_RESTART_AUTO_NEG
#define E1000_CTRL_EXT_SDP3_DATA
#define E1000_DMACR_DMAC_LX_MASK
#define ADVERTISE_100_FULL
#define DEFAULT_82542_TIPG_IPGR1
#define MII_CR_AUTO_NEG_EN
#define E1000_TXDCTL_GRAN
#define E1000_RAR_ENTRIES
#define E1000_DMACR_DMAC_EN
#define DEFAULT_82543_TIPG_IPGR2
#define DEFAULT_82543_TIPG_IPGT_COPPER
#define ADVERTISE_100_HALF
#define CR_1000T_MS_ENABLE
#define E1000_ICR_INT_ASSERTED
#define E1000_EITR_CNT_IGNR
#define ADVERTISE_1000_FULL
#define E1000_MRQC_RSS_FIELD_IPV6_EX
#define E1000_MRQC_RSS_FIELD_IPV6
#define E1000_MANC_ARP_EN
#define E1000_RXCSUM_CRCOFL
#define NVM_INIT_CONTROL3_PORT_A
#define E1000_CTRL_EXT_DRV_LOAD
#define DEFAULT_82542_TIPG_IPGT
#define E1000_RCTL_SZ_4096
#define E1000_EICR_RX_QUEUE0
#define E1000_CTRL_SWDPIN3
#define E1000_TIPG_IPGR2_SHIFT
#define DEFAULT_80003ES2LAN_TIPG_IPGR2
#define E1000_MRQC_RSS_ENABLE_2Q
#define E1000_MRQC_RSS_FIELD_IPV6_TCP
#define E1000_DEV_ID_82571EB_SERDES_DUAL
#define E1000_DEV_ID_82572EI
#define E1000_DEV_ID_PCH_LBG_I219_LM3
#define E1000_DEV_ID_PCH_LPT_I217_V
#define E1000_DEV_ID_I210_SERDES
#define E1000_DEV_ID_PCH_LPTLP_I218_LM
#define E1000_DEV_ID_I350_SGMII
#define E1000_DEV_ID_PCH_CMP_I219_V12
#define E1000_DEV_ID_PCH_TGP_I219_LM15
#define E1000_DEV_ID_82574LA
void e1000_pci_set_mwi(struct e1000_hw *hw)
#define E1000_DEV_ID_PCH_TGP_I219_V14
#define E1000_DEV_ID_82545GM_SERDES
#define E1000_DEV_ID_I211_COPPER
#define E1000_DEV_ID_I354_BACKPLANE_2_5GBPS
#define E1000_DEV_ID_PCH_SPT_I219_V4
#define E1000_DEV_ID_82540EM_LOM
#define E1000_DEV_ID_82547GI
#define E1000_DEV_ID_PCH_SPT_I219_LM2
#define E1000_DEV_ID_PCH_M_HV_LM
#define E1000_DEV_ID_ICH8_IFE_G
#define E1000_DEV_ID_PCH_CMP_I219_LM12
#define E1000_DEV_ID_82542
#define E1000_DEV_ID_ICH9_IGP_M_V
#define E1000_DEV_ID_ICH10_D_BM_V
#define E1000_DEV_ID_PCH_ADL_I219_V16
#define E1000_DEV_ID_82576_VF
#define E1000_DEV_ID_I210_COPPER_OEM1
#define E1000_DEV_ID_PCH_SPT_I219_LM
#define E1000_DEV_ID_82571PT_QUAD_COPPER
#define E1000_DEV_ID_ICH8_IGP_M_AMT
#define E1000_DEV_ID_82544GC_LOM
#define E1000_DEV_ID_82576_QUAD_COPPER_ET2
#define E1000_DEV_ID_PCH_SPT_I219_V
#define E1000_DEV_ID_80003ES2LAN_COPPER_DPT
#define E1000_DEV_ID_ICH9_IGP_AMT
#define E1000_DEV_ID_PCH_ICP_I219_LM9
#define E1000_DEV_ID_ICH8_82567V_3
#define E1000_DEV_ID_82540EP
#define E1000_DEV_ID_82541ER_LOM
#define E1000_DEV_ID_ICH9_IFE_G
#define E1000_DEV_ID_PCH_SPT_I219_V2
#define E1000_DEV_ID_PCH_ADL_I219_LM17
#define E1000_DEV_ID_82575EB_FIBER_SERDES
#define E1000_DEV_ID_ICH9_IGP_M
#define E1000_DEV_ID_82546GB_COPPER
#define E1000_DEV_ID_82576_QUAD_COPPER
#define E1000_DEV_ID_I350_SERDES
#define E1000_DEV_ID_ICH10_R_BM_LF
#define E1000_DEV_ID_82541GI_LF
#define E1000_DEV_ID_PCH_I218_LM2
#define E1000_DEV_ID_PCH_TGP_I219_LM13
#define E1000_DEV_ID_82576
#define E1000_DEV_ID_82572EI_FIBER
#define E1000_DEV_ID_PCH_CNP_I219_LM7
#define E1000_DEV_ID_82571EB_QUAD_COPPER
#define E1000_DEV_ID_82575EB_COPPER
#define E1000_DEV_ID_PCH_D_HV_DM
#define E1000_DEV_ID_82545GM_COPPER
#define E1000_DEV_ID_ICH8_IGP_C
#define E1000_DEV_ID_PCH_MTP_I219_V18
#define E1000_DEV_ID_82547EI
#define E1000_DEV_ID_ICH9_BM
#define E1000_DEV_ID_PCH_CMP_I219_LM11
#define E1000_DEV_ID_PCH_MTP_I219_V19
#define E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3
#define E1000_DEV_ID_I354_BACKPLANE_1GBPS
#define E1000_DEV_ID_80003ES2LAN_SERDES_DPT
#define E1000_DEV_ID_82545EM_COPPER
#define E1000_DEV_ID_I350_VF
#define E1000_DEV_ID_82541GI
#define E1000_DEV_ID_82573E_IAMT
#define E1000_DEV_ID_82571EB_COPPER
#define E1000_DEV_ID_82576_FIBER
#define E1000_DEV_ID_ICH8_IGP_AMT
#define E1000_DEV_ID_82571EB_QUAD_FIBER
#define E1000_DEV_ID_82540EM
#define E1000_DEV_ID_PCH_SPT_I219_V5
#define E1000_DEV_ID_82580_COPPER_DUAL
#define E1000_DEV_ID_82576_SERDES
#define E1000_DEV_ID_82580_FIBER
#define E1000_DEV_ID_PCH_CMP_I219_V11
#define E1000_DEV_ID_PCH_ADL_I219_V17
#define E1000_DEV_ID_PCH_ICP_I219_V9
#define E1000_DEV_ID_I210_COPPER
#define E1000_DEV_ID_PCH_TGP_I219_V15
#define E1000_DEV_ID_PCH_I218_V2
#define E1000_DEV_ID_82574L
#define E1000_DEV_ID_82545EM_FIBER
#define E1000_DEV_ID_ICH10_R_BM_V
#define E1000_DEV_ID_82580_COPPER
#define E1000_DEV_ID_PCH2_LV_LM
#define E1000_DEV_ID_I210_SERDES_FLASHLESS
#define E1000_DEV_ID_82573E
#define E1000_DEV_ID_80003ES2LAN_SERDES_SPT
#define E1000_DEV_ID_PCH_CNP_I219_LM6
#define E1000_DEV_ID_82573L
#define E1000_DEV_ID_82546GB_FIBER
#define E1000_DEV_ID_DH89XXCC_SGMII
#define E1000_DEV_ID_82544EI_FIBER
#define E1000_DEV_ID_ICH8_IFE
#define E1000_DEV_ID_ICH10_D_BM_LM
#define E1000_DEV_ID_PCH_MTP_I219_LM18
#define E1000_DEV_ID_82546GB_SERDES
#define E1000_DEV_ID_82546EB_COPPER
#define E1000_DEV_ID_82576_NS_SERDES
#define E1000_DEV_ID_PCH_I218_LM3
#define E1000_DEV_ID_82540EP_LOM
#define E1000_DEV_ID_PCH_CMP_I219_V10
#define E1000_DEV_ID_82543GC_FIBER
#define E1000_DEV_ID_PCH_D_HV_DC
#define E1000_DEV_ID_ICH9_IFE_GT
#define E1000_DEV_ID_ICH9_IGP_M_AMT
#define E1000_DEV_ID_82571EB_SERDES_QUAD
#define E1000_DEV_ID_82544EI_COPPER
#define E1000_DEV_ID_82544GC_COPPER
#define E1000_DEV_ID_80003ES2LAN_COPPER_SPT
#define E1000_DEV_ID_PCH_ICP_I219_V8
#define E1000_DEV_ID_82576_SERDES_QUAD
@ e1000_media_type_unknown
@ e1000_media_type_internal_serdes
@ e1000_media_type_copper
#define E1000_DEV_ID_PCH_LPTLP_I218_V
#define E1000_DEV_ID_PCH_CNP_I219_V7
#define E1000_DEV_ID_PCH_CNP_I219_V6
#define E1000_DEV_ID_PCH_SPT_I219_LM5
#define E1000_DEV_ID_PCH_ICP_I219_LM8
#define E1000_DEV_ID_82541GI_MOBILE
#define E1000_DEV_ID_I210_FIBER
#define E1000_DEV_ID_82571EB_SERDES
#define E1000_DEV_ID_I354_SGMII
#define E1000_DEV_ID_82580_SGMII
#define E1000_DEV_ID_PCH_LPT_I217_LM
#define E1000_DEV_ID_PCH2_LV_V
#define E1000_DEV_ID_PCH_TGP_I219_V13
#define E1000_DEV_ID_82580_QUAD_FIBER
#define E1000_DEV_ID_I350_COPPER
#define E1000_DEV_ID_DH89XXCC_SERDES
#define E1000_DEV_ID_ICH9_IFE
#define E1000_DEV_ID_ICH10_R_BM_LM
#define E1000_DEV_ID_PCH_MTP_I219_LM19
#define E1000_DEV_ID_I350_FIBER
#define E1000_DEV_ID_82546GB_PCIE
#define E1000_DEV_ID_ICH9_IGP_C
#define E1000_DEV_ID_DH89XXCC_SFP
#define E1000_DEV_ID_DH89XXCC_BACKPLANE
#define E1000_DEV_ID_82541EI
void e1000_pci_clear_mwi(struct e1000_hw *hw)
#define E1000_DEV_ID_PCH_CMP_I219_LM10
#define E1000_DEV_ID_82546EB_FIBER
#define E1000_DEV_ID_ICH10_D_BM_LF
#define E1000_DEV_ID_82580_SERDES
#define E1000_DEV_ID_PCH_ADL_I219_LM16
#define E1000_DEV_ID_82546GB_QUAD_COPPER
#define E1000_DEV_ID_PCH_TGP_I219_LM14
#define E1000_DEV_ID_82575GB_QUAD_COPPER
#define E1000_DEV_ID_I210_COPPER_FLASHLESS
#define E1000_DEV_ID_I210_SGMII
#define E1000_DEV_ID_82571EB_FIBER
#define E1000_DEV_ID_82540EP_LP
#define E1000_DEV_ID_82541EI_MOBILE
#define E1000_DEV_ID_82571EB_QUAD_COPPER_LP
#define E1000_DEV_ID_ICH8_IGP_M
#define E1000_DEV_ID_I210_SGMII_FLASHLESS
#define E1000_DEV_ID_PCH_SPT_I219_LM4
#define E1000_DEV_ID_82547EI_MOBILE
#define E1000_DEV_ID_82546EB_QUAD_COPPER
#define E1000_DEV_ID_82545GM_FIBER
#define E1000_DEV_ID_82576_NS
#define E1000_DEV_ID_ICH8_IFE_GT
#define E1000_DEV_ID_82543GC_COPPER
#define E1000_DEV_ID_82572EI_SERDES
#define E1000_DEV_ID_I210_COPPER_IT
#define E1000_DEV_ID_PCH_I218_V3
#define E1000_DEV_ID_82572EI_COPPER
#define E1000_DEV_ID_PCH_M_HV_LC
#define E1000_DEV_ID_82583V
#define E1000_DEV_ID_82541ER
u32 e1000_resume_workarounds_pchlan(struct e1000_hw *hw)
void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw)
void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw)
s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)
s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)
void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw)
#define E1000_TARC0_CB_MULTIQ_2_REQ
#define E1000_FLASH_BASE_ADDR
void e1000_clear_hw_cntrs_base_generic(struct e1000_hw *hw)
bool e1000_enable_mng_pass_thru(struct e1000_hw *hw)
void e1000_get_fw_version(struct e1000_hw *hw, struct e1000_fw_version *fw_vers)
#define CMD_MEM_WRT_INVALIDATE
#define E1000_WRITE_REG_ARRAY(hw, reg, index, value)
#define E1000_READ_REG_ARRAY(hw, reg, index)
#define E1000_REGISTER(hw, reg)
#define E1000_READ_OFFSET(hw, offset)
#define E1000_WRITE_OFFSET(hw, offset, value)
#define E1000_WRITE_FLUSH(a)
#define E1000_WRITE_REG(hw, reg, value)
#define E1000_READ_REG(hw, reg)
#define ASSERT_CTX_LOCK_HELD(hw)
s32 e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
s32 e1000_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
#define IGP01E1000_PHY_PAGE_SELECT
#define BM_WUC_ENABLE_PAGE
#define BM_WUC_ENABLE_BIT
#define IGP02E1000_PHY_POWER_MGMT
#define BM_WUC_HOST_WU_BIT
#define BM_WUC_ENABLE_REG
void em_dump_rs(struct e1000_softc *sc)
static int em_sysctl_reg_handler(SYSCTL_HANDLER_ARGS)
static int em_sysctl_eee(SYSCTL_HANDLER_ARGS)
static u_int em_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_int idx)
static void em_release_hw_control(struct e1000_softc *)
static void em_if_init(if_ctx_t)
static bool em_if_vlan_filter_capable(if_ctx_t)
#define E1000_MNG2HOST_PORT_623
static device_method_t em_methods[]
static void em_if_intr_enable(if_ctx_t)
static int em_allocate_pci_resources(if_ctx_t)
static void em_if_stop(if_ctx_t)
static int em_get_regs(SYSCTL_HANDLER_ARGS)
static driver_t em_if_driver
static void em_fw_version_locked(if_ctx_t)
static void em_if_vlan_filter_write(struct e1000_softc *)
static int em_msix_link(void *)
static void em_setup_vlan_hw_support(if_ctx_t ctx)
static int em_tx_abs_int_delay_dflt
static int em_sysctl_int_delay(SYSCTL_HANDLER_ARGS)
static int em_rx_process_limit
static void em_release_manageability(struct e1000_softc *)
static int em_if_tx_queues_alloc(if_ctx_t, caddr_t *, uint64_t *, int, int)
static void em_initialize_rss_mapping(struct e1000_softc *sc)
static int em_get_rs(SYSCTL_HANDLER_ARGS)
static int em_tx_int_delay_dflt
static void em_if_vlan_filter_disable(struct e1000_softc *)
static int em_if_rx_queue_intr_enable(if_ctx_t, uint16_t)
static int em_if_set_promisc(if_ctx_t, int)
static void igb_if_intr_enable(if_ctx_t)
static void em_if_update_admin_status(if_ctx_t)
static void * igb_register(device_t)
static void em_print_fw_version(struct e1000_softc *)
static int em_max_interrupt_rate
static int em_if_suspend(if_ctx_t)
IFLIB_PNP_INFO(pci, em, em_vendor_info_array)
static void em_initialize_receive_unit(if_ctx_t)
static int em_if_tx_queue_intr_enable(if_ctx_t, uint16_t)
static int em_set_num_queues(if_ctx_t ctx)
static int em_set_flowcntl(SYSCTL_HANDLER_ARGS)
static int igb_if_rx_queue_intr_enable(if_ctx_t, uint16_t)
static int em_if_rx_queues_alloc(if_ctx_t, caddr_t *, uint64_t *, int, int)
static device_method_t igb_if_methods[]
static int em_msix_que(void *arg)
static int em_if_attach_pre(if_ctx_t)
#define E1000_MNG2HOST_PORT_664
static void igb_initialize_rss_mapping(struct e1000_softc *sc)
static void em_identify_hardware(if_ctx_t)
static void em_add_hw_stats(struct e1000_softc *)
SYSCTL_INT(_hw_em, OID_AUTO, disable_crc_stripping, CTLFLAG_RDTUN, &em_disable_crc_stripping, 0, "Disable CRC Stripping")
static void em_if_vlan_filter_enable(struct e1000_softc *)
#define EM_TICKS_TO_USECS(ticks)
static void em_update_stats_counters(struct e1000_softc *)
static pci_vendor_info_t em_vendor_info_array[]
static void em_free_pci_resources(if_ctx_t)
static void em_if_media_status(if_ctx_t, struct ifmediareq *)
static void em_reset(if_ctx_t)
static driver_t igb_if_driver
static void em_get_wakeup(if_ctx_t)
static void em_sbuf_fw_version(struct e1000_fw_version *, struct sbuf *)
static int em_rx_int_delay_dflt
static struct if_shared_ctx igb_sctx_init
static uint64_t em_if_get_counter(if_ctx_t, ift_counter)
static void em_print_debug_info(struct e1000_softc *)
static void em_print_nvm_info(struct e1000_softc *)
static int em_if_detach(if_ctx_t)
static void igb_if_intr_disable(if_ctx_t)
static driver_t igb_driver
static struct if_shared_ctx em_sctx_init
static device_method_t igb_methods[]
static int em_setup_interface(if_ctx_t)
static void em_if_timer(if_ctx_t, uint16_t)
static void em_initialize_transmit_unit(if_ctx_t)
static int em_rx_abs_int_delay_dflt
static int em_if_media_change(if_ctx_t)
static int em_disable_crc_stripping
static void em_if_vlan_register(if_ctx_t, u16)
static devclass_t igb_devclass
static void em_enable_wakeup(if_ctx_t)
static void igb_init_dmac(struct e1000_softc *sc, u32 pba)
static driver_t em_driver
static void em_if_multi_set(if_ctx_t)
static int em_sysctl_nvm_info(SYSCTL_HANDLER_ARGS)
static int igb_if_tx_queue_intr_enable(if_ctx_t, uint16_t)
static bool em_if_needs_restart(if_ctx_t, enum iflib_restart_event)
static int global_quad_port_a
static void em_if_intr_disable(if_ctx_t)
static int em_if_msix_intr_assign(if_ctx_t, int)
static device_method_t em_if_methods[]
static void em_disable_aspm(struct e1000_softc *)
static void em_enable_vectors_82574(if_ctx_t)
static int em_if_attach_post(if_ctx_t)
static void * em_register(device_t)
static int em_if_resume(if_ctx_t)
static int em_sysctl_debug_info(SYSCTL_HANDLER_ARGS)
#define EM_USECS_TO_TICKS(usecs)
static int em_sysctl_print_fw_version(SYSCTL_HANDLER_ARGS)
static bool em_if_vlan_filter_used(if_ctx_t)
MODULE_DEPEND(em, pci, 1, 1, 1)
static void igb_configure_queues(struct e1000_softc *)
static void em_get_hw_control(struct e1000_softc *)
static void em_if_vlan_unregister(if_ctx_t, u16)
static void em_init_manageability(struct e1000_softc *)
DRIVER_MODULE(em, pci, em_driver, em_devclass, 0, 0)
static int em_smart_pwr_down
static void lem_smartspeed(struct e1000_softc *)
static void em_if_led_func(if_ctx_t, int)
static int em_is_valid_ether_addr(u8 *)
static int em_if_shutdown(if_ctx_t)
static pci_vendor_info_t igb_vendor_info_array[]
static devclass_t em_devclass
static int em_enable_phy_wakeup(struct e1000_softc *)
static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD|CTLFLAG_MPSAFE, 0, "EM driver parameters")
static void em_if_watchdog_reset(if_ctx_t)
static void em_handle_link(void *)
static void em_add_int_delay_sysctl(struct e1000_softc *, const char *, const char *, struct em_int_delay_info *, int, int)
static void em_if_debug(if_ctx_t)
static int em_if_mtu_set(if_ctx_t, uint32_t)
static int em_setup_msix(if_ctx_t)
static void em_if_queues_free(if_ctx_t)
#define AUTONEG_ADV_DEFAULT
#define IOCTL_DEBUGOUT(S)
#define MAX_NUM_MULTICAST_ADDRESSES
#define TARC_SPEED_MODE_BIT
#define EM_SMARTSPEED_MAX
#define EM_BAR_MEM_TYPE(v)
#define INIT_DEBUGOUT1(S, A)
#define TARC_COMPENSATION_MODE
#define IGB_DMCTLX_DCFLUSH_DIS
#define HW_DEBUGOUT2(S, A, B)
#define EM_RSSRK_VAL(key, i)
#define EM_BAR_TYPE_FLASH
#define EM_BAR_MEM_TYPE_64BIT
#define EM_NVM_MSIX_N_SHIFT
#define EM_SMARTSPEED_DOWNSHIFT
#define EM_NVM_MSIX_N_MASK
enum e1000_fc_mode current_mode
enum e1000_fc_mode requested_mode
union e1000_hw::@46 dev_spec
struct e1000_bus_info bus
struct e1000_mac_info mac
struct e1000_dev_spec_82575 _82575
struct e1000_dev_spec_ich8lan ich8lan
struct e1000_phy_info phy
bus_space_tag_t flash_bus_space_tag
bus_space_tag_t io_bus_space_tag
bus_space_handle_t mem_bus_space_handle
bus_space_handle_t flash_bus_space_handle
bus_space_handle_t io_bus_space_handle
bus_space_tag_t mem_bus_space_tag
bool autoneg_wait_to_complete
enum e1000_media_type media_type
bool disable_polarity_correction
struct e1000_phy_operations ops
enum e1000_ms_type ms_type
void(* release)(struct e1000_hw *)
s32(* acquire)(struct e1000_hw *)
struct em_rx_queue * rx_queues
unsigned long watchdog_events
unsigned long rx_overruns
struct em_int_delay_info rx_int_delay
struct e1000_hw_stats stats
struct em_int_delay_info tx_itr
struct e1000_fw_version fw_ver
struct em_int_delay_info tx_int_delay
u32 shadow_vfta[EM_VFTA_SIZE]
struct em_int_delay_info tx_abs_int_delay
struct em_int_delay_info rx_abs_int_delay
unsigned long dropped_pkts
struct em_tx_queue * tx_queues
union e1000_tx_desc::@33 upper
struct e1000_tx_desc::@33::@35 fields
union e1000_rx_desc_extended * rx_base
struct e1000_tx_desc * tx_base
struct e1000_rx_desc_extended::@19 read
struct e1000_rx_desc_extended::@20 wb
struct e1000_rx_desc_extended::@20::@22 upper