STRUCT COUNTER_OPS(9)
π NAME π
okay bestie, welcome to struct counter_ops(9) from the Kernel API Manual β this page is literally <pink>struct counter_ops</pink> - <purple>Callbacks from driver</purple>. it's the callback lineup a driver hands over, iykyk π
β¨
β¨ SYNOPSIS β¨
here's the struct, copied exactly, no editing bestie π«Ά
struct counter_ops {
int (*signal_read)(struct counter_device *counter, struct
counter_signal *signal, enum counter_signal_level *level);
int (*count_read)(struct counter_device *counter, struct
counter_count *count, u64 *value);
int (*count_write)(struct counter_device *counter, struct
counter_count *count, u64 value);
int (*function_read)(struct counter_device *counter, struct
counter_count *count, enum counter_function *function);
int (*function_write)(struct counter_device *counter, struct
counter_count *count, enum counter_function function);
int (*action_read)(struct counter_device *counter, struct
counter_count *count, struct counter_synapse *synapse, enum
counter_synapse_action *action);
int (*action_write)(struct counter_device *counter, struct
counter_count *count, struct counter_synapse *synapse, enum
counter_synapse_action action);
int (*events_configure)(struct counter_device *counter);
int (*watch_validate)(struct counter_device *counter, const struct
counter_watch *watch);
};
π Members π
okay so each member is a callback slot, and here's the tea ββ¨
signal_readβ optional read callback for Signals. The read level of the respective Signal should be passed back via thelevelparameter. πcount_readβ read callback for Counts. The read value of the respective Count should be passed back via thevalueparameter.count_writeβ optional write callback for Counts. The write value for the respective Count is passed in via thevalueparameter.function_readβ read callback for the Count function modes. The read function mode of the respective Count should be passed back via thefunctionparameter.function_writeβ optional write callback for Count function modes. The function mode to write for the respective Count is passed in via thefunctionparameter.action_readβ optional read callback for the Synapse action modes. The read action mode of the respective Synapse should be passed back via theactionparameter.action_writeβ optional write callback for Synapse action modes. The action mode to write for the respective Synapse is passed in via theactionparameter.events_configureβ optional write callback to configure events. The list ofstruct counter_event_nodemay be accessed via theevents_listmember of thecounterparameter.watch_validateβ optional callback to validate a watch. The Counter component watch configuration is passed in via thewatchparameter. A return value of0indicates a valid Counter component watch configuration. β
π¦ SEE ALSO π¦
Kernel file ./include/linux/counter.h β plus struct counter_comp(9), struct counter_signal(9), struct counter_synapse(9), struct counter_count(9), struct counter_event_node(9), and struct counter_device(9). go binge those next, bestie ππ
okay that's the whole page π«Ά source/version: ./include/linux, date: October 2026, manual: struct counter_ops(9) β mwah, go make those callbacks iconic π
β¨
π¦ 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