Hi,
I was just talking to Nicolas Droux and Eric Cheng,
and they suggested that it might be more convenient
to be able to pass a table of (prop name, perm flags)
arguments to mac_register_prop, instead of
registering individual props one at a time.
The current signature of this function is
void
mac_register_priv_prop(mac_handle_t mh, char *name, int flags)
so the suggestion is to instead change this to
typedef struct mac_priv_prop_s {
char mpp_name[DLD_LINKPROP_NAME_MAX];
int mpp_flags;
} mac_priv_prop_t;
int mac_register_priv_prop(mac_handle_t mh,
mac_priv_prop_t *prop_table,
int nprop)
the function will return
0, on no error,
EEXIST if called more than once.
ENOMEM if some memory allocation failed.
Thus drivers could declare a static table
of all private properties, and pass this in one
shot to mac_register_private_prop. Another
advantage is that this does not have locking problems
that Garrett alluded to.
The down side to this is that drivers will
not be able to change an existing registration
easily. Thus they have to do a monolithic
registration of all their props.
Thoughts? comments?
--Sowmini