pstore_blk.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __PSTORE_BLK_H_
  3. #define __PSTORE_BLK_H_
  4. #include <linux/types.h>
  5. #include <linux/pstore.h>
  6. #include <linux/pstore_zone.h>
  7. /**
  8. * struct pstore_device_info - back-end pstore/blk driver structure.
  9. *
  10. * @flags: Refer to macro starting with PSTORE_FLAGS defined in
  11. * linux/pstore.h. It means what front-ends this device support.
  12. * Zero means all backends for compatible.
  13. * @zone: The struct pstore_zone_info details.
  14. *
  15. */
  16. struct pstore_device_info {
  17. unsigned int flags;
  18. struct pstore_zone_info zone;
  19. };
  20. int register_pstore_device(struct pstore_device_info *dev);
  21. void unregister_pstore_device(struct pstore_device_info *dev);
  22. /**
  23. * struct pstore_blk_config - the pstore_blk backend configuration
  24. *
  25. * @device: Name of the desired block device
  26. * @max_reason: Maximum kmsg dump reason to store to block device
  27. * @kmsg_size: Total size of for kmsg dumps
  28. * @pmsg_size: Total size of the pmsg storage area
  29. * @console_size: Total size of the console storage area
  30. * @ftrace_size: Total size for ftrace logging data (for all CPUs)
  31. */
  32. struct pstore_blk_config {
  33. char device[80];
  34. enum kmsg_dump_reason max_reason;
  35. unsigned long kmsg_size;
  36. unsigned long pmsg_size;
  37. unsigned long console_size;
  38. unsigned long ftrace_size;
  39. };
  40. /**
  41. * pstore_blk_get_config - get a copy of the pstore_blk backend configuration
  42. *
  43. * @info: The sturct pstore_blk_config to be filled in
  44. *
  45. * Failure returns negative error code, and success returns 0.
  46. */
  47. int pstore_blk_get_config(struct pstore_blk_config *info);
  48. #endif