Submit #2332 ยป 0001-Use-MSI-if-device-supports-it.-RT8168E-supports-MSI.patch
sys/dev/netif/re/if_re.c | ||
---|---|---|
static int re_rx_desc_count = RE_RX_DESC_CNT_DEF;
|
||
static int re_tx_desc_count = RE_TX_DESC_CNT_DEF;
|
||
static int re_msi_enable = 1;
|
||
TUNABLE_INT("hw.re.rx_desc_count", &re_rx_desc_count);
|
||
TUNABLE_INT("hw.re.tx_desc_count", &re_tx_desc_count);
|
||
TUNABLE_INT("hw.re.msi.enable", &re_msi_enable);
|
||
#define EE_SET(x) \
|
||
CSR_WRITE_1(sc, RE_EECMD, CSR_READ_1(sc, RE_EECMD) | (x))
|
||
... | ... | |
struct ifnet *ifp;
|
||
uint8_t eaddr[ETHER_ADDR_LEN];
|
||
int error = 0, rid, qlen;
|
||
u_int irq_flags;
|
||
callout_init(&sc->re_timer);
|
||
sc->re_dev = dev;
|
||
... | ... | |
sc->re_bhandle = rman_get_bushandle(sc->re_res);
|
||
/* Allocate interrupt */
|
||
rid = 0;
|
||
sc->re_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
|
||
RF_SHAREABLE | RF_ACTIVE);
|
||
sc->re_irq_type = pci_alloc_1intr(dev, re_msi_enable,
|
||
&sc->re_irq_rid, &irq_flags);
|
||
|
||
sc->re_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->re_irq_rid,
|
||
irq_flags);
|
||
if (sc->re_irq == NULL) {
|
||
device_printf(dev, "couldn't map interrupt\n");
|
||
error = ENXIO;
|
||
... | ... | |
sysctl_ctx_free(&sc->re_sysctl_ctx);
|
||
if (sc->re_irq)
|
||
bus_release_resource(dev, SYS_RES_IRQ, 0, sc->re_irq);
|
||
bus_release_resource(dev, SYS_RES_IRQ, sc->re_irq_rid,
|
||
sc->re_irq);
|
||
if (sc->re_irq_type == PCI_INTR_TYPE_MSI)
|
||
pci_release_msi(dev);
|
||
if (sc->re_res) {
|
||
bus_release_resource(dev, SYS_RES_IOPORT, RE_PCI_LOIO,
|
||
sc->re_res);
|
sys/dev/netif/re/if_revar.h | ||
---|---|---|
int rxcycles;
|
||
int re_rxbuf_size;
|
||
int (*re_newbuf)(struct re_softc *, int, int);
|
||
int re_irq_type;
|
||
int re_irq_rid;
|
||
uint32_t re_flags; /* see RE_F_ */
|
||
int re_if_flags; /* saved ifnet.if_flags */
|