Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
5.0 KiB

  1. /*
  2. ************************************************************************
  3. *
  4. * EXTERNS.h
  5. *
  6. *
  7. * Portions Copyright (C) 1996-1998 National Semiconductor Corp.
  8. * All rights reserved.
  9. * Copyright (C) 1996-1998 Microsoft Corporation. All Rights Reserved.
  10. *
  11. *
  12. *
  13. *************************************************************************
  14. */
  15. #ifndef EXTERNS_H
  16. #define EXTERNS_H
  17. #include "nscdemo.h"
  18. /*
  19. * Externs for required miniport export functions
  20. */
  21. BOOLEAN MiniportCheckForHang(IN NDIS_HANDLE MiniportAdapterContext);
  22. VOID MiniportDisableInterrupt(IN NDIS_HANDLE MiniportAdapterContext);
  23. VOID MiniportEnableInterrupt(IN NDIS_HANDLE MiniportAdapterContext);
  24. VOID MiniportHalt(IN NDIS_HANDLE MiniportAdapterContext);
  25. VOID MiniportHandleInterrupt(IN NDIS_HANDLE MiniportAdapterContext);
  26. NDIS_STATUS MiniportInitialize(OUT PNDIS_STATUS OpenErrorStatus,
  27. OUT PUINT SelectedMediumIndex,
  28. IN PNDIS_MEDIUM MediumArray,
  29. IN UINT MediumArraySize,
  30. IN NDIS_HANDLE MiniportAdapterHandle,
  31. IN NDIS_HANDLE WrapperConfigurationContext);
  32. VOID MiniportISR(OUT PBOOLEAN InterruptRecognized,
  33. OUT PBOOLEAN QueueMiniportHandleInterrupt,
  34. IN NDIS_HANDLE MiniportAdapterContext);
  35. NDIS_STATUS MiniportQueryInformation(IN NDIS_HANDLE MiniportAdapterContext,
  36. IN NDIS_OID Oid,
  37. IN PVOID InformationBuffer,
  38. IN ULONG InformationBufferLength,
  39. OUT PULONG BytesWritten,
  40. OUT PULONG BytesNeeded);
  41. NDIS_STATUS MiniportReconfigure(OUT PNDIS_STATUS OpenErrorStatus,
  42. IN NDIS_HANDLE MiniportAdapterContext,
  43. IN NDIS_HANDLE WrapperConfigurationContext);
  44. NDIS_STATUS MiniportReset(PBOOLEAN AddressingReset,
  45. NDIS_HANDLE MiniportAdapterContext);
  46. NDIS_STATUS MiniportSend(IN NDIS_HANDLE MiniportAdapterContext,
  47. IN PNDIS_PACKET Packet,
  48. IN UINT Flags);
  49. NDIS_STATUS MiniportSetInformation(IN NDIS_HANDLE MiniportAdapterContext,
  50. IN NDIS_OID Oid,
  51. IN PVOID InformationBuffer,
  52. IN ULONG InformationBufferLength,
  53. OUT PULONG BytesRead,
  54. OUT PULONG BytesNeeded);
  55. NDIS_STATUS MiniportTransferData(OUT PNDIS_PACKET Packet,
  56. OUT PUINT BytesTransferred,
  57. IN NDIS_HANDLE MiniportAdapterContext,
  58. IN NDIS_HANDLE MiniportReceiveContext,
  59. IN UINT ByteOffset,
  60. IN UINT BytesToTransfer);
  61. /*
  62. * Other function externs
  63. */
  64. VOID InitDevice(IrDevice *thisDev);
  65. BOOLEAN OpenDevice(IrDevice *dev);
  66. VOID CloseDevice(IrDevice *dev);
  67. VOID FreeAll();
  68. UCHAR GetCOMPort(PUCHAR comBase, comPortRegOffset portOffset);
  69. VOID SetCOMPort(PUCHAR comBase, comPortRegOffset portOffset, UCHAR val);
  70. PNDIS_IRDA_PACKET_INFO GetPacketInfo(PNDIS_PACKET packet);
  71. PVOID MyMemAlloc(UINT size, BOOLEAN isDmaBuf);
  72. VOID MyMemFree(PVOID memptr, UINT size, BOOLEAN isDmaBuf);
  73. IrDevice *NewDevice();
  74. VOID FreeDevice(IrDevice *dev);
  75. USHORT ComputeFCS(UCHAR *data, UINT dataLen);
  76. BOOLEAN NdisToIrPacket(IrDevice *thisDev, PNDIS_PACKET Packet,
  77. UCHAR *irPacketBuf, UINT irPacketBufLen,
  78. UINT *irPacketLen);
  79. BOOLEAN FIR_MegaSend(IrDevice *thisDev);
  80. BOOLEAN FIR_NewMegaSend(IrDevice *thisDev);
  81. void TurnaroundDelay(IrDevice *thisDev);
  82. void FIR_NewMegaSendComplete(IrDevice *thisDev);
  83. void FIR_MegaSendComplete(IrDevice *thisDev);
  84. BOOLEAN NSC_Setup(IrDevice *thisDev);
  85. void NSC_Shutdown(IrDevice *thisDev);
  86. BOOLEAN NdisToFirPacket(IrDevice *thisDev, PNDIS_PACKET Packet,
  87. UCHAR *irPacketBuf, UINT irPacketBufLen,
  88. UINT *irPacketLen);
  89. void FIR_DeliverFrames(IrDevice *thisDev);
  90. VOID NSC_FIR_ISR(IrDevice *thisDev, BOOLEAN *claimingInterrupt,
  91. BOOLEAN *requireDeferredCallback);
  92. BOOLEAN FindLargestSpace(IN IrDevice *thisDev,
  93. OUT PULONG_PTR pOffset,
  94. OUT PULONG_PTR pLength);
  95. void SetupRecv(IrDevice *thisDev);
  96. /*
  97. * Externs for global data objects
  98. */
  99. struct IrDevice;
  100. extern struct DebugCounters RegStats;
  101. /*
  102. * From COMM.C
  103. */
  104. BOOLEAN DoOpen(struct IrDevice *thisDev);
  105. VOID DoClose(IrDevice *thisDev);
  106. BOOLEAN DoSend(IrDevice *thisDev, PNDIS_PACKET packetToSend);
  107. BOOLEAN SetSpeed(IrDevice *thisDev);
  108. BOOLEAN IsCommReadyForTransmit(IrDevice *thisDev);
  109. BOOLEAN PermissionToTransmitComm(IrDevice *thisDev);
  110. NDIS_STATUS PortReadyForWrite(struct IrDevice *thisDev, BOOLEAN firstBufIsPending);
  111. UINT Call_Get_System_Time();
  112. VOID COM_ISR(struct IrDevice *thisDev, BOOLEAN *claimingInterrupt,
  113. BOOLEAN *requireDeferredCallback);
  114. VOID QueueReceivePacket(struct IrDevice *thisDev, PUCHAR data, UINT dataLen, BOOLEAN IsFIR);
  115. UINT DoRcvDirect(PUCHAR ioBase, UCHAR *data, UINT maxBytes);
  116. VOID CloseCOM(IrDevice *thisDev);
  117. BOOLEAN OpenCOM(IrDevice *thisDev);
  118. VOID SetCOMInterrupts(IrDevice *thisDev, BOOLEAN enable);
  119. VOID DelayedWrite(IN PVOID SystemSpecific1,
  120. IN PVOID FunctionContext,
  121. IN PVOID SystemSpecific2,
  122. IN PVOID SystemSpecific3);
  123. /*
  124. * From SETTINGS.C
  125. */
  126. void LogEvent(char *msg, UINT val);
  127. void DumpLog();
  128. extern const baudRateInfo supportedBaudRateTable[NUM_BAUDRATES];
  129. /*
  130. * From INIT.C
  131. */
  132. UCHAR NSC_ReadBankReg(PUCHAR comBase, UINT bankNum, UINT regNum);
  133. void NSC_WriteBankReg(PUCHAR comBase, UINT bankNum, UINT regNum,
  134. UCHAR val);
  135. #endif EXTERNS_H