ReactOS  0.4.15-dev-494-g1d8c567
8390.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _PACKET_HEADER
 
struct  _ETH_HEADER
 
struct  _DISCARD_HEADER
 

Macros

#define PG0_CR   0x00 /* Command Register (R/W) */
 
#define PG0_CLDA0   0x01 /* Current Local DMA Address 0 (R) */
 
#define PG0_PSTART   0x01 /* Page Start Register (W) */
 
#define PG0_CLDA1   0x02 /* Current Local DMA Address 1 (R) */
 
#define PG0_PSTOP   0x02 /* Page Stop Register (W) */
 
#define PG0_BNRY   0x03 /* Boundary Pointer (R/W) */
 
#define PG0_TSR   0x04 /* Transmit Status Register (R) */
 
#define PG0_TPSR   0x04 /* Transmit Page Start Register (W) */
 
#define PG0_NCR   0x05 /* Number of Collisions Register (R) */
 
#define PG0_TBCR0   0x05 /* Transmit Byte Count Register 0 (W) */
 
#define PG0_FIFO   0x06 /* FIFO (R) */
 
#define PG0_TBCR1   0x06 /* Transmit Byte Count Register 1 (W) */
 
#define PG0_ISR   0x07 /* Interrupt Status Register (R/W) */
 
#define PG0_CRDA0   0x08 /* Current Remote DMA Address 0 (R) */
 
#define PG0_RSAR0   0x08 /* Remote Start Address Register 0 (W) */
 
#define PG0_CRDA1   0x09 /* Current Remote DMA Address 1 (R) */
 
#define PG0_RSAR1   0x09 /* Remote Start Address Register 1 (W) */
 
#define PG0_RBCR0   0x0A /* Remote Byte Count Register 0 (W) */
 
#define PG0_RBCR1   0x0B /* Remote Byte Count Register 1 (W) */
 
#define PG0_RSR   0x0C /* Receive Status Register (R) */
 
#define PG0_RCR   0x0C /* Receive Configuration Register (W) */
 
#define PG0_CNTR0   0x0D /* Tally Counter 0 (Frame Alignment Errors) (R) */
 
#define PG0_TCR   0x0D /* Transmit Configuration Register (W) */
 
#define PG0_CNTR1   0x0E /* Tally Counter 1 (CRC Errors) (R) */
 
#define PG0_DCR   0x0E /* Data Configuration Register (W) */
 
#define PG0_CNTR2   0x0F /* Tally Counter 2 (Missed Packet Errors) (R) */
 
#define PG0_IMR   0x0F /* Interrupt Mask Register (W) */
 
#define PG1_CR   0x00 /* Command Register (R/W) */
 
#define PG1_PAR   0x01 /* Physical Address Registers (6 registers) (R/W) */
 
#define PG1_CURR   0x07 /* Current Page Register (R/W) */
 
#define PG1_MAR   0x08 /* Multicast Address Registers (8 registers) (R/W) */
 
#define PG2_CR   0x00 /* Command Register (R/W) */
 
#define PG2_PSTART   0x01 /* Page Start Register (R) */
 
#define PG2_CLDA0   0x01 /* Current Local DMA Address 0 (W) */
 
#define PG2_PSTOP   0x02 /* Page Stop Register (R) */
 
#define PG2_CLDA1   0x02 /* Current Local DMA Address 1 (W) */
 
#define PG2_RNPP   0x03 /* Remote Next Packet Pointer (R/W) */
 
#define PG2_TPSR   0x04 /* Transmit Page Start Address (R) */
 
#define PG2_LNPP   0x05 /* Local Next Packet Pointer (R/W) */
 
#define PG2_AC1   0x06 /* Address Counter (Upper) (R/W) */
 
#define PG2_AC0   0x07 /* Address Counter (Lower) (R/W) */
 
#define PG2_RCR   0x0C /* Receive Configuration Register (R) */
 
#define PG2_TCR   0x0D /* Transmit Configuration Register (R) */
 
#define PG2_DCR   0x0E /* Data Configuration Register (R) */
 
#define PG2_IMR   0x0F /* Interrupt Mask Register (R) */
 
#define CR_STP   0x01 /* Stop chip */
 
#define CR_STA   0x02 /* Start chip */
 
#define CR_TXP   0x04 /* Transmit a frame */
 
#define CR_RD0   0x08 /* Remote read */
 
#define CR_RD1   0x10 /* Remote write */
 
#define CR_RD2   0x20 /* Abort/complete remote DMA */
 
#define CR_PAGE0   0x00 /* Select page 0 of chip registers */
 
#define CR_PAGE1   0x40 /* Select page 1 of chip registers */
 
#define CR_PAGE2   0x80 /* Select page 2 of chip registers */
 
#define ISR_PRX   0x01 /* Packet received, no errors */
 
#define ISR_PTX   0x02 /* Packet transmitted, no errors */
 
#define ISR_RXE   0x04 /* Receive error */
 
#define ISR_TXE   0x08 /* Transmit error */
 
#define ISR_OVW   0x10 /* Overwrite warning */
 
#define ISR_CNT   0x20 /* Counter overflow */
 
#define ISR_RDC   0x40 /* Remote DMA complete */
 
#define ISR_RST   0x80 /* Reset status */
 
#define TSR_PTX   0x01h /* Packet transmitted without error */
 
#define TSR_COL   0x04h /* Collided at least once */
 
#define TSR_ABT   0x08h /* Collided 16 times and was dropped */
 
#define TSR_CRS   0x10h /* Carrier sense lost */
 
#define TSR_FU   0x20h /* Transmit FIFO Underrun */
 
#define TSR_CDH   0x40h /* Collision detect heartbeat */
 
#define TSR_OWC   0x80h /* Out of window collision */
 
#define RCR_SEP   0x01 /* Save error packets */
 
#define RCR_AR   0x02 /* Accept runt packets */
 
#define RCR_AB   0x04 /* Accept broadcasts */
 
#define RCR_AM   0x08 /* Accept multicast */
 
#define RCR_PRO   0x10 /* Promiscuous physical addresses */
 
#define RCR_MON   0x20 /* Monitor mode */
 
#define RSR_PRX   0x01 /* Received packet intact */
 
#define RSR_CRC   0x02 /* CRC error */
 
#define RSR_FAE   0x04 /* Frame alignment error */
 
#define RSR_FO   0x08 /* FIFO overrun */
 
#define RSR_MPA   0x10 /* Missed packet */
 
#define RSR_PHY   0x20 /* Physical/multicast address */
 
#define RSR_DIS   0x40 /* Receiver disabled (monitor mode) */
 
#define RSR_DFR   0x80 /* Deferring */
 
#define TCR_CRC   0x01 /* Inhibit CRC, do not append CRC */
 
#define TCR_LOOP   0x02 /* Set loopback mode */
 
#define TCR_LB01   0x06 /* Encoded loopback control */
 
#define TCR_ATD   0x08 /* Auto transmit disable */
 
#define TCR_OFST   0x10 /* Collision offset enable */
 
#define DCR_WTS   0x01 /* Word transfer mode selection */
 
#define DCR_BOS   0x02 /* Byte order selection */
 
#define DCR_LAS   0x04 /* Long address selection */
 
#define DCR_LS   0x08 /* Loopback select (when 0) */
 
#define DCR_ARM   0x10 /* Autoinitialize remote */
 
#define DCR_FT00   0x00 /* Burst length selection (1 word/2 bytes) */
 
#define DCR_FT01   0x20 /* burst length selection (2 words/4 bytes) */
 
#define DCR_FT10   0x40 /* Burst length selection (4 words/8 bytes) */
 
#define DCR_FT11   0x60 /* Burst length selection (6 words/12 bytes) */
 
#define IMR_PRXE   0x01 /* Packet received interrupt enable */
 
#define IMR_PTXE   0x02 /* Packet transmitted interrupt enable */
 
#define IMR_RXEE   0x04 /* Receive error interrupt enable */
 
#define IMR_TXEE   0x08 /* Transmit error interrupt enable */
 
#define IMR_OVWE   0x10 /* Overwrite warning interrupt enable */
 
#define IMR_CNTE   0x20 /* Counter overflow interrupt enable */
 
#define IMR_RDCE   0x40 /* Remote DMA complete interrupt enable */
 
#define IMR_ALLE   0x7F /* All interrupts enable */
 
#define IEEE_802_ADDR_LENGTH   6
 
#define NICDisableInterrupts(Adapter)
 
#define NICEnableInterrupts(Adapter)
 

Typedefs

typedef struct _PACKET_HEADER PACKET_HEADER
 
typedef struct _PACKET_HEADERPPACKET_HEADER
 
typedef struct _ETH_HEADER ETH_HEADER
 
typedef struct _ETH_HEADERPETH_HEADER
 
typedef struct _DISCARD_HEADER DISCARD_HEADER
 
typedef struct _DISCARD_HEADERPDISCARD_HEADER
 

Functions

VOID NTAPI MiniportHandleInterrupt (IN NDIS_HANDLE MiniportAdapterContext)
 

Macro Definition Documentation

◆ CR_PAGE0

#define CR_PAGE0   0x00 /* Select page 0 of chip registers */

Definition at line 68 of file 8390.h.

◆ CR_PAGE1

#define CR_PAGE1   0x40 /* Select page 1 of chip registers */

Definition at line 69 of file 8390.h.

◆ CR_PAGE2

#define CR_PAGE2   0x80 /* Select page 2 of chip registers */

Definition at line 70 of file 8390.h.

◆ CR_RD0

#define CR_RD0   0x08 /* Remote read */

Definition at line 65 of file 8390.h.

◆ CR_RD1

#define CR_RD1   0x10 /* Remote write */

Definition at line 66 of file 8390.h.

◆ CR_RD2

#define CR_RD2   0x20 /* Abort/complete remote DMA */

Definition at line 67 of file 8390.h.

◆ CR_STA

#define CR_STA   0x02 /* Start chip */

Definition at line 63 of file 8390.h.

◆ CR_STP

#define CR_STP   0x01 /* Stop chip */

Definition at line 62 of file 8390.h.

◆ CR_TXP

#define CR_TXP   0x04 /* Transmit a frame */

Definition at line 64 of file 8390.h.

◆ DCR_ARM

#define DCR_ARM   0x10 /* Autoinitialize remote */

Definition at line 121 of file 8390.h.

◆ DCR_BOS

#define DCR_BOS   0x02 /* Byte order selection */

Definition at line 118 of file 8390.h.

◆ DCR_FT00

#define DCR_FT00   0x00 /* Burst length selection (1 word/2 bytes) */

Definition at line 122 of file 8390.h.

◆ DCR_FT01

#define DCR_FT01   0x20 /* burst length selection (2 words/4 bytes) */

Definition at line 123 of file 8390.h.

◆ DCR_FT10

#define DCR_FT10   0x40 /* Burst length selection (4 words/8 bytes) */

Definition at line 124 of file 8390.h.

◆ DCR_FT11

#define DCR_FT11   0x60 /* Burst length selection (6 words/12 bytes) */

Definition at line 125 of file 8390.h.

◆ DCR_LAS

#define DCR_LAS   0x04 /* Long address selection */

Definition at line 119 of file 8390.h.

◆ DCR_LS

#define DCR_LS   0x08 /* Loopback select (when 0) */

Definition at line 120 of file 8390.h.

◆ DCR_WTS

#define DCR_WTS   0x01 /* Word transfer mode selection */

Definition at line 117 of file 8390.h.

◆ IEEE_802_ADDR_LENGTH

#define IEEE_802_ADDR_LENGTH   6

Definition at line 145 of file 8390.h.

◆ IMR_ALLE

#define IMR_ALLE   0x7F /* All interrupts enable */

Definition at line 135 of file 8390.h.

◆ IMR_CNTE

#define IMR_CNTE   0x20 /* Counter overflow interrupt enable */

Definition at line 133 of file 8390.h.

◆ IMR_OVWE

#define IMR_OVWE   0x10 /* Overwrite warning interrupt enable */

Definition at line 132 of file 8390.h.

◆ IMR_PRXE

#define IMR_PRXE   0x01 /* Packet received interrupt enable */

Definition at line 128 of file 8390.h.

◆ IMR_PTXE

#define IMR_PTXE   0x02 /* Packet transmitted interrupt enable */

Definition at line 129 of file 8390.h.

◆ IMR_RDCE

#define IMR_RDCE   0x40 /* Remote DMA complete interrupt enable */

Definition at line 134 of file 8390.h.

◆ IMR_RXEE

#define IMR_RXEE   0x04 /* Receive error interrupt enable */

Definition at line 130 of file 8390.h.

◆ IMR_TXEE

#define IMR_TXEE   0x08 /* Transmit error interrupt enable */

Definition at line 131 of file 8390.h.

◆ ISR_CNT

#define ISR_CNT   0x20 /* Counter overflow */

Definition at line 78 of file 8390.h.

◆ ISR_OVW

#define ISR_OVW   0x10 /* Overwrite warning */

Definition at line 77 of file 8390.h.

◆ ISR_PRX

#define ISR_PRX   0x01 /* Packet received, no errors */

Definition at line 73 of file 8390.h.

◆ ISR_PTX

#define ISR_PTX   0x02 /* Packet transmitted, no errors */

Definition at line 74 of file 8390.h.

◆ ISR_RDC

#define ISR_RDC   0x40 /* Remote DMA complete */

Definition at line 79 of file 8390.h.

◆ ISR_RST

#define ISR_RST   0x80 /* Reset status */

Definition at line 80 of file 8390.h.

◆ ISR_RXE

#define ISR_RXE   0x04 /* Receive error */

Definition at line 75 of file 8390.h.

◆ ISR_TXE

#define ISR_TXE   0x08 /* Transmit error */

Definition at line 76 of file 8390.h.

◆ NICDisableInterrupts

#define NICDisableInterrupts (   Adapter)
Value:
{ \
NDIS_DbgPrint(MAX_TRACE, ("NICDisableInterrupts()\n")); \
NdisRawWritePortUchar((Adapter)->IOBase + PG0_IMR, 0x00); \
}
#define PG0_IMR
Definition: 8390.h:37
#define MAX_TRACE
Definition: debug.h:16

Definition at line 159 of file 8390.h.

◆ NICEnableInterrupts

#define NICEnableInterrupts (   Adapter)
Value:
{ \
NDIS_DbgPrint(MAX_TRACE, ("NICEnableInterrupts() Mask (0x%X)\n", (Adapter)->InterruptMask)); \
NdisRawWritePortUchar((Adapter)->IOBase + PG0_IMR, (Adapter)->InterruptMask); \
}
#define PG0_IMR
Definition: 8390.h:37
#define MAX_TRACE
Definition: debug.h:16

Definition at line 164 of file 8390.h.

◆ PG0_BNRY

#define PG0_BNRY   0x03 /* Boundary Pointer (R/W) */

Definition at line 16 of file 8390.h.

◆ PG0_CLDA0

#define PG0_CLDA0   0x01 /* Current Local DMA Address 0 (R) */

Definition at line 12 of file 8390.h.

◆ PG0_CLDA1

#define PG0_CLDA1   0x02 /* Current Local DMA Address 1 (R) */

Definition at line 14 of file 8390.h.

◆ PG0_CNTR0

#define PG0_CNTR0   0x0D /* Tally Counter 0 (Frame Alignment Errors) (R) */

Definition at line 32 of file 8390.h.

◆ PG0_CNTR1

#define PG0_CNTR1   0x0E /* Tally Counter 1 (CRC Errors) (R) */

Definition at line 34 of file 8390.h.

◆ PG0_CNTR2

#define PG0_CNTR2   0x0F /* Tally Counter 2 (Missed Packet Errors) (R) */

Definition at line 36 of file 8390.h.

◆ PG0_CR

#define PG0_CR   0x00 /* Command Register (R/W) */

Definition at line 11 of file 8390.h.

◆ PG0_CRDA0

#define PG0_CRDA0   0x08 /* Current Remote DMA Address 0 (R) */

Definition at line 24 of file 8390.h.

◆ PG0_CRDA1

#define PG0_CRDA1   0x09 /* Current Remote DMA Address 1 (R) */

Definition at line 26 of file 8390.h.

◆ PG0_DCR

#define PG0_DCR   0x0E /* Data Configuration Register (W) */

Definition at line 35 of file 8390.h.

◆ PG0_FIFO

#define PG0_FIFO   0x06 /* FIFO (R) */

Definition at line 21 of file 8390.h.

◆ PG0_IMR

#define PG0_IMR   0x0F /* Interrupt Mask Register (W) */

Definition at line 37 of file 8390.h.

◆ PG0_ISR

#define PG0_ISR   0x07 /* Interrupt Status Register (R/W) */

Definition at line 23 of file 8390.h.

◆ PG0_NCR

#define PG0_NCR   0x05 /* Number of Collisions Register (R) */

Definition at line 19 of file 8390.h.

◆ PG0_PSTART

#define PG0_PSTART   0x01 /* Page Start Register (W) */

Definition at line 13 of file 8390.h.

◆ PG0_PSTOP

#define PG0_PSTOP   0x02 /* Page Stop Register (W) */

Definition at line 15 of file 8390.h.

◆ PG0_RBCR0

#define PG0_RBCR0   0x0A /* Remote Byte Count Register 0 (W) */

Definition at line 28 of file 8390.h.

◆ PG0_RBCR1

#define PG0_RBCR1   0x0B /* Remote Byte Count Register 1 (W) */

Definition at line 29 of file 8390.h.

◆ PG0_RCR

#define PG0_RCR   0x0C /* Receive Configuration Register (W) */

Definition at line 31 of file 8390.h.

◆ PG0_RSAR0

#define PG0_RSAR0   0x08 /* Remote Start Address Register 0 (W) */

Definition at line 25 of file 8390.h.

◆ PG0_RSAR1

#define PG0_RSAR1   0x09 /* Remote Start Address Register 1 (W) */

Definition at line 27 of file 8390.h.

◆ PG0_RSR

#define PG0_RSR   0x0C /* Receive Status Register (R) */

Definition at line 30 of file 8390.h.

◆ PG0_TBCR0

#define PG0_TBCR0   0x05 /* Transmit Byte Count Register 0 (W) */

Definition at line 20 of file 8390.h.

◆ PG0_TBCR1

#define PG0_TBCR1   0x06 /* Transmit Byte Count Register 1 (W) */

Definition at line 22 of file 8390.h.

◆ PG0_TCR

#define PG0_TCR   0x0D /* Transmit Configuration Register (W) */

Definition at line 33 of file 8390.h.

◆ PG0_TPSR

#define PG0_TPSR   0x04 /* Transmit Page Start Register (W) */

Definition at line 18 of file 8390.h.

◆ PG0_TSR

#define PG0_TSR   0x04 /* Transmit Status Register (R) */

Definition at line 17 of file 8390.h.

◆ PG1_CR

#define PG1_CR   0x00 /* Command Register (R/W) */

Definition at line 40 of file 8390.h.

◆ PG1_CURR

#define PG1_CURR   0x07 /* Current Page Register (R/W) */

Definition at line 42 of file 8390.h.

◆ PG1_MAR

#define PG1_MAR   0x08 /* Multicast Address Registers (8 registers) (R/W) */

Definition at line 43 of file 8390.h.

◆ PG1_PAR

#define PG1_PAR   0x01 /* Physical Address Registers (6 registers) (R/W) */

Definition at line 41 of file 8390.h.

◆ PG2_AC0

#define PG2_AC0   0x07 /* Address Counter (Lower) (R/W) */

Definition at line 55 of file 8390.h.

◆ PG2_AC1

#define PG2_AC1   0x06 /* Address Counter (Upper) (R/W) */

Definition at line 54 of file 8390.h.

◆ PG2_CLDA0

#define PG2_CLDA0   0x01 /* Current Local DMA Address 0 (W) */

Definition at line 48 of file 8390.h.

◆ PG2_CLDA1

#define PG2_CLDA1   0x02 /* Current Local DMA Address 1 (W) */

Definition at line 50 of file 8390.h.

◆ PG2_CR

#define PG2_CR   0x00 /* Command Register (R/W) */

Definition at line 46 of file 8390.h.

◆ PG2_DCR

#define PG2_DCR   0x0E /* Data Configuration Register (R) */

Definition at line 58 of file 8390.h.

◆ PG2_IMR

#define PG2_IMR   0x0F /* Interrupt Mask Register (R) */

Definition at line 59 of file 8390.h.

◆ PG2_LNPP

#define PG2_LNPP   0x05 /* Local Next Packet Pointer (R/W) */

Definition at line 53 of file 8390.h.

◆ PG2_PSTART

#define PG2_PSTART   0x01 /* Page Start Register (R) */

Definition at line 47 of file 8390.h.

◆ PG2_PSTOP

#define PG2_PSTOP   0x02 /* Page Stop Register (R) */

Definition at line 49 of file 8390.h.

◆ PG2_RCR

#define PG2_RCR   0x0C /* Receive Configuration Register (R) */

Definition at line 56 of file 8390.h.

◆ PG2_RNPP

#define PG2_RNPP   0x03 /* Remote Next Packet Pointer (R/W) */

Definition at line 51 of file 8390.h.

◆ PG2_TCR

#define PG2_TCR   0x0D /* Transmit Configuration Register (R) */

Definition at line 57 of file 8390.h.

◆ PG2_TPSR

#define PG2_TPSR   0x04 /* Transmit Page Start Address (R) */

Definition at line 52 of file 8390.h.

◆ RCR_AB

#define RCR_AB   0x04 /* Accept broadcasts */

Definition at line 94 of file 8390.h.

◆ RCR_AM

#define RCR_AM   0x08 /* Accept multicast */

Definition at line 95 of file 8390.h.

◆ RCR_AR

#define RCR_AR   0x02 /* Accept runt packets */

Definition at line 93 of file 8390.h.

◆ RCR_MON

#define RCR_MON   0x20 /* Monitor mode */

Definition at line 97 of file 8390.h.

◆ RCR_PRO

#define RCR_PRO   0x10 /* Promiscuous physical addresses */

Definition at line 96 of file 8390.h.

◆ RCR_SEP

#define RCR_SEP   0x01 /* Save error packets */

Definition at line 92 of file 8390.h.

◆ RSR_CRC

#define RSR_CRC   0x02 /* CRC error */

Definition at line 101 of file 8390.h.

◆ RSR_DFR

#define RSR_DFR   0x80 /* Deferring */

Definition at line 107 of file 8390.h.

◆ RSR_DIS

#define RSR_DIS   0x40 /* Receiver disabled (monitor mode) */

Definition at line 106 of file 8390.h.

◆ RSR_FAE

#define RSR_FAE   0x04 /* Frame alignment error */

Definition at line 102 of file 8390.h.

◆ RSR_FO

#define RSR_FO   0x08 /* FIFO overrun */

Definition at line 103 of file 8390.h.

◆ RSR_MPA

#define RSR_MPA   0x10 /* Missed packet */

Definition at line 104 of file 8390.h.

◆ RSR_PHY

#define RSR_PHY   0x20 /* Physical/multicast address */

Definition at line 105 of file 8390.h.

◆ RSR_PRX

#define RSR_PRX   0x01 /* Received packet intact */

Definition at line 100 of file 8390.h.

◆ TCR_ATD

#define TCR_ATD   0x08 /* Auto transmit disable */

Definition at line 113 of file 8390.h.

◆ TCR_CRC

#define TCR_CRC   0x01 /* Inhibit CRC, do not append CRC */

Definition at line 110 of file 8390.h.

◆ TCR_LB01

#define TCR_LB01   0x06 /* Encoded loopback control */

Definition at line 112 of file 8390.h.

◆ TCR_LOOP

#define TCR_LOOP   0x02 /* Set loopback mode */

Definition at line 111 of file 8390.h.

◆ TCR_OFST

#define TCR_OFST   0x10 /* Collision offset enable */

Definition at line 114 of file 8390.h.

◆ TSR_ABT

#define TSR_ABT   0x08h /* Collided 16 times and was dropped */

Definition at line 85 of file 8390.h.

◆ TSR_CDH

#define TSR_CDH   0x40h /* Collision detect heartbeat */

Definition at line 88 of file 8390.h.

◆ TSR_COL

#define TSR_COL   0x04h /* Collided at least once */

Definition at line 84 of file 8390.h.

◆ TSR_CRS

#define TSR_CRS   0x10h /* Carrier sense lost */

Definition at line 86 of file 8390.h.

◆ TSR_FU

#define TSR_FU   0x20h /* Transmit FIFO Underrun */

Definition at line 87 of file 8390.h.

◆ TSR_OWC

#define TSR_OWC   0x80h /* Out of window collision */

Definition at line 89 of file 8390.h.

◆ TSR_PTX

#define TSR_PTX   0x01h /* Packet transmitted without error */

Definition at line 83 of file 8390.h.

Typedef Documentation

◆ DISCARD_HEADER

◆ ETH_HEADER

◆ PACKET_HEADER

◆ PDISCARD_HEADER

◆ PETH_HEADER

◆ PPACKET_HEADER

Function Documentation

◆ MiniportHandleInterrupt()

VOID NTAPI MiniportHandleInterrupt ( IN NDIS_HANDLE  MiniportAdapterContext)

Definition at line 40 of file interrupt.c.

42 {
43  ULONG InterruptPending;
44  PE1000_ADAPTER Adapter = (PE1000_ADAPTER)MiniportAdapterContext;
45  volatile PE1000_TRANSMIT_DESCRIPTOR TransmitDescriptor;
46 
47  NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
48 
49  InterruptPending = InterlockedExchange(&Adapter->InterruptPending, 0);
50 
51 
52  /* Link State Changed */
53  if (InterruptPending & E1000_IMS_LSC)
54  {
55  ULONG Status;
56 
57  InterruptPending &= ~E1000_IMS_LSC;
58  NDIS_DbgPrint(MAX_TRACE, ("Link status changed!.\n"));
59 
60  NICUpdateLinkStatus(Adapter);
61 
63 
66  }
67 
68  /* Handling receive interrupts */
69  if (InterruptPending & (E1000_IMS_RXDMT0 | E1000_IMS_RXT0))
70  {
71  volatile PE1000_RECEIVE_DESCRIPTOR ReceiveDescriptor;
72  PETH_HEADER EthHeader;
73  ULONG BufferOffset;
74  BOOLEAN bGotAny = FALSE;
75  ULONG RxDescHead, RxDescTail, CurrRxDesc;
76 
77  /* Clear out these interrupts */
78  InterruptPending &= ~(E1000_IMS_RXDMT0 | E1000_IMS_RXT0);
79 
80  E1000ReadUlong(Adapter, E1000_REG_RDH, &RxDescHead);
81  E1000ReadUlong(Adapter, E1000_REG_RDT, &RxDescTail);
82 
83  while (((RxDescTail + 1) % NUM_RECEIVE_DESCRIPTORS) != RxDescHead)
84  {
85  CurrRxDesc = (RxDescTail + 1) % NUM_RECEIVE_DESCRIPTORS;
86  BufferOffset = CurrRxDesc * Adapter->ReceiveBufferEntrySize;
87  ReceiveDescriptor = Adapter->ReceiveDescriptors + CurrRxDesc;
88 
89  /* Check if the hardware have released this descriptor (DD - Descriptor Done) */
90  if (!(ReceiveDescriptor->Status & E1000_RDESC_STATUS_DD))
91  {
92  /* No need to check descriptors after the first unfinished one */
93  break;
94  }
95 
96  /* Ignoring these flags for now */
97  ReceiveDescriptor->Status &= ~(E1000_RDESC_STATUS_IXSM | E1000_RDESC_STATUS_PIF);
98 
99  if (ReceiveDescriptor->Status != (E1000_RDESC_STATUS_EOP | E1000_RDESC_STATUS_DD))
100  {
101  NDIS_DbgPrint(MIN_TRACE, ("Unrecognized ReceiveDescriptor status flag: %u\n", ReceiveDescriptor->Status));
102  }
103 
104  if (ReceiveDescriptor->Length != 0 && ReceiveDescriptor->Address != 0)
105  {
106  EthHeader = (PETH_HEADER)(Adapter->ReceiveBuffer + BufferOffset);
107 
109  NULL,
110  (PCHAR)EthHeader,
111  sizeof(ETH_HEADER),
112  (PCHAR)(EthHeader + 1),
113  ReceiveDescriptor->Length - sizeof(ETH_HEADER),
114  ReceiveDescriptor->Length - sizeof(ETH_HEADER));
115 
116  bGotAny = TRUE;
117  }
118  else
119  {
120  NDIS_DbgPrint(MIN_TRACE, ("Got a NULL descriptor"));
121  }
122 
123  /* Give the descriptor back */
124  ReceiveDescriptor->Status = 0;
125 
126  RxDescTail = CurrRxDesc;
127  }
128 
129  if (bGotAny)
130  {
131  /* Write back new tail value */
132  E1000WriteUlong(Adapter, E1000_REG_RDT, RxDescTail);
133 
134  NDIS_DbgPrint(MAX_TRACE, ("Rx done (RDH: %u, RDT: %u)\n", RxDescHead, RxDescTail));
135 
137  }
138  }
139 
140  /* Handling transmit interrupts */
141  if (InterruptPending & (E1000_IMS_TXD_LOW | E1000_IMS_TXDW | E1000_IMS_TXQE))
142  {
143  PNDIS_PACKET AckPackets[40] = {0};
144  ULONG NumPackets = 0, i;
145 
146  /* Clear out these interrupts */
147  InterruptPending &= ~(E1000_IMS_TXD_LOW | E1000_IMS_TXDW | E1000_IMS_TXQE);
148 
149  while ((Adapter->TxFull || Adapter->LastTxDesc != Adapter->CurrentTxDesc) && NumPackets < ARRAYSIZE(AckPackets))
150  {
151  TransmitDescriptor = Adapter->TransmitDescriptors + Adapter->LastTxDesc;
152 
153  if (TransmitDescriptor->Status & E1000_TDESC_STATUS_DD)
154  {
155  if (Adapter->TransmitPackets[Adapter->LastTxDesc])
156  {
157  AckPackets[NumPackets++] = Adapter->TransmitPackets[Adapter->LastTxDesc];
158  Adapter->TransmitPackets[Adapter->LastTxDesc] = NULL;
159  TransmitDescriptor->Status = 0;
160  }
161 
162  Adapter->LastTxDesc = (Adapter->LastTxDesc + 1) % NUM_TRANSMIT_DESCRIPTORS;
163  Adapter->TxFull = FALSE;
164  }
165  else
166  {
167  break;
168  }
169  }
170 
171  if (NumPackets)
172  {
173  NDIS_DbgPrint(MAX_TRACE, ("Tx: (TDH: %u, TDT: %u)\n", Adapter->CurrentTxDesc, Adapter->LastTxDesc));
174  NDIS_DbgPrint(MAX_TRACE, ("Tx Done: %u packets to ack\n", NumPackets));
175 
176  for (i = 0; i < NumPackets; ++i)
177  {
178  NdisMSendComplete(Adapter->AdapterHandle, AckPackets[i], NDIS_STATUS_SUCCESS);
179  }
180  }
181  }
182 
183  ASSERT(InterruptPending == 0);
184 }
#define E1000_IMS_RXT0
Definition: e1000hw.h:186
signed char * PCHAR
Definition: retypes.h:7
VOID EXPORT NdisMSendComplete(IN NDIS_HANDLE MiniportAdapterHandle, IN PNDIS_PACKET Packet, IN NDIS_STATUS Status)
Definition: miniport.c:2809
#define E1000_REG_RDH
Definition: e1000hw.h:132
#define TRUE
Definition: types.h:120
VOID NTAPI E1000ReadUlong(IN PE1000_ADAPTER Adapter, IN ULONG Address, OUT PULONG Value)
Definition: hardware.c:70
NDIS_HANDLE AdapterHandle
Definition: nic.h:31
PE1000_RECEIVE_DESCRIPTOR ReceiveDescriptors
Definition: nic.h:81
volatile PUCHAR ReceiveBuffer
Definition: nic.h:85
#define NUM_RECEIVE_DESCRIPTORS
Definition: e1000hw.h:109
#define NdisMEthIndicateReceiveComplete(MiniportAdapterHandle)
Definition: ndis.h:5482
struct _E1000_ADAPTER * PE1000_ADAPTER
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define NUM_TRANSMIT_DESCRIPTORS
Definition: e1000hw.h:108
#define E1000_IMS_TXQE
Definition: e1000hw.h:183
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define E1000_REG_RDT
Definition: e1000hw.h:133
Definition: lan.h:33
#define E1000_RDESC_STATUS_EOP
Definition: e1000hw.h:61
LONG InterruptPending
Definition: nic.h:66
#define E1000_RDESC_STATUS_DD
Definition: e1000hw.h:62
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI NICUpdateLinkStatus(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:808
#define E1000_RDESC_STATUS_IXSM
Definition: e1000hw.h:60
VOID EXPORT NdisMIndicateStatusComplete(IN NDIS_HANDLE MiniportAdapterHandle)
Definition: miniport.c:1580
ULONG MediaState
Definition: nic.h:43
#define NDIS_STATUS_MEDIA_CONNECT
Definition: ndis.h:361
#define E1000_IMS_LSC
Definition: e1000hw.h:184
#define E1000_IMS_RXDMT0
Definition: e1000hw.h:185
struct _ETH_HEADER * PETH_HEADER
ULONG LastTxDesc
Definition: nic.h:76
BOOLEAN TxFull
Definition: nic.h:77
#define NdisMEthIndicateReceive(MiniportAdapterHandle, MiniportReceiveContext, HeaderBuffer, HeaderBufferSize, LookaheadBuffer, LookaheadBufferSize, PacketSize)
Definition: ndis.h:5458
PE1000_TRANSMIT_DESCRIPTOR TransmitDescriptors
Definition: nic.h:70
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
#define E1000_RDESC_STATUS_PIF
Definition: e1000hw.h:59
ULONG CurrentTxDesc
Definition: nic.h:75
ULONG ReceiveBufferEntrySize
Definition: nic.h:87
PNDIS_PACKET TransmitPackets[NUM_TRANSMIT_DESCRIPTORS]
Definition: nic.h:73
#define InterlockedExchange
Definition: armddk.h:54
Status
Definition: gdiplustypes.h:24
#define E1000_IMS_TXDW
Definition: e1000hw.h:182
#define E1000_TDESC_STATUS_DD
Definition: e1000hw.h:84
#define E1000_IMS_TXD_LOW
Definition: e1000hw.h:187
#define MAX_TRACE
Definition: debug.h:16
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
unsigned int ULONG
Definition: retypes.h:1
#define MIN_TRACE
Definition: debug.h:14
VOID NTAPI E1000WriteUlong(IN PE1000_ADAPTER Adapter, IN ULONG Address, IN ULONG Value)
Definition: hardware.c:65
VOID EXPORT NdisMIndicateStatus(IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_STATUS GeneralStatus, IN PVOID StatusBuffer, IN UINT StatusBufferSize)
Definition: miniport.c:1565
#define NDIS_STATUS_MEDIA_DISCONNECT
Definition: ndis.h:362