intel_lb_mei_interface.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* SPDX-License-Identifier: MIT */
  2. /*
  3. * Copyright (c) 2025 Intel Corporation
  4. */
  5. #ifndef _INTEL_LB_MEI_INTERFACE_H_
  6. #define _INTEL_LB_MEI_INTERFACE_H_
  7. #include <linux/types.h>
  8. struct device;
  9. /**
  10. * define INTEL_LB_FLAG_IS_PERSISTENT - Mark the payload as persistent
  11. *
  12. * This flag indicates that the late binding payload should be stored
  13. * persistently in flash across warm resets.
  14. */
  15. #define INTEL_LB_FLAG_IS_PERSISTENT BIT(0)
  16. /**
  17. * enum intel_lb_type - enum to determine late binding payload type
  18. * @INTEL_LB_TYPE_FAN_CONTROL: Fan controller configuration
  19. */
  20. enum intel_lb_type {
  21. INTEL_LB_TYPE_FAN_CONTROL = 1,
  22. };
  23. /**
  24. * enum intel_lb_status - Status codes returned on late binding transmissions
  25. * @INTEL_LB_STATUS_SUCCESS: Operation completed successfully
  26. * @INTEL_LB_STATUS_4ID_MISMATCH: Mismatch in the expected 4ID (firmware identity/token)
  27. * @INTEL_LB_STATUS_ARB_FAILURE: Arbitration failure (e.g. conflicting access or state)
  28. * @INTEL_LB_STATUS_GENERAL_ERROR: General firmware error not covered by other codes
  29. * @INTEL_LB_STATUS_INVALID_PARAMS: One or more input parameters are invalid
  30. * @INTEL_LB_STATUS_INVALID_SIGNATURE: Payload has an invalid or untrusted signature
  31. * @INTEL_LB_STATUS_INVALID_PAYLOAD: Payload contents are not accepted by firmware
  32. * @INTEL_LB_STATUS_TIMEOUT: Operation timed out before completion
  33. */
  34. enum intel_lb_status {
  35. INTEL_LB_STATUS_SUCCESS = 0,
  36. INTEL_LB_STATUS_4ID_MISMATCH = 1,
  37. INTEL_LB_STATUS_ARB_FAILURE = 2,
  38. INTEL_LB_STATUS_GENERAL_ERROR = 3,
  39. INTEL_LB_STATUS_INVALID_PARAMS = 4,
  40. INTEL_LB_STATUS_INVALID_SIGNATURE = 5,
  41. INTEL_LB_STATUS_INVALID_PAYLOAD = 6,
  42. INTEL_LB_STATUS_TIMEOUT = 7,
  43. };
  44. /**
  45. * struct intel_lb_component_ops - Ops for late binding services
  46. */
  47. struct intel_lb_component_ops {
  48. /**
  49. * @push_payload: Sends a payload to the authentication firmware
  50. *
  51. * @dev: Device struct corresponding to the mei device
  52. * @type: Payload type (see &enum intel_lb_type)
  53. * @flags: Payload flags bitmap (e.g. %INTEL_LB_FLAGS_IS_PERSISTENT)
  54. * @payload: Pointer to payload buffer
  55. * @payload_size: Payload buffer size in bytes
  56. *
  57. * Return: 0 success, negative errno value on transport failure,
  58. * positive status returned by firmware
  59. */
  60. int (*push_payload)(struct device *dev, u32 type, u32 flags,
  61. const void *payload, size_t payload_size);
  62. };
  63. #endif /* _INTEL_LB_MEI_INTERFACE_H_ */