Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Henrik Nordström | f4d8de4 | 2013-11-10 10:26:56 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2013, Henrik Nordstrom <henrik@henriknordstrom.net> |
Henrik Nordström | f4d8de4 | 2013-11-10 10:26:56 -0700 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef __SANDBOX_BLOCK_DEV__ |
| 7 | #define __SANDBOX_BLOCK_DEV__ |
| 8 | |
Simon Glass | 32c8566 | 2021-11-24 09:26:40 -0700 | [diff] [blame] | 9 | /* Maximum number of host devices - see drivers/block/sandbox.c */ |
| 10 | #define SANDBOX_HOST_MAX_DEVICES 4 |
| 11 | |
Henrik Nordström | f4d8de4 | 2013-11-10 10:26:56 -0700 | [diff] [blame] | 12 | struct host_block_dev { |
Simon Glass | 40fd050 | 2016-02-29 15:25:57 -0700 | [diff] [blame] | 13 | #ifndef CONFIG_BLK |
Simon Glass | 4101f68 | 2016-02-29 15:25:34 -0700 | [diff] [blame] | 14 | struct blk_desc blk_dev; |
Simon Glass | 40fd050 | 2016-02-29 15:25:57 -0700 | [diff] [blame] | 15 | #endif |
Henrik Nordström | f4d8de4 | 2013-11-10 10:26:56 -0700 | [diff] [blame] | 16 | char *filename; |
| 17 | int fd; |
| 18 | }; |
| 19 | |
Simon Glass | 1758551 | 2021-03-15 18:11:11 +1300 | [diff] [blame] | 20 | /** |
| 21 | * host_dev_bind() - Bind or unbind a device |
| 22 | * |
| 23 | * @dev: Device number (0=first slot) |
| 24 | * @filename: Host filename to use, or NULL to unbind |
| 25 | * @removable: true if the block device should mark itself as removable |
| 26 | */ |
| 27 | int host_dev_bind(int dev, char *filename, bool removable); |
Henrik Nordström | f4d8de4 | 2013-11-10 10:26:56 -0700 | [diff] [blame] | 28 | |
AKASHI Takahiro | c73a070 | 2022-04-19 10:01:55 +0900 | [diff] [blame] | 29 | int host_get_dev_err(int dev, struct blk_desc **blk_devp); |
| 30 | |
Henrik Nordström | f4d8de4 | 2013-11-10 10:26:56 -0700 | [diff] [blame] | 31 | #endif |