1*180cc7c6SAlex Deymo /* 2*180cc7c6SAlex Deymo * Copyright (C) 2017 The Android Open Source Project 3*180cc7c6SAlex Deymo * 4*180cc7c6SAlex Deymo * SPDX-License-Identifier: BSD-2-Clause 5*180cc7c6SAlex Deymo */ 6*180cc7c6SAlex Deymo 7*180cc7c6SAlex Deymo #ifndef __ANDROID_CMDS_H 8*180cc7c6SAlex Deymo #define __ANDROID_CMDS_H 9*180cc7c6SAlex Deymo 10*180cc7c6SAlex Deymo #include <common.h> 11*180cc7c6SAlex Deymo 12*180cc7c6SAlex Deymo /** 13*180cc7c6SAlex Deymo * part_get_info_by_dev_and_name_or_num - Parse a device number and partition 14*180cc7c6SAlex Deymo * description (either name or number) in the form of device number plus 15*180cc7c6SAlex Deymo * partition name separated by a ";" (like "device_num;partition_name") or 16*180cc7c6SAlex Deymo * a device number plus a partition number separated by a ":". For example both 17*180cc7c6SAlex Deymo * "0;misc" and "0:1" can be valid partition descriptions for a given interface. 18*180cc7c6SAlex Deymo * If the partition is found, sets dev_desc and part_info accordingly with the 19*180cc7c6SAlex Deymo * information of the partition. 20*180cc7c6SAlex Deymo * 21*180cc7c6SAlex Deymo * @dev_iface: Device interface. 22*180cc7c6SAlex Deymo * @dev_part_str: Input partition description, like "0;misc" or "0:1". 23*180cc7c6SAlex Deymo * @dev_desc: Place to store the device description pointer. 24*180cc7c6SAlex Deymo * @part_info: Place to store the partition information. 25*180cc7c6SAlex Deymo * @return 0 on success, or -1 on error 26*180cc7c6SAlex Deymo */ 27*180cc7c6SAlex Deymo int part_get_info_by_dev_and_name_or_num(const char *dev_iface, 28*180cc7c6SAlex Deymo const char *dev_part_str, 29*180cc7c6SAlex Deymo struct blk_desc **dev_desc, 30*180cc7c6SAlex Deymo disk_partition_t *part_info); 31*180cc7c6SAlex Deymo 32*180cc7c6SAlex Deymo #endif 33