Lines Matching defs:opt
64 } opt = {
72 #define OPT(l, s, t, opt, addr, desc) { l, s, t, &opt.addr, desc }
73 OPT("activate", 'a', arg_none, opt, activate,
75 OPT("slot", 's', arg_uint32, opt, slot,
77 OPT("firmware", 'f', arg_path, opt, fw_img,
84 { arg_string, &opt.dev, "controller-id|namespace-id" },
92 .ctx_size = sizeof(opt),
245 if (opt.slot == 0) {
250 } else if (opt.slot > 7 && opt.slot != NONE) {
258 if (!opt.activate && opt.fw_img == NULL) {
266 if (opt.activate && opt.fw_img == NULL && opt.slot == 0) {
272 open_dev(opt.dev, &fd, 1, 1);
293 if (opt.fw_img && opt.slot == 1 && fw_slot1_ro)
294 errx(EX_UNAVAILABLE, "slot %d is marked as read only", opt.slot);
299 if (opt.slot > fw_num_slots)
302 opt.slot, fw_num_slots);
304 if (opt.activate && opt.fw_img == NULL &&
305 !slot_has_valid_firmware(fd, opt.slot))
310 opt.slot, opt.dev);
312 if (opt.fw_img)
313 read_image_file(opt.fw_img, &buf, &size);
315 if (opt.fw_img != NULL&& opt.activate)
320 opt.fw_img, opt.dev);
321 else if (opt.activate)
325 opt.dev);
326 else if (opt.fw_img != NULL)
331 opt.fw_img, opt.dev);
343 if (opt.fw_img != NULL) {
345 if (opt.activate)
353 reboot_required = activate_firmware(fd, opt.slot, activate_action);
355 if (opt.activate) {
365 opt.dev);