Lines Matching full:opt
61 } opt = {
69 #define OPT(l, s, t, opt, addr, desc) { l, s, t, &opt.addr, desc }
70 OPT("activate", 'a', arg_none, opt, activate,
72 OPT("slot", 's', arg_uint32, opt, slot,
74 OPT("firmware", 'f', arg_path, opt, fw_img,
78 #undef OPT
81 { arg_string, &opt.dev, "controller-id|namespace-id" },
89 .ctx_size = sizeof(opt),
243 if (opt.slot == 0) {
248 } else if (opt.slot > 7 && opt.slot != NONE) {
256 if (!opt.activate && opt.fw_img == NULL) {
264 if (opt.activate && opt.fw_img == NULL && opt.slot == 0) {
270 open_dev(opt.dev, &fd, 1, 1);
289 if (opt.fw_img && opt.slot == 1 && fw_slot1_ro)
290 errx(EX_UNAVAILABLE, "slot %d is marked as read only", opt.slot);
294 if (opt.slot > fw_num_slots)
297 opt.slot, fw_num_slots);
299 if (opt.activate && opt.fw_img == NULL &&
300 !slot_has_valid_firmware(fd, opt.slot))
305 opt.slot, opt.dev);
307 if (opt.fw_img)
308 read_image_file(opt.fw_img, &buf, &size);
310 if (opt.fw_img != NULL&& opt.activate)
315 opt.fw_img, opt.dev);
316 else if (opt.activate)
320 opt.dev);
321 else if (opt.fw_img != NULL)
326 opt.fw_img, opt.dev);
338 if (opt.fw_img != NULL) {
340 if (opt.activate)
348 reboot_required = activate_firmware(fd, opt.slot, activate_action);
350 if (opt.activate) {
360 opt.dev);