skqueue.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /******************************************************************************
  2. *
  3. * Name: skqueue.h
  4. * Project: Gigabit Ethernet Adapters, Event Scheduler Module
  5. * Version: $Revision: 1.16 $
  6. * Date: $Date: 2003/09/16 12:50:32 $
  7. * Purpose: Defines for the Event queue
  8. *
  9. ******************************************************************************/
  10. /******************************************************************************
  11. *
  12. * (C)Copyright 1998-2002 SysKonnect GmbH.
  13. * (C)Copyright 2002-2003 Marvell.
  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. * SKQUEUE.H contains all defines and types for the event queue
  25. */
  26. #ifndef _SKQUEUE_H_
  27. #define _SKQUEUE_H_
  28. /*
  29. * define the event classes to be served
  30. */
  31. #define SKGE_DRV 1 /* Driver Event Class */
  32. #define SKGE_RLMT 2 /* RLMT Event Class */
  33. #define SKGE_I2C 3 /* I2C Event Class */
  34. #define SKGE_PNMI 4 /* PNMI Event Class */
  35. #define SKGE_CSUM 5 /* Checksum Event Class */
  36. #define SKGE_HWAC 6 /* Hardware Access Event Class */
  37. #define SKGE_SWT 9 /* Software Timer Event Class */
  38. #define SKGE_LACP 10 /* LACP Aggregation Event Class */
  39. #define SKGE_RSF 11 /* RSF Aggregation Event Class */
  40. #define SKGE_MARKER 12 /* MARKER Aggregation Event Class */
  41. #define SKGE_FD 13 /* FD Distributor Event Class */
  42. /*
  43. * define event queue as circular buffer
  44. */
  45. #define SK_MAX_EVENT 64
  46. /*
  47. * Parameter union for the Para stuff
  48. */
  49. typedef union u_EvPara {
  50. void *pParaPtr; /* Parameter Pointer */
  51. SK_U64 Para64; /* Parameter 64bit version */
  52. SK_U32 Para32[2]; /* Parameter Array of 32bit parameters */
  53. } SK_EVPARA;
  54. /*
  55. * Event Queue
  56. * skqueue.c
  57. * events are class/value pairs
  58. * class is addressee, e.g. RLMT, PNMI etc.
  59. * value is command, e.g. line state change, ring op change etc.
  60. */
  61. typedef struct s_EventElem {
  62. SK_U32 Class; /* Event class */
  63. SK_U32 Event; /* Event value */
  64. SK_EVPARA Para; /* Event parameter */
  65. } SK_EVENTELEM;
  66. typedef struct s_Queue {
  67. SK_EVENTELEM EvQueue[SK_MAX_EVENT];
  68. SK_EVENTELEM *EvPut;
  69. SK_EVENTELEM *EvGet;
  70. } SK_QUEUE;
  71. extern void SkEventInit(SK_AC *pAC, SK_IOC Ioc, int Level);
  72. extern void SkEventQueue(SK_AC *pAC, SK_U32 Class, SK_U32 Event,
  73. SK_EVPARA Para);
  74. extern int SkEventDispatcher(SK_AC *pAC, SK_IOC Ioc);
  75. /* Define Error Numbers and messages */
  76. #define SKERR_Q_E001 (SK_ERRBASE_QUEUE+0)
  77. #define SKERR_Q_E001MSG "Event queue overflow"
  78. #define SKERR_Q_E002 (SKERR_Q_E001+1)
  79. #define SKERR_Q_E002MSG "Undefined event class"
  80. #endif /* _SKQUEUE_H_ */