VirtualBox

source: vbox/trunk/include/VBox/DevPCNet.h@ 7682

Last change on this file since 7682 was 7682, checked in by vboxsync, 17 years ago

export

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1/** @file
2 * DevPCNet - Private guest interface for the PCNet device.
3 */
4
5/*
6 * Copyright (C) 2008 innotek GmbH
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.215389.xyz. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef ___VBox_DevPCNet_h
27#define ___VBox_DevPCNet_h
28
29#include <iprt/types.h>
30
31/** @defgroup grp_devpcnet AMD PCnet-PCI II / PCnet-FAST III (Am79C970A / Am79C973) Ethernet Controller Emulation.
32 * {
33 */
34
35#define PCNET_GUEST_INTERFACE_VERSION (1)
36#define PCNET_GUEST_SHARED_MEMORY_SIZE _1M
37#define PCNET_GUEST_TX_DESCRIPTOR_SIZE 16
38#define PCNET_GUEST_RX_DESCRIPTOR_SIZE 16
39#define PCNET_GUEST_MAX_TX_DESCRIPTORS 128
40#define PCNET_GUEST_MAX_RX_DESCRIPTORS 256
41#define PCNET_GUEST_NIC_BUFFER_SIZE 1536
42
43/* 256*16 + 128*16 + 256*1536 + 128*1536 = 582KB */
44
45/**
46 * The header of the PCNet shared memory (VBox specific).
47 */
48#pragma pack(1) /* paranoia */
49typedef struct
50{
51 /** The size of the shared memory.
52 * This is sizeof(PCNETGUESTSHAREDMEMORY) not PCNET_GUEST_SHARED_MEMORY_SIZE as one would expect.
53 * @todo r=bird: why not rename to cbHdr or something more descriptive? */
54 uint32_t u32Size;
55 /** Version (PCNET_GUEST_INTERFACE_VERSION). */
56 uint32_t u32Version;
57 /** Flags (See PCNET_GUEST_FLAGS_*). */
58 uint32_t fFlags;
59
60 /** @todo r=bird: You might consider aligning this on a 8(/16) byte boundrary to
61 * avoid future uint64_t issues. */
62 union
63 {
64 struct
65 {
66 /** The size (in bytes) of the transmit descriptor array. */
67 uint32_t cbTxDescriptors;
68 /** The size (in bytes) of the receive descriptor array. */
69 uint32_t cbRxDescriptors;
70 /** Offset of the transmit descriptors relative to this header.
71 * @todo r=bird: offTxDescriptors is IMO a better name. */
72 uint32_t u32OffTxDescriptors;
73 /** Offset of the receive descriptors relative to this header. */
74 uint32_t u32OffRxDescriptors;
75 /** Offset of the transmit buffers relative to this header. */
76 uint32_t u32OffTxBuffers;
77 /** Offset of the receive buffers relative to this header. */
78 uint32_t u32OffRxBuffers;
79 } V1;
80 } V;
81
82} PCNETGUESTSHAREDMEMORY;
83#pragma pack()
84/** Pointer to the PCNet shared memory header. */
85typedef PCNETGUESTSHAREDMEMORY *PPCNETGUESTSHAREDMEMORY;
86/** Const pointer to the PCNet shared memory header. */
87typedef const PCNETGUESTSHAREDMEMORY *PCPCNETGUESTSHAREDMEMORY;
88
89/** @name fFlags definitions
90 * @{
91 */
92/** Host admits existence private PCNet interface. */
93#define PCNET_GUEST_FLAGS_ADMIT_HOST RT_BIT(0)
94/** Guest admits using the private PCNet interface. */
95#define PCNET_GUEST_FLAGS_ADMIT_GUEST RT_BIT(1)
96/** @} */
97
98/** @} */
99
100#endif
101
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette