0528f891b120364d4f6e7da9e97fb553a39f1cdf
[platform/kernel/u-boot.git] / include / sandboxblockdev.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (c) 2013, Henrik Nordstrom <henrik@henriknordstrom.net>
4  */
5
6 #ifndef __SANDBOX_BLOCK_DEV__
7 #define __SANDBOX_BLOCK_DEV__
8
9 /* Maximum number of host devices - see drivers/block/sandbox.c */
10 #define SANDBOX_HOST_MAX_DEVICES        4
11
12 struct host_block_dev {
13         char *filename;
14         int fd;
15 };
16
17 /**
18  * host_dev_bind() - Bind or unbind a device
19  *
20  * @dev: Device number (0=first slot)
21  * @filename: Host filename to use, or NULL to unbind
22  * @removable: true if the block device should mark itself as removable
23  */
24 int host_dev_bind(int dev, char *filename, bool removable);
25
26 int host_get_dev_err(int dev, struct blk_desc **blk_devp);
27
28 #endif