blob: 6cd44d2ab9240b06c6241abd5ab453804686500f [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Maxime Ripard00e8eb72015-10-15 14:34:13 +02002/*
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 Ripard00e8eb72015-10-15 14:34:13 +020011 */
12#ifndef _FASTBOOT_H_
13#define _FASTBOOT_H_
14
15/* The 64 defined bytes plus \0 */
16#define FASTBOOT_RESPONSE_LEN (64 + 1)
17
Alex Kiernaned6a41442018-05-29 15:30:41 +000018/**
19 * fastboot_response() - Writes a response of the form "$tag$reason".
20 *
21 * @tag: The first part of the response
22 * @response: Pointer to fastboot response buffer
23 * @format: printf style format string
24 */
25void fastboot_response(const char *tag, char *response,
26 const char *format, ...)
27 __attribute__ ((format (__printf__, 3, 4)));
28
29/**
30 * fastboot_fail() - Write a FAIL response of the form "FAIL$reason".
31 *
32 * @reason: Pointer to returned reason string
33 * @response: Pointer to fastboot response buffer
34 */
Alex Kiernan27b69de2018-05-29 15:30:40 +000035void fastboot_fail(const char *reason, char *response);
Alex Kiernaned6a41442018-05-29 15:30:41 +000036
37/**
38 * fastboot_okay() - Write an OKAY response of the form "OKAY$reason".
39 *
40 * @reason: Pointer to returned reason string, or NULL to send a bare "OKAY"
41 * @response: Pointer to fastboot response buffer
42 */
Alex Kiernan27b69de2018-05-29 15:30:40 +000043void fastboot_okay(const char *reason, char *response);
Maxime Ripard00e8eb72015-10-15 14:34:13 +020044
45#endif /* _FASTBOOT_H_ */