Go to the documentation of this file.
27 #ifndef _VMXNET3_DEFS_H_
28 #define _VMXNET3_DEFS_H_
54 #define VMXNET3_PT_REG_SIZE 4096
55 #define VMXNET3_VD_REG_SIZE 4096
57 #define VMXNET3_REG_ALIGN 8
58 #define VMXNET3_REG_ALIGN_MASK 0x7
61 #define VMXNET3_IO_TYPE_PT 0
62 #define VMXNET3_IO_TYPE_VD 1
63 #define VMXNET3_IO_ADDR(type, reg) (((type) << 24) | ((reg) & 0xFFFFFF))
64 #define VMXNET3_IO_TYPE(addr) ((addr) >> 24)
65 #define VMXNET3_IO_REG(addr) ((addr) & 0xFFFFFF)
114 #ifdef __BIG_ENDIAN_BITFIELD
130 #ifdef __BIG_ENDIAN_BITFIELD
150 #define VMXNET3_OM_NONE 0
151 #define VMXNET3_OM_CSUM 2
152 #define VMXNET3_OM_TSO 3
155 #define VMXNET3_TXD_EOP_SHIFT 12
156 #define VMXNET3_TXD_CQ_SHIFT 13
157 #define VMXNET3_TXD_GEN_SHIFT 14
158 #define VMXNET3_TXD_EOP_DWORD_SHIFT 3
159 #define VMXNET3_TXD_GEN_DWORD_SHIFT 2
161 #define VMXNET3_TXD_CQ (1 << VMXNET3_TXD_CQ_SHIFT)
162 #define VMXNET3_TXD_EOP (1 << VMXNET3_TXD_EOP_SHIFT)
163 #define VMXNET3_TXD_GEN (1 << VMXNET3_TXD_GEN_SHIFT)
165 #define VMXNET3_HDR_COPY_SIZE 128
172 #define VMXNET3_TCD_GEN_SHIFT 31
173 #define VMXNET3_TCD_GEN_SIZE 1
174 #define VMXNET3_TCD_TXIDX_SHIFT 0
175 #define VMXNET3_TCD_TXIDX_SIZE 12
176 #define VMXNET3_TCD_GEN_DWORD_SHIFT 3
193 #ifdef __BIG_ENDIAN_BITFIELD
210 #define VMXNET3_RXD_BTYPE_HEAD 0
211 #define VMXNET3_RXD_BTYPE_BODY 1
214 #define VMXNET3_RXD_BTYPE_SHIFT 14
215 #define VMXNET3_RXD_GEN_SHIFT 31
218 #ifdef __BIG_ENDIAN_BITFIELD
240 #ifdef __BIG_ENDIAN_BITFIELD
253 #ifdef __BIG_ENDIAN_BITFIELD
281 #define VMXNET3_RCD_TUC_SHIFT 16
282 #define VMXNET3_RCD_IPC_SHIFT 19
285 #define VMXNET3_RCD_TYPE_SHIFT 56
286 #define VMXNET3_RCD_GEN_SHIFT 63
289 #define VMXNET3_RCD_CSUM_OK (1 << VMXNET3_RCD_TUC_SHIFT | \
290 1 << VMXNET3_RCD_IPC_SHIFT)
291 #define VMXNET3_TXD_GEN_SIZE 1
292 #define VMXNET3_TXD_EOP_SIZE 1
315 #define VMXNET3_INIT_GEN 1
318 #define VMXNET3_MAX_TX_BUF_SIZE (1 << 14)
321 #define VMXNET3_TXD_NEEDED(size) (((size) + VMXNET3_MAX_TX_BUF_SIZE - 1) / \
322 VMXNET3_MAX_TX_BUF_SIZE)
325 #define VMXNET3_MAX_TXD_PER_PKT 16
328 #define VMXNET3_MAX_RX_BUF_SIZE ((1 << 14) - 1)
330 #define VMXNET3_MIN_T0_BUF_SIZE 128
331 #define VMXNET3_MAX_CSUM_OFFSET 1024
334 #define VMXNET3_RING_BA_ALIGN 512
335 #define VMXNET3_RING_BA_MASK (VMXNET3_RING_BA_ALIGN - 1)
338 #define VMXNET3_RING_SIZE_ALIGN 32
339 #define VMXNET3_RING_SIZE_MASK (VMXNET3_RING_SIZE_ALIGN - 1)
342 #define VMXNET3_TX_RING_MAX_SIZE 4096
343 #define VMXNET3_TC_RING_MAX_SIZE 4096
344 #define VMXNET3_RX_RING_MAX_SIZE 4096
345 #define VMXNET3_RC_RING_MAX_SIZE 8192
361 #define VMXNET3_CDTYPE_TXCOMP 0
362 #define VMXNET3_CDTYPE_RXCOMP 3
370 #define VMXNET3_GOS_TYPE_LINUX 1
374 #ifdef __BIG_ENDIAN_BITFIELD
395 #define VMXNET3_REV1_MAGIC 0xbabefee1
403 #define VMXNET3_QUEUE_DESC_ALIGN 128
462 #define VMXNET3_MAX_TX_QUEUES 8
463 #define VMXNET3_MAX_RX_QUEUES 16
465 #define VMXNET3_MAX_INTRS 25
468 #define VMXNET3_IC_DISABLE_ALL 0x1
482 #define VMXNET3_VFT_SIZE (4096 / (sizeof(u32) * 8))
522 #define VMXNET3_PM_MAX_FILTERS 6
523 #define VMXNET3_PM_MAX_PATTERN_SIZE 128
524 #define VMXNET3_PM_MAX_MASK_SIZE (VMXNET3_PM_MAX_PATTERN_SIZE / 8)
526 #define VMXNET3_PM_WAKEUP_MAGIC cpu_to_le16(0x01)
527 #define VMXNET3_PM_WAKEUP_FILTER cpu_to_le16(0x02)
597 #define VMXNET3_ECR_RQERR (1 << 0)
598 #define VMXNET3_ECR_TQERR (1 << 1)
599 #define VMXNET3_ECR_LINK (1 << 2)
600 #define VMXNET3_ECR_DIC (1 << 3)
601 #define VMXNET3_ECR_DEBUG (1 << 4)
604 #define VMXNET3_FLIP_RING_GEN(gen) ((gen) = (gen) ^ 0x1)
607 #define VMXNET3_INC_RING_IDX_ONLY(idx, ring_size) \
610 if (unlikely((idx) == (ring_size))) {\
615 #define VMXNET3_SET_VFTABLE_ENTRY(vfTable, vid) \
616 (vfTable[vid >> 5] |= (1 << (vid & 31)))
617 #define VMXNET3_CLEAR_VFTABLE_ENTRY(vfTable, vid) \
618 (vfTable[vid >> 5] &= ~(1 << (vid & 31)))
620 #define VMXNET3_VFTABLE_ENTRY_IS_SET(vfTable, vid) \
621 ((vfTable[vid >> 5] & (1 << (vid & 31))) != 0)
623 #define VMXNET3_MAX_MTU 9000
624 #define VMXNET3_MIN_MTU 60
626 #define VMXNET3_LINK_UP (10000 << 16 | 1)
627 #define VMXNET3_LINK_DOWN 0