STRUCT POWERCAP_ZONE(9)
π struct powercap_zone(9) β Kernel API Manual, but make it cute
okay so real talk: we're looking at struct powercap_zone(9) from the Kernel API Manual, and bestie, it's giving "the blueprint of a power cap zone." Let's get into it π
β¨ NAME β¨
struct powercap_zone β literally defines an instance of a power cap zone. that's the whole vibe. π
πΈ SYNOPSIS πΈ
struct powercap_zone {
int id;
char *name;
void *control_type_inst;
const struct powercap_zone_ops *ops;
struct device dev;
int const_id_cnt;
struct idr idr;
struct idr *parent_idr;
void *private_data;
struct attribute **zone_dev_attrs;
int zone_attr_count;
struct attribute_group dev_zone_attr_group;
const struct attribute_group *dev_attr_groups[2];
bool allocated;
struct powercap_zone_constraint *constraints;
};
like, look at her. fifteen fields and every single one is doing its job. no filler, no fluff, main character struct energy fr fr π
π¦ Members π¦
idβ the unique id. one of a kind, obviously. β¨nameβ the power zone name. her government name, if you will. πcontrol_type_instβ the control type instance for this zone. yes it's avoid *, yes we're being mysterious about it πopsβ pointer to the zone operation structure. the whole personality lives here tbh.devβ an instance of a device. she has a device. we love that for her.const_id_cntβ number of constraints defined. count 'em, bestie π₯idrβ an instance of an idr entry, but specifically for children zones. it's giving "mom of the group chat" π«Άparent_idrβ used to remove the reference from the parent idr. gotta clean up after yourself, no cap.private_dataβ private data pointer, if any, for this zone. if any. respect the mystery πzone_dev_attrsβ the attributes associated with this device.zone_attr_countβ the attribute count. because somebody has to keep track πdev_zone_attr_groupβ the attribute group for attributes. groups within groups, iconic.dev_attr_groupsβ the attribute group store that gets registered with the device.allocatedβ okay so this one's a whole situation: it's possible that the client owns the memory used by this structure. in that case, this flag is set tofalseby the framework to prevent deallocation during the release process. otherwise, this flag is set totrue. read it twice, bestie, this is the important one βconstraintsβ the list of constraints for this zone. the rules. the boundaries. the "no β€οΈ" energy.
π Description π
so basically: this defines a power zone instance. and now the part where I hold your hand and look you dead in the eye β the fields of this structure are private, and should not be used by client drivers. π
fr fr do NOT go poking at these fields from your driver. they're private. it's not your business. iykyk π
π₯ SEE ALSO π₯
- Kernel file
./include/linux/powercap.hstruct powercap_control_type_ops(9) struct powercap_control_type(9)struct powercap_zone_ops(9)struct powercap_zone_constraint_ops(9)struct powercap_zone_constraint(9)powercap_set_zone_data(9)powercap_get_zone_data(9)powercap_register_control_type(9)powercap_unregister_control_type(9)powercap_register_zone(9)powercap_unregister_zone(9)
like a little friend group of man pages. go read them all, they're all slay π¦
that's the whole page, bestie! this cutie lives in ./include/linux and the version/date on it is October 2026, filed under struct powercap_zone(9) β mwah, go forth and don't touch the private fields πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms