Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Maxime Ripard | 00e8eb7 | 2015-10-15 14:34:13 +0200 | [diff] [blame] | 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> |
Maxime Ripard | 00e8eb7 | 2015-10-15 14:34:13 +0200 | [diff] [blame] | 11 | */ |
| 12 | #ifndef _FASTBOOT_H_ |
| 13 | #define _FASTBOOT_H_ |
| 14 | |
Alex Kiernan | 1df9890 | 2018-05-29 15:30:47 +0000 | [diff] [blame] | 15 | #define FASTBOOT_VERSION "0.4" |
| 16 | |
Maxime Ripard | 00e8eb7 | 2015-10-15 14:34:13 +0200 | [diff] [blame] | 17 | /* The 64 defined bytes plus \0 */ |
| 18 | #define FASTBOOT_RESPONSE_LEN (64 + 1) |
| 19 | |
Alex Kiernan | ed6a4144 | 2018-05-29 15:30:41 +0000 | [diff] [blame] | 20 | /** |
| 21 | * fastboot_response() - Writes a response of the form "$tag$reason". |
| 22 | * |
| 23 | * @tag: The first part of the response |
| 24 | * @response: Pointer to fastboot response buffer |
| 25 | * @format: printf style format string |
| 26 | */ |
| 27 | void fastboot_response(const char *tag, char *response, |
| 28 | const char *format, ...) |
| 29 | __attribute__ ((format (__printf__, 3, 4))); |
| 30 | |
| 31 | /** |
| 32 | * fastboot_fail() - Write a FAIL response of the form "FAIL$reason". |
| 33 | * |
| 34 | * @reason: Pointer to returned reason string |
| 35 | * @response: Pointer to fastboot response buffer |
| 36 | */ |
Alex Kiernan | 27b69de | 2018-05-29 15:30:40 +0000 | [diff] [blame] | 37 | void fastboot_fail(const char *reason, char *response); |
Alex Kiernan | ed6a4144 | 2018-05-29 15:30:41 +0000 | [diff] [blame] | 38 | |
| 39 | /** |
| 40 | * fastboot_okay() - Write an OKAY response of the form "OKAY$reason". |
| 41 | * |
| 42 | * @reason: Pointer to returned reason string, or NULL to send a bare "OKAY" |
| 43 | * @response: Pointer to fastboot response buffer |
| 44 | */ |
Alex Kiernan | 27b69de | 2018-05-29 15:30:40 +0000 | [diff] [blame] | 45 | void fastboot_okay(const char *reason, char *response); |
Alex Kiernan | 5512c43 | 2018-05-29 15:30:46 +0000 | [diff] [blame] | 46 | int fastboot_set_reboot_flag(void); |
Maxime Ripard | 00e8eb7 | 2015-10-15 14:34:13 +0200 | [diff] [blame] | 47 | #endif /* _FASTBOOT_H_ */ |