of_msi_map_rid — Map a MSI requester ID for a device.
u32 of_msi_map_rid ( | struct device * dev, |
struct device_node * msi_np, | |
u32 rid_in) ; |
dev
Pointer to device for which the mapping is to be done
msi_np
NULL or pointer to device node of the expected msi controller
rid_in
Unmapped MSI requester ID for the device
Walk up the device hierarchy, looking for a device whose devicetree node
contains an “msi-map” property. If found and an element of msi-map matches,
apply the mapping specified by the rid-base in the matching element to
rid_in
.
rid_in
may be masked by property “msi-map-mask”, contained in the node that
contains property “msi_map”.
A match occurs if (1) rid_in
, optionally masked by “msi-map-mask”, is in
the range of rid_base..(rid_base + length), and (2) if msi_np
is not NULL,
it has the same value as the dereferenced msi-controller phandle
Note that the tree walk is for “struct device *”, not “struct device_node *”. In other words, not walking up the devicetree tree.
See binding pci/pci-msi.txt for more information about requestor ID and properties “msi-map” and “msi-map-mask”.