@@ -55,7 +55,13 @@ struct ib_uverbs_attr {
__u16 attr_id; /* command specific type attribute */
__u16 len; /* only for pointers */
__u16 flags; /* combination of UVERBS_ATTR_F_XXXX */
- __u16 reserved;
+ union {
+ struct {
+ __u8 elem_id;
+ __u8 reserved;
+ } enum_data;
+ __u16 reserved;
+ } attr_data;
__aligned_u64 data; /* ptr to command, inline data or idr/fd */
};
@@ -346,4 +346,16 @@ static inline size_t __check_divide(size_t val, unsigned int div)
return val / div;
}
+static inline struct ib_uverbs_attr *
+fill_attr_in_enum(struct ibv_command_buffer *cmd, uint16_t attr_id,
+ uint8_t elem_id, const void *data, size_t len)
+{
+ struct ib_uverbs_attr *attr;
+
+ attr = fill_attr_in(cmd, attr_id, data, len);
+ attr->attr_data.enum_data.elem_id = elem_id;
+
+ return attr;
+}
+
#endif