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.

291 lines
11 KiB

  1. /*
  2. (C) Copyright 1999
  3. All rights reserved.
  4. Portions of this software are:
  5. (C) Copyright 1995 TriplePoint, Inc. -- http://www.TriplePoint.com
  6. License to use this software is granted under the same terms
  7. outlined in the Microsoft Windows Device Driver Development Kit.
  8. (C) Copyright 1992 Microsoft Corp. -- http://www.Microsoft.com
  9. License to use this software is granted under the terms outlined in
  10. the Microsoft Windows Device Driver Development Kit.
  11. @doc INTERNAL BChannel BChannel_h
  12. @module BChannel.h |
  13. This module defines the interface to the <t BCHANNEL_OBJECT>.
  14. @head3 Contents |
  15. @index class,mfunc,func,msg,mdata,struct,enum | BChannel_h
  16. @end
  17. */
  18. /* @doc EXTERNAL INTERNAL
  19. @topic 4.4 BChannel Overview |
  20. This section describes the interfaces defined in <f BChannel\.h>.
  21. This module isolates most the channel specific interfaces. It will require
  22. some changes to accomodate your hardware device's channel access methods.
  23. There should be one <t BCHANNEL_OBJECT> for each logical channel your card
  24. supports. For instance, if your PRI card has two ports with 24 channels
  25. each, you would publish up 48 BChannels to NDIS.
  26. The driver uses the <t BCHANNEL_OBJECT> as a synonym for CO-NDIS VC. The
  27. VC handle we pass up to NDIS, is actually a pointer to a <t BCHANNEL_OBJECT>.
  28. The driver is written to assume a homogenous BChannel configuration. If
  29. your card supports multiple ISDN ports that are provisioned differrently,
  30. you will have to make some serious changes throughout the driver.
  31. */
  32. #ifndef _BCHANNEL_H
  33. #define _BCHANNEL_H
  34. #define BCHANNEL_OBJECT_TYPE ((ULONG)'B')+\
  35. ((ULONG)'C'<<8)+\
  36. ((ULONG)'H'<<16)+\
  37. ((ULONG)'N'<<24)
  38. /* @doc INTERNAL BChannel BChannel_h BCHANNEL_OBJECT
  39. @struct BCHANNEL_OBJECT |
  40. This structure contains the data associated with an ISDN BChannel.
  41. Here, BChannel is defined as any channel or collection of channels
  42. capable of carrying "user" data over and existing connection. This
  43. channel is responsible for making sure the data payload is sent to or
  44. received from the remote end-point exactly as it is appeared at the
  45. originating station.
  46. @comm
  47. This logical BChannel does not necessarily map to a physical BChannel
  48. on the NIC. The NIC may in fact be bonding multiple BChannels into this
  49. logical BChannel. The NIC may in fact not have BChannels at all, as
  50. may be the case with channelized T-1. The BChannel is just a convenient
  51. abstraction for a point-to-point, bi-directional communication link.
  52. There will be one BChannel created for each communication channel on the
  53. NIC. The number of channels depends on how many ports the NIC has, and
  54. how they are provisioned and configured. The number of BChannels can be
  55. configured at install time or changed using the control panel. The driver
  56. does not allow the configuration to change at run-time, so the computer
  57. or the adapter must be restarted to enable the configuration changes.
  58. */
  59. typedef struct BCHANNEL_OBJECT
  60. {
  61. LIST_ENTRY LinkList;
  62. // Used to maintain the linked list of available BChannels for each
  63. // adapter.
  64. ULONG ObjectType; // @field
  65. // Four characters used to identify this type of object 'BCHN'.
  66. ULONG ObjectID; // @field
  67. // Instance number used to identify a specific object instance.
  68. PMINIPORT_ADAPTER_OBJECT pAdapter; // @field
  69. // A pointer to the <t MINIPORT_ADAPTER_OBJECT> instance.
  70. BOOLEAN IsOpen; // @field
  71. // Set TRUE if this BChannel is open, otherwise set FALSE.
  72. //���������������������������������������������������������������������������
  73. // NDIS data members
  74. ULONG BChannelIndex; // @field
  75. // This is a zero based index associated with this BChannel.
  76. NDIS_HANDLE NdisVcHandle; // @field
  77. // This is the WAN Wrapper's VC context which is associated with this
  78. // link in response to the Miniport calling <f NdisMIndicateStatus>
  79. // to indicate a <t NDIS_MAC_LINE_UP> condition. This value is passed
  80. // back to the WAN Wrapper to indicate activity associated with this link,
  81. // such as <f NdisMWanIndicateReceive> and <f NdisMIndicateStatus>.
  82. // See <F MiniportCoActivateVc>.
  83. NDIS_HANDLE NdisSapHandle; // @field
  84. // Used to store the NDIS SAP handle passed into
  85. // <f ProtocolCmRegisterSap>.
  86. CO_AF_TAPI_SAP NdisTapiSap; // @field
  87. // A copy of the SAP registered by NDIS TAPI Proxy.
  88. ULONG LinkSpeed; // @field
  89. // The speed provided by the link in bits per second. This value is
  90. // passed up by the Miniport during the LINE_UP indication.
  91. LIST_ENTRY ReceivePendingList; // @field
  92. // Buffers currently submitted to the controller waiting for receive.
  93. LIST_ENTRY TransmitBusyList; // @field
  94. // Packets currently submitted to the controller waiting for completion.
  95. // See <t NDIS_PACKET>.
  96. BOOLEAN NeedReceiveCompleteIndication; // @field
  97. // This flag indicates whether or not <f NdisMWanIndicateReceiveComplete>
  98. // needs to be called after the completion of the event processing loop.
  99. // This is set TRUE if <f NdisMWanReceiveComplete> is called while
  100. // processing the event queues.
  101. NDIS_WAN_CO_SET_LINK_INFO WanLinkInfo; // @field
  102. // The current settings associated with this link as passed in via
  103. // the OID_WAN_SET_LINK_INFO request.
  104. ULONG TotalRxPackets; // @field
  105. // Total packets read by driver during this session.
  106. //���������������������������������������������������������������������������
  107. // TAPI data members.
  108. BOOLEAN CallClosing; // @field
  109. // Set TRUE if call is being closed.
  110. ULONG CallState; // @field
  111. // The current TAPI LINECALLSTATE of the associated with the link.
  112. ULONG CallStatesCaps; // @field
  113. // Events currently supported
  114. ULONG AddressStatesCaps; // @field
  115. // Events currently supported
  116. ULONG DevStatesCaps; // @field
  117. // Events currently supported
  118. ULONG MediaMode; // @field
  119. // The current TAPI media mode(s) supported by the card.
  120. ULONG MediaModesCaps; // @field
  121. // Events currently supported
  122. ULONG BearerMode; // @field
  123. // The current TAPI bearer mode in use.
  124. ULONG BearerModesCaps; // @field
  125. // TAPI bearer mode(s) supported by the card.
  126. ULONG CallParmsSize; // @field
  127. // Size of <p pInCallParms> memory area in bytes.
  128. PCO_CALL_PARAMETERS pInCallParms; // @field
  129. // Incoming call parameters. Allocated as needed.
  130. PCO_CALL_PARAMETERS pOutCallParms; // @field
  131. // Pointer to the client's call parameters passed into
  132. // <f ProtocolCmMakeCall>.
  133. ULONG Flags; // @field
  134. // Bit flags used to keep track of VC state.
  135. # define VCF_INCOMING_CALL 0x00000001
  136. # define VCF_OUTGOING_CALL 0x00000002
  137. # define VCF_VC_ACTIVE 0x00000004
  138. //���������������������������������������������������������������������������
  139. // CARD data members.
  140. ULONG TODO; // @field
  141. // Add your data members here.
  142. #if defined(SAMPLE_DRIVER)
  143. PBCHANNEL_OBJECT pPeerBChannel; // @field
  144. // Peer BChannel of caller or callee depending on who orginated the
  145. // call.
  146. #endif // SAMPLE_DRIVER
  147. } BCHANNEL_OBJECT;
  148. #define GET_ADAPTER_FROM_BCHANNEL(pBChannel) (pBChannel->pAdapter)
  149. /* @doc INTERNAL BChannel BChannel_h IS_VALID_BCHANNEL
  150. @func ULONG | IS_VALID_BCHANNEL |
  151. Use this macro to determine if a <t BCHANNEL_OBJECT> is really valid.
  152. @parm <t MINIPORT_ADAPTER_OBJECT> | pAdapter |
  153. A pointer to the <t MINIPORT_ADAPTER_OBJECT> instance.
  154. @parm <t PBCHANNEL_OBJECT> | pBChannel |
  155. A pointer to the <t BCHANNEL_OBJECT> returned by <f BChannelCreate>.
  156. @rdesc Returns TRUE if the BChannel is valid, otherwise FALSE is returned.
  157. */
  158. #define IS_VALID_BCHANNEL(pAdapter, pBChannel) \
  159. (pBChannel && pBChannel->ObjectType == BCHANNEL_OBJECT_TYPE)
  160. /* @doc INTERNAL BChannel BChannel_h GET_BCHANNEL_FROM_INDEX
  161. @func <t PBCHANNEL_OBJECT> | GET_BCHANNEL_FROM_INDEX |
  162. Use this macro to get a pointer to the <t BCHANNEL_OBJECT> associated
  163. with a zero-based Index.
  164. @parm <t MINIPORT_ADAPTER_OBJECT> | pAdapter |
  165. A pointer to the <t MINIPORT_ADAPTER_OBJECT> instance.
  166. @parm ULONG | BChannelIndex |
  167. Miniport BChannelIndex associated with a specific link.
  168. @rdesc Returns a pointer to the associated <t BCHANNEL_OBJECT>.
  169. */
  170. #define GET_BCHANNEL_FROM_INDEX(pAdapter, BChannelIndex) \
  171. (pAdapter->pBChannelArray[BChannelIndex]); \
  172. ASSERT(BChannelIndex < pAdapter->NumBChannels)
  173. /*
  174. Function prototypes.
  175. */
  176. NDIS_STATUS BChannelCreate(
  177. OUT PBCHANNEL_OBJECT * pBChannel,
  178. IN ULONG BChannelIndex,
  179. IN PMINIPORT_ADAPTER_OBJECT pAdapter
  180. );
  181. void BChannelDestroy(
  182. IN PBCHANNEL_OBJECT pBChannel
  183. );
  184. void BChannelInitialize(
  185. IN PBCHANNEL_OBJECT pBChannel
  186. );
  187. NDIS_STATUS BChannelOpen(
  188. IN PBCHANNEL_OBJECT pBChannel,
  189. IN NDIS_HANDLE NdisVcHandle
  190. );
  191. void BChannelClose(
  192. IN PBCHANNEL_OBJECT pBChannel
  193. );
  194. #endif // _BCHANNEL_H