X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/96e23fa3c6eabf8a6efebac24b740c5d4a2a1050..bb7ce16533fb6c1384775dea6e1150e74c229daf:/lunaix-os/includes/lunaix/device.h?ds=inline diff --git a/lunaix-os/includes/lunaix/device.h b/lunaix-os/includes/lunaix/device.h index c0ed989..be6dc26 100644 --- a/lunaix-os/includes/lunaix/device.h +++ b/lunaix-os/includes/lunaix/device.h @@ -5,6 +5,7 @@ #include #include +#include #define DEV_MSKIF 0x00000003 @@ -17,6 +18,7 @@ typedef unsigned int dev_t; struct device { struct llist_header siblings; + struct llist_header children; struct device* parent; struct hstr name; dev_t dev_id; @@ -27,6 +29,13 @@ struct device int (*write)(struct device* dev, void* buf, size_t offset, size_t len); }; +struct device* +device_add(struct device* parent, + void* underlay, + char* name_fmt, + uint32_t type, + va_list args); + struct device* device_addseq(struct device* parent, void* underlay, char* name_fmt, ...); @@ -43,9 +52,12 @@ struct device* device_getbyid(struct llist_header* devlist, dev_t id); struct device* -device_getbyname(struct llist_header* devlist, struct hstr* name); +device_getbyhname(struct device* root_dev, struct hstr* name); + +struct device* +device_getbyname(struct device* root_dev, const char* name, size_t len); struct device* -device_getbyoffset(struct llist_header* devlist, int pos); +device_getbyoffset(struct device* root_dev, int pos); #endif /* __LUNAIX_DEVICE_H */