summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/common.h2
-rw-r--r--include/ext4fs.h6
-rw-r--r--include/fat.h4
-rw-r--r--include/ide.h6
-rw-r--r--include/mmc.h2
-rw-r--r--include/part.h130
-rw-r--r--include/reiserfs.h2
-rw-r--r--include/sandboxblockdev.h2
-rw-r--r--include/sandboxfs.h2
-rw-r--r--include/sata.h2
-rw-r--r--include/spl.h10
-rw-r--r--include/systemace.h2
-rw-r--r--include/ubifs_uboot.h2
-rw-r--r--include/usb.h2
-rw-r--r--include/usb_mass_storage.h2
-rw-r--r--include/zfs_common.h4
16 files changed, 94 insertions, 86 deletions
diff --git a/include/common.h b/include/common.h
index 1563d649f0..1317f9b9e7 100644
--- a/include/common.h
+++ b/include/common.h
@@ -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);
diff --git a/include/ext4fs.h b/include/ext4fs.h
index 6888adc56f..cc765ae468 100644
--- a/include/ext4fs.h
+++ b/include/ext4fs.h
@@ -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);
diff --git a/include/fat.h b/include/fat.h
index 3038bd7e4f..9d053e6fa6 100644
--- a/include/fat.h
+++ b/include/fat.h
@@ -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);
diff --git a/include/ide.h b/include/ide.h
index f9357bee76..2407393850 100644
--- a/include/ide.h
+++ b/include/ide.h
@@ -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
diff --git a/include/mmc.h b/include/mmc.h
index d652c1484e..cdb56e7ac1 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -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 */
diff --git a/include/part.h b/include/part.h
index dc23949ae8..d1e9d0fcf9 100644
--- a/include/part.h
+++ b/include/part.h
@@ -10,7 +10,7 @@
#include <ide.h>
#include <common.h>
-struct block_dev_desc {
+struct blk_desc {
int if_type; /* type of the interface */
int dev; /* device number */
unsigned char part_type; /* partition type */
@@ -28,23 +28,23 @@ struct block_dev_desc {
char vendor [40+1]; /* IDE model, SCSI Vendor */
char product[20+1]; /* IDE Serial no, SCSI product */
char revision[8+1]; /* firmware revision */
- unsigned long (*block_read)(block_dev_desc_t *block_dev,
+ unsigned long (*block_read)(struct blk_desc *block_dev,
lbaint_t start,
lbaint_t blkcnt,
void *buffer);
- unsigned long (*block_write)(block_dev_desc_t *block_dev,
+ unsigned long (*block_write)(struct blk_desc *block_dev,
lbaint_t start,
lbaint_t blkcnt,
const void *buffer);
- unsigned long (*block_erase)(block_dev_desc_t *block_dev,
+ unsigned long (*block_erase)(struct blk_desc *block_dev,
lbaint_t start,
lbaint_t blkcnt);
void *priv; /* driver private struct pointer */
};
-#define BLOCK_CNT(size, block_dev_desc) (PAD_COUNT(size, block_dev_desc->blksz))
-#define PAD_TO_BLOCKSIZE(size, block_dev_desc) \
- (PAD_SIZE(size, block_dev_desc->blksz))
+#define BLOCK_CNT(size, blk_desc) (PAD_COUNT(size, blk_desc->blksz))
+#define PAD_TO_BLOCKSIZE(size, blk_desc) \
+ (PAD_SIZE(size, blk_desc->blksz))
#define LOG2(x) (((x & 0xaaaaaaaa) ? 1 : 0) + ((x & 0xcccccccc) ? 2 : 0) + \
((x & 0xf0f0f0f0) ? 4 : 0) + ((x & 0xff00ff00) ? 8 : 0) + \
((x & 0xffff0000) ? 16 : 0))
@@ -101,52 +101,53 @@ typedef struct disk_partition {
/* Misc _get_dev functions */
#ifdef CONFIG_PARTITIONS
-block_dev_desc_t *get_dev(const char *ifname, int dev);
-block_dev_desc_t* ide_get_dev(int dev);
-block_dev_desc_t* sata_get_dev(int dev);
-block_dev_desc_t* scsi_get_dev(int dev);
-block_dev_desc_t* usb_stor_get_dev(int dev);
-block_dev_desc_t* mmc_get_dev(int dev);
+struct blk_desc *get_dev(const char *ifname, int dev);
+struct blk_desc *ide_get_dev(int dev);
+struct blk_desc *sata_get_dev(int dev);
+struct blk_desc *scsi_get_dev(int dev);
+struct blk_desc *usb_stor_get_dev(int dev);
+struct blk_desc *mmc_get_dev(int dev);
int mmc_select_hwpart(int dev_num, int hwpart);
-block_dev_desc_t* systemace_get_dev(int dev);
-block_dev_desc_t* mg_disk_get_dev(int dev);
-block_dev_desc_t *host_get_dev(int dev);
-int host_get_dev_err(int dev, block_dev_desc_t **blk_devp);
+struct blk_desc *systemace_get_dev(int dev);
+struct blk_desc *mg_disk_get_dev(int dev);
+struct blk_desc *host_get_dev(int dev);
+int host_get_dev_err(int dev, struct blk_desc **blk_devp);
/* disk/part.c */
-int get_partition_info (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part (block_dev_desc_t *dev_desc);
-void init_part (block_dev_desc_t *dev_desc);
-void dev_print(block_dev_desc_t *dev_desc);
+int get_partition_info(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info);
+void print_part(struct blk_desc *dev_desc);
+void init_part(struct blk_desc *dev_desc);
+void dev_print(struct blk_desc *dev_desc);
int get_device(const char *ifname, const char *dev_str,
- block_dev_desc_t **dev_desc);
+ struct blk_desc **dev_desc);
int get_device_and_partition(const char *ifname, const char *dev_part_str,
- block_dev_desc_t **dev_desc,
+ struct blk_desc **dev_desc,
disk_partition_t *info, int allow_whole_dev);
#else
-static inline block_dev_desc_t *get_dev(const char *ifname, int dev)
+static inline struct blk_desc *get_dev(const char *ifname, int dev)
{ return NULL; }
-static inline block_dev_desc_t* ide_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t* sata_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t* scsi_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t* usb_stor_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t* mmc_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *ide_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *sata_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *scsi_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *usb_stor_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *mmc_get_dev(int dev) { return NULL; }
static inline int mmc_select_hwpart(int dev_num, int hwpart) { return -1; }
-static inline block_dev_desc_t* systemace_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t* mg_disk_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t *host_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *systemace_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *mg_disk_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *host_get_dev(int dev) { return NULL; }
-static inline int get_partition_info (block_dev_desc_t * dev_desc, int part,
- disk_partition_t *info) { return -1; }
-static inline void print_part (block_dev_desc_t *dev_desc) {}
-static inline void init_part (block_dev_desc_t *dev_desc) {}
-static inline void dev_print(block_dev_desc_t *dev_desc) {}
+static inline int get_partition_info(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info) { return -1; }
+static inline void print_part(struct blk_desc *dev_desc) {}
+static inline void init_part(struct blk_desc *dev_desc) {}
+static inline void dev_print(struct blk_desc *dev_desc) {}
static inline int get_device(const char *ifname, const char *dev_str,
- block_dev_desc_t **dev_desc)
+ struct blk_desc **dev_desc)
{ return -1; }
static inline int get_device_and_partition(const char *ifname,
const char *dev_part_str,
- block_dev_desc_t **dev_desc,
+ struct blk_desc **dev_desc,
disk_partition_t *info,
int allow_whole_dev)
{ *dev_desc = NULL; return -1; }
@@ -154,36 +155,41 @@ static inline int get_device_and_partition(const char *ifname,
#ifdef CONFIG_MAC_PARTITION
/* disk/part_mac.c */
-int get_partition_info_mac (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_mac (block_dev_desc_t *dev_desc);
-int test_part_mac (block_dev_desc_t *dev_desc);
+int get_partition_info_mac(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info);
+void print_part_mac(struct blk_desc *dev_desc);
+int test_part_mac(struct blk_desc *dev_desc);
#endif
#ifdef CONFIG_DOS_PARTITION
/* disk/part_dos.c */
-int get_partition_info_dos (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_dos (block_dev_desc_t *dev_desc);
-int test_part_dos (block_dev_desc_t *dev_desc);
+int get_partition_info_dos(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info);
+void print_part_dos(struct blk_desc *dev_desc);
+int test_part_dos(struct blk_desc *dev_desc);
#endif
#ifdef CONFIG_ISO_PARTITION
/* disk/part_iso.c */
-int get_partition_info_iso (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_iso (block_dev_desc_t *dev_desc);
-int test_part_iso (block_dev_desc_t *dev_desc);
+int get_partition_info_iso(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info);
+void print_part_iso(struct blk_desc *dev_desc);
+int test_part_iso(struct blk_desc *dev_desc);
#endif
#ifdef CONFIG_AMIGA_PARTITION
/* disk/part_amiga.c */
-int get_partition_info_amiga (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_amiga (block_dev_desc_t *dev_desc);
-int test_part_amiga (block_dev_desc_t *dev_desc);
+int get_partition_info_amiga(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info);
+void print_part_amiga(struct blk_desc *dev_desc);
+int test_part_amiga(struct blk_desc *dev_desc);
#endif
#ifdef CONFIG_EFI_PARTITION
#include <part_efi.h>
/* disk/part_efi.c */
-int get_partition_info_efi (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
+int get_partition_info_efi(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info);
/**
* get_partition_info_efi_by_name() - Find the specified GPT partition table entry
*
@@ -193,10 +199,10 @@ int get_partition_info_efi (block_dev_desc_t * dev_desc, int part, disk_partitio
*
* @return - '0' on match, '-1' on no match, otherwise error
*/
-int get_partition_info_efi_by_name(block_dev_desc_t *dev_desc,
+int get_partition_info_efi_by_name(struct blk_desc *dev_desc,
const char *name, disk_partition_t *info);
-void print_part_efi (block_dev_desc_t *dev_desc);
-int test_part_efi (block_dev_desc_t *dev_desc);
+void print_part_efi(struct blk_desc *dev_desc);
+int test_part_efi(struct blk_desc *dev_desc);
/**
* write_gpt_table() - Write the GUID Partition Table to disk
@@ -207,7 +213,7 @@ int test_part_efi (block_dev_desc_t *dev_desc);
*
* @return - zero on success, otherwise error
*/
-int write_gpt_table(block_dev_desc_t *dev_desc,
+int write_gpt_table(struct blk_desc *dev_desc,
gpt_header *gpt_h, gpt_entry *gpt_e);
/**
@@ -233,7 +239,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
*
* @return - error on str_guid conversion error
*/
-int gpt_fill_header(block_dev_desc_t *dev_desc, gpt_header *gpt_h,
+int gpt_fill_header(struct blk_desc *dev_desc, gpt_header *gpt_h,
char *str_guid, int parts_count);
/**
@@ -246,7 +252,7 @@ int gpt_fill_header(block_dev_desc_t *dev_desc, gpt_header *gpt_h,
*
* @return zero on success
*/
-int gpt_restore(block_dev_desc_t *dev_desc, char *str_disk_guid,
+int gpt_restore(struct blk_desc *dev_desc, char *str_disk_guid,
disk_partition_t *partitions, const int parts_count);
/**
@@ -257,7 +263,7 @@ int gpt_restore(block_dev_desc_t *dev_desc, char *str_disk_guid,
*
* @return - '0' on success, otherwise error
*/
-int is_valid_gpt_buf(block_dev_desc_t *dev_desc, void *buf);
+int is_valid_gpt_buf(struct blk_desc *dev_desc, void *buf);
/**
* write_mbr_and_gpt_partitions() - write MBR, Primary GPT and Backup GPT
@@ -267,7 +273,7 @@ int is_valid_gpt_buf(block_dev_desc_t *dev_desc, void *buf);
*
* @return - '0' on success, otherwise error
*/
-int write_mbr_and_gpt_partitions(block_dev_desc_t *dev_desc, void *buf);
+int write_mbr_and_gpt_partitions(struct blk_desc *dev_desc, void *buf);
/**
* gpt_verify_headers() - Function to read and CRC32 check of the GPT's header
@@ -281,7 +287,7 @@ int write_mbr_and_gpt_partitions(block_dev_desc_t *dev_desc, void *buf);
*
* @return - '0' on success, otherwise error
*/
-int gpt_verify_headers(block_dev_desc_t *dev_desc, gpt_header *gpt_head,
+int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head,
gpt_entry **gpt_pte);
/**
@@ -300,7 +306,7 @@ int gpt_verify_headers(block_dev_desc_t *dev_desc, gpt_header *gpt_head,
*
* @return - '0' on success, otherwise error
*/
-int gpt_verify_partitions(block_dev_desc_t *dev_desc,
+int gpt_verify_partitions(struct blk_desc *dev_desc,
disk_partition_t *partitions, int parts,
gpt_header *gpt_head, gpt_entry **gpt_pte);
#endif
diff --git a/include/reiserfs.h b/include/reiserfs.h
index 2d14d48fe0..ffe4e466d9 100644
--- a/include/reiserfs.h
+++ b/include/reiserfs.h
@@ -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);
diff --git a/include/sandboxblockdev.h b/include/sandboxblockdev.h
index 627787aa32..59f9519346 100644
--- a/include/sandboxblockdev.h
+++ b/include/sandboxblockdev.h
@@ -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;
};
diff --git a/include/sandboxfs.h b/include/sandboxfs.h
index 4c7745de91..6e6e3c62ff 100644
--- a/include/sandboxfs.h
+++ b/include/sandboxfs.h
@@ -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);
diff --git a/include/sata.h b/include/sata.h
index fa61da8ddd..b35359aa5a 100644
--- a/include/sata.h
+++ b/include/sata.h
@@ -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
diff --git a/include/spl.h b/include/spl.h
index 92cdc049d4..c62887af0e 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -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
diff --git a/include/systemace.h b/include/systemace.h
index 3f342d565c..3b6ec7da4b 100644
--- a/include/systemace.h
+++ b/include/systemace.h
@@ -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 */
diff --git a/include/ubifs_uboot.h b/include/ubifs_uboot.h
index dab433a39f..d86da277b0 100644
--- a/include/ubifs_uboot.h
+++ b/include/ubifs_uboot.h
@@ -21,7 +21,7 @@ void uboot_ubifs_umount(void);
int ubifs_is_mounted(void);
int ubifs_load(char *filename, u32 addr, u32 size);
-int ubifs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
+int ubifs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
int ubifs_ls(const char *dir_name);
int ubifs_exists(const char *filename);
int ubifs_size(const char *filename, loff_t *size);
diff --git a/include/usb.h b/include/usb.h
index 0b410b6cd1..c2fa6849f1 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -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);
diff --git a/include/usb_mass_storage.h b/include/usb_mass_storage.h
index 5804b70c35..8229f62b97 100644
--- a/include/usb_mass_storage.h
+++ b/include/usb_mass_storage.h
@@ -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);
diff --git a/include/zfs_common.h b/include/zfs_common.h
index 3bd575ef5f..bca3dff06e 100644
--- a/include/zfs_common.h
+++ b/include/zfs_common.h
@@ -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