X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fdevice.h;h=a05c3d37b06735cd73d40876e9c5c7c6b9fc4008;hp=a5c5f745b81f712dfea4e582e7205269c0a54b8c;hb=4e2075ceea72b3e7e753bf5c6c0e8c4a3b68cdd9;hpb=e99e38bbdcca3fe5956823bdb3d38544ccf93221 diff --git a/src/device.h b/src/device.h index a5c5f745b..a05c3d37b 100644 --- a/src/device.h +++ b/src/device.h @@ -1,4 +1,4 @@ -/*-*- Mode: C; c-basic-offset: 8 -*-*/ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ #ifndef foodevicehfoo #define foodevicehfoo @@ -30,17 +30,23 @@ typedef struct Device Device; * simplifies the state engine greatly */ typedef enum DeviceState { DEVICE_DEAD, - DEVICE_AVAILABLE, + DEVICE_PLUGGED, _DEVICE_STATE_MAX, _DEVICE_STATE_INVALID = -1 } DeviceState; struct Device { - Meta meta; - - DeviceState state; + Unit meta; char *sysfs; + + /* In order to be able to distinguish dependencies on + different device nodes we might end up creating multiple + devices for the same sysfs path. We chain them up here. */ + + LIST_FIELDS(struct Device, same_sysfs); + + DeviceState state; }; extern const UnitVTable device_vtable;