-
Notifications
You must be signed in to change notification settings - Fork 1
/
adapter.h
77 lines (61 loc) · 1.67 KB
/
adapter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#pragma once
extern "C"
{
#include "e1000_api.h"
}
#define IGB_MAX_TX_QUEUES 1
#define IGB_MAX_RX_QUEUES 4
#define IGB_MAX_INTERRUPTS 5
#define IGB_MAX_MCAST_LIST 32
#define IGB_TX_BUF_NUM 1024
#define IGB_RX_BUF_NUM 1024
#define IGB_RX_BUFFER_ALIGN 128
#define IGB_MAX_PHYS_BUF_COUNT 1
#define IGB_BUF_SIZE 2048
typedef struct _IGB_ADAPTER
{
WDFDEVICE WdfDevice;
NETADAPTER NetAdapter;
NETCONFIGURATION NetConfiguration;
WDFSPINLOCK Lock;
WDFDMAENABLER DmaEnabler;
NETPACKETQUEUE TxQueues[IGB_MAX_TX_QUEUES];
NETPACKETQUEUE RxQueues[IGB_MAX_RX_QUEUES];
PVOID MMIOAddress;
SIZE_T MMIOSize;
BUS_INTERFACE_STANDARD PciConfig;
PIGB_INTERRUPT MiscInterrupt;
PIGB_INTERRUPT Interrupts[IGB_MAX_INTERRUPTS];
UINT MsiInterrupts;
NET_PACKET_FILTER_FLAGS PacketFilterFlags;
UINT MCAddressLength;
UCHAR MCAddressList[E1000_RAR_ENTRIES * ETH_LENGTH_OF_ADDRESS];
// Configuration
//REG_SPEED_SETTING SpeedDuplex;
NET_ADAPTER_LINK_LAYER_ADDRESS PermanentAddress;
NET_ADAPTER_LINK_LAYER_ADDRESS CurrentAddress;
//BOOLEAN OverrideAddress;
//FLOW_CTRL FlowControl;
//UINT16 VlanID;
//ULONG64 MaxSpeed;
BOOLEAN TxIpHwChkSum;
BOOLEAN TxTcpHwChkSum;
BOOLEAN TxUdpHwChkSum;
BOOLEAN RxIpHwChkSum;
BOOLEAN RxTcpHwChkSum;
BOOLEAN RxUdpHwChkSum;
BOOLEAN LSOv4;
BOOLEAN LSOv6;
struct e1000_hw Hw;
} IGB_ADAPTER, *PIGB_ADAPTER;
WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(IGB_ADAPTER, IgbGetAdapterContext);
EVT_NET_ADAPTER_CREATE_TXQUEUE EvtAdapterCreateTxQueue;
EVT_NET_ADAPTER_CREATE_RXQUEUE EvtAdapterCreateRxQueue;
NTSTATUS
IgbInitializeAdapterContext(
_In_ PIGB_ADAPTER adapter,
_In_ WDFDEVICE device,
_In_ NETADAPTER netAdapter);
NTSTATUS
IgbAdapterStart(
_In_ IGB_ADAPTER* adapter);