home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD v1.2 / amidev_cd_12.iso / devcon / milan_1991 / devcon91.2 / network / sana2 / include / sana2device.i < prev    next >
Text File  |  1992-09-01  |  7KB  |  249 lines

  1.     IFND    SANA2_SANA2DEVICE_I
  2. SANA2_SANA2DEVICE_I    SET    1
  3. **
  4. **    $Filename: sana2device.i $
  5. **    $Release: Developer Information$
  6. **    $Revision: 1.8 $
  7. **    $Date: 91/05/14 $
  8. **
  9. **    Structure definitions for SANA-II devices.
  10. **
  11. **    (C) Copyright 1991 Raymond S. Brand
  12. **        All Rights Reserved
  13. **
  14. **    (C) Copyright 1991 Commodore-Amiga Inc.
  15. **        All Rights Reserved
  16. **
  17.  
  18. **
  19. ** Contributions from:
  20. **    Raymond S. Brand,   rsbx@cbmvax.commodore.com,  (215) 431-9100
  21. **    Martin Hunt,      martin@cbmvax.commodore.com,  (215) 431-9100
  22. **    Perry Kivolowitz,           ASDG Incorporated,  (608) 273-6585
  23. **
  24.  
  25.     IFND    EXEC_TYPES_I
  26.     INCLUDE    "exec/types.i"
  27.     ENDC    !EXEC_TYPES_I
  28.     IFND    EXEC_PORTS_I
  29.     INCLUDE    "exec/ports.i"
  30.     ENDC    !EXEC_PORTS_I
  31.     IFND    EXEC_IO_I
  32.     INCLUDE    "exec/io.i"
  33.     ENDC    !EXEC_IO_I
  34.     IFND    DEVICES_TIMER_I
  35.     INCLUDE    "devices/timer.i"
  36.     ENDC    !DEVICES_TIMER_I
  37.     IFND    LIBRARIES_NETBUFF_I
  38.     INCLUDE "libraries/netbuff.i"
  39.     ENDC    !LIBRARIES_NETBUFF_I
  40.  
  41.  
  42. SANA2_MAX_ADDR_BITS    EQU    128
  43. SANA2_MAX_ADDR_BYTES    EQU    ((SANA2_MAX_ADDR_BITS+7)/8)
  44.  
  45.  
  46.  STRUCTURE IOSana2Req,0
  47.     STRUCT    S2IO_MESSAGE,MN_SIZE
  48.     APTR    S2IO_DEVICE        ; device node pointer
  49.     APTR    S2IO_UNIT        ; unit (driver private)
  50.  
  51.     UWORD    S2IO_COMMAND        ; device command
  52.     UBYTE    S2IO_FLAGS        ; command flags
  53.     BYTE    S2IO_ERROR        ; generic error or warning
  54.     ULONG    S2IO_WIREERROR        ; wire type specific error
  55.  
  56.     APTR    S2IO_PACKETTYPE        ; packet type
  57.     STRUCT    S2IO_SRCADDR,SANA2_MAX_ADDR_BYTES    ; source address
  58.     STRUCT    S2IO_DSTADDR,SANA2_MAX_ADDR_BYTES    ; dest address
  59.     ULONG    S2IO_DATALENGTH        ; from header
  60.  
  61.     STRUCT    S2IO_BODY,NB_SIZE    ; packet data
  62.     APTR    S2IO_STATDATA        ; statics data pointer
  63.     LABEL    S2IO_SIZE
  64.  
  65.  
  66. ;
  67. ; equates for the S2IO_FLAGS field
  68. ;
  69.  
  70. SANA2IOB_RAW    EQU    7        ; raw packet IO requested
  71. SANA2IOF_RAW    EQU    (1<<SANA2IOB_RAW)
  72.  
  73. SANA2IOB_BCAST    EQU    6        ; broadcast packet (received)
  74. SANA2IOF_BCAST    EQU    (1<<SANA2IOB_BCAST)
  75.  
  76. SANA2IOB_MCAST    EQU    5        ; multicast packet (received)
  77. SANA2IOF_MCAST    EQU    (1<<SANA2IOB_MCAST)
  78.  
  79. SANA2IOB_QUICK    EQU    IOB_QUICK    ; quick IO requested (0)
  80. SANA2IOF_QUICK    EQU    IOF_QUICK
  81.  
  82.  
  83. ;
  84. ; equates for OpenDevice()
  85. ;
  86.  
  87. SANA2OPB_MINE    EQU    0        ; exclusive access requested
  88. SANA2OPF_MINE    EQU    (1<<SANA2OPB_MINE)
  89.  
  90. SANA2OPB_PROM    EQU    1        ; promiscuous mode requested
  91. SANA2OPF_PROM    EQU    (1<<SANA2OPB_PROM)
  92.  
  93.  
  94.  STRUCTURE SANA2PACKETTYPE,0
  95.     ULONG    S2PT_CANONICALTYPE    ; used by higher levels
  96.     ULONG    S2PT_MAGIC        ; interpretation code
  97.     ULONG    S2PT_LENGTH        ; length of match data
  98.     APTR    S2PT_MATCH        ; bytes to compare
  99.     APTR    S2PT_MASK        ; mask for comparison
  100.     LABEL    S2PT_SIZE
  101.  
  102.  
  103.  STRUCTURE SANA2DEVICEQUERY,0
  104.     ; Standard information
  105.     ULONG    S2DQ_SIZEAVAILABLE    ; bytes available
  106.     ULONG    S2DQ_SIZESUPPLIED    ; bytes supplied
  107.     LONG    S2DQ_FORMAT        ; this is type 0
  108.     LONG    S2DQ_DEVICELEVEL    ; this document is level 0
  109.  
  110.     ; Common information
  111.     UWORD    S2DQ_ADDRSIZE        ; address size in bits
  112.     ULONG    S2DQ_MTU        ; maximum packet data size
  113.     LONG    S2DQ_BPS        ; line rate (bits/sec)
  114.     LONG    S2DQ_HARDWARETYPE    ; what the wire is
  115.  
  116.     ; Format specific information
  117.     LABEL    S2DQ_SIZE
  118.  
  119.  
  120. ;
  121. ; defined SANA-II hardware types
  122. ;
  123.  
  124. S2WIRETYPE_ETHERNET        EQU    1
  125. S2WIRETYPE_ARCNET        EQU    2
  126.  
  127.  
  128.  STRUCTURE SANA2PACKETTYPESTATS,0
  129.     LONG    S2PTS_TXPACKETS        ; transmitted count
  130.     LONG    S2PTS_RXPACKETS        ; received count
  131.     LONG    S2PTS_TXBYTES        ; bytes transmitted count
  132.     LONG    S2PTS_RXBYTES        ; bytes received count
  133.     LONG    S2PTS_PACKETSDROPPED    ; packets dropped count
  134.     LABEL    S2PTS_SIZE
  135.  
  136.  
  137.  STRUCTURE SANA2SPECIALSTATRECORD,0
  138.     ULONG    S2SSR_TYPE        ; statistic identifier
  139.     LONG    S2SSR_COUNT        ; the statistic
  140.     APTR    S2SSR_STRING        ; statistic name
  141.     LABEL    S2SSR_SIZE
  142.  
  143.  
  144.  STRUCTURE SANA2SPECIALSTATHEADER,0
  145.     ULONG    S2SSH_RECORDCOUNTMAX        ; room available
  146.     ULONG    S2SSH_RECORDCOUNTSUPPLIED    ; number supplied
  147.     LABEL    S2SSH_SIZE
  148.  
  149.  
  150.  STRUCTURE SANA2DEVICESTATS,0
  151.     LONG    S2DS_RXPACKETS        ; received count
  152.     LONG    S2DS_TXPACKETS        ; transmitted count
  153.     LONG    S2DS_FRAMINGERRORS    ; framming errors found
  154.     LONG    S2DS_BADDATA        ; bad packets received
  155.     LONG    S2DS_HARDMISSES        ; hardware miss count
  156.     LONG    S2DS_SOFTMISSES        ; software miss count
  157.     LONG    S2DS_RXUNKNOWNTYPES    ; orphan count
  158.     LONG    S2DS_FIFOOVERRUNS    ; hardware overruns
  159.     LONG    S2DS_FIFOUNDERRUNS    ; hardware underruns
  160.     LONG    S2DS_RECONFIGURATIONS    ; network reconfigurations
  161.     STRUCT    S2DS_LASTSTART,TV_SIZE    ; time of last online
  162.     LABEL    S2DS_SIZE
  163.  
  164.  
  165. ;
  166. ; Device Commands
  167. ;
  168.  
  169. SANA2_CMD_START            EQU    (CMD_NONSTD)
  170.  
  171. SANA2CMD_DEVICEQUERY        EQU    (SANA2_CMD_START+0)
  172. SANA2CMD_GETSTATIONADDRESS    EQU    (SANA2_CMD_START+1)
  173. SANA2CMD_CONFIGINTERFACE    EQU    (SANA2_CMD_START+2)
  174. SANA2CMD_ADDSTATIONALIAS    EQU    (SANA2_CMD_START+3)
  175. SANA2CMD_DELSTATIONALIAS    EQU    (SANA2_CMD_START+4)
  176. SANA2CMD_ADDMULTICASTADDRESS    EQU    (SANA2_CMD_START+5)
  177. SANA2CMD_DELMULTICASTADDRESS    EQU    (SANA2_CMD_START+6)
  178. SANA2CMD_MULTICAST        EQU    (SANA2_CMD_START+7)
  179. SANA2CMD_BROADCAST        EQU    (SANA2_CMD_START+8)
  180. SANA2CMD_TRACKTYPE        EQU    (SANA2_CMD_START+9)
  181. SANA2CMD_UNTRACKTYPE        EQU    (SANA2_CMD_START+10)
  182. SANA2CMD_GETTYPESTATS        EQU    (SANA2_CMD_START+11)
  183. SANA2CMD_GETSPECIALSTATS    EQU    (SANA2_CMD_START+12)
  184. SANA2CMD_GETGLOBALSTATS        EQU    (SANA2_CMD_START+13)
  185. SANA2CMD_ONEVENT        EQU    (SANA2_CMD_START+14)
  186. SANA2CMD_READORPHAN        EQU    (SANA2_CMD_START+15)
  187. SANA2CMD_ONLINE            EQU    (SANA2_CMD_START+16)
  188. SANA2CMD_OFFLINE        EQU    (SANA2_CMD_START+17)
  189.  
  190. SANA2_CMD_END            EQU    (SANA2_CMD_START+18)
  191.  
  192.  
  193. ;
  194. ; defined errors for S2IO_ERROR
  195. ;
  196.  
  197. S2ERR_NO_ERROR        EQU    0    ; peachy-keen
  198. S2ERR_NO_RESOURCES    EQU    1    ; resource allocation failure
  199. S2ERR_UNKNOWN_ENTITY    EQU    2    ; unable to find something
  200. S2ERR_BAD_ARGUMENT    EQU    3    ; garbage somewhere
  201. S2ERR_BAD_STATE        EQU    4    ; inappropriate state
  202. S2ERR_BAD_ADDRESS    EQU    5    ; who?
  203. S2ERR_MTU_EXCEEDED    EQU    6    ; too much to chew
  204. S2ERR_BAD_PROTOCOL    EQU    7    ; bad packet type structure
  205. S2ERR_NOT_SUPPORTED    EQU    8    ; command not supported
  206. S2ERR_SOFTWARE        EQU    9    ; software error detected
  207.  
  208.  
  209. ;
  210. ; defined errors for S2IO_WIREERROR
  211. ;
  212.  
  213. S2WERR_GENERIC_ERROR    EQU    0    ; no specific info available
  214. S2WERR_NOT_CONFIGURED    EQU    1    ; unit not configured
  215. S2WERR_UNIT_ONLINE    EQU    2    ; unit is currently online
  216. S2WERR_UNIT_OFFLINE    EQU    3    ; unit is currently offline
  217. S2WERR_ALREADY_TRACKED    EQU    4    ; protocol already tracked
  218. S2WERR_NOT_TRACKED    EQU    5    ; protocol not tracked
  219. S2WERR_NETBUFF_ERROR    EQU    6    ; netbuff.lib returned error
  220. S2WERR_SRC_ADDRESS    EQU    7    ; source address problem
  221. S2WERR_DST_ADDRESS    EQU    8    ; destination address problem
  222. S2WERR_BAD_BROADCAST    EQU    9    ; broadcast address problem
  223. S2WERR_BAD_MULTICAST    EQU    10    ; multicast address problem
  224. S2WERR_ALIAS_LIST_FULL    EQU    11    ; station alias list full
  225. S2WERR_BAD_ALIAS    EQU    12    ; bad station alias
  226. S2WERR_MULTICAST_FULL    EQU    13    ; multicast address list full
  227. S2WERR_BAD_EVENT    EQU    14    ; unsupported event class
  228. S2WERR_BAD_STATDATA    EQU    15    ; statdata failed sanity check
  229. S2WERR_PROTOCOL_UNKNOWN    EQU    16    ; unknown protocol type
  230. S2WERR_IS_CONFIGURED    EQU    17    ; attempt to config twice
  231. S2WERR_NULL_POINTER    EQU    18    ; null pointer detected
  232.  
  233.  
  234. ;
  235. ; defined events
  236. ;
  237.  
  238. S2EVENT_ERROR        EQU    0    ; error catch all
  239. S2EVENT_TX        EQU    1    ; transmitter error catch all
  240. S2EVENT_RX        EQU    2    ; receiver error catch all
  241. S2EVENT_ONLINE        EQU    3    ; unit is in service
  242. S2EVENT_OFFLINE        EQU    4    ; unit is not in service
  243. S2EVENT_NETBUF        EQU    5    ; NetBuff error catch all
  244. S2EVENT_HARDWARE    EQU    6    ; hardware error catch all
  245. S2EVENT_SOFTWARE    EQU    7    ; software error catch all
  246.  
  247.  
  248.     ENDC    SANA2_SANA2DEVICE_I
  249.