fastboot.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2008 - 2009
  4. * Windriver, <www.windriver.com>
  5. * Tom Rix <Tom.Rix@windriver.com>
  6. *
  7. * Copyright 2011 Sebastian Andrzej Siewior <bigeasy@linutronix.de>
  8. *
  9. * Copyright 2014 Linaro, Ltd.
  10. * Rob Herring <robh@kernel.org>
  11. */
  12. #ifndef _FASTBOOT_H_
  13. #define _FASTBOOT_H_
  14. /* The 64 defined bytes plus \0 */
  15. #define FASTBOOT_RESPONSE_LEN (64 + 1)
  16. /**
  17. * fastboot_response() - Writes a response of the form "$tag$reason".
  18. *
  19. * @tag: The first part of the response
  20. * @response: Pointer to fastboot response buffer
  21. * @format: printf style format string
  22. */
  23. void fastboot_response(const char *tag, char *response,
  24. const char *format, ...)
  25. __attribute__ ((format (__printf__, 3, 4)));
  26. /**
  27. * fastboot_fail() - Write a FAIL response of the form "FAIL$reason".
  28. *
  29. * @reason: Pointer to returned reason string
  30. * @response: Pointer to fastboot response buffer
  31. */
  32. void fastboot_fail(const char *reason, char *response);
  33. /**
  34. * fastboot_okay() - Write an OKAY response of the form "OKAY$reason".
  35. *
  36. * @reason: Pointer to returned reason string, or NULL to send a bare "OKAY"
  37. * @response: Pointer to fastboot response buffer
  38. */
  39. void fastboot_okay(const char *reason, char *response);
  40. int fastboot_set_reboot_flag(void);
  41. #endif /* _FASTBOOT_H_ */