]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: Drop the block_dev_desc_t typedef
authorSimon Glass <sjg@chromium.org>
Mon, 29 Feb 2016 22:25:34 +0000 (15:25 -0700)
committerSimon Glass <sjg@chromium.org>
Mon, 14 Mar 2016 21:34:50 +0000 (15:34 -0600)
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>
66 files changed:
api/api.c
api/api_storage.c
board/cm5200/fwupdate.c
board/mpl/pip405/README
cmd/disk.c
cmd/fat.c
cmd/gpt.c
cmd/host.c
cmd/ide.c
cmd/mmc.c
cmd/part.c
cmd/read.c
cmd/reiser.c
cmd/sata.c
cmd/scsi.c
cmd/unzip.c
cmd/usb.c
cmd/usb_mass_storage.c
cmd/zfs.c
common/env_fat.c
common/fb_mmc.c
common/spl/spl_ext.c
common/spl/spl_fat.c
common/spl/spl_sata.c
common/spl/spl_usb.c
common/usb_storage.c
disk/part.c
disk/part_amiga.c
disk/part_dos.c
disk/part_efi.c
disk/part_iso.c
disk/part_mac.c
drivers/block/dwc_ahsata.c
drivers/block/sandbox.c
drivers/block/systemace.c
drivers/dfu/dfu_mmc.c
drivers/mmc/mmc.c
drivers/mmc/mmc_private.h
drivers/mmc/mmc_write.c
fs/ext4/dev.c
fs/ext4/ext4fs.c
fs/fat/fat.c
fs/fs.c
fs/reiserfs/dev.c
fs/sandbox/sandboxfs.c
fs/ubifs/ubifs.c
fs/zfs/dev.c
fs/zfs/zfs.c
include/common.h
include/ext4fs.h
include/fat.h
include/ide.h
include/mmc.h
include/part.h
include/reiserfs.h
include/sandboxblockdev.h
include/sandboxfs.h
include/sata.h
include/spl.h
include/systemace.h
include/ubifs_uboot.h
include/usb.h
include/usb_mass_storage.h
include/zfs_common.h
lib/gunzip.c
test/dm/usb.c

index 6b114f077f649c27ddd066383ee5fd6a94dd148d..457dc36f6fc4e76a9ff5356414e9c0ba67fe7466 100644 (file)
--- a/api/api.c
+++ b/api/api.c
@@ -189,7 +189,7 @@ static int API_get_timer(va_list ap)
  *
  *   - net: &eth_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
  *
  ****************************************************************************/
index bc2b4d6b8cc76de796d98ecb69e1f581212df6b9..225a6cf10fc1723768f83274251e1dd362efb20d 100644 (file)
@@ -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;
index 2b923624aea11f4adfe5fb57c0ce1b9f0a1fddfc..d5064c118533d045c8a6cfd2c7e4c2c9a93013f2 100644 (file)
@@ -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 */
index 1b73dbe5edd1303e074e54b581c38a3a11a253ad..e900c56f1591fdebd4b2d94816949c98c39d5b54 100644 (file)
@@ -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.
index 3025225c764264a899d2ecd40e4081ccbc713228..c53c2a2dbfeac9aad6509e77452bb3a91bef9cc1 100644 (file)
@@ -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;
index aae993d2b9a486c7ca1bdc16c10f7c84e9c817b9..82b9b38c2c56f9bd3b4e49010f24c9b968b65eb4 100644 (file)
--- a/cmd/fat.c
+++ b/cmd/fat.c
@@ -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;
index d94d5530bc6fab6194a92cdd4b089dbbcf1f24af..881367c095a86e2e0528f957720ac390190b1e8f 100644 (file)
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -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;
index ba1460ea1c35c29a064d1a63c6c5868e5cfe555d..ee219ce914506857662e7459d0f35b6769f39d29 100644 (file)
@@ -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)
index f19a7ce42a728895ecb3582bd35d7487c2ef559e..06202c5fc6e6884a0eca71e8d34cf9bcfea0feb5 100644 (file)
--- a/cmd/ide.c
+++ b/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;
index 1c7156f19c5939867c30d52fdba0ffdcf3583c55..ab59e7fadf729949c7169273e1352542a2e93c6c 100644 (file)
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -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);
index 55995097eb00c8d1a12f03a621d2d29082b58b37..a572aabe1de149d84eb6b2f1ab6a70b595e1e108 100644 (file)
@@ -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;
index 8710288781747d9f0bc32a4d2ac18a9e61b893e4..6a1e1d9e2dd76aa857b3bd98243950c3a577f20c 100644 (file)
@@ -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;
        }
 
index 887156486a136af8235e8d25b54f582c0ecd7ca4..1cca5eb6581bcc830f20fa06f7f047aa565525ef 100644 (file)
@@ -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;
 
index 76baceae8c939eff77fcd45d46c820f3feb8a5d5..a1faf2d67301cab7bc21b1c805e9cae50a8fb7f2 100644 (file)
 #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;
 }
index bc7d1b6c53007801eb24e298629040aa6c7ed2c5..dff811bb9617ac5f730c0e879098427ff7d05e81 100644 (file)
@@ -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;
index 0686be68ce0a857ead08ff840a23c444284f30fb..5be156644cb62db3cb72bb7fe4c14561d75dc6f7 100644 (file)
@@ -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;
index c7b642c40af969885d0d782bcf010740e613f16f..5f3b06a6c6bcbab3cefeed69701242d92223b07e 100644 (file)
--- a/cmd/usb.c
+++ b/cmd/usb.c
@@ -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)
index 041559172d9560407df9249ef5de3d57ff1125e1..03b7e216916fb6347099bce444394c7523f1312f 100644 (file)
@@ -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;
 
index 0aed29e9b2c8989d86c3ff14fad67feca692b1f8..9076a8a6bbd81f592fa7ab5ad8b11bba164c2a37 100644 (file)
--- a/cmd/zfs.c
+++ b/cmd/zfs.c
@@ -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;
 
index d79d864a0c1216ee0e66a216b94d80a59e62de28..e88279eb705b79f6cd1fddcde409a5727d909ee5 100644 (file)
@@ -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;
index 6e742dac56f7884ebd866ab35730412b4e255b15..fd4308530fbda9bfac5d4228ee500eae4d1e839f 100644 (file)
 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);
index a42fbd009b5125428b927eeccf97bf52b20d4deb..d29d2293c2c1b7c0a8d3a0bcedd09ed8cbe950ee 100644 (file)
@@ -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;
 }
index 0daadbedae7a01971a7a93ad762db538d5d140d6..d761b264c139aba5c0229af4d02139e6626660eb 100644 (file)
@@ -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;
 }
index 3ba4c249b7dbea18c4a4f417fb65fa53c8e24c53..1719946ec5f0d7fbc0a7e2ec2d753ed0b0a640a6 100644 (file)
@@ -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) {
index 588b85c4a5638fdb0853d00bd986c8c21948f1d6..c42848e6fc84800bc2a5f49e3380af37b16a924f 100644 (file)
@@ -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();
index 8737cf7ceaabbb673b094ff8237e4c9c3fb9d78b..ca5aeea5e397b482618e9b5dcc1d21cb3d76aa03 100644 (file)
@@ -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);
index 1935b28841011268cf6451594120a6e126f09d16..7f98d89115c2cebcad4e5eff4482c2e0a893c3e2 100644 (file)
@@ -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;
index 57c1b9d055f0d1d1ca255bc7e9f4dfd1a4542b29..008941c53282ee4a6d99f1b8c8283293269b7e1d 100644 (file)
@@ -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;
index 08872d6a03f4f43454f35a2bb0e8a75defc6159c..ea0315ca07d902ef0263163b4c30be62939eb1bd 100644 (file)
@@ -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);
 }
index e1b58c54b45b9c03e515a0b0ddca18f9825308c5..db5e7ed0695cdb5722900c747d483fbea5e7975a 100644 (file)
@@ -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;
index 5f4bb182dd28a5f5f94db1b353514ef509f3c36a..2984df510ccdce7e5c9e36ae87c53a2d831d1e7f 100644 (file)
@@ -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;
 
index f3bc8dd55535b843850df201c534456a396a99a8..ae83495f311c587ab2f52f95745c1f29d4fa88ee 100644 (file)
@@ -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);
index bc072f335f63529f23987a1bb2b608ed7a3d01d3..6ec52a9114b468ced0fffc0f70b7aea2bf29f9b5 100644 (file)
@@ -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,
index 170f0fa5bf20bf3394c08c19f89eb75b4a5fc415..dd21400cd44c1855b6f561d150e3597acf1553d4 100644 (file)
@@ -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;
index b974e80167e961dbf6934cdcd74c6a3588dd77c1..ea18c0d7353f6d0b7a5d0762d18a97cbddfa38e4 100644 (file)
@@ -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)
 {
index 395d472e0bd995e7a7e863f786ae0c7fdfa1ca24..bfac91a5613567f72fef71a4b9936c5135ef172a 100644 (file)
@@ -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;
 
index ede5d6eeec73e6fa2a6b6f38a8cd150a58d400e7..b19b328465cb9d11b776af9ee9be623f7e07cbc8 100644 (file)
@@ -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))
index 6a7063976ceaa01fe32418f50a60861a29b2d52d..d3f6bfe123cdde8930ad0b40e5307efd83274dab 100644 (file)
@@ -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;
index 79b8c4d808fb32c79605dc046417135aed1def9c..54e60dbe9c4c21339b92d840bc133f3a69be20a7 100644 (file)
@@ -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;
index 9fd10de0776b82028c8ccdc547a03e6188eb5812..3eef66f84781a303b9277a88082da8a089f323e8 100644 (file)
 
 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;
                }
index 258b93791b642e66a791467898e83f12b7a8c832..43c8897793f2869aaf2030e8a266f3847a474974 100644 (file)
@@ -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);
index 472a63e8bb0af7fb47f9467b40a781d1744a1ecd..2cef3bd22d4751a8261bd14c8b4b419f3c6a613f 100644 (file)
@@ -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;
 
diff --git a/fs/fs.c b/fs/fs.c
index d123d29a0808fe6e14b4f19214d69290aeb13471..8515beabf51bc712b6d2fe56ba2e41b5e4b9afc5 100644 (file)
--- a/fs/fs.c
+++ b/fs/fs.c
 
 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);
index 7b24d6aa715c275b107b2c54eb5318fcd45aa517..5a1ab0a3648a12099283baf9a9e6c92b1416c114 100644 (file)
 
 #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;
                }
index 5acfc03704a9b35d9f823637ffac86e06f051208..2703eed2088b44164d03c6ab5e4d6904c226e28a 100644 (file)
@@ -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;
index a992a00c8f272727d6058b2e8079830d9d7c73b7..168ae2b697b0d8ee6277a53dfd9cc1bc3512ae0f 100644 (file)
@@ -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");
index 67d12652b01e27a5f94b3fc4f62a079baf0e61c1..2f409e66cddf0f6f5748144a962c1fd335c9f154 100644 (file)
 #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;
                }
index fb2b3ee089ecadb8c82cb35bc7912ffce9cbf65d..ca67afbb2ee4a5b26febb4b3dce3511f9cab2afc 100644 (file)
@@ -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:
index 1563d649f01cd869c35fef7f2c2a160f42ee969c..1317f9b9e78e1b42c9780421a48d18d4ad27bceb 100644 (file)
@@ -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);
index 6888adc56f406d1c40049e240f8dc727e4e97009..cc765ae468afdc40359a5df2c6ecca08e3d944e8 100644 (file)
@@ -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);
index 3038bd7e4f6e7133af0c5149395438a810dc719a..9d053e6fa67e31c8c6f10276508c1d6f4e37b1ab 100644 (file)
@@ -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);
index f9357bee76220d9066ace1f697040e43da810e51..24073938507179fb75224f5281a1a8d97721af9e 100644 (file)
@@ -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
index d652c1484efdd7892df02cd37ac36ed7eada7c8e..cdb56e7ac14eaaeef3d952876756beb6359ad0bb 100644 (file)
@@ -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 */
index dc23949ae8c079ddf05f9e50b6ab51f5bcd7b52a..d1e9d0fcf9aa3e2d52e19565ca693db8579ccbd8 100644 (file)
@@ -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
index 2d14d48fe03bc00929279363e7d0b9e01a1b8236..ffe4e466d9be66c966f3af03c492ae0d3737a32b 100644 (file)
@@ -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);
index 627787aa326280a6afe3eefc88fad344338e8d83..59f951934660c83434ed7af65110cf7f7ef0efdc 100644 (file)
@@ -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;
 };
index 4c7745de91002d503640631f234d470c00ada0ee..6e6e3c62ff9612c2e1458ad52bc58b5f8ac4b1d6 100644 (file)
@@ -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);
index fa61da8ddd0431e7e34c12682a27bb7fc3a585ef..b35359aa5a1986a412c7cfb3d77461b3b6cbb30a 100644 (file)
@@ -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
index 92cdc049d45382f11fe5cd1539f57c8f7e445bf3..c62887af0eddf29b9c4f17fdd93eef327f59c4f9 100644 (file)
@@ -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
index 3f342d565c5671582d5b32d410c8849bf2410885..3b6ec7da4b41e981022ecd2d731f44bb3504fd74 100644 (file)
@@ -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 */
index dab433a39fdd2e539cd2c4465a7523ec944d3c89..d86da277b042a79d035e0663be874400a705eca9 100644 (file)
@@ -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);
index 0b410b6cd10b6cece52ba0748be4ff83b768f573..c2fa6849f10dddaf9d50a4542f66df41ee8fcd65 100644 (file)
@@ -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);
 
index 5804b70c354d571c3c3bce8fdbd8f560ea088b8e..8229f62b97fcfc594922eafcac6977e2ce88d303 100644 (file)
@@ -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);
index 3bd575ef5f956efa5274d09911f7978ba6b26d22..bca3dff06e1a83e9ada821a8564e18e7d69c8502 100644 (file)
@@ -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
index da0c76c500d1cf2db8362ebc753defb61f1474ea..6d65ccccffa018582ed33497f5ae9361c6252f23 100644 (file)
@@ -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)
index 3a2e52b2b57d32f5142f8e261d7f0df83f00bca6..25cde687f1972e959da03200ca31d52cab390121 100644 (file)
@@ -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);