+/* SPDX-License-Identifier: GPL-2.0+ */
/*
* (C) Copyright 2000-2004
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#ifndef BLK_H
IF_TYPE_SD,
IF_TYPE_SATA,
IF_TYPE_HOST,
- IF_TYPE_SYSTEMACE,
IF_TYPE_NVME,
+ IF_TYPE_EFI,
+ IF_TYPE_VIRTIO,
IF_TYPE_COUNT, /* Number of interface types */
};
#define PAD_TO_BLOCKSIZE(size, blk_desc) \
(PAD_SIZE(size, blk_desc->blksz))
-#ifdef CONFIG_BLOCK_CACHE
+#if CONFIG_IS_ENABLED(BLOCK_CACHE)
/**
* blkcache_read() - attempt to read a set of blocks from cache
*
const char *name, int if_type, int devnum, int blksz,
lbaint_t lba, struct udevice **devp);
-/**
- * blk_prepare_device() - Prepare a block device for use
- *
- * This reads partition information from the device if supported.
- *
- * @dev: Device to prepare
- * @return 0 if ok, -ve on error
- */
-int blk_prepare_device(struct udevice *dev);
-
/**
* blk_unbind_all() - Unbind all device of the given interface type
*
*/
int blk_find_max_devnum(enum if_type if_type);
+/**
+ * blk_next_free_devnum() - get the next device number for an interface type
+ *
+ * Finds the next number that is safe to use for a newly allocated device for
+ * an interface type @if_type.
+ *
+ * @if_type: Interface type to scan
+ * @return next device number safe to use, or -ve on error
+ */
+int blk_next_free_devnum(enum if_type if_type);
+
/**
* blk_select_hwpart() - select a hardware partition
*
*/
int blk_get_from_parent(struct udevice *parent, struct udevice **devp);
+/**
+ * blk_get_by_device() - Get the block device descriptor for the given device
+ * @dev: Instance of a storage device
+ *
+ * Return: With block device descriptor on success , NULL if there is no such
+ * block device.
+ */
+struct blk_desc *blk_get_by_device(struct udevice *dev);
+
#else
#include <errno.h>
/*