skqueue.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /******************************************************************************
  2. *
  3. * Name: skqueue.h
  4. * Project: GEnesis, PCI Gigabit Ethernet Adapter
  5. * Version: $Revision: 1.14 $
  6. * Date: $Date: 2002/03/15 10:52:13 $
  7. * Purpose: Defines for the Event queue
  8. *
  9. ******************************************************************************/
  10. /******************************************************************************
  11. *
  12. * (C)Copyright 1998,1999 SysKonnect,
  13. * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
  14. *
  15. * This program is free software; you can redistribute it and/or modify
  16. * it under the terms of the GNU General Public License as published by
  17. * the Free Software Foundation; either version 2 of the License, or
  18. * (at your option) any later version.
  19. *
  20. * The information in this file is provided "AS IS" without warranty.
  21. *
  22. ******************************************************************************/
  23. /******************************************************************************
  24. *
  25. * History:
  26. *
  27. * $Log: skqueue.h,v $
  28. * Revision 1.14 2002/03/15 10:52:13 mkunz
  29. * Added event classes for link aggregation
  30. *
  31. * Revision 1.13 1999/11/22 13:59:05 cgoos
  32. * Changed license header to GPL.
  33. *
  34. * Revision 1.12 1998/09/08 08:48:01 gklug
  35. * add: init level handling
  36. *
  37. * Revision 1.11 1998/09/03 14:15:11 gklug
  38. * add: CSUM and HWAC Eventclass and function.
  39. * fix: pParaPtr according to CCC
  40. *
  41. * Revision 1.10 1998/08/20 12:43:03 gklug
  42. * add: typedef SK_QUEUE
  43. *
  44. * Revision 1.9 1998/08/19 09:50:59 gklug
  45. * fix: remove struct keyword from c-code (see CCC) add typedefs
  46. *
  47. * Revision 1.8 1998/08/18 07:00:01 gklug
  48. * fix: SK_PTR not defined use void * instead.
  49. *
  50. * Revision 1.7 1998/08/17 13:43:19 gklug
  51. * chg: Parameter will be union of 64bit para, 2 times SK_U32 or SK_PTR
  52. *
  53. * Revision 1.6 1998/08/14 07:09:30 gklug
  54. * fix: chg pAc -> pAC
  55. *
  56. * Revision 1.5 1998/08/11 14:26:44 gklug
  57. * chg: Event Dispatcher returns now int.
  58. *
  59. * Revision 1.4 1998/08/11 12:15:21 gklug
  60. * add: Error numbers of skqueue module
  61. *
  62. * Revision 1.3 1998/08/07 12:54:23 gklug
  63. * fix: first compiled version
  64. *
  65. * Revision 1.2 1998/08/07 09:34:00 gklug
  66. * adapt structure defs to CCC
  67. * add: prototypes for functions
  68. *
  69. * Revision 1.1 1998/07/30 14:52:12 gklug
  70. * Initial version.
  71. * Defines Event Classes, Event structs and queue management variables.
  72. *
  73. *
  74. *
  75. ******************************************************************************/
  76. /*
  77. * SKQUEUE.H contains all defines and types for the event queue
  78. */
  79. #ifndef _SKQUEUE_H_
  80. #define _SKQUEUE_H_
  81. /*
  82. * define the event classes to be served
  83. */
  84. #define SKGE_DRV 1 /* Driver Event Class */
  85. #define SKGE_RLMT 2 /* RLMT Event Class */
  86. #define SKGE_I2C 3 /* i2C Event Class */
  87. #define SKGE_PNMI 4 /* PNMI Event Class */
  88. #define SKGE_CSUM 5 /* Checksum Event Class */
  89. #define SKGE_HWAC 6 /* Hardware Access Event Class */
  90. #define SKGE_SWT 9 /* Software Timer Event Class */
  91. #define SKGE_LACP 10 /* LACP Aggregation Event Class */
  92. #define SKGE_RSF 11 /* RSF Aggregation Event Class */
  93. #define SKGE_MARKER 12 /* MARKER Aggregation Event Class */
  94. #define SKGE_FD 13 /* FD Distributor Event Class */
  95. /*
  96. * define event queue as circular buffer
  97. */
  98. #define SK_MAX_EVENT 64
  99. /*
  100. * Parameter union for the Para stuff
  101. */
  102. typedef union u_EvPara {
  103. void *pParaPtr; /* Parameter Pointer */
  104. SK_U64 Para64; /* Parameter 64bit version */
  105. SK_U32 Para32[2]; /* Parameter Array of 32bit parameters */
  106. } SK_EVPARA;
  107. /*
  108. * Event Queue
  109. * skqueue.c
  110. * events are class/value pairs
  111. * class is addressee, e.g. RMT, PCM etc.
  112. * value is command, e.g. line state change, ring op change etc.
  113. */
  114. typedef struct s_EventElem {
  115. SK_U32 Class ; /* Event class */
  116. SK_U32 Event ; /* Event value */
  117. SK_EVPARA Para ; /* Event parameter */
  118. } SK_EVENTELEM;
  119. typedef struct s_Queue {
  120. SK_EVENTELEM EvQueue[SK_MAX_EVENT];
  121. SK_EVENTELEM *EvPut ;
  122. SK_EVENTELEM *EvGet ;
  123. } SK_QUEUE;
  124. extern void SkEventInit(SK_AC *pAC, SK_IOC Ioc, int Level);
  125. extern void SkEventQueue(SK_AC *pAC, SK_U32 Class, SK_U32 Event,
  126. SK_EVPARA Para);
  127. extern int SkEventDispatcher(SK_AC *pAC,SK_IOC Ioc);
  128. /* Define Error Numbers and messages */
  129. #define SKERR_Q_E001 (SK_ERRBASE_QUEUE+0)
  130. #define SKERR_Q_E001MSG "Event queue overflow"
  131. #define SKERR_Q_E002 (SKERR_Q_E001+1)
  132. #define SKERR_Q_E002MSG "Undefined event class"
  133. #endif /* _SKQUEUE_H_ */