1 1.2 kamil /* $NetBSD: temacvar.h,v 1.2 2019/04/11 14:38:05 kamil Exp $ */ 2 1.1 freza 3 1.1 freza /* 4 1.1 freza * Copyright (c) 2006 Jachym Holecek 5 1.1 freza * All rights reserved. 6 1.1 freza * 7 1.1 freza * Written for "DSP&FPGA Custom Design". 8 1.1 freza * 9 1.1 freza * Redistribution and use in source and binary forms, with or without 10 1.1 freza * modification, are permitted provided that the following conditions 11 1.1 freza * are met: 12 1.1 freza * 13 1.1 freza * 1. Redistributions of source code must retain the above copyright 14 1.1 freza * notice, this list of conditions and the following disclaimer. 15 1.1 freza * 16 1.1 freza * 2. Redistributions in binary form must reproduce the above copyright 17 1.1 freza * notice, this list of conditions and the following disclaimer in the 18 1.1 freza * documentation and/or other materials provided with the distribution. 19 1.1 freza * 20 1.1 freza * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 1.1 freza * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 1.1 freza * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 1.1 freza * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 1.1 freza * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 1.1 freza * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 1.1 freza * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 1.1 freza * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 1.1 freza * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 1.1 freza * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 1.1 freza */ 31 1.1 freza 32 1.1 freza #ifndef _VIRTEX_DEV_TEMACVAR_H_ 33 1.1 freza #define _VIRTEX_DEV_TEMACVAR_H_ 34 1.1 freza 35 1.1 freza /* TEMAC specific fields in Rx CDMAC descriptor. */ 36 1.1 freza #define desc_rxstat desc_user3 37 1.1 freza #define RXSTAT_GOOD 0x80000000 /* Good frame */ 38 1.1 freza #define RXSTAT_BAD 0x40000000 /* Bad frame */ 39 1.1 freza #define RXSTAT_FLOW 0x20000000 /* Flow control frame */ 40 1.1 freza #define RXSTAT_VLAN 0x10000000 /* Contains VLAN tag */ 41 1.1 freza #define RXSTAT_BADCRC 0x08000000 /* Failed FCS validation */ 42 1.1 freza #define RXSTAT_TRUNC 0x04000000 /* Truncated, FIFO overflow */ 43 1.1 freza #define RXSTAT_RAWCSUM_MASK 0x0000ffff /* Precalculated raw csum */ 44 1.1 freza 45 1.1 freza #define RXSTAT_SICK (RXSTAT_BAD | RXSTAT_FLOW | RXSTAT_BADCRC | \ 46 1.1 freza RXSTAT_TRUNC) 47 1.1 freza 48 1.1 freza #define desc_rxsize desc_user4 49 1.1 freza #define RXSIZE_MASK 0x0000ffff /* Length of frame in bytes */ 50 1.1 freza 51 1.1 freza /* TEMAC specific fields in Tx CDMAC descriptor. */ 52 1.1 freza #define desc_txcon desc_user0 /* Careful: overlayed w/ stat */ 53 1.1 freza #define TXCON_TCP 0x0002 /* TCP segment, UDP otherwise */ 54 1.1 freza #define TXCON_CSUM 0x0001 /* Calculate checksum in hw */ 55 1.1 freza 56 1.1 freza #define desc_txcsum desc_user1 57 1.1 freza #define CSUM_INSERT_MASK 0x003ff /* Offset where to insert cs */ 58 1.1 freza #define CSUM_START_MASK 0x003ff /* Offset where calc starts */ 59 1.1 freza #define CSUM_START_OFFS 16 60 1.1 freza 61 1.1 freza #define desc_txcsumini desc_user2 /* Initial value for cs calc */ 62 1.1 freza #define CSUMINI_MASK 0xffff 63 1.1 freza 64 1.1 freza #endif /* _VIRTEX_DEV_TEMACVAR_H_ */ 65