-#define UEVENT_QUANTITY_FIELDS(q) \
- q(design_capacity, CHARGE_FULL_DESIGN ) /* uAh */ \
- q(last_full_capacity, CHARGE_FULL ) /* uAh */ \
- q(present_rate, CURRENT_NOW ) /* uA */ \
- q(remaining_capacity, CHARGE_NOW ) /* uAh */ \
- q(present, PRESENT ) /* boolean */ \
- q(online, ONLINE ) /* boolean */
-
-#define UEVENT_ENUM_FIELDS(e) \
- e(type, TYPE, "Battery", "Mains" ) \
- e(state, STATUS, "Discharging", "Charging", "Charged" )
-
-#define CHGST_DISCHARGING 0 /* Reflects order in e(state,...) above */
-#define CHGST_CHARGING 1 /* Also, much code assumes exadtly */
-#define CHGST_CHARGED 2 /* these three possible states. */
+#define UEVENT_QUANTITY_FIELDS(f) \
+ f(design_capacity, BATTERY, CHARGE_FULL_DESIGN ) /* uAh */ \
+ f(last_full_capacity, BATTERY, CHARGE_FULL ) /* uAh */ \
+ f(present_rate, BATTERY, CURRENT_NOW ) /* uA */ \
+ f(remaining_capacity, BATTERY, CHARGE_NOW ) /* uAh */ \
+ f(present, BATTERY, PRESENT ) /* boolean */ \
+ f(online, MAINS, ONLINE ) /* boolean */
+
+#define UEVENT_ENUM_FIELDS(f) \
+ f(state, BATTERY, STATUS, "Discharging","Charging","Charged","Unknown" ) \
+ f(type, BOTH, TYPE, "Mains", "Battery" )
+
+#define CHGST_DISCHARGING 0 /* Reflects order in f(state,...) above */
+#define CHGST_CHARGING 1 /* Also, much code assumes exactly */
+#define CHGST_CHARGED 2 /* these three possible states. */
+#define CHGST_UNKNOWN 3 /* these three possible states. */