tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: General device properties API
> On Aug 22, 2021, at 9:28 AM, Taylor R Campbell <campbell+netbsd-tech-kern%mumble.net@localhost> wrote:
>
>> As for the way device_call() works, propose an alternative with the
>> following attributes: [...]
>
> Here's a sketch of a typed version of what I think is essentially the
> same thing the untyped device_call does:
>
> typedef struct {
> void *private;
> struct devhandle_ops *ops; /* `vtable', if you will */
> } devhandle_t;
>
> struct devhandle_ops_v1 {
> int (*dho_getprop_string)(devhandle_t, const char *, int, uint32_t *);
> ...
> };
> ...
> struct devhandle_ops {
> unsigned version;
> struct devhandle_ops_v1 v1;
> struct devhandle_ops_v2 v2;
> ...
> };
This proposal does not have all of the attributes I laid out. Please go back and read what I said again.
-- thorpej
Home |
Main Index |
Thread Index |
Old Index