home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ndissrc.zip / UM9008SW.H < prev   
Text File  |  1998-07-01  |  18KB  |  881 lines

  1. /*++
  2.  
  3. Module Name:
  4.  
  5.     um9008sw.h
  6.  
  7. Abstract:
  8.  
  9.     The main header for an UMC UM9008 Miniport driver.
  10.  
  11. Author:
  12.  
  13.     Sean Selitrennikoff
  14.  
  15. Environment:
  16.  
  17.     Architecturally, there is an assumption in this driver that we are
  18.     on a little endian machine.
  19.  
  20. Notes:
  21.  
  22.     optional-notes
  23.  
  24. Revision History:
  25.  
  26. --*/
  27.  
  28. #ifndef _UM9008SFT_
  29. #define _UM9008SFT_
  30.  
  31. #if NDIS40_MINIPORT
  32. #define UM9008_NDIS_MAJOR_VERSION 4
  33. #define UM9008_NDIS_MINOR_VERSION 0
  34. #else
  35. #define UM9008_NDIS_MAJOR_VERSION 3
  36. #define UM9008_NDIS_MINOR_VERSION 0
  37. #endif
  38.  
  39. //
  40. // This macro is used along with the flags to selectively
  41. // turn on debugging.
  42. //
  43.  
  44. #if DBG
  45.  
  46. #define IF_UM9008DEBUG(f) if (UM9008DebugFlag & (f))
  47. extern ULONG UM9008DebugFlag;
  48.  
  49. #define UM9008_DEBUG_LOUD               0x00000001  // debugging info
  50. #define UM9008_DEBUG_VERY_LOUD          0x00000002  // excessive debugging info
  51. #define UM9008_DEBUG_LOG                0x00000004  // enable UM9008Log
  52. #define UM9008_DEBUG_CHECK_DUP_SENDS    0x00000008  // check for duplicate sends
  53. #define UM9008_DEBUG_TRACK_PACKET_LENS  0x00000010  // track directed packet lens
  54. #define UM9008_DEBUG_WORKAROUND1        0x00000020  // drop DFR/DIS packets
  55. #define UM9008_DEBUG_CARD_BAD           0x00000040  // dump data if CARD_BAD
  56. #define UM9008_DEBUG_CARD_TESTS         0x00000080  // print reason for failing
  57.  
  58. //
  59. // Macro for deciding whether to print a lot of debugging information.
  60. //
  61.  
  62. #define IF_LOUD(A) IF_UM9008DEBUG( UM9008_DEBUG_LOUD ) { A }
  63. #define IF_VERY_LOUD(A) IF_UM9008DEBUG( UM9008_DEBUG_VERY_LOUD ) { A }
  64.  
  65. //
  66. // Whether to use the UM9008Log buffer to record a trace of the driver.
  67. //
  68. #define IF_LOG(A) IF_UM9008DEBUG( UM9008_DEBUG_LOG ) { A }
  69. extern VOID UM9008Log(UCHAR);
  70.  
  71. //
  72. // Whether to do loud init failure
  73. //
  74. #define IF_INIT(A) A
  75.  
  76. //
  77. // Whether to do loud card test failures
  78. //
  79. #define IF_TEST(A) IF_UM9008DEBUG( UM9008_DEBUG_CARD_TESTS ) { A }
  80.  
  81. #else
  82.  
  83. //
  84. // This is not a debug build, so make everything quiet.
  85. //
  86. #define IF_LOUD(A)
  87. #define IF_VERY_LOUD(A)
  88. #define IF_LOG(A)
  89. #define IF_INIT(A)
  90. #define IF_TEST(A)
  91.  
  92. #endif
  93.  
  94.  
  95.  
  96.  
  97. //
  98. // Adapter->NumBuffers
  99. //
  100. // controls the number of transmit buffers on the packet.
  101. // Choices are 1 through 12.
  102. //
  103.  
  104. #define DEFAULT_NUMBUFFERS 12
  105.  
  106.  
  107. //
  108. // Create a macro for moving memory from place to place.  Makes
  109. // the code more readable and portable in case we ever support
  110. // a shared memory UM9008 adapter.
  111. //
  112. #define UM9008_MOVE_MEM(dest,src,size) NdisMoveMemory(dest,src,size)
  113.  
  114. //
  115. // The status of transmit buffers.
  116. //
  117.  
  118. typedef enum {
  119.     EMPTY = 0x00,
  120.     FULL = 0x02
  121. } BUFFER_STATUS;
  122.  
  123. //
  124. // Type of an interrupt.
  125. //
  126.  
  127. typedef enum {
  128.     RECEIVE    = 0x01,
  129.     TRANSMIT   = 0x02,
  130.     OVERFLOW   = 0x04,
  131.     COUNTER    = 0x08,
  132.     UNKNOWN    = 0x10
  133. } INTERRUPT_TYPE;
  134.  
  135. //
  136. // Result of UM9008IndicatePacket().
  137. //
  138. typedef enum {
  139.     INDICATE_OK,
  140.     SKIPPED,
  141.     ABORT,
  142.     CARD_BAD
  143. } INDICATE_STATUS;
  144.  
  145.  
  146.  
  147. //
  148. // Size of the ethernet header
  149. //
  150. #define UM9008_HEADER_SIZE 14
  151.  
  152. //
  153. // Size of the ethernet address
  154. //
  155. #define UM9008_LENGTH_OF_ADDRESS 6
  156.  
  157. //
  158. // Number of bytes allowed in a lookahead (max)
  159. //
  160. #define UM9008_MAX_LOOKAHEAD (252 - UM9008_HEADER_SIZE)
  161.  
  162. //
  163. // Maximum number of transmit buffers on the card.
  164. //
  165. #define MAX_XMIT_BUFS   12
  166.  
  167. //
  168. // Definition of a transmit buffer.
  169. //
  170. typedef UINT XMIT_BUF;
  171.  
  172. //
  173. // Number of 256-byte buffers in a transmit buffer.
  174. //
  175. #define BUFS_PER_TX 1
  176.  
  177. //
  178. // Size of a single transmit buffer.
  179. //
  180. #define TX_BUF_SIZE (BUFS_PER_TX*256)
  181.  
  182.  
  183.  
  184.  
  185. //
  186. // This structure contains information about the driver
  187. // itself.  There is only have one of these structures.
  188. //
  189. typedef struct _DRIVER_BLOCK {
  190.  
  191.     //
  192.     // NDIS wrapper information.
  193.     //
  194.     NDIS_HANDLE NdisMacHandle;          // returned from NdisRegisterMac
  195.     NDIS_HANDLE NdisWrapperHandle;      // returned from NdisInitializeWrapper
  196.  
  197.     //
  198.     // Adapters registered for this Miniport driver.
  199.     //
  200.     struct _UM9008_ADAPTER * AdapterQueue;
  201.  
  202. } DRIVER_BLOCK, * PDRIVER_BLOCK;
  203.  
  204.  
  205.  
  206. //
  207. // This structure contains all the information about a single
  208. // adapter that this driver is controlling.
  209. //
  210. typedef struct _UM9008_ADAPTER {
  211.  
  212.     //
  213.     // This is the handle given by the wrapper for calling ndis
  214.     // functions.
  215.     //
  216.     NDIS_HANDLE MiniportAdapterHandle;
  217.  
  218.     //
  219.     // Interrupt object.
  220.     //
  221.     NDIS_MINIPORT_INTERRUPT Interrupt;
  222.  
  223.     //
  224.     // used by DriverBlock->AdapterQueue
  225.     //
  226.     struct _UM9008_ADAPTER * NextAdapter;
  227.  
  228.     //
  229.     // This is a count of the number of receives that have been
  230.     // indicated in a row.  This is used to limit the number
  231.     // of sequential receives so that one can periodically check
  232.     // for transmit complete interrupts.
  233.     //
  234.     ULONG ReceivePacketCount;
  235.  
  236.     //
  237.     // Configuration information
  238.     //
  239.  
  240.     //
  241.     // Number of buffer in this adapter.
  242.     //
  243.     UINT NumBuffers;
  244.  
  245.     //
  246.     // Physical address of the IoBaseAddress
  247.     //
  248.     PVOID IoBaseAddr;
  249.  
  250.     //
  251.     // Interrupt number this adapter is using.
  252.     //
  253.     CHAR InterruptNumber;
  254.  
  255.     //
  256.     // Number of multicast addresses that this adapter is to support.
  257.     //
  258.     UINT MulticastListMax;
  259.  
  260.     //
  261.     // The type of bus that this adapter is running on.  Either ISA or
  262.     // MCA.
  263.     //
  264.     UCHAR BusType;
  265.  
  266.     //
  267.     // InterruptType is the next interrupt that should be serviced.
  268.     //
  269.     UCHAR InterruptType;
  270.  
  271.  
  272.     //
  273.     //  Type of UM9008 card.
  274.     //
  275.     UINT    CardType;
  276.  
  277.     //
  278.     //  Address of the memory window.
  279.     //
  280.     ULONG   AttributeMemoryAddress;
  281.     ULONG   AttributeMemorySize;
  282.  
  283.     //
  284.     // Transmit information.
  285.     //
  286.  
  287.     //
  288.     // The next available empty transmit buffer.
  289.     //
  290.     XMIT_BUF NextBufToFill;
  291.  
  292.     //
  293.     // The next full transmit buffer waiting to transmitted.  This
  294.     // is valid only if CurBufXmitting is -1
  295.     //
  296.     XMIT_BUF NextBufToXmit;
  297.  
  298.     //
  299.     // This transmit buffer that is currently transmitting.  If none,
  300.     // then the value is -1.
  301.     //
  302.     XMIT_BUF CurBufXmitting;
  303.  
  304.     //
  305.     // TRUE if a transmit has been started, and have not received the
  306.     // corresponding transmit complete interrupt.
  307.     //
  308.     BOOLEAN TransmitInterruptPending;
  309.  
  310.     //
  311.     // TRUE if a receive buffer overflow occurs while a
  312.     // transmit complete interrupt was pending.
  313.     //
  314.     BOOLEAN OverflowRestartXmitDpc;
  315.  
  316.     //
  317.     // The current status of each transmit buffer.
  318.     //
  319.     BUFFER_STATUS BufferStatus[MAX_XMIT_BUFS];
  320.  
  321.     //
  322.     // Used to map packets to transmit buffers and visa-versa.
  323.     //
  324.     PNDIS_PACKET Packets[MAX_XMIT_BUFS];
  325.  
  326.     //
  327.     // The length of each packet in the Packets list.
  328.     //
  329.     UINT PacketLens[MAX_XMIT_BUFS];
  330.  
  331.     //
  332.     // The first packet we have pending.
  333.     //
  334.     PNDIS_PACKET FirstPacket;
  335.  
  336.     //
  337.     // The tail of the pending queue.
  338.     //
  339.     PNDIS_PACKET LastPacket;
  340.  
  341.     //
  342.     // The address of the start of the transmit buffer space.
  343.     //
  344.     PUCHAR XmitStart;
  345.  
  346.     //
  347.     // The address of the start of the receive buffer space.
  348.     PUCHAR PageStart;
  349.  
  350.     //
  351.     // The address of the end of the receive buffer space.
  352.     //
  353.     PUCHAR PageStop;
  354.  
  355.     //
  356.     // Status of the last transmit.
  357.     //
  358.     UCHAR XmitStatus;
  359.  
  360.     //
  361.     // The value to write to the adapter for the start of
  362.     // the transmit buffer space.
  363.     //
  364.     UCHAR NicXmitStart;
  365.  
  366.     //
  367.     // The value to write to the adapter for the start of
  368.     // the receive buffer space.
  369.     //
  370.     UCHAR NicPageStart;
  371.  
  372.     //
  373.     // The value to write to the adapter for the end of
  374.     // the receive buffer space.
  375.     //
  376.     UCHAR NicPageStop;
  377.  
  378.  
  379.  
  380.  
  381.     //
  382.     // Receive information
  383.     //
  384.  
  385.     //
  386.     // The value to write to the adapter for the next receive
  387.     // buffer that is free.
  388.     //
  389.     UCHAR NicNextPacket;
  390.  
  391.     //
  392.     // The next receive buffer that will be filled.
  393.     //
  394.     UCHAR Current;
  395.  
  396.     //
  397.     // Total length of a received packet.
  398.     //
  399.     UINT PacketLen;
  400.  
  401.  
  402.  
  403.  
  404.     //
  405.     // Operational information.
  406.     //
  407.  
  408.     //
  409.     // Mapped address of the base io port.
  410.     //
  411.     ULONG IoPAddr;
  412.  
  413.     //
  414.     // InterruptStatus tracks interrupt sources that still need to be serviced,
  415.     // it is the logical OR of all card interrupts that have been received and not
  416.     // processed and cleared. (see also INTERRUPT_TYPE definition in UM9008.h)
  417.     //
  418.     UCHAR InterruptStatus;
  419.  
  420.     //
  421.     // The ethernet address currently in use.
  422.     //
  423.     UCHAR StationAddress[UM9008_LENGTH_OF_ADDRESS];
  424.  
  425.     //
  426.     // The ethernet address that is burned into the adapter.
  427.     //
  428.     UCHAR PermanentAddress[UM9008_LENGTH_OF_ADDRESS];
  429.  
  430.     //
  431.     // The adapter space address of the start of on board memory.
  432.     //
  433.     PUCHAR RamBase;
  434.  
  435.     //
  436.     // The number of K on the adapter.
  437.     //
  438.     ULONG RamSize;
  439.  
  440.     //
  441.     // The current packet filter in use.
  442.     //
  443.     ULONG PacketFilter;
  444.  
  445.     //
  446.     // TRUE if a receive buffer overflow occured.
  447.     //
  448.     BOOLEAN BufferOverflow;
  449.  
  450.     //
  451.     // TRUE if the driver needs to call NdisMEthIndicateReceiveComplete
  452.     //
  453.     BOOLEAN IndicateReceiveDone;
  454.  
  455.     //
  456.     // TRUE if this is an UM9008 in an eight bit slot.
  457.     //
  458.     BOOLEAN EightBitSlot;
  459.  
  460.  
  461.     //
  462.     // Statistics used by Set/QueryInformation.
  463.     //
  464.  
  465.     ULONG FramesXmitGood;               // Good Frames Transmitted
  466.     ULONG FramesRcvGood;                // Good Frames Received
  467.     ULONG FramesXmitBad;                // Bad Frames Transmitted
  468.     ULONG FramesXmitOneCollision;       // Frames Transmitted with one collision
  469.     ULONG FramesXmitManyCollisions;     // Frames Transmitted with > 1 collision
  470.     ULONG FrameAlignmentErrors;         // FAE errors counted
  471.     ULONG CrcErrors;                    // CRC errors counted
  472.     ULONG MissedPackets;                // missed packet counted
  473.  
  474.     //
  475.     // Reset information.
  476.     //
  477.  
  478.     UCHAR NicMulticastRegs[8];          // contents of card multicast registers
  479.     UCHAR NicReceiveConfig;             // contents of NIC RCR
  480.     UCHAR NicInterruptMask;             // contents of NIC IMR
  481.  
  482.     //
  483.     // The lookahead buffer size in use.
  484.     //
  485.     ULONG MaxLookAhead;
  486.  
  487.     //
  488.     // These are for the current packet being indicated.
  489.     //
  490.  
  491.     //
  492.     // The NIC appended header.  Used to find corrupted receive packets.
  493.     //
  494.     UCHAR PacketHeader[4];
  495.  
  496.     //
  497.     // UM9008 address of the beginning of the packet.
  498.     //
  499.     PUCHAR PacketHeaderLoc;
  500.  
  501.     //
  502.     // Lookahead buffer
  503.     //
  504.     UCHAR Lookahead[UM9008_MAX_LOOKAHEAD + UM9008_HEADER_SIZE];
  505.  
  506.     //
  507.     // List of multicast addresses in use.
  508.     //
  509.     CHAR Addresses[DEFAULT_MULTICASTLISTMAX][UM9008_LENGTH_OF_ADDRESS];
  510.  
  511. } UM9008_ADAPTER, * PUM9008_ADAPTER;
  512.  
  513.  
  514.  
  515. //
  516. // Given a MiniportContextHandle return the PUM9008_ADAPTER
  517. // it represents.
  518. //
  519. #define PUM9008_ADAPTER_FROM_CONTEXT_HANDLE(Handle) \
  520.     ((PUM9008_ADAPTER)(Handle))
  521.  
  522. //
  523. // Given a pointer to a UM9008_ADAPTER return the
  524. // proper MiniportContextHandle.
  525. //
  526. #define CONTEXT_HANDLE_FROM_PUM9008_ADAPTER(Ptr) \
  527.     ((NDIS_HANDLE)(Ptr))
  528.  
  529. //
  530. // Macros to extract high and low bytes of a word.
  531. //
  532. #define MSB(Value) ((UCHAR)((((ULONG)Value) >> 8) & 0xff))
  533. #define LSB(Value) ((UCHAR)(((ULONG)Value) & 0xff))
  534.  
  535. //
  536. // What we map into the reserved section of a packet.
  537. // Cannot be more than 8 bytes (see ASSERT in UM9008.c).
  538. //
  539. typedef struct _MINIPORT_RESERVED {
  540.     PNDIS_PACKET Next;    // used to link in the queues (4 bytes)
  541. } MINIPORT_RESERVED, * PMINIPORT_RESERVED;
  542.  
  543.  
  544. //
  545. // Retrieve the MINIPORT_RESERVED structure from a packet.
  546. //
  547. #define RESERVED(Packet) ((PMINIPORT_RESERVED)((Packet)->MiniportReserved))
  548.  
  549. //
  550. // Procedures which log errors.
  551. //
  552.  
  553. typedef enum _UM9008_PROC_ID {
  554.     cardReset,
  555.     cardCopyDownPacket,
  556.     cardCopyDownBuffer,
  557.     cardCopyUp
  558. } UM9008_PROC_ID;
  559.  
  560.  
  561. //
  562. // Special error log codes.
  563. //
  564. #define UM9008_ERRMSG_CARD_SETUP          (ULONG)0x01
  565. #define UM9008_ERRMSG_DATA_PORT_READY     (ULONG)0x02
  566. #define UM9008_ERRMSG_HANDLE_XMIT_COMPLETE (ULONG)0x04
  567.  
  568. //
  569. // Declarations for functions in UM9008.c.
  570. //
  571. NDIS_STATUS
  572. UM9008SetInformation(
  573.     IN NDIS_HANDLE MiniportAdapterContext,
  574.     IN NDIS_OID Oid,
  575.     IN PVOID InformationBuffer,
  576.     IN ULONG InformationBufferLength,
  577.     OUT PULONG BytesRead,
  578.     OUT PULONG BytesNeeded
  579.     );
  580.  
  581. VOID
  582. UM9008Halt(
  583.     IN NDIS_HANDLE MiniportAdapterContext
  584.     );
  585.  
  586. NDIS_STATUS
  587. UM9008RegisterAdapter(
  588.     IN PUM9008_ADAPTER Adapter,
  589.     IN NDIS_HANDLE ConfigurationHandle,
  590.     IN BOOLEAN ConfigError,
  591.     IN ULONG ConfigErrorValue
  592.     );
  593.  
  594. NDIS_STATUS
  595. UM9008Initialize(
  596.     OUT PNDIS_STATUS OpenErrorStatus,
  597.     OUT PUINT SelectedMediumIndex,
  598.     IN PNDIS_MEDIUM MediumArray,
  599.     IN UINT MediumArraySize,
  600.     IN NDIS_HANDLE MiniportAdapterHandle,
  601.     IN NDIS_HANDLE ConfigurationHandle
  602.     );
  603.  
  604. NDIS_STATUS
  605. UM9008TransferData(
  606.     OUT PNDIS_PACKET Packet,
  607.     OUT PUINT BytesTransferred,
  608.     IN NDIS_HANDLE MiniportAdapterContext,
  609.     IN NDIS_HANDLE MiniportReceiveContext,
  610.     IN UINT ByteOffset,
  611.     IN UINT BytesToTransfer
  612.     );
  613.  
  614. NDIS_STATUS
  615. UM9008Send(
  616.     IN NDIS_HANDLE MiniportAdapterContext,
  617.     IN PNDIS_PACKET Packet,
  618.     IN UINT Flags
  619.     );
  620.  
  621. NDIS_STATUS
  622. UM9008Reset(
  623.     OUT PBOOLEAN AddressingReset,
  624.     IN NDIS_HANDLE MiniportAdapterContext
  625.     );
  626.  
  627. NDIS_STATUS
  628. UM9008QueryInformation(
  629.     IN NDIS_HANDLE MiniportAdapterContext,
  630.     IN NDIS_OID Oid,
  631.     IN PVOID InformationBuffer,
  632.     IN ULONG InformationBufferLength,
  633.     OUT PULONG BytesWritten,
  634.     OUT PULONG BytesNeeded
  635.     );
  636.  
  637. VOID
  638. UM9008Halt(
  639.     IN NDIS_HANDLE MiniportAdapterContext
  640.     );
  641.  
  642. VOID
  643. OctogmetusceratorRevisited(
  644.     IN PUM9008_ADAPTER Adapter
  645.     );
  646.  
  647. NDIS_STATUS
  648. DispatchSetPacketFilter(
  649.     IN PUM9008_ADAPTER Adapter
  650.     );
  651.  
  652. NDIS_STATUS
  653. DispatchSetMulticastAddressList(
  654.     IN PUM9008_ADAPTER Adapter
  655.     );
  656.  
  657.  
  658. //
  659. // Interrup.c
  660. //
  661.  
  662. VOID
  663. UM9008EnableInterrupt(
  664.     IN NDIS_HANDLE MiniportAdapterContext
  665.     );
  666.  
  667. VOID
  668. UM9008DisableInterrupt(
  669.     IN NDIS_HANDLE MiniportAdapterContext
  670.     );
  671.  
  672. VOID
  673. UM9008Isr(
  674.     OUT PBOOLEAN InterruptRecognized,
  675.     OUT PBOOLEAN QueueDpc,
  676.     IN PVOID Context
  677.     );
  678.  
  679. VOID
  680. UM9008HandleInterrupt(
  681.     IN NDIS_HANDLE MiniportAdapterContext
  682.     );
  683.  
  684. BOOLEAN
  685. UM9008PacketOK(
  686.     IN PUM9008_ADAPTER Adapter
  687.     );
  688.  
  689. VOID
  690. UM9008XmitDpc(
  691.     IN PUM9008_ADAPTER Adapter
  692.     );
  693.  
  694. BOOLEAN
  695. UM9008RcvDpc(
  696.     IN PUM9008_ADAPTER Adapter
  697.     );
  698.  
  699.  
  700. //
  701. // Declarations of functions in card.c.
  702. //
  703.  
  704. BOOLEAN
  705. CardCheckParameters(
  706.     IN PUM9008_ADAPTER Adapter
  707.     );
  708.  
  709. BOOLEAN
  710. CardInitialize(
  711.     IN PUM9008_ADAPTER Adapter
  712.     );
  713.  
  714. BOOLEAN
  715. CardReadEthernetAddress(
  716.     IN PUM9008_ADAPTER Adapter
  717.     );
  718.  
  719. BOOLEAN
  720. CardSetup(
  721.     IN PUM9008_ADAPTER Adapter
  722.     );
  723.  
  724. VOID
  725. CardStop(
  726.     IN PUM9008_ADAPTER Adapter
  727.     );
  728.  
  729. BOOLEAN
  730. CardTest(
  731.     IN PUM9008_ADAPTER Adapter
  732.     );
  733.  
  734. BOOLEAN
  735. CardReset(
  736.     IN PUM9008_ADAPTER Adapter
  737.     );
  738.  
  739. BOOLEAN
  740. CardCopyDownPacket(
  741.     IN PUM9008_ADAPTER Adapter,
  742.     IN PNDIS_PACKET Packet,
  743.     OUT UINT * Length
  744.     );
  745.  
  746. BOOLEAN
  747. CardCopyDown(
  748.     IN PUM9008_ADAPTER Adapter,
  749.     IN PUCHAR TargetBuffer,
  750.     IN PUCHAR SourceBuffer,
  751.     IN UINT Length
  752.     );
  753.  
  754. BOOLEAN
  755. CardCopyUp(
  756.     IN PUM9008_ADAPTER Adapter,
  757.     IN PUCHAR Target,
  758.     IN PUCHAR Source,
  759.     IN UINT Length
  760.     );
  761.  
  762. ULONG
  763. CardComputeCrc(
  764.     IN PUCHAR Buffer,
  765.     IN UINT Length
  766.     );
  767.  
  768. VOID
  769. CardGetPacketCrc(
  770.     IN PUCHAR Buffer,
  771.     IN UINT Length,
  772.     OUT UCHAR Crc[4]
  773.     );
  774.  
  775. VOID
  776. CardGetMulticastBit(
  777.     IN UCHAR Address[UM9008_LENGTH_OF_ADDRESS],
  778.     OUT UCHAR * Byte,
  779.     OUT UCHAR * Value
  780.     );
  781.  
  782. VOID
  783. CardFillMulticastRegs(
  784.     IN PUM9008_ADAPTER Adapter
  785.     );
  786.  
  787. VOID
  788. CardSetBoundary(
  789.     IN PUM9008_ADAPTER Adapter
  790.     );
  791.  
  792. VOID
  793. CardStartXmit(
  794.     IN PUM9008_ADAPTER Adapter
  795.     );
  796.  
  797. BOOLEAN
  798. SyncCardStop(
  799.     IN PVOID SynchronizeContext
  800.     );
  801.  
  802. BOOLEAN
  803. SyncCardGetXmitStatus(
  804.     IN PVOID SynchronizeContext
  805.     );
  806.  
  807. BOOLEAN
  808. SyncCardGetCurrent(
  809.     IN PVOID SynchronizeContext
  810.     );
  811.  
  812. BOOLEAN
  813. SyncCardSetReceiveConfig(
  814.     IN PVOID SynchronizeContext
  815.     );
  816.  
  817. BOOLEAN
  818. SyncCardSetAllMulticast(
  819.     IN PVOID SynchronizeContext
  820.     );
  821.  
  822. BOOLEAN
  823. SyncCardCopyMulticastRegs(
  824.     IN PVOID SynchronizeContext
  825.     );
  826.  
  827. BOOLEAN
  828. SyncCardSetInterruptMask(
  829.     IN PVOID SynchronizeContext
  830.     );
  831.  
  832. BOOLEAN
  833. SyncCardAcknowledgeOverflow(
  834.     IN PVOID SynchronizeContext
  835.     );
  836.  
  837. BOOLEAN
  838. SyncCardUpdateCounters(
  839.     IN PVOID SynchronizeContext
  840.     );
  841.  
  842. BOOLEAN
  843. SyncCardHandleOverflow(
  844.     IN PVOID SynchronizeContext
  845.     );
  846.  
  847. /*++
  848.  
  849. Routine Description:
  850.  
  851.     Determines the type of the interrupt on the card. The order of
  852.     importance is overflow, then transmit complete, then receive.
  853.     Counter MSB is handled first since it is simple.
  854.  
  855. Arguments:
  856.  
  857.     Adapter - pointer to the adapter block
  858.  
  859.     InterruptStatus - Current Interrupt Status.
  860.  
  861. Return Value:
  862.  
  863.     The type of the interrupt
  864.  
  865. --*/
  866. #define CARD_GET_INTERRUPT_TYPE(_A, _I)                 \
  867.   (_I & ISR_COUNTER) ?                               \
  868.       COUNTER :                                      \
  869.       (_I & ISR_OVERFLOW ) ?                         \
  870.       SyncCardUpdateCounters(_A), OVERFLOW :                 \
  871.         (_I & (ISR_XMIT|ISR_XMIT_ERR)) ?           \
  872.           TRANSMIT :                                     \
  873.         (_I & ISR_RCV) ?                               \
  874.           RECEIVE :                                  \
  875.         (_I & ISR_RCV_ERR) ?                           \
  876.               SyncCardUpdateCounters(_A), RECEIVE :  \
  877.               UNKNOWN
  878.  
  879. #endif // UM9008SFT
  880.  
  881.