Commit dc926051 authored by Kevin Bowling's avatar Kevin Bowling
Browse files

e1000: Rename 'struct adapter' to 'struct e1000_sc'

Rename the 'struct adapter' to 'struct e1000_sc' to avoid type ambiguity
in things like kgdb.

Reviewed by:	jhb, markj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D32129
parent f73c2bbf
...@@ -42,9 +42,9 @@ ...@@ -42,9 +42,9 @@
/********************************************************************* /*********************************************************************
* Local Function prototypes * Local Function prototypes
*********************************************************************/ *********************************************************************/
static int em_tso_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_upper, static int em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, u32 *txd_upper,
u32 *txd_lower); u32 *txd_lower);
static int em_transmit_checksum_setup(struct adapter *adapter, if_pkt_info_t pi, static int em_transmit_checksum_setup(struct e1000_softc *sc, if_pkt_info_t pi,
u32 *txd_upper, u32 *txd_lower); u32 *txd_upper, u32 *txd_lower);
static int em_isc_txd_encap(void *arg, if_pkt_info_t pi); static int em_isc_txd_encap(void *arg, if_pkt_info_t pi);
static void em_isc_txd_flush(void *arg, uint16_t txqid, qidx_t pidx); static void em_isc_txd_flush(void *arg, uint16_t txqid, qidx_t pidx);
...@@ -91,9 +91,9 @@ struct if_txrx lem_txrx = { ...@@ -91,9 +91,9 @@ struct if_txrx lem_txrx = {
extern if_shared_ctx_t em_sctx; extern if_shared_ctx_t em_sctx;
void void
em_dump_rs(struct adapter *adapter) em_dump_rs(struct e1000_softc *sc)
{ {
if_softc_ctx_t scctx = adapter->shared; if_softc_ctx_t scctx = sc->shared;
struct em_tx_queue *que; struct em_tx_queue *que;
struct tx_ring *txr; struct tx_ring *txr;
qidx_t i, ntxd, qid, cur; qidx_t i, ntxd, qid, cur;
...@@ -102,8 +102,8 @@ em_dump_rs(struct adapter *adapter) ...@@ -102,8 +102,8 @@ em_dump_rs(struct adapter *adapter)
printf("\n"); printf("\n");
ntxd = scctx->isc_ntxd[0]; ntxd = scctx->isc_ntxd[0];
for (qid = 0; qid < adapter->tx_num_queues; qid++) { for (qid = 0; qid < sc->tx_num_queues; qid++) {
que = &adapter->tx_queues[qid]; que = &sc->tx_queues[qid];
txr = &que->txr; txr = &que->txr;
rs_cidx = txr->tx_rs_cidx; rs_cidx = txr->tx_rs_cidx;
if (rs_cidx != txr->tx_rs_pidx) { if (rs_cidx != txr->tx_rs_pidx) {
...@@ -132,10 +132,10 @@ em_dump_rs(struct adapter *adapter) ...@@ -132,10 +132,10 @@ em_dump_rs(struct adapter *adapter)
* *
**********************************************************************/ **********************************************************************/
static int static int
em_tso_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_upper, u32 *txd_lower) em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, u32 *txd_upper, u32 *txd_lower)
{ {
if_softc_ctx_t scctx = adapter->shared; if_softc_ctx_t scctx = sc->shared;
struct em_tx_queue *que = &adapter->tx_queues[pi->ipi_qsidx]; struct em_tx_queue *que = &sc->tx_queues[pi->ipi_qsidx];
struct tx_ring *txr = &que->txr; struct tx_ring *txr = &que->txr;
struct e1000_context_desc *TXD; struct e1000_context_desc *TXD;
int cur, hdr_len; int cur, hdr_len;
...@@ -178,7 +178,7 @@ em_tso_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_upper, u32 *txd ...@@ -178,7 +178,7 @@ em_tso_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_upper, u32 *txd
TXD->tcp_seg_setup.fields.mss = htole16(pi->ipi_tso_segsz); TXD->tcp_seg_setup.fields.mss = htole16(pi->ipi_tso_segsz);
TXD->tcp_seg_setup.fields.hdr_len = hdr_len; TXD->tcp_seg_setup.fields.hdr_len = hdr_len;
TXD->cmd_and_length = htole32(adapter->txd_cmd | TXD->cmd_and_length = htole32(sc->txd_cmd |
E1000_TXD_CMD_DEXT | /* Extended descr */ E1000_TXD_CMD_DEXT | /* Extended descr */
E1000_TXD_CMD_TSE | /* TSE context */ E1000_TXD_CMD_TSE | /* TSE context */
E1000_TXD_CMD_IP | /* Do IP csum */ E1000_TXD_CMD_IP | /* Do IP csum */
...@@ -189,7 +189,7 @@ em_tso_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_upper, u32 *txd ...@@ -189,7 +189,7 @@ em_tso_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_upper, u32 *txd
if (++cur == scctx->isc_ntxd[0]) { if (++cur == scctx->isc_ntxd[0]) {
cur = 0; cur = 0;
} }
DPRINTF(iflib_get_dev(adapter->ctx), "%s: pidx: %d cur: %d\n", __FUNCTION__, pi->ipi_pidx, cur); DPRINTF(iflib_get_dev(sc->ctx), "%s: pidx: %d cur: %d\n", __FUNCTION__, pi->ipi_pidx, cur);
return (cur); return (cur);
} }
...@@ -215,11 +215,11 @@ em_tso_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_upper, u32 *txd ...@@ -215,11 +215,11 @@ em_tso_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_upper, u32 *txd
**********************************************************************/ **********************************************************************/
static int static int
em_transmit_checksum_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_upper, u32 *txd_lower) em_transmit_checksum_setup(struct e1000_softc *sc, if_pkt_info_t pi, u32 *txd_upper, u32 *txd_lower)
{ {
struct e1000_context_desc *TXD = NULL; struct e1000_context_desc *TXD = NULL;
if_softc_ctx_t scctx = adapter->shared; if_softc_ctx_t scctx = sc->shared;
struct em_tx_queue *que = &adapter->tx_queues[pi->ipi_qsidx]; struct em_tx_queue *que = &sc->tx_queues[pi->ipi_qsidx];
struct tx_ring *txr = &que->txr; struct tx_ring *txr = &que->txr;
int csum_flags = pi->ipi_csum_flags; int csum_flags = pi->ipi_csum_flags;
int cur, hdr_len; int cur, hdr_len;
...@@ -227,7 +227,7 @@ em_transmit_checksum_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_u ...@@ -227,7 +227,7 @@ em_transmit_checksum_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_u
cur = pi->ipi_pidx; cur = pi->ipi_pidx;
hdr_len = pi->ipi_ehdrlen + pi->ipi_ip_hlen; hdr_len = pi->ipi_ehdrlen + pi->ipi_ip_hlen;
cmd = adapter->txd_cmd; cmd = sc->txd_cmd;
/* /*
* The 82574L can only remember the *last* context used * The 82574L can only remember the *last* context used
...@@ -237,7 +237,7 @@ em_transmit_checksum_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_u ...@@ -237,7 +237,7 @@ em_transmit_checksum_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_u
* second note. * second note.
*/ */
if (DONT_FORCE_CTX && if (DONT_FORCE_CTX &&
adapter->tx_num_queues == 1 && sc->tx_num_queues == 1 &&
txr->csum_lhlen == pi->ipi_ehdrlen && txr->csum_lhlen == pi->ipi_ehdrlen &&
txr->csum_iphlen == pi->ipi_ip_hlen && txr->csum_iphlen == pi->ipi_ip_hlen &&
txr->csum_flags == csum_flags) { txr->csum_flags == csum_flags) {
...@@ -293,7 +293,7 @@ em_transmit_checksum_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_u ...@@ -293,7 +293,7 @@ em_transmit_checksum_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_u
if (++cur == scctx->isc_ntxd[0]) { if (++cur == scctx->isc_ntxd[0]) {
cur = 0; cur = 0;
} }
DPRINTF(iflib_get_dev(adapter->ctx), "checksum_setup csum_flags=%x txd_upper=%x txd_lower=%x hdr_len=%d cmd=%x\n", DPRINTF(iflib_get_dev(sc->ctx), "checksum_setup csum_flags=%x txd_upper=%x txd_lower=%x hdr_len=%d cmd=%x\n",
csum_flags, *txd_upper, *txd_lower, hdr_len, cmd); csum_flags, *txd_upper, *txd_lower, hdr_len, cmd);
return (cur); return (cur);
} }
...@@ -301,7 +301,7 @@ em_transmit_checksum_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_u ...@@ -301,7 +301,7 @@ em_transmit_checksum_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_u
static int static int
em_isc_txd_encap(void *arg, if_pkt_info_t pi) em_isc_txd_encap(void *arg, if_pkt_info_t pi)
{ {
struct adapter *sc = arg; struct e1000_softc *sc = arg;
if_softc_ctx_t scctx = sc->shared; if_softc_ctx_t scctx = sc->shared;
struct em_tx_queue *que = &sc->tx_queues[pi->ipi_qsidx]; struct em_tx_queue *que = &sc->tx_queues[pi->ipi_qsidx];
struct tx_ring *txr = &que->txr; struct tx_ring *txr = &que->txr;
...@@ -348,7 +348,7 @@ em_isc_txd_encap(void *arg, if_pkt_info_t pi) ...@@ -348,7 +348,7 @@ em_isc_txd_encap(void *arg, if_pkt_info_t pi)
} }
DPRINTF(iflib_get_dev(sc->ctx), "encap: set up tx: nsegs=%d first=%d i=%d\n", nsegs, first, i); DPRINTF(iflib_get_dev(sc->ctx), "encap: set up tx: nsegs=%d first=%d i=%d\n", nsegs, first, i);
/* XXX adapter->pcix_82544 -- lem_fill_descriptors */ /* XXX sc->pcix_82544 -- lem_fill_descriptors */
/* Set up our transmit descriptors */ /* Set up our transmit descriptors */
for (j = 0; j < nsegs; j++) { for (j = 0; j < nsegs; j++) {
...@@ -416,19 +416,19 @@ em_isc_txd_encap(void *arg, if_pkt_info_t pi) ...@@ -416,19 +416,19 @@ em_isc_txd_encap(void *arg, if_pkt_info_t pi)
static void static void
em_isc_txd_flush(void *arg, uint16_t txqid, qidx_t pidx) em_isc_txd_flush(void *arg, uint16_t txqid, qidx_t pidx)
{ {
struct adapter *adapter = arg; struct e1000_softc *sc = arg;
struct em_tx_queue *que = &adapter->tx_queues[txqid]; struct em_tx_queue *que = &sc->tx_queues[txqid];
struct tx_ring *txr = &que->txr; struct tx_ring *txr = &que->txr;
E1000_WRITE_REG(&adapter->hw, E1000_TDT(txr->me), pidx); E1000_WRITE_REG(&sc->hw, E1000_TDT(txr->me), pidx);
} }
static int static int
em_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear) em_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear)
{ {
struct adapter *adapter = arg; struct e1000_softc *sc = arg;
if_softc_ctx_t scctx = adapter->shared; if_softc_ctx_t scctx = sc->shared;
struct em_tx_queue *que = &adapter->tx_queues[txqid]; struct em_tx_queue *que = &sc->tx_queues[txqid];
struct tx_ring *txr = &que->txr; struct tx_ring *txr = &que->txr;
qidx_t processed = 0; qidx_t processed = 0;
...@@ -461,7 +461,7 @@ em_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear) ...@@ -461,7 +461,7 @@ em_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear)
if (delta < 0) if (delta < 0)
delta += ntxd; delta += ntxd;
MPASS(delta > 0); MPASS(delta > 0);
DPRINTF(iflib_get_dev(adapter->ctx), DPRINTF(iflib_get_dev(sc->ctx),
"%s: cidx_processed=%u cur=%u clear=%d delta=%d\n", "%s: cidx_processed=%u cur=%u clear=%d delta=%d\n",
__FUNCTION__, prev, cur, clear, delta); __FUNCTION__, prev, cur, clear, delta);
...@@ -483,7 +483,7 @@ em_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear) ...@@ -483,7 +483,7 @@ em_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear)
static void static void
lem_isc_rxd_refill(void *arg, if_rxd_update_t iru) lem_isc_rxd_refill(void *arg, if_rxd_update_t iru)
{ {
struct adapter *sc = arg; struct e1000_softc *sc = arg;
if_softc_ctx_t scctx = sc->shared; if_softc_ctx_t scctx = sc->shared;
struct em_rx_queue *que = &sc->rx_queues[iru->iru_qsidx]; struct em_rx_queue *que = &sc->rx_queues[iru->iru_qsidx];
struct rx_ring *rxr = &que->rxr; struct rx_ring *rxr = &que->rxr;
...@@ -511,7 +511,7 @@ lem_isc_rxd_refill(void *arg, if_rxd_update_t iru) ...@@ -511,7 +511,7 @@ lem_isc_rxd_refill(void *arg, if_rxd_update_t iru)
static void static void
em_isc_rxd_refill(void *arg, if_rxd_update_t iru) em_isc_rxd_refill(void *arg, if_rxd_update_t iru)
{ {
struct adapter *sc = arg; struct e1000_softc *sc = arg;
if_softc_ctx_t scctx = sc->shared; if_softc_ctx_t scctx = sc->shared;
uint16_t rxqid = iru->iru_qsidx; uint16_t rxqid = iru->iru_qsidx;
struct em_rx_queue *que = &sc->rx_queues[rxqid]; struct em_rx_queue *que = &sc->rx_queues[rxqid];
...@@ -540,7 +540,7 @@ em_isc_rxd_refill(void *arg, if_rxd_update_t iru) ...@@ -540,7 +540,7 @@ em_isc_rxd_refill(void *arg, if_rxd_update_t iru)
static void static void
em_isc_rxd_flush(void *arg, uint16_t rxqid, uint8_t flid __unused, qidx_t pidx) em_isc_rxd_flush(void *arg, uint16_t rxqid, uint8_t flid __unused, qidx_t pidx)
{ {
struct adapter *sc = arg; struct e1000_softc *sc = arg;
struct em_rx_queue *que = &sc->rx_queues[rxqid]; struct em_rx_queue *que = &sc->rx_queues[rxqid];
struct rx_ring *rxr = &que->rxr; struct rx_ring *rxr = &que->rxr;
...@@ -550,7 +550,7 @@ em_isc_rxd_flush(void *arg, uint16_t rxqid, uint8_t flid __unused, qidx_t pidx) ...@@ -550,7 +550,7 @@ em_isc_rxd_flush(void *arg, uint16_t rxqid, uint8_t flid __unused, qidx_t pidx)
static int static int
lem_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, qidx_t budget) lem_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, qidx_t budget)
{ {
struct adapter *sc = arg; struct e1000_softc *sc = arg;
if_softc_ctx_t scctx = sc->shared; if_softc_ctx_t scctx = sc->shared;
struct em_rx_queue *que = &sc->rx_queues[rxqid]; struct em_rx_queue *que = &sc->rx_queues[rxqid];
struct rx_ring *rxr = &que->rxr; struct rx_ring *rxr = &que->rxr;
...@@ -575,7 +575,7 @@ lem_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, qidx_t budget) ...@@ -575,7 +575,7 @@ lem_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, qidx_t budget)
static int static int
em_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, qidx_t budget) em_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, qidx_t budget)
{ {
struct adapter *sc = arg; struct e1000_softc *sc = arg;
if_softc_ctx_t scctx = sc->shared; if_softc_ctx_t scctx = sc->shared;
struct em_rx_queue *que = &sc->rx_queues[rxqid]; struct em_rx_queue *que = &sc->rx_queues[rxqid];
struct rx_ring *rxr = &que->rxr; struct rx_ring *rxr = &que->rxr;
...@@ -600,9 +600,9 @@ em_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, qidx_t budget) ...@@ -600,9 +600,9 @@ em_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, qidx_t budget)
static int static int
lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
{ {
struct adapter *adapter = arg; struct e1000_softc *sc = arg;
if_softc_ctx_t scctx = adapter->shared; if_softc_ctx_t scctx = sc->shared;
struct em_rx_queue *que = &adapter->rx_queues[ri->iri_qsidx]; struct em_rx_queue *que = &sc->rx_queues[ri->iri_qsidx];
struct rx_ring *rxr = &que->rxr; struct rx_ring *rxr = &que->rxr;
struct e1000_rx_desc *rxd; struct e1000_rx_desc *rxd;
u16 len; u16 len;
...@@ -628,7 +628,7 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) ...@@ -628,7 +628,7 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
/* Make sure bad packets are discarded */ /* Make sure bad packets are discarded */
if (errors & E1000_RXD_ERR_FRAME_ERR_MASK) { if (errors & E1000_RXD_ERR_FRAME_ERR_MASK) {
adapter->dropped_pkts++; sc->dropped_pkts++;
/* XXX fixup if common */ /* XXX fixup if common */
return (EBADMSG); return (EBADMSG);
} }
...@@ -645,7 +645,7 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) ...@@ -645,7 +645,7 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
} while (!eop); } while (!eop);
/* XXX add a faster way to look this up */ /* XXX add a faster way to look this up */
if (adapter->hw.mac.type >= e1000_82543) if (sc->hw.mac.type >= e1000_82543)
em_receive_checksum(status, errors, ri); em_receive_checksum(status, errors, ri);
if (status & E1000_RXD_STAT_VP) { if (status & E1000_RXD_STAT_VP) {
...@@ -661,9 +661,9 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) ...@@ -661,9 +661,9 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
static int static int
em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
{ {
struct adapter *adapter = arg; struct e1000_softc *sc = arg;
if_softc_ctx_t scctx = adapter->shared; if_softc_ctx_t scctx = sc->shared;
struct em_rx_queue *que = &adapter->rx_queues[ri->iri_qsidx]; struct em_rx_queue *que = &sc->rx_queues[ri->iri_qsidx];
struct rx_ring *rxr = &que->rxr; struct rx_ring *rxr = &que->rxr;
union e1000_rx_desc_extended *rxd; union e1000_rx_desc_extended *rxd;
...@@ -691,7 +691,7 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) ...@@ -691,7 +691,7 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
/* Make sure bad packets are discarded */ /* Make sure bad packets are discarded */
if (staterr & E1000_RXDEXT_ERR_FRAME_ERR_MASK) { if (staterr & E1000_RXDEXT_ERR_FRAME_ERR_MASK) {
adapter->dropped_pkts++; sc->dropped_pkts++;
return EBADMSG; return EBADMSG;
} }
......
This diff is collapsed.
...@@ -27,6 +27,10 @@ ...@@ -27,6 +27,10 @@
*/ */
/*$FreeBSD$*/ /*$FreeBSD$*/
#ifndef _EM_H_DEFINED_
#define _EM_H_DEFINED_
#include "opt_ddb.h" #include "opt_ddb.h"
#include "opt_inet.h" #include "opt_inet.h"
#include "opt_inet6.h" #include "opt_inet6.h"
...@@ -42,9 +46,7 @@ ...@@ -42,9 +46,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <ddb/ddb.h> #include <ddb/ddb.h>
#endif #endif
#if __FreeBSD_version >= 800000
#include <sys/buf_ring.h> #include <sys/buf_ring.h>
#endif
#include <sys/bus.h> #include <sys/bus.h>
#include <sys/endian.h> #include <sys/endian.h>
#include <sys/kernel.h> #include <sys/kernel.h>
...@@ -95,11 +97,6 @@ ...@@ -95,11 +97,6 @@
#include "e1000_82571.h" #include "e1000_82571.h"
#include "ifdi_if.h" #include "ifdi_if.h"
#ifndef _EM_H_DEFINED_
#define _EM_H_DEFINED_
/* Tunables */ /* Tunables */
/* /*
...@@ -226,7 +223,7 @@ ...@@ -226,7 +223,7 @@
#define EM_MASTER_SLAVE e1000_ms_hw_default #define EM_MASTER_SLAVE e1000_ms_hw_default
/* /*
* Micellaneous constants * Miscellaneous constants
*/ */
#define EM_VENDOR_ID 0x8086 #define EM_VENDOR_ID 0x8086
#define EM_FLASH 0x0014 #define EM_FLASH 0x0014
...@@ -244,7 +241,6 @@ ...@@ -244,7 +241,6 @@
#define EM_EEPROM_APME 0x400; #define EM_EEPROM_APME 0x400;
#define EM_82544_APME 0x0004; #define EM_82544_APME 0x0004;
/* Support AutoMediaDetect for Marvell M88 PHY in i354 */ /* Support AutoMediaDetect for Marvell M88 PHY in i354 */
#define IGB_MEDIA_RESET (1 << 0) #define IGB_MEDIA_RESET (1 << 0)
...@@ -282,12 +278,12 @@ ...@@ -282,12 +278,12 @@
((hw->mac.type <= e1000_82576) ? 16 : 8)) ((hw->mac.type <= e1000_82576) ? 16 : 8))
#define IGB_RX_HTHRESH 8 #define IGB_RX_HTHRESH 8
#define IGB_RX_WTHRESH ((hw->mac.type == e1000_82576 && \ #define IGB_RX_WTHRESH ((hw->mac.type == e1000_82576 && \
(adapter->intr_type == IFLIB_INTR_MSIX)) ? 1 : 4) (sc->intr_type == IFLIB_INTR_MSIX)) ? 1 : 4)
#define IGB_TX_PTHRESH ((hw->mac.type == e1000_i354) ? 20 : 8) #define IGB_TX_PTHRESH ((hw->mac.type == e1000_i354) ? 20 : 8)
#define IGB_TX_HTHRESH 1 #define IGB_TX_HTHRESH 1
#define IGB_TX_WTHRESH ((hw->mac.type != e1000_82575 && \ #define IGB_TX_WTHRESH ((hw->mac.type != e1000_82575 && \
(adapter->intr_type == IFLIB_INTR_MSIX) ? 1 : 16) sc->intr_type == IFLIB_INTR_MSIX) ? 1 : 16)
/* /*
* TDBA/RDBA should be aligned on 16 byte boundary. But TDLEN/RDLEN should be * TDBA/RDBA should be aligned on 16 byte boundary. But TDLEN/RDLEN should be
...@@ -317,11 +313,6 @@ ...@@ -317,11 +313,6 @@
#define EM_BAR_MEM_TYPE_32BIT 0x00000000 #define EM_BAR_MEM_TYPE_32BIT 0x00000000
#define EM_BAR_MEM_TYPE_64BIT 0x00000004 #define EM_BAR_MEM_TYPE_64BIT 0x00000004
/* More backward compatibility */
#if __FreeBSD_version < 900000
#define SYSCTL_ADD_UQUAD SYSCTL_ADD_QUAD
#endif
/* Defines for printing debug information */ /* Defines for printing debug information */
#define DEBUG_INIT 0 #define DEBUG_INIT 0
#define DEBUG_IOCTL 0 #define DEBUG_IOCTL 0
...@@ -347,7 +338,6 @@ ...@@ -347,7 +338,6 @@
CSUM_IP_SCTP | CSUM_IP6_UDP | CSUM_IP6_TCP | \ CSUM_IP_SCTP | CSUM_IP6_UDP | CSUM_IP6_TCP | \
CSUM_IP6_SCTP) /* Offload bits in mbuf flag */ CSUM_IP6_SCTP) /* Offload bits in mbuf flag */
#define IGB_PKTTYPE_MASK 0x0000FFF0 #define IGB_PKTTYPE_MASK 0x0000FFF0
#define IGB_DMCTLX_DCFLUSH_DIS 0x80000000 /* Disable DMA Coalesce Flush */ #define IGB_DMCTLX_DCFLUSH_DIS 0x80000000 /* Disable DMA Coalesce Flush */
...@@ -367,10 +357,10 @@ ...@@ -367,10 +357,10 @@
#define EM_NVM_MSIX_N_MASK (0x7 << EM_NVM_MSIX_N_SHIFT) #define EM_NVM_MSIX_N_MASK (0x7 << EM_NVM_MSIX_N_SHIFT)
#define EM_NVM_MSIX_N_SHIFT 7 #define EM_NVM_MSIX_N_SHIFT 7
struct adapter; struct e1000_softc;
struct em_int_delay_info { struct em_int_delay_info {
struct adapter *adapter; /* Back-pointer to the adapter struct */ struct e1000_softc *sc; /* Back-pointer to the sc struct */
int offset; /* Register offset to read/write */ int offset; /* Register offset to read/write */
int value; /* Current value in usecs */ int value; /* Current value in usecs */
}; };
...@@ -379,7 +369,7 @@ struct em_int_delay_info { ...@@ -379,7 +369,7 @@ struct em_int_delay_info {
* The transmit ring, one per tx queue * The transmit ring, one per tx queue
*/ */
struct tx_ring { struct tx_ring {
struct adapter *adapter; struct e1000_softc *sc;
struct e1000_tx_desc *tx_base; struct e1000_tx_desc *tx_base;
uint64_t tx_paddr; uint64_t tx_paddr;
qidx_t *tx_rsq; qidx_t *tx_rsq;
...@@ -410,7 +400,7 @@ struct tx_ring { ...@@ -410,7 +400,7 @@ struct tx_ring {
* The Receive ring, one per rx queue * The Receive ring, one per rx queue
*/ */
struct rx_ring { struct rx_ring {
struct adapter *adapter; struct e1000_softc *sc;
struct em_rx_queue *que; struct em_rx_queue *que;
u32 me; u32 me;
u32 payload; u32 payload;
...@@ -430,7 +420,7 @@ struct rx_ring { ...@@ -430,7 +420,7 @@ struct rx_ring {
}; };
struct em_tx_queue { struct em_tx_queue {
struct adapter *adapter; struct e1000_softc *sc;
u32 msix; u32 msix;
u32 eims; /* This queue's EIMS bit */ u32 eims; /* This queue's EIMS bit */
u32 me; u32 me;
...@@ -438,7 +428,7 @@ struct em_tx_queue { ...@@ -438,7 +428,7 @@ struct em_tx_queue {
}; };
struct em_rx_queue { struct em_rx_queue {
struct adapter *adapter; struct e1000_softc *sc;
u32 me; u32 me;
u32 msix; u32 msix;
u32 eims; u32 eims;
...@@ -447,8 +437,8 @@ struct em_rx_queue { ...@@ -447,8 +437,8 @@ struct em_rx_queue {
struct if_irq que_irq; struct if_irq que_irq;
}; };
/* Our adapter structure */ /* Our softc structure */
struct adapter { struct e1000_softc {
struct ifnet *ifp; struct ifnet *ifp;
struct e1000_hw hw; struct e1000_hw hw;
...@@ -551,7 +541,7 @@ typedef struct _em_vendor_info_t { ...@@ -551,7 +541,7 @@ typedef struct _em_vendor_info_t {
unsigned int index; unsigned int index;
} em_vendor_info_t; } em_vendor_info_t;
void em_dump_rs(struct adapter *); void em_dump_rs(struct e1000_softc *);
#define EM_RSSRK_SIZE 4 #define EM_RSSRK_SIZE 4
#define EM_RSSRK_VAL(key, i) (key[(i) * EM_RSSRK_SIZE] | \ #define EM_RSSRK_VAL(key, i) (key[(i) * EM_RSSRK_SIZE] | \
......
...@@ -89,7 +89,7 @@ igb_tso_setup(struct tx_ring *txr, if_pkt_info_t pi, uint32_t *cmd_type_len, ...@@ -89,7 +89,7 @@ igb_tso_setup(struct tx_ring *txr, if_pkt_info_t pi, uint32_t *cmd_type_len,
uint32_t *olinfo_status) uint32_t *olinfo_status)
{ {
struct e1000_adv_tx_context_desc *TXD; struct e1000_adv_tx_context_desc *TXD;
struct adapter *adapter = txr->adapter; struct e1000_softc *sc = txr->sc;
uint32_t type_tucmd_mlhl = 0, vlan_macip_lens = 0; uint32_t type_tucmd_mlhl = 0, vlan_macip_lens = 0;
uint32_t mss_l4len_idx = 0; uint32_t mss_l4len_idx = 0;
uint32_t paylen; uint32_t paylen;
...@@ -132,7 +132,7 @@ igb_tso_setup(struct tx_ring *txr, if_pkt_info_t pi, uint32_t *cmd_type_len, ...@@ -132,7 +132,7 @@ igb_tso_setup(struct tx_ring *txr, if_pkt_info_t pi, uint32_t *cmd_type_len,
mss_l4len_idx |= (pi->ipi_tso_segsz << E1000_ADVTXD_MSS_SHIFT); mss_l4len_idx |= (pi->ipi_tso_segsz << E1000_ADVTXD_MSS_SHIFT);
mss_l4len_idx |= (pi->ipi_tcp_hlen << E1000_ADVTXD_L4LEN_SHIFT); mss_l4len_idx |= (pi->ipi_tcp_hlen << E1000_ADVTXD_L4LEN_SHIFT);
/* 82575 needs the queue index added */ /* 82575 needs the queue index added */
if (adapter->hw.mac.type == e1000_82575) if (sc->hw.mac.type == e1000_82575)
mss_l4len_idx |= txr->me << 4; mss_l4len_idx |= txr->me << 4;
TXD->mss_l4len_idx = htole32(mss_l4len_idx);