1 /* SPDX-License-Identifier: GPL-2.0+ */ 2 /* 3 * Copyright (c) 2022 Google, Inc. 4 * Written by Andrew Scull <ascull@google.com> 5 */ 6 7 #ifndef __FUZZING_ENGINE_H 8 #define __FUZZING_ENGINE_H 9 10 struct udevice; 11 12 /** 13 * dm_fuzzing_engine_get_input() - get an input from the fuzzing engine device 14 * 15 * The function will return a pointer to the input data and the size of the 16 * data pointed to. The pointer will remain valid until the next invocation of 17 * this function. 18 * 19 * @dev: fuzzing engine device 20 * @data: output pointer to input data 21 * @size output size of input data 22 * Return: 0 if OK, -ve on error 23 */ 24 int dm_fuzzing_engine_get_input(struct udevice *dev, 25 const uint8_t **data, 26 size_t *size); 27 28 /** 29 * struct dm_fuzzing_engine_ops - operations for the fuzzing engine uclass 30 * 31 * This contains the functions implemented by a fuzzing engine device. 32 */ 33 struct dm_fuzzing_engine_ops { 34 /** 35 * @get_input() - get an input 36 * 37 * The function will return a pointer to the input data and the size of 38 * the data pointed to. The pointer will remain valid until the next 39 * invocation of this function. 40 * 41 * @get_input.dev: fuzzing engine device 42 * @get_input.data: output pointer to input data 43 * @get_input.size output size of input data 44 * @get_input.Return: 0 if OK, -ve on error 45 */ 46 int (*get_input)(struct udevice *dev, 47 const uint8_t **data, 48 size_t *size); 49 }; 50 51 #endif /* __FUZZING_ENGINE_H */ 52