#ifndef SANA2_SANA2DEVICE_H #define SANA2_SANA2DEVICE_H 1 /* ** $Id: sana2.h,v 1.1 2003/08/06 15:15:40 obarthel Exp $ ** Includes Release 50.1 ** ** Structure definitions for SANA-II devices. ** ** (C) Copyright 1991-2003 Amiga, Inc. ** All Rights Reserved */ #ifndef EXEC_TYPES_H #include #endif #ifndef EXEC_PORTS_H #include #endif #ifndef EXEC_IO_H #include #endif #ifndef EXEC_TASKS_H #include #endif #ifndef EXEC_ERRORS_H #include #endif #ifndef DEVICES_TIMER_H #include #endif #ifndef UTILITY_TAGITEM_H #include #endif #ifndef UTILITY_HOOKS_H #include #endif /****************************************************************************/ #ifdef __cplusplus extern "C" { #endif #ifdef __GNUC__ #ifdef __PPC__ #pragma pack(2) #endif #elif defined(__VBCC__) #pragma amiga-align #endif /****************************************************************************/ #define SANA2_MAX_ADDR_BITS (128) #define SANA2_MAX_ADDR_BYTES ((SANA2_MAX_ADDR_BITS+7)/8) struct IOSana2Req { struct IORequest ios2_Req; ULONG ios2_WireError; /* wire type specific error */ ULONG ios2_PacketType; /* packet type */ UBYTE ios2_SrcAddr[SANA2_MAX_ADDR_BYTES]; /* source address */ UBYTE ios2_DstAddr[SANA2_MAX_ADDR_BYTES]; /* dest address */ ULONG ios2_DataLength; /* length of packet data */ APTR ios2_Data; /* packet data */ APTR ios2_StatData; /* statistics data pointer */ APTR ios2_BufferManagement; /* see SANA-II OpenDevice adoc */ }; /* ** Defines for the io_Flags field */ #define SANA2IOB_RAW (7) /* raw packet IO requested */ #define SANA2IOB_BCAST (6) /* broadcast packet (received) */ #define SANA2IOB_MCAST (5) /* multicast packet (received) */ #define SANA2IOB_QUICK (IOB_QUICK) /* quick IO requested (0) */ #define SANA2IOF_RAW (1<) */ #define S2ERR_NO_ERROR 0 /* peachy-keen */ #define S2ERR_NO_RESOURCES 1 /* resource allocation failure */ #define S2ERR_BAD_ARGUMENT 3 /* garbage somewhere */ #define S2ERR_BAD_STATE 4 /* inappropriate state */ #define S2ERR_BAD_ADDRESS 5 /* who? */ #define S2ERR_MTU_EXCEEDED 6 /* too much to chew */ #define S2ERR_NOT_SUPPORTED 8 /* hardware can't support cmd */ #define S2ERR_SOFTWARE 9 /* software error detected */ #define S2ERR_OUTOFSERVICE 10 /* driver is OFFLINE */ #define S2ERR_TX_FAILURE 11 /* Transmission attempt failed */ /* ** From ** ** IOERR_OPENFAIL (-1) * device/unit failed to open * ** IOERR_ABORTED (-2) * request terminated early [after AbortIO()] * ** IOERR_NOCMD (-3) * command not supported by device * ** IOERR_BADLENGTH (-4) * not a valid length (usually IO_LENGTH) * ** IOERR_BADADDRESS (-5) * invalid address (misaligned or bad range) * ** IOERR_UNITBUSY (-6) * device opens ok, but requested unit is busy * ** IOERR_SELFTEST (-7) * hardware failed self-test * */ /* ** Defined errors for ios2_WireError */ #define S2WERR_GENERIC_ERROR 0 /* no specific info available */ #define S2WERR_NOT_CONFIGURED 1 /* unit not configured */ #define S2WERR_UNIT_ONLINE 2 /* unit is currently online */ #define S2WERR_UNIT_OFFLINE 3 /* unit is currently offline */ #define S2WERR_ALREADY_TRACKED 4 /* protocol already tracked */ #define S2WERR_NOT_TRACKED 5 /* protocol not tracked */ #define S2WERR_BUFF_ERROR 6 /* buff mgt func returned error */ #define S2WERR_SRC_ADDRESS 7 /* source address problem */ #define S2WERR_DST_ADDRESS 8 /* destination address problem */ #define S2WERR_BAD_BROADCAST 9 /* broadcast address problem */ #define S2WERR_BAD_MULTICAST 10 /* multicast address problem */ #define S2WERR_MULTICAST_FULL 11 /* multicast address list full */ #define S2WERR_BAD_EVENT 12 /* unsupported event class */ #define S2WERR_BAD_STATDATA 13 /* statdata failed sanity check */ /*** THERE IS NO WIRE ERROR CODE 14 ***/ #define S2WERR_IS_CONFIGURED 15 /* attempt to config twice */ #define S2WERR_NULL_POINTER 16 /* null pointer detected */ #define S2WERR_TOO_MANY_RETRIES 17 /* tx failed - too many retries */ #define S2WERR_RCVREL_HDW_ERR 18 /* Driver fixable HW error */ #define S2WERR_UNIT_DISCONNECTED 19 /* unit is currently not connected */ #define S2WERR_UNIT_CONNECTED 20 /* unit is currently connected */ #define S2WERR_INVALID_OPTION 21 /* invalid option rejected */ #define S2WERR_MISSING_OPTION 22 /* a mandatory option is missing */ #define S2WERR_AUTHENTICATION_FAILED 23 /* could not log in */ /* ** For our dsylexic friends */ #define S2WERR_TOO_MANY_RETIRES S2WERR_TOO_MANY_RETRIES /* ** Defined events */ #define S2EVENT_ERROR (1UL<< 0) /* error catch all */ #define S2EVENT_TX (1UL<< 1) /* transmitter error catch all */ #define S2EVENT_RX (1UL<< 2) /* receiver error catch all */ #define S2EVENT_ONLINE (1UL<< 3) /* unit is in service */ #define S2EVENT_OFFLINE (1UL<< 4) /* unit is not in service */ #define S2EVENT_BUFF (1UL<< 5) /* buff mgt function error */ #define S2EVENT_HARDWARE (1UL<< 6) /* hardware error catch all */ #define S2EVENT_SOFTWARE (1UL<< 7) /* software error catch all */ #define S2EVENT_CONFIGCHANGED (1UL<< 8) /* driver configuration changed */ #define S2EVENT_CONNECT (1UL<< 9) /* driver has opened session */ #define S2EVENT_DISCONNECT (1UL<<10) /* driver has closed session */ /****************************************************************************/ #ifdef __GNUC__ #ifdef __PPC__ #pragma pack() #endif #elif defined(__VBCC__) #pragma default-align #endif #ifdef __cplusplus } #endif /****************************************************************************/ #endif /* SANA2_SANA2DEVICE_H */