/* device can use 48bit addr (ATA/ATAPI v7) */
bool lba48;
unsigned char atapi; /* Use ATAPI protocol */
+ unsigned char bb; /* Use bounce buffer */
lbaint_t lba; /* number of blocks */
unsigned long blksz; /* block size */
int log2blksz; /* for convenience: log2(blksz) */
#endif
-#if CONFIG_IS_ENABLED(BLK)
struct udevice;
/* Operations on block devices */
#endif /* CONFIG_BOUNCE_BUFFER */
};
+#if CONFIG_IS_ENABLED(BLK)
+
/*
* These functions should take struct udevice instead of struct blk_desc,
* but this is convenient for migration to driver model. Add a 'd' prefix
unsigned long blk_derase(struct blk_desc *block_dev, lbaint_t start,
lbaint_t blkcnt);
+#endif /* BLK */
+
/**
* blk_read() - Read from a block device
*
*/
int blk_next_device(struct udevice **devp);
-/**
- * blk_create_device() - Create a new block device
- *
- * @parent: Parent of the new device
- * @drv_name: Driver name to use for the block device
- * @name: Name for the device
- * @uclass_id: Interface type (enum uclass_id_t)
- * @devnum: Device number, specific to the interface type, or -1 to
- * allocate the next available number
- * @blksz: Block size of the device in bytes (typically 512)
- * @lba: Total number of blocks of the device
- * @devp: the new device (which has not been probed)
- */
-int blk_create_device(struct udevice *parent, const char *drv_name,
- const char *name, int uclass_id, int devnum, int blksz,
- lbaint_t lba, struct udevice **devp);
-
/**
* blk_create_devicef() - Create a new named block device
*
*/
int blk_get_desc(enum uclass_id uclass_id, int devnum, struct blk_desc **descp);
-#else
+#if !CONFIG_IS_ENABLED(BLK)
+
#include <errno.h>
+
/*
* These functions should take struct udevice instead of struct blk_desc,
* but this is convenient for migration to driver model. Add a 'd' prefix
struct blk_desc *blk_get_devnum_by_uclass_id(enum uclass_id uclass_id, int devnum);
/**
- * blk_get_devnum_by_uclass_id() - Get a block device by type name, and number
+ * blk_get_devnum_by_uclass_idname() - Get block device by type name and number
*
* This looks up the block device type based on @uclass_idname, then calls
* blk_get_devnum_by_uclass_id().
* Return: point to block device descriptor, or NULL if not found
*/
struct blk_desc *blk_get_devnum_by_uclass_idname(const char *uclass_idname,
- int devnum);
+ int devnum);
/**
* blk_dselect_hwpart() - select a hardware partition