Lines Matching full:ctrl
17 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_sysfs_reset() local
20 ret = nvme_reset_ctrl_sync(ctrl); in nvme_sysfs_reset()
31 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_sysfs_rescan() local
33 nvme_queue_scan(ctrl); in nvme_sysfs_rescan()
41 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_adm_passthru_err_log_enabled_show() local
44 ctrl->passthru_err_log_enabled ? "on\n" : "off\n"); in nvme_adm_passthru_err_log_enabled_show()
50 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_adm_passthru_err_log_enabled_store() local
58 ctrl->passthru_err_log_enabled = passthru_err_log_enabled; in nvme_adm_passthru_err_log_enabled_store()
201 ret = nvme_identify_ns(ns->ctrl, head->ns_id, &id); in ns_head_update_nuse()
222 ret = nvme_identify_ns(ns->ctrl, ns->head->ns_id, &id); in ns_update_nuse()
293 if (!nvme_ctrl_use_ana(nvme_get_ns_from_dev(dev)->ctrl)) in nvme_ns_attrs_are_visible()
366 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); \
368 (int)sizeof(ctrl->subsys->field), ctrl->subsys->field); \
380 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); \
381 return sysfs_emit(buf, "%d\n", ctrl->field); \
395 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_sysfs_delete() local
397 if (!test_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags)) in nvme_sysfs_delete()
401 nvme_delete_ctrl_sync(ctrl); in nvme_sysfs_delete()
410 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_sysfs_show_transport() local
412 return sysfs_emit(buf, "%s\n", ctrl->ops->name); in nvme_sysfs_show_transport()
420 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_sysfs_show_state() local
421 unsigned state = (unsigned)nvme_ctrl_state(ctrl); in nvme_sysfs_show_state()
444 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_sysfs_show_subsysnqn() local
446 return sysfs_emit(buf, "%s\n", ctrl->subsys->subnqn); in nvme_sysfs_show_subsysnqn()
454 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_sysfs_show_hostnqn() local
456 return sysfs_emit(buf, "%s\n", ctrl->opts->host->nqn); in nvme_sysfs_show_hostnqn()
464 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_sysfs_show_hostid() local
466 return sysfs_emit(buf, "%pU\n", &ctrl->opts->host->id); in nvme_sysfs_show_hostid()
474 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_sysfs_show_address() local
476 return ctrl->ops->get_address(ctrl, buf, PAGE_SIZE); in nvme_sysfs_show_address()
483 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_loss_tmo_show() local
484 struct nvmf_ctrl_options *opts = ctrl->opts; in nvme_ctrl_loss_tmo_show()
486 if (ctrl->opts->max_reconnects == -1) in nvme_ctrl_loss_tmo_show()
495 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_loss_tmo_store() local
496 struct nvmf_ctrl_options *opts = ctrl->opts; in nvme_ctrl_loss_tmo_store()
516 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_reconnect_delay_show() local
518 if (ctrl->opts->reconnect_delay == -1) in nvme_ctrl_reconnect_delay_show()
520 return sysfs_emit(buf, "%d\n", ctrl->opts->reconnect_delay); in nvme_ctrl_reconnect_delay_show()
526 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_reconnect_delay_store() local
534 ctrl->opts->reconnect_delay = v; in nvme_ctrl_reconnect_delay_store()
543 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_fast_io_fail_tmo_show() local
545 if (ctrl->opts->fast_io_fail_tmo == -1) in nvme_ctrl_fast_io_fail_tmo_show()
547 return sysfs_emit(buf, "%d\n", ctrl->opts->fast_io_fail_tmo); in nvme_ctrl_fast_io_fail_tmo_show()
553 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_fast_io_fail_tmo_store() local
554 struct nvmf_ctrl_options *opts = ctrl->opts; in nvme_ctrl_fast_io_fail_tmo_store()
578 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in cntrltype_show() local
580 if (ctrl->cntrltype > NVME_CTRL_ADMIN || !type[ctrl->cntrltype]) in cntrltype_show()
583 return sysfs_emit(buf, type[ctrl->cntrltype]); in cntrltype_show()
595 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in dctype_show() local
597 if (ctrl->dctype > NVME_DCTYPE_CDC || !type[ctrl->dctype]) in dctype_show()
600 return sysfs_emit(buf, type[ctrl->dctype]); in dctype_show()
608 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_dhchap_secret_show() local
609 struct nvmf_ctrl_options *opts = ctrl->opts; in nvme_ctrl_dhchap_secret_show()
619 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_dhchap_secret_store() local
620 struct nvmf_ctrl_options *opts = ctrl->opts; in nvme_ctrl_dhchap_secret_store()
623 if (!ctrl->opts->dhchap_secret) in nvme_ctrl_dhchap_secret_store()
634 nvme_auth_stop(ctrl); in nvme_ctrl_dhchap_secret_store()
646 host_key = ctrl->host_key; in nvme_ctrl_dhchap_secret_store()
647 mutex_lock(&ctrl->dhchap_auth_mutex); in nvme_ctrl_dhchap_secret_store()
648 ctrl->host_key = key; in nvme_ctrl_dhchap_secret_store()
649 mutex_unlock(&ctrl->dhchap_auth_mutex); in nvme_ctrl_dhchap_secret_store()
654 dev_info(ctrl->device, "re-authenticating controller\n"); in nvme_ctrl_dhchap_secret_store()
655 queue_work(nvme_wq, &ctrl->dhchap_auth_work); in nvme_ctrl_dhchap_secret_store()
666 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_dhchap_ctrl_secret_show() local
667 struct nvmf_ctrl_options *opts = ctrl->opts; in nvme_ctrl_dhchap_ctrl_secret_show()
677 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_dhchap_ctrl_secret_store() local
678 struct nvmf_ctrl_options *opts = ctrl->opts; in nvme_ctrl_dhchap_ctrl_secret_store()
681 if (!ctrl->opts->dhchap_ctrl_secret) in nvme_ctrl_dhchap_ctrl_secret_store()
692 nvme_auth_stop(ctrl); in nvme_ctrl_dhchap_ctrl_secret_store()
704 ctrl_key = ctrl->ctrl_key; in nvme_ctrl_dhchap_ctrl_secret_store()
705 mutex_lock(&ctrl->dhchap_auth_mutex); in nvme_ctrl_dhchap_ctrl_secret_store()
706 ctrl->ctrl_key = key; in nvme_ctrl_dhchap_ctrl_secret_store()
707 mutex_unlock(&ctrl->dhchap_auth_mutex); in nvme_ctrl_dhchap_ctrl_secret_store()
712 dev_info(ctrl->device, "re-authenticating controller\n"); in nvme_ctrl_dhchap_ctrl_secret_store()
713 queue_work(nvme_wq, &ctrl->dhchap_auth_work); in nvme_ctrl_dhchap_ctrl_secret_store()
757 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_dev_attrs_are_visible() local
759 if (a == &dev_attr_delete_controller.attr && !ctrl->ops->delete_ctrl) in nvme_dev_attrs_are_visible()
761 if (a == &dev_attr_address.attr && !ctrl->ops->get_address) in nvme_dev_attrs_are_visible()
763 if (a == &dev_attr_hostnqn.attr && !ctrl->opts) in nvme_dev_attrs_are_visible()
765 if (a == &dev_attr_hostid.attr && !ctrl->opts) in nvme_dev_attrs_are_visible()
767 if (a == &dev_attr_ctrl_loss_tmo.attr && !ctrl->opts) in nvme_dev_attrs_are_visible()
769 if (a == &dev_attr_reconnect_delay.attr && !ctrl->opts) in nvme_dev_attrs_are_visible()
771 if (a == &dev_attr_fast_io_fail_tmo.attr && !ctrl->opts) in nvme_dev_attrs_are_visible()
774 if (a == &dev_attr_dhchap_secret.attr && !ctrl->opts) in nvme_dev_attrs_are_visible()
776 if (a == &dev_attr_dhchap_ctrl_secret.attr && !ctrl->opts) in nvme_dev_attrs_are_visible()
793 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in tls_key_show() local
795 if (!ctrl->tls_pskid) in tls_key_show()
797 return sysfs_emit(buf, "%08x\n", ctrl->tls_pskid); in tls_key_show()
804 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in tls_configured_key_show() local
805 struct key *key = ctrl->opts->tls_key; in tls_configured_key_show()
814 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in tls_keyring_show() local
815 struct key *keyring = ctrl->opts->keyring; in tls_keyring_show()
832 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_tls_attrs_are_visible() local
834 if (!ctrl->opts || strcmp(ctrl->opts->transport, "tcp")) in nvme_tls_attrs_are_visible()
838 !ctrl->opts->tls && !ctrl->opts->concat) in nvme_tls_attrs_are_visible()
841 (!ctrl->opts->tls_key || ctrl->opts->concat)) in nvme_tls_attrs_are_visible()
844 !ctrl->opts->keyring) in nvme_tls_attrs_are_visible()