11ae08745Sheppo /* 21ae08745Sheppo * CDDL HEADER START 31ae08745Sheppo * 41ae08745Sheppo * The contents of this file are subject to the terms of the 51ae08745Sheppo * Common Development and Distribution License (the "License"). 61ae08745Sheppo * You may not use this file except in compliance with the License. 71ae08745Sheppo * 81ae08745Sheppo * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 91ae08745Sheppo * or http://www.opensolaris.org/os/licensing. 101ae08745Sheppo * See the License for the specific language governing permissions 111ae08745Sheppo * and limitations under the License. 121ae08745Sheppo * 131ae08745Sheppo * When distributing Covered Code, include this CDDL HEADER in each 141ae08745Sheppo * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 151ae08745Sheppo * If applicable, add the following below this CDDL HEADER, with the 161ae08745Sheppo * fields enclosed by brackets "[]" replaced with your own identifying 171ae08745Sheppo * information: Portions Copyright [yyyy] [name of copyright owner] 181ae08745Sheppo * 191ae08745Sheppo * CDDL HEADER END 201ae08745Sheppo */ 211ae08745Sheppo 221ae08745Sheppo /* 23*0705ae3aSraghuram * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 241ae08745Sheppo * Use is subject to license terms. 251ae08745Sheppo */ 261ae08745Sheppo 271ae08745Sheppo #ifndef _CNEX_H 281ae08745Sheppo #define _CNEX_H 291ae08745Sheppo 301ae08745Sheppo #pragma ident "%Z%%M% %I% %E% SMI" 311ae08745Sheppo 321ae08745Sheppo #ifdef __cplusplus 331ae08745Sheppo extern "C" { 341ae08745Sheppo #endif 351ae08745Sheppo 361ae08745Sheppo /* 371ae08745Sheppo * Channel nexus "reg" spec 381ae08745Sheppo */ 391ae08745Sheppo typedef struct cnex_regspec { 401ae08745Sheppo uint64_t physaddr; 411ae08745Sheppo uint64_t size; 421ae08745Sheppo } cnex_regspec_t; 431ae08745Sheppo 441ae08745Sheppo /* 451ae08745Sheppo * Channel nexus interrupt map 461ae08745Sheppo */ 471ae08745Sheppo struct cnex_pil_map { 481ae08745Sheppo ldc_dev_t devclass; /* LDC device class */ 491ae08745Sheppo uint32_t pil; /* PIL for device class */ 501ae08745Sheppo }; 511ae08745Sheppo 521ae08745Sheppo /* 531ae08745Sheppo * Channel interrupt information 541ae08745Sheppo */ 551ae08745Sheppo typedef struct cnex_intr { 561ae08745Sheppo uint64_t ino; /* dev intr number */ 57*0705ae3aSraghuram uint64_t cpuid; /* Target CPU */ 581ae08745Sheppo uint64_t icookie; /* dev intr cookie */ 591ae08745Sheppo uint_t (*hdlr)(); /* intr handler */ 601ae08745Sheppo caddr_t arg1; /* intr argument 1 */ 611ae08745Sheppo caddr_t arg2; /* intr argument 2 */ 62*0705ae3aSraghuram struct cnex_ldc *cldcp; /* back pointer to the ldc */ 631ae08745Sheppo } cnex_intr_t; 641ae08745Sheppo 651ae08745Sheppo /* cnex interrupt types */ 661ae08745Sheppo typedef enum { 671ae08745Sheppo CNEX_TX_INTR = 1, /* transmit interrupt */ 681ae08745Sheppo CNEX_RX_INTR /* receive interrupt */ 691ae08745Sheppo } cnex_intrtype_t; 701ae08745Sheppo 711ae08745Sheppo /* 721ae08745Sheppo * Channel information 731ae08745Sheppo */ 741ae08745Sheppo typedef struct cnex_ldc { 751ae08745Sheppo kmutex_t lock; /* Channel lock */ 761ae08745Sheppo struct cnex_ldc *next; 771ae08745Sheppo 781ae08745Sheppo uint64_t id; 791ae08745Sheppo ldc_dev_t devclass; /* Device class channel belongs to */ 801ae08745Sheppo 811ae08745Sheppo cnex_intr_t tx; /* Transmit interrupt */ 821ae08745Sheppo cnex_intr_t rx; /* Receive interrupt */ 83*0705ae3aSraghuram dev_info_t *dip; /* dip of the associated device */ 841ae08745Sheppo } cnex_ldc_t; 851ae08745Sheppo 861ae08745Sheppo /* 871ae08745Sheppo * Channel nexus soft state pointer 881ae08745Sheppo */ 891ae08745Sheppo typedef struct cnex_soft_state { 901ae08745Sheppo dev_info_t *devi; 911ae08745Sheppo uint64_t cfghdl; /* cnex config handle */ 921ae08745Sheppo kmutex_t clist_lock; /* lock to protect channel list */ 931ae08745Sheppo cnex_ldc_t *clist; /* list of registered channels */ 941ae08745Sheppo } cnex_soft_state_t; 951ae08745Sheppo 961ae08745Sheppo #ifdef __cplusplus 971ae08745Sheppo } 981ae08745Sheppo #endif 991ae08745Sheppo 1001ae08745Sheppo #endif /* _CNEX_H */ 101