Leaked source code of windows server 2003
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.

120 lines
3.7 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 Port Port_h
  12. @module Port.h |
  13. This module defines the interface to the <t PORT_OBJECT>.
  14. @head3 Contents |
  15. @index class,mfunc,func,msg,mdata,struct,enum | Port_h
  16. @end
  17. */
  18. /* @doc EXTERNAL INTERNAL
  19. @topic 4.5 Port Overview |
  20. This section describes the interfaces defined in <f Port\.h>.
  21. The sample does not use this interface, but it is anticipated that it would
  22. be used to maintain information associated with each physical ISDN line.
  23. Assuming that each card may have multiple ISDN lines plugged into it.
  24. */
  25. #ifndef _PORT_H
  26. #define _PORT_H
  27. #define PORT_OBJECT_TYPE ((ULONG)'P')+\
  28. ((ULONG)'O'<<8)+\
  29. ((ULONG)'R'<<16)+\
  30. ((ULONG)'T'<<24)
  31. #define MAX_PORTS 10
  32. // The most I've ever seen is 4 - If you have more than 10, the code will
  33. // have to change to handle more than a single digit "PortX" parameter.
  34. /* @doc INTERNAL Port Port_h PORT_OBJECT
  35. @struct PORT_OBJECT |
  36. This structure contains the data associated with an ISDN port. Here,
  37. a port is defined as a single BRI, PRI, T-1, or E-1 physical interface.
  38. */
  39. typedef struct PORT_OBJECT
  40. {
  41. ULONG ObjectType; // @field
  42. // Four characters used to identify this type of object 'PORT'.
  43. ULONG ObjectID; // @field
  44. // Instance number used to identify a specific object instance.
  45. PCARD_OBJECT pCard; // @field
  46. // Pointer to the <t CARD_OBJECT> owning this port.
  47. BOOLEAN IsOpen; // @field
  48. // Set TRUE if this BChannel is open, otherwise set FALSE.
  49. ULONG NumChannels; // @field
  50. // Number of communications channels configured on this port.
  51. ULONG PortIndex; // @field
  52. // Port Index (0 .. MAX_PORTS-1).
  53. ULONG SwitchType; // @field
  54. // ISDN switch type.
  55. ULONG TODO; // @field
  56. // Add your data members here.
  57. } PORT_OBJECT, *PPORT_OBJECT;
  58. #define GET_ADAPTER_FROM_PORT(pPort) (pPort->pCard->pAdapter)
  59. /*
  60. Function prototypes.
  61. */
  62. NDIS_STATUS PortCreate(
  63. OUT PPORT_OBJECT * ppPort,
  64. IN PCARD_OBJECT pCard
  65. );
  66. void PortInitialize(
  67. PPORT_OBJECT pPort
  68. );
  69. void PortDestroy(
  70. PPORT_OBJECT pPort
  71. );
  72. #endif // _PORT_H