13859Sml29623 /* 23859Sml29623 * CDDL HEADER START 33859Sml29623 * 43859Sml29623 * The contents of this file are subject to the terms of the 53859Sml29623 * Common Development and Distribution License (the "License"). 63859Sml29623 * You may not use this file except in compliance with the License. 73859Sml29623 * 83859Sml29623 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 93859Sml29623 * or http://www.opensolaris.org/os/licensing. 103859Sml29623 * See the License for the specific language governing permissions 113859Sml29623 * and limitations under the License. 123859Sml29623 * 133859Sml29623 * When distributing Covered Code, include this CDDL HEADER in each 143859Sml29623 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 153859Sml29623 * If applicable, add the following below this CDDL HEADER, with the 163859Sml29623 * fields enclosed by brackets "[]" replaced with your own identifying 173859Sml29623 * information: Portions Copyright [yyyy] [name of copyright owner] 183859Sml29623 * 193859Sml29623 * CDDL HEADER END 203859Sml29623 */ 213859Sml29623 /* 22*5770Sml29623 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 233859Sml29623 * Use is subject to license terms. 243859Sml29623 */ 253859Sml29623 263859Sml29623 #ifndef _SYS_NXGE_NXGE_DEFS_H 273859Sml29623 #define _SYS_NXGE_NXGE_DEFS_H 283859Sml29623 293859Sml29623 #pragma ident "%Z%%M% %I% %E% SMI" 303859Sml29623 313859Sml29623 #ifdef __cplusplus 323859Sml29623 extern "C" { 333859Sml29623 #endif 343859Sml29623 353859Sml29623 /* 363859Sml29623 * Block Address Assignment (24-bit base address) 373859Sml29623 * (bits [23:20]: block [19]: set to 1 for FZC ) 383859Sml29623 */ 393859Sml29623 #define PIO 0x000000 403859Sml29623 #define FZC_PIO 0x080000 413859Sml29623 #define RESERVED_1 0x100000 423859Sml29623 #define FZC_MAC 0x180000 433859Sml29623 #define RESERVED_2 0x200000 443859Sml29623 #define FZC_IPP 0x280000 453859Sml29623 #define FFLP 0x300000 463859Sml29623 #define FZC_FFLP 0x380000 473859Sml29623 #define PIO_VADDR 0x400000 483859Sml29623 #define RESERVED_3 0x480000 493859Sml29623 #define ZCP 0x500000 503859Sml29623 #define FZC_ZCP 0x580000 513859Sml29623 #define DMC 0x600000 523859Sml29623 #define FZC_DMC 0x680000 533859Sml29623 #define TXC 0x700000 543859Sml29623 #define FZC_TXC 0x780000 553859Sml29623 #define PIO_LDSV 0x800000 563859Sml29623 #define RESERVED_4 0x880000 573859Sml29623 #define PIO_LDGIM 0x900000 583859Sml29623 #define RESERVED_5 0x980000 593859Sml29623 #define PIO_IMASK0 0xa00000 603859Sml29623 #define RESERVED_6 0xa80000 613859Sml29623 #define PIO_IMASK1 0xb00000 623859Sml29623 #define RESERVED_7_START 0xb80000 633859Sml29623 #define RESERVED_7_END 0xc00000 643859Sml29623 #define FZC_PROM 0xc80000 653859Sml29623 #define RESERVED_8 0xd00000 663859Sml29623 #define FZC_PIM 0xd80000 673859Sml29623 #define RESERVED_9_START 0xe00000 683859Sml29623 #define RESERVED_9_END 0xf80000 693859Sml29623 703859Sml29623 /* PIO (0x000000) */ 713859Sml29623 723859Sml29623 733859Sml29623 /* FZC_PIO (0x080000) */ 743859Sml29623 #define LDGITMRES (FZC_PIO + 0x00008) /* timer resolution */ 753859Sml29623 #define SID (FZC_PIO + 0x10200) /* 64 LDG, INT data */ 763859Sml29623 #define LDG_NUM (FZC_PIO + 0x20000) /* 69 LDs */ 773859Sml29623 783859Sml29623 793859Sml29623 803859Sml29623 /* FZC_IPP (0x280000) */ 813859Sml29623 823859Sml29623 833859Sml29623 /* FFLP (0x300000), Header Parser */ 843859Sml29623 853859Sml29623 /* PIO_VADDR (0x400000), PIO Virtaul DMA Address */ 863859Sml29623 /* ?? how to access DMA via PIO_VADDR? */ 873859Sml29623 #define VADDR (PIO_VADDR + 0x00000) /* ?? not for driver */ 883859Sml29623 893859Sml29623 903859Sml29623 /* ZCP (0x500000), Neptune Only */ 913859Sml29623 923859Sml29623 933859Sml29623 /* FZC_ZCP (0x580000), Neptune Only */ 943859Sml29623 953859Sml29623 963859Sml29623 /* DMC (0x600000), register offset (32 DMA channels) */ 973859Sml29623 983859Sml29623 /* Transmit Ring Register Offset (32 Channels) */ 993859Sml29623 #define TX_RNG_CFIG (DMC + 0x40000) 1003859Sml29623 #define TX_RING_HDH (DMC + 0x40008) 1013859Sml29623 #define TX_RING_HDL (DMC + 0x40010) 1023859Sml29623 #define TX_RING_KICK (DMC + 0x40018) 1033859Sml29623 /* Transmit Operations (32 Channels) */ 1043859Sml29623 #define TX_ENT_MSK (DMC + 0x40020) 1053859Sml29623 #define TX_CS (DMC + 0x40028) 1063859Sml29623 #define TXDMA_MBH (DMC + 0x40030) 1073859Sml29623 #define TXDMA_MBL (DMC + 0x40038) 1083859Sml29623 #define TX_DMA_PRE_ST (DMC + 0x40040) 1093859Sml29623 #define TX_RNG_ERR_LOGH (DMC + 0x40048) 1103859Sml29623 #define TX_RNG_ERR_LOGL (DMC + 0x40050) 1113859Sml29623 #if OLD 1123859Sml29623 #define SH_TX_RNG_ERR_LOGH (DMC + 0x40058) 1133859Sml29623 #define SH_TX_RNG_ERR_LOGL (DMC + 0x40060) 1143859Sml29623 #endif 1153859Sml29623 1163859Sml29623 /* FZC_DMC RED Initial Random Value register offset (global) */ 1173859Sml29623 #define RED_RAN_INIT (FZC_DMC + 0x00068) 1183859Sml29623 1193859Sml29623 #define RX_ADDR_MD (FZC_DMC + 0x00070) 1203859Sml29623 1213859Sml29623 /* FZC_DMC Ethernet Timeout Countue register offset (global) */ 1223859Sml29623 #define EING_TIMEOUT (FZC_DMC + 0x00078) 1233859Sml29623 1243859Sml29623 /* RDC Table */ 1253859Sml29623 #define RDC_TBL (FZC_DMC + 0x10000) /* 256 * 8 */ 1263859Sml29623 1273859Sml29623 /* FZC_DMC partitioning support register offset (32 channels) */ 1283859Sml29623 1293859Sml29623 #define TX_LOG_PAGE_VLD (FZC_DMC + 0x40000) 1303859Sml29623 #define TX_LOG_MASK1 (FZC_DMC + 0x40008) 1313859Sml29623 #define TX_LOG_VAL1 (FZC_DMC + 0x40010) 1323859Sml29623 #define TX_LOG_MASK2 (FZC_DMC + 0x40018) 1333859Sml29623 #define TX_LOG_VAL2 (FZC_DMC + 0x40020) 1343859Sml29623 #define TX_LOG_PAGE_RELO1 (FZC_DMC + 0x40028) 1353859Sml29623 #define TX_LOG_PAGE_RELO2 (FZC_DMC + 0x40030) 1363859Sml29623 #define TX_LOG_PAGE_HDL (FZC_DMC + 0x40038) 1373859Sml29623 1383859Sml29623 #define TX_ADDR_MOD (FZC_DMC + 0x41000) /* only one? */ 1393859Sml29623 1403859Sml29623 1413859Sml29623 /* FZC_DMC RED Parameters register offset (32 channels) */ 1423859Sml29623 #define RDC_RED_PARA1 (FZC_DMC + 0x30000) 1433859Sml29623 #define RDC_RED_PARA2 (FZC_DMC + 0x30008) 1443859Sml29623 /* FZC_DMC RED Discard Cound Register offset (32 channels) */ 1453859Sml29623 #define RED_DIS_CNT (FZC_DMC + 0x30010) 1463859Sml29623 1473859Sml29623 #if OLD /* This has been moved to TXC */ 1483859Sml29623 /* Transmit Ring Scheduler (per port) */ 1493859Sml29623 #define TX_DMA_MAP0 (FZC_DMC + 0x50000) 1503859Sml29623 #define TX_DMA_MAP1 (FZC_DMC + 0x50008) 1513859Sml29623 #define TX_DMA_MAP2 (FZC_DMC + 0x50010) 1523859Sml29623 #define TX_DMA_MAP3 (FZC_DMC + 0x50018) 1533859Sml29623 #endif 1543859Sml29623 1553859Sml29623 /* Transmit Ring Scheduler: DRR Weight (32 Channels) */ 1563859Sml29623 #define DRR_WT (FZC_DMC + 0x51000) 1573859Sml29623 #if OLD 1583859Sml29623 #define TXRNG_USE (FZC_DMC + 0x51008) 1593859Sml29623 #endif 1603859Sml29623 1613859Sml29623 /* TXC (0x700000)?? */ 1623859Sml29623 1633859Sml29623 1643859Sml29623 /* FZC_TXC (0x780000)?? */ 1653859Sml29623 1663859Sml29623 1673859Sml29623 /* 1683859Sml29623 * PIO_LDSV (0x800000) 1693859Sml29623 * Logical Device State Vector 0, 1, 2. 1703859Sml29623 * (69 logical devices, 8192 apart, partitioning control) 1713859Sml29623 */ 1723859Sml29623 #define LDSV0 (PIO_LDSV + 0x00000) /* RO (64 - 69) */ 1733859Sml29623 #define LDSV1 (PIO_LDSV + 0x00008) /* RO (32 - 63) */ 1743859Sml29623 #define LDSV2 (PIO_LDSV + 0x00010) /* RO ( 0 - 31) */ 1753859Sml29623 1763859Sml29623 /* 1773859Sml29623 * PIO_LDGIM (0x900000) 1783859Sml29623 * Logical Device Group Interrupt Management (64 groups). 1793859Sml29623 * (count 64, step 8192) 1803859Sml29623 */ 1813859Sml29623 #define LDGIMGN (PIO_LDGIMGN + 0x00000) /* RW */ 1823859Sml29623 1833859Sml29623 /* 1843859Sml29623 * PIO_IMASK0 (0xA000000) 1853859Sml29623 * 1863859Sml29623 * Logical Device Masks 0, 1. 1873859Sml29623 * (64 logical devices, 8192 apart, partitioning control) 1883859Sml29623 */ 1893859Sml29623 #define LD_IM0 (PIO_IMASK0 + 0x00000) /* RW ( 0 - 63) */ 1903859Sml29623 1913859Sml29623 /* 1923859Sml29623 * PIO_IMASK0 (0xB000000) 1933859Sml29623 * 1943859Sml29623 * Logical Device Masks 0, 1. 1953859Sml29623 * (5 logical devices, 8192 apart, partitioning control) 1963859Sml29623 */ 1973859Sml29623 #define LD_IM1 (PIO_IMASK1 + 0x00000) /* RW (64 - 69) */ 1983859Sml29623 1993859Sml29623 2003859Sml29623 /* DMC/TMC CSR size */ 2013859Sml29623 #define DMA_CSR_SIZE 512 2023859Sml29623 #define DMA_CSR_MIN_PAGE_SIZE 1024 2033859Sml29623 2043859Sml29623 /* 2053859Sml29623 * Define the Default RBR, RCR 2063859Sml29623 */ 207*5770Sml29623 #define RBR_DEFAULT_MAX_BLKS 8192 /* each entry (16 blockaddr/64B) */ 2083859Sml29623 #define RBR_NBLK_PER_LINE 16 /* 16 block addresses per 64 B line */ 2093859Sml29623 #define RBR_DEFAULT_MAX_LEN (RBR_DEFAULT_MAX_BLKS) 2103859Sml29623 #define RBR_DEFAULT_MIN_LEN 1 211*5770Sml29623 #define RCR_DEFAULT_MAX 8192 2123859Sml29623 2133859Sml29623 #define SW_OFFSET_NO_OFFSET 0 2143859Sml29623 #define SW_OFFSET_64 1 /* 64 bytes */ 2153859Sml29623 #define SW_OFFSET_128 2 /* 128 bytes */ 2163859Sml29623 #define SW_OFFSET_INVALID 3 2173859Sml29623 218*5770Sml29623 #define TDC_DEFAULT_MAX 8192 2193859Sml29623 /* 2203859Sml29623 * RBR block descriptor is 32 bits (bits [43:12] 2213859Sml29623 */ 2223859Sml29623 #define RBR_BKADDR_SHIFT 12 2233859Sml29623 2243859Sml29623 2253859Sml29623 #define RCR_DEFAULT_MAX_BLKS 4096 /* each entry (8 blockaddr/64B) */ 2263859Sml29623 #define RCR_NBLK_PER_LINE 8 /* 8 block addresses per 64 B line */ 2273859Sml29623 #define RCR_DEFAULT_MAX_LEN (RCR_DEFAULT_MAX_BLKS) 2283859Sml29623 #define RCR_DEFAULT_MIN_LEN 1 2293859Sml29623 2303859Sml29623 /* DMA Channels. */ 2313859Sml29623 #define NXGE_MAX_DMCS (NXGE_MAX_RDCS + NXGE_MAX_TDCS) 2323859Sml29623 #define NXGE_MAX_RDCS 16 2333859Sml29623 #define NXGE_MAX_TDCS 24 2343859Sml29623 #define NXGE_MAX_TDCS_NIU 16 2353859Sml29623 /* 2363859Sml29623 * original mapping from Hypervisor 2373859Sml29623 */ 2383859Sml29623 #ifdef ORIGINAL 2393859Sml29623 #define NXGE_N2_RXDMA_START_LDG 0 2403859Sml29623 #define NXGE_N2_TXDMA_START_LDG 16 2413859Sml29623 #define NXGE_N2_MIF_LDG 32 2423859Sml29623 #define NXGE_N2_MAC_0_LDG 33 2433859Sml29623 #define NXGE_N2_MAC_1_LDG 34 2443859Sml29623 #define NXGE_N2_SYS_ERROR_LDG 35 2453859Sml29623 #endif 2463859Sml29623 2473859Sml29623 #define NXGE_N2_RXDMA_START_LDG 19 2483859Sml29623 #define NXGE_N2_TXDMA_START_LDG 27 2493859Sml29623 #define NXGE_N2_MIF_LDG 17 2503859Sml29623 #define NXGE_N2_MAC_0_LDG 16 2513859Sml29623 #define NXGE_N2_MAC_1_LDG 35 2523859Sml29623 #define NXGE_N2_SYS_ERROR_LDG 18 2533859Sml29623 #define NXGE_N2_LDG_GAP 17 2543859Sml29623 2553859Sml29623 #define NXGE_MAX_RDC_GRPS 8 2563859Sml29623 2573859Sml29623 /* 2583859Sml29623 * Max. ports per Neptune and NIU 2593859Sml29623 */ 2603859Sml29623 #define NXGE_MAX_PORTS 4 2613859Sml29623 #define NXGE_PORTS_NEPTUNE 4 2623859Sml29623 #define NXGE_PORTS_NIU 2 2633859Sml29623 2643859Sml29623 /* Max. RDC table groups */ 2653859Sml29623 #define NXGE_MAX_RDC_GROUPS 8 2663859Sml29623 #define NXGE_MAX_RDCS 16 2673859Sml29623 #define NXGE_MAX_DMAS 32 2683859Sml29623 2693859Sml29623 2703859Sml29623 #define NXGE_MAX_MACS_XMACS 16 2713859Sml29623 #define NXGE_MAX_MACS_BMACS 8 2723859Sml29623 #define NXGE_MAX_MACS (NXGE_MAX_PORTS * NXGE_MAX_MACS_XMACS) 2733859Sml29623 2743859Sml29623 #define NXGE_MAX_VLANS 4096 2753859Sml29623 #define VLAN_ETHERTYPE (0x8100) 2763859Sml29623 2773859Sml29623 2783859Sml29623 /* Scaling factor for RBR (receive block ring) */ 2793859Sml29623 #define RBR_SCALE_1 0 2803859Sml29623 #define RBR_SCALE_2 1 2813859Sml29623 #define RBR_SCALE_3 2 2823859Sml29623 #define RBR_SCALE_4 3 2833859Sml29623 #define RBR_SCALE_5 4 2843859Sml29623 #define RBR_SCALE_6 5 2853859Sml29623 #define RBR_SCALE_7 6 2863859Sml29623 #define RBR_SCALE_8 7 2873859Sml29623 2883859Sml29623 2893859Sml29623 #define MAX_PORTS_PER_NXGE 4 2903859Sml29623 #define MAX_MACS 32 2913859Sml29623 2923859Sml29623 #define TX_GATHER_POINTER_SZ 8 2933859Sml29623 #define TX_GP_PER_BLOCK 8 2943859Sml29623 #define TX_DEFAULT_MAX_GPS 1024 /* Max. # of gather pointers */ 2953859Sml29623 #define TX_DEFAULT_JUMBO_MAX_GPS 4096 /* Max. # of gather pointers */ 2963859Sml29623 #define TX_DEFAULT_MAX_LEN (TX_DEFAULT_MAX_GPS/TX_GP_PER_BLOCK) 2973859Sml29623 #define TX_DEFAULT_JUMBO_MAX_LEN (TX_DEFAULT_JUMBO_MAX_GPS/TX_GP_PER_BLOCK) 2983859Sml29623 2993859Sml29623 #define TX_RING_THRESHOLD (TX_DEFAULT_MAX_GPS/4) 3003859Sml29623 #define TX_RING_JUMBO_THRESHOLD (TX_DEFAULT_JUMBO_MAX_GPS/4) 3013859Sml29623 3023859Sml29623 #define TRANSMIT_HEADER_SIZE 16 /* 16 B frame header */ 3033859Sml29623 3043859Sml29623 #define TX_DESC_SAD_SHIFT 0 3053859Sml29623 #define TX_DESC_SAD_MASK 0x00000FFFFFFFFFFFULL /* start address */ 3063859Sml29623 #define TX_DESC_TR_LEN_SHIFT 44 3073859Sml29623 #define TX_DESC_TR_LEN_MASK 0x00FFF00000000000ULL /* Transfer Length */ 3083859Sml29623 #define TX_DESC_NUM_PTR_SHIFT 58 3093859Sml29623 #define TX_DESC_NUM_PTR_MASK 0x2C00000000000000ULL /* gather pointers */ 3103859Sml29623 #define TX_DESC_MASK_SHIFT 62 3113859Sml29623 #define TX_DESC_MASK_MASK 0x4000000000000000ULL /* Mark bit */ 3123859Sml29623 #define TX_DESC_SOP_SHIF 63 3133859Sml29623 #define TX_DESC_NUM_MASK 0x8000000000000000ULL /* Start of packet */ 3143859Sml29623 3153859Sml29623 #define TCAM_FLOW_KEY_MAX_CLASS 12 3163859Sml29623 #define TCAM_L3_MAX_USER_CLASS 4 3173859Sml29623 #define TCAM_NIU_TCAM_MAX_ENTRY 128 3183859Sml29623 #define TCAM_NXGE_TCAM_MAX_ENTRY 256 3193859Sml29623 3203859Sml29623 3213859Sml29623 3223859Sml29623 /* TCAM entry formats */ 3233859Sml29623 #define TCAM_IPV4_5TUPLE_FORMAT 0x00 3243859Sml29623 #define TCAM_IPV6_5TUPLE_FORMAT 0x01 3253859Sml29623 #define TCAM_ETHERTYPE_FORMAT 0x02 3263859Sml29623 3273859Sml29623 3283859Sml29623 /* TCAM */ 3293859Sml29623 #define TCAM_SELECT_IPV6 0x01 3303859Sml29623 #define TCAM_LOOKUP 0x04 3313859Sml29623 #define TCAM_DISCARD 0x08 3323859Sml29623 3333859Sml29623 /* FLOW Key */ 3343859Sml29623 #define FLOW_L4_1_34_BYTES 0x10 3353859Sml29623 #define FLOW_L4_1_78_BYTES 0x11 3363859Sml29623 #define FLOW_L4_0_12_BYTES (0x10 << 2) 3373859Sml29623 #define FLOW_L4_0_56_BYTES (0x11 << 2) 3383859Sml29623 #define FLOW_PROTO_NEXT 0x10 3393859Sml29623 #define FLOW_IPDA 0x20 3403859Sml29623 #define FLOW_IPSA 0x40 3413859Sml29623 #define FLOW_VLAN 0x80 3423859Sml29623 #define FLOW_L2DA 0x100 3433859Sml29623 #define FLOW_PORT 0x200 3443859Sml29623 3453859Sml29623 /* TCAM */ 3463859Sml29623 #define MAX_EFRAME 11 3473859Sml29623 3483859Sml29623 #define TCAM_USE_L2RDC_FLOW_LOOKUP 0x00 3493859Sml29623 #define TCAM_USE_OFFSET_DONE 0x01 3503859Sml29623 #define TCAM_OVERRIDE_L2_FLOW_LOOKUP 0x02 3513859Sml29623 #define TCAM_OVERRIDE_L2_USE_OFFSET 0x03 3523859Sml29623 3533859Sml29623 /* 3543859Sml29623 * FCRAM (Hashing): 3553859Sml29623 * 1. IPv4 exact match 3563859Sml29623 * 2. IPv6 exact match 3573859Sml29623 * 3. IPv4 Optimistic match 3583859Sml29623 * 4. IPv6 Optimistic match 3593859Sml29623 * 3603859Sml29623 */ 3613859Sml29623 #define FCRAM_IPV4_EXT_MATCH 0x00 3623859Sml29623 #define FCRAM_IPV6_EXT_MATCH 0x01 3633859Sml29623 #define FCRAM_IPV4_OPTI_MATCH 0x02 3643859Sml29623 #define FCRAM_IPV6_OPTI_MATCH 0x03 3653859Sml29623 3663859Sml29623 3673859Sml29623 #define NXGE_HASH_MAX_ENTRY 256 3683859Sml29623 3693859Sml29623 3703859Sml29623 #define MAC_ADDR_LENGTH 6 3713859Sml29623 3723859Sml29623 /* convert values */ 3733859Sml29623 #define NXGE_BASE(x, y) (((y) << (x ## _SHIFT)) & (x ## _MASK)) 3743859Sml29623 #define NXGE_VAL(x, y) (((y) & (x ## _MASK)) >> (x ## _SHIFT)) 3753859Sml29623 3763859Sml29623 /* 3773859Sml29623 * Locate the DMA channel start offset (PIO_VADDR) 3783859Sml29623 * (DMA virtual address space of the PIO block) 3793859Sml29623 */ 3803859Sml29623 #define TDMC_PIOVADDR_OFFSET(channel) (2 * DMA_CSR_SIZE * channel) 3813859Sml29623 #define RDMC_PIOVADDR_OFFSET(channel) (TDMC_OFFSET(channel) + DMA_CSR_SIZE) 3823859Sml29623 3833859Sml29623 /* 3843859Sml29623 * PIO access using the DMC block directly (DMC) 3853859Sml29623 */ 3863859Sml29623 #define DMC_OFFSET(channel) (DMA_CSR_SIZE * channel) 3873859Sml29623 #define TDMC_OFFSET(channel) (TX_RNG_CFIG + DMA_CSR_SIZE * channel) 3883859Sml29623 3893859Sml29623 /* 3903859Sml29623 * Number of logical pages. 3913859Sml29623 */ 3923859Sml29623 #define NXGE_MAX_LOGICAL_PAGES 2 3933859Sml29623 3943859Sml29623 #ifdef SOLARIS 3953859Sml29623 #ifndef i386 3963859Sml29623 #define _BIT_FIELDS_BIG_ENDIAN _BIT_FIELDS_HTOL 3973859Sml29623 #else 3983859Sml29623 #define _BIT_FIELDS_LITTLE_ENDIAN _BIT_FIELDS_LTOH 3993859Sml29623 #endif 4003859Sml29623 #else 4013859Sml29623 #define _BIT_FIELDS_LITTLE_ENDIAN _LITTLE_ENDIAN_BITFIELD 4023859Sml29623 #endif 4033859Sml29623 4043859Sml29623 #ifdef COSIM 4053859Sml29623 #define MAX_PIO_RETRIES 3200 4063859Sml29623 #else 4073859Sml29623 #define MAX_PIO_RETRIES 32 4083859Sml29623 #endif 4093859Sml29623 4103859Sml29623 #define IS_PORT_NUM_VALID(portn)\ 4113859Sml29623 (portn < 4) 4123859Sml29623 4133859Sml29623 /* 4143859Sml29623 * The following macros expect unsigned input values. 4153859Sml29623 */ 4163859Sml29623 #define TXDMA_CHANNEL_VALID(cn) (cn < NXGE_MAX_TDCS) 4173859Sml29623 #define TXDMA_PAGE_VALID(pn) (pn < NXGE_MAX_LOGICAL_PAGES) 4183859Sml29623 #define TXDMA_FUNC_VALID(fn) (fn < MAX_PORTS_PER_NXGE) 4193859Sml29623 #define FUNC_VALID(n) (n < MAX_PORTS_PER_NXGE) 4203859Sml29623 4213859Sml29623 /* 4223859Sml29623 * DMA channel binding definitions. 4233859Sml29623 */ 4243859Sml29623 #define VIR_PAGE_INDEX_MAX 8 4253859Sml29623 #define VIR_SUB_REGIONS 2 4263859Sml29623 #define VIR_DMA_BIND 1 4273859Sml29623 4283859Sml29623 #define SUBREGION_VALID(n) (n < VIR_SUB_REGIONS) 4293859Sml29623 #define VIR_PAGE_INDEX_VALID(n) (n < VIR_PAGE_INDEX_MAX) 4303859Sml29623 #define VRXDMA_CHANNEL_VALID(n) (n < NXGE_MAX_RDCS) 4313859Sml29623 4323859Sml29623 /* 4333859Sml29623 * Logical device definitions. 4343859Sml29623 */ 4353859Sml29623 #define NXGE_INT_MAX_LD 69 4363859Sml29623 #define NXGE_INT_MAX_LDG 64 4373859Sml29623 4383859Sml29623 #define NXGE_RDMA_LD_START 0 4393859Sml29623 #define NXGE_TDMA_LD_START 32 4403859Sml29623 #define NXGE_MIF_LD 63 4413859Sml29623 #define NXGE_MAC_LD_PORT0 64 4423859Sml29623 #define NXGE_MAC_LD_PORT1 65 4433859Sml29623 #define NXGE_MAC_LD_PORT2 66 4443859Sml29623 #define NXGE_MAC_LD_PORT3 67 4453859Sml29623 #define NXGE_SYS_ERROR_LD 68 4463859Sml29623 4473859Sml29623 #define LDG_VALID(n) (n < NXGE_INT_MAX_LDG) 4483859Sml29623 #define LD_VALID(n) (n < NXGE_INT_MAX_LD) 4493859Sml29623 #define LD_RXDMA_LD_VALID(n) (n < NXGE_MAX_RDCS) 4503859Sml29623 #define LD_TXDMA_LD_VALID(n) (n >= NXGE_MAX_RDCS && \ 4513859Sml29623 ((n - NXGE_MAX_RDCS) < NXGE_MAX_TDCS))) 4523859Sml29623 #define LD_MAC_VALID(n) (IS_PORT_NUM_VALID(n)) 4533859Sml29623 4543859Sml29623 #define LD_TIMER_MAX 0x3f 4553859Sml29623 #define LD_INTTIMER_VALID(n) (n <= LD_TIMER_MAX) 4563859Sml29623 4573859Sml29623 /* System Interrupt Data */ 4583859Sml29623 #define SID_VECTOR_MAX 0x1f 4593859Sml29623 #define SID_VECTOR_VALID(n) (n <= SID_VECTOR_MAX) 4603859Sml29623 4613859Sml29623 #define NXGE_COMPILE_32 4623859Sml29623 4633859Sml29623 #ifdef __cplusplus 4643859Sml29623 } 4653859Sml29623 #endif 4663859Sml29623 4673859Sml29623 #endif /* _SYS_NXGE_NXGE_DEFS_H */ 468