Lines Matching refs:dev_desc

26 static struct part_driver *part_driver_lookup_type(struct blk_desc *dev_desc)  in part_driver_lookup_type()  argument
33 if (dev_desc->part_type == PART_TYPE_UNKNOWN) { in part_driver_lookup_type()
37 ret = entry->test(dev_desc); in part_driver_lookup_type()
39 dev_desc->part_type = entry->part_type; in part_driver_lookup_type()
45 if (dev_desc->part_type == entry->part_type) in part_driver_lookup_type()
57 struct blk_desc *dev_desc; in get_dev_hwpart() local
60 dev_desc = blk_get_devnum_by_typename(ifname, dev); in get_dev_hwpart()
61 if (!dev_desc) { in get_dev_hwpart()
66 ret = blk_dselect_hwpart(dev_desc, hwpart); in get_dev_hwpart()
73 return dev_desc; in get_dev_hwpart()
119 void dev_print (struct blk_desc *dev_desc) in dev_print() argument
123 if (dev_desc->type == DEV_TYPE_UNKNOWN) { in dev_print()
128 switch (dev_desc->if_type) { in dev_print()
131 dev_desc->target,dev_desc->lun, in dev_print()
132 dev_desc->vendor, in dev_print()
133 dev_desc->product, in dev_print()
134 dev_desc->revision); in dev_print()
140 dev_desc->vendor, in dev_print()
141 dev_desc->revision, in dev_print()
142 dev_desc->product); in dev_print()
149 dev_desc->vendor, in dev_print()
150 dev_desc->revision, in dev_print()
151 dev_desc->product); in dev_print()
160 printf("Unhandled device type: %i\n", dev_desc->if_type); in dev_print()
164 if (dev_desc->removable) in dev_print()
166 switch (dev_desc->type & 0x1F) { in dev_print()
180 printf ("# %02X #", dev_desc->type & 0x1F); in dev_print()
184 if (dev_desc->lba > 0L && dev_desc->blksz > 0L) { in dev_print()
188 lba = dev_desc->lba; in dev_print()
190 lba512 = (lba * (dev_desc->blksz/512)); in dev_print()
202 if (dev_desc->lba48) in dev_print()
210 dev_desc->blksz); in dev_print()
216 dev_desc->blksz); in dev_print()
226 void part_init(struct blk_desc *dev_desc) in part_init() argument
233 blkcache_invalidate(dev_desc->if_type, dev_desc->devnum); in part_init()
235 dev_desc->part_type = PART_TYPE_UNKNOWN; in part_init()
239 ret = entry->test(dev_desc); in part_init()
242 dev_desc->part_type = entry->part_type; in part_init()
248 static void print_part_header(const char *type, struct blk_desc *dev_desc) in print_part_header() argument
256 switch (dev_desc->if_type) { in print_part_header()
289 dev_desc->devnum, type); in print_part_header()
293 void part_print(struct blk_desc *dev_desc) in part_print() argument
297 drv = part_driver_lookup_type(dev_desc); in part_print()
300 dev_desc->part_type); in part_print()
305 print_part_header(drv->name, dev_desc); in part_print()
307 drv->print(dev_desc); in part_print()
312 int part_get_info(struct blk_desc *dev_desc, int part, in part_get_info() argument
326 drv = part_driver_lookup_type(dev_desc); in part_get_info()
329 dev_desc->part_type); in part_get_info()
337 if (drv->get_info(dev_desc, part, info) == 0) { in part_get_info()
346 int part_get_info_whole_disk(struct blk_desc *dev_desc, disk_partition_t *info) in part_get_info_whole_disk() argument
349 info->size = dev_desc->lba; in part_get_info_whole_disk()
350 info->blksz = dev_desc->blksz; in part_get_info_whole_disk()
365 struct blk_desc **dev_desc) in blk_get_device_by_str() argument
401 *dev_desc = get_dev_hwpart(ifname, dev, hwpart); in blk_get_device_by_str()
402 if (!(*dev_desc) || ((*dev_desc)->type == DEV_TYPE_UNKNOWN)) { in blk_get_device_by_str()
415 part_init(*dev_desc); in blk_get_device_by_str()
426 struct blk_desc **dev_desc, in blk_get_device_part_str() argument
445 *dev_desc = NULL; in blk_get_device_part_str()
474 *dev_desc = NULL; in blk_get_device_part_str()
508 dev = blk_get_device_by_str(ifname, dev_str, dev_desc); in blk_get_device_part_str()
535 if (((*dev_desc)->part_type == PART_TYPE_UNKNOWN) || in blk_get_device_part_str()
537 if (!(*dev_desc)->lba) { in blk_get_device_part_str()
554 (*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz); in blk_get_device_part_str()
556 part_get_info_whole_disk(*dev_desc, info); in blk_get_device_part_str()
574 ret = part_get_info(*dev_desc, part, info); in blk_get_device_part_str()
586 ret = part_get_info(*dev_desc, p, info); in blk_get_device_part_str()
631 (*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz); in blk_get_device_part_str()
641 int part_get_info_by_name_type(struct blk_desc *dev_desc, const char *name, in part_get_info_by_name_type() argument
648 part_drv = part_driver_lookup_type(dev_desc); in part_get_info_by_name_type()
652 ret = part_drv->get_info(dev_desc, i, info); in part_get_info_by_name_type()
666 int part_get_info_by_name(struct blk_desc *dev_desc, const char *name, in part_get_info_by_name() argument
669 return part_get_info_by_name_type(dev_desc, name, info, PART_TYPE_ALL); in part_get_info_by_name()
672 void part_set_generic_name(const struct blk_desc *dev_desc, in part_set_generic_name() argument
677 switch (dev_desc->if_type) { in part_set_generic_name()
701 sprintf(name, "%s%c%d", devtype, 'a' + dev_desc->devnum, part_num); in part_set_generic_name()