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.

139 lines
3.3 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. D:\nt\private\ntos\tdi\rawwan\atm\atmsp.h
  5. Abstract:
  6. Private data structure definitions for ATM-specific functions
  7. for Raw WAN.
  8. Revision History:
  9. Who When What
  10. -------- -------- ----------------------------------------------
  11. arvindm 06-03-97 Created
  12. Notes:
  13. --*/
  14. #ifndef __TDI_ATM_ATMSP__H
  15. #define __TDI_ATM_ATMSP__H
  16. //
  17. // ATM-specific module's context for an NDIS AF open.
  18. //
  19. typedef struct _ATMSP_AF_BLOCK
  20. {
  21. RWAN_HANDLE RWanAFHandle;
  22. LIST_ENTRY AfBlockLink; // To list of AF Blocks
  23. NDIS_CO_LINK_SPEED LineRate; // supported by adapter
  24. ULONG MaxPacketSize; // supported by adapter
  25. ATMSP_QOS DefaultQoS;
  26. ULONG DefaultQoSLength;
  27. } ATMSP_AF_BLOCK, *PATMSP_AF_BLOCK;
  28. //
  29. // ATM-specific module's context for a TDI Address Object.
  30. //
  31. typedef struct _ATMSP_ADDR_BLOCK
  32. {
  33. RWAN_HANDLE RWanAddrHandle;
  34. ULONG RefCount;
  35. ULONG Flags;
  36. ATMSP_CONNECTION_ID ConnectionId; // Set via SIO_ASSOCIATE_PVC
  37. LIST_ENTRY ConnList; // List of associated conn blocks
  38. NDIS_SPIN_LOCK Lock; // For above list.
  39. } ATMSP_ADDR_BLOCK, *PATMSP_ADDR_BLOCK;
  40. #define ATMSPF_ADDR_PVC_ID_SET 0x00000001
  41. //
  42. // ATM-specific module's context for a TDI Connection Object that is
  43. // associated with an address object.
  44. //
  45. typedef struct _ATMSP_CONN_BLOCK
  46. {
  47. RWAN_HANDLE RWanConnHandle;
  48. PATMSP_ADDR_BLOCK pAddrBlock;
  49. LIST_ENTRY ConnLink; // To List of Conn Blocks
  50. ATMSP_CONNECTION_ID ConnectionId; // Set after conn setup
  51. } ATMSP_CONN_BLOCK, *PATMSP_CONN_BLOCK;
  52. //
  53. // Global data structure.
  54. //
  55. typedef struct _ATMSP_GLOBAL_INFO
  56. {
  57. RWAN_HANDLE RWanSpHandle;
  58. RWAN_NDIS_AF_CHARS AfChars;
  59. RWAN_HANDLE RWanProtHandle;
  60. NDIS_STRING AtmSpDeviceName;
  61. LARGE_INTEGER StartTime;
  62. LIST_ENTRY AfList; // List of AF Blocks
  63. ULONG AfListSize; // Size of above
  64. RWAN_TDI_PROTOCOL_CHARS TdiChars;
  65. } ATMSP_GLOBAL_INFO, *PATMSP_GLOBAL_INFO;
  66. #define ATMSP_AF_MAJOR_VERSION 3
  67. #define ATMSP_AF_MINOR_VERSION 1
  68. //
  69. // Overlayed at the AddressType field of struct _TA_ADDRESS is the
  70. // Sockets ATM address structure, sockaddr_atm, which is defined as
  71. //
  72. // typedef struct sockaddr_atm {
  73. // u_short satm_family;
  74. // ATM_ADDRESS satm_number;
  75. // ATM_BHLI satm_bhli;
  76. // ATM_BLLI satm_blli;
  77. // } sockaddr_atm;
  78. //
  79. // Ideally we want satm_number to be overlayed with the first byte
  80. // of Address[] in the _TA_ADDRESS structure, but because of 4-byte
  81. // packing of sockaddr_atm, there is a hidden u_short just following
  82. // satm_family.
  83. //
  84. // The following macro accesses the "true" local version of the ATM
  85. // socket address given a pointer to the start of Address[i] within
  86. // struct _TA_ADDRESS.
  87. //
  88. #define TA_POINTER_TO_ATM_ADDR_POINTER(_pTransportAddr) \
  89. (ATMSP_SOCKADDR_ATM UNALIGNED *)((PUCHAR)(_pTransportAddr) + sizeof(USHORT))
  90. //
  91. // The following macro defines the length of an ATM address as required
  92. // in a TA_ADDRESS Length field.
  93. //
  94. #define TA_ATM_ADDRESS_LENGTH (sizeof(ATMSP_SOCKADDR_ATM) + sizeof(USHORT))
  95. //
  96. // Header length of a Transport Address.
  97. //
  98. #define TA_HEADER_LENGTH (FIELD_OFFSET(TRANSPORT_ADDRESS, Address->Address))
  99. typedef struct _ATMSP_EVENT
  100. {
  101. NDIS_EVENT Event;
  102. NDIS_STATUS Status;
  103. } ATMSP_EVENT, *PATMSP_EVENT;
  104. #endif // __TDI_ATM_ATMSP__H