ipmi_int.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*****************************************************************
  2. *****************************************************************
  3. *** **
  4. *** (C)Copyright 2006-2007, American Megatrends Inc. **
  5. *** **
  6. *** All Rights Reserved. **
  7. *** **
  8. *** 6145-F, Northbelt Parkway, Norcross, **
  9. *** **
  10. *** Georgia - 30071, USA. Phone-(770)-246-8600. **
  11. *** **
  12. *****************************************************************
  13. *****************************************************************
  14. ******************************************************************
  15. *
  16. * interrupt.h
  17. * IPMI based interrupt handling.
  18. *
  19. * Author: Vinothkumar S <vinothkumars@ami.com>
  20. ******************************************************************/
  21. #ifndef _INTTERRUPT_H_
  22. #define _INTTERRUPT_H_
  23. #include <stdio.h>
  24. #include <stdlib.h>
  25. #include <errno.h>
  26. #include <string.h>
  27. #include <fcntl.h>
  28. #include <ctype.h>
  29. #include <unistd.h>
  30. #include <sys/select.h>
  31. #include <sys/ioctl.h>
  32. #include <sys/poll.h>
  33. #include <sys/time.h>
  34. #include <stdint.h>
  35. #include <dbgout.h>
  36. #include "Types.h"
  37. //#include "SensorMonitor.h"
  38. #define MAX_IPMI_INT 0x10
  39. /* Interrupt Trigger Type */
  40. typedef enum {
  41. IPMI_INT_TRIGGER_EDGE,
  42. IPMI_INT_TRIGGER_LEVEL
  43. } IPMI_INTTrig_method_E;
  44. /* Interrupt Trigger Method */
  45. typedef enum {
  46. IPMI_INT_RISING_EDGE,
  47. IPMI_INT_FALLING_EDGE,
  48. IPMI_INT_HIGH_LEVEL,
  49. IPMI_INT_LOW_LEVEL,
  50. IPMI_INT_BOTH_EDGES
  51. } IPMI_INTTrig_type_E;
  52. /* Interrupt Source */
  53. typedef enum
  54. {
  55. INT_SENSOR = 0, /* Interrupt occured for any Sensor monitoring */
  56. INT_CHASSIS, /* Interrupt for any chassis releated */
  57. INT_LPC_RESET, /* Interrupt for LPC reset */
  58. INT_REG_HNDLR, /* Interrupt handled by registered handler */
  59. INT_SWC_HNDLR /* Interrupt handler for the SWC */
  60. } IPMI_INTSource_E;
  61. /* Registered interrupt information */
  62. typedef struct {
  63. void *pint_hndlr; /* interrupt handler for this routine */
  64. int int_num; /* interrupt number for this handler */
  65. IPMI_INTSource_E Source; /* Interrupt source */
  66. INT8U SensorNum; /* Used only for Sensor monitoring */
  67. INT8U SensorType; /* Used only for Sensor monitoring */
  68. IPMI_INTTrig_method_E TriggerMethod; /* Interrupt trigger method */
  69. IPMI_INTTrig_type_E TriggerType; /* Interrupt trigger type */
  70. int int_type; /* Interrupt type used only for SWC Handler */
  71. INT8U int_input_data; /* Interrupt input data used only for SWC */
  72. INT8U reading_on_assertion; /* Reading/Interrupt information when interrupt occured */
  73. INT8U SensorOwnerLun;
  74. } IPMI_INTInfo_T;
  75. /* pointer to the handler which handles the interrupt after comming out of
  76. * the interrutp
  77. *
  78. * */
  79. typedef int (*pINTHndlr_T) (IPMI_INTInfo_T*);
  80. /* pointer to the handler which handles the sensor
  81. * interrupt after comming out of the interrutp
  82. *
  83. * */
  84. typedef int (*pSensorINTHndlr_T) (IPMI_INTInfo_T*, SensorInfo_T*);
  85. /*** Global definitions ***/
  86. #define IPMI_MAX_INT_FDS 20
  87. #define WAIT_FOR_IPMI_INT 0x10
  88. /* Declaration for Interrupt task */
  89. void* InterruptTask (void *pArg);
  90. #endif // _INTTERRUPT_H_