nvmet.h (77d651a65569a5e60f314b768500e94fcb936311) nvmet.h (ab7a2737ac5acd7d485ca45d8772497717fbc781)
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (c) 2015-2016 HGST, a Western Digital Company.
4 */
5
6#ifndef _NVMET_H
7#define _NVMET_H
8

--- 568 unchanged lines hidden (view full) ---

577}
578
579#ifdef CONFIG_NVME_TARGET_PASSTHRU
580void nvmet_passthru_subsys_free(struct nvmet_subsys *subsys);
581int nvmet_passthru_ctrl_enable(struct nvmet_subsys *subsys);
582void nvmet_passthru_ctrl_disable(struct nvmet_subsys *subsys);
583u16 nvmet_parse_passthru_admin_cmd(struct nvmet_req *req);
584u16 nvmet_parse_passthru_io_cmd(struct nvmet_req *req);
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (c) 2015-2016 HGST, a Western Digital Company.
4 */
5
6#ifndef _NVMET_H
7#define _NVMET_H
8

--- 568 unchanged lines hidden (view full) ---

577}
578
579#ifdef CONFIG_NVME_TARGET_PASSTHRU
580void nvmet_passthru_subsys_free(struct nvmet_subsys *subsys);
581int nvmet_passthru_ctrl_enable(struct nvmet_subsys *subsys);
582void nvmet_passthru_ctrl_disable(struct nvmet_subsys *subsys);
583u16 nvmet_parse_passthru_admin_cmd(struct nvmet_req *req);
584u16 nvmet_parse_passthru_io_cmd(struct nvmet_req *req);
585static inline struct nvme_ctrl *nvmet_passthru_ctrl(struct nvmet_subsys *subsys)
585static inline bool nvmet_is_passthru_subsys(struct nvmet_subsys *subsys)
586{
587 return subsys->passthru_ctrl;
588}
589#else /* CONFIG_NVME_TARGET_PASSTHRU */
590static inline void nvmet_passthru_subsys_free(struct nvmet_subsys *subsys)
591{
592}
593static inline void nvmet_passthru_ctrl_disable(struct nvmet_subsys *subsys)
594{
595}
596static inline u16 nvmet_parse_passthru_admin_cmd(struct nvmet_req *req)
597{
598 return 0;
599}
600static inline u16 nvmet_parse_passthru_io_cmd(struct nvmet_req *req)
601{
602 return 0;
603}
586{
587 return subsys->passthru_ctrl;
588}
589#else /* CONFIG_NVME_TARGET_PASSTHRU */
590static inline void nvmet_passthru_subsys_free(struct nvmet_subsys *subsys)
591{
592}
593static inline void nvmet_passthru_ctrl_disable(struct nvmet_subsys *subsys)
594{
595}
596static inline u16 nvmet_parse_passthru_admin_cmd(struct nvmet_req *req)
597{
598 return 0;
599}
600static inline u16 nvmet_parse_passthru_io_cmd(struct nvmet_req *req)
601{
602 return 0;
603}
604static inline struct nvme_ctrl *nvmet_passthru_ctrl(struct nvmet_subsys *subsys)
604static inline bool nvmet_is_passthru_subsys(struct nvmet_subsys *subsys)
605{
606 return NULL;
607}
608#endif /* CONFIG_NVME_TARGET_PASSTHRU */
609
605{
606 return NULL;
607}
608#endif /* CONFIG_NVME_TARGET_PASSTHRU */
609
610static inline struct nvme_ctrl *
611nvmet_req_passthru_ctrl(struct nvmet_req *req)
610static inline bool nvmet_is_passthru_req(struct nvmet_req *req)
612{
611{
613 return nvmet_passthru_ctrl(nvmet_req_subsys(req));
612 return nvmet_is_passthru_subsys(nvmet_req_subsys(req));
614}
615
616void nvmet_passthrough_override_cap(struct nvmet_ctrl *ctrl);
617
618u16 errno_to_nvme_status(struct nvmet_req *req, int errno);
619u16 nvmet_report_invalid_opcode(struct nvmet_req *req);
620
621/* Convert a 32-bit number to a 16-bit 0's based number */

--- 43 unchanged lines hidden ---
613}
614
615void nvmet_passthrough_override_cap(struct nvmet_ctrl *ctrl);
616
617u16 errno_to_nvme_status(struct nvmet_req *req, int errno);
618u16 nvmet_report_invalid_opcode(struct nvmet_req *req);
619
620/* Convert a 32-bit number to a 16-bit 0's based number */

--- 43 unchanged lines hidden ---