1 /* $OpenBSD: if_lmc_types.h,v 1.5 2005/11/14 14:56:02 mickey Exp $ */ 2 /* $NetBSD: if_lmc_types.h,v 1.2 1999/03/25 04:09:33 explorer Exp $ */ 3 4 /*- 5 * Copyright (c) 1997-1999 LAN Media Corporation (LMC) 6 * All rights reserved. www.lanmedia.com 7 * 8 * This code is written by Michael Graff <graff@vix.com> for LMC. 9 * The code is derived from permitted modifications to software created 10 * by Matt Thomas (matt@3am-software.com). 11 * 12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions 14 * are met: 15 * 1. Redistributions of source code must retain the above copyright 16 * notice, this list of conditions and the following disclaimer. 17 * 2. Redistributions in binary form must reproduce the above 18 * copyright notice, this list of conditions and the following disclaimer 19 * in the documentation and/or other materials provided with the 20 * distribution. 21 * 3. All marketing or advertising materials mentioning features or 22 * use of this software must display the following acknowledgement: 23 * This product includes software developed by LAN Media Corporation 24 * and its contributors. 25 * 4. Neither the name of LAN Media Corporation nor the names of its 26 * contributors may be used to endorse or promote products derived 27 * from this software without specific prior written permission. 28 * 29 * THIS SOFTWARE IS PROVIDED BY LAN MEDIA CORPORATION AND CONTRIBUTORS 30 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 31 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 32 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 33 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 34 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 37 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 39 * THE POSSIBILITY OF SUCH DAMAGE. 40 */ 41 42 #ifndef LMC_TYPES_H 43 #define LMC_TYPES_H 44 45 #if defined(_KERNEL) 46 47 /* 48 * LMC has weird endianness issues, so we can't use the tulip_desc_t. 49 */ 50 typedef struct { 51 u_int32_t d_status; 52 u_int32_t d_ctl; 53 u_int32_t d_addr1; 54 u_int32_t d_addr2; 55 } lmc_desc_t; 56 57 #define LMC_CTL_FLGS(x) (((x)>>22)&0x3ff) 58 #define LMC_CTL_LEN2(x) (((x)>>11)&0x7ff) 59 #define LMC_CTL_LEN1(x) ((x)&0x7ff) 60 #define LMC_CTL(f,l1,l2) ((((f)&0x3ff)<<22)|(((l2)&0x7ff)<<11)|((l1)&0x7ff)) 61 62 typedef bus_size_t lmc_csrptr_t; 63 64 #define lmc_intrfunc_t int 65 66 typedef struct lmc___softc lmc_softc_t; 67 typedef struct lmc___media lmc_media_t; 68 typedef struct lmc_ringinfo lmc_ringinfo_t; 69 70 #endif /* _KERNEL */ 71 72 typedef struct lmc___ctl lmc_ctl_t; 73 74 #endif /* LMC_TYPES_H */