udi_mei_enumeration_rank_func_t(3udi)
Metalanguage library device enumeration ranking
#include <udi.h>typedef udi_ubit8_t udi_mei_enumeration_rank_func_t ( udi_ubit32_t attr_device_match, void **attr_value_list );ARGUMENTS attr_device_match is a bitmask value where each bit represents a specific enumeration attribute as defined by the associated metalanguage. If the bit is set then the value for that attribute appears in the attr_value_list at an index that is equal to the bit number.
attr_value_list specifies the value of the enumerated attribute indicated by a non-zero bit at the corresponding bit offset in the attr_device_match argument. The metalanguage must not access array_value_list entries whose corresponding bit is not set in the attr_device_match argument.
DESCRIPTION The Management Agent (MA) will call the udi_mei_enumeration_rank function provided by the Metalanguage Library for each "device" declaration (see Device Declaration) that is a potential candidate for binding to an enumerated device. In order to be a valid candidate, the metalanguage and all enumeration attribute values specified in the "device" declaration must match the values for the enumerated device instance (though there may be additional enumerated attributes besidesthose specified in the "device" line). The rank function will only be called for valid candidates.
This routine is responsible for determining the "ranking" of this match as defined by the Metalanguage specification and returning that numeric ranking value to the MA. The rankable enumeration attributes specified by the parent are indicated to this function by setting a bit in the attr_device_match bitmask along with the attribute's value via the attr_value_list array.
After calling the rank function for all candidates, the MA will choose the candidate with the highest ranking value. If more than one driver matches with the same ranking value, the one with the greatest number of matching attributes will be chosen. If this still leaves multiple candidates, the MA will choose one of these candidates, in an implementation-dependent fashion.
RETURN VALUES This function returns the numerical ranking value for the specifed attribute values. Higher ranking values indicate better matches. The ranking values and methods are defined by each Metalanguage's specification.