/Linux-v6.6/drivers/counter/ |
D | counter-core.c | 3 * Generic Counter interface 7 #include <linux/counter.h> 22 #include "counter-chrdev.h" 23 #include "counter-sysfs.h" 25 #define COUNTER_NAME "counter" 27 /* Provides a unique ID for each counter device */ 31 struct counter_device counter; member 42 struct counter_device *const counter = in counter_device_release() local 45 counter_chrdev_remove(counter); in counter_device_release() 48 kfree(container_of(counter, struct counter_device_allochelper, counter)); in counter_device_release() [all …]
|
D | counter-chrdev.c | 3 * Generic Counter character device interface 7 #include <linux/counter.h> 24 #include "counter-chrdev.h" 68 struct counter_device *const counter = filp->private_data; in counter_chrdev_read() local 72 if (!counter->ops) in counter_chrdev_read() 79 if (kfifo_is_empty(&counter->events)) { in counter_chrdev_read() 83 err = wait_event_interruptible(counter->events_wait, in counter_chrdev_read() 84 !kfifo_is_empty(&counter->events) || in counter_chrdev_read() 85 !counter->ops); in counter_chrdev_read() 88 if (!counter->ops) in counter_chrdev_read() [all …]
|
D | rz-mtu3-cnt.c | 3 * Renesas RZ/G2L MTU3a Counter driver 9 #include <linux/counter.h> 23 * TCNT: Timer Counter 25 * TCNTLW: Timer Longword Counter 66 * struct rz_mtu3_cnt - MTU3 counter private data 71 * @count_is_enabled: Enabled state of Counter value channel 97 static inline struct rz_mtu3_channel *rz_mtu3_get_ch(struct counter_device *counter, int id) in rz_mtu3_get_ch() argument 99 struct rz_mtu3_cnt *const priv = counter_priv(counter); in rz_mtu3_get_ch() 105 static bool rz_mtu3_is_counter_invalid(struct counter_device *counter, int id) in rz_mtu3_is_counter_invalid() argument 107 struct rz_mtu3_cnt *const priv = counter_priv(counter); in rz_mtu3_is_counter_invalid() [all …]
|
D | ti-ecap-capture.c | 10 #include <linux/counter.h> 86 * @pm_ctx.time_cntr: timestamp counter value 100 static u8 ecap_cnt_capture_get_evmode(struct counter_device *counter) in ecap_cnt_capture_get_evmode() argument 102 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_capture_get_evmode() 105 pm_runtime_get_sync(counter->parent); in ecap_cnt_capture_get_evmode() 107 pm_runtime_put_sync(counter->parent); in ecap_cnt_capture_get_evmode() 112 static void ecap_cnt_capture_set_evmode(struct counter_device *counter, u8 ev_mode) in ecap_cnt_capture_set_evmode() argument 114 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_capture_set_evmode() 116 pm_runtime_get_sync(counter->parent); in ecap_cnt_capture_set_evmode() 118 pm_runtime_put_sync(counter->parent); in ecap_cnt_capture_set_evmode() [all …]
|
D | interrupt-cnt.c | 6 #include <linux/counter.h> 29 struct counter_device *counter = dev_id; in interrupt_cnt_isr() local 30 struct interrupt_cnt_priv *priv = counter_priv(counter); in interrupt_cnt_isr() 34 counter_push_event(counter, COUNTER_EVENT_CHANGE_OF_STATE, 0); in interrupt_cnt_isr() 39 static int interrupt_cnt_enable_read(struct counter_device *counter, in interrupt_cnt_enable_read() argument 42 struct interrupt_cnt_priv *priv = counter_priv(counter); in interrupt_cnt_enable_read() 49 static int interrupt_cnt_enable_write(struct counter_device *counter, in interrupt_cnt_enable_write() argument 52 struct interrupt_cnt_priv *priv = counter_priv(counter); in interrupt_cnt_enable_write() 77 static int interrupt_cnt_action_read(struct counter_device *counter, in interrupt_cnt_action_read() argument 87 static int interrupt_cnt_read(struct counter_device *counter, in interrupt_cnt_read() argument [all …]
|
D | stm32-timer-cnt.c | 3 * STM32 Timer Encoder and Counter driver 10 #include <linux/counter.h> 46 static int stm32_count_read(struct counter_device *counter, in stm32_count_read() argument 49 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_read() 58 static int stm32_count_write(struct counter_device *counter, in stm32_count_write() argument 61 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_write() 71 static int stm32_count_function_read(struct counter_device *counter, in stm32_count_function_read() argument 75 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_function_read() 98 static int stm32_count_function_write(struct counter_device *counter, in stm32_count_function_write() argument 102 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_function_write() [all …]
|
D | i8254.c | 8 #include <linux/counter.h> 46 * @preset: array of Counter Register states 57 static int i8254_count_read(struct counter_device *const counter, struct counter_count *const count, in i8254_count_read() argument 60 struct i8254 *const priv = counter_priv(counter); in i8254_count_read() 84 static int i8254_function_read(struct counter_device *const counter, in i8254_function_read() argument 96 static int i8254_action_read(struct counter_device *const counter, in i8254_action_read() argument 101 struct i8254 *const priv = counter_priv(counter); in i8254_action_read() 125 static int i8254_count_ceiling_read(struct counter_device *const counter, in i8254_count_ceiling_read() argument 128 struct i8254 *const priv = counter_priv(counter); in i8254_count_ceiling_read() 134 /* Rate Generator decrements 0 by one and the counter "wraps around" */ in i8254_count_ceiling_read() [all …]
|
D | counter-sysfs.c | 3 * Generic Counter sysfs interface 6 #include <linux/counter.h> 20 #include "counter-sysfs.h" 28 * struct counter_attribute - Counter sysfs attribute 30 * @l: node to add Counter attribute to attribute group list 31 * @comp: Counter component callbacks and data 32 * @scope: Counter scope of the attribute 109 struct counter_device *const counter = counter_from_dev(dev); in counter_comp_u8_show() local 115 err = a->comp.device_u8_read(counter, &data); in counter_comp_u8_show() 118 err = a->comp.signal_u8_read(counter, a->parent, &data); in counter_comp_u8_show() [all …]
|
D | ti-eqep.c | 5 * Counter driver for Texas Instruments Enhanced Quadrature Encoder Pulse (eQEP) 9 #include <linux/counter.h> 76 /* Position Counter Input Modes */ 85 struct counter_device counter; member 90 static struct ti_eqep_cnt *ti_eqep_count_from_counter(struct counter_device *counter) in ti_eqep_count_from_counter() argument 92 return counter_priv(counter); in ti_eqep_count_from_counter() 95 static int ti_eqep_count_read(struct counter_device *counter, in ti_eqep_count_read() argument 98 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_count_read() 107 static int ti_eqep_count_write(struct counter_device *counter, in ti_eqep_count_write() argument 110 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_count_write() [all …]
|
D | Kconfig | 3 # Counter devices 8 select COUNTER 21 menuconfig COUNTER config 22 tristate "Counter support" 24 This enables counter device support through the Generic Counter 26 one or more of the counter device drivers below. 28 if COUNTER 38 encoder counter/interface device family (104-QUAD-8, 104-QUAD-4). 40 A counter's respective error flag may be cleared by performing a write 42 counters may be set either directly or via the counter's preset [all …]
|
D | stm32-lptimer-cnt.c | 3 * STM32 Low-Power Timer Encoder and Counter driver 14 #include <linux/counter.h> 100 /* Setup LP timer encoder/counter and polarity, without prescaler */ in stm32_lptim_setup() 140 static int stm32_lptim_cnt_read(struct counter_device *counter, in stm32_lptim_cnt_read() argument 143 struct stm32_lptim_cnt *const priv = counter_priv(counter); in stm32_lptim_cnt_read() 156 static int stm32_lptim_cnt_function_read(struct counter_device *counter, in stm32_lptim_cnt_function_read() argument 160 struct stm32_lptim_cnt *const priv = counter_priv(counter); in stm32_lptim_cnt_function_read() 175 static int stm32_lptim_cnt_function_write(struct counter_device *counter, in stm32_lptim_cnt_function_write() argument 179 struct stm32_lptim_cnt *const priv = counter_priv(counter); in stm32_lptim_cnt_function_write() 198 static int stm32_lptim_cnt_enable_read(struct counter_device *counter, in stm32_lptim_cnt_enable_read() argument [all …]
|
/Linux-v6.6/drivers/net/ethernet/marvell/prestera/ |
D | prestera_counter.c | 50 static void prestera_counter_lock(struct prestera_counter *counter) in prestera_counter_lock() argument 52 mutex_lock(&counter->mtx); in prestera_counter_lock() 55 static void prestera_counter_unlock(struct prestera_counter *counter) in prestera_counter_unlock() argument 57 mutex_unlock(&counter->mtx); in prestera_counter_unlock() 89 prestera_counter_block_lookup_not_full(struct prestera_counter *counter, in prestera_counter_block_lookup_not_full() argument 94 prestera_counter_lock(counter); in prestera_counter_block_lookup_not_full() 95 for (i = 0; i < counter->block_list_len; i++) { in prestera_counter_block_lookup_not_full() 96 if (counter->block_list[i] && in prestera_counter_block_lookup_not_full() 97 counter->block_list[i]->client == client && in prestera_counter_block_lookup_not_full() 98 !counter->block_list[i]->full && in prestera_counter_block_lookup_not_full() [all …]
|
/Linux-v6.6/tools/testing/selftests/netfilter/ |
D | nft_meta.sh | 30 counter iifcount {} 31 counter iifnamecount {} 32 counter iifgroupcount {} 33 counter iiftypecount {} 34 counter infproto4count {} 35 counter il4protocounter {} 36 counter imarkcounter {} 37 counter icpu0counter {} 38 counter ilastyearcounter {} 39 counter icurrentyearcounter {} [all …]
|
/Linux-v6.6/drivers/infiniband/core/ |
D | counters.c | 37 * Return 0 on success. If counter mode wasn't changed then it is considered 78 static void auto_mode_init_counter(struct rdma_counter *counter, in auto_mode_init_counter() argument 82 struct auto_mode_param *param = &counter->mode.param; in auto_mode_init_counter() 84 counter->mode.mode = RDMA_COUNTER_MODE_AUTO; in auto_mode_init_counter() 85 counter->mode.mask = new_mask; in auto_mode_init_counter() 91 static int __rdma_counter_bind_qp(struct rdma_counter *counter, in __rdma_counter_bind_qp() argument 96 if (qp->counter) in __rdma_counter_bind_qp() 102 mutex_lock(&counter->lock); in __rdma_counter_bind_qp() 103 ret = qp->device->ops.counter_bind_qp(counter, qp); in __rdma_counter_bind_qp() 104 mutex_unlock(&counter->lock); in __rdma_counter_bind_qp() [all …]
|
/Linux-v6.6/Documentation/ABI/testing/ |
D | sysfs-bus-counter | 1 What: /sys/bus/counter/devices/counterX/cascade_counts_enable 5 Indicates the cascading of Counts on Counter X. 9 What: /sys/bus/counter/devices/counterX/external_input_phase_clock_select 14 Counter X. 24 What: /sys/bus/counter/devices/counterX/external_input_phase_clock_select_available 31 What: /sys/bus/counter/devices/counterX/countY/count 37 What: /sys/bus/counter/devices/counterX/countY/capture 43 What: /sys/bus/counter/devices/counterX/countY/ceiling 48 respective counter. 50 What: /sys/bus/counter/devices/counterX/countY/floor [all …]
|
/Linux-v6.6/drivers/comedi/drivers/ |
D | ni_tio.c | 22 * originally based on the counter code from ni_660x.c and 145 * @counter: struct ni_gpct counter. 149 void ni_tio_write(struct ni_gpct *counter, unsigned int value, in ni_tio_write() argument 153 counter->counter_dev->write(counter, value, reg); in ni_tio_write() 159 * @counter: struct ni_gpct counter. 162 unsigned int ni_tio_read(struct ni_gpct *counter, enum ni_gpct_register reg) in ni_tio_read() argument 165 return counter->counter_dev->read(counter, reg); in ni_tio_read() 170 static void ni_tio_reset_count_and_disarm(struct ni_gpct *counter) in ni_tio_reset_count_and_disarm() argument 172 unsigned int cidx = counter->counter_index; in ni_tio_reset_count_and_disarm() 174 ni_tio_write(counter, GI_RESET(cidx), NITIO_RESET_REG(cidx)); in ni_tio_reset_count_and_disarm() [all …]
|
D | ni_tiocmd.c | 38 static void ni_tio_configure_dma(struct ni_gpct *counter, in ni_tio_configure_dma() argument 41 struct ni_gpct_device *counter_dev = counter->counter_dev; in ni_tio_configure_dma() 42 unsigned int cidx = counter->counter_index; in ni_tio_configure_dma() 55 ni_tio_set_bits(counter, NITIO_INPUT_SEL_REG(cidx), mask, bits); in ni_tio_configure_dma() 69 ni_tio_set_bits(counter, NITIO_DMA_CFG_REG(cidx), mask, bits); in ni_tio_configure_dma() 78 struct ni_gpct *counter = s->private; in ni_tio_input_inttrig() local 86 spin_lock_irqsave(&counter->lock, flags); in ni_tio_input_inttrig() 87 if (counter->mite_chan) in ni_tio_input_inttrig() 88 mite_dma_arm(counter->mite_chan); in ni_tio_input_inttrig() 91 spin_unlock_irqrestore(&counter->lock, flags); in ni_tio_input_inttrig() [all …]
|
D | comedi_8254.c | 4 * Generic 8254 timer/counter support 15 * Description: Generic 8254 timer/counter support 53 * Writes an initial value to a counter. 58 * NOTE: The counter does not stop when it reaches zero. In Mode 0, 1, 4, 59 * and 5 the counter "wraps around" to the highest count, either 0xffff 61 * Modes 2 and 3 are periodic; the counter reloads itself with the initial 65 * Reads the current value from a counter. 68 * Reads the status of a counter. 78 * Calculates the divisor value needed for a single counter to generate 99 * Internally flags a counter as "busy". This is done to protect the [all …]
|
/Linux-v6.6/Documentation/driver-api/ |
D | generic-counter.rst | 4 Generic Counter Interface 10 Counter devices are prevalent among a diverse spectrum of industries. 13 resolve the issue of duplicate code found among existing counter device 14 drivers by introducing a generic counter interface for consumption. The 15 Generic Counter interface enables drivers to support and expose a common 16 set of components and functionality present in counter devices. 21 Counter devices can vary greatly in design, but regardless of whether 23 counter devices consist of a core set of components. This core set of 24 components, shared by all counter devices, is what forms the essence of 25 the Generic Counter interface. [all …]
|
/Linux-v6.6/mm/ |
D | page_counter.c | 45 * page_counter_cancel - take pages out of the local counter 46 * @counter: counter 49 void page_counter_cancel(struct page_counter *counter, unsigned long nr_pages) in page_counter_cancel() argument 53 new = atomic_long_sub_return(nr_pages, &counter->usage); in page_counter_cancel() 58 atomic_long_set(&counter->usage, new); in page_counter_cancel() 60 propagate_protected_usage(counter, new); in page_counter_cancel() 65 * @counter: counter 68 * NOTE: This does not consider any configured counter limits. 70 void page_counter_charge(struct page_counter *counter, unsigned long nr_pages) in page_counter_charge() argument 74 for (c = counter; c; c = c->parent) { in page_counter_charge() [all …]
|
/Linux-v6.6/drivers/net/ethernet/mellanox/mlx5/core/ |
D | fs_counters.c | 83 * dump (access to struct mlx5_fc) after a counter is destroyed. 85 * access to counter list: 94 * - add a counter to lockless dellist 114 struct mlx5_fc *counter; in mlx5_fc_counters_lookup_next() local 120 counter, tmp, next_id) { in mlx5_fc_counters_lookup_next() 121 if (!list_empty(&counter->list)) in mlx5_fc_counters_lookup_next() 126 return counter ? &counter->list : &fc_stats->counters; in mlx5_fc_counters_lookup_next() 130 struct mlx5_fc *counter) in mlx5_fc_stats_insert() argument 132 struct list_head *next = mlx5_fc_counters_lookup_next(dev, counter->id); in mlx5_fc_stats_insert() 134 list_add_tail(&counter->list, next); in mlx5_fc_stats_insert() [all …]
|
/Linux-v6.6/arch/arm/include/asm/ |
D | atomic.h | 25 #define arch_atomic_read(v) READ_ONCE((v)->counter) 26 #define arch_atomic_set(v,i) WRITE_ONCE(((v)->counter), (i)) 42 prefetchw(&v->counter); \ 49 : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) \ 50 : "r" (&v->counter), "Ir" (i) \ 60 prefetchw(&v->counter); \ 68 : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) \ 69 : "r" (&v->counter), "Ir" (i) \ 81 prefetchw(&v->counter); \ 89 : "=&r" (result), "=&r" (val), "=&r" (tmp), "+Qo" (v->counter) \ [all …]
|
/Linux-v6.6/tools/perf/ |
D | design.txt | 12 The Linux Performance Counter subsystem provides an abstraction of these 13 hardware capabilities. It provides per task and per CPU counters, counter 19 There's one file descriptor per virtual counter used. 29 VFS system calls: read() can be used to read the counter, fcntl() 35 When creating a new counter fd, 'perf_event_attr' is: 40 * specific (raw) counter configuration data, if unset, the next 71 The 'config' field specifies what the counter should count. It 78 If 'raw_type' is 1, then the counter will count a hardware event 82 If 'raw_type' is 0, then the 'type' field says what kind of counter 91 A counter of PERF_TYPE_HARDWARE will count the hardware event [all …]
|
/Linux-v6.6/include/linux/ |
D | counter.h | 3 * Counter interface 17 #include <uapi/linux/counter.h> 39 * struct counter_comp - Counter component node 40 * @type: Counter component data type 157 int (*action_read)(struct counter_device *counter, 161 int (*device_u8_read)(struct counter_device *counter, u8 *val); 162 int (*count_u8_read)(struct counter_device *counter, 164 int (*signal_u8_read)(struct counter_device *counter, 166 int (*device_u32_read)(struct counter_device *counter, 168 int (*count_u32_read)(struct counter_device *counter, [all …]
|
D | page_counter.h | 47 static inline void page_counter_init(struct page_counter *counter, in page_counter_init() argument 50 atomic_long_set(&counter->usage, 0); in page_counter_init() 51 counter->max = PAGE_COUNTER_MAX; in page_counter_init() 52 counter->parent = parent; in page_counter_init() 55 static inline unsigned long page_counter_read(struct page_counter *counter) in page_counter_read() argument 57 return atomic_long_read(&counter->usage); in page_counter_read() 60 void page_counter_cancel(struct page_counter *counter, unsigned long nr_pages); 61 void page_counter_charge(struct page_counter *counter, unsigned long nr_pages); 62 bool page_counter_try_charge(struct page_counter *counter, 65 void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages); [all …]
|