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
This commit is contained in:
parent
f73c2bbf81
commit
dc92605154
@ -42,9 +42,9 @@
|
||||
/*********************************************************************
|
||||
* 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);
|
||||
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);
|
||||
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);
|
||||
@ -91,9 +91,9 @@ struct if_txrx lem_txrx = {
|
||||
extern if_shared_ctx_t em_sctx;
|
||||
|
||||
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 tx_ring *txr;
|
||||
qidx_t i, ntxd, qid, cur;
|
||||
@ -102,8 +102,8 @@ em_dump_rs(struct adapter *adapter)
|
||||
|
||||
printf("\n");
|
||||
ntxd = scctx->isc_ntxd[0];
|
||||
for (qid = 0; qid < adapter->tx_num_queues; qid++) {
|
||||
que = &adapter->tx_queues[qid];
|
||||
for (qid = 0; qid < sc->tx_num_queues; qid++) {
|
||||
que = &sc->tx_queues[qid];
|
||||
txr = &que->txr;
|
||||
rs_cidx = txr->tx_rs_cidx;
|
||||
if (rs_cidx != txr->tx_rs_pidx) {
|
||||
@ -132,10 +132,10 @@ em_dump_rs(struct adapter *adapter)
|
||||
*
|
||||
**********************************************************************/
|
||||
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;
|
||||
struct em_tx_queue *que = &adapter->tx_queues[pi->ipi_qsidx];
|
||||
if_softc_ctx_t scctx = sc->shared;
|
||||
struct em_tx_queue *que = &sc->tx_queues[pi->ipi_qsidx];
|
||||
struct tx_ring *txr = &que->txr;
|
||||
struct e1000_context_desc *TXD;
|
||||
int cur, hdr_len;
|
||||
@ -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.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_TSE | /* TSE context */
|
||||
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
|
||||
if (++cur == scctx->isc_ntxd[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);
|
||||
}
|
||||
|
||||
@ -215,11 +215,11 @@ em_tso_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_upper, u32 *txd
|
||||
**********************************************************************/
|
||||
|
||||
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;
|
||||
if_softc_ctx_t scctx = adapter->shared;
|
||||
struct em_tx_queue *que = &adapter->tx_queues[pi->ipi_qsidx];
|
||||
if_softc_ctx_t scctx = sc->shared;
|
||||
struct em_tx_queue *que = &sc->tx_queues[pi->ipi_qsidx];
|
||||
struct tx_ring *txr = &que->txr;
|
||||
int csum_flags = pi->ipi_csum_flags;
|
||||
int cur, hdr_len;
|
||||
@ -227,7 +227,7 @@ em_transmit_checksum_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_u
|
||||
|
||||
cur = pi->ipi_pidx;
|
||||
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
|
||||
@ -237,7 +237,7 @@ em_transmit_checksum_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_u
|
||||
* second note.
|
||||
*/
|
||||
if (DONT_FORCE_CTX &&
|
||||
adapter->tx_num_queues == 1 &&
|
||||
sc->tx_num_queues == 1 &&
|
||||
txr->csum_lhlen == pi->ipi_ehdrlen &&
|
||||
txr->csum_iphlen == pi->ipi_ip_hlen &&
|
||||
txr->csum_flags == csum_flags) {
|
||||
@ -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]) {
|
||||
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);
|
||||
return (cur);
|
||||
}
|
||||
@ -301,7 +301,7 @@ em_transmit_checksum_setup(struct adapter *adapter, if_pkt_info_t pi, u32 *txd_u
|
||||
static int
|
||||
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;
|
||||
struct em_tx_queue *que = &sc->tx_queues[pi->ipi_qsidx];
|
||||
struct tx_ring *txr = &que->txr;
|
||||
@ -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);
|
||||
/* XXX adapter->pcix_82544 -- lem_fill_descriptors */
|
||||
/* XXX sc->pcix_82544 -- lem_fill_descriptors */
|
||||
|
||||
/* Set up our transmit descriptors */
|
||||
for (j = 0; j < nsegs; j++) {
|
||||
@ -416,19 +416,19 @@ 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)
|
||||
{
|
||||
struct adapter *adapter = arg;
|
||||
struct em_tx_queue *que = &adapter->tx_queues[txqid];
|
||||
struct e1000_softc *sc = arg;
|
||||
struct em_tx_queue *que = &sc->tx_queues[txqid];
|
||||
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
|
||||
em_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear)
|
||||
{
|
||||
struct adapter *adapter = arg;
|
||||
if_softc_ctx_t scctx = adapter->shared;
|
||||
struct em_tx_queue *que = &adapter->tx_queues[txqid];
|
||||
struct e1000_softc *sc = arg;
|
||||
if_softc_ctx_t scctx = sc->shared;
|
||||
struct em_tx_queue *que = &sc->tx_queues[txqid];
|
||||
struct tx_ring *txr = &que->txr;
|
||||
|
||||
qidx_t processed = 0;
|
||||
@ -461,7 +461,7 @@ em_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear)
|
||||
if (delta < 0)
|
||||
delta += ntxd;
|
||||
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",
|
||||
__FUNCTION__, prev, cur, clear, delta);
|
||||
|
||||
@ -483,7 +483,7 @@ em_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear)
|
||||
static void
|
||||
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;
|
||||
struct em_rx_queue *que = &sc->rx_queues[iru->iru_qsidx];
|
||||
struct rx_ring *rxr = &que->rxr;
|
||||
@ -511,7 +511,7 @@ lem_isc_rxd_refill(void *arg, if_rxd_update_t iru)
|
||||
static void
|
||||
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;
|
||||
uint16_t rxqid = iru->iru_qsidx;
|
||||
struct em_rx_queue *que = &sc->rx_queues[rxqid];
|
||||
@ -540,7 +540,7 @@ em_isc_rxd_refill(void *arg, if_rxd_update_t iru)
|
||||
static void
|
||||
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 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)
|
||||
static int
|
||||
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;
|
||||
struct em_rx_queue *que = &sc->rx_queues[rxqid];
|
||||
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)
|
||||
static int
|
||||
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;
|
||||
struct em_rx_queue *que = &sc->rx_queues[rxqid];
|
||||
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)
|
||||
static int
|
||||
lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
|
||||
{
|
||||
struct adapter *adapter = arg;
|
||||
if_softc_ctx_t scctx = adapter->shared;
|
||||
struct em_rx_queue *que = &adapter->rx_queues[ri->iri_qsidx];
|
||||
struct e1000_softc *sc = arg;
|
||||
if_softc_ctx_t scctx = sc->shared;
|
||||
struct em_rx_queue *que = &sc->rx_queues[ri->iri_qsidx];
|
||||
struct rx_ring *rxr = &que->rxr;
|
||||
struct e1000_rx_desc *rxd;
|
||||
u16 len;
|
||||
@ -628,7 +628,7 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
|
||||
|
||||
/* Make sure bad packets are discarded */
|
||||
if (errors & E1000_RXD_ERR_FRAME_ERR_MASK) {
|
||||
adapter->dropped_pkts++;
|
||||
sc->dropped_pkts++;
|
||||
/* XXX fixup if common */
|
||||
return (EBADMSG);
|
||||
}
|
||||
@ -645,7 +645,7 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
|
||||
} while (!eop);
|
||||
|
||||
/* 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);
|
||||
|
||||
if (status & E1000_RXD_STAT_VP) {
|
||||
@ -661,9 +661,9 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
|
||||
static int
|
||||
em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
|
||||
{
|
||||
struct adapter *adapter = arg;
|
||||
if_softc_ctx_t scctx = adapter->shared;
|
||||
struct em_rx_queue *que = &adapter->rx_queues[ri->iri_qsidx];
|
||||
struct e1000_softc *sc = arg;
|
||||
if_softc_ctx_t scctx = sc->shared;
|
||||
struct em_rx_queue *que = &sc->rx_queues[ri->iri_qsidx];
|
||||
struct rx_ring *rxr = &que->rxr;
|
||||
union e1000_rx_desc_extended *rxd;
|
||||
|
||||
@ -691,7 +691,7 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
|
||||
|
||||
/* Make sure bad packets are discarded */
|
||||
if (staterr & E1000_RXDEXT_ERR_FRAME_ERR_MASK) {
|
||||
adapter->dropped_pkts++;
|
||||
sc->dropped_pkts++;
|
||||
return EBADMSG;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -27,6 +27,10 @@
|
||||
*/
|
||||
|
||||
/*$FreeBSD$*/
|
||||
|
||||
#ifndef _EM_H_DEFINED_
|
||||
#define _EM_H_DEFINED_
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_inet.h"
|
||||
#include "opt_inet6.h"
|
||||
@ -42,9 +46,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <ddb/ddb.h>
|
||||
#endif
|
||||
#if __FreeBSD_version >= 800000
|
||||
#include <sys/buf_ring.h>
|
||||
#endif
|
||||
#include <sys/bus.h>
|
||||
#include <sys/endian.h>
|
||||
#include <sys/kernel.h>
|
||||
@ -95,11 +97,6 @@
|
||||
#include "e1000_82571.h"
|
||||
#include "ifdi_if.h"
|
||||
|
||||
|
||||
#ifndef _EM_H_DEFINED_
|
||||
#define _EM_H_DEFINED_
|
||||
|
||||
|
||||
/* Tunables */
|
||||
|
||||
/*
|
||||
@ -226,7 +223,7 @@
|
||||
#define EM_MASTER_SLAVE e1000_ms_hw_default
|
||||
|
||||
/*
|
||||
* Micellaneous constants
|
||||
* Miscellaneous constants
|
||||
*/
|
||||
#define EM_VENDOR_ID 0x8086
|
||||
#define EM_FLASH 0x0014
|
||||
@ -244,7 +241,6 @@
|
||||
#define EM_EEPROM_APME 0x400;
|
||||
#define EM_82544_APME 0x0004;
|
||||
|
||||
|
||||
/* Support AutoMediaDetect for Marvell M88 PHY in i354 */
|
||||
#define IGB_MEDIA_RESET (1 << 0)
|
||||
|
||||
@ -282,12 +278,12 @@
|
||||
((hw->mac.type <= e1000_82576) ? 16 : 8))
|
||||
#define IGB_RX_HTHRESH 8
|
||||
#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_HTHRESH 1
|
||||
#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
|
||||
@ -317,11 +313,6 @@
|
||||
#define EM_BAR_MEM_TYPE_32BIT 0x00000000
|
||||
#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 */
|
||||
#define DEBUG_INIT 0
|
||||
#define DEBUG_IOCTL 0
|
||||
@ -347,7 +338,6 @@
|
||||
CSUM_IP_SCTP | CSUM_IP6_UDP | CSUM_IP6_TCP | \
|
||||
CSUM_IP6_SCTP) /* Offload bits in mbuf flag */
|
||||
|
||||
|
||||
#define IGB_PKTTYPE_MASK 0x0000FFF0
|
||||
#define IGB_DMCTLX_DCFLUSH_DIS 0x80000000 /* Disable DMA Coalesce Flush */
|
||||
|
||||
@ -367,10 +357,10 @@
|
||||
#define EM_NVM_MSIX_N_MASK (0x7 << EM_NVM_MSIX_N_SHIFT)
|
||||
#define EM_NVM_MSIX_N_SHIFT 7
|
||||
|
||||
struct adapter;
|
||||
struct e1000_softc;
|
||||
|
||||
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 value; /* Current value in usecs */
|
||||
};
|
||||
@ -379,7 +369,7 @@ struct em_int_delay_info {
|
||||
* The transmit ring, one per tx queue
|
||||
*/
|
||||
struct tx_ring {
|
||||
struct adapter *adapter;
|
||||
struct e1000_softc *sc;
|
||||
struct e1000_tx_desc *tx_base;
|
||||
uint64_t tx_paddr;
|
||||
qidx_t *tx_rsq;
|
||||
@ -410,7 +400,7 @@ struct tx_ring {
|
||||
* The Receive ring, one per rx queue
|
||||
*/
|
||||
struct rx_ring {
|
||||
struct adapter *adapter;
|
||||
struct e1000_softc *sc;
|
||||
struct em_rx_queue *que;
|
||||
u32 me;
|
||||
u32 payload;
|
||||
@ -430,7 +420,7 @@ struct rx_ring {
|
||||
};
|
||||
|
||||
struct em_tx_queue {
|
||||
struct adapter *adapter;
|
||||
struct e1000_softc *sc;
|
||||
u32 msix;
|
||||
u32 eims; /* This queue's EIMS bit */
|
||||
u32 me;
|
||||
@ -438,7 +428,7 @@ struct em_tx_queue {
|
||||
};
|
||||
|
||||
struct em_rx_queue {
|
||||
struct adapter *adapter;
|
||||
struct e1000_softc *sc;
|
||||
u32 me;
|
||||
u32 msix;
|
||||
u32 eims;
|
||||
@ -447,8 +437,8 @@ struct em_rx_queue {
|
||||
struct if_irq que_irq;
|
||||
};
|
||||
|
||||
/* Our adapter structure */
|
||||
struct adapter {
|
||||
/* Our softc structure */
|
||||
struct e1000_softc {
|
||||
struct ifnet *ifp;
|
||||
struct e1000_hw hw;
|
||||
|
||||
@ -551,7 +541,7 @@ typedef struct _em_vendor_info_t {
|
||||
unsigned int index;
|
||||
} 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_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,
|
||||
uint32_t *olinfo_status)
|
||||
{
|
||||
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 mss_l4len_idx = 0;
|
||||
uint32_t paylen;
|
||||
@ -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_tcp_hlen << E1000_ADVTXD_L4LEN_SHIFT);
|
||||
/* 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;
|
||||
TXD->mss_l4len_idx = htole32(mss_l4len_idx);
|
||||
|
||||
@ -154,7 +154,7 @@ igb_tx_ctx_setup(struct tx_ring *txr, if_pkt_info_t pi, uint32_t *cmd_type_len,
|
||||
uint32_t *olinfo_status)
|
||||
{
|
||||
struct e1000_adv_tx_context_desc *TXD;
|
||||
struct adapter *adapter = txr->adapter;
|
||||
struct e1000_softc *sc = txr->sc;
|
||||
uint32_t vlan_macip_lens, type_tucmd_mlhl;
|
||||
uint32_t mss_l4len_idx;
|
||||
mss_l4len_idx = vlan_macip_lens = type_tucmd_mlhl = 0;
|
||||
@ -221,7 +221,7 @@ igb_tx_ctx_setup(struct tx_ring *txr, if_pkt_info_t pi, uint32_t *cmd_type_len,
|
||||
}
|
||||
|
||||
/* 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;
|
||||
|
||||
/* Now copy bits into descriptor */
|
||||
@ -236,7 +236,7 @@ igb_tx_ctx_setup(struct tx_ring *txr, if_pkt_info_t pi, uint32_t *cmd_type_len,
|
||||
static int
|
||||
igb_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;
|
||||
struct em_tx_queue *que = &sc->tx_queues[pi->ipi_qsidx];
|
||||
struct tx_ring *txr = &que->txr;
|
||||
@ -299,19 +299,19 @@ igb_isc_txd_encap(void *arg, if_pkt_info_t pi)
|
||||
static void
|
||||
igb_isc_txd_flush(void *arg, uint16_t txqid, qidx_t pidx)
|
||||
{
|
||||
struct adapter *adapter = arg;
|
||||
struct em_tx_queue *que = &adapter->tx_queues[txqid];
|
||||
struct e1000_softc *sc = arg;
|
||||
struct em_tx_queue *que = &sc->tx_queues[txqid];
|
||||
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
|
||||
igb_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear)
|
||||
{
|
||||
struct adapter *adapter = arg;
|
||||
if_softc_ctx_t scctx = adapter->shared;
|
||||
struct em_tx_queue *que = &adapter->tx_queues[txqid];
|
||||
struct e1000_softc *sc = arg;
|
||||
if_softc_ctx_t scctx = sc->shared;
|
||||
struct em_tx_queue *que = &sc->tx_queues[txqid];
|
||||
struct tx_ring *txr = &que->txr;
|
||||
|
||||
qidx_t processed = 0;
|
||||
@ -361,7 +361,7 @@ igb_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear)
|
||||
static void
|
||||
igb_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;
|
||||
uint16_t rxqid = iru->iru_qsidx;
|
||||
struct em_rx_queue *que = &sc->rx_queues[rxqid];
|
||||
@ -388,7 +388,7 @@ igb_isc_rxd_refill(void *arg, if_rxd_update_t iru)
|
||||
static void
|
||||
igb_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 rx_ring *rxr = &que->rxr;
|
||||
|
||||
@ -398,7 +398,7 @@ igb_isc_rxd_flush(void *arg, uint16_t rxqid, uint8_t flid __unused, qidx_t pidx)
|
||||
static int
|
||||
igb_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;
|
||||
struct em_rx_queue *que = &sc->rx_queues[rxqid];
|
||||
struct rx_ring *rxr = &que->rxr;
|
||||
@ -430,9 +430,9 @@ igb_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, qidx_t budget)
|
||||
static int
|
||||
igb_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
|
||||
{
|
||||
struct adapter *adapter = arg;
|
||||
if_softc_ctx_t scctx = adapter->shared;
|
||||
struct em_rx_queue *que = &adapter->rx_queues[ri->iri_qsidx];
|
||||
struct e1000_softc *sc = arg;
|
||||
if_softc_ctx_t scctx = sc->shared;
|
||||
struct em_rx_queue *que = &sc->rx_queues[ri->iri_qsidx];
|
||||
struct rx_ring *rxr = &que->rxr;
|
||||
union e1000_adv_rx_desc *rxd;
|
||||
|
||||
@ -460,8 +460,8 @@ igb_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
|
||||
rxd->wb.upper.status_error = 0;
|
||||
eop = ((staterr & E1000_RXD_STAT_EOP) == E1000_RXD_STAT_EOP);
|
||||
|
||||
if (((adapter->hw.mac.type == e1000_i350) ||
|
||||
(adapter->hw.mac.type == e1000_i354)) &&
|
||||
if (((sc->hw.mac.type == e1000_i350) ||
|
||||
(sc->hw.mac.type == e1000_i354)) &&
|
||||
(staterr & E1000_RXDEXT_STATERR_LB))
|
||||
vtag = be16toh(rxd->wb.upper.vlan);
|
||||
else
|
||||
@ -469,7 +469,7 @@ igb_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
|
||||
|
||||
/* Make sure bad packets are discarded */
|
||||
if (eop && ((staterr & E1000_RXDEXT_ERR_FRAME_ERR_MASK) != 0)) {
|
||||
adapter->dropped_pkts++;
|
||||
sc->dropped_pkts++;
|
||||
++rxr->rx_discarded;
|
||||
return (EBADMSG);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user