Commit 4101f687 authored by Simon Glass's avatar Simon Glass

dm: Drop the block_dev_desc_t typedef

Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long
and causes 80-column violations, rename it to struct blk_desc.
Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
Tested-by: default avatarStephen Warren <swarren@nvidia.com>
parent b391d743
...@@ -189,7 +189,7 @@ static int API_get_timer(va_list ap) ...@@ -189,7 +189,7 @@ static int API_get_timer(va_list ap)
* *
* - net: &eth_device struct address from list pointed to by eth_devices * - 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 * &scsi_dev_desc[n] and similar tables
* *
****************************************************************************/ ****************************************************************************/
......
...@@ -103,7 +103,7 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di) ...@@ -103,7 +103,7 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
int i; int i;
block_dev_desc_t *dd; struct blk_desc *dd;
if (first) { if (first) {
di->cookie = (void *)get_dev(specs[type].name, 0); 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) ...@@ -148,7 +148,7 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
di->type = specs[type].type; di->type = specs[type].type;
if (di->cookie != NULL) { if (di->cookie != NULL) {
dd = (block_dev_desc_t *)di->cookie; dd = (struct blk_desc *)di->cookie;
if (dd->type == DEV_TYPE_UNKNOWN) { if (dd->type == DEV_TYPE_UNKNOWN) {
debugf("device instance exists, but is not active.."); debugf("device instance exists, but is not active..");
found = 0; found = 0;
...@@ -166,9 +166,9 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di) ...@@ -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; int i, j;
...@@ -308,7 +308,7 @@ int dev_enum_storage(struct device_info *di) ...@@ -308,7 +308,7 @@ int dev_enum_storage(struct device_info *di)
return 0; 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; int i;
...@@ -328,7 +328,7 @@ int dev_open_stor(void *cookie) ...@@ -328,7 +328,7 @@ int dev_open_stor(void *cookie)
if (type == ENUM_MAX) if (type == ENUM_MAX)
return API_ENODEV; 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 0;
return API_ENODEV; return API_ENODEV;
...@@ -348,7 +348,7 @@ int dev_close_stor(void *cookie) ...@@ -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) lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start)
{ {
int type; 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) if ((type = dev_stor_type(dd)) == ENUM_MAX)
return 0; return 0;
......
...@@ -81,7 +81,7 @@ static int load_rescue_image(ulong addr) ...@@ -81,7 +81,7 @@ static int load_rescue_image(ulong addr)
char dev[7]; char dev[7];
char addr_str[16]; char addr_str[16];
char * const argv[6] = { "fatload", "usb", dev, addr_str, nxri, NULL }; 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; cmd_tbl_t *bcmd;
/* Get name of firmware directory */ /* Get name of firmware directory */
......
...@@ -217,8 +217,8 @@ Added files: ...@@ -217,8 +217,8 @@ Added files:
Block device changes: Block device changes:
--------------------- ---------------------
To allow the use of dos_part.c, mac_part.c and iso_part.c, the parameter 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 blk_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 device descriptor (blk_desc) contains a pointer to the read routine of the
device, which will be used to read blocks from the device. 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 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. it for IDE ATAPI and SCSI devices.
......
...@@ -20,7 +20,7 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc, ...@@ -20,7 +20,7 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
#if defined(CONFIG_IMAGE_FORMAT_LEGACY) #if defined(CONFIG_IMAGE_FORMAT_LEGACY)
image_header_t *hdr; image_header_t *hdr;
#endif #endif
block_dev_desc_t *dev_desc; struct blk_desc *dev_desc;
#if defined(CONFIG_FIT) #if defined(CONFIG_FIT)
const void *fit_hdr = NULL; const void *fit_hdr = NULL;
......
...@@ -69,7 +69,7 @@ static int do_fat_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, ...@@ -69,7 +69,7 @@ static int do_fat_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[]) char * const argv[])
{ {
int dev, part; int dev, part;
block_dev_desc_t *dev_desc; struct blk_desc *dev_desc;
disk_partition_t info; disk_partition_t info;
if (argc < 2) { if (argc < 2) {
...@@ -105,7 +105,7 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag, ...@@ -105,7 +105,7 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag,
int ret; int ret;
unsigned long addr; unsigned long addr;
unsigned long count; unsigned long count;
block_dev_desc_t *dev_desc = NULL; struct blk_desc *dev_desc = NULL;
disk_partition_t info; disk_partition_t info;
int dev = 0; int dev = 0;
int part = 1; int part = 1;
......
...@@ -168,7 +168,7 @@ static bool found_key(const char *str, const char *key) ...@@ -168,7 +168,7 @@ static bool found_key(const char *str, const char *key)
* @return - zero on success, otherwise error * @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, const char *str_part,
char **str_disk_guid, char **str_disk_guid,
disk_partition_t **partitions, disk_partition_t **partitions,
...@@ -328,7 +328,7 @@ err: ...@@ -328,7 +328,7 @@ err:
return errno; 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; int ret;
char *str_disk_guid; char *str_disk_guid;
...@@ -356,7 +356,7 @@ static int gpt_default(block_dev_desc_t *blk_dev_desc, const char *str_part) ...@@ -356,7 +356,7 @@ static int gpt_default(block_dev_desc_t *blk_dev_desc, const char *str_part)
return ret; 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, ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1,
blk_dev_desc->blksz); blk_dev_desc->blksz);
...@@ -408,7 +408,7 @@ static int do_gpt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ...@@ -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 ret = CMD_RET_SUCCESS;
int dev = 0; int dev = 0;
char *ep; char *ep;
block_dev_desc_t *blk_dev_desc = NULL; struct blk_desc *blk_dev_desc = NULL;
if (argc < 4 || argc > 5) if (argc < 4 || argc > 5)
return CMD_RET_USAGE; return CMD_RET_USAGE;
......
...@@ -67,7 +67,7 @@ static int do_host_info(cmd_tbl_t *cmdtp, int flag, int argc, ...@@ -67,7 +67,7 @@ static int do_host_info(cmd_tbl_t *cmdtp, int flag, int argc,
int dev; int dev;
printf("%3s %12s %s\n", "dev", "blocks", "path"); printf("%3s %12s %s\n", "dev", "blocks", "path");
for (dev = min_dev; dev <= max_dev; dev++) { for (dev = min_dev; dev <= max_dev; dev++) {
block_dev_desc_t *blk_dev; struct blk_desc *blk_dev;
int ret; int ret;
printf("%3d ", dev); printf("%3d ", dev);
...@@ -92,7 +92,7 @@ static int do_host_dev(cmd_tbl_t *cmdtp, int flag, int argc, ...@@ -92,7 +92,7 @@ static int do_host_dev(cmd_tbl_t *cmdtp, int flag, int argc,
{ {
int dev; int dev;
char *ep; char *ep;
block_dev_desc_t *blk_dev; struct blk_desc *blk_dev;
int ret; int ret;
if (argc < 1 || argc > 3) if (argc < 1 || argc > 3)
......
...@@ -53,7 +53,7 @@ ulong ide_bus_offset[CONFIG_SYS_IDE_MAXBUS] = { ...@@ -53,7 +53,7 @@ ulong ide_bus_offset[CONFIG_SYS_IDE_MAXBUS] = {
static int ide_bus_ok[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 #ifdef CONFIG_IDE_RESET
...@@ -62,7 +62,7 @@ static void ide_reset (void); ...@@ -62,7 +62,7 @@ static void ide_reset (void);
#define ide_reset() /* dummy */ #define ide_reset() /* dummy */
#endif #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); static uchar ide_wait (int dev, ulong t);
#define IDE_TIME_OUT 2000 /* 2 sec timeout */ #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 ...@@ -78,8 +78,8 @@ static void ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len
#endif #endif
#ifdef CONFIG_ATAPI #ifdef CONFIG_ATAPI
static void atapi_inquiry(block_dev_desc_t *dev_desc); static void atapi_inquiry(struct blk_desc *dev_desc);
static ulong atapi_read(block_dev_desc_t *block_dev, lbaint_t blknr, static ulong atapi_read(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, void *buffer); lbaint_t blkcnt, void *buffer);
#endif #endif
...@@ -187,7 +187,7 @@ int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) ...@@ -187,7 +187,7 @@ int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
if (strcmp(argv[1], "read") == 0) { if (strcmp(argv[1], "read") == 0) {
ulong addr = simple_strtoul(argv[2], NULL, 16); ulong addr = simple_strtoul(argv[2], NULL, 16);
ulong cnt = simple_strtoul(argv[4], NULL, 16); ulong cnt = simple_strtoul(argv[4], NULL, 16);
block_dev_desc_t *dev_desc; struct blk_desc *dev_desc;
ulong n; ulong n;
#ifdef CONFIG_SYS_64BIT_LBA #ifdef CONFIG_SYS_64BIT_LBA
...@@ -446,7 +446,7 @@ void ide_init(void) ...@@ -446,7 +446,7 @@ void ide_init(void)
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
#ifdef CONFIG_PARTITIONS #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; 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) ...@@ -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; unsigned char c;
hd_driveid_t iop; hd_driveid_t iop;
...@@ -713,7 +713,7 @@ static void ide_ident(block_dev_desc_t *dev_desc) ...@@ -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) void *buffer)
{ {
int device = block_dev->dev; int device = block_dev->dev;
...@@ -839,7 +839,7 @@ IDE_READ_E: ...@@ -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) const void *buffer)
{ {
int device = block_dev->dev; int device = block_dev->dev;
...@@ -1301,7 +1301,7 @@ error: ...@@ -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 ccb[12]; /* Command descriptor block */
unsigned char iobuf[64]; /* temp buf */ unsigned char iobuf[64]; /* temp buf */
...@@ -1394,7 +1394,7 @@ static void atapi_inquiry(block_dev_desc_t *dev_desc) ...@@ -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_BLOCK_SIZE 2048 /* assuming CD part */
#define ATAPI_READ_MAX_BLOCK (ATAPI_READ_MAX_BYTES/ATAPI_READ_BLOCK_SIZE) #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) void *buffer)
{ {
int device = block_dev->dev; int device = block_dev->dev;
......
...@@ -424,7 +424,7 @@ static int do_mmc_rescan(cmd_tbl_t *cmdtp, int flag, ...@@ -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, static int do_mmc_part(cmd_tbl_t *cmdtp, int flag,
int argc, char * const argv[]) int argc, char * const argv[])
{ {
block_dev_desc_t *mmc_dev; struct blk_desc *mmc_dev;
struct mmc *mmc; struct mmc *mmc;
mmc = init_mmc_device(curr_device, false); mmc = init_mmc_device(curr_device, false);
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
static int do_part_uuid(int argc, char * const argv[]) static int do_part_uuid(int argc, char * const argv[])
{ {
int part; int part;
block_dev_desc_t *dev_desc; struct blk_desc *dev_desc;
disk_partition_t info; disk_partition_t info;
if (argc < 2) if (argc < 2)
...@@ -52,7 +52,7 @@ static int do_part_uuid(int argc, char * const argv[]) ...@@ -52,7 +52,7 @@ static int do_part_uuid(int argc, char * const argv[])
static int do_part_list(int argc, char * const argv[]) static int do_part_list(int argc, char * const argv[])
{ {
int ret; int ret;
block_dev_desc_t *desc; struct blk_desc *desc;
char *var = NULL; char *var = NULL;
bool bootable = false; bool bootable = false;
int i; int i;
...@@ -114,7 +114,7 @@ static int do_part_list(int argc, char * const argv[]) ...@@ -114,7 +114,7 @@ static int do_part_list(int argc, char * const argv[])
static int do_part_start(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; disk_partition_t info;
char buf[512] = { 0 }; char buf[512] = { 0 };
int part; int part;
...@@ -148,7 +148,7 @@ static int do_part_start(int argc, char * const argv[]) ...@@ -148,7 +148,7 @@ static int do_part_start(int argc, char * const argv[])
static int do_part_size(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; disk_partition_t info;
char buf[512] = { 0 }; char buf[512] = { 0 };
int part; int part;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{ {
char *ep; char *ep;
block_dev_desc_t *dev_desc = NULL; struct blk_desc *dev_desc = NULL;
int dev; int dev;
int part = 0; int part = 0;
disk_partition_t part_info; disk_partition_t part_info;
...@@ -57,7 +57,7 @@ int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ...@@ -57,7 +57,7 @@ int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
offset = part_info.start; offset = part_info.start;
limit = part_info.size; limit = part_info.size;
} else { } else {
/* Largest address not available in block_dev_desc_t. */ /* Largest address not available in struct blk_desc. */
limit = ~0; limit = ~0;
} }
......
...@@ -34,7 +34,7 @@ int do_reiserls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ...@@ -34,7 +34,7 @@ int do_reiserls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{ {
char *filename = "/"; char *filename = "/";
int dev, part; int dev, part;
block_dev_desc_t *dev_desc=NULL; struct blk_desc *dev_desc = NULL;
disk_partition_t info; disk_partition_t info;
if (argc < 3) if (argc < 3)
...@@ -82,7 +82,7 @@ int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ...@@ -82,7 +82,7 @@ int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int dev, part; int dev, part;
ulong addr = 0, filelen; ulong addr = 0, filelen;
disk_partition_t info; disk_partition_t info;
block_dev_desc_t *dev_desc = NULL; struct blk_desc *dev_desc = NULL;
unsigned long count; unsigned long count;
char *addr_str; char *addr_str;
......
...@@ -16,15 +16,15 @@ ...@@ -16,15 +16,15 @@
#include <sata.h> #include <sata.h>
static int sata_curr_device = -1; 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) lbaint_t blkcnt, void *dst)
{ {
return sata_read(block_dev->dev, start, blkcnt, 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) lbaint_t blkcnt, const void *buffer)
{ {
return sata_write(block_dev->dev, start, blkcnt, buffer); return sata_write(block_dev->dev, start, blkcnt, buffer);
...@@ -36,7 +36,7 @@ int __sata_initialize(void) ...@@ -36,7 +36,7 @@ int __sata_initialize(void)
int i; int i;
for (i = 0; i < CONFIG_SYS_SATA_MAX_DEVICE; 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].if_type = IF_TYPE_SATA;
sata_dev_desc[i].dev = i; sata_dev_desc[i].dev = i;
sata_dev_desc[i].part_type = PART_TYPE_UNKNOWN; sata_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
...@@ -75,7 +75,7 @@ __weak int __sata_stop(void) ...@@ -75,7 +75,7 @@ __weak int __sata_stop(void)
int sata_stop(void) __attribute__((weak, alias("__sata_stop"))); int sata_stop(void) __attribute__((weak, alias("__sata_stop")));
#ifdef CONFIG_PARTITIONS #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; return (dev < CONFIG_SYS_SATA_MAX_DEVICE) ? &sata_dev_desc[dev] : NULL;
} }
......
...@@ -48,7 +48,7 @@ static int scsi_max_devs; /* number of highest available scsi device */ ...@@ -48,7 +48,7 @@ static int scsi_max_devs; /* number of highest available scsi device */
static int scsi_curr_dev; /* current 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 * forward declerations of some Setup Routines
...@@ -66,9 +66,9 @@ void scsi_ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len); ...@@ -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, static int scsi_read_capacity(ccb *pccb, lbaint_t *capacity,
unsigned long *blksz); 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); 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); lbaint_t blkcnt, const void *buffer);
...@@ -239,7 +239,7 @@ void scsi_init(void) ...@@ -239,7 +239,7 @@ void scsi_init(void)
#endif #endif
#ifdef CONFIG_PARTITIONS #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; 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[]) ...@@ -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_MAX_READ_BLK 0xFFFF
#define SCSI_LBA48_READ 0xFFFFFFF #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) lbaint_t blkcnt, void *buffer)
{ {
int device = block_dev->dev; int device = block_dev->dev;
...@@ -443,7 +443,7 @@ static ulong scsi_read(block_dev_desc_t *block_dev, lbaint_t blknr, ...@@ -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.. */ /* Almost the maximum amount of the scsi_ext command.. */
#define SCSI_MAX_WRITE_BLK 0xFFFF #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) lbaint_t blkcnt, const void *buffer)
{ {
int device = block_dev->dev; int device = block_dev->dev;
......
...@@ -43,7 +43,7 @@ U_BOOT_CMD( ...@@ -43,7 +43,7 @@ U_BOOT_CMD(
static int do_gzwrite(cmd_tbl_t *cmdtp, int flag, static int do_gzwrite(cmd_tbl_t *cmdtp, int flag,
int argc, char * const argv[]) int argc, char * const argv[])
{ {
block_dev_desc_t *bdev; struct blk_desc *bdev;
int ret; int ret;
unsigned char *addr; unsigned char *addr;
unsigned long length; unsigned long length;
......
...@@ -625,7 +625,7 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ...@@ -625,7 +625,7 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int i; int i;
extern char usb_started; extern char usb_started;
#ifdef CONFIG_USB_STORAGE #ifdef CONFIG_USB_STORAGE
block_dev_desc_t *stor_dev; struct blk_desc *stor_dev;
#endif #endif
if (argc < 2) if (argc < 2)
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
static int ums_read_sector(struct ums *ums_dev, static int ums_read_sector(struct ums *ums_dev,
ulong start, lbaint_t blkcnt, void *buf) 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; lbaint_t blkstart = start + ums_dev->start_sector;
return block_dev->block_read(block_dev, blkstart, blkcnt, buf); return block_dev->block_read(block_dev, blkstart, blkcnt, buf);
...@@ -28,7 +28,7 @@ static int ums_read_sector(struct ums *ums_dev, ...@@ -28,7 +28,7 @@ static int ums_read_sector(struct ums *ums_dev,
static int ums_write_sector(struct ums *ums_dev, static int ums_write_sector(struct ums *ums_dev,
ulong start, lbaint_t blkcnt, const void *buf) 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; lbaint_t blkstart = start + ums_dev->start_sector;
return block_dev->block_write(block_dev, blkstart, blkcnt, buf); return block_dev->block_write(block_dev, blkstart, blkcnt, buf);
...@@ -53,7 +53,7 @@ static void ums_fini(void) ...@@ -53,7 +53,7 @@ static void ums_fini(void)
static int ums_init(const char *devtype, const char *devnums) static int ums_init(const char *devtype, const char *devnums)
{ {
char *s, *t, *devnum, *name; char *s, *t, *devnum, *name;
block_dev_desc_t *block_dev; struct blk_desc *block_dev;
int ret; int ret;
struct ums *ums_new; struct ums *ums_new;
......
...@@ -39,7 +39,7 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] ...@@ -39,7 +39,7 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
int part; int part;
ulong addr = 0; ulong addr = 0;
disk_partition_t info; disk_partition_t info;
block_dev_desc_t *dev_desc; struct blk_desc *dev_desc;
char buf[12]; char buf[12];
unsigned long count; unsigned long count;
const char *addr_str; const char *addr_str;
...@@ -135,7 +135,7 @@ static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ...@@ -135,7 +135,7 @@ static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{ {
const char *filename = "/"; const char *filename = "/";
int part; int part;
block_dev_desc_t *dev_desc; struct blk_desc *dev_desc;
disk_partition_t info; disk_partition_t info;
struct device_s vdev;