mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
b79fbe2333
The driver supports all nVidia chipset models from 2001 until 2010, starting from nForce. All NICs are compatible with x86 and amd64 devices only. Tested by Daniel Reimer on OG Xbox and by me on MCP board. CORE-15872 CORE-16216
57 lines
1.4 KiB
C
57 lines
1.4 KiB
C
/*
|
|
* PROJECT: ReactOS nVidia nForce Ethernet Controller Driver
|
|
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
|
* PURPOSE: Ethernet definitions
|
|
* COPYRIGHT: Copyright 2021-2022 Dmitry Borisov <di.sean@protonmail.com>
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <pshpack1.h>
|
|
typedef struct _ETH_HEADER
|
|
{
|
|
UCHAR Destination[ETH_LENGTH_OF_ADDRESS];
|
|
UCHAR Source[ETH_LENGTH_OF_ADDRESS];
|
|
USHORT PayloadType;
|
|
} ETH_HEADER, *PETH_HEADER;
|
|
#include <poppack.h>
|
|
|
|
#define ETH_IS_LOCALLY_ADMINISTERED(Address) \
|
|
(BOOLEAN)(((PUCHAR)(Address))[0] & ((UCHAR)0x02))
|
|
|
|
#define ETH_IS_EMPTY(Address) \
|
|
(BOOLEAN)((((PUCHAR)(Address))[0] | ((PUCHAR)(Address))[1] | ((PUCHAR)(Address))[2] | \
|
|
((PUCHAR)(Address))[3] | ((PUCHAR)(Address))[5] | ((PUCHAR)(Address))[5]) == 0)
|
|
|
|
typedef struct IPv4_HEADER
|
|
{
|
|
UCHAR VersionLength;
|
|
UCHAR Tos;
|
|
USHORT TotalLength;
|
|
USHORT Id;
|
|
USHORT Offset;
|
|
UCHAR Ttl;
|
|
UCHAR Protocol;
|
|
USHORT Checksum;
|
|
ULONG Source;
|
|
ULONG Destination;
|
|
} IPv4_HEADER, *PIPv4_HEADER;
|
|
|
|
typedef struct TCPv4_HEADER
|
|
{
|
|
USHORT SourcePort;
|
|
USHORT DestinationPort;
|
|
ULONG SequenceNumber;
|
|
ULONG AckNumber;
|
|
UCHAR DataOffset;
|
|
UCHAR Flags;
|
|
USHORT Window;
|
|
USHORT Checksum;
|
|
USHORT Urgent;
|
|
} TCPv4_HEADER, *PTCPv4_HEADER;
|
|
|
|
#define IP_HEADER_LENGTH(Header) \
|
|
(((Header)->VersionLength & 0x0F) << 2)
|
|
|
|
#define TCP_HEADER_LENGTH(Header) \
|
|
((Header->DataOffset & 0xF0) >> 2)
|