Skip to content

Commit

Permalink
drmgr: Introduce get_my_partner_drc_index()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
  • Loading branch information
hmyneni authored and tyreld committed Jul 26, 2024
1 parent 3a7e774 commit aa5feef
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/drmgr/common_ofdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/drmgr/ofdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down

0 comments on commit aa5feef

Please sign in to comment.