nvme.h (1e05a7e6ebc4a5a5c53dce32e7e6d0ff5e7e08d1) | nvme.h (c0f2f45be2976abe973c8cd544f38e2d928771b0) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * Copyright (c) 2011-2014, Intel Corporation. 4 */ 5 6#ifndef _NVME_H 7#define _NVME_H 8 --- 78 unchanged lines hidden (view full) --- 87 * Ignore device provided subnqn. 88 */ 89 NVME_QUIRK_IGNORE_DEV_SUBNQN = (1 << 8), 90 91 /* 92 * Broken Write Zeroes. 93 */ 94 NVME_QUIRK_DISABLE_WRITE_ZEROES = (1 << 9), | 1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * Copyright (c) 2011-2014, Intel Corporation. 4 */ 5 6#ifndef _NVME_H 7#define _NVME_H 8 --- 78 unchanged lines hidden (view full) --- 87 * Ignore device provided subnqn. 88 */ 89 NVME_QUIRK_IGNORE_DEV_SUBNQN = (1 << 8), 90 91 /* 92 * Broken Write Zeroes. 93 */ 94 NVME_QUIRK_DISABLE_WRITE_ZEROES = (1 << 9), |
95 96 /* 97 * Force simple suspend/resume path. 98 */ 99 NVME_QUIRK_SIMPLE_SUSPEND = (1 << 10), | |
100}; 101 102/* 103 * Common request structure for NVMe passthrough. All drivers must have 104 * this structure as the first member of their request-private data. 105 */ 106struct nvme_request { 107 struct nvme_command *cmd; --- 319 unchanged lines hidden (view full) --- 427 put_device(ctrl->device); 428} 429 430void nvme_complete_rq(struct request *req); 431bool nvme_cancel_request(struct request *req, void *data, bool reserved); 432bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl, 433 enum nvme_ctrl_state new_state); 434int nvme_disable_ctrl(struct nvme_ctrl *ctrl, u64 cap); | 95}; 96 97/* 98 * Common request structure for NVMe passthrough. All drivers must have 99 * this structure as the first member of their request-private data. 100 */ 101struct nvme_request { 102 struct nvme_command *cmd; --- 319 unchanged lines hidden (view full) --- 422 put_device(ctrl->device); 423} 424 425void nvme_complete_rq(struct request *req); 426bool nvme_cancel_request(struct request *req, void *data, bool reserved); 427bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl, 428 enum nvme_ctrl_state new_state); 429int nvme_disable_ctrl(struct nvme_ctrl *ctrl, u64 cap); |
435int nvme_enable_ctrl(struct nvme_ctrl *ctrl, u64 cap); | 430int nvme_enable_ctrl(struct nvme_ctrl *ctrl); |
436int nvme_shutdown_ctrl(struct nvme_ctrl *ctrl); 437int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev, 438 const struct nvme_ctrl_ops *ops, unsigned long quirks); 439void nvme_uninit_ctrl(struct nvme_ctrl *ctrl); 440void nvme_start_ctrl(struct nvme_ctrl *ctrl); 441void nvme_stop_ctrl(struct nvme_ctrl *ctrl); 442void nvme_put_ctrl(struct nvme_ctrl *ctrl); 443int nvme_init_identify(struct nvme_ctrl *ctrl); --- 46 unchanged lines hidden (view full) --- 490extern const struct block_device_operations nvme_ns_head_ops; 491 492#ifdef CONFIG_NVME_MULTIPATH 493static inline bool nvme_ctrl_use_ana(struct nvme_ctrl *ctrl) 494{ 495 return ctrl->ana_log_buf != NULL; 496} 497 | 431int nvme_shutdown_ctrl(struct nvme_ctrl *ctrl); 432int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev, 433 const struct nvme_ctrl_ops *ops, unsigned long quirks); 434void nvme_uninit_ctrl(struct nvme_ctrl *ctrl); 435void nvme_start_ctrl(struct nvme_ctrl *ctrl); 436void nvme_stop_ctrl(struct nvme_ctrl *ctrl); 437void nvme_put_ctrl(struct nvme_ctrl *ctrl); 438int nvme_init_identify(struct nvme_ctrl *ctrl); --- 46 unchanged lines hidden (view full) --- 485extern const struct block_device_operations nvme_ns_head_ops; 486 487#ifdef CONFIG_NVME_MULTIPATH 488static inline bool nvme_ctrl_use_ana(struct nvme_ctrl *ctrl) 489{ 490 return ctrl->ana_log_buf != NULL; 491} 492 |
498void nvme_mpath_unfreeze(struct nvme_subsystem *subsys); 499void nvme_mpath_wait_freeze(struct nvme_subsystem *subsys); 500void nvme_mpath_start_freeze(struct nvme_subsystem *subsys); | |
501void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns, 502 struct nvme_ctrl *ctrl, int *flags); 503void nvme_failover_req(struct request *req); 504void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl); 505int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl,struct nvme_ns_head *head); 506void nvme_mpath_add_disk(struct nvme_ns *ns, struct nvme_id_ns *id); 507void nvme_mpath_remove_disk(struct nvme_ns_head *head); 508int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id); 509void nvme_mpath_uninit(struct nvme_ctrl *ctrl); 510void nvme_mpath_stop(struct nvme_ctrl *ctrl); | 493void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns, 494 struct nvme_ctrl *ctrl, int *flags); 495void nvme_failover_req(struct request *req); 496void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl); 497int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl,struct nvme_ns_head *head); 498void nvme_mpath_add_disk(struct nvme_ns *ns, struct nvme_id_ns *id); 499void nvme_mpath_remove_disk(struct nvme_ns_head *head); 500int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id); 501void nvme_mpath_uninit(struct nvme_ctrl *ctrl); 502void nvme_mpath_stop(struct nvme_ctrl *ctrl); |
511bool nvme_mpath_clear_current_path(struct nvme_ns *ns); 512void nvme_mpath_clear_ctrl_paths(struct nvme_ctrl *ctrl); | 503void nvme_mpath_clear_current_path(struct nvme_ns *ns); |
513struct nvme_ns *nvme_find_path(struct nvme_ns_head *head); 514 515static inline void nvme_mpath_check_last_path(struct nvme_ns *ns) 516{ 517 struct nvme_ns_head *head = ns->head; 518 519 if (head->disk && list_empty(&head->list)) 520 kblockd_schedule_work(&head->requeue_work); --- 31 unchanged lines hidden (view full) --- 552} 553static inline void nvme_mpath_add_disk(struct nvme_ns *ns, 554 struct nvme_id_ns *id) 555{ 556} 557static inline void nvme_mpath_remove_disk(struct nvme_ns_head *head) 558{ 559} | 504struct nvme_ns *nvme_find_path(struct nvme_ns_head *head); 505 506static inline void nvme_mpath_check_last_path(struct nvme_ns *ns) 507{ 508 struct nvme_ns_head *head = ns->head; 509 510 if (head->disk && list_empty(&head->list)) 511 kblockd_schedule_work(&head->requeue_work); --- 31 unchanged lines hidden (view full) --- 543} 544static inline void nvme_mpath_add_disk(struct nvme_ns *ns, 545 struct nvme_id_ns *id) 546{ 547} 548static inline void nvme_mpath_remove_disk(struct nvme_ns_head *head) 549{ 550} |
560static inline bool nvme_mpath_clear_current_path(struct nvme_ns *ns) | 551static inline void nvme_mpath_clear_current_path(struct nvme_ns *ns) |
561{ | 552{ |
562 return false; | |
563} | 553} |
564static inline void nvme_mpath_clear_ctrl_paths(struct nvme_ctrl *ctrl) 565{ 566} | |
567static inline void nvme_mpath_check_last_path(struct nvme_ns *ns) 568{ 569} 570static inline int nvme_mpath_init(struct nvme_ctrl *ctrl, 571 struct nvme_id_ctrl *id) 572{ 573 if (ctrl->subsys->cmic & (1 << 3)) 574 dev_warn(ctrl->device, 575"Please enable CONFIG_NVME_MULTIPATH for full support of multi-port devices.\n"); 576 return 0; 577} 578static inline void nvme_mpath_uninit(struct nvme_ctrl *ctrl) 579{ 580} 581static inline void nvme_mpath_stop(struct nvme_ctrl *ctrl) 582{ 583} | 554static inline void nvme_mpath_check_last_path(struct nvme_ns *ns) 555{ 556} 557static inline int nvme_mpath_init(struct nvme_ctrl *ctrl, 558 struct nvme_id_ctrl *id) 559{ 560 if (ctrl->subsys->cmic & (1 << 3)) 561 dev_warn(ctrl->device, 562"Please enable CONFIG_NVME_MULTIPATH for full support of multi-port devices.\n"); 563 return 0; 564} 565static inline void nvme_mpath_uninit(struct nvme_ctrl *ctrl) 566{ 567} 568static inline void nvme_mpath_stop(struct nvme_ctrl *ctrl) 569{ 570} |
584static inline void nvme_mpath_unfreeze(struct nvme_subsystem *subsys) 585{ 586} 587static inline void nvme_mpath_wait_freeze(struct nvme_subsystem *subsys) 588{ 589} 590static inline void nvme_mpath_start_freeze(struct nvme_subsystem *subsys) 591{ 592} | |
593#endif /* CONFIG_NVME_MULTIPATH */ 594 595#ifdef CONFIG_NVM 596int nvme_nvm_register(struct nvme_ns *ns, char *disk_name, int node); 597void nvme_nvm_unregister(struct nvme_ns *ns); 598extern const struct attribute_group nvme_nvm_attr_group; 599int nvme_nvm_ioctl(struct nvme_ns *ns, unsigned int cmd, unsigned long arg); 600#else --- 20 unchanged lines hidden --- | 571#endif /* CONFIG_NVME_MULTIPATH */ 572 573#ifdef CONFIG_NVM 574int nvme_nvm_register(struct nvme_ns *ns, char *disk_name, int node); 575void nvme_nvm_unregister(struct nvme_ns *ns); 576extern const struct attribute_group nvme_nvm_attr_group; 577int nvme_nvm_ioctl(struct nvme_ns *ns, unsigned int cmd, unsigned long arg); 578#else --- 20 unchanged lines hidden --- |