commit aa5feef7c7657fb764d732e831c9f7c7b9820498 Author: Haren Myneni Date: Fri Jun 21 15:41:46 2024 -0700 drmgr: Introduce get_my_partner_drc_index() get_my_partner_drc_index() is called to retrieve DRC index from the "ibm,multipath-partner-drc" property. This property is available in the parent device node if the device has miltipath partner device. "ibm,multipath-partner-drc" has the DRC index of the partner device. Signed-off-by: Haren Myneni Signed-off-by: Tyrel Datwyler diff --git a/src/drmgr/common_ofdt.c b/src/drmgr/common_ofdt.c index 655c9d2..1e5fe53 100644 --- a/src/drmgr/common_ofdt.c +++ b/src/drmgr/common_ofdt.c @@ -609,6 +609,26 @@ get_my_drc_index(char *of_path, uint32_t *index) return rc; } +/** + * get_my_partner_drc_index + * + * @param of_full_path + * @param index + * @returns 0 on success, !0 otherwise + */ +int get_my_partner_drc_index(struct dr_node *node, uint32_t *index) +{ + int rc; + + if (node == NULL) + return -1; + + rc = get_ofdt_uint_property(node->ofdt_path, + "ibm,multipath-partner-drc", index); + + return rc; +} + /** * drc_name_to_index * @brief Find the drc index for the given name diff --git a/src/drmgr/ofdt.h b/src/drmgr/ofdt.h index 6c1b961..08d34e1 100644 --- a/src/drmgr/ofdt.h +++ b/src/drmgr/ofdt.h @@ -174,6 +174,7 @@ struct dr_connector *search_drc_list(struct dr_connector *, struct dr_connector *, int, void *); int get_my_drc_index(char *, uint32_t *); +int get_my_partner_drc_index(struct dr_node *, uint32_t *); int drc_name_to_index(const char *, struct dr_connector *); char * drc_index_to_name(uint32_t, struct dr_connector *); int get_drc_by_name(char *, struct dr_connector *, char *, char *);