Lines Matching refs:config
11 static inline u8 can_ram_clamp(const struct can_ram_config *config, in can_ram_clamp() argument
17 max = min_t(u8, obj->max, obj->fifo_num * config->fifo_depth); in can_ram_clamp()
22 can_ram_rounddown_pow_of_two(const struct can_ram_config *config, in can_ram_rounddown_pow_of_two() argument
29 val = can_ram_clamp(config, obj, val); in can_ram_rounddown_pow_of_two()
38 ret = min_t(u8, coalesce * 2, config->fifo_depth); in can_ram_rounddown_pow_of_two()
47 config->fifo_depth); in can_ram_rounddown_pow_of_two()
61 const struct can_ram_config *config, in can_ram_get_layout() argument
71 num_tx = config->tx.def[fd_mode]; in can_ram_get_layout()
72 num_tx = can_ram_rounddown_pow_of_two(config, &config->tx, 0, num_tx); in can_ram_get_layout()
74 ram_free = config->size; in can_ram_get_layout()
75 ram_free -= config->tx.size[fd_mode] * num_tx; in can_ram_get_layout()
77 num_rx = ram_free / config->rx.size[fd_mode]; in can_ram_get_layout()
79 layout->default_rx = can_ram_rounddown_pow_of_two(config, &config->rx, 0, num_rx); in can_ram_get_layout()
84 ram_free = config->size; in can_ram_get_layout()
85 ram_free -= config->tx.size[fd_mode] * config->tx.min; in can_ram_get_layout()
86 num_rx = ram_free / config->rx.size[fd_mode]; in can_ram_get_layout()
88 ram_free = config->size; in can_ram_get_layout()
89 ram_free -= config->rx.size[fd_mode] * config->rx.min; in can_ram_get_layout()
90 num_tx = ram_free / config->tx.size[fd_mode]; in can_ram_get_layout()
92 layout->max_rx = can_ram_rounddown_pow_of_two(config, &config->rx, 0, num_rx); in can_ram_get_layout()
93 layout->max_tx = can_ram_rounddown_pow_of_two(config, &config->tx, 0, num_tx); in can_ram_get_layout()
100 num_rx = can_ram_rounddown_pow_of_two(config, &config->rx, 0, ring->rx_pending); in can_ram_get_layout()
110 max = min_t(u8, num_rx / 2, config->fifo_depth); in can_ram_get_layout()
112 (u32)config->rx.fifo_depth_coalesce_min, in can_ram_get_layout()
116 num_rx = can_ram_rounddown_pow_of_two(config, &config->rx, in can_ram_get_layout()
120 ram_free = config->size - config->rx.size[fd_mode] * num_rx; in can_ram_get_layout()
121 num_tx = ram_free / config->tx.size[fd_mode]; in can_ram_get_layout()
123 num_tx = can_ram_rounddown_pow_of_two(config, &config->tx, 0, num_tx); in can_ram_get_layout()
133 max = min_t(u8, num_tx / 2, config->fifo_depth); in can_ram_get_layout()
135 (u32)config->tx.fifo_depth_coalesce_min, in can_ram_get_layout()
139 num_tx = can_ram_rounddown_pow_of_two(config, &config->tx, in can_ram_get_layout()