Commit 4101f6879256720b30df712089a3df18565f9203
1 parent
b391d74336
Exists in
v2017.01-smarct4x
and in
29 other branches
dm: Drop the block_dev_desc_t typedef
Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long and causes 80-column violations, rename it to struct blk_desc. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
Showing 66 changed files with 338 additions and 331 deletions Side-by-side Diff
- 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
api/api.c
... | ... | @@ -189,7 +189,7 @@ |
189 | 189 | * |
190 | 190 | * - net: ð_device struct address from list pointed to by eth_devices |
191 | 191 | * |
192 | - * - storage: block_dev_desc_t struct address from &ide_dev_desc[n], | |
192 | + * - storage: struct blk_desc struct address from &ide_dev_desc[n], | |
193 | 193 | * &scsi_dev_desc[n] and similar tables |
194 | 194 | * |
195 | 195 | ****************************************************************************/ |
api/api_storage.c
... | ... | @@ -103,7 +103,7 @@ |
103 | 103 | |
104 | 104 | int i; |
105 | 105 | |
106 | - block_dev_desc_t *dd; | |
106 | + struct blk_desc *dd; | |
107 | 107 | |
108 | 108 | if (first) { |
109 | 109 | di->cookie = (void *)get_dev(specs[type].name, 0); |
... | ... | @@ -148,7 +148,7 @@ |
148 | 148 | di->type = specs[type].type; |
149 | 149 | |
150 | 150 | if (di->cookie != NULL) { |
151 | - dd = (block_dev_desc_t *)di->cookie; | |
151 | + dd = (struct blk_desc *)di->cookie; | |
152 | 152 | if (dd->type == DEV_TYPE_UNKNOWN) { |
153 | 153 | debugf("device instance exists, but is not active.."); |
154 | 154 | found = 0; |
155 | 155 | |
... | ... | @@ -166,9 +166,9 @@ |
166 | 166 | |
167 | 167 | |
168 | 168 | /* |
169 | - * returns: ENUM_IDE, ENUM_USB etc. based on block_dev_desc_t | |
169 | + * returns: ENUM_IDE, ENUM_USB etc. based on struct blk_desc | |
170 | 170 | */ |
171 | -static int dev_stor_type(block_dev_desc_t *dd) | |
171 | +static int dev_stor_type(struct blk_desc *dd) | |
172 | 172 | { |
173 | 173 | int i, j; |
174 | 174 | |
... | ... | @@ -308,7 +308,7 @@ |
308 | 308 | return 0; |
309 | 309 | } |
310 | 310 | |
311 | -static int dev_stor_is_valid(int type, block_dev_desc_t *dd) | |
311 | +static int dev_stor_is_valid(int type, struct blk_desc *dd) | |
312 | 312 | { |
313 | 313 | int i; |
314 | 314 | |
... | ... | @@ -328,7 +328,7 @@ |
328 | 328 | if (type == ENUM_MAX) |
329 | 329 | return API_ENODEV; |
330 | 330 | |
331 | - if (dev_stor_is_valid(type, (block_dev_desc_t *)cookie)) | |
331 | + if (dev_stor_is_valid(type, (struct blk_desc *)cookie)) | |
332 | 332 | return 0; |
333 | 333 | |
334 | 334 | return API_ENODEV; |
... | ... | @@ -348,7 +348,7 @@ |
348 | 348 | lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start) |
349 | 349 | { |
350 | 350 | int type; |
351 | - block_dev_desc_t *dd = (block_dev_desc_t *)cookie; | |
351 | + struct blk_desc *dd = (struct blk_desc *)cookie; | |
352 | 352 | |
353 | 353 | if ((type = dev_stor_type(dd)) == ENUM_MAX) |
354 | 354 | return 0; |
board/cm5200/fwupdate.c
board/mpl/pip405/README
... | ... | @@ -217,8 +217,8 @@ |
217 | 217 | Block device changes: |
218 | 218 | --------------------- |
219 | 219 | To allow the use of dos_part.c, mac_part.c and iso_part.c, the parameter |
220 | -block_dev_desc will be used when accessing the functions in these files. The block | |
221 | -device descriptor (block_dev_desc) contains a pointer to the read routine of the | |
220 | +blk_desc will be used when accessing the functions in these files. The block | |
221 | +device descriptor (blk_desc) contains a pointer to the read routine of the | |
222 | 222 | device, which will be used to read blocks from the device. |
223 | 223 | Renamed function ide_print to dev_print and moved it to the file disk/part.c to use |
224 | 224 | it for IDE ATAPI and SCSI devices. |
cmd/disk.c
cmd/fat.c
... | ... | @@ -69,7 +69,7 @@ |
69 | 69 | char * const argv[]) |
70 | 70 | { |
71 | 71 | int dev, part; |
72 | - block_dev_desc_t *dev_desc; | |
72 | + struct blk_desc *dev_desc; | |
73 | 73 | disk_partition_t info; |
74 | 74 | |
75 | 75 | if (argc < 2) { |
... | ... | @@ -105,7 +105,7 @@ |
105 | 105 | int ret; |
106 | 106 | unsigned long addr; |
107 | 107 | unsigned long count; |
108 | - block_dev_desc_t *dev_desc = NULL; | |
108 | + struct blk_desc *dev_desc = NULL; | |
109 | 109 | disk_partition_t info; |
110 | 110 | int dev = 0; |
111 | 111 | int part = 1; |
cmd/gpt.c
... | ... | @@ -168,7 +168,7 @@ |
168 | 168 | * @return - zero on success, otherwise error |
169 | 169 | * |
170 | 170 | */ |
171 | -static int set_gpt_info(block_dev_desc_t *dev_desc, | |
171 | +static int set_gpt_info(struct blk_desc *dev_desc, | |
172 | 172 | const char *str_part, |
173 | 173 | char **str_disk_guid, |
174 | 174 | disk_partition_t **partitions, |
... | ... | @@ -328,7 +328,7 @@ |
328 | 328 | return errno; |
329 | 329 | } |
330 | 330 | |
331 | -static int gpt_default(block_dev_desc_t *blk_dev_desc, const char *str_part) | |
331 | +static int gpt_default(struct blk_desc *blk_dev_desc, const char *str_part) | |
332 | 332 | { |
333 | 333 | int ret; |
334 | 334 | char *str_disk_guid; |
... | ... | @@ -356,7 +356,7 @@ |
356 | 356 | return ret; |
357 | 357 | } |
358 | 358 | |
359 | -static int gpt_verify(block_dev_desc_t *blk_dev_desc, const char *str_part) | |
359 | +static int gpt_verify(struct blk_desc *blk_dev_desc, const char *str_part) | |
360 | 360 | { |
361 | 361 | ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, |
362 | 362 | blk_dev_desc->blksz); |
... | ... | @@ -408,7 +408,7 @@ |
408 | 408 | int ret = CMD_RET_SUCCESS; |
409 | 409 | int dev = 0; |
410 | 410 | char *ep; |
411 | - block_dev_desc_t *blk_dev_desc = NULL; | |
411 | + struct blk_desc *blk_dev_desc = NULL; | |
412 | 412 | |
413 | 413 | if (argc < 4 || argc > 5) |
414 | 414 | return CMD_RET_USAGE; |
cmd/host.c
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 | int dev; |
68 | 68 | printf("%3s %12s %s\n", "dev", "blocks", "path"); |
69 | 69 | for (dev = min_dev; dev <= max_dev; dev++) { |
70 | - block_dev_desc_t *blk_dev; | |
70 | + struct blk_desc *blk_dev; | |
71 | 71 | int ret; |
72 | 72 | |
73 | 73 | printf("%3d ", dev); |
... | ... | @@ -92,7 +92,7 @@ |
92 | 92 | { |
93 | 93 | int dev; |
94 | 94 | char *ep; |
95 | - block_dev_desc_t *blk_dev; | |
95 | + struct blk_desc *blk_dev; | |
96 | 96 | int ret; |
97 | 97 | |
98 | 98 | if (argc < 1 || argc > 3) |
cmd/ide.c
... | ... | @@ -53,7 +53,7 @@ |
53 | 53 | |
54 | 54 | static int ide_bus_ok[CONFIG_SYS_IDE_MAXBUS]; |
55 | 55 | |
56 | -block_dev_desc_t ide_dev_desc[CONFIG_SYS_IDE_MAXDEVICE]; | |
56 | +struct blk_desc ide_dev_desc[CONFIG_SYS_IDE_MAXDEVICE]; | |
57 | 57 | /* ------------------------------------------------------------------------- */ |
58 | 58 | |
59 | 59 | #ifdef CONFIG_IDE_RESET |
... | ... | @@ -62,7 +62,7 @@ |
62 | 62 | #define ide_reset() /* dummy */ |
63 | 63 | #endif |
64 | 64 | |
65 | -static void ide_ident (block_dev_desc_t *dev_desc); | |
65 | +static void ide_ident(struct blk_desc *dev_desc); | |
66 | 66 | static uchar ide_wait (int dev, ulong t); |
67 | 67 | |
68 | 68 | #define IDE_TIME_OUT 2000 /* 2 sec timeout */ |
... | ... | @@ -78,8 +78,8 @@ |
78 | 78 | #endif |
79 | 79 | |
80 | 80 | #ifdef CONFIG_ATAPI |
81 | -static void atapi_inquiry(block_dev_desc_t *dev_desc); | |
82 | -static ulong atapi_read(block_dev_desc_t *block_dev, lbaint_t blknr, | |
81 | +static void atapi_inquiry(struct blk_desc *dev_desc); | |
82 | +static ulong atapi_read(struct blk_desc *block_dev, lbaint_t blknr, | |
83 | 83 | lbaint_t blkcnt, void *buffer); |
84 | 84 | #endif |
85 | 85 | |
... | ... | @@ -187,7 +187,7 @@ |
187 | 187 | if (strcmp(argv[1], "read") == 0) { |
188 | 188 | ulong addr = simple_strtoul(argv[2], NULL, 16); |
189 | 189 | ulong cnt = simple_strtoul(argv[4], NULL, 16); |
190 | - block_dev_desc_t *dev_desc; | |
190 | + struct blk_desc *dev_desc; | |
191 | 191 | ulong n; |
192 | 192 | |
193 | 193 | #ifdef CONFIG_SYS_64BIT_LBA |
... | ... | @@ -446,7 +446,7 @@ |
446 | 446 | /* ------------------------------------------------------------------------- */ |
447 | 447 | |
448 | 448 | #ifdef CONFIG_PARTITIONS |
449 | -block_dev_desc_t *ide_get_dev(int dev) | |
449 | +struct blk_desc *ide_get_dev(int dev) | |
450 | 450 | { |
451 | 451 | return (dev < CONFIG_SYS_IDE_MAXDEVICE) ? &ide_dev_desc[dev] : NULL; |
452 | 452 | } |
... | ... | @@ -541,7 +541,7 @@ |
541 | 541 | |
542 | 542 | /* ------------------------------------------------------------------------- |
543 | 543 | */ |
544 | -static void ide_ident(block_dev_desc_t *dev_desc) | |
544 | +static void ide_ident(struct blk_desc *dev_desc) | |
545 | 545 | { |
546 | 546 | unsigned char c; |
547 | 547 | hd_driveid_t iop; |
... | ... | @@ -713,7 +713,7 @@ |
713 | 713 | |
714 | 714 | /* ------------------------------------------------------------------------- */ |
715 | 715 | |
716 | -ulong ide_read(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt, | |
716 | +ulong ide_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt, | |
717 | 717 | void *buffer) |
718 | 718 | { |
719 | 719 | int device = block_dev->dev; |
... | ... | @@ -839,7 +839,7 @@ |
839 | 839 | /* ------------------------------------------------------------------------- */ |
840 | 840 | |
841 | 841 | |
842 | -ulong ide_write(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt, | |
842 | +ulong ide_write(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt, | |
843 | 843 | const void *buffer) |
844 | 844 | { |
845 | 845 | int device = block_dev->dev; |
... | ... | @@ -1301,7 +1301,7 @@ |
1301 | 1301 | } |
1302 | 1302 | |
1303 | 1303 | |
1304 | -static void atapi_inquiry(block_dev_desc_t *dev_desc) | |
1304 | +static void atapi_inquiry(struct blk_desc *dev_desc) | |
1305 | 1305 | { |
1306 | 1306 | unsigned char ccb[12]; /* Command descriptor block */ |
1307 | 1307 | unsigned char iobuf[64]; /* temp buf */ |
... | ... | @@ -1394,7 +1394,7 @@ |
1394 | 1394 | #define ATAPI_READ_BLOCK_SIZE 2048 /* assuming CD part */ |
1395 | 1395 | #define ATAPI_READ_MAX_BLOCK (ATAPI_READ_MAX_BYTES/ATAPI_READ_BLOCK_SIZE) |
1396 | 1396 | |
1397 | -ulong atapi_read(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt, | |
1397 | +ulong atapi_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt, | |
1398 | 1398 | void *buffer) |
1399 | 1399 | { |
1400 | 1400 | int device = block_dev->dev; |
cmd/mmc.c
cmd/part.c
... | ... | @@ -29,7 +29,7 @@ |
29 | 29 | static int do_part_uuid(int argc, char * const argv[]) |
30 | 30 | { |
31 | 31 | int part; |
32 | - block_dev_desc_t *dev_desc; | |
32 | + struct blk_desc *dev_desc; | |
33 | 33 | disk_partition_t info; |
34 | 34 | |
35 | 35 | if (argc < 2) |
... | ... | @@ -52,7 +52,7 @@ |
52 | 52 | static int do_part_list(int argc, char * const argv[]) |
53 | 53 | { |
54 | 54 | int ret; |
55 | - block_dev_desc_t *desc; | |
55 | + struct blk_desc *desc; | |
56 | 56 | char *var = NULL; |
57 | 57 | bool bootable = false; |
58 | 58 | int i; |
... | ... | @@ -114,7 +114,7 @@ |
114 | 114 | |
115 | 115 | static int do_part_start(int argc, char * const argv[]) |
116 | 116 | { |
117 | - block_dev_desc_t *desc; | |
117 | + struct blk_desc *desc; | |
118 | 118 | disk_partition_t info; |
119 | 119 | char buf[512] = { 0 }; |
120 | 120 | int part; |
... | ... | @@ -148,7 +148,7 @@ |
148 | 148 | |
149 | 149 | static int do_part_size(int argc, char * const argv[]) |
150 | 150 | { |
151 | - block_dev_desc_t *desc; | |
151 | + struct blk_desc *desc; | |
152 | 152 | disk_partition_t info; |
153 | 153 | char buf[512] = { 0 }; |
154 | 154 | int part; |
cmd/read.c
... | ... | @@ -15,7 +15,7 @@ |
15 | 15 | int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
16 | 16 | { |
17 | 17 | char *ep; |
18 | - block_dev_desc_t *dev_desc = NULL; | |
18 | + struct blk_desc *dev_desc = NULL; | |
19 | 19 | int dev; |
20 | 20 | int part = 0; |
21 | 21 | disk_partition_t part_info; |
... | ... | @@ -57,7 +57,7 @@ |
57 | 57 | offset = part_info.start; |
58 | 58 | limit = part_info.size; |
59 | 59 | } else { |
60 | - /* Largest address not available in block_dev_desc_t. */ | |
60 | + /* Largest address not available in struct blk_desc. */ | |
61 | 61 | limit = ~0; |
62 | 62 | } |
63 | 63 |
cmd/reiser.c
... | ... | @@ -34,7 +34,7 @@ |
34 | 34 | { |
35 | 35 | char *filename = "/"; |
36 | 36 | int dev, part; |
37 | - block_dev_desc_t *dev_desc=NULL; | |
37 | + struct blk_desc *dev_desc = NULL; | |
38 | 38 | disk_partition_t info; |
39 | 39 | |
40 | 40 | if (argc < 3) |
... | ... | @@ -82,7 +82,7 @@ |
82 | 82 | int dev, part; |
83 | 83 | ulong addr = 0, filelen; |
84 | 84 | disk_partition_t info; |
85 | - block_dev_desc_t *dev_desc = NULL; | |
85 | + struct blk_desc *dev_desc = NULL; | |
86 | 86 | unsigned long count; |
87 | 87 | char *addr_str; |
88 | 88 |
cmd/sata.c
... | ... | @@ -16,15 +16,15 @@ |
16 | 16 | #include <sata.h> |
17 | 17 | |
18 | 18 | static int sata_curr_device = -1; |
19 | -block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE]; | |
19 | +struct blk_desc sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE]; | |
20 | 20 | |
21 | -static unsigned long sata_bread(block_dev_desc_t *block_dev, lbaint_t start, | |
21 | +static unsigned long sata_bread(struct blk_desc *block_dev, lbaint_t start, | |
22 | 22 | lbaint_t blkcnt, void *dst) |
23 | 23 | { |
24 | 24 | return sata_read(block_dev->dev, start, blkcnt, dst); |
25 | 25 | } |
26 | 26 | |
27 | -static unsigned long sata_bwrite(block_dev_desc_t *block_dev, lbaint_t start, | |
27 | +static unsigned long sata_bwrite(struct blk_desc *block_dev, lbaint_t start, | |
28 | 28 | lbaint_t blkcnt, const void *buffer) |
29 | 29 | { |
30 | 30 | return sata_write(block_dev->dev, start, blkcnt, buffer); |
... | ... | @@ -36,7 +36,7 @@ |
36 | 36 | int i; |
37 | 37 | |
38 | 38 | for (i = 0; i < CONFIG_SYS_SATA_MAX_DEVICE; i++) { |
39 | - memset(&sata_dev_desc[i], 0, sizeof(struct block_dev_desc)); | |
39 | + memset(&sata_dev_desc[i], 0, sizeof(struct blk_desc)); | |
40 | 40 | sata_dev_desc[i].if_type = IF_TYPE_SATA; |
41 | 41 | sata_dev_desc[i].dev = i; |
42 | 42 | sata_dev_desc[i].part_type = PART_TYPE_UNKNOWN; |
... | ... | @@ -75,7 +75,7 @@ |
75 | 75 | int sata_stop(void) __attribute__((weak, alias("__sata_stop"))); |
76 | 76 | |
77 | 77 | #ifdef CONFIG_PARTITIONS |
78 | -block_dev_desc_t *sata_get_dev(int dev) | |
78 | +struct blk_desc *sata_get_dev(int dev) | |
79 | 79 | { |
80 | 80 | return (dev < CONFIG_SYS_SATA_MAX_DEVICE) ? &sata_dev_desc[dev] : NULL; |
81 | 81 | } |
cmd/scsi.c
... | ... | @@ -48,7 +48,7 @@ |
48 | 48 | |
49 | 49 | static int scsi_curr_dev; /* current device */ |
50 | 50 | |
51 | -static block_dev_desc_t scsi_dev_desc[CONFIG_SYS_SCSI_MAX_DEVICE]; | |
51 | +static struct blk_desc scsi_dev_desc[CONFIG_SYS_SCSI_MAX_DEVICE]; | |
52 | 52 | |
53 | 53 | /******************************************************************************** |
54 | 54 | * forward declerations of some Setup Routines |
55 | 55 | |
... | ... | @@ -66,9 +66,9 @@ |
66 | 66 | |
67 | 67 | static int scsi_read_capacity(ccb *pccb, lbaint_t *capacity, |
68 | 68 | unsigned long *blksz); |
69 | -static ulong scsi_read(block_dev_desc_t *block_dev, lbaint_t blknr, | |
69 | +static ulong scsi_read(struct blk_desc *block_dev, lbaint_t blknr, | |
70 | 70 | lbaint_t blkcnt, void *buffer); |
71 | -static ulong scsi_write(block_dev_desc_t *block_dev, lbaint_t blknr, | |
71 | +static ulong scsi_write(struct blk_desc *block_dev, lbaint_t blknr, | |
72 | 72 | lbaint_t blkcnt, const void *buffer); |
73 | 73 | |
74 | 74 | |
... | ... | @@ -239,7 +239,7 @@ |
239 | 239 | #endif |
240 | 240 | |
241 | 241 | #ifdef CONFIG_PARTITIONS |
242 | -block_dev_desc_t * scsi_get_dev(int dev) | |
242 | +struct blk_desc *scsi_get_dev(int dev) | |
243 | 243 | { |
244 | 244 | return (dev < CONFIG_SYS_SCSI_MAX_DEVICE) ? &scsi_dev_desc[dev] : NULL; |
245 | 245 | } |
... | ... | @@ -376,7 +376,7 @@ |
376 | 376 | #define SCSI_MAX_READ_BLK 0xFFFF |
377 | 377 | #define SCSI_LBA48_READ 0xFFFFFFF |
378 | 378 | |
379 | -static ulong scsi_read(block_dev_desc_t *block_dev, lbaint_t blknr, | |
379 | +static ulong scsi_read(struct blk_desc *block_dev, lbaint_t blknr, | |
380 | 380 | lbaint_t blkcnt, void *buffer) |
381 | 381 | { |
382 | 382 | int device = block_dev->dev; |
... | ... | @@ -443,7 +443,7 @@ |
443 | 443 | /* Almost the maximum amount of the scsi_ext command.. */ |
444 | 444 | #define SCSI_MAX_WRITE_BLK 0xFFFF |
445 | 445 | |
446 | -static ulong scsi_write(block_dev_desc_t *block_dev, lbaint_t blknr, | |
446 | +static ulong scsi_write(struct blk_desc *block_dev, lbaint_t blknr, | |
447 | 447 | lbaint_t blkcnt, const void *buffer) |
448 | 448 | { |
449 | 449 | int device = block_dev->dev; |
cmd/unzip.c
cmd/usb.c
cmd/usb_mass_storage.c
... | ... | @@ -19,7 +19,7 @@ |
19 | 19 | static int ums_read_sector(struct ums *ums_dev, |
20 | 20 | ulong start, lbaint_t blkcnt, void *buf) |
21 | 21 | { |
22 | - block_dev_desc_t *block_dev = &ums_dev->block_dev; | |
22 | + struct blk_desc *block_dev = &ums_dev->block_dev; | |
23 | 23 | lbaint_t blkstart = start + ums_dev->start_sector; |
24 | 24 | |
25 | 25 | return block_dev->block_read(block_dev, blkstart, blkcnt, buf); |
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 | static int ums_write_sector(struct ums *ums_dev, |
29 | 29 | ulong start, lbaint_t blkcnt, const void *buf) |
30 | 30 | { |
31 | - block_dev_desc_t *block_dev = &ums_dev->block_dev; | |
31 | + struct blk_desc *block_dev = &ums_dev->block_dev; | |
32 | 32 | lbaint_t blkstart = start + ums_dev->start_sector; |
33 | 33 | |
34 | 34 | return block_dev->block_write(block_dev, blkstart, blkcnt, buf); |
... | ... | @@ -53,7 +53,7 @@ |
53 | 53 | static int ums_init(const char *devtype, const char *devnums) |
54 | 54 | { |
55 | 55 | char *s, *t, *devnum, *name; |
56 | - block_dev_desc_t *block_dev; | |
56 | + struct blk_desc *block_dev; | |
57 | 57 | int ret; |
58 | 58 | struct ums *ums_new; |
59 | 59 |
cmd/zfs.c
... | ... | @@ -39,7 +39,7 @@ |
39 | 39 | int part; |
40 | 40 | ulong addr = 0; |
41 | 41 | disk_partition_t info; |
42 | - block_dev_desc_t *dev_desc; | |
42 | + struct blk_desc *dev_desc; | |
43 | 43 | char buf[12]; |
44 | 44 | unsigned long count; |
45 | 45 | const char *addr_str; |
... | ... | @@ -135,7 +135,7 @@ |
135 | 135 | { |
136 | 136 | const char *filename = "/"; |
137 | 137 | int part; |
138 | - block_dev_desc_t *dev_desc; | |
138 | + struct blk_desc *dev_desc; | |
139 | 139 | disk_partition_t info; |
140 | 140 | struct device_s vdev; |
141 | 141 |
common/env_fat.c
... | ... | @@ -38,7 +38,7 @@ |
38 | 38 | int saveenv(void) |
39 | 39 | { |
40 | 40 | env_t env_new; |
41 | - block_dev_desc_t *dev_desc = NULL; | |
41 | + struct blk_desc *dev_desc = NULL; | |
42 | 42 | disk_partition_t info; |
43 | 43 | int dev, part; |
44 | 44 | int err; |
... | ... | @@ -77,7 +77,7 @@ |
77 | 77 | void env_relocate_spec(void) |
78 | 78 | { |
79 | 79 | ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE); |
80 | - block_dev_desc_t *dev_desc = NULL; | |
80 | + struct blk_desc *dev_desc = NULL; | |
81 | 81 | disk_partition_t info; |
82 | 82 | int dev, part; |
83 | 83 | int err; |
common/fb_mmc.c
... | ... | @@ -22,10 +22,10 @@ |
22 | 22 | static char *response_str; |
23 | 23 | |
24 | 24 | struct fb_mmc_sparse { |
25 | - block_dev_desc_t *dev_desc; | |
25 | + struct blk_desc *dev_desc; | |
26 | 26 | }; |
27 | 27 | |
28 | -static int get_partition_info_efi_by_name_or_alias(block_dev_desc_t *dev_desc, | |
28 | +static int get_partition_info_efi_by_name_or_alias(struct blk_desc *dev_desc, | |
29 | 29 | const char *name, disk_partition_t *info) |
30 | 30 | { |
31 | 31 | int ret; |
... | ... | @@ -55,7 +55,7 @@ |
55 | 55 | char *data) |
56 | 56 | { |
57 | 57 | struct fb_mmc_sparse *sparse = priv; |
58 | - block_dev_desc_t *dev_desc = sparse->dev_desc; | |
58 | + struct blk_desc *dev_desc = sparse->dev_desc; | |
59 | 59 | int ret; |
60 | 60 | |
61 | 61 | ret = dev_desc->block_write(dev_desc, offset, size, data); |
... | ... | @@ -65,7 +65,7 @@ |
65 | 65 | return ret; |
66 | 66 | } |
67 | 67 | |
68 | -static void write_raw_image(block_dev_desc_t *dev_desc, disk_partition_t *info, | |
68 | +static void write_raw_image(struct blk_desc *dev_desc, disk_partition_t *info, | |
69 | 69 | const char *part_name, void *buffer, |
70 | 70 | unsigned int download_bytes) |
71 | 71 | { |
... | ... | @@ -100,7 +100,7 @@ |
100 | 100 | void *download_buffer, unsigned int download_bytes, |
101 | 101 | char *response) |
102 | 102 | { |
103 | - block_dev_desc_t *dev_desc; | |
103 | + struct blk_desc *dev_desc; | |
104 | 104 | disk_partition_t info; |
105 | 105 | |
106 | 106 | /* initialize the response buffer */ |
... | ... | @@ -165,7 +165,7 @@ |
165 | 165 | void fb_mmc_erase(const char *cmd, char *response) |
166 | 166 | { |
167 | 167 | int ret; |
168 | - block_dev_desc_t *dev_desc; | |
168 | + struct blk_desc *dev_desc; | |
169 | 169 | disk_partition_t info; |
170 | 170 | lbaint_t blks, blks_start, blks_size, grp_size; |
171 | 171 | struct mmc *mmc = find_mmc_device(CONFIG_FASTBOOT_FLASH_MMC_DEV); |
common/spl/spl_ext.c
... | ... | @@ -10,7 +10,7 @@ |
10 | 10 | #include <image.h> |
11 | 11 | |
12 | 12 | #ifdef CONFIG_SPL_EXT_SUPPORT |
13 | -int spl_load_image_ext(block_dev_desc_t *block_dev, | |
13 | +int spl_load_image_ext(struct blk_desc *block_dev, | |
14 | 14 | int partition, |
15 | 15 | const char *filename) |
16 | 16 | { |
... | ... | @@ -64,7 +64,7 @@ |
64 | 64 | } |
65 | 65 | |
66 | 66 | #ifdef CONFIG_SPL_OS_BOOT |
67 | -int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition) | |
67 | +int spl_load_image_ext_os(struct blk_desc *block_dev, int partition) | |
68 | 68 | { |
69 | 69 | int err; |
70 | 70 | __maybe_unused loff_t filelen, actlen; |
... | ... | @@ -137,7 +137,7 @@ |
137 | 137 | CONFIG_SPL_FS_LOAD_KERNEL_NAME); |
138 | 138 | } |
139 | 139 | #else |
140 | -int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition) | |
140 | +int spl_load_image_ext_os(struct blk_desc *block_dev, int partition) | |
141 | 141 | { |
142 | 142 | return -ENOSYS; |
143 | 143 | } |
common/spl/spl_fat.c
... | ... | @@ -19,7 +19,7 @@ |
19 | 19 | static int fat_registered; |
20 | 20 | |
21 | 21 | #ifdef CONFIG_SPL_FAT_SUPPORT |
22 | -static int spl_register_fat_device(block_dev_desc_t *block_dev, int partition) | |
22 | +static int spl_register_fat_device(struct blk_desc *block_dev, int partition) | |
23 | 23 | { |
24 | 24 | int err = 0; |
25 | 25 | |
... | ... | @@ -39,7 +39,7 @@ |
39 | 39 | return err; |
40 | 40 | } |
41 | 41 | |
42 | -int spl_load_image_fat(block_dev_desc_t *block_dev, | |
42 | +int spl_load_image_fat(struct blk_desc *block_dev, | |
43 | 43 | int partition, |
44 | 44 | const char *filename) |
45 | 45 | { |
... | ... | @@ -72,7 +72,7 @@ |
72 | 72 | } |
73 | 73 | |
74 | 74 | #ifdef CONFIG_SPL_OS_BOOT |
75 | -int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition) | |
75 | +int spl_load_image_fat_os(struct blk_desc *block_dev, int partition) | |
76 | 76 | { |
77 | 77 | int err; |
78 | 78 | __maybe_unused char *file; |
... | ... | @@ -121,7 +121,7 @@ |
121 | 121 | CONFIG_SPL_FS_LOAD_KERNEL_NAME); |
122 | 122 | } |
123 | 123 | #else |
124 | -int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition) | |
124 | +int spl_load_image_fat_os(struct blk_desc *block_dev, int partition) | |
125 | 125 | { |
126 | 126 | return -ENOSYS; |
127 | 127 | } |
common/spl/spl_sata.c
common/spl/spl_usb.c
common/usb_storage.c
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 | |
68 | 68 | static int usb_max_devs; /* number of highest available usb device */ |
69 | 69 | |
70 | -static block_dev_desc_t usb_dev_desc[USB_MAX_STOR_DEV]; | |
70 | +static struct blk_desc usb_dev_desc[USB_MAX_STOR_DEV]; | |
71 | 71 | |
72 | 72 | struct us_data; |
73 | 73 | typedef int (*trans_cmnd)(ccb *cb, struct us_data *data); |
74 | 74 | |
75 | 75 | |
76 | 76 | |
... | ... | @@ -115,17 +115,17 @@ |
115 | 115 | #define USB_STOR_TRANSPORT_ERROR -2 |
116 | 116 | |
117 | 117 | int usb_stor_get_info(struct usb_device *dev, struct us_data *us, |
118 | - block_dev_desc_t *dev_desc); | |
118 | + struct blk_desc *dev_desc); | |
119 | 119 | int usb_storage_probe(struct usb_device *dev, unsigned int ifnum, |
120 | 120 | struct us_data *ss); |
121 | -static unsigned long usb_stor_read(block_dev_desc_t *block_dev, lbaint_t blknr, | |
121 | +static unsigned long usb_stor_read(struct blk_desc *block_dev, lbaint_t blknr, | |
122 | 122 | lbaint_t blkcnt, void *buffer); |
123 | -static unsigned long usb_stor_write(block_dev_desc_t *block_dev, lbaint_t blknr, | |
123 | +static unsigned long usb_stor_write(struct blk_desc *block_dev, lbaint_t blknr, | |
124 | 124 | lbaint_t blkcnt, const void *buffer); |
125 | 125 | void uhci_show_temp_int_td(void); |
126 | 126 | |
127 | 127 | #ifdef CONFIG_PARTITIONS |
128 | -block_dev_desc_t *usb_stor_get_dev(int index) | |
128 | +struct blk_desc *usb_stor_get_dev(int index) | |
129 | 129 | { |
130 | 130 | return (index < usb_max_devs) ? &usb_dev_desc[index] : NULL; |
131 | 131 | } |
132 | 132 | |
... | ... | @@ -187,10 +187,10 @@ |
187 | 187 | for (lun = 0; |
188 | 188 | lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV; |
189 | 189 | lun++) { |
190 | - struct block_dev_desc *blkdev; | |
190 | + struct blk_desc *blkdev; | |
191 | 191 | |
192 | 192 | blkdev = &usb_dev_desc[usb_max_devs]; |
193 | - memset(blkdev, '\0', sizeof(block_dev_desc_t)); | |
193 | + memset(blkdev, '\0', sizeof(struct blk_desc)); | |
194 | 194 | blkdev->if_type = IF_TYPE_USB; |
195 | 195 | blkdev->dev = usb_max_devs; |
196 | 196 | blkdev->part_type = PART_TYPE_UNKNOWN; |
... | ... | @@ -1011,7 +1011,7 @@ |
1011 | 1011 | * device with proper values (as reported by 'usb info'). |
1012 | 1012 | * |
1013 | 1013 | * Vendor and product length limits are taken from the definition of |
1014 | - * block_dev_desc_t in include/part.h. | |
1014 | + * struct blk_desc in include/part.h. | |
1015 | 1015 | */ |
1016 | 1016 | static void usb_bin_fixup(struct usb_device_descriptor descriptor, |
1017 | 1017 | unsigned char vendor[], |
... | ... | @@ -1026,7 +1026,7 @@ |
1026 | 1026 | } |
1027 | 1027 | #endif /* CONFIG_USB_BIN_FIXUP */ |
1028 | 1028 | |
1029 | -static unsigned long usb_stor_read(block_dev_desc_t *block_dev, lbaint_t blknr, | |
1029 | +static unsigned long usb_stor_read(struct blk_desc *block_dev, lbaint_t blknr, | |
1030 | 1030 | lbaint_t blkcnt, void *buffer) |
1031 | 1031 | { |
1032 | 1032 | int device = block_dev->dev; |
... | ... | @@ -1097,7 +1097,7 @@ |
1097 | 1097 | return blkcnt; |
1098 | 1098 | } |
1099 | 1099 | |
1100 | -static unsigned long usb_stor_write(block_dev_desc_t *block_dev, lbaint_t blknr, | |
1100 | +static unsigned long usb_stor_write(struct blk_desc *block_dev, lbaint_t blknr, | |
1101 | 1101 | lbaint_t blkcnt, const void *buffer) |
1102 | 1102 | { |
1103 | 1103 | int device = block_dev->dev; |
... | ... | @@ -1289,7 +1289,7 @@ |
1289 | 1289 | } |
1290 | 1290 | |
1291 | 1291 | int usb_stor_get_info(struct usb_device *dev, struct us_data *ss, |
1292 | - block_dev_desc_t *dev_desc) | |
1292 | + struct blk_desc *dev_desc) | |
1293 | 1293 | { |
1294 | 1294 | unsigned char perq, modi; |
1295 | 1295 | ALLOC_CACHE_ALIGN_BUFFER(u32, cap, 2); |
disk/part.c
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 | |
23 | 23 | struct block_drvr { |
24 | 24 | char *name; |
25 | - block_dev_desc_t* (*get_dev)(int dev); | |
25 | + struct blk_desc* (*get_dev)(int dev); | |
26 | 26 | int (*select_hwpart)(int dev_num, int hwpart); |
27 | 27 | }; |
28 | 28 | |
29 | 29 | |
... | ... | @@ -58,10 +58,10 @@ |
58 | 58 | DECLARE_GLOBAL_DATA_PTR; |
59 | 59 | |
60 | 60 | #ifdef HAVE_BLOCK_DEVICE |
61 | -static block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart) | |
61 | +static struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart) | |
62 | 62 | { |
63 | 63 | const struct block_drvr *drvr = block_drvr; |
64 | - block_dev_desc_t* (*reloc_get_dev)(int dev); | |
64 | + struct blk_desc* (*reloc_get_dev)(int dev); | |
65 | 65 | int (*select_hwpart)(int dev_num, int hwpart); |
66 | 66 | char *name; |
67 | 67 | int ret; |
... | ... | @@ -84,7 +84,7 @@ |
84 | 84 | select_hwpart += gd->reloc_off; |
85 | 85 | #endif |
86 | 86 | if (strncmp(ifname, name, strlen(name)) == 0) { |
87 | - block_dev_desc_t *dev_desc = reloc_get_dev(dev); | |
87 | + struct blk_desc *dev_desc = reloc_get_dev(dev); | |
88 | 88 | if (!dev_desc) |
89 | 89 | return NULL; |
90 | 90 | if (hwpart == 0 && !select_hwpart) |
91 | 91 | |
92 | 92 | |
... | ... | @@ -101,17 +101,17 @@ |
101 | 101 | return NULL; |
102 | 102 | } |
103 | 103 | |
104 | -block_dev_desc_t *get_dev(const char *ifname, int dev) | |
104 | +struct blk_desc *get_dev(const char *ifname, int dev) | |
105 | 105 | { |
106 | 106 | return get_dev_hwpart(ifname, dev, 0); |
107 | 107 | } |
108 | 108 | #else |
109 | -block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart) | |
109 | +struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart) | |
110 | 110 | { |
111 | 111 | return NULL; |
112 | 112 | } |
113 | 113 | |
114 | -block_dev_desc_t *get_dev(const char *ifname, int dev) | |
114 | +struct blk_desc *get_dev(const char *ifname, int dev) | |
115 | 115 | { |
116 | 116 | return NULL; |
117 | 117 | } |
... | ... | @@ -144,7 +144,7 @@ |
144 | 144 | return bc_quot * mul_by + (bc_rem * mul_by) / div_by; |
145 | 145 | } |
146 | 146 | |
147 | -void dev_print (block_dev_desc_t *dev_desc) | |
147 | +void dev_print (struct blk_desc *dev_desc) | |
148 | 148 | { |
149 | 149 | lba512_t lba512; /* number of blocks if 512bytes block size */ |
150 | 150 | |
... | ... | @@ -250,7 +250,7 @@ |
250 | 250 | |
251 | 251 | #ifdef HAVE_BLOCK_DEVICE |
252 | 252 | |
253 | -void init_part(block_dev_desc_t *dev_desc) | |
253 | +void init_part(struct blk_desc *dev_desc) | |
254 | 254 | { |
255 | 255 | #ifdef CONFIG_ISO_PARTITION |
256 | 256 | if (test_part_iso(dev_desc) == 0) { |
... | ... | @@ -297,7 +297,7 @@ |
297 | 297 | defined(CONFIG_AMIGA_PARTITION) || \ |
298 | 298 | defined(CONFIG_EFI_PARTITION) |
299 | 299 | |
300 | -static void print_part_header(const char *type, block_dev_desc_t *dev_desc) | |
300 | +static void print_part_header(const char *type, struct blk_desc *dev_desc) | |
301 | 301 | { |
302 | 302 | puts ("\nPartition Map for "); |
303 | 303 | switch (dev_desc->if_type) { |
... | ... | @@ -335,7 +335,7 @@ |
335 | 335 | |
336 | 336 | #endif /* any CONFIG_..._PARTITION */ |
337 | 337 | |
338 | -void print_part(block_dev_desc_t * dev_desc) | |
338 | +void print_part(struct blk_desc *dev_desc) | |
339 | 339 | { |
340 | 340 | |
341 | 341 | switch (dev_desc->part_type) { |
... | ... | @@ -383,7 +383,7 @@ |
383 | 383 | |
384 | 384 | #endif /* HAVE_BLOCK_DEVICE */ |
385 | 385 | |
386 | -int get_partition_info(block_dev_desc_t *dev_desc, int part, | |
386 | +int get_partition_info(struct blk_desc *dev_desc, int part, | |
387 | 387 | disk_partition_t *info) |
388 | 388 | { |
389 | 389 | #ifdef HAVE_BLOCK_DEVICE |
... | ... | @@ -450,7 +450,7 @@ |
450 | 450 | } |
451 | 451 | |
452 | 452 | int get_device(const char *ifname, const char *dev_hwpart_str, |
453 | - block_dev_desc_t **dev_desc) | |
453 | + struct blk_desc **dev_desc) | |
454 | 454 | { |
455 | 455 | char *ep; |
456 | 456 | char *dup_str = NULL; |
... | ... | @@ -512,7 +512,7 @@ |
512 | 512 | #define PART_AUTO -1 |
513 | 513 | #define MAX_SEARCH_PARTITIONS 16 |
514 | 514 | int get_device_and_partition(const char *ifname, const char *dev_part_str, |
515 | - block_dev_desc_t **dev_desc, | |
515 | + struct blk_desc **dev_desc, | |
516 | 516 | disk_partition_t *info, int allow_whole_dev) |
517 | 517 | { |
518 | 518 | int ret = -1; |
disk/part_amiga.c
... | ... | @@ -126,7 +126,7 @@ |
126 | 126 | * the ID AMIGA_ID_RDISK ('RDSK') and needs to have a valid |
127 | 127 | * sum-to-zero checksum |
128 | 128 | */ |
129 | -struct rigid_disk_block *get_rdisk(block_dev_desc_t *dev_desc) | |
129 | +struct rigid_disk_block *get_rdisk(struct blk_desc *dev_desc) | |
130 | 130 | { |
131 | 131 | int i; |
132 | 132 | int limit; |
... | ... | @@ -166,7 +166,7 @@ |
166 | 166 | * Ridgid disk block |
167 | 167 | */ |
168 | 168 | |
169 | -struct bootcode_block *get_bootcode(block_dev_desc_t *dev_desc) | |
169 | +struct bootcode_block *get_bootcode(struct blk_desc *dev_desc) | |
170 | 170 | { |
171 | 171 | int i; |
172 | 172 | int limit; |
... | ... | @@ -207,7 +207,7 @@ |
207 | 207 | * Test if the given partition has an Amiga partition table/Rigid |
208 | 208 | * Disk block |
209 | 209 | */ |
210 | -int test_part_amiga(block_dev_desc_t *dev_desc) | |
210 | +int test_part_amiga(struct blk_desc *dev_desc) | |
211 | 211 | { |
212 | 212 | struct rigid_disk_block *rdb; |
213 | 213 | struct bootcode_block *bootcode; |
... | ... | @@ -236,7 +236,8 @@ |
236 | 236 | /* |
237 | 237 | * Find partition number partnum on the given drive. |
238 | 238 | */ |
239 | -static struct partition_block *find_partition(block_dev_desc_t *dev_desc, int partnum) | |
239 | +static struct partition_block *find_partition(struct blk_desc *dev_desc, | |
240 | + int partnum) | |
240 | 241 | { |
241 | 242 | struct rigid_disk_block *rdb; |
242 | 243 | struct partition_block *p; |
... | ... | @@ -290,7 +291,8 @@ |
290 | 291 | /* |
291 | 292 | * Get info about a partition |
292 | 293 | */ |
293 | -int get_partition_info_amiga (block_dev_desc_t *dev_desc, int part, disk_partition_t *info) | |
294 | +int get_partition_info_amiga(struct blk_desc *dev_desc, int part, | |
295 | + disk_partition_t *info) | |
294 | 296 | { |
295 | 297 | struct partition_block *p = find_partition(dev_desc, part-1); |
296 | 298 | struct amiga_part_geometry *g; |
... | ... | @@ -317,7 +319,7 @@ |
317 | 319 | return 0; |
318 | 320 | } |
319 | 321 | |
320 | -void print_part_amiga (block_dev_desc_t *dev_desc) | |
322 | +void print_part_amiga(struct blk_desc *dev_desc) | |
321 | 323 | { |
322 | 324 | struct rigid_disk_block *rdb; |
323 | 325 | struct bootcode_block *boot; |
disk/part_dos.c
... | ... | @@ -87,7 +87,7 @@ |
87 | 87 | } |
88 | 88 | |
89 | 89 | |
90 | -int test_part_dos (block_dev_desc_t *dev_desc) | |
90 | +int test_part_dos(struct blk_desc *dev_desc) | |
91 | 91 | { |
92 | 92 | ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz); |
93 | 93 | |
... | ... | @@ -102,7 +102,7 @@ |
102 | 102 | |
103 | 103 | /* Print a partition that is relative to its Extended partition table |
104 | 104 | */ |
105 | -static void print_partition_extended(block_dev_desc_t *dev_desc, | |
105 | +static void print_partition_extended(struct blk_desc *dev_desc, | |
106 | 106 | lbaint_t ext_part_sector, |
107 | 107 | lbaint_t relative, |
108 | 108 | int part_num, unsigned int disksig) |
... | ... | @@ -167,11 +167,11 @@ |
167 | 167 | |
168 | 168 | /* Print a partition that is relative to its Extended partition table |
169 | 169 | */ |
170 | -static int get_partition_info_extended (block_dev_desc_t *dev_desc, | |
171 | - lbaint_t ext_part_sector, | |
172 | - lbaint_t relative, int part_num, | |
173 | - int which_part, disk_partition_t *info, | |
174 | - unsigned int disksig) | |
170 | +static int get_partition_info_extended(struct blk_desc *dev_desc, | |
171 | + lbaint_t ext_part_sector, | |
172 | + lbaint_t relative, int part_num, | |
173 | + int which_part, disk_partition_t *info, | |
174 | + unsigned int disksig) | |
175 | 175 | { |
176 | 176 | ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz); |
177 | 177 | dos_partition_t *pt; |
178 | 178 | |
... | ... | @@ -283,13 +283,14 @@ |
283 | 283 | return -1; |
284 | 284 | } |
285 | 285 | |
286 | -void print_part_dos (block_dev_desc_t *dev_desc) | |
286 | +void print_part_dos(struct blk_desc *dev_desc) | |
287 | 287 | { |
288 | 288 | printf("Part\tStart Sector\tNum Sectors\tUUID\t\tType\n"); |
289 | 289 | print_partition_extended(dev_desc, 0, 0, 1, 0); |
290 | 290 | } |
291 | 291 | |
292 | -int get_partition_info_dos (block_dev_desc_t *dev_desc, int part, disk_partition_t * info) | |
292 | +int get_partition_info_dos(struct blk_desc *dev_desc, int part, | |
293 | + disk_partition_t *info) | |
293 | 294 | { |
294 | 295 | return get_partition_info_extended(dev_desc, 0, 0, 1, part, info, 0); |
295 | 296 | } |
disk/part_efi.c
... | ... | @@ -41,10 +41,10 @@ |
41 | 41 | |
42 | 42 | static int pmbr_part_valid(struct partition *part); |
43 | 43 | static int is_pmbr_valid(legacy_mbr * mbr); |
44 | -static int is_gpt_valid(block_dev_desc_t *dev_desc, u64 lba, | |
44 | +static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba, | |
45 | 45 | gpt_header *pgpt_head, gpt_entry **pgpt_pte); |
46 | -static gpt_entry *alloc_read_gpt_entries(block_dev_desc_t * dev_desc, | |
47 | - gpt_header * pgpt_head); | |
46 | +static gpt_entry *alloc_read_gpt_entries(struct blk_desc *dev_desc, | |
47 | + gpt_header *pgpt_head); | |
48 | 48 | static int is_pte_valid(gpt_entry * pte); |
49 | 49 | |
50 | 50 | static char *print_efiname(gpt_entry *pte) |
... | ... | @@ -176,7 +176,7 @@ |
176 | 176 | * Public Functions (include/part.h) |
177 | 177 | */ |
178 | 178 | |
179 | -void print_part_efi(block_dev_desc_t * dev_desc) | |
179 | +void print_part_efi(struct blk_desc *dev_desc) | |
180 | 180 | { |
181 | 181 | ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, dev_desc->blksz); |
182 | 182 | gpt_entry *gpt_pte = NULL; |
... | ... | @@ -237,8 +237,8 @@ |
237 | 237 | return; |
238 | 238 | } |
239 | 239 | |
240 | -int get_partition_info_efi(block_dev_desc_t * dev_desc, int part, | |
241 | - disk_partition_t * info) | |
240 | +int get_partition_info_efi(struct blk_desc *dev_desc, int part, | |
241 | + disk_partition_t *info) | |
242 | 242 | { |
243 | 243 | ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, dev_desc->blksz); |
244 | 244 | gpt_entry *gpt_pte = NULL; |
... | ... | @@ -300,7 +300,7 @@ |
300 | 300 | return 0; |
301 | 301 | } |
302 | 302 | |
303 | -int get_partition_info_efi_by_name(block_dev_desc_t *dev_desc, | |
303 | +int get_partition_info_efi_by_name(struct blk_desc *dev_desc, | |
304 | 304 | const char *name, disk_partition_t *info) |
305 | 305 | { |
306 | 306 | int ret; |
... | ... | @@ -319,7 +319,7 @@ |
319 | 319 | return -2; |
320 | 320 | } |
321 | 321 | |
322 | -int test_part_efi(block_dev_desc_t * dev_desc) | |
322 | +int test_part_efi(struct blk_desc *dev_desc) | |
323 | 323 | { |
324 | 324 | ALLOC_CACHE_ALIGN_BUFFER_PAD(legacy_mbr, legacymbr, 1, dev_desc->blksz); |
325 | 325 | |
... | ... | @@ -337,7 +337,7 @@ |
337 | 337 | * |
338 | 338 | * @return - zero on success, otherwise error |
339 | 339 | */ |
340 | -static int set_protective_mbr(block_dev_desc_t *dev_desc) | |
340 | +static int set_protective_mbr(struct blk_desc *dev_desc) | |
341 | 341 | { |
342 | 342 | /* Setup the Protective MBR */ |
343 | 343 | ALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, p_mbr, 1); |
... | ... | @@ -363,7 +363,7 @@ |
363 | 363 | return 0; |
364 | 364 | } |
365 | 365 | |
366 | -int write_gpt_table(block_dev_desc_t *dev_desc, | |
366 | +int write_gpt_table(struct blk_desc *dev_desc, | |
367 | 367 | gpt_header *gpt_h, gpt_entry *gpt_e) |
368 | 368 | { |
369 | 369 | const int pte_blk_cnt = BLOCK_CNT((gpt_h->num_partition_entries |
... | ... | @@ -517,7 +517,7 @@ |
517 | 517 | return 0; |
518 | 518 | } |
519 | 519 | |
520 | -int gpt_fill_header(block_dev_desc_t *dev_desc, gpt_header *gpt_h, | |
520 | +int gpt_fill_header(struct blk_desc *dev_desc, gpt_header *gpt_h, | |
521 | 521 | char *str_guid, int parts_count) |
522 | 522 | { |
523 | 523 | gpt_h->signature = cpu_to_le64(GPT_HEADER_SIGNATURE); |
... | ... | @@ -539,7 +539,7 @@ |
539 | 539 | return 0; |
540 | 540 | } |
541 | 541 | |
542 | -int gpt_restore(block_dev_desc_t *dev_desc, char *str_disk_guid, | |
542 | +int gpt_restore(struct blk_desc *dev_desc, char *str_disk_guid, | |
543 | 543 | disk_partition_t *partitions, int parts_count) |
544 | 544 | { |
545 | 545 | int ret; |
... | ... | @@ -595,7 +595,7 @@ |
595 | 595 | } |
596 | 596 | } |
597 | 597 | |
598 | -int gpt_verify_headers(block_dev_desc_t *dev_desc, gpt_header *gpt_head, | |
598 | +int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head, | |
599 | 599 | gpt_entry **gpt_pte) |
600 | 600 | { |
601 | 601 | /* |
... | ... | @@ -619,7 +619,7 @@ |
619 | 619 | return 0; |
620 | 620 | } |
621 | 621 | |
622 | -int gpt_verify_partitions(block_dev_desc_t *dev_desc, | |
622 | +int gpt_verify_partitions(struct blk_desc *dev_desc, | |
623 | 623 | disk_partition_t *partitions, int parts, |
624 | 624 | gpt_header *gpt_head, gpt_entry **gpt_pte) |
625 | 625 | { |
... | ... | @@ -691,7 +691,7 @@ |
691 | 691 | return 0; |
692 | 692 | } |
693 | 693 | |
694 | -int is_valid_gpt_buf(block_dev_desc_t *dev_desc, void *buf) | |
694 | +int is_valid_gpt_buf(struct blk_desc *dev_desc, void *buf) | |
695 | 695 | { |
696 | 696 | gpt_header *gpt_h; |
697 | 697 | gpt_entry *gpt_e; |
... | ... | @@ -712,7 +712,7 @@ |
712 | 712 | return 0; |
713 | 713 | } |
714 | 714 | |
715 | -int write_mbr_and_gpt_partitions(block_dev_desc_t *dev_desc, void *buf) | |
715 | +int write_mbr_and_gpt_partitions(struct blk_desc *dev_desc, void *buf) | |
716 | 716 | { |
717 | 717 | gpt_header *gpt_h; |
718 | 718 | gpt_entry *gpt_e; |
... | ... | @@ -834,7 +834,7 @@ |
834 | 834 | * Description: returns 1 if valid, 0 on error. |
835 | 835 | * If valid, returns pointers to PTEs. |
836 | 836 | */ |
837 | -static int is_gpt_valid(block_dev_desc_t *dev_desc, u64 lba, | |
837 | +static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba, | |
838 | 838 | gpt_header *pgpt_head, gpt_entry **pgpt_pte) |
839 | 839 | { |
840 | 840 | if (!dev_desc || !pgpt_head) { |
... | ... | @@ -876,8 +876,8 @@ |
876 | 876 | * Allocates space for PTEs based on information found in @gpt. |
877 | 877 | * Notes: remember to free pte when you're done! |
878 | 878 | */ |
879 | -static gpt_entry *alloc_read_gpt_entries(block_dev_desc_t * dev_desc, | |
880 | - gpt_header * pgpt_head) | |
879 | +static gpt_entry *alloc_read_gpt_entries(struct blk_desc *dev_desc, | |
880 | + gpt_header *pgpt_head) | |
881 | 881 | { |
882 | 882 | size_t count = 0, blk_cnt; |
883 | 883 | lbaint_t blk; |
disk/part_iso.c
... | ... | @@ -46,7 +46,8 @@ |
46 | 46 | |
47 | 47 | |
48 | 48 | /* only boot records will be listed as valid partitions */ |
49 | -int get_partition_info_iso_verb(block_dev_desc_t * dev_desc, int part_num, disk_partition_t * info, int verb) | |
49 | +int get_partition_info_iso_verb(struct blk_desc *dev_desc, int part_num, | |
50 | + disk_partition_t *info, int verb) | |
50 | 51 | { |
51 | 52 | int i,offset,entry_num; |
52 | 53 | unsigned short *chksumbuf; |
53 | 54 | |
... | ... | @@ -216,13 +217,14 @@ |
216 | 217 | return 0; |
217 | 218 | } |
218 | 219 | |
219 | -int get_partition_info_iso(block_dev_desc_t * dev_desc, int part_num, disk_partition_t * info) | |
220 | +int get_partition_info_iso(struct blk_desc *dev_desc, int part_num, | |
221 | + disk_partition_t *info) | |
220 | 222 | { |
221 | 223 | return(get_partition_info_iso_verb(dev_desc, part_num, info, 1)); |
222 | 224 | } |
223 | 225 | |
224 | 226 | |
225 | -void print_part_iso(block_dev_desc_t * dev_desc) | |
227 | +void print_part_iso(struct blk_desc *dev_desc) | |
226 | 228 | { |
227 | 229 | disk_partition_t info; |
228 | 230 | int i; |
... | ... | @@ -239,7 +241,7 @@ |
239 | 241 | } while (get_partition_info_iso_verb(dev_desc,i,&info,0)!=-1); |
240 | 242 | } |
241 | 243 | |
242 | -int test_part_iso (block_dev_desc_t *dev_desc) | |
244 | +int test_part_iso(struct blk_desc *dev_desc) | |
243 | 245 | { |
244 | 246 | disk_partition_t info; |
245 | 247 |
disk/part_mac.c
... | ... | @@ -32,13 +32,15 @@ |
32 | 32 | #endif |
33 | 33 | |
34 | 34 | |
35 | -static int part_mac_read_ddb (block_dev_desc_t *dev_desc, mac_driver_desc_t *ddb_p); | |
36 | -static int part_mac_read_pdb (block_dev_desc_t *dev_desc, int part, mac_partition_t *pdb_p); | |
35 | +static int part_mac_read_ddb(struct blk_desc *dev_desc, | |
36 | + mac_driver_desc_t *ddb_p); | |
37 | +static int part_mac_read_pdb(struct blk_desc *dev_desc, int part, | |
38 | + mac_partition_t *pdb_p); | |
37 | 39 | |
38 | 40 | /* |
39 | 41 | * Test for a valid MAC partition |
40 | 42 | */ |
41 | -int test_part_mac (block_dev_desc_t *dev_desc) | |
43 | +int test_part_mac(struct blk_desc *dev_desc) | |
42 | 44 | { |
43 | 45 | ALLOC_CACHE_ALIGN_BUFFER(mac_driver_desc_t, ddesc, 1); |
44 | 46 | ALLOC_CACHE_ALIGN_BUFFER(mac_partition_t, mpart, 1); |
... | ... | @@ -63,7 +65,7 @@ |
63 | 65 | } |
64 | 66 | |
65 | 67 | |
66 | -void print_part_mac (block_dev_desc_t *dev_desc) | |
68 | +void print_part_mac(struct blk_desc *dev_desc) | |
67 | 69 | { |
68 | 70 | ulong i, n; |
69 | 71 | ALLOC_CACHE_ALIGN_BUFFER(mac_driver_desc_t, ddesc, 1); |
... | ... | @@ -149,7 +151,8 @@ |
149 | 151 | /* |
150 | 152 | * Read Device Descriptor Block |
151 | 153 | */ |
152 | -static int part_mac_read_ddb (block_dev_desc_t *dev_desc, mac_driver_desc_t *ddb_p) | |
154 | +static int part_mac_read_ddb(struct blk_desc *dev_desc, | |
155 | + mac_driver_desc_t *ddb_p) | |
153 | 156 | { |
154 | 157 | if (dev_desc->block_read(dev_desc, 0, 1, (ulong *)ddb_p) != 1) { |
155 | 158 | printf ("** Can't read Driver Desriptor Block **\n"); |
... | ... | @@ -169,7 +172,8 @@ |
169 | 172 | /* |
170 | 173 | * Read Partition Descriptor Block |
171 | 174 | */ |
172 | -static int part_mac_read_pdb (block_dev_desc_t *dev_desc, int part, mac_partition_t *pdb_p) | |
175 | +static int part_mac_read_pdb(struct blk_desc *dev_desc, int part, | |
176 | + mac_partition_t *pdb_p) | |
173 | 177 | { |
174 | 178 | int n = 1; |
175 | 179 | |
... | ... | @@ -210,7 +214,8 @@ |
210 | 214 | /* NOTREACHED */ |
211 | 215 | } |
212 | 216 | |
213 | -int get_partition_info_mac (block_dev_desc_t *dev_desc, int part, disk_partition_t *info) | |
217 | +int get_partition_info_mac(struct blk_desc *dev_desc, int part, | |
218 | + disk_partition_t *info) | |
214 | 219 | { |
215 | 220 | ALLOC_CACHE_ALIGN_BUFFER(mac_driver_desc_t, ddesc, 1); |
216 | 221 | ALLOC_CACHE_ALIGN_BUFFER(mac_partition_t, mpart, 1); |
drivers/block/dwc_ahsata.c
... | ... | @@ -620,7 +620,7 @@ |
620 | 620 | |
621 | 621 | static void dwc_ahsata_print_info(int dev) |
622 | 622 | { |
623 | - block_dev_desc_t *pdev = &(sata_dev_desc[dev]); | |
623 | + struct blk_desc *pdev = &(sata_dev_desc[dev]); | |
624 | 624 | |
625 | 625 | printf("SATA Device Info:\n\r"); |
626 | 626 | #ifdef CONFIG_SYS_64BIT_LBA |
... | ... | @@ -956,7 +956,7 @@ |
956 | 956 | struct ahci_probe_ent *probe_ent = |
957 | 957 | (struct ahci_probe_ent *)sata_dev_desc[dev].priv; |
958 | 958 | u8 port = probe_ent->hard_port_no; |
959 | - block_dev_desc_t *pdev = &(sata_dev_desc[dev]); | |
959 | + struct blk_desc *pdev = &(sata_dev_desc[dev]); | |
960 | 960 | |
961 | 961 | id = (u16 *)memalign(ARCH_DMA_MINALIGN, |
962 | 962 | roundup(ARCH_DMA_MINALIGN, |
drivers/block/sandbox.c
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 | return NULL; |
23 | 23 | } |
24 | 24 | |
25 | -static unsigned long host_block_read(block_dev_desc_t *block_dev, | |
25 | +static unsigned long host_block_read(struct blk_desc *block_dev, | |
26 | 26 | unsigned long start, lbaint_t blkcnt, |
27 | 27 | void *buffer) |
28 | 28 | { |
... | ... | @@ -44,7 +44,7 @@ |
44 | 44 | return -1; |
45 | 45 | } |
46 | 46 | |
47 | -static unsigned long host_block_write(block_dev_desc_t *block_dev, | |
47 | +static unsigned long host_block_write(struct blk_desc *block_dev, | |
48 | 48 | unsigned long start, lbaint_t blkcnt, |
49 | 49 | const void *buffer) |
50 | 50 | { |
... | ... | @@ -89,7 +89,7 @@ |
89 | 89 | return 1; |
90 | 90 | } |
91 | 91 | |
92 | - block_dev_desc_t *blk_dev = &host_dev->blk_dev; | |
92 | + struct blk_desc *blk_dev = &host_dev->blk_dev; | |
93 | 93 | blk_dev->if_type = IF_TYPE_HOST; |
94 | 94 | blk_dev->priv = host_dev; |
95 | 95 | blk_dev->blksz = 512; |
... | ... | @@ -103,7 +103,7 @@ |
103 | 103 | return 0; |
104 | 104 | } |
105 | 105 | |
106 | -int host_get_dev_err(int dev, block_dev_desc_t **blk_devp) | |
106 | +int host_get_dev_err(int dev, struct blk_desc **blk_devp) | |
107 | 107 | { |
108 | 108 | struct host_block_dev *host_dev = find_host_device(dev); |
109 | 109 | |
110 | 110 | |
... | ... | @@ -117,9 +117,9 @@ |
117 | 117 | return 0; |
118 | 118 | } |
119 | 119 | |
120 | -block_dev_desc_t *host_get_dev(int dev) | |
120 | +struct blk_desc *host_get_dev(int dev) | |
121 | 121 | { |
122 | - block_dev_desc_t *blk_dev; | |
122 | + struct blk_desc *blk_dev; | |
123 | 123 | |
124 | 124 | if (host_get_dev_err(dev, &blk_dev)) |
125 | 125 | return NULL; |
drivers/block/systemace.c
... | ... | @@ -69,11 +69,11 @@ |
69 | 69 | return in16(base + off); |
70 | 70 | } |
71 | 71 | |
72 | -static unsigned long systemace_read(block_dev_desc_t *block_dev, | |
72 | +static unsigned long systemace_read(struct blk_desc *block_dev, | |
73 | 73 | unsigned long start, lbaint_t blkcnt, |
74 | 74 | void *buffer); |
75 | 75 | |
76 | -static block_dev_desc_t systemace_dev = { 0 }; | |
76 | +static struct blk_desc systemace_dev = { 0 }; | |
77 | 77 | |
78 | 78 | static int get_cf_lock(void) |
79 | 79 | { |
... | ... | @@ -105,7 +105,7 @@ |
105 | 105 | } |
106 | 106 | |
107 | 107 | #ifdef CONFIG_PARTITIONS |
108 | -block_dev_desc_t *systemace_get_dev(int dev) | |
108 | +struct blk_desc *systemace_get_dev(int dev) | |
109 | 109 | { |
110 | 110 | /* The first time through this, the systemace_dev object is |
111 | 111 | not yet initialized. In that case, fill it in. */ |
... | ... | @@ -137,7 +137,7 @@ |
137 | 137 | * the dev_desc) to read blocks of data. The return value is the |
138 | 138 | * number of blocks read. A zero return indicates an error. |
139 | 139 | */ |
140 | -static unsigned long systemace_read(block_dev_desc_t *block_dev, | |
140 | +static unsigned long systemace_read(struct blk_desc *block_dev, | |
141 | 141 | unsigned long start, lbaint_t blkcnt, |
142 | 142 | void *buffer) |
143 | 143 | { |
drivers/dfu/dfu_mmc.c
drivers/mmc/mmc.c
... | ... | @@ -234,7 +234,7 @@ |
234 | 234 | return blkcnt; |
235 | 235 | } |
236 | 236 | |
237 | -static ulong mmc_bread(block_dev_desc_t *block_dev, lbaint_t start, | |
237 | +static ulong mmc_bread(struct blk_desc *block_dev, lbaint_t start, | |
238 | 238 | lbaint_t blkcnt, void *dst) |
239 | 239 | { |
240 | 240 | int dev_num = block_dev->dev; |
... | ... | @@ -1579,7 +1579,7 @@ |
1579 | 1579 | } |
1580 | 1580 | |
1581 | 1581 | #ifdef CONFIG_PARTITIONS |
1582 | -block_dev_desc_t *mmc_get_dev(int dev) | |
1582 | +struct blk_desc *mmc_get_dev(int dev) | |
1583 | 1583 | { |
1584 | 1584 | struct mmc *mmc = find_mmc_device(dev); |
1585 | 1585 | if (!mmc || mmc_init(mmc)) |
drivers/mmc/mmc_private.h
... | ... | @@ -22,23 +22,23 @@ |
22 | 22 | |
23 | 23 | #ifndef CONFIG_SPL_BUILD |
24 | 24 | |
25 | -unsigned long mmc_berase(block_dev_desc_t *block_dev, lbaint_t start, | |
25 | +unsigned long mmc_berase(struct blk_desc *block_dev, lbaint_t start, | |
26 | 26 | lbaint_t blkcnt); |
27 | 27 | |
28 | -unsigned long mmc_bwrite(block_dev_desc_t *block_dev, lbaint_t start, | |
28 | +unsigned long mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, | |
29 | 29 | lbaint_t blkcnt, const void *src); |
30 | 30 | |
31 | 31 | #else /* CONFIG_SPL_BUILD */ |
32 | 32 | |
33 | 33 | /* SPL will never write or erase, declare dummies to reduce code size. */ |
34 | 34 | |
35 | -static inline unsigned long mmc_berase(block_dev_desc_t *block_dev, | |
35 | +static inline unsigned long mmc_berase(struct blk_desc *block_dev, | |
36 | 36 | lbaint_t start, lbaint_t blkcnt) |
37 | 37 | { |
38 | 38 | return 0; |
39 | 39 | } |
40 | 40 | |
41 | -static inline ulong mmc_bwrite(block_dev_desc_t *block_dev, lbaint_t start, | |
41 | +static inline ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, | |
42 | 42 | lbaint_t blkcnt, const void *src) |
43 | 43 | { |
44 | 44 | return 0; |
drivers/mmc/mmc_write.c
... | ... | @@ -65,7 +65,7 @@ |
65 | 65 | return err; |
66 | 66 | } |
67 | 67 | |
68 | -unsigned long mmc_berase(block_dev_desc_t *block_dev, lbaint_t start, | |
68 | +unsigned long mmc_berase(struct blk_desc *block_dev, lbaint_t start, | |
69 | 69 | lbaint_t blkcnt) |
70 | 70 | { |
71 | 71 | int dev_num = block_dev->dev; |
... | ... | @@ -171,7 +171,7 @@ |
171 | 171 | return blkcnt; |
172 | 172 | } |
173 | 173 | |
174 | -ulong mmc_bwrite(block_dev_desc_t *block_dev, lbaint_t start, lbaint_t blkcnt, | |
174 | +ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt, | |
175 | 175 | const void *src) |
176 | 176 | { |
177 | 177 | int dev_num = block_dev->dev; |
fs/ext4/dev.c
... | ... | @@ -32,13 +32,13 @@ |
32 | 32 | |
33 | 33 | lbaint_t part_offset; |
34 | 34 | |
35 | -static block_dev_desc_t *ext4fs_block_dev_desc; | |
35 | +static struct blk_desc *ext4fs_blk_desc; | |
36 | 36 | static disk_partition_t *part_info; |
37 | 37 | |
38 | -void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info) | |
38 | +void ext4fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info) | |
39 | 39 | { |
40 | 40 | assert(rbdd->blksz == (1 << rbdd->log2blksz)); |
41 | - ext4fs_block_dev_desc = rbdd; | |
41 | + ext4fs_blk_desc = rbdd; | |
42 | 42 | get_fs()->dev_desc = rbdd; |
43 | 43 | part_info = info; |
44 | 44 | part_offset = info->start; |
45 | 45 | |
... | ... | @@ -49,11 +49,11 @@ |
49 | 49 | int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf) |
50 | 50 | { |
51 | 51 | unsigned block_len; |
52 | - int log2blksz = ext4fs_block_dev_desc->log2blksz; | |
53 | - ALLOC_CACHE_ALIGN_BUFFER(char, sec_buf, (ext4fs_block_dev_desc ? | |
54 | - ext4fs_block_dev_desc->blksz : | |
52 | + int log2blksz = ext4fs_blk_desc->log2blksz; | |
53 | + ALLOC_CACHE_ALIGN_BUFFER(char, sec_buf, (ext4fs_blk_desc ? | |
54 | + ext4fs_blk_desc->blksz : | |
55 | 55 | 0)); |
56 | - if (ext4fs_block_dev_desc == NULL) { | |
56 | + if (ext4fs_blk_desc == NULL) { | |
57 | 57 | printf("** Invalid Block Device Descriptor (NULL)\n"); |
58 | 58 | return 0; |
59 | 59 | } |
60 | 60 | |
61 | 61 | |
... | ... | @@ -69,21 +69,20 @@ |
69 | 69 | |
70 | 70 | /* Get the read to the beginning of a partition */ |
71 | 71 | sector += byte_offset >> log2blksz; |
72 | - byte_offset &= ext4fs_block_dev_desc->blksz - 1; | |
72 | + byte_offset &= ext4fs_blk_desc->blksz - 1; | |
73 | 73 | |
74 | 74 | debug(" <" LBAFU ", %d, %d>\n", sector, byte_offset, byte_len); |
75 | 75 | |
76 | 76 | if (byte_offset != 0) { |
77 | 77 | int readlen; |
78 | 78 | /* read first part which isn't aligned with start of sector */ |
79 | - if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc, | |
80 | - part_info->start + sector, | |
81 | - 1, (void *)sec_buf) | |
82 | - != 1) { | |
79 | + if (ext4fs_blk_desc->block_read(ext4fs_blk_desc, | |
80 | + part_info->start + sector, | |
81 | + 1, (void *)sec_buf) != 1) { | |
83 | 82 | printf(" ** ext2fs_devread() read error **\n"); |
84 | 83 | return 0; |
85 | 84 | } |
86 | - readlen = min((int)ext4fs_block_dev_desc->blksz - byte_offset, | |
85 | + readlen = min((int)ext4fs_blk_desc->blksz - byte_offset, | |
87 | 86 | byte_len); |
88 | 87 | memcpy(buf, sec_buf + byte_offset, readlen); |
89 | 88 | buf += readlen; |
90 | 89 | |
91 | 90 | |
92 | 91 | |
93 | 92 | |
94 | 93 | |
95 | 94 | |
... | ... | @@ -95,38 +94,36 @@ |
95 | 94 | return 1; |
96 | 95 | |
97 | 96 | /* read sector aligned part */ |
98 | - block_len = byte_len & ~(ext4fs_block_dev_desc->blksz - 1); | |
97 | + block_len = byte_len & ~(ext4fs_blk_desc->blksz - 1); | |
99 | 98 | |
100 | 99 | if (block_len == 0) { |
101 | - ALLOC_CACHE_ALIGN_BUFFER(u8, p, ext4fs_block_dev_desc->blksz); | |
100 | + ALLOC_CACHE_ALIGN_BUFFER(u8, p, ext4fs_blk_desc->blksz); | |
102 | 101 | |
103 | - block_len = ext4fs_block_dev_desc->blksz; | |
104 | - ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc, | |
102 | + block_len = ext4fs_blk_desc->blksz; | |
103 | + ext4fs_blk_desc->block_read(ext4fs_blk_desc, | |
105 | 104 | part_info->start + sector, |
106 | 105 | 1, (void *)p); |
107 | 106 | memcpy(buf, p, byte_len); |
108 | 107 | return 1; |
109 | 108 | } |
110 | 109 | |
111 | - if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc, | |
112 | - part_info->start + sector, | |
113 | - block_len >> log2blksz, | |
114 | - (void *)buf) != | |
115 | - block_len >> log2blksz) { | |
110 | + if (ext4fs_blk_desc->block_read(ext4fs_blk_desc, | |
111 | + part_info->start + sector, | |
112 | + block_len >> log2blksz, (void *)buf) | |
113 | + != block_len >> log2blksz) { | |
116 | 114 | printf(" ** %s read error - block\n", __func__); |
117 | 115 | return 0; |
118 | 116 | } |
119 | - block_len = byte_len & ~(ext4fs_block_dev_desc->blksz - 1); | |
117 | + block_len = byte_len & ~(ext4fs_blk_desc->blksz - 1); | |
120 | 118 | buf += block_len; |
121 | 119 | byte_len -= block_len; |
122 | - sector += block_len / ext4fs_block_dev_desc->blksz; | |
120 | + sector += block_len / ext4fs_blk_desc->blksz; | |
123 | 121 | |
124 | 122 | if (byte_len != 0) { |
125 | 123 | /* read rest of data which are not in whole sector */ |
126 | - if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc, | |
127 | - part_info->start + sector, | |
128 | - 1, (void *)sec_buf) | |
129 | - != 1) { | |
124 | + if (ext4fs_blk_desc->block_read(ext4fs_blk_desc, | |
125 | + part_info->start + sector, | |
126 | + 1, (void *)sec_buf) != 1) { | |
130 | 127 | printf("* %s read error - last part\n", __func__); |
131 | 128 | return 0; |
132 | 129 | } |
fs/ext4/ext4fs.c
... | ... | @@ -198,7 +198,7 @@ |
198 | 198 | return ext4fs_read_file(ext4fs_file, 0, len, buf, actread); |
199 | 199 | } |
200 | 200 | |
201 | -int ext4fs_probe(block_dev_desc_t *fs_dev_desc, | |
201 | +int ext4fs_probe(struct blk_desc *fs_dev_desc, | |
202 | 202 | disk_partition_t *fs_partition) |
203 | 203 | { |
204 | 204 | ext4fs_set_blk_dev(fs_dev_desc, fs_partition); |
fs/fat/fat.c
... | ... | @@ -37,7 +37,7 @@ |
37 | 37 | } |
38 | 38 | } |
39 | 39 | |
40 | -static block_dev_desc_t *cur_dev; | |
40 | +static struct blk_desc *cur_dev; | |
41 | 41 | static disk_partition_t cur_part_info; |
42 | 42 | |
43 | 43 | #define DOS_BOOT_MAGIC_OFFSET 0x1fe |
... | ... | @@ -60,7 +60,7 @@ |
60 | 60 | return ret; |
61 | 61 | } |
62 | 62 | |
63 | -int fat_set_blk_dev(block_dev_desc_t *dev_desc, disk_partition_t *info) | |
63 | +int fat_set_blk_dev(struct blk_desc *dev_desc, disk_partition_t *info) | |
64 | 64 | { |
65 | 65 | ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz); |
66 | 66 | |
... | ... | @@ -89,7 +89,7 @@ |
89 | 89 | return -1; |
90 | 90 | } |
91 | 91 | |
92 | -int fat_register_device(block_dev_desc_t *dev_desc, int part_no) | |
92 | +int fat_register_device(struct blk_desc *dev_desc, int part_no) | |
93 | 93 | { |
94 | 94 | disk_partition_t info; |
95 | 95 |
fs/fs.c
... | ... | @@ -20,11 +20,11 @@ |
20 | 20 | |
21 | 21 | DECLARE_GLOBAL_DATA_PTR; |
22 | 22 | |
23 | -static block_dev_desc_t *fs_dev_desc; | |
23 | +static struct blk_desc *fs_dev_desc; | |
24 | 24 | static disk_partition_t fs_partition; |
25 | 25 | static int fs_type = FS_TYPE_ANY; |
26 | 26 | |
27 | -static inline int fs_probe_unsupported(block_dev_desc_t *fs_dev_desc, | |
27 | +static inline int fs_probe_unsupported(struct blk_desc *fs_dev_desc, | |
28 | 28 | disk_partition_t *fs_partition) |
29 | 29 | { |
30 | 30 | printf("** Unrecognized filesystem type **\n"); |
... | ... | @@ -81,7 +81,7 @@ |
81 | 81 | * filesystem. |
82 | 82 | */ |
83 | 83 | bool null_dev_desc_ok; |
84 | - int (*probe)(block_dev_desc_t *fs_dev_desc, | |
84 | + int (*probe)(struct blk_desc *fs_dev_desc, | |
85 | 85 | disk_partition_t *fs_partition); |
86 | 86 | int (*ls)(const char *dirname); |
87 | 87 | int (*exists)(const char *filename); |
fs/reiserfs/dev.c
... | ... | @@ -12,13 +12,13 @@ |
12 | 12 | |
13 | 13 | #include "reiserfs_private.h" |
14 | 14 | |
15 | -static block_dev_desc_t *reiserfs_block_dev_desc; | |
15 | +static struct blk_desc *reiserfs_blk_desc; | |
16 | 16 | static disk_partition_t *part_info; |
17 | 17 | |
18 | 18 | |
19 | -void reiserfs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info) | |
19 | +void reiserfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info) | |
20 | 20 | { |
21 | - reiserfs_block_dev_desc = rbdd; | |
21 | + reiserfs_blk_desc = rbdd; | |
22 | 22 | part_info = info; |
23 | 23 | } |
24 | 24 | |
25 | 25 | |
... | ... | @@ -53,17 +53,15 @@ |
53 | 53 | #endif |
54 | 54 | |
55 | 55 | |
56 | - if (reiserfs_block_dev_desc == NULL) | |
56 | + if (reiserfs_blk_desc == NULL) | |
57 | 57 | return 0; |
58 | 58 | |
59 | 59 | |
60 | 60 | if (byte_offset != 0) { |
61 | 61 | /* read first part which isn't aligned with start of sector */ |
62 | - if (reiserfs_block_dev_desc->block_read(reiserfs_block_dev_desc, | |
63 | - part_info->start + | |
64 | - sector, | |
65 | - 1, (void *)sec_buf) | |
66 | - != 1) { | |
62 | + if (reiserfs_blk_desc->block_read(reiserfs_blk_desc, | |
63 | + part_info->start + sector, | |
64 | + 1, (void *)sec_buf) != 1) { | |
67 | 65 | printf (" ** reiserfs_devread() read error\n"); |
68 | 66 | return 0; |
69 | 67 | } |
... | ... | @@ -75,11 +73,10 @@ |
75 | 73 | |
76 | 74 | /* read sector aligned part */ |
77 | 75 | block_len = byte_len & ~(SECTOR_SIZE-1); |
78 | - if (reiserfs_block_dev_desc->block_read(reiserfs_block_dev_desc, | |
79 | - part_info->start + sector, | |
80 | - block_len / SECTOR_SIZE, | |
81 | - (void *)buf) | |
82 | - != block_len/SECTOR_SIZE) { | |
76 | + if (reiserfs_blk_desc->block_read(reiserfs_blk_desc, | |
77 | + part_info->start + sector, | |
78 | + block_len / SECTOR_SIZE, (void *)buf) | |
79 | + != block_len/SECTOR_SIZE) { | |
83 | 80 | printf (" ** reiserfs_devread() read error - block\n"); |
84 | 81 | return 0; |
85 | 82 | } |
... | ... | @@ -89,11 +86,9 @@ |
89 | 86 | |
90 | 87 | if ( byte_len != 0 ) { |
91 | 88 | /* read rest of data which are not in whole sector */ |
92 | - if (reiserfs_block_dev_desc->block_read(reiserfs_block_dev_desc, | |
93 | - part_info->start + | |
94 | - sector, | |
95 | - 1, (void *)sec_buf) | |
96 | - != 1) { | |
89 | + if (reiserfs_blk_desc->block_read(reiserfs_blk_desc, | |
90 | + part_info->start + sector, | |
91 | + 1, (void *)sec_buf) != 1) { | |
97 | 92 | printf (" ** reiserfs_devread() read error - last part\n"); |
98 | 93 | return 0; |
99 | 94 | } |
fs/sandbox/sandboxfs.c
... | ... | @@ -8,10 +8,10 @@ |
8 | 8 | #include <fs.h> |
9 | 9 | #include <os.h> |
10 | 10 | |
11 | -int sandbox_fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info) | |
11 | +int sandbox_fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info) | |
12 | 12 | { |
13 | 13 | /* |
14 | - * Only accept a NULL block_dev_desc_t for the sandbox, which is when | |
14 | + * Only accept a NULL struct blk_desc for the sandbox, which is when | |
15 | 15 | * hostfs interface is used |
16 | 16 | */ |
17 | 17 | return rbdd != NULL; |
fs/ubifs/ubifs.c
... | ... | @@ -561,7 +561,7 @@ |
561 | 561 | return 0; |
562 | 562 | } |
563 | 563 | |
564 | -int ubifs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info) | |
564 | +int ubifs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info) | |
565 | 565 | { |
566 | 566 | if (rbdd) { |
567 | 567 | debug("UBIFS cannot be used with normal block devices\n"); |
fs/zfs/dev.c
... | ... | @@ -13,12 +13,12 @@ |
13 | 13 | #include <config.h> |
14 | 14 | #include <zfs_common.h> |
15 | 15 | |
16 | -static block_dev_desc_t *zfs_block_dev_desc; | |
16 | +static struct blk_desc *zfs_blk_desc; | |
17 | 17 | static disk_partition_t *part_info; |
18 | 18 | |
19 | -void zfs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info) | |
19 | +void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info) | |
20 | 20 | { |
21 | - zfs_block_dev_desc = rbdd; | |
21 | + zfs_blk_desc = rbdd; | |
22 | 22 | part_info = info; |
23 | 23 | } |
24 | 24 | |
25 | 25 | |
... | ... | @@ -48,17 +48,16 @@ |
48 | 48 | |
49 | 49 | debug(" <%d, %d, %d>\n", sector, byte_offset, byte_len); |
50 | 50 | |
51 | - if (zfs_block_dev_desc == NULL) { | |
51 | + if (zfs_blk_desc == NULL) { | |
52 | 52 | printf("** Invalid Block Device Descriptor (NULL)\n"); |
53 | 53 | return 1; |
54 | 54 | } |
55 | 55 | |
56 | 56 | if (byte_offset != 0) { |
57 | 57 | /* read first part which isn't aligned with start of sector */ |
58 | - if (zfs_block_dev_desc->block_read(zfs_block_dev_desc, | |
59 | - part_info->start + sector, 1, | |
60 | - (void *)sec_buf) | |
61 | - != 1) { | |
58 | + if (zfs_blk_desc->block_read(zfs_blk_desc, | |
59 | + part_info->start + sector, 1, | |
60 | + (void *)sec_buf) != 1) { | |
62 | 61 | printf(" ** zfs_devread() read error **\n"); |
63 | 62 | return 1; |
64 | 63 | } |
65 | 64 | |
... | ... | @@ -79,18 +78,16 @@ |
79 | 78 | u8 p[SECTOR_SIZE]; |
80 | 79 | |
81 | 80 | block_len = SECTOR_SIZE; |
82 | - zfs_block_dev_desc->block_read(zfs_block_dev_desc, | |
83 | - part_info->start + sector, | |
84 | - 1, (void *)p); | |
81 | + zfs_blk_desc->block_read(zfs_blk_desc, | |
82 | + part_info->start + sector, | |
83 | + 1, (void *)p); | |
85 | 84 | memcpy(buf, p, byte_len); |
86 | 85 | return 0; |
87 | 86 | } |
88 | 87 | |
89 | - if (zfs_block_dev_desc->block_read(zfs_block_dev_desc, | |
90 | - part_info->start + sector, | |
91 | - block_len / SECTOR_SIZE, | |
92 | - (void *)buf) | |
93 | - != block_len / SECTOR_SIZE) { | |
88 | + if (zfs_blk_desc->block_read(zfs_blk_desc, part_info->start + sector, | |
89 | + block_len / SECTOR_SIZE, | |
90 | + (void *)buf) != block_len / SECTOR_SIZE) { | |
94 | 91 | printf(" ** zfs_devread() read error - block\n"); |
95 | 92 | return 1; |
96 | 93 | } |
... | ... | @@ -102,9 +99,9 @@ |
102 | 99 | |
103 | 100 | if (byte_len != 0) { |
104 | 101 | /* read rest of data which are not in whole sector */ |
105 | - if (zfs_block_dev_desc->block_read(zfs_block_dev_desc, | |
106 | - part_info->start + sector, | |
107 | - 1, (void *)sec_buf) != 1) { | |
102 | + if (zfs_blk_desc->block_read(zfs_blk_desc, | |
103 | + part_info->start + sector, | |
104 | + 1, (void *)sec_buf) != 1) { | |
108 | 105 | printf(" ** zfs_devread() read error - last part\n"); |
109 | 106 | return 1; |
110 | 107 | } |
fs/zfs/zfs.c
include/common.h
include/ext4fs.h
... | ... | @@ -110,7 +110,7 @@ |
110 | 110 | /* Journal Related */ |
111 | 111 | |
112 | 112 | /* Block Device Descriptor */ |
113 | - block_dev_desc_t *dev_desc; | |
113 | + struct blk_desc *dev_desc; | |
114 | 114 | }; |
115 | 115 | |
116 | 116 | extern struct ext2_data *ext4fs_root; |
117 | 117 | |
... | ... | @@ -141,9 +141,9 @@ |
141 | 141 | int ext4fs_size(const char *filename, loff_t *size); |
142 | 142 | void ext4fs_free_node(struct ext2fs_node *node, struct ext2fs_node *currroot); |
143 | 143 | int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf); |
144 | -void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info); | |
144 | +void ext4fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info); | |
145 | 145 | long int read_allocated_block(struct ext2_inode *inode, int fileblock); |
146 | -int ext4fs_probe(block_dev_desc_t *fs_dev_desc, | |
146 | +int ext4fs_probe(struct blk_desc *fs_dev_desc, | |
147 | 147 | disk_partition_t *fs_partition); |
148 | 148 | int ext4_read_file(const char *filename, void *buf, loff_t offset, loff_t len, |
149 | 149 | loff_t *actread); |
include/fat.h
... | ... | @@ -203,8 +203,8 @@ |
203 | 203 | loff_t maxsize, loff_t *actread); |
204 | 204 | int file_fat_read(const char *filename, void *buffer, int maxsize); |
205 | 205 | const char *file_getfsname(int idx); |
206 | -int fat_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info); | |
207 | -int fat_register_device(block_dev_desc_t *dev_desc, int part_no); | |
206 | +int fat_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info); | |
207 | +int fat_register_device(struct blk_desc *dev_desc, int part_no); | |
208 | 208 | |
209 | 209 | int file_fat_write(const char *filename, void *buf, loff_t offset, loff_t len, |
210 | 210 | loff_t *actwrite); |
include/ide.h
... | ... | @@ -41,10 +41,10 @@ |
41 | 41 | */ |
42 | 42 | |
43 | 43 | void ide_init(void); |
44 | -typedef struct block_dev_desc block_dev_desc_t; | |
45 | -ulong ide_read(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt, | |
44 | +struct blk_desc; | |
45 | +ulong ide_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt, | |
46 | 46 | void *buffer); |
47 | -ulong ide_write(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt, | |
47 | +ulong ide_write(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt, | |
48 | 48 | const void *buffer); |
49 | 49 | |
50 | 50 | #ifdef CONFIG_IDE_PREINIT |
include/mmc.h
... | ... | @@ -376,7 +376,7 @@ |
376 | 376 | u64 capacity_gp[4]; |
377 | 377 | u64 enh_user_start; |
378 | 378 | u64 enh_user_size; |
379 | - block_dev_desc_t block_dev; | |
379 | + struct blk_desc block_dev; | |
380 | 380 | char op_cond_pending; /* 1 if we are waiting on an op_cond command */ |
381 | 381 | char init_in_progress; /* 1 if we have done mmc_start_init() */ |
382 | 382 | char preinit; /* start init as early as possible */ |
include/part.h
... | ... | @@ -10,7 +10,7 @@ |
10 | 10 | #include <ide.h> |
11 | 11 | #include <common.h> |
12 | 12 | |
13 | -struct block_dev_desc { | |
13 | +struct blk_desc { | |
14 | 14 | int if_type; /* type of the interface */ |
15 | 15 | int dev; /* device number */ |
16 | 16 | unsigned char part_type; /* partition type */ |
17 | 17 | |
18 | 18 | |
19 | 19 | |
... | ... | @@ -28,23 +28,23 @@ |
28 | 28 | char vendor [40+1]; /* IDE model, SCSI Vendor */ |
29 | 29 | char product[20+1]; /* IDE Serial no, SCSI product */ |
30 | 30 | char revision[8+1]; /* firmware revision */ |
31 | - unsigned long (*block_read)(block_dev_desc_t *block_dev, | |
31 | + unsigned long (*block_read)(struct blk_desc *block_dev, | |
32 | 32 | lbaint_t start, |
33 | 33 | lbaint_t blkcnt, |
34 | 34 | void *buffer); |
35 | - unsigned long (*block_write)(block_dev_desc_t *block_dev, | |
35 | + unsigned long (*block_write)(struct blk_desc *block_dev, | |
36 | 36 | lbaint_t start, |
37 | 37 | lbaint_t blkcnt, |
38 | 38 | const void *buffer); |
39 | - unsigned long (*block_erase)(block_dev_desc_t *block_dev, | |
39 | + unsigned long (*block_erase)(struct blk_desc *block_dev, | |
40 | 40 | lbaint_t start, |
41 | 41 | lbaint_t blkcnt); |
42 | 42 | void *priv; /* driver private struct pointer */ |
43 | 43 | }; |
44 | 44 | |
45 | -#define BLOCK_CNT(size, block_dev_desc) (PAD_COUNT(size, block_dev_desc->blksz)) | |
46 | -#define PAD_TO_BLOCKSIZE(size, block_dev_desc) \ | |
47 | - (PAD_SIZE(size, block_dev_desc->blksz)) | |
45 | +#define BLOCK_CNT(size, blk_desc) (PAD_COUNT(size, blk_desc->blksz)) | |
46 | +#define PAD_TO_BLOCKSIZE(size, blk_desc) \ | |
47 | + (PAD_SIZE(size, blk_desc->blksz)) | |
48 | 48 | #define LOG2(x) (((x & 0xaaaaaaaa) ? 1 : 0) + ((x & 0xcccccccc) ? 2 : 0) + \ |
49 | 49 | ((x & 0xf0f0f0f0) ? 4 : 0) + ((x & 0xff00ff00) ? 8 : 0) + \ |
50 | 50 | ((x & 0xffff0000) ? 16 : 0)) |
51 | 51 | |
52 | 52 | |
53 | 53 | |
54 | 54 | |
55 | 55 | |
56 | 56 | |
57 | 57 | |
58 | 58 | |
59 | 59 | |
60 | 60 | |
... | ... | @@ -101,52 +101,53 @@ |
101 | 101 | |
102 | 102 | /* Misc _get_dev functions */ |
103 | 103 | #ifdef CONFIG_PARTITIONS |
104 | -block_dev_desc_t *get_dev(const char *ifname, int dev); | |
105 | -block_dev_desc_t* ide_get_dev(int dev); | |
106 | -block_dev_desc_t* sata_get_dev(int dev); | |
107 | -block_dev_desc_t* scsi_get_dev(int dev); | |
108 | -block_dev_desc_t* usb_stor_get_dev(int dev); | |
109 | -block_dev_desc_t* mmc_get_dev(int dev); | |
104 | +struct blk_desc *get_dev(const char *ifname, int dev); | |
105 | +struct blk_desc *ide_get_dev(int dev); | |
106 | +struct blk_desc *sata_get_dev(int dev); | |
107 | +struct blk_desc *scsi_get_dev(int dev); | |
108 | +struct blk_desc *usb_stor_get_dev(int dev); | |
109 | +struct blk_desc *mmc_get_dev(int dev); | |
110 | 110 | int mmc_select_hwpart(int dev_num, int hwpart); |
111 | -block_dev_desc_t* systemace_get_dev(int dev); | |
112 | -block_dev_desc_t* mg_disk_get_dev(int dev); | |
113 | -block_dev_desc_t *host_get_dev(int dev); | |
114 | -int host_get_dev_err(int dev, block_dev_desc_t **blk_devp); | |
111 | +struct blk_desc *systemace_get_dev(int dev); | |
112 | +struct blk_desc *mg_disk_get_dev(int dev); | |
113 | +struct blk_desc *host_get_dev(int dev); | |
114 | +int host_get_dev_err(int dev, struct blk_desc **blk_devp); | |
115 | 115 | |
116 | 116 | /* disk/part.c */ |
117 | -int get_partition_info (block_dev_desc_t * dev_desc, int part, disk_partition_t *info); | |
118 | -void print_part (block_dev_desc_t *dev_desc); | |
119 | -void init_part (block_dev_desc_t *dev_desc); | |
120 | -void dev_print(block_dev_desc_t *dev_desc); | |
117 | +int get_partition_info(struct blk_desc *dev_desc, int part, | |
118 | + disk_partition_t *info); | |
119 | +void print_part(struct blk_desc *dev_desc); | |
120 | +void init_part(struct blk_desc *dev_desc); | |
121 | +void dev_print(struct blk_desc *dev_desc); | |
121 | 122 | int get_device(const char *ifname, const char *dev_str, |
122 | - block_dev_desc_t **dev_desc); | |
123 | + struct blk_desc **dev_desc); | |
123 | 124 | int get_device_and_partition(const char *ifname, const char *dev_part_str, |
124 | - block_dev_desc_t **dev_desc, | |
125 | + struct blk_desc **dev_desc, | |
125 | 126 | disk_partition_t *info, int allow_whole_dev); |
126 | 127 | #else |
127 | -static inline block_dev_desc_t *get_dev(const char *ifname, int dev) | |
128 | +static inline struct blk_desc *get_dev(const char *ifname, int dev) | |
128 | 129 | { return NULL; } |
129 | -static inline block_dev_desc_t* ide_get_dev(int dev) { return NULL; } | |
130 | -static inline block_dev_desc_t* sata_get_dev(int dev) { return NULL; } | |
131 | -static inline block_dev_desc_t* scsi_get_dev(int dev) { return NULL; } | |
132 | -static inline block_dev_desc_t* usb_stor_get_dev(int dev) { return NULL; } | |
133 | -static inline block_dev_desc_t* mmc_get_dev(int dev) { return NULL; } | |
130 | +static inline struct blk_desc *ide_get_dev(int dev) { return NULL; } | |
131 | +static inline struct blk_desc *sata_get_dev(int dev) { return NULL; } | |
132 | +static inline struct blk_desc *scsi_get_dev(int dev) { return NULL; } | |
133 | +static inline struct blk_desc *usb_stor_get_dev(int dev) { return NULL; } | |
134 | +static inline struct blk_desc *mmc_get_dev(int dev) { return NULL; } | |
134 | 135 | static inline int mmc_select_hwpart(int dev_num, int hwpart) { return -1; } |
135 | -static inline block_dev_desc_t* systemace_get_dev(int dev) { return NULL; } | |
136 | -static inline block_dev_desc_t* mg_disk_get_dev(int dev) { return NULL; } | |
137 | -static inline block_dev_desc_t *host_get_dev(int dev) { return NULL; } | |
136 | +static inline struct blk_desc *systemace_get_dev(int dev) { return NULL; } | |
137 | +static inline struct blk_desc *mg_disk_get_dev(int dev) { return NULL; } | |
138 | +static inline struct blk_desc *host_get_dev(int dev) { return NULL; } | |
138 | 139 | |
139 | -static inline int get_partition_info (block_dev_desc_t * dev_desc, int part, | |
140 | - disk_partition_t *info) { return -1; } | |
141 | -static inline void print_part (block_dev_desc_t *dev_desc) {} | |
142 | -static inline void init_part (block_dev_desc_t *dev_desc) {} | |
143 | -static inline void dev_print(block_dev_desc_t *dev_desc) {} | |
140 | +static inline int get_partition_info(struct blk_desc *dev_desc, int part, | |
141 | + disk_partition_t *info) { return -1; } | |
142 | +static inline void print_part(struct blk_desc *dev_desc) {} | |
143 | +static inline void init_part(struct blk_desc *dev_desc) {} | |
144 | +static inline void dev_print(struct blk_desc *dev_desc) {} | |
144 | 145 | static inline int get_device(const char *ifname, const char *dev_str, |
145 | - block_dev_desc_t **dev_desc) | |
146 | + struct blk_desc **dev_desc) | |
146 | 147 | { return -1; } |
147 | 148 | static inline int get_device_and_partition(const char *ifname, |
148 | 149 | const char *dev_part_str, |
149 | - block_dev_desc_t **dev_desc, | |
150 | + struct blk_desc **dev_desc, | |
150 | 151 | disk_partition_t *info, |
151 | 152 | int allow_whole_dev) |
152 | 153 | { *dev_desc = NULL; return -1; } |
153 | 154 | |
154 | 155 | |
155 | 156 | |
156 | 157 | |
... | ... | @@ -154,36 +155,41 @@ |
154 | 155 | |
155 | 156 | #ifdef CONFIG_MAC_PARTITION |
156 | 157 | /* disk/part_mac.c */ |
157 | -int get_partition_info_mac (block_dev_desc_t * dev_desc, int part, disk_partition_t *info); | |
158 | -void print_part_mac (block_dev_desc_t *dev_desc); | |
159 | -int test_part_mac (block_dev_desc_t *dev_desc); | |
158 | +int get_partition_info_mac(struct blk_desc *dev_desc, int part, | |
159 | + disk_partition_t *info); | |
160 | +void print_part_mac(struct blk_desc *dev_desc); | |
161 | +int test_part_mac(struct blk_desc *dev_desc); | |
160 | 162 | #endif |
161 | 163 | |
162 | 164 | #ifdef CONFIG_DOS_PARTITION |
163 | 165 | /* disk/part_dos.c */ |
164 | -int get_partition_info_dos (block_dev_desc_t * dev_desc, int part, disk_partition_t *info); | |
165 | -void print_part_dos (block_dev_desc_t *dev_desc); | |
166 | -int test_part_dos (block_dev_desc_t *dev_desc); | |
166 | +int get_partition_info_dos(struct blk_desc *dev_desc, int part, | |
167 | + disk_partition_t *info); | |
168 | +void print_part_dos(struct blk_desc *dev_desc); | |
169 | +int test_part_dos(struct blk_desc *dev_desc); | |
167 | 170 | #endif |
168 | 171 | |
169 | 172 | #ifdef CONFIG_ISO_PARTITION |
170 | 173 | /* disk/part_iso.c */ |
171 | -int get_partition_info_iso (block_dev_desc_t * dev_desc, int part, disk_partition_t *info); | |
172 | -void print_part_iso (block_dev_desc_t *dev_desc); | |
173 | -int test_part_iso (block_dev_desc_t *dev_desc); | |
174 | +int get_partition_info_iso(struct blk_desc *dev_desc, int part, | |
175 | + disk_partition_t *info); | |
176 | +void print_part_iso(struct blk_desc *dev_desc); | |
177 | +int test_part_iso(struct blk_desc *dev_desc); | |
174 | 178 | #endif |
175 | 179 | |
176 | 180 | #ifdef CONFIG_AMIGA_PARTITION |
177 | 181 | /* disk/part_amiga.c */ |
178 | -int get_partition_info_amiga (block_dev_desc_t * dev_desc, int part, disk_partition_t *info); | |
179 | -void print_part_amiga (block_dev_desc_t *dev_desc); | |
180 | -int test_part_amiga (block_dev_desc_t *dev_desc); | |
182 | +int get_partition_info_amiga(struct blk_desc *dev_desc, int part, | |
183 | + disk_partition_t *info); | |
184 | +void print_part_amiga(struct blk_desc *dev_desc); | |
185 | +int test_part_amiga(struct blk_desc *dev_desc); | |
181 | 186 | #endif |
182 | 187 | |
183 | 188 | #ifdef CONFIG_EFI_PARTITION |
184 | 189 | #include <part_efi.h> |
185 | 190 | /* disk/part_efi.c */ |
186 | -int get_partition_info_efi (block_dev_desc_t * dev_desc, int part, disk_partition_t *info); | |
191 | +int get_partition_info_efi(struct blk_desc *dev_desc, int part, | |
192 | + disk_partition_t *info); | |
187 | 193 | /** |
188 | 194 | * get_partition_info_efi_by_name() - Find the specified GPT partition table entry |
189 | 195 | * |
190 | 196 | |
... | ... | @@ -193,10 +199,10 @@ |
193 | 199 | * |
194 | 200 | * @return - '0' on match, '-1' on no match, otherwise error |
195 | 201 | */ |
196 | -int get_partition_info_efi_by_name(block_dev_desc_t *dev_desc, | |
202 | +int get_partition_info_efi_by_name(struct blk_desc *dev_desc, | |
197 | 203 | const char *name, disk_partition_t *info); |
198 | -void print_part_efi (block_dev_desc_t *dev_desc); | |
199 | -int test_part_efi (block_dev_desc_t *dev_desc); | |
204 | +void print_part_efi(struct blk_desc *dev_desc); | |
205 | +int test_part_efi(struct blk_desc *dev_desc); | |
200 | 206 | |
201 | 207 | /** |
202 | 208 | * write_gpt_table() - Write the GUID Partition Table to disk |
... | ... | @@ -207,7 +213,7 @@ |
207 | 213 | * |
208 | 214 | * @return - zero on success, otherwise error |
209 | 215 | */ |
210 | -int write_gpt_table(block_dev_desc_t *dev_desc, | |
216 | +int write_gpt_table(struct blk_desc *dev_desc, | |
211 | 217 | gpt_header *gpt_h, gpt_entry *gpt_e); |
212 | 218 | |
213 | 219 | /** |
... | ... | @@ -233,7 +239,7 @@ |
233 | 239 | * |
234 | 240 | * @return - error on str_guid conversion error |
235 | 241 | */ |
236 | -int gpt_fill_header(block_dev_desc_t *dev_desc, gpt_header *gpt_h, | |
242 | +int gpt_fill_header(struct blk_desc *dev_desc, gpt_header *gpt_h, | |
237 | 243 | char *str_guid, int parts_count); |
238 | 244 | |
239 | 245 | /** |
... | ... | @@ -246,7 +252,7 @@ |
246 | 252 | * |
247 | 253 | * @return zero on success |
248 | 254 | */ |
249 | -int gpt_restore(block_dev_desc_t *dev_desc, char *str_disk_guid, | |
255 | +int gpt_restore(struct blk_desc *dev_desc, char *str_disk_guid, | |
250 | 256 | disk_partition_t *partitions, const int parts_count); |
251 | 257 | |
252 | 258 | /** |
... | ... | @@ -257,7 +263,7 @@ |
257 | 263 | * |
258 | 264 | * @return - '0' on success, otherwise error |
259 | 265 | */ |
260 | -int is_valid_gpt_buf(block_dev_desc_t *dev_desc, void *buf); | |
266 | +int is_valid_gpt_buf(struct blk_desc *dev_desc, void *buf); | |
261 | 267 | |
262 | 268 | /** |
263 | 269 | * write_mbr_and_gpt_partitions() - write MBR, Primary GPT and Backup GPT |
... | ... | @@ -267,7 +273,7 @@ |
267 | 273 | * |
268 | 274 | * @return - '0' on success, otherwise error |
269 | 275 | */ |
270 | -int write_mbr_and_gpt_partitions(block_dev_desc_t *dev_desc, void *buf); | |
276 | +int write_mbr_and_gpt_partitions(struct blk_desc *dev_desc, void *buf); | |
271 | 277 | |
272 | 278 | /** |
273 | 279 | * gpt_verify_headers() - Function to read and CRC32 check of the GPT's header |
... | ... | @@ -281,7 +287,7 @@ |
281 | 287 | * |
282 | 288 | * @return - '0' on success, otherwise error |
283 | 289 | */ |
284 | -int gpt_verify_headers(block_dev_desc_t *dev_desc, gpt_header *gpt_head, | |
290 | +int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head, | |
285 | 291 | gpt_entry **gpt_pte); |
286 | 292 | |
287 | 293 | /** |
... | ... | @@ -300,7 +306,7 @@ |
300 | 306 | * |
301 | 307 | * @return - '0' on success, otherwise error |
302 | 308 | */ |
303 | -int gpt_verify_partitions(block_dev_desc_t *dev_desc, | |
309 | +int gpt_verify_partitions(struct blk_desc *dev_desc, | |
304 | 310 | disk_partition_t *partitions, int parts, |
305 | 311 | gpt_header *gpt_head, gpt_entry **gpt_pte); |
306 | 312 | #endif |
include/reiserfs.h
... | ... | @@ -63,7 +63,7 @@ |
63 | 63 | } reiserfs_error_t; |
64 | 64 | |
65 | 65 | |
66 | -extern void reiserfs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info); | |
66 | +void reiserfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info); | |
67 | 67 | extern int reiserfs_ls (char *dirname); |
68 | 68 | extern int reiserfs_open (char *filename); |
69 | 69 | extern int reiserfs_read (char *buf, unsigned len); |
include/sandboxblockdev.h
include/sandboxfs.h
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 | #ifndef __SANDBOX_FS__ |
19 | 19 | #define __SANDBOX_FS__ |
20 | 20 | |
21 | -int sandbox_fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info); | |
21 | +int sandbox_fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info); | |
22 | 22 | |
23 | 23 | int sandbox_fs_read_at(const char *filename, loff_t pos, void *buffer, |
24 | 24 | loff_t maxsize, loff_t *actread); |
include/sata.h
include/spl.h
... | ... | @@ -72,14 +72,16 @@ |
72 | 72 | int spl_sata_load_image(void); |
73 | 73 | |
74 | 74 | /* SPL FAT image functions */ |
75 | -int spl_load_image_fat(block_dev_desc_t *block_dev, int partition, const char *filename); | |
76 | -int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition); | |
75 | +int spl_load_image_fat(struct blk_desc *block_dev, int partition, | |
76 | + const char *filename); | |
77 | +int spl_load_image_fat_os(struct blk_desc *block_dev, int partition); | |
77 | 78 | |
78 | 79 | void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image); |
79 | 80 | |
80 | 81 | /* SPL EXT image functions */ |
81 | -int spl_load_image_ext(block_dev_desc_t *block_dev, int partition, const char *filename); | |
82 | -int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition); | |
82 | +int spl_load_image_ext(struct blk_desc *block_dev, int partition, | |
83 | + const char *filename); | |
84 | +int spl_load_image_ext_os(struct blk_desc *block_dev, int partition); | |
83 | 85 | |
84 | 86 | /** |
85 | 87 | * spl_init() - Set up device tree and driver model in SPL if enabled |
include/systemace.h
include/ubifs_uboot.h
... | ... | @@ -21,7 +21,7 @@ |
21 | 21 | int ubifs_is_mounted(void); |
22 | 22 | int ubifs_load(char *filename, u32 addr, u32 size); |
23 | 23 | |
24 | -int ubifs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info); | |
24 | +int ubifs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info); | |
25 | 25 | int ubifs_ls(const char *dir_name); |
26 | 26 | int ubifs_exists(const char *filename); |
27 | 27 | int ubifs_size(const char *filename, loff_t *size); |
include/usb.h
include/usb_mass_storage.h
include/zfs_common.h
... | ... | @@ -63,7 +63,7 @@ |
63 | 63 | struct zfs_filesystem { |
64 | 64 | |
65 | 65 | /* Block Device Descriptor */ |
66 | - block_dev_desc_t *dev_desc; | |
66 | + struct blk_desc *dev_desc; | |
67 | 67 | }; |
68 | 68 | |
69 | 69 | struct device_s { |
... | ... | @@ -98,7 +98,7 @@ |
98 | 98 | int zfs_ls(device_t dev, const char *path, |
99 | 99 | int (*hook) (const char *, const struct zfs_dirhook_info *)); |
100 | 100 | int zfs_devread(int sector, int byte_offset, int byte_len, char *buf); |
101 | -void zfs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info); | |
101 | +void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info); | |
102 | 102 | void zfs_unmount(struct zfs_data *data); |
103 | 103 | int lzjb_decompress(void *, void *, uint32_t, uint32_t); |
104 | 104 | #endif |
lib/gunzip.c
test/dm/usb.c