t2ex/t2ex_source/include/device/netdrv.h | bare source | permlink (0.01 seconds) |
1: /* 2: *---------------------------------------------------------------------- 3: * T2EX Software Package 4: * 5: * Copyright 2012 by Ken Sakamura. 6: * This software is distributed under the latest version of T-License 2.x. 7: *---------------------------------------------------------------------- 8: * 9: * Released by T-Engine Forum(http://www.t-engine.org/) at 2012/12/12. 10: * Modified by TRON Forum(http://www.tron.org/) at 2015/06/04. 11: * 12: *---------------------------------------------------------------------- 13: */ 14: /* 15: * This software package is available for use, modification, 16: * and redistribution in accordance with the terms of the attached 17: * T-License 2.x. 18: * If you want to redistribute the source code, you need to attach 19: * the T-License 2.x document. 20: * There's no obligation to publish the content, and no obligation 21: * to disclose it to the TRON Forum if you have modified the 22: * software package. 23: * You can also distribute the modified source code. In this case, 24: * please register the modification to T-Kernel traceability service. 25: * People can know the history of modifications by the service, 26: * and can be sure that the version you have inherited some 27: * modification of a particular version or not. 28: * 29: * http://trace.tron.org/tk/?lang=en 30: * http://trace.tron.org/tk/?lang=ja 31: * 32: * As per the provisions of the T-License 2.x, TRON Forum ensures that 33: * the portion of the software that is copyrighted by Ken Sakamura or 34: * the TRON Forum does not infringe the copyrights of a third party. 35: * However, it does not make any warranty other than this. 36: * DISCLAIMER: TRON Forum and Ken Sakamura shall not be held 37: * responsible for any consequences or damages caused directly or 38: * indirectly by the use of this software package. 39: * 40: * The source codes in bsd_source.tar.gz in this software package are 41: * derived from NetBSD or OpenBSD and not covered under T-License 2.x. 42: * They need to be changed or redistributed according to the 43: * representation of each source header. 44: */ 45: 46: /* 47: * @(#)netdrv.h 48: */ 49: 50: #ifndef __DEVICE_NETDRV_H__ 51: #define __DEVICE_NETDRV_H__ 52: 53: #include <basic.h> 54: 55: #ifdef __cplusplus 56: extern "C" { 57: #endif 58: 59: /* 60: * Data Number 61: */ 62: typedef enum { 63: DN_NETEVENT = -100, 64: DN_NETRESET = -103, 65: DN_NETADDR = -105, 66: DN_NETDEVINFO = -110, 67: DN_NETSTINFO = -111, 68: DN_NETCSTINFO = -112, 69: DN_NETRXBUF = -113, 70: DN_NETRXBUFSZ = -114, 71: DN_NETMCASTLIST = -115, 72: DN_NETALLMCAST = -116, 73: } NetDrvDataNo; 74: 75: /* 76: * DN_NETEVENT 77: */ 78: typedef struct { 79: UH len; 80: VP buf; 81: } NetEvent; 82: 83: /* 84: * DN_NETADDR 85: */ 86: typedef struct { 87: UB c[6]; 88: } NetAddr; 89: 90: /* 91: * DN_NETDEVINFO 92: */ 93: #define L_NETPNAME (40) 94: 95: typedef struct { 96: UB name[L_NETPNAME]; 97: UW iobase; 98: UW iosize; 99: UW intno; 100: UW kind; 101: UW ifconn; 102: W stat; 103: } NetDevInfo; 104: 105: /* ifconn */ 106: #define IFC_UNKNOWN (0) 107: #define IFC_AUI (1) 108: #define IFC_TPE (2) 109: #define IFC_BNC (3) 110: #define IFC_100TX (4) 111: #define IFC_100FX (5) 112: #define IFC_AUTO (6) 113: #define IFC_1000T (7) 114: #define IFC_WLAN (16) 115: 116: /* 117: * DN_NETSTINFO, DN_NETCSTINFO 118: */ 119: typedef struct { 120: UW rxpkt; 121: UW rxerr; 122: UW misspkt; 123: UW invpkt; 124: UW txpkt; 125: UW txerr; 126: UW txbusy; 127: UW collision; 128: UW nint; 129: UW rxint; 130: UW txint; 131: UW overrun; 132: UW hwerr; 133: UW other[3]; 134: } NetStInfo; 135: 136: /* 137: * DN_NETRXBUFSZ 138: */ 139: typedef struct { 140: W minsz; 141: W maxsz; 142: } NetRxBufSz; 143: 144: #ifdef __cplusplus 145: } 146: #endif 147: #endif /* __DEVICE_NETDRV_H__ */