Lines Matching +full:s +full:- +full:mode

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
53 tmp += snprintf(buf, sz, "%u day%s", d, d == 1 ? "" : "s"); in mfi_autolearn_period()
54 sz -= tmp - buf; in mfi_autolearn_period()
57 sz -= 2; in mfi_autolearn_period()
61 snprintf(tmp, sz, "%u hour%s", h, h == 1 ? "" : "s"); in mfi_autolearn_period()
79 len = snprintf(buf, sz, "%s", ctime(&basetime)); in mfi_next_learn_time()
82 buf[len - 1] = '\0'; in mfi_next_learn_time()
86 mfi_autolearn_mode(uint8_t mode, char *buf, size_t sz) in mfi_autolearn_mode() argument
89 switch (mode) { in mfi_autolearn_mode()
100 snprintf(buf, sz, "mode 0x%02x", mode); in mfi_autolearn_mode()
147 warnx("Failed to start BBU learn: %s", mfi_status(status)); in start_bbu_learn()
162 char *mode, *endptr; in update_bbu_props() local
184 warnx("Failed to get BBU properties: %s", mfi_status(status)); in update_bbu_props()
189 if (strcmp(av[1], "learn-delay") == 0) { in update_bbu_props()
192 warnx("Invalid learn delay '%s'", av[2]); in update_bbu_props()
198 } else if (strcmp(av[1], "autolearn-mode") == 0) { in update_bbu_props()
199 mode = av[2]; in update_bbu_props()
205 else if (mode[0] >= '0' && mode[0] <= '2' && mode[1] == '\0') in update_bbu_props()
206 props.auto_learn_mode = mode[0] - '0'; in update_bbu_props()
208 warnx("Invalid mode '%s'", mode); in update_bbu_props()
212 } else if (strcmp(av[1], "bbu-mode") == 0) { in update_bbu_props()
219 /* The mode must be an integer between 1 and 5. */ in update_bbu_props()
220 mode = av[2]; in update_bbu_props()
221 if (mode[0] < '1' || mode[0] > '5' || mode[1] != '\0') { in update_bbu_props()
222 warnx("Invalid mode '%s'", mode); in update_bbu_props()
227 props.bbu_mode = mode[0] - '0'; in update_bbu_props()
229 warnx("bbu: Invalid command '%s'", av[1]); in update_bbu_props()
239 warnx("Failed to set BBU properties: %s", mfi_status(status)); in update_bbu_props()