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