mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-26 13:44:29 +08:00
dm: Drop the block_dev_desc_t typedef
Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long and causes 80-column violations, rename it to struct blk_desc. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
parent
b391d74336
commit
4101f68792
@ -189,7 +189,7 @@ static int API_get_timer(va_list ap)
|
||||
*
|
||||
* - net: ð_device struct address from list pointed to by eth_devices
|
||||
*
|
||||
* - storage: block_dev_desc_t struct address from &ide_dev_desc[n],
|
||||
* - storage: struct blk_desc struct address from &ide_dev_desc[n],
|
||||
* &scsi_dev_desc[n] and similar tables
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -103,7 +103,7 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
|
||||
|
||||
int i;
|
||||
|
||||
block_dev_desc_t *dd;
|
||||
struct blk_desc *dd;
|
||||
|
||||
if (first) {
|
||||
di->cookie = (void *)get_dev(specs[type].name, 0);
|
||||
@ -148,7 +148,7 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
|
||||
di->type = specs[type].type;
|
||||
|
||||
if (di->cookie != NULL) {
|
||||
dd = (block_dev_desc_t *)di->cookie;
|
||||
dd = (struct blk_desc *)di->cookie;
|
||||
if (dd->type == DEV_TYPE_UNKNOWN) {
|
||||
debugf("device instance exists, but is not active..");
|
||||
found = 0;
|
||||
@ -166,9 +166,9 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
|
||||
|
||||
|
||||
/*
|
||||
* returns: ENUM_IDE, ENUM_USB etc. based on block_dev_desc_t
|
||||
* returns: ENUM_IDE, ENUM_USB etc. based on struct blk_desc
|
||||
*/
|
||||
static int dev_stor_type(block_dev_desc_t *dd)
|
||||
static int dev_stor_type(struct blk_desc *dd)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
@ -308,7 +308,7 @@ int dev_enum_storage(struct device_info *di)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dev_stor_is_valid(int type, block_dev_desc_t *dd)
|
||||
static int dev_stor_is_valid(int type, struct blk_desc *dd)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -328,7 +328,7 @@ int dev_open_stor(void *cookie)
|
||||
if (type == ENUM_MAX)
|
||||
return API_ENODEV;
|
||||
|
||||
if (dev_stor_is_valid(type, (block_dev_desc_t *)cookie))
|
||||
if (dev_stor_is_valid(type, (struct blk_desc *)cookie))
|
||||
return 0;
|
||||
|
||||
return API_ENODEV;
|
||||
@ -348,7 +348,7 @@ int dev_close_stor(void *cookie)
|
||||
lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start)
|
||||
{
|
||||
int type;
|
||||
block_dev_desc_t *dd = (block_dev_desc_t *)cookie;
|
||||
struct blk_desc *dd = (struct blk_desc *)cookie;
|
||||
|
||||
if ((type = dev_stor_type(dd)) == ENUM_MAX)
|
||||
return 0;
|
||||
|
@ -81,7 +81,7 @@ static int load_rescue_image(ulong addr)
|
||||
char dev[7];
|
||||
char addr_str[16];
|
||||
char * const argv[6] = { "fatload", "usb", dev, addr_str, nxri, NULL };
|
||||
block_dev_desc_t *stor_dev = NULL;
|
||||
struct blk_desc *stor_dev = NULL;
|
||||
cmd_tbl_t *bcmd;
|
||||
|
||||
/* Get name of firmware directory */
|
||||
|
@ -217,8 +217,8 @@ Added files:
|
||||
Block device changes:
|
||||
---------------------
|
||||
To allow the use of dos_part.c, mac_part.c and iso_part.c, the parameter
|
||||
block_dev_desc will be used when accessing the functions in these files. The block
|
||||
device descriptor (block_dev_desc) contains a pointer to the read routine of the
|
||||
blk_desc will be used when accessing the functions in these files. The block
|
||||
device descriptor (blk_desc) contains a pointer to the read routine of the
|
||||
device, which will be used to read blocks from the device.
|
||||
Renamed function ide_print to dev_print and moved it to the file disk/part.c to use
|
||||
it for IDE ATAPI and SCSI devices.
|
||||
|
@ -20,7 +20,7 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
|
||||
#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
|
||||
image_header_t *hdr;
|
||||
#endif
|
||||
block_dev_desc_t *dev_desc;
|
||||
struct blk_desc *dev_desc;
|
||||
|
||||
#if defined(CONFIG_FIT)
|
||||
const void *fit_hdr = NULL;
|
||||
|
@ -69,7 +69,7 @@ static int do_fat_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char * const argv[])
|
||||
{
|
||||
int dev, part;
|
||||
block_dev_desc_t *dev_desc;
|
||||
struct blk_desc *dev_desc;
|
||||
disk_partition_t info;
|
||||
|
||||
if (argc < 2) {
|
||||
@ -105,7 +105,7 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag,
|
||||
int ret;
|
||||
unsigned long addr;
|
||||
unsigned long count;
|
||||
block_dev_desc_t *dev_desc = NULL;
|
||||
struct blk_desc *dev_desc = NULL;
|
||||
disk_partition_t info;
|
||||
int dev = 0;
|
||||
int part = 1;
|
||||
|
@ -168,7 +168,7 @@ static bool found_key(const char *str, const char *key)
|
||||
* @return - zero on success, otherwise error
|
||||
*
|
||||
*/
|
||||
static int set_gpt_info(block_dev_desc_t *dev_desc,
|
||||
static int set_gpt_info(struct blk_desc *dev_desc,
|
||||
const char *str_part,
|
||||
char **str_disk_guid,
|
||||
disk_partition_t **partitions,
|
||||
@ -328,7 +328,7 @@ err:
|
||||
return errno;
|
||||
}
|
||||
|
||||
static int gpt_default(block_dev_desc_t *blk_dev_desc, const char *str_part)
|
||||
static int gpt_default(struct blk_desc *blk_dev_desc, const char *str_part)
|
||||
{
|
||||
int ret;
|
||||
char *str_disk_guid;
|
||||
@ -356,7 +356,7 @@ static int gpt_default(block_dev_desc_t *blk_dev_desc, const char *str_part)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int gpt_verify(block_dev_desc_t *blk_dev_desc, const char *str_part)
|
||||
static int gpt_verify(struct blk_desc *blk_dev_desc, const char *str_part)
|
||||
{
|
||||
ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1,
|
||||
blk_dev_desc->blksz);
|
||||
@ -408,7 +408,7 @@ static int do_gpt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
int ret = CMD_RET_SUCCESS;
|
||||
int dev = 0;
|
||||
char *ep;
|
||||
block_dev_desc_t *blk_dev_desc = NULL;
|
||||
struct blk_desc *blk_dev_desc = NULL;
|
||||
|
||||
if (argc < 4 || argc > 5)
|
||||
return CMD_RET_USAGE;
|
||||
|
@ -67,7 +67,7 @@ static int do_host_info(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
int dev;
|
||||
printf("%3s %12s %s\n", "dev", "blocks", "path");
|
||||
for (dev = min_dev; dev <= max_dev; dev++) {
|
||||
block_dev_desc_t *blk_dev;
|
||||
struct blk_desc *blk_dev;
|
||||
int ret;
|
||||
|
||||
printf("%3d ", dev);
|
||||
@ -92,7 +92,7 @@ static int do_host_dev(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
{
|
||||
int dev;
|
||||
char *ep;
|
||||
block_dev_desc_t *blk_dev;
|
||||
struct blk_desc *blk_dev;
|
||||
int ret;
|
||||
|
||||
if (argc < 1 || argc > 3)
|
||||
|
22
cmd/ide.c
22
cmd/ide.c
@ -53,7 +53,7 @@ ulong ide_bus_offset[CONFIG_SYS_IDE_MAXBUS] = {
|
||||
|
||||
static int ide_bus_ok[CONFIG_SYS_IDE_MAXBUS];
|
||||
|
||||
block_dev_desc_t ide_dev_desc[CONFIG_SYS_IDE_MAXDEVICE];
|
||||
struct blk_desc ide_dev_desc[CONFIG_SYS_IDE_MAXDEVICE];
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef CONFIG_IDE_RESET
|
||||
@ -62,7 +62,7 @@ static void ide_reset (void);
|
||||
#define ide_reset() /* dummy */
|
||||
#endif
|
||||
|
||||
static void ide_ident (block_dev_desc_t *dev_desc);
|
||||
static void ide_ident(struct blk_desc *dev_desc);
|
||||
static uchar ide_wait (int dev, ulong t);
|
||||
|
||||
#define IDE_TIME_OUT 2000 /* 2 sec timeout */
|
||||
@ -78,8 +78,8 @@ static void ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ATAPI
|
||||
static void atapi_inquiry(block_dev_desc_t *dev_desc);
|
||||
static ulong atapi_read(block_dev_desc_t *block_dev, lbaint_t blknr,
|
||||
static void atapi_inquiry(struct blk_desc *dev_desc);
|
||||
static ulong atapi_read(struct blk_desc *block_dev, lbaint_t blknr,
|
||||
lbaint_t blkcnt, void *buffer);
|
||||
#endif
|
||||
|
||||
@ -187,7 +187,7 @@ int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
||||
if (strcmp(argv[1], "read") == 0) {
|
||||
ulong addr = simple_strtoul(argv[2], NULL, 16);
|
||||
ulong cnt = simple_strtoul(argv[4], NULL, 16);
|
||||
block_dev_desc_t *dev_desc;
|
||||
struct blk_desc *dev_desc;
|
||||
ulong n;
|
||||
|
||||
#ifdef CONFIG_SYS_64BIT_LBA
|
||||
@ -446,7 +446,7 @@ void ide_init(void)
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef CONFIG_PARTITIONS
|
||||
block_dev_desc_t *ide_get_dev(int dev)
|
||||
struct blk_desc *ide_get_dev(int dev)
|
||||
{
|
||||
return (dev < CONFIG_SYS_IDE_MAXDEVICE) ? &ide_dev_desc[dev] : NULL;
|
||||
}
|
||||
@ -541,7 +541,7 @@ __weak void ide_input_data(int dev, ulong *sect_buf, int words)
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
*/
|
||||
static void ide_ident(block_dev_desc_t *dev_desc)
|
||||
static void ide_ident(struct blk_desc *dev_desc)
|
||||
{
|
||||
unsigned char c;
|
||||
hd_driveid_t iop;
|
||||
@ -713,7 +713,7 @@ static void ide_ident(block_dev_desc_t *dev_desc)
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
ulong ide_read(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
|
||||
ulong ide_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
|
||||
void *buffer)
|
||||
{
|
||||
int device = block_dev->dev;
|
||||
@ -839,7 +839,7 @@ IDE_READ_E:
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
ulong ide_write(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
|
||||
ulong ide_write(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
|
||||
const void *buffer)
|
||||
{
|
||||
int device = block_dev->dev;
|
||||
@ -1301,7 +1301,7 @@ error:
|
||||
}
|
||||
|
||||
|
||||
static void atapi_inquiry(block_dev_desc_t *dev_desc)
|
||||
static void atapi_inquiry(struct blk_desc *dev_desc)
|
||||
{
|
||||
unsigned char ccb[12]; /* Command descriptor block */
|
||||
unsigned char iobuf[64]; /* temp buf */
|
||||
@ -1394,7 +1394,7 @@ static void atapi_inquiry(block_dev_desc_t *dev_desc)
|
||||
#define ATAPI_READ_BLOCK_SIZE 2048 /* assuming CD part */
|
||||
#define ATAPI_READ_MAX_BLOCK (ATAPI_READ_MAX_BYTES/ATAPI_READ_BLOCK_SIZE)
|
||||
|
||||
ulong atapi_read(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
|
||||
ulong atapi_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
|
||||
void *buffer)
|
||||
{
|
||||
int device = block_dev->dev;
|
||||
|
@ -424,7 +424,7 @@ static int do_mmc_rescan(cmd_tbl_t *cmdtp, int flag,
|
||||
static int do_mmc_part(cmd_tbl_t *cmdtp, int flag,
|
||||
int argc, char * const argv[])
|
||||
{
|
||||
block_dev_desc_t *mmc_dev;
|
||||
struct blk_desc *mmc_dev;
|
||||
struct mmc *mmc;
|
||||
|
||||
mmc = init_mmc_device(curr_device, false);
|
||||
|
@ -29,7 +29,7 @@
|
||||
static int do_part_uuid(int argc, char * const argv[])
|
||||
{
|
||||
int part;
|
||||
block_dev_desc_t *dev_desc;
|
||||
struct blk_desc *dev_desc;
|
||||
disk_partition_t info;
|
||||
|
||||
if (argc < 2)
|
||||
@ -52,7 +52,7 @@ static int do_part_uuid(int argc, char * const argv[])
|
||||
static int do_part_list(int argc, char * const argv[])
|
||||
{
|
||||
int ret;
|
||||
block_dev_desc_t *desc;
|
||||
struct blk_desc *desc;
|
||||
char *var = NULL;
|
||||
bool bootable = false;
|
||||
int i;
|
||||
@ -114,7 +114,7 @@ static int do_part_list(int argc, char * const argv[])
|
||||
|
||||
static int do_part_start(int argc, char * const argv[])
|
||||
{
|
||||
block_dev_desc_t *desc;
|
||||
struct blk_desc *desc;
|
||||
disk_partition_t info;
|
||||
char buf[512] = { 0 };
|
||||
int part;
|
||||
@ -148,7 +148,7 @@ static int do_part_start(int argc, char * const argv[])
|
||||
|
||||
static int do_part_size(int argc, char * const argv[])
|
||||
{
|
||||
block_dev_desc_t *desc;
|
||||
struct blk_desc *desc;
|
||||
disk_partition_t info;
|
||||
char buf[512] = { 0 };
|
||||
int part;
|
||||
|
@ -15,7 +15,7 @@
|
||||
int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
char *ep;
|
||||
block_dev_desc_t *dev_desc = NULL;
|
||||
struct blk_desc *dev_desc = NULL;
|
||||
int dev;
|
||||
int part = 0;
|
||||
disk_partition_t part_info;
|
||||
@ -57,7 +57,7 @@ int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
offset = part_info.start;
|
||||
limit = part_info.size;
|
||||
} else {
|
||||
/* Largest address not available in block_dev_desc_t. */
|
||||
/* Largest address not available in struct blk_desc. */
|
||||
limit = ~0;
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ int do_reiserls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
char *filename = "/";
|
||||
int dev, part;
|
||||
block_dev_desc_t *dev_desc=NULL;
|
||||
struct blk_desc *dev_desc = NULL;
|
||||
disk_partition_t info;
|
||||
|
||||
if (argc < 3)
|
||||
@ -82,7 +82,7 @@ int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
int dev, part;
|
||||
ulong addr = 0, filelen;
|
||||
disk_partition_t info;
|
||||
block_dev_desc_t *dev_desc = NULL;
|
||||
struct blk_desc *dev_desc = NULL;
|
||||
unsigned long count;
|
||||
char *addr_str;
|
||||
|
||||
|
10
cmd/sata.c
10
cmd/sata.c
@ -16,15 +16,15 @@
|
||||
#include <sata.h>
|
||||
|
||||
static int sata_curr_device = -1;
|
||||
block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
|
||||
struct blk_desc sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
|
||||
|
||||
static unsigned long sata_bread(block_dev_desc_t *block_dev, lbaint_t start,
|
||||
static unsigned long sata_bread(struct blk_desc *block_dev, lbaint_t start,
|
||||
lbaint_t blkcnt, void *dst)
|
||||
{
|
||||
return sata_read(block_dev->dev, start, blkcnt, dst);
|
||||
}
|
||||
|
||||
static unsigned long sata_bwrite(block_dev_desc_t *block_dev, lbaint_t start,
|
||||
static unsigned long sata_bwrite(struct blk_desc *block_dev, lbaint_t start,
|
||||
lbaint_t blkcnt, const void *buffer)
|
||||
{
|
||||
return sata_write(block_dev->dev, start, blkcnt, buffer);
|
||||
@ -36,7 +36,7 @@ int __sata_initialize(void)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < CONFIG_SYS_SATA_MAX_DEVICE; i++) {
|
||||
memset(&sata_dev_desc[i], 0, sizeof(struct block_dev_desc));
|
||||
memset(&sata_dev_desc[i], 0, sizeof(struct blk_desc));
|
||||
sata_dev_desc[i].if_type = IF_TYPE_SATA;
|
||||
sata_dev_desc[i].dev = i;
|
||||
sata_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
|
||||
@ -75,7 +75,7 @@ __weak int __sata_stop(void)
|
||||
int sata_stop(void) __attribute__((weak, alias("__sata_stop")));
|
||||
|
||||
#ifdef CONFIG_PARTITIONS
|
||||
block_dev_desc_t *sata_get_dev(int dev)
|
||||
struct blk_desc *sata_get_dev(int dev)
|
||||
{
|
||||
return (dev < CONFIG_SYS_SATA_MAX_DEVICE) ? &sata_dev_desc[dev] : NULL;
|
||||
}
|
||||
|
12
cmd/scsi.c
12
cmd/scsi.c
@ -48,7 +48,7 @@ static int scsi_max_devs; /* number of highest available scsi device */
|
||||
|
||||
static int scsi_curr_dev; /* current device */
|
||||
|
||||
static block_dev_desc_t scsi_dev_desc[CONFIG_SYS_SCSI_MAX_DEVICE];
|
||||
static struct blk_desc scsi_dev_desc[CONFIG_SYS_SCSI_MAX_DEVICE];
|
||||
|
||||
/********************************************************************************
|
||||
* forward declerations of some Setup Routines
|
||||
@ -66,9 +66,9 @@ void scsi_ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len);
|
||||
|
||||
static int scsi_read_capacity(ccb *pccb, lbaint_t *capacity,
|
||||
unsigned long *blksz);
|
||||
static ulong scsi_read(block_dev_desc_t *block_dev, lbaint_t blknr,
|
||||
static ulong scsi_read(struct blk_desc *block_dev, lbaint_t blknr,
|
||||
lbaint_t blkcnt, void *buffer);
|
||||
static ulong scsi_write(block_dev_desc_t *block_dev, lbaint_t blknr,
|
||||
static ulong scsi_write(struct blk_desc *block_dev, lbaint_t blknr,
|
||||
lbaint_t blkcnt, const void *buffer);
|
||||
|
||||
|
||||
@ -239,7 +239,7 @@ void scsi_init(void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PARTITIONS
|
||||
block_dev_desc_t * scsi_get_dev(int dev)
|
||||
struct blk_desc *scsi_get_dev(int dev)
|
||||
{
|
||||
return (dev < CONFIG_SYS_SCSI_MAX_DEVICE) ? &scsi_dev_desc[dev] : NULL;
|
||||
}
|
||||
@ -376,7 +376,7 @@ int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
#define SCSI_MAX_READ_BLK 0xFFFF
|
||||
#define SCSI_LBA48_READ 0xFFFFFFF
|
||||
|
||||
static ulong scsi_read(block_dev_desc_t *block_dev, lbaint_t blknr,
|
||||
static ulong scsi_read(struct blk_desc *block_dev, lbaint_t blknr,
|
||||
lbaint_t blkcnt, void *buffer)
|
||||
{
|
||||
int device = block_dev->dev;
|
||||
@ -443,7 +443,7 @@ static ulong scsi_read(block_dev_desc_t *block_dev, lbaint_t blknr,
|
||||
/* Almost the maximum amount of the scsi_ext command.. */
|
||||
#define SCSI_MAX_WRITE_BLK 0xFFFF
|
||||
|
||||
static ulong scsi_write(block_dev_desc_t *block_dev, lbaint_t blknr,
|
||||
static ulong scsi_write(struct blk_desc *block_dev, lbaint_t blknr,
|
||||
lbaint_t blkcnt, const void *buffer)
|
||||
{
|
||||
int device = block_dev->dev;
|
||||
|
@ -43,7 +43,7 @@ U_BOOT_CMD(
|
||||
static int do_gzwrite(cmd_tbl_t *cmdtp, int flag,
|
||||
int argc, char * const argv[])
|
||||
{
|
||||
block_dev_desc_t *bdev;
|
||||
struct blk_desc *bdev;
|
||||
int ret;
|
||||
unsigned char *addr;
|
||||
unsigned long length;
|
||||
|
@ -625,7 +625,7 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
int i;
|
||||
extern char usb_started;
|
||||
#ifdef CONFIG_USB_STORAGE
|
||||
block_dev_desc_t *stor_dev;
|
||||
struct blk_desc *stor_dev;
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
|
@ -19,7 +19,7 @@
|
||||
static int ums_read_sector(struct ums *ums_dev,
|
||||
ulong start, lbaint_t blkcnt, void *buf)
|
||||
{
|
||||
block_dev_desc_t *block_dev = &ums_dev->block_dev;
|
||||
struct blk_desc *block_dev = &ums_dev->block_dev;
|
||||
lbaint_t blkstart = start + ums_dev->start_sector;
|
||||
|
||||
return block_dev->block_read(block_dev, blkstart, blkcnt, buf);
|
||||
@ -28,7 +28,7 @@ static int ums_read_sector(struct ums *ums_dev,
|
||||
static int ums_write_sector(struct ums *ums_dev,
|
||||
ulong start, lbaint_t blkcnt, const void *buf)
|
||||
{
|
||||
block_dev_desc_t *block_dev = &ums_dev->block_dev;
|
||||
struct blk_desc *block_dev = &ums_dev->block_dev;
|
||||
lbaint_t blkstart = start + ums_dev->start_sector;
|
||||
|
||||
return block_dev->block_write(block_dev, blkstart, blkcnt, buf);
|
||||
@ -53,7 +53,7 @@ static void ums_fini(void)
|
||||
static int ums_init(const char *devtype, const char *devnums)
|
||||
{
|
||||
char *s, *t, *devnum, *name;
|
||||
block_dev_desc_t *block_dev;
|
||||
struct blk_desc *block_dev;
|
||||
int ret;
|
||||
struct ums *ums_new;
|
||||
|
||||
|
@ -39,7 +39,7 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
|
||||
int part;
|
||||
ulong addr = 0;
|
||||
disk_partition_t info;
|
||||
block_dev_desc_t *dev_desc;
|
||||
struct blk_desc *dev_desc;
|
||||
char buf[12];
|
||||
unsigned long count;
|
||||
const char *addr_str;
|
||||
@ -135,7 +135,7 @@ static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
const char *filename = "/";
|
||||
int part;
|
||||
block_dev_desc_t *dev_desc;
|
||||
struct blk_desc *dev_desc;
|
||||
disk_partition_t info;
|
||||
struct device_s vdev;
|
||||
|
||||
|
@ -38,7 +38,7 @@ int env_init(void)
|
||||
int saveenv(void)
|
||||
{
|
||||
env_t env_new;
|
||||
block_dev_desc_t *dev_desc = NULL;
|
||||
struct blk_desc *dev_desc = NULL;
|
||||
disk_partition_t info;
|
||||
int dev, part;
|
||||
int err;
|
||||
@ -77,7 +77,7 @@ int saveenv(void)
|
||||
void env_relocate_spec(void)
|
||||
{
|
||||
ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
|
||||
block_dev_desc_t *dev_desc = NULL;
|
||||
struct blk_desc *dev_desc = NULL;
|
||||
disk_partition_t info;
|
||||
int dev, part;
|
||||
int err;
|
||||
|
@ -22,10 +22,10 @@
|
||||
static char *response_str;
|
||||
|
||||
struct fb_mmc_sparse {
|
||||
block_dev_desc_t *dev_desc;
|
||||
struct blk_desc *dev_desc;
|
||||
};
|
||||
|
||||
static int get_partition_info_efi_by_name_or_alias(block_dev_desc_t *dev_desc,
|
||||
static int get_partition_info_efi_by_name_or_alias(struct blk_desc *dev_desc,
|
||||
const char *name, disk_partition_t *info)
|
||||
{
|
||||
int ret;
|
||||
@ -55,7 +55,7 @@ static int fb_mmc_sparse_write(struct sparse_storage *storage,
|
||||
char *data)
|
||||
{
|
||||
struct fb_mmc_sparse *sparse = priv;
|
||||
block_dev_desc_t *dev_desc = sparse->dev_desc;
|
||||
struct blk_desc *dev_desc = sparse->dev_desc;
|
||||
int ret;
|
||||
|
||||
ret = dev_desc->block_write(dev_desc, offset, size, data);
|
||||
@ -65,7 +65,7 @@ static int fb_mmc_sparse_write(struct sparse_storage *storage,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void write_raw_image(block_dev_desc_t *dev_desc, disk_partition_t *info,
|
||||
static void write_raw_image(struct blk_desc *dev_desc, disk_partition_t *info,
|
||||
const char *part_name, void *buffer,
|
||||
unsigned int download_bytes)
|
||||
{
|
||||
@ -100,7 +100,7 @@ void fb_mmc_flash_write(const char *cmd, unsigned int session_id,
|
||||
void *download_buffer, unsigned int download_bytes,
|
||||
char *response)
|
||||
{
|
||||
block_dev_desc_t *dev_desc;
|
||||
struct blk_desc *dev_desc;
|
||||
disk_partition_t info;
|
||||
|
||||
/* initialize the response buffer */
|
||||
@ -165,7 +165,7 @@ void fb_mmc_flash_write(const char *cmd, unsigned int session_id,
|
||||
void fb_mmc_erase(const char *cmd, char *response)
|
||||
{
|
||||
int ret;
|
||||
block_dev_desc_t *dev_desc;
|
||||
struct blk_desc *dev_desc;
|
||||
disk_partition_t info;
|
||||
lbaint_t blks, blks_start, blks_size, grp_size;
|
||||
struct mmc *mmc = find_mmc_device(CONFIG_FASTBOOT_FLASH_MMC_DEV);
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <image.h>
|
||||
|
||||
#ifdef CONFIG_SPL_EXT_SUPPORT
|
||||
int spl_load_image_ext(block_dev_desc_t *block_dev,
|
||||
int spl_load_image_ext(struct blk_desc *block_dev,
|
||||
int partition,
|
||||
const char *filename)
|
||||
{
|
||||
@ -64,7 +64,7 @@ end:
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPL_OS_BOOT
|
||||
int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
|
||||
int spl_load_image_ext_os(struct blk_desc *block_dev, int partition)
|
||||
{
|
||||
int err;
|
||||
__maybe_unused loff_t filelen, actlen;
|
||||
@ -137,7 +137,7 @@ defaults:
|
||||
CONFIG_SPL_FS_LOAD_KERNEL_NAME);
|
||||
}
|
||||
#else
|
||||
int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
|
||||
int spl_load_image_ext_os(struct blk_desc *block_dev, int partition)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
static int fat_registered;
|
||||
|
||||
#ifdef CONFIG_SPL_FAT_SUPPORT
|
||||
static int spl_register_fat_device(block_dev_desc_t *block_dev, int partition)
|
||||
static int spl_register_fat_device(struct blk_desc *block_dev, int partition)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
@ -39,7 +39,7 @@ static int spl_register_fat_device(block_dev_desc_t *block_dev, int partition)
|
||||
return err;
|
||||
}
|
||||
|
||||
int spl_load_image_fat(block_dev_desc_t *block_dev,
|
||||
int spl_load_image_fat(struct blk_desc *block_dev,
|
||||
int partition,
|
||||
const char *filename)
|
||||
{
|
||||
@ -72,7 +72,7 @@ end:
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPL_OS_BOOT
|
||||
int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition)
|
||||
int spl_load_image_fat_os(struct blk_desc *block_dev, int partition)
|
||||
{
|
||||
int err;
|
||||
__maybe_unused char *file;
|
||||
@ -121,7 +121,7 @@ defaults:
|
||||
CONFIG_SPL_FS_LOAD_KERNEL_NAME);
|
||||
}
|
||||
#else
|
||||
int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition)
|
||||
int spl_load_image_fat_os(struct blk_desc *block_dev, int partition)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||
int spl_sata_load_image(void)
|
||||
{
|
||||
int err;
|
||||
block_dev_desc_t *stor_dev;
|
||||
struct blk_desc *stor_dev;
|
||||
|
||||
err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE);
|
||||
if (err) {
|
||||
|
@ -25,7 +25,7 @@ static int usb_stor_curr_dev = -1; /* current device */
|
||||
int spl_usb_load_image(void)
|
||||
{
|
||||
int err;
|
||||
block_dev_desc_t *stor_dev;
|
||||
struct blk_desc *stor_dev;
|
||||
|
||||
usb_stop();
|
||||
err = usb_init();
|
||||
|
@ -67,7 +67,7 @@ static __u32 CBWTag;
|
||||
|
||||
static int usb_max_devs; /* number of highest available usb device */
|
||||
|
||||
static block_dev_desc_t usb_dev_desc[USB_MAX_STOR_DEV];
|
||||
static struct blk_desc usb_dev_desc[USB_MAX_STOR_DEV];
|
||||
|
||||
struct us_data;
|
||||
typedef int (*trans_cmnd)(ccb *cb, struct us_data *data);
|
||||
@ -115,17 +115,17 @@ static struct us_data usb_stor[USB_MAX_STOR_DEV];
|
||||
#define USB_STOR_TRANSPORT_ERROR -2
|
||||
|
||||
int usb_stor_get_info(struct usb_device *dev, struct us_data *us,
|
||||
block_dev_desc_t *dev_desc);
|
||||
struct blk_desc *dev_desc);
|
||||
int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
|
||||
struct us_data *ss);
|
||||
static unsigned long usb_stor_read(block_dev_desc_t *block_dev, lbaint_t blknr,
|
||||
static unsigned long usb_stor_read(struct blk_desc *block_dev, lbaint_t blknr,
|
||||
lbaint_t blkcnt, void *buffer);
|
||||
static unsigned long usb_stor_write(block_dev_desc_t *block_dev, lbaint_t blknr,
|
||||
static unsigned long usb_stor_write(struct blk_desc *block_dev, lbaint_t blknr,
|
||||
lbaint_t blkcnt, const void *buffer);
|
||||
void uhci_show_temp_int_td(void);
|
||||
|
||||
#ifdef CONFIG_PARTITIONS
|
||||
block_dev_desc_t *usb_stor_get_dev(int index)
|
||||
struct blk_desc *usb_stor_get_dev(int index)
|
||||
{
|
||||
return (index < usb_max_devs) ? &usb_dev_desc[index] : NULL;
|
||||
}
|
||||
@ -187,10 +187,10 @@ static int usb_stor_probe_device(struct usb_device *dev)
|
||||
for (lun = 0;
|
||||
lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV;
|
||||
lun++) {
|
||||
struct block_dev_desc *blkdev;
|
||||
struct blk_desc *blkdev;
|
||||
|
||||
blkdev = &usb_dev_desc[usb_max_devs];
|
||||
memset(blkdev, '\0', sizeof(block_dev_desc_t));
|
||||
memset(blkdev, '\0', sizeof(struct blk_desc));
|
||||
blkdev->if_type = IF_TYPE_USB;
|
||||
blkdev->dev = usb_max_devs;
|
||||
blkdev->part_type = PART_TYPE_UNKNOWN;
|
||||
@ -1011,7 +1011,7 @@ static int usb_write_10(ccb *srb, struct us_data *ss, unsigned long start,
|
||||
* device with proper values (as reported by 'usb info').
|
||||
*
|
||||
* Vendor and product length limits are taken from the definition of
|
||||
* block_dev_desc_t in include/part.h.
|
||||
* struct blk_desc in include/part.h.
|
||||
*/
|
||||
static void usb_bin_fixup(struct usb_device_descriptor descriptor,
|
||||
unsigned char vendor[],
|
||||
@ -1026,7 +1026,7 @@ static void usb_bin_fixup(struct usb_device_descriptor descriptor,
|
||||
}
|
||||
#endif /* CONFIG_USB_BIN_FIXUP */
|
||||
|
||||
static unsigned long usb_stor_read(block_dev_desc_t *block_dev, lbaint_t blknr,
|
||||
static unsigned long usb_stor_read(struct blk_desc *block_dev, lbaint_t blknr,
|
||||
lbaint_t blkcnt, void *buffer)
|
||||
{
|
||||
int device = block_dev->dev;
|
||||
@ -1097,7 +1097,7 @@ retry_it:
|
||||
return blkcnt;
|
||||
}
|
||||
|
||||
static unsigned long usb_stor_write(block_dev_desc_t *block_dev, lbaint_t blknr,
|
||||
static unsigned long usb_stor_write(struct blk_desc *block_dev, lbaint_t blknr,
|
||||
lbaint_t blkcnt, const void *buffer)
|
||||
{
|
||||
int device = block_dev->dev;
|
||||
@ -1289,7 +1289,7 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
|
||||
}
|
||||
|
||||
int usb_stor_get_info(struct usb_device *dev, struct us_data *ss,
|
||||
block_dev_desc_t *dev_desc)
|
||||
struct blk_desc *dev_desc)
|
||||
{
|
||||
unsigned char perq, modi;
|
||||
ALLOC_CACHE_ALIGN_BUFFER(u32, cap, 2);
|
||||
|
28
disk/part.c
28
disk/part.c
@ -22,7 +22,7 @@
|
||||
|
||||
struct block_drvr {
|
||||
char *name;
|
||||
block_dev_desc_t* (*get_dev)(int dev);
|
||||
struct blk_desc* (*get_dev)(int dev);
|
||||
int (*select_hwpart)(int dev_num, int hwpart);
|
||||
};
|
||||
|
||||
@ -58,10 +58,10 @@ static const struct block_drvr block_drvr[] = {
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#ifdef HAVE_BLOCK_DEVICE
|
||||
static block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart)
|
||||
static struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart)
|
||||
{
|
||||
const struct block_drvr *drvr = block_drvr;
|
||||
block_dev_desc_t* (*reloc_get_dev)(int dev);
|
||||
struct blk_desc* (*reloc_get_dev)(int dev);
|
||||
int (*select_hwpart)(int dev_num, int hwpart);
|
||||
char *name;
|
||||
int ret;
|
||||
@ -84,7 +84,7 @@ static block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart)
|
||||
select_hwpart += gd->reloc_off;
|
||||
#endif
|
||||
if (strncmp(ifname, name, strlen(name)) == 0) {
|
||||
block_dev_desc_t *dev_desc = reloc_get_dev(dev);
|
||||
struct blk_desc *dev_desc = reloc_get_dev(dev);
|
||||
if (!dev_desc)
|
||||
return NULL;
|
||||
if (hwpart == 0 && !select_hwpart)
|
||||
@ -101,17 +101,17 @@ static block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
block_dev_desc_t *get_dev(const char *ifname, int dev)
|
||||
struct blk_desc *get_dev(const char *ifname, int dev)
|
||||
{
|
||||
return get_dev_hwpart(ifname, dev, 0);
|
||||
}
|
||||
#else
|
||||
block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart)
|
||||
struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
block_dev_desc_t *get_dev(const char *ifname, int dev)
|
||||
struct blk_desc *get_dev(const char *ifname, int dev)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@ -144,7 +144,7 @@ static lba512_t lba512_muldiv(lba512_t block_count, lba512_t mul_by, lba512_t di
|
||||
return bc_quot * mul_by + (bc_rem * mul_by) / div_by;
|
||||
}
|
||||
|
||||
void dev_print (block_dev_desc_t *dev_desc)
|
||||
void dev_print (struct blk_desc *dev_desc)
|
||||
{
|
||||
lba512_t lba512; /* number of blocks if 512bytes block size */
|
||||
|
||||
@ -250,7 +250,7 @@ void dev_print (block_dev_desc_t *dev_desc)
|
||||
|
||||
#ifdef HAVE_BLOCK_DEVICE
|
||||
|
||||
void init_part(block_dev_desc_t *dev_desc)
|
||||
void init_part(struct blk_desc *dev_desc)
|
||||
{
|
||||
#ifdef CONFIG_ISO_PARTITION
|
||||
if (test_part_iso(dev_desc) == 0) {
|
||||
@ -297,7 +297,7 @@ void init_part(block_dev_desc_t *dev_desc)
|
||||
defined(CONFIG_AMIGA_PARTITION) || \
|
||||
defined(CONFIG_EFI_PARTITION)
|
||||
|
||||
static void print_part_header(const char *type, block_dev_desc_t *dev_desc)
|
||||
static void print_part_header(const char *type, struct blk_desc *dev_desc)
|
||||
{
|
||||
puts ("\nPartition Map for ");
|
||||
switch (dev_desc->if_type) {
|
||||
@ -335,7 +335,7 @@ static void print_part_header(const char *type, block_dev_desc_t *dev_desc)
|
||||
|
||||
#endif /* any CONFIG_..._PARTITION */
|
||||
|
||||
void print_part(block_dev_desc_t * dev_desc)
|
||||
void print_part(struct blk_desc *dev_desc)
|
||||
{
|
||||
|
||||
switch (dev_desc->part_type) {
|
||||
@ -383,7 +383,7 @@ void print_part(block_dev_desc_t * dev_desc)
|
||||
|
||||
#endif /* HAVE_BLOCK_DEVICE */
|
||||
|
||||
int get_partition_info(block_dev_desc_t *dev_desc, int part,
|
||||
int get_partition_info(struct blk_desc *dev_desc, int part,
|
||||
disk_partition_t *info)
|
||||
{
|
||||
#ifdef HAVE_BLOCK_DEVICE
|
||||
@ -450,7 +450,7 @@ int get_partition_info(block_dev_desc_t *dev_desc, int part,
|
||||
}
|
||||
|
||||
int get_device(const char *ifname, const char *dev_hwpart_str,
|
||||
block_dev_desc_t **dev_desc)
|
||||
struct blk_desc **dev_desc)
|
||||
{
|
||||
char *ep;
|
||||
char *dup_str = NULL;
|
||||
@ -512,7 +512,7 @@ cleanup:
|
||||
#define PART_AUTO -1
|
||||
#define MAX_SEARCH_PARTITIONS 16
|
||||
int get_device_and_partition(const char *ifname, const char *dev_part_str,
|
||||
block_dev_desc_t **dev_desc,
|
||||
struct blk_desc **dev_desc,
|
||||
disk_partition_t *info, int allow_whole_dev)
|
||||
{
|
||||
int ret = -1;
|
||||
|
@ -126,7 +126,7 @@ static void print_part_info(struct partition_block *p)
|
||||
* the ID AMIGA_ID_RDISK ('RDSK') and needs to have a valid
|
||||
* sum-to-zero checksum
|
||||
*/
|
||||
struct rigid_disk_block *get_rdisk(block_dev_desc_t *dev_desc)
|
||||
struct rigid_disk_block *get_rdisk(struct blk_desc *dev_desc)
|
||||
{
|
||||
int i;
|
||||
int limit;
|
||||
@ -166,7 +166,7 @@ struct rigid_disk_block *get_rdisk(block_dev_desc_t *dev_desc)
|
||||
* Ridgid disk block
|
||||
*/
|
||||
|
||||
struct bootcode_block *get_bootcode(block_dev_desc_t *dev_desc)
|
||||
struct bootcode_block *get_bootcode(struct blk_desc *dev_desc)
|
||||
{
|
||||
int i;
|
||||
int limit;
|
||||
@ -207,7 +207,7 @@ struct bootcode_block *get_bootcode(block_dev_desc_t *dev_desc)
|
||||
* Test if the given partition has an Amiga partition table/Rigid
|
||||
* Disk block
|
||||
*/
|
||||
int test_part_amiga(block_dev_desc_t *dev_desc)
|
||||
int test_part_amiga(struct blk_desc *dev_desc)
|
||||
{
|
||||
struct rigid_disk_block *rdb;
|
||||
struct bootcode_block *bootcode;
|
||||
@ -236,7 +236,8 @@ int test_part_amiga(block_dev_desc_t *dev_desc)
|
||||
/*
|
||||
* Find partition number partnum on the given drive.
|
||||
*/
|
||||
static struct partition_block *find_partition(block_dev_desc_t *dev_desc, int partnum)
|
||||
static struct partition_block *find_partition(struct blk_desc *dev_desc,
|
||||
int partnum)
|
||||
{
|
||||
struct rigid_disk_block *rdb;
|
||||
struct partition_block *p;
|
||||
@ -290,7 +291,8 @@ static struct partition_block *find_partition(block_dev_desc_t *dev_desc, int pa
|
||||
/*
|
||||
* Get info about a partition
|
||||
*/
|
||||
int get_partition_info_amiga (block_dev_desc_t *dev_desc, int part, disk_partition_t *info)
|
||||
int get_partition_info_amiga(struct blk_desc *dev_desc, int part,
|
||||
disk_partition_t *info)
|
||||
{
|
||||
struct partition_block *p = find_partition(dev_desc, part-1);
|
||||
struct amiga_part_geometry *g;
|
||||
@ -317,7 +319,7 @@ int get_partition_info_amiga (block_dev_desc_t *dev_desc, int part, disk_partiti
|
||||
return 0;
|
||||
}
|
||||
|
||||
void print_part_amiga (block_dev_desc_t *dev_desc)
|
||||
void print_part_amiga(struct blk_desc *dev_desc)
|
||||
{
|
||||
struct rigid_disk_block *rdb;
|
||||
struct bootcode_block *boot;
|
||||
|
@ -87,7 +87,7 @@ static int test_block_type(unsigned char *buffer)
|
||||
}
|
||||
|
||||
|
||||
int test_part_dos (block_dev_desc_t *dev_desc)
|
||||
int test_part_dos(struct blk_desc *dev_desc)
|
||||
{
|
||||
ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
|
||||
|
||||
@ -102,7 +102,7 @@ int test_part_dos (block_dev_desc_t *dev_desc)
|
||||
|
||||
/* Print a partition that is relative to its Extended partition table
|
||||
*/
|
||||
static void print_partition_extended(block_dev_desc_t *dev_desc,
|
||||
static void print_partition_extended(struct blk_desc *dev_desc,
|
||||
lbaint_t ext_part_sector,
|
||||
lbaint_t relative,
|
||||
int part_num, unsigned int disksig)
|
||||
@ -167,11 +167,11 @@ static void print_partition_extended(block_dev_desc_t *dev_desc,
|
||||
|
||||
/* Print a partition that is relative to its Extended partition table
|
||||
*/
|
||||
static int get_partition_info_extended (block_dev_desc_t *dev_desc,
|
||||
lbaint_t ext_part_sector,
|
||||
lbaint_t relative, int part_num,
|
||||
int which_part, disk_partition_t *info,
|
||||
unsigned int disksig)
|
||||
static int get_partition_info_extended(struct blk_desc *dev_desc,
|
||||
lbaint_t ext_part_sector,
|
||||
lbaint_t relative, int part_num,
|
||||
int which_part, disk_partition_t *info,
|
||||
unsigned int disksig)
|
||||
{
|
||||
ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
|
||||
dos_partition_t *pt;
|
||||
@ -283,13 +283,14 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc,
|
||||
return -1;
|
||||
}
|
||||
|
||||
void print_part_dos (block_dev_desc_t *dev_desc)
|
||||
void print_part_dos(struct blk_desc *dev_desc)
|
||||
{
|
||||
printf("Part\tStart Sector\tNum Sectors\tUUID\t\tType\n");
|
||||
print_partition_extended(dev_desc, 0, 0, 1, 0);
|
||||
}
|
||||
|
||||
int get_partition_info_dos (block_dev_desc_t *dev_desc, int part, disk_partition_t * info)
|
||||
int get_partition_info_dos(struct blk_desc *dev_desc, int part,
|
||||
disk_partition_t *info)
|
||||
{
|
||||
return get_partition_info_extended(dev_desc, 0, 0, 1, part, info, 0);
|
||||
}
|
||||
|
@ -41,10 +41,10 @@ static inline u32 efi_crc32(const void *buf, u32 len)
|
||||
|
||||
static int pmbr_part_valid(struct partition *part);
|
||||
static int is_pmbr_valid(legacy_mbr * mbr);
|
||||
static int is_gpt_valid(block_dev_desc_t *dev_desc, u64 lba,
|
||||
static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba,
|
||||
gpt_header *pgpt_head, gpt_entry **pgpt_pte);
|
||||
static gpt_entry *alloc_read_gpt_entries(block_dev_desc_t * dev_desc,
|
||||
gpt_header * pgpt_head);
|
||||
static gpt_entry *alloc_read_gpt_entries(struct blk_desc *dev_desc,
|
||||
gpt_header *pgpt_head);
|
||||
static int is_pte_valid(gpt_entry * pte);
|
||||
|
||||
static char *print_efiname(gpt_entry *pte)
|
||||
@ -176,7 +176,7 @@ static void prepare_backup_gpt_header(gpt_header *gpt_h)
|
||||
* Public Functions (include/part.h)
|
||||
*/
|
||||
|
||||
void print_part_efi(block_dev_desc_t * dev_desc)
|
||||
void print_part_efi(struct blk_desc *dev_desc)
|
||||
{
|
||||
ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, dev_desc->blksz);
|
||||
gpt_entry *gpt_pte = NULL;
|
||||
@ -237,8 +237,8 @@ void print_part_efi(block_dev_desc_t * dev_desc)
|
||||
return;
|
||||
}
|
||||
|
||||
int get_partition_info_efi(block_dev_desc_t * dev_desc, int part,
|
||||
disk_partition_t * info)
|
||||
int get_partition_info_efi(struct blk_desc *dev_desc, int part,
|
||||
disk_partition_t *info)
|
||||
{
|
||||
ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, dev_desc->blksz);
|
||||
gpt_entry *gpt_pte = NULL;
|
||||
@ -300,7 +300,7 @@ int get_partition_info_efi(block_dev_desc_t * dev_desc, int part,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_partition_info_efi_by_name(block_dev_desc_t *dev_desc,
|
||||
int get_partition_info_efi_by_name(struct blk_desc *dev_desc,
|
||||
const char *name, disk_partition_t *info)
|
||||
{
|
||||
int ret;
|
||||
@ -319,7 +319,7 @@ int get_partition_info_efi_by_name(block_dev_desc_t *dev_desc,
|
||||
return -2;
|
||||
}
|
||||
|
||||
int test_part_efi(block_dev_desc_t * dev_desc)
|
||||
int test_part_efi(struct blk_desc *dev_desc)
|
||||
{
|
||||
ALLOC_CACHE_ALIGN_BUFFER_PAD(legacy_mbr, legacymbr, 1, dev_desc->blksz);
|
||||
|
||||
@ -337,7 +337,7 @@ int test_part_efi(block_dev_desc_t * dev_desc)
|
||||
*
|
||||
* @return - zero on success, otherwise error
|
||||
*/
|
||||
static int set_protective_mbr(block_dev_desc_t *dev_desc)
|
||||
static int set_protective_mbr(struct blk_desc *dev_desc)
|
||||
{
|
||||
/* Setup the Protective MBR */
|
||||
ALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, p_mbr, 1);
|
||||
@ -363,7 +363,7 @@ static int set_protective_mbr(block_dev_desc_t *dev_desc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int write_gpt_table(block_dev_desc_t *dev_desc,
|
||||
int write_gpt_table(struct blk_desc *dev_desc,
|
||||
gpt_header *gpt_h, gpt_entry *gpt_e)
|
||||
{
|
||||
const int pte_blk_cnt = BLOCK_CNT((gpt_h->num_partition_entries
|
||||
@ -517,7 +517,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int gpt_fill_header(block_dev_desc_t *dev_desc, gpt_header *gpt_h,
|
||||
int gpt_fill_header(struct blk_desc *dev_desc, gpt_header *gpt_h,
|
||||
char *str_guid, int parts_count)
|
||||
{
|
||||
gpt_h->signature = cpu_to_le64(GPT_HEADER_SIGNATURE);
|
||||
@ -539,7 +539,7 @@ int gpt_fill_header(block_dev_desc_t *dev_desc, gpt_header *gpt_h,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int gpt_restore(block_dev_desc_t *dev_desc, char *str_disk_guid,
|
||||
int gpt_restore(struct blk_desc *dev_desc, char *str_disk_guid,
|
||||
disk_partition_t *partitions, int parts_count)
|
||||
{
|
||||
int ret;
|
||||
@ -595,7 +595,7 @@ static void gpt_convert_efi_name_to_char(char *s, efi_char16_t *es, int n)
|
||||
}
|
||||
}
|
||||
|
||||
int gpt_verify_headers(block_dev_desc_t *dev_desc, gpt_header *gpt_head,
|
||||
int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head,
|
||||
gpt_entry **gpt_pte)
|
||||
{
|
||||
/*
|
||||
@ -619,7 +619,7 @@ int gpt_verify_headers(block_dev_desc_t *dev_desc, gpt_header *gpt_head,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int gpt_verify_partitions(block_dev_desc_t *dev_desc,
|
||||
int gpt_verify_partitions(struct blk_desc *dev_desc,
|
||||
disk_partition_t *partitions, int parts,
|
||||
gpt_header *gpt_head, gpt_entry **gpt_pte)
|
||||
{
|
||||
@ -691,7 +691,7 @@ int gpt_verify_partitions(block_dev_desc_t *dev_desc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int is_valid_gpt_buf(block_dev_desc_t *dev_desc, void *buf)
|
||||
int is_valid_gpt_buf(struct blk_desc *dev_desc, void *buf)
|
||||
{
|
||||
gpt_header *gpt_h;
|
||||
gpt_entry *gpt_e;
|
||||
@ -712,7 +712,7 @@ int is_valid_gpt_buf(block_dev_desc_t *dev_desc, void *buf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int write_mbr_and_gpt_partitions(block_dev_desc_t *dev_desc, void *buf)
|
||||
int write_mbr_and_gpt_partitions(struct blk_desc *dev_desc, void *buf)
|
||||
{
|
||||
gpt_header *gpt_h;
|
||||
gpt_entry *gpt_e;
|
||||
@ -834,7 +834,7 @@ static int is_pmbr_valid(legacy_mbr * mbr)
|
||||
* Description: returns 1 if valid, 0 on error.
|
||||
* If valid, returns pointers to PTEs.
|
||||
*/
|
||||
static int is_gpt_valid(block_dev_desc_t *dev_desc, u64 lba,
|
||||
static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba,
|
||||
gpt_header *pgpt_head, gpt_entry **pgpt_pte)
|
||||
{
|
||||
if (!dev_desc || !pgpt_head) {
|
||||
@ -876,8 +876,8 @@ static int is_gpt_valid(block_dev_desc_t *dev_desc, u64 lba,
|
||||
* Allocates space for PTEs based on information found in @gpt.
|
||||
* Notes: remember to free pte when you're done!
|
||||
*/
|
||||
static gpt_entry *alloc_read_gpt_entries(block_dev_desc_t * dev_desc,
|
||||
gpt_header * pgpt_head)
|
||||
static gpt_entry *alloc_read_gpt_entries(struct blk_desc *dev_desc,
|
||||
gpt_header *pgpt_head)
|
||||
{
|
||||
size_t count = 0, blk_cnt;
|
||||
lbaint_t blk;
|
||||
|
@ -46,7 +46,8 @@ static inline unsigned short le16_to_int(unsigned char *le16)
|
||||
|
||||
|
||||
/* only boot records will be listed as valid partitions */
|
||||
int get_partition_info_iso_verb(block_dev_desc_t * dev_desc, int part_num, disk_partition_t * info, int verb)
|
||||
int get_partition_info_iso_verb(struct blk_desc *dev_desc, int part_num,
|
||||
disk_partition_t *info, int verb)
|
||||
{
|
||||
int i,offset,entry_num;
|
||||
unsigned short *chksumbuf;
|
||||
@ -216,13 +217,14 @@ found:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_partition_info_iso(block_dev_desc_t * dev_desc, int part_num, disk_partition_t * info)
|
||||
int get_partition_info_iso(struct blk_desc *dev_desc, int part_num,
|
||||
disk_partition_t *info)
|
||||
{
|
||||
return(get_partition_info_iso_verb(dev_desc, part_num, info, 1));
|
||||
}
|
||||
|
||||
|
||||
void print_part_iso(block_dev_desc_t * dev_desc)
|
||||
void print_part_iso(struct blk_desc *dev_desc)
|
||||
{
|
||||
disk_partition_t info;
|
||||
int i;
|
||||
@ -239,7 +241,7 @@ void print_part_iso(block_dev_desc_t * dev_desc)
|
||||
} while (get_partition_info_iso_verb(dev_desc,i,&info,0)!=-1);
|
||||
}
|
||||
|
||||
int test_part_iso (block_dev_desc_t *dev_desc)
|
||||
int test_part_iso(struct blk_desc *dev_desc)
|
||||
{
|
||||
disk_partition_t info;
|
||||
|
||||
|
@ -32,13 +32,15 @@ extern ldiv_t ldiv (long int __numer, long int __denom);
|
||||
#endif
|
||||
|
||||
|
||||
static int part_mac_read_ddb (block_dev_desc_t *dev_desc, mac_driver_desc_t *ddb_p);
|
||||
static int part_mac_read_pdb (block_dev_desc_t *dev_desc, int part, mac_partition_t *pdb_p);
|
||||
static int part_mac_read_ddb(struct blk_desc *dev_desc,
|
||||
mac_driver_desc_t *ddb_p);
|
||||
static int part_mac_read_pdb(struct blk_desc *dev_desc, int part,
|
||||
mac_partition_t *pdb_p);
|
||||
|
||||
/*
|
||||
* Test for a valid MAC partition
|
||||
*/
|
||||
int test_part_mac (block_dev_desc_t *dev_desc)
|
||||
int test_part_mac(struct blk_desc *dev_desc)
|
||||
{
|
||||
ALLOC_CACHE_ALIGN_BUFFER(mac_driver_desc_t, ddesc, 1);
|
||||
ALLOC_CACHE_ALIGN_BUFFER(mac_partition_t, mpart, 1);
|
||||
@ -63,7 +65,7 @@ int test_part_mac (block_dev_desc_t *dev_desc)
|
||||
}
|
||||
|
||||
|
||||
void print_part_mac (block_dev_desc_t *dev_desc)
|
||||
void print_part_mac(struct blk_desc *dev_desc)
|
||||
{
|
||||
ulong i, n;
|
||||
ALLOC_CACHE_ALIGN_BUFFER(mac_driver_desc_t, ddesc, 1);
|
||||
@ -149,7 +151,8 @@ void print_part_mac (block_dev_desc_t *dev_desc)
|
||||
/*
|
||||
* Read Device Descriptor Block
|
||||
*/
|
||||
static int part_mac_read_ddb (block_dev_desc_t *dev_desc, mac_driver_desc_t *ddb_p)
|
||||
static int part_mac_read_ddb(struct blk_desc *dev_desc,
|
||||
mac_driver_desc_t *ddb_p)
|
||||
{
|
||||
if (dev_desc->block_read(dev_desc, 0, 1, (ulong *)ddb_p) != 1) {
|
||||
printf ("** Can't read Driver Desriptor Block **\n");
|
||||
@ -169,7 +172,8 @@ static int part_mac_read_ddb (block_dev_desc_t *dev_desc, mac_driver_desc_t *ddb
|
||||
/*
|
||||
* Read Partition Descriptor Block
|
||||
*/
|
||||
static int part_mac_read_pdb (block_dev_desc_t *dev_desc, int part, mac_partition_t *pdb_p)
|
||||
static int part_mac_read_pdb(struct blk_desc *dev_desc, int part,
|
||||
mac_partition_t *pdb_p)
|
||||
{
|
||||
int n = 1;
|
||||
|
||||
@ -210,7 +214,8 @@ static int part_mac_read_pdb (block_dev_desc_t *dev_desc, int part, mac_partitio
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
int get_partition_info_mac (block_dev_desc_t *dev_desc, int part, disk_partition_t *info)
|
||||
int get_partition_info_mac(struct blk_desc *dev_desc, int part,
|
||||
disk_partition_t *info)
|
||||
{
|
||||
ALLOC_CACHE_ALIGN_BUFFER(mac_driver_desc_t, ddesc, 1);
|
||||
ALLOC_CACHE_ALIGN_BUFFER(mac_partition_t, mpart, 1);
|
||||
|
@ -620,7 +620,7 @@ int reset_sata(int dev)
|
||||
|
||||
static void dwc_ahsata_print_info(int dev)
|
||||
{
|
||||
block_dev_desc_t *pdev = &(sata_dev_desc[dev]);
|
||||
struct blk_desc *pdev = &(sata_dev_desc[dev]);
|
||||
|
||||
printf("SATA Device Info:\n\r");
|
||||
#ifdef CONFIG_SYS_64BIT_LBA
|
||||
@ -956,7 +956,7 @@ int scan_sata(int dev)
|
||||
struct ahci_probe_ent *probe_ent =
|
||||
(struct ahci_probe_ent *)sata_dev_desc[dev].priv;
|
||||
u8 port = probe_ent->hard_port_no;
|
||||
block_dev_desc_t *pdev = &(sata_dev_desc[dev]);
|
||||
struct blk_desc *pdev = &(sata_dev_desc[dev]);
|
||||
|
||||
id = (u16 *)memalign(ARCH_DMA_MINALIGN,
|
||||
roundup(ARCH_DMA_MINALIGN,
|
||||
|
@ -22,7 +22,7 @@ static struct host_block_dev *find_host_device(int dev)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static unsigned long host_block_read(block_dev_desc_t *block_dev,
|
||||
static unsigned long host_block_read(struct blk_desc *block_dev,
|
||||
unsigned long start, lbaint_t blkcnt,
|
||||
void *buffer)
|
||||
{
|
||||
@ -44,7 +44,7 @@ static unsigned long host_block_read(block_dev_desc_t *block_dev,
|
||||
return -1;
|
||||
}
|
||||
|
||||
static unsigned long host_block_write(block_dev_desc_t *block_dev,
|
||||
static unsigned long host_block_write(struct blk_desc *block_dev,
|
||||
unsigned long start, lbaint_t blkcnt,
|
||||
const void *buffer)
|
||||
{
|
||||
@ -89,7 +89,7 @@ int host_dev_bind(int dev, char *filename)
|
||||
return 1;
|
||||
}
|
||||
|
||||
block_dev_desc_t *blk_dev = &host_dev->blk_dev;
|
||||
struct blk_desc *blk_dev = &host_dev->blk_dev;
|
||||
blk_dev->if_type = IF_TYPE_HOST;
|
||||
blk_dev->priv = host_dev;
|
||||
blk_dev->blksz = 512;
|
||||
@ -103,7 +103,7 @@ int host_dev_bind(int dev, char *filename)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int host_get_dev_err(int dev, block_dev_desc_t **blk_devp)
|
||||
int host_get_dev_err(int dev, struct blk_desc **blk_devp)
|
||||
{
|
||||
struct host_block_dev *host_dev = find_host_device(dev);
|
||||
|
||||
@ -117,9 +117,9 @@ int host_get_dev_err(int dev, block_dev_desc_t **blk_devp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
block_dev_desc_t *host_get_dev(int dev)
|
||||
struct blk_desc *host_get_dev(int dev)
|
||||
{
|
||||
block_dev_desc_t *blk_dev;
|
||||
struct blk_desc *blk_dev;
|
||||
|
||||
if (host_get_dev_err(dev, &blk_dev))
|
||||
return NULL;
|
||||
|
@ -69,11 +69,11 @@ static u16 ace_readw(unsigned off)
|
||||
return in16(base + off);
|
||||
}
|
||||
|
||||
static unsigned long systemace_read(block_dev_desc_t *block_dev,
|
||||
static unsigned long systemace_read(struct blk_desc *block_dev,
|
||||
unsigned long start, lbaint_t blkcnt,
|
||||
void *buffer);
|
||||
|
||||
static block_dev_desc_t systemace_dev = { 0 };
|
||||
static struct blk_desc systemace_dev = { 0 };
|
||||
|
||||
static int get_cf_lock(void)
|
||||
{
|
||||
@ -105,7 +105,7 @@ static void release_cf_lock(void)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PARTITIONS
|
||||
block_dev_desc_t *systemace_get_dev(int dev)
|
||||
struct blk_desc *systemace_get_dev(int dev)
|
||||
{
|
||||
/* The first time through this, the systemace_dev object is
|
||||
not yet initialized. In that case, fill it in. */
|
||||
@ -137,7 +137,7 @@ block_dev_desc_t *systemace_get_dev(int dev)
|
||||
* the dev_desc) to read blocks of data. The return value is the
|
||||
* number of blocks read. A zero return indicates an error.
|
||||
*/
|
||||
static unsigned long systemace_read(block_dev_desc_t *block_dev,
|
||||
static unsigned long systemace_read(struct blk_desc *block_dev,
|
||||
unsigned long start, lbaint_t blkcnt,
|
||||
void *buffer)
|
||||
{
|
||||
|
@ -351,7 +351,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
|
||||
|
||||
} else if (!strcmp(entity_type, "part")) {
|
||||
disk_partition_t partinfo;
|
||||
block_dev_desc_t *blk_dev = &mmc->block_dev;
|
||||
struct blk_desc *blk_dev = &mmc->block_dev;
|
||||
int mmcdev = second_arg;
|
||||
int mmcpart = third_arg;
|
||||
|
||||
|
@ -234,7 +234,7 @@ static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start,
|
||||
return blkcnt;
|
||||
}
|
||||
|
||||
static ulong mmc_bread(block_dev_desc_t *block_dev, lbaint_t start,
|
||||
static ulong mmc_bread(struct blk_desc *block_dev, lbaint_t start,
|
||||
lbaint_t blkcnt, void *dst)
|
||||
{
|
||||
int dev_num = block_dev->dev;
|
||||
@ -1579,7 +1579,7 @@ void mmc_destroy(struct mmc *mmc)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PARTITIONS
|
||||
block_dev_desc_t *mmc_get_dev(int dev)
|
||||
struct blk_desc *mmc_get_dev(int dev)
|
||||
{
|
||||
struct mmc *mmc = find_mmc_device(dev);
|
||||
if (!mmc || mmc_init(mmc))
|
||||
|
@ -22,23 +22,23 @@ void mmc_adapter_card_type_ident(void);
|
||||
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
|
||||
unsigned long mmc_berase(block_dev_desc_t *block_dev, lbaint_t start,
|
||||
unsigned long mmc_berase(struct blk_desc *block_dev, lbaint_t start,
|
||||
lbaint_t blkcnt);
|
||||
|
||||
unsigned long mmc_bwrite(block_dev_desc_t *block_dev, lbaint_t start,
|
||||
unsigned long mmc_bwrite(struct blk_desc *block_dev, lbaint_t start,
|
||||
lbaint_t blkcnt, const void *src);
|
||||
|
||||
#else /* CONFIG_SPL_BUILD */
|
||||
|
||||
/* SPL will never write or erase, declare dummies to reduce code size. */
|
||||
|
||||
static inline unsigned long mmc_berase(block_dev_desc_t *block_dev,
|
||||
static inline unsigned long mmc_berase(struct blk_desc *block_dev,
|
||||
lbaint_t start, lbaint_t blkcnt)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline ulong mmc_bwrite(block_dev_desc_t *block_dev, lbaint_t start,
|
||||
static inline ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start,
|
||||
lbaint_t blkcnt, const void *src)
|
||||
{
|
||||
return 0;
|
||||
|
@ -65,7 +65,7 @@ err_out:
|
||||
return err;
|
||||
}
|
||||
|
||||
unsigned long mmc_berase(block_dev_desc_t *block_dev, lbaint_t start,
|
||||
unsigned long mmc_berase(struct blk_desc *block_dev, lbaint_t start,
|
||||
lbaint_t blkcnt)
|
||||
{
|
||||
int dev_num = block_dev->dev;
|
||||
@ -171,7 +171,7 @@ static ulong mmc_write_blocks(struct mmc *mmc, lbaint_t start,
|
||||
return blkcnt;
|
||||
}
|
||||
|
||||
ulong mmc_bwrite(block_dev_desc_t *block_dev, lbaint_t start, lbaint_t blkcnt,
|
||||
ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt,
|
||||
const void *src)
|
||||
{
|
||||
int dev_num = block_dev->dev;
|
||||
|
@ -32,13 +32,13 @@
|
||||
|
||||
lbaint_t part_offset;
|
||||
|
||||
static block_dev_desc_t *ext4fs_block_dev_desc;
|
||||
static struct blk_desc *ext4fs_blk_desc;
|
||||
static disk_partition_t *part_info;
|
||||
|
||||
void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info)
|
||||
void ext4fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
|
||||
{
|
||||
assert(rbdd->blksz == (1 << rbdd->log2blksz));
|
||||
ext4fs_block_dev_desc = rbdd;
|
||||
ext4fs_blk_desc = rbdd;
|
||||
get_fs()->dev_desc = rbdd;
|
||||
part_info = info;
|
||||
part_offset = info->start;
|
||||
@ -49,11 +49,11 @@ void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info)
|
||||
int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf)
|
||||
{
|
||||
unsigned block_len;
|
||||
int log2blksz = ext4fs_block_dev_desc->log2blksz;
|
||||
ALLOC_CACHE_ALIGN_BUFFER(char, sec_buf, (ext4fs_block_dev_desc ?
|
||||
ext4fs_block_dev_desc->blksz :
|
||||
int log2blksz = ext4fs_blk_desc->log2blksz;
|
||||
ALLOC_CACHE_ALIGN_BUFFER(char, sec_buf, (ext4fs_blk_desc ?
|
||||
ext4fs_blk_desc->blksz :
|
||||
0));
|
||||
if (ext4fs_block_dev_desc == NULL) {
|
||||
if (ext4fs_blk_desc == NULL) {
|
||||
printf("** Invalid Block Device Descriptor (NULL)\n");
|
||||
return 0;
|
||||
}
|
||||
@ -69,21 +69,20 @@ int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf)
|
||||
|
||||
/* Get the read to the beginning of a partition */
|
||||
sector += byte_offset >> log2blksz;
|
||||
byte_offset &= ext4fs_block_dev_desc->blksz - 1;
|
||||
byte_offset &= ext4fs_blk_desc->blksz - 1;
|
||||
|
||||
debug(" <" LBAFU ", %d, %d>\n", sector, byte_offset, byte_len);
|
||||
|
||||
if (byte_offset != 0) {
|
||||
int readlen;
|
||||
/* read first part which isn't aligned with start of sector */
|
||||
if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc,
|
||||
part_info->start + sector,
|
||||
1, (void *)sec_buf)
|
||||
!= 1) {
|
||||
if (ext4fs_blk_desc->block_read(ext4fs_blk_desc,
|
||||
part_info->start + sector,
|
||||
1, (void *)sec_buf) != 1) {
|
||||
printf(" ** ext2fs_devread() read error **\n");
|
||||
return 0;
|
||||
}
|
||||
readlen = min((int)ext4fs_block_dev_desc->blksz - byte_offset,
|
||||
readlen = min((int)ext4fs_blk_desc->blksz - byte_offset,
|
||||
byte_len);
|
||||
memcpy(buf, sec_buf + byte_offset, readlen);
|
||||
buf += readlen;
|
||||
@ -95,38 +94,36 @@ int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf)
|
||||
return 1;
|
||||
|
||||
/* read sector aligned part */
|
||||
block_len = byte_len & ~(ext4fs_block_dev_desc->blksz - 1);
|
||||
block_len = byte_len & ~(ext4fs_blk_desc->blksz - 1);
|
||||
|
||||
if (block_len == 0) {
|
||||
ALLOC_CACHE_ALIGN_BUFFER(u8, p, ext4fs_block_dev_desc->blksz);
|
||||
ALLOC_CACHE_ALIGN_BUFFER(u8, p, ext4fs_blk_desc->blksz);
|
||||
|
||||
block_len = ext4fs_block_dev_desc->blksz;
|
||||
ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc,
|
||||
block_len = ext4fs_blk_desc->blksz;
|
||||
ext4fs_blk_desc->block_read(ext4fs_blk_desc,
|
||||
part_info->start + sector,
|
||||
1, (void *)p);
|
||||
memcpy(buf, p, byte_len);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc,
|
||||
part_info->start + sector,
|
||||
block_len >> log2blksz,
|
||||
(void *)buf) !=
|
||||
block_len >> log2blksz) {
|
||||
if (ext4fs_blk_desc->block_read(ext4fs_blk_desc,
|
||||
part_info->start + sector,
|
||||
block_len >> log2blksz, (void *)buf)
|
||||
!= block_len >> log2blksz) {
|
||||
printf(" ** %s read error - block\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
block_len = byte_len & ~(ext4fs_block_dev_desc->blksz - 1);
|
||||
block_len = byte_len & ~(ext4fs_blk_desc->blksz - 1);
|
||||
buf += block_len;
|
||||
byte_len -= block_len;
|
||||
sector += block_len / ext4fs_block_dev_desc->blksz;
|
||||
sector += block_len / ext4fs_blk_desc->blksz;
|
||||
|
||||
if (byte_len != 0) {
|
||||
/* read rest of data which are not in whole sector */
|
||||
if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc,
|
||||
part_info->start + sector,
|
||||
1, (void *)sec_buf)
|
||||
!= 1) {
|
||||
if (ext4fs_blk_desc->block_read(ext4fs_blk_desc,
|
||||
part_info->start + sector,
|
||||
1, (void *)sec_buf) != 1) {
|
||||
printf("* %s read error - last part\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ int ext4fs_read(char *buf, loff_t len, loff_t *actread)
|
||||
return ext4fs_read_file(ext4fs_file, 0, len, buf, actread);
|
||||
}
|
||||
|
||||
int ext4fs_probe(block_dev_desc_t *fs_dev_desc,
|
||||
int ext4fs_probe(struct blk_desc *fs_dev_desc,
|
||||
disk_partition_t *fs_partition)
|
||||
{
|
||||
ext4fs_set_blk_dev(fs_dev_desc, fs_partition);
|
||||
|
@ -37,7 +37,7 @@ static void downcase(char *str)
|
||||
}
|
||||
}
|
||||
|
||||
static block_dev_desc_t *cur_dev;
|
||||
static struct blk_desc *cur_dev;
|
||||
static disk_partition_t cur_part_info;
|
||||
|
||||
#define DOS_BOOT_MAGIC_OFFSET 0x1fe
|
||||
@ -60,7 +60,7 @@ static int disk_read(__u32 block, __u32 nr_blocks, void *buf)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int fat_set_blk_dev(block_dev_desc_t *dev_desc, disk_partition_t *info)
|
||||
int fat_set_blk_dev(struct blk_desc *dev_desc, disk_partition_t *info)
|
||||
{
|
||||
ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
|
||||
|
||||
@ -89,7 +89,7 @@ int fat_set_blk_dev(block_dev_desc_t *dev_desc, disk_partition_t *info)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int fat_register_device(block_dev_desc_t *dev_desc, int part_no)
|
||||
int fat_register_device(struct blk_desc *dev_desc, int part_no)
|
||||
{
|
||||
disk_partition_t info;
|
||||
|
||||
|
6
fs/fs.c
6
fs/fs.c
@ -20,11 +20,11 @@
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
static block_dev_desc_t *fs_dev_desc;
|
||||
static struct blk_desc *fs_dev_desc;
|
||||
static disk_partition_t fs_partition;
|
||||
static int fs_type = FS_TYPE_ANY;
|
||||
|
||||
static inline int fs_probe_unsupported(block_dev_desc_t *fs_dev_desc,
|
||||
static inline int fs_probe_unsupported(struct blk_desc *fs_dev_desc,
|
||||
disk_partition_t *fs_partition)
|
||||
{
|
||||
printf("** Unrecognized filesystem type **\n");
|
||||
@ -81,7 +81,7 @@ struct fstype_info {
|
||||
* filesystem.
|
||||
*/
|
||||
bool null_dev_desc_ok;
|
||||
int (*probe)(block_dev_desc_t *fs_dev_desc,
|
||||
int (*probe)(struct blk_desc *fs_dev_desc,
|
||||
disk_partition_t *fs_partition);
|
||||
int (*ls)(const char *dirname);
|
||||
int (*exists)(const char *filename);
|
||||
|
@ -12,13 +12,13 @@
|
||||
|
||||
#include "reiserfs_private.h"
|
||||
|
||||
static block_dev_desc_t *reiserfs_block_dev_desc;
|
||||
static struct blk_desc *reiserfs_blk_desc;
|
||||
static disk_partition_t *part_info;
|
||||
|
||||
|
||||
void reiserfs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info)
|
||||
void reiserfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
|
||||
{
|
||||
reiserfs_block_dev_desc = rbdd;
|
||||
reiserfs_blk_desc = rbdd;
|
||||
part_info = info;
|
||||
}
|
||||
|
||||
@ -53,17 +53,15 @@ int reiserfs_devread (int sector, int byte_offset, int byte_len, char *buf)
|
||||
#endif
|
||||
|
||||
|
||||
if (reiserfs_block_dev_desc == NULL)
|
||||
if (reiserfs_blk_desc == NULL)
|
||||
return 0;
|
||||
|
||||
|
||||
if (byte_offset != 0) {
|
||||
/* read first part which isn't aligned with start of sector */
|
||||
if (reiserfs_block_dev_desc->block_read(reiserfs_block_dev_desc,
|
||||
part_info->start +
|
||||
sector,
|
||||
1, (void *)sec_buf)
|
||||
!= 1) {
|
||||
if (reiserfs_blk_desc->block_read(reiserfs_blk_desc,
|
||||
part_info->start + sector,
|
||||
1, (void *)sec_buf) != 1) {
|
||||
printf (" ** reiserfs_devread() read error\n");
|
||||
return 0;
|
||||
}
|
||||
@ -75,11 +73,10 @@ int reiserfs_devread (int sector, int byte_offset, int byte_len, char *buf)
|
||||
|
||||
/* read sector aligned part */
|
||||
block_len = byte_len & ~(SECTOR_SIZE-1);
|
||||
if (reiserfs_block_dev_desc->block_read(reiserfs_block_dev_desc,
|
||||
part_info->start + sector,
|
||||
block_len / SECTOR_SIZE,
|
||||
(void *)buf)
|
||||
!= block_len/SECTOR_SIZE) {
|
||||
if (reiserfs_blk_desc->block_read(reiserfs_blk_desc,
|
||||
part_info->start + sector,
|
||||
block_len / SECTOR_SIZE, (void *)buf)
|
||||
!= block_len/SECTOR_SIZE) {
|
||||
printf (" ** reiserfs_devread() read error - block\n");
|
||||
return 0;
|
||||
}
|
||||
@ -89,11 +86,9 @@ int reiserfs_devread (int sector, int byte_offset, int byte_len, char *buf)
|
||||
|
||||
if ( byte_len != 0 ) {
|
||||
/* read rest of data which are not in whole sector */
|
||||
if (reiserfs_block_dev_desc->block_read(reiserfs_block_dev_desc,
|
||||
part_info->start +
|
||||
sector,
|
||||
1, (void *)sec_buf)
|
||||
!= 1) {
|
||||
if (reiserfs_blk_desc->block_read(reiserfs_blk_desc,
|
||||
part_info->start + sector,
|
||||
1, (void *)sec_buf) != 1) {
|
||||
printf (" ** reiserfs_devread() read error - last part\n");
|
||||
return 0;
|
||||
}
|
||||
|
@ -8,10 +8,10 @@
|
||||
#include <fs.h>
|
||||
#include <os.h>
|
||||
|
||||
int sandbox_fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info)
|
||||
int sandbox_fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
|
||||
{
|
||||
/*
|
||||
* Only accept a NULL block_dev_desc_t for the sandbox, which is when
|
||||
* Only accept a NULL struct blk_desc for the sandbox, which is when
|
||||
* hostfs interface is used
|
||||
*/
|
||||
return rbdd != NULL;
|
||||
|
@ -561,7 +561,7 @@ static unsigned long ubifs_findfile(struct super_block *sb, char *filename)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ubifs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info)
|
||||
int ubifs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
|
||||
{
|
||||
if (rbdd) {
|
||||
debug("UBIFS cannot be used with normal block devices\n");
|
||||
|
35
fs/zfs/dev.c
35
fs/zfs/dev.c
@ -13,12 +13,12 @@
|
||||
#include <config.h>
|
||||
#include <zfs_common.h>
|
||||
|
||||
static block_dev_desc_t *zfs_block_dev_desc;
|
||||
static struct blk_desc *zfs_blk_desc;
|
||||
static disk_partition_t *part_info;
|
||||
|
||||
void zfs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info)
|
||||
void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
|
||||
{
|
||||
zfs_block_dev_desc = rbdd;
|
||||
zfs_blk_desc = rbdd;
|
||||
part_info = info;
|
||||
}
|
||||
|
||||
@ -48,17 +48,16 @@ int zfs_devread(int sector, int byte_offset, int byte_len, char *buf)
|
||||
|
||||
debug(" <%d, %d, %d>\n", sector, byte_offset, byte_len);
|
||||
|
||||
if (zfs_block_dev_desc == NULL) {
|
||||
if (zfs_blk_desc == NULL) {
|
||||
printf("** Invalid Block Device Descriptor (NULL)\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (byte_offset != 0) {
|
||||
/* read first part which isn't aligned with start of sector */
|
||||
if (zfs_block_dev_desc->block_read(zfs_block_dev_desc,
|
||||
part_info->start + sector, 1,
|
||||
(void *)sec_buf)
|
||||
!= 1) {
|
||||
if (zfs_blk_desc->block_read(zfs_blk_desc,
|
||||
part_info->start + sector, 1,
|
||||
(void *)sec_buf) != 1) {
|
||||
printf(" ** zfs_devread() read error **\n");
|
||||
return 1;
|
||||
}
|
||||
@ -79,18 +78,16 @@ int zfs_devread(int sector, int byte_offset, int byte_len, char *buf)
|
||||
u8 p[SECTOR_SIZE];
|
||||
|
||||
block_len = SECTOR_SIZE;
|
||||
zfs_block_dev_desc->block_read(zfs_block_dev_desc,
|
||||
part_info->start + sector,
|
||||
1, (void *)p);
|
||||
zfs_blk_desc->block_read(zfs_blk_desc,
|
||||
part_info->start + sector,
|
||||
1, (void *)p);
|
||||
memcpy(buf, p, byte_len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (zfs_block_dev_desc->block_read(zfs_block_dev_desc,
|
||||
part_info->start + sector,
|
||||
block_len / SECTOR_SIZE,
|
||||
(void *)buf)
|
||||
!= block_len / SECTOR_SIZE) {
|
||||
if (zfs_blk_desc->block_read(zfs_blk_desc, part_info->start + sector,
|
||||
block_len / SECTOR_SIZE,
|
||||
(void *)buf) != block_len / SECTOR_SIZE) {
|
||||
printf(" ** zfs_devread() read error - block\n");
|
||||
return 1;
|
||||
}
|
||||
@ -102,9 +99,9 @@ int zfs_devread(int sector, int byte_offset, int byte_len, char *buf)
|
||||
|
||||
if (byte_len != 0) {
|
||||
/* read rest of data which are not in whole sector */
|
||||
if (zfs_block_dev_desc->block_read(zfs_block_dev_desc,
|
||||
part_info->start + sector,
|
||||
1, (void *)sec_buf) != 1) {
|
||||
if (zfs_blk_desc->block_read(zfs_blk_desc,
|
||||
part_info->start + sector,
|
||||
1, (void *)sec_buf) != 1) {
|
||||
printf(" ** zfs_devread() read error - last part\n");
|
||||
return 1;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "zfs_common.h"
|
||||
#include "div64.h"
|
||||
|
||||
block_dev_desc_t *zfs_dev_desc;
|
||||
struct blk_desc *zfs_dev_desc;
|
||||
|
||||
/*
|
||||
* The zfs plug-in routines for GRUB are:
|
||||
|
@ -813,7 +813,7 @@ void gzwrite_progress_finish(int retcode,
|
||||
* for files under 4GiB
|
||||
*/
|
||||
int gzwrite(unsigned char *src, int len,
|
||||
struct block_dev_desc *dev,
|
||||
struct blk_desc *dev,
|
||||
unsigned long szwritebuf,
|
||||
u64 startoffs,
|
||||
u64 szexpected);
|
||||
|
@ -110,7 +110,7 @@ struct ext_filesystem {
|
||||
/* Journal Related */
|
||||
|
||||
/* Block Device Descriptor */
|
||||
block_dev_desc_t *dev_desc;
|
||||
struct blk_desc *dev_desc;
|
||||
};
|
||||
|
||||
extern struct ext2_data *ext4fs_root;
|
||||
@ -141,9 +141,9 @@ int ext4fs_exists(const char *filename);
|
||||
int ext4fs_size(const char *filename, loff_t *size);
|
||||
void ext4fs_free_node(struct ext2fs_node *node, struct ext2fs_node *currroot);
|
||||
int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf);
|
||||
void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
|
||||
void ext4fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
|
||||
long int read_allocated_block(struct ext2_inode *inode, int fileblock);
|
||||
int ext4fs_probe(block_dev_desc_t *fs_dev_desc,
|
||||
int ext4fs_probe(struct blk_desc *fs_dev_desc,
|
||||
disk_partition_t *fs_partition);
|
||||
int ext4_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
|
||||
loff_t *actread);
|
||||
|
@ -203,8 +203,8 @@ int file_fat_read_at(const char *filename, loff_t pos, void *buffer,
|
||||
loff_t maxsize, loff_t *actread);
|
||||
int file_fat_read(const char *filename, void *buffer, int maxsize);
|
||||
const char *file_getfsname(int idx);
|
||||
int fat_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
|
||||
int fat_register_device(block_dev_desc_t *dev_desc, int part_no);
|
||||
int fat_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
|
||||
int fat_register_device(struct blk_desc *dev_desc, int part_no);
|
||||
|
||||
int file_fat_write(const char *filename, void *buf, loff_t offset, loff_t len,
|
||||
loff_t *actwrite);
|
||||
|
@ -41,10 +41,10 @@ typedef ulong lbaint_t;
|
||||
*/
|
||||
|
||||
void ide_init(void);
|
||||
typedef struct block_dev_desc block_dev_desc_t;
|
||||
ulong ide_read(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
|
||||
struct blk_desc;
|
||||
ulong ide_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
|
||||
void *buffer);
|
||||
ulong ide_write(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
|
||||
ulong ide_write(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
|
||||
const void *buffer);
|
||||
|
||||
#ifdef CONFIG_IDE_PREINIT
|
||||
|
@ -376,7 +376,7 @@ struct mmc {
|
||||
u64 capacity_gp[4];
|
||||
u64 enh_user_start;
|
||||
u64 enh_user_size;
|
||||
block_dev_desc_t block_dev;
|
||||
struct blk_desc block_dev;
|
||||
char op_cond_pending; /* 1 if we are waiting on an op_cond command */
|
||||
char init_in_progress; /* 1 if we have done mmc_start_init() */
|
||||
char preinit; /* start init as early as possible */
|
||||
|
130
include/part.h
130
include/part.h
@ -10,7 +10,7 @@
|
||||
#include <ide.h>
|
||||
#include <common.h>
|
||||
|
||||
struct block_dev_desc {
|
||||
struct blk_desc {
|
||||
int if_type; /* type of the interface */
|
||||
int dev; /* device number */
|
||||
unsigned char part_type; /* partition type */
|
||||
@ -28,23 +28,23 @@ struct block_dev_desc {
|
||||
char vendor [40+1]; /* IDE model, SCSI Vendor */
|
||||
char product[20+1]; /* IDE Serial no, SCSI product */
|
||||
char revision[8+1]; /* firmware revision */
|
||||
unsigned long (*block_read)(block_dev_desc_t *block_dev,
|
||||
unsigned long (*block_read)(struct blk_desc *block_dev,
|
||||
lbaint_t start,
|
||||
lbaint_t blkcnt,
|
||||
void *buffer);
|
||||
unsigned long (*block_write)(block_dev_desc_t *block_dev,
|
||||
unsigned long (*block_write)(struct blk_desc *block_dev,
|
||||
lbaint_t start,
|
||||
lbaint_t blkcnt,
|
||||
const void *buffer);
|
||||
unsigned long (*block_erase)(block_dev_desc_t *block_dev,
|
||||
unsigned long (*block_erase)(struct blk_desc *block_dev,
|
||||
lbaint_t start,
|
||||
lbaint_t blkcnt);
|
||||
void *priv; /* driver private struct pointer */
|
||||
};
|
||||
|
||||
#define BLOCK_CNT(size, block_dev_desc) (PAD_COUNT(size, block_dev_desc->blksz))
|
||||
#define PAD_TO_BLOCKSIZE(size, block_dev_desc) \
|
||||
(PAD_SIZE(size, block_dev_desc->blksz))
|
||||
#define BLOCK_CNT(size, blk_desc) (PAD_COUNT(size, blk_desc->blksz))
|
||||
#define PAD_TO_BLOCKSIZE(size, blk_desc) \
|
||||
(PAD_SIZE(size, blk_desc->blksz))
|
||||
#define LOG2(x) (((x & 0xaaaaaaaa) ? 1 : 0) + ((x & 0xcccccccc) ? 2 : 0) + \
|
||||
((x & 0xf0f0f0f0) ? 4 : 0) + ((x & 0xff00ff00) ? 8 : 0) + \
|
||||
((x & 0xffff0000) ? 16 : 0))
|
||||
@ -101,52 +101,53 @@ typedef struct disk_partition {
|
||||
|
||||
/* Misc _get_dev functions */
|
||||
#ifdef CONFIG_PARTITIONS
|
||||
block_dev_desc_t *get_dev(const char *ifname, int dev);
|
||||
block_dev_desc_t* ide_get_dev(int dev);
|
||||
block_dev_desc_t* sata_get_dev(int dev);
|
||||
block_dev_desc_t* scsi_get_dev(int dev);
|
||||
block_dev_desc_t* usb_stor_get_dev(int dev);
|
||||
block_dev_desc_t* mmc_get_dev(int dev);
|
||||
struct blk_desc *get_dev(const char *ifname, int dev);
|
||||
struct blk_desc *ide_get_dev(int dev);
|
||||
struct blk_desc *sata_get_dev(int dev);
|
||||
struct blk_desc *scsi_get_dev(int dev);
|
||||
struct blk_desc *usb_stor_get_dev(int dev);
|
||||
struct blk_desc *mmc_get_dev(int dev);
|
||||
int mmc_select_hwpart(int dev_num, int hwpart);
|
||||
block_dev_desc_t* systemace_get_dev(int dev);
|
||||
block_dev_desc_t* mg_disk_get_dev(int dev);
|
||||
block_dev_desc_t *host_get_dev(int dev);
|
||||
int host_get_dev_err(int dev, block_dev_desc_t **blk_devp);
|
||||
struct blk_desc *systemace_get_dev(int dev);
|
||||
struct blk_desc *mg_disk_get_dev(int dev);
|
||||
struct blk_desc *host_get_dev(int dev);
|
||||
int host_get_dev_err(int dev, struct blk_desc **blk_devp);
|
||||
|
||||
/* disk/part.c */
|
||||
int get_partition_info (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
|
||||
void print_part (block_dev_desc_t *dev_desc);
|
||||
void init_part (block_dev_desc_t *dev_desc);
|
||||
void dev_print(block_dev_desc_t *dev_desc);
|
||||
int get_partition_info(struct blk_desc *dev_desc, int part,
|
||||
disk_partition_t *info);
|
||||
void print_part(struct blk_desc *dev_desc);
|
||||
void init_part(struct blk_desc *dev_desc);
|
||||
void dev_print(struct blk_desc *dev_desc);
|
||||
int get_device(const char *ifname, const char *dev_str,
|
||||
block_dev_desc_t **dev_desc);
|
||||
struct blk_desc **dev_desc);
|
||||
int get_device_and_partition(const char *ifname, const char *dev_part_str,
|
||||
block_dev_desc_t **dev_desc,
|
||||
struct blk_desc **dev_desc,
|
||||
disk_partition_t *info, int allow_whole_dev);
|
||||
#else
|
||||
static inline block_dev_desc_t *get_dev(const char *ifname, int dev)
|
||||
static inline struct blk_desc *get_dev(const char *ifname, int dev)
|
||||
{ return NULL; }
|
||||
static inline block_dev_desc_t* ide_get_dev(int dev) { return NULL; }
|
||||
static inline block_dev_desc_t* sata_get_dev(int dev) { return NULL; }
|
||||
static inline block_dev_desc_t* scsi_get_dev(int dev) { return NULL; }
|
||||
static inline block_dev_desc_t* usb_stor_get_dev(int dev) { return NULL; }
|
||||
static inline block_dev_desc_t* mmc_get_dev(int dev) { return NULL; }
|
||||
static inline struct blk_desc *ide_get_dev(int dev) { return NULL; }
|
||||
static inline struct blk_desc *sata_get_dev(int dev) { return NULL; }
|
||||
static inline struct blk_desc *scsi_get_dev(int dev) { return NULL; }
|
||||
static inline struct blk_desc *usb_stor_get_dev(int dev) { return NULL; }
|
||||
static inline struct blk_desc *mmc_get_dev(int dev) { return NULL; }
|
||||
static inline int mmc_select_hwpart(int dev_num, int hwpart) { return -1; }
|
||||
static inline block_dev_desc_t* systemace_get_dev(int dev) { return NULL; }
|
||||
static inline block_dev_desc_t* mg_disk_get_dev(int dev) { return NULL; }
|
||||
static inline block_dev_desc_t *host_get_dev(int dev) { return NULL; }
|
||||
static inline struct blk_desc *systemace_get_dev(int dev) { return NULL; }
|
||||
static inline struct blk_desc *mg_disk_get_dev(int dev) { return NULL; }
|
||||
static inline struct blk_desc *host_get_dev(int dev) { return NULL; }
|
||||
|
||||
static inline int get_partition_info (block_dev_desc_t * dev_desc, int part,
|
||||
disk_partition_t *info) { return -1; }
|
||||
static inline void print_part (block_dev_desc_t *dev_desc) {}
|
||||
static inline void init_part (block_dev_desc_t *dev_desc) {}
|
||||
static inline void dev_print(block_dev_desc_t *dev_desc) {}
|
||||
static inline int get_partition_info(struct blk_desc *dev_desc, int part,
|
||||
disk_partition_t *info) { return -1; }
|
||||
static inline void print_part(struct blk_desc *dev_desc) {}
|
||||
static inline void init_part(struct blk_desc *dev_desc) {}
|
||||
static inline void dev_print(struct blk_desc *dev_desc) {}
|
||||
static inline int get_device(const char *ifname, const char *dev_str,
|
||||
block_dev_desc_t **dev_desc)
|
||||
struct blk_desc **dev_desc)
|
||||
{ return -1; }
|
||||
static inline int get_device_and_partition(const char *ifname,
|
||||
const char *dev_part_str,
|
||||
block_dev_desc_t **dev_desc,
|
||||
struct blk_desc **dev_desc,
|
||||
disk_partition_t *info,
|
||||
int allow_whole_dev)
|
||||
{ *dev_desc = NULL; return -1; }
|
||||
@ -154,36 +155,41 @@ static inline int get_device_and_partition(const char *ifname,
|
||||
|
||||
#ifdef CONFIG_MAC_PARTITION
|
||||
/* disk/part_mac.c */
|
||||
int get_partition_info_mac (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
|
||||
void print_part_mac (block_dev_desc_t *dev_desc);
|
||||
int test_part_mac (block_dev_desc_t *dev_desc);
|
||||
int get_partition_info_mac(struct blk_desc *dev_desc, int part,
|
||||
disk_partition_t *info);
|
||||
void print_part_mac(struct blk_desc *dev_desc);
|
||||
int test_part_mac(struct blk_desc *dev_desc);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DOS_PARTITION
|
||||
/* disk/part_dos.c */
|
||||
int get_partition_info_dos (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
|
||||
void print_part_dos (block_dev_desc_t *dev_desc);
|
||||
int test_part_dos (block_dev_desc_t *dev_desc);
|
||||
int get_partition_info_dos(struct blk_desc *dev_desc, int part,
|
||||
disk_partition_t *info);
|
||||
void print_part_dos(struct blk_desc *dev_desc);
|
||||
int test_part_dos(struct blk_desc *dev_desc);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ISO_PARTITION
|
||||
/* disk/part_iso.c */
|
||||
int get_partition_info_iso (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
|
||||
void print_part_iso (block_dev_desc_t *dev_desc);
|
||||
int test_part_iso (block_dev_desc_t *dev_desc);
|
||||
int get_partition_info_iso(struct blk_desc *dev_desc, int part,
|
||||
disk_partition_t *info);
|
||||
void print_part_iso(struct blk_desc *dev_desc);
|
||||
int test_part_iso(struct blk_desc *dev_desc);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_AMIGA_PARTITION
|
||||
/* disk/part_amiga.c */
|
||||
int get_partition_info_amiga (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
|
||||
void print_part_amiga (block_dev_desc_t *dev_desc);
|
||||
int test_part_amiga (block_dev_desc_t *dev_desc);
|
||||
int get_partition_info_amiga(struct blk_desc *dev_desc, int part,
|
||||
disk_partition_t *info);
|
||||
void print_part_amiga(struct blk_desc *dev_desc);
|
||||
int test_part_amiga(struct blk_desc *dev_desc);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_EFI_PARTITION
|
||||
#include <part_efi.h>
|
||||
/* disk/part_efi.c */
|
||||
int get_partition_info_efi (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
|
||||
int get_partition_info_efi(struct blk_desc *dev_desc, int part,
|
||||
disk_partition_t *info);
|
||||
/**
|
||||
* get_partition_info_efi_by_name() - Find the specified GPT partition table entry
|
||||
*
|
||||
@ -193,10 +199,10 @@ int get_partition_info_efi (block_dev_desc_t * dev_desc, int part, disk_partitio
|
||||
*
|
||||
* @return - '0' on match, '-1' on no match, otherwise error
|
||||
*/
|
||||
int get_partition_info_efi_by_name(block_dev_desc_t *dev_desc,
|
||||
int get_partition_info_efi_by_name(struct blk_desc *dev_desc,
|
||||
const char *name, disk_partition_t *info);
|
||||
void print_part_efi (block_dev_desc_t *dev_desc);
|
||||
int test_part_efi (block_dev_desc_t *dev_desc);
|
||||
void print_part_efi(struct blk_desc *dev_desc);
|
||||
int test_part_efi(struct blk_desc *dev_desc);
|
||||
|
||||
/**
|
||||
* write_gpt_table() - Write the GUID Partition Table to disk
|
||||
@ -207,7 +213,7 @@ int test_part_efi (block_dev_desc_t *dev_desc);
|
||||
*
|
||||
* @return - zero on success, otherwise error
|
||||
*/
|
||||
int write_gpt_table(block_dev_desc_t *dev_desc,
|
||||
int write_gpt_table(struct blk_desc *dev_desc,
|
||||
gpt_header *gpt_h, gpt_entry *gpt_e);
|
||||
|
||||
/**
|
||||
@ -233,7 +239,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
|
||||
*
|
||||
* @return - error on str_guid conversion error
|
||||
*/
|
||||
int gpt_fill_header(block_dev_desc_t *dev_desc, gpt_header *gpt_h,
|
||||
int gpt_fill_header(struct blk_desc *dev_desc, gpt_header *gpt_h,
|
||||
char *str_guid, int parts_count);
|
||||
|
||||
/**
|
||||
@ -246,7 +252,7 @@ int gpt_fill_header(block_dev_desc_t *dev_desc, gpt_header *gpt_h,
|
||||
*
|
||||
* @return zero on success
|
||||
*/
|
||||
int gpt_restore(block_dev_desc_t *dev_desc, char *str_disk_guid,
|
||||
int gpt_restore(struct blk_desc *dev_desc, char *str_disk_guid,
|
||||
disk_partition_t *partitions, const int parts_count);
|
||||
|
||||
/**
|
||||
@ -257,7 +263,7 @@ int gpt_restore(block_dev_desc_t *dev_desc, char *str_disk_guid,
|
||||
*
|
||||
* @return - '0' on success, otherwise error
|
||||
*/
|
||||
int is_valid_gpt_buf(block_dev_desc_t *dev_desc, void *buf);
|
||||
int is_valid_gpt_buf(struct blk_desc *dev_desc, void *buf);
|
||||
|
||||
/**
|
||||
* write_mbr_and_gpt_partitions() - write MBR, Primary GPT and Backup GPT
|
||||
@ -267,7 +273,7 @@ int is_valid_gpt_buf(block_dev_desc_t *dev_desc, void *buf);
|
||||
*
|
||||
* @return - '0' on success, otherwise error
|
||||
*/
|
||||
int write_mbr_and_gpt_partitions(block_dev_desc_t *dev_desc, void *buf);
|
||||
int write_mbr_and_gpt_partitions(struct blk_desc *dev_desc, void *buf);
|
||||
|
||||
/**
|
||||
* gpt_verify_headers() - Function to read and CRC32 check of the GPT's header
|
||||
@ -281,7 +287,7 @@ int write_mbr_and_gpt_partitions(block_dev_desc_t *dev_desc, void *buf);
|
||||
*
|
||||
* @return - '0' on success, otherwise error
|
||||
*/
|
||||
int gpt_verify_headers(block_dev_desc_t *dev_desc, gpt_header *gpt_head,
|
||||
int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head,
|
||||
gpt_entry **gpt_pte);
|
||||
|
||||
/**
|
||||
@ -300,7 +306,7 @@ int gpt_verify_headers(block_dev_desc_t *dev_desc, gpt_header *gpt_head,
|
||||
*
|
||||
* @return - '0' on success, otherwise error
|
||||
*/
|
||||
int gpt_verify_partitions(block_dev_desc_t *dev_desc,
|
||||
int gpt_verify_partitions(struct blk_desc *dev_desc,
|
||||
disk_partition_t *partitions, int parts,
|
||||
gpt_header *gpt_head, gpt_entry **gpt_pte);
|
||||
#endif
|
||||
|
@ -63,7 +63,7 @@ typedef enum
|
||||
} reiserfs_error_t;
|
||||
|
||||
|
||||
extern void reiserfs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
|
||||
void reiserfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
|
||||
extern int reiserfs_ls (char *dirname);
|
||||
extern int reiserfs_open (char *filename);
|
||||
extern int reiserfs_read (char *buf, unsigned len);
|
||||
|
@ -8,7 +8,7 @@
|
||||
#define __SANDBOX_BLOCK_DEV__
|
||||
|
||||
struct host_block_dev {
|
||||
block_dev_desc_t blk_dev;
|
||||
struct blk_desc blk_dev;
|
||||
char *filename;
|
||||
int fd;
|
||||
};
|
||||
|
@ -18,7 +18,7 @@
|
||||
#ifndef __SANDBOX_FS__
|
||||
#define __SANDBOX_FS__
|
||||
|
||||
int sandbox_fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
|
||||
int sandbox_fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
|
||||
|
||||
int sandbox_fs_read_at(const char *filename, loff_t pos, void *buffer,
|
||||
loff_t maxsize, loff_t *actread);
|
||||
|
@ -14,6 +14,6 @@ int sata_stop(void);
|
||||
int __sata_stop(void);
|
||||
int sata_port_status(int dev, int port);
|
||||
|
||||
extern block_dev_desc_t sata_dev_desc[];
|
||||
extern struct blk_desc sata_dev_desc[];
|
||||
|
||||
#endif
|
||||
|
@ -72,14 +72,16 @@ int spl_usb_load_image(void);
|
||||
int spl_sata_load_image(void);
|
||||
|
||||
/* SPL FAT image functions */
|
||||
int spl_load_image_fat(block_dev_desc_t *block_dev, int partition, const char *filename);
|
||||
int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition);
|
||||
int spl_load_image_fat(struct blk_desc *block_dev, int partition,
|
||||
const char *filename);
|
||||
int spl_load_image_fat_os(struct blk_desc *block_dev, int partition);
|
||||
|
||||
void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image);
|
||||
|
||||
/* SPL EXT image functions */
|
||||
int spl_load_image_ext(block_dev_desc_t *block_dev, int partition, const char *filename);
|
||||
int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition);
|
||||
int spl_load_image_ext(struct blk_desc *block_dev, int partition,
|
||||
const char *filename);
|
||||
int spl_load_image_ext_os(struct blk_desc *block_dev, int partition);
|
||||
|
||||
/**
|
||||
* spl_init() - Set up device tree and driver model in SPL if enabled
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
# include <part.h>
|
||||
|
||||
block_dev_desc_t * systemace_get_dev(int dev);
|
||||
struct blk_desc *systemace_get_dev(int dev);
|
||||
|
||||
#endif /* CONFIG_SYSTEMACE */
|
||||
#endif /* __SYSTEMACE_H */
|
||||
|
@ -21,7 +21,7 @@ void uboot_ubifs_umount(void);
|
||||
int ubifs_is_mounted(void);
|
||||
int ubifs_load(char *filename, u32 addr, u32 size);
|
||||
|
||||
int ubifs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
|
||||
int ubifs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
|
||||
int ubifs_ls(const char *dir_name);
|
||||
int ubifs_exists(const char *filename);
|
||||
int ubifs_size(const char *filename, loff_t *size);
|
||||
|
@ -228,7 +228,7 @@ int board_usb_cleanup(int index, enum usb_init_type init);
|
||||
#ifdef CONFIG_USB_STORAGE
|
||||
|
||||
#define USB_MAX_STOR_DEV 7
|
||||
block_dev_desc_t *usb_stor_get_dev(int index);
|
||||
struct blk_desc *usb_stor_get_dev(int index);
|
||||
int usb_stor_scan(int mode);
|
||||
int usb_stor_info(void);
|
||||
|
||||
|
@ -23,7 +23,7 @@ struct ums {
|
||||
unsigned int start_sector;
|
||||
unsigned int num_sectors;
|
||||
const char *name;
|
||||
block_dev_desc_t block_dev;
|
||||
struct blk_desc block_dev;
|
||||
};
|
||||
|
||||
int fsg_init(struct ums *ums_devs, int count);
|
||||
|
@ -63,7 +63,7 @@ enum zfs_errors {
|
||||
struct zfs_filesystem {
|
||||
|
||||
/* Block Device Descriptor */
|
||||
block_dev_desc_t *dev_desc;
|
||||
struct blk_desc *dev_desc;
|
||||
};
|
||||
|
||||
struct device_s {
|
||||
@ -98,7 +98,7 @@ int zfs_close(zfs_file_t);
|
||||
int zfs_ls(device_t dev, const char *path,
|
||||
int (*hook) (const char *, const struct zfs_dirhook_info *));
|
||||
int zfs_devread(int sector, int byte_offset, int byte_len, char *buf);
|
||||
void zfs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
|
||||
void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
|
||||
void zfs_unmount(struct zfs_data *data);
|
||||
int lzjb_decompress(void *, void *, uint32_t, uint32_t);
|
||||
#endif
|
||||
|
@ -105,7 +105,7 @@ void gzwrite_progress_finish(int returnval,
|
||||
}
|
||||
|
||||
int gzwrite(unsigned char *src, int len,
|
||||
struct block_dev_desc *dev,
|
||||
struct blk_desc *dev,
|
||||
unsigned long szwritebuf,
|
||||
u64 startoffs,
|
||||
u64 szexpected)
|
||||
|
@ -39,7 +39,7 @@ DM_TEST(dm_test_usb_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
||||
static int dm_test_usb_flash(struct unit_test_state *uts)
|
||||
{
|
||||
struct udevice *dev;
|
||||
block_dev_desc_t *dev_desc;
|
||||
struct blk_desc *dev_desc;
|
||||
char cmp[1024];
|
||||
|
||||
state_set_skip_delays(true);
|
||||
|
Loading…
Reference in New Issue
Block a user