Lines Matching refs: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()
292 if (!nvme_ctrl_use_ana(nvme_get_ns_from_dev(dev)->ctrl)) in nvme_ns_attrs_are_visible()
359 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); \
361 (int)sizeof(ctrl->subsys->field), ctrl->subsys->field); \
373 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); \
374 return sysfs_emit(buf, "%d\n", ctrl->field); \
388 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_sysfs_delete() local
390 if (!test_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags)) in nvme_sysfs_delete()
394 nvme_delete_ctrl_sync(ctrl); in nvme_sysfs_delete()
403 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_sysfs_show_transport() local
405 return sysfs_emit(buf, "%s\n", ctrl->ops->name); in nvme_sysfs_show_transport()
413 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_sysfs_show_state() local
414 unsigned state = (unsigned)nvme_ctrl_state(ctrl); in nvme_sysfs_show_state()
437 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_sysfs_show_subsysnqn() local
439 return sysfs_emit(buf, "%s\n", ctrl->subsys->subnqn); in nvme_sysfs_show_subsysnqn()
447 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_sysfs_show_hostnqn() local
449 return sysfs_emit(buf, "%s\n", ctrl->opts->host->nqn); in nvme_sysfs_show_hostnqn()
457 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_sysfs_show_hostid() local
459 return sysfs_emit(buf, "%pU\n", &ctrl->opts->host->id); in nvme_sysfs_show_hostid()
467 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_sysfs_show_address() local
469 return ctrl->ops->get_address(ctrl, buf, PAGE_SIZE); in nvme_sysfs_show_address()
476 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_loss_tmo_show() local
477 struct nvmf_ctrl_options *opts = ctrl->opts; in nvme_ctrl_loss_tmo_show()
479 if (ctrl->opts->max_reconnects == -1) in nvme_ctrl_loss_tmo_show()
488 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_loss_tmo_store() local
489 struct nvmf_ctrl_options *opts = ctrl->opts; in nvme_ctrl_loss_tmo_store()
509 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_reconnect_delay_show() local
511 if (ctrl->opts->reconnect_delay == -1) in nvme_ctrl_reconnect_delay_show()
513 return sysfs_emit(buf, "%d\n", ctrl->opts->reconnect_delay); in nvme_ctrl_reconnect_delay_show()
519 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_reconnect_delay_store() local
527 ctrl->opts->reconnect_delay = v; in nvme_ctrl_reconnect_delay_store()
536 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_fast_io_fail_tmo_show() local
538 if (ctrl->opts->fast_io_fail_tmo == -1) in nvme_ctrl_fast_io_fail_tmo_show()
540 return sysfs_emit(buf, "%d\n", ctrl->opts->fast_io_fail_tmo); in nvme_ctrl_fast_io_fail_tmo_show()
546 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_fast_io_fail_tmo_store() local
547 struct nvmf_ctrl_options *opts = ctrl->opts; in nvme_ctrl_fast_io_fail_tmo_store()
571 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in cntrltype_show() local
573 if (ctrl->cntrltype > NVME_CTRL_ADMIN || !type[ctrl->cntrltype]) in cntrltype_show()
576 return sysfs_emit(buf, type[ctrl->cntrltype]); in cntrltype_show()
588 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in dctype_show() local
590 if (ctrl->dctype > NVME_DCTYPE_CDC || !type[ctrl->dctype]) in dctype_show()
593 return sysfs_emit(buf, type[ctrl->dctype]); in dctype_show()
601 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_dhchap_secret_show() local
602 struct nvmf_ctrl_options *opts = ctrl->opts; in nvme_ctrl_dhchap_secret_show()
612 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_dhchap_secret_store() local
613 struct nvmf_ctrl_options *opts = ctrl->opts; in nvme_ctrl_dhchap_secret_store()
616 if (!ctrl->opts->dhchap_secret) in nvme_ctrl_dhchap_secret_store()
627 nvme_auth_stop(ctrl); in nvme_ctrl_dhchap_secret_store()
639 host_key = ctrl->host_key; in nvme_ctrl_dhchap_secret_store()
640 mutex_lock(&ctrl->dhchap_auth_mutex); in nvme_ctrl_dhchap_secret_store()
641 ctrl->host_key = key; in nvme_ctrl_dhchap_secret_store()
642 mutex_unlock(&ctrl->dhchap_auth_mutex); in nvme_ctrl_dhchap_secret_store()
647 dev_info(ctrl->device, "re-authenticating controller\n"); in nvme_ctrl_dhchap_secret_store()
648 queue_work(nvme_wq, &ctrl->dhchap_auth_work); in nvme_ctrl_dhchap_secret_store()
659 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_dhchap_ctrl_secret_show() local
660 struct nvmf_ctrl_options *opts = ctrl->opts; in nvme_ctrl_dhchap_ctrl_secret_show()
670 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_ctrl_dhchap_ctrl_secret_store() local
671 struct nvmf_ctrl_options *opts = ctrl->opts; in nvme_ctrl_dhchap_ctrl_secret_store()
674 if (!ctrl->opts->dhchap_ctrl_secret) in nvme_ctrl_dhchap_ctrl_secret_store()
685 nvme_auth_stop(ctrl); in nvme_ctrl_dhchap_ctrl_secret_store()
697 ctrl_key = ctrl->ctrl_key; in nvme_ctrl_dhchap_ctrl_secret_store()
698 mutex_lock(&ctrl->dhchap_auth_mutex); in nvme_ctrl_dhchap_ctrl_secret_store()
699 ctrl->ctrl_key = key; in nvme_ctrl_dhchap_ctrl_secret_store()
700 mutex_unlock(&ctrl->dhchap_auth_mutex); in nvme_ctrl_dhchap_ctrl_secret_store()
705 dev_info(ctrl->device, "re-authenticating controller\n"); in nvme_ctrl_dhchap_ctrl_secret_store()
706 queue_work(nvme_wq, &ctrl->dhchap_auth_work); in nvme_ctrl_dhchap_ctrl_secret_store()
750 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_dev_attrs_are_visible() local
752 if (a == &dev_attr_delete_controller.attr && !ctrl->ops->delete_ctrl) in nvme_dev_attrs_are_visible()
754 if (a == &dev_attr_address.attr && !ctrl->ops->get_address) in nvme_dev_attrs_are_visible()
756 if (a == &dev_attr_hostnqn.attr && !ctrl->opts) in nvme_dev_attrs_are_visible()
758 if (a == &dev_attr_hostid.attr && !ctrl->opts) in nvme_dev_attrs_are_visible()
760 if (a == &dev_attr_ctrl_loss_tmo.attr && !ctrl->opts) in nvme_dev_attrs_are_visible()
762 if (a == &dev_attr_reconnect_delay.attr && !ctrl->opts) in nvme_dev_attrs_are_visible()
764 if (a == &dev_attr_fast_io_fail_tmo.attr && !ctrl->opts) in nvme_dev_attrs_are_visible()
767 if (a == &dev_attr_dhchap_secret.attr && !ctrl->opts) in nvme_dev_attrs_are_visible()
769 if (a == &dev_attr_dhchap_ctrl_secret.attr && !ctrl->opts) in nvme_dev_attrs_are_visible()
786 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in tls_key_show() local
788 if (!ctrl->tls_pskid) in tls_key_show()
790 return sysfs_emit(buf, "%08x\n", ctrl->tls_pskid); in tls_key_show()
797 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in tls_configured_key_show() local
798 struct key *key = ctrl->opts->tls_key; in tls_configured_key_show()
807 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in tls_keyring_show() local
808 struct key *keyring = ctrl->opts->keyring; in tls_keyring_show()
825 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); in nvme_tls_attrs_are_visible() local
827 if (!ctrl->opts || strcmp(ctrl->opts->transport, "tcp")) in nvme_tls_attrs_are_visible()
831 !ctrl->opts->tls && !ctrl->opts->concat) in nvme_tls_attrs_are_visible()
834 (!ctrl->opts->tls_key || ctrl->opts->concat)) in nvme_tls_attrs_are_visible()
837 !ctrl->opts->keyring) in nvme_tls_attrs_are_visible()