~henrix/ubuntu/precise/open-vm-dkms/lp-1416003

« back to all changes in this revision

Viewing changes to modules/linux/vmxnet3/upt1_defs.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2008-10-23 15:32:00 UTC
  • mfrom: (1.1.2 upstream) (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20081023153200-gc1bfx89hj35c799
Tags: 2008.10.10-123053-2
* Correcting typo in dh_installinit call.
* Downgrading depends on module-assistant to recommends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*********************************************************
 
2
 * Copyright (C) 2007 VMware, Inc. All rights reserved.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License as published by the
 
6
 * Free Software Foundation version 2 and no later version.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
10
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 
11
 * for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License along
 
14
 * with this program; if not, write to the Free Software Foundation, Inc.,
 
15
 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
16
 *
 
17
 *********************************************************/
 
18
 
 
19
/* upt1_defs.h
 
20
 *
 
21
 *      Definitions for UPTv1
 
22
 */
 
23
 
 
24
#ifndef _UPT1_DEFS_H
 
25
#define _UPT1_DEFS_H
 
26
 
 
27
#define UPT1_MAX_TX_QUEUES  64
 
28
#define UPT1_MAX_RX_QUEUES  64
 
29
 
 
30
#define UPT1_MAX_INTRS  (UPT1_MAX_TX_QUEUES + UPT1_MAX_RX_QUEUES)
 
31
 
 
32
typedef
 
33
#include "vmware_pack_begin.h"
 
34
struct UPT1_RingDesc {
 
35
   uint64 basePA;    /* physical addr of the ring */
 
36
   uint16 size;      /* # of descriptors */
 
37
   uint16 prodIdx;   /* index of the descriptor the producer of the ring 
 
38
                      * will write to next */
 
39
   uint16 consIdx;   /* index of the descriptor the consumer of the ring 
 
40
                      * will read next */
 
41
   uint16 pad;
 
42
}
 
43
#include "vmware_pack_end.h"
 
44
UPT1_RingDesc;
 
45
 
 
46
typedef
 
47
#include "vmware_pack_begin.h"
 
48
struct UPT1_TxStats {
 
49
   uint64 TSOPktsTxOK;  /* TSO pkts post-segmentation */
 
50
   uint64 TSOBytesTxOK;
 
51
   uint64 ucastPktsTxOK;
 
52
   uint64 ucastBytesTxOK;
 
53
   uint64 mcastPktsTxOK;
 
54
   uint64 mcastBytesTxOK;
 
55
   uint64 bcastPktsTxOK;
 
56
   uint64 bcastBytesTxOK;
 
57
   uint64 pktsTxError;
 
58
   uint64 pktsTxDiscard;
 
59
}
 
60
#include "vmware_pack_end.h"
 
61
UPT1_TxStats;
 
62
 
 
63
typedef
 
64
#include "vmware_pack_begin.h"
 
65
struct UPT1_TxQueueState {
 
66
   UPT1_RingDesc txRing;
 
67
   UPT1_RingDesc dataRing;
 
68
   UPT1_RingDesc compRing;
 
69
   uint8         tcGen;    /* value of the TCGEN register */
 
70
   uint8         intrIdx;  /* which MSI/MSI-X vector to use for the tx queue */
 
71
   Bool          stopped;  /* is the queue stopped? */
 
72
   uint8         pad;
 
73
   uint32        error;    /* error code if the queue is stopped due to error */
 
74
   UPT1_TxStats  stats;    /* stats for the tx queue */
 
75
}
 
76
#include "vmware_pack_end.h"
 
77
UPT1_TxQueueState;
 
78
 
 
79
typedef
 
80
#include "vmware_pack_begin.h"
 
81
struct UPT1_RxStats {
 
82
   uint64 LROPktsRxOK;    /* LRO pkts */
 
83
   uint64 LROBytesRxOK;   /* bytes from LRO pkts */
 
84
   /* the following counters are for pkts from the wire, i.e., pre-LRO */
 
85
   uint64 ucastPktsRxOK;
 
86
   uint64 ucastBytesRxOK;
 
87
   uint64 mcastPktsRxOK;
 
88
   uint64 mcastBytesRxOK;
 
89
   uint64 bcastPktsRxOK;
 
90
   uint64 bcastBytesRxOK;
 
91
   uint64 pktsRxOutOfBuf;
 
92
   uint64 pktsRxError;
 
93
}
 
94
#include "vmware_pack_end.h"
 
95
UPT1_RxStats;
 
96
 
 
97
typedef
 
98
#include "vmware_pack_begin.h"
 
99
struct UPT1_RxQueueState {
 
100
   UPT1_RingDesc rxRing[2];
 
101
   UPT1_RingDesc compRing;
 
102
   uint8         rcGen;     /* value of the RCGEN register */
 
103
   uint8         intrIdx;   /* which MSI/MSI-X vector to use for the rx queue */
 
104
   Bool          stopped;   /* is the queue stopped? */
 
105
   uint8         pad;
 
106
   uint32        error;     /* error code if the queue is stopped due to error */
 
107
   UPT1_RxStats  stats;     /* stats for the rx queue */
 
108
}
 
109
#include "vmware_pack_end.h"
 
110
UPT1_RxQueueState;
 
111
 
 
112
/* physical dev intr type */
 
113
typedef enum {
 
114
   UPT1_IT_MSI = 1,
 
115
   UPT1_IT_MSIX
 
116
} UPT1_IntrType;
 
117
 
 
118
/* interrupt moderation level */
 
119
#define UPT1_IML_NONE     0 /* no interrupt moderation */
 
120
#define UPT1_IML_HIGHEST  7 /* least intr generated */
 
121
#define UPT1_IML_ADAPTIVE 8 /* adpative intr moderation */
 
122
 
 
123
typedef struct UPT1_IntrState {
 
124
   UPT1_IntrType type;
 
125
   Bool  autoMask;
 
126
   uint8 numIntrs;      /* # of MSI/MSI-X vectors allocated */
 
127
   uint8 *modLevels;    /* interrupt moderation level */
 
128
   uint8 *imr;          /* IMR register values */
 
129
} UPT1_IntrState;
 
130
 
 
131
/* values for UPT1_RSSConf.hashFunc */
 
132
#define UPT1_RSS_HASH_TYPE_NONE      0x0
 
133
#define UPT1_RSS_HASH_TYPE_IPV4      0x01
 
134
#define UPT1_RSS_HASH_TYPE_TCP_IPV4  0x02
 
135
#define UPT1_RSS_HASH_TYPE_IPV6      0x04
 
136
#define UPT1_RSS_HASH_TYPE_TCP_IPV6  0x08
 
137
 
 
138
#define UPT1_RSS_HASH_FUNC_NONE      0x0
 
139
#define UPT1_RSS_HASH_FUNC_TOEPLITZ  0x01
 
140
 
 
141
#define UPT1_RSS_MAX_KEY_SIZE        40
 
142
#define UPT1_RSS_MAX_IND_TABLE_SIZE  128
 
143
 
 
144
typedef 
 
145
#include "vmware_pack_begin.h"
 
146
struct UPT1_RSSConf {
 
147
   uint16   hashType;
 
148
   uint16   hashFunc;
 
149
   uint16   hashKeySize;
 
150
   uint16   indTableSize;
 
151
   uint8    hashKey[UPT1_RSS_MAX_KEY_SIZE];
 
152
   uint8    indTable[UPT1_RSS_MAX_IND_TABLE_SIZE];
 
153
}
 
154
#include "vmware_pack_end.h"
 
155
UPT1_RSSConf;
 
156
 
 
157
/* features */
 
158
#define UPT1_F_RXCSUM      0x0001   /* rx csum verification */
 
159
#define UPT1_F_RSS         0x0002
 
160
#define UPT1_F_RXVLAN      0x0004   /* VLAN tag stripping */
 
161
#define UPT1_F_LRO         0x0008
 
162
 
 
163
#endif