|
|
udi_filter_element_t(3udi)
Enumeration filter element structure
#include <udi.h>typedef struct { char attr_name[UDI_MAX_ATTR_NAMELEN]; udi_ubit8_t attr_min[UDI_MAX_ATTR_SIZE]; udi_ubit8_t attr_min_len; udi_ubit8_t attr_max[UDI_MAX_ATTR_SIZE]; udi_ubit8_t attr_max_len; udi_instance_attr_type_t attr_type; udi_ubit32_t attr_stride; } udi_filter_element_t;MEMBERS attr_name is the name of the attribute to be filtered.
attr_min is the minimum acceptable value for the attribute in this filter. When combined with the attr_max value an inclusive range of valid attribute values for the filter is specified.
attr_min_len specifies the valid length (in bytes) of the attr_min value. Must not be zero.
attr_max is the maximum acceptable value for the attribute in this filter.
attr_max_len specifies the valid length (in bytes) of the attr_max value. Must not be zero.
attr_type is the attribute type as specified for udi_instance_attr_type_t on page 16-7. Must not be UDI_ATTR_NONE or UDI_ATTR_FILE.
attr_stride specifies the periodicity of the filter match values starting at attr_min and ending at or above attr_max.
DESCRIPTION The udi_filter_element_t structure is used to specify an attribute being filtered and the valid range and periodicity of the values for that filter. This can be used to reduce the amount of work a driver needs to go through to scan for child devices.
The interpretation of attr_stride is unique to each attr_name attribute and is specified by the metalanguage when describing that attribute.
The interpretation of attr_min and attr_max values will be determined by the attr_type specified for that attr_name attribute when the attribute is being enumerated.
If attr_type is UDI_ATTR_UBIT32, the 32-bit value is encoded as a little-endian value in the first four bytes of attr_min and attr_max, and attr_min_len and attr_max_len must be 4. In this case, UDI_ATTR32_GET (page 16-14) must be used to extract values from attr_min and attr_max.
EXAMPLE If the current target driver instance is a SCSI HD that is enumerating SCSI Metalanguage children (SCSI peripheral devices) for the MA, the following filter specification (as initialized by the MA):
#define udi_filter_element_t f = { "scsi_target", UDI_ATTR32_INIT(2), 1, UDI_ATTR32_INIT(15), 1, UDI_ATTR_UBIT32, 3 };indicates that the MA only cares about SCSI targets with one of the following SCSI Target ID values: 2, 5, 8, 11, 14.
REFERENCES udi_instance_attr_type_t, udi_instance_attr_list_t, UDI_ATTR32_GET, UDI_ATTR32_INIT, udi_enumerate_req