diff options
Diffstat (limited to 'nvme-print.h')
-rw-r--r-- | nvme-print.h | 139 |
1 files changed, 71 insertions, 68 deletions
diff --git a/nvme-print.h b/nvme-print.h index b17172e..a3943cc 100644 --- a/nvme-print.h +++ b/nvme-print.h @@ -18,6 +18,8 @@ typedef struct nvme_effects_log_node { #define POWER_OF_TWO(exponent) (1 << (exponent)) +#define STR_LEN 100 + void d(unsigned char *buf, int len, int width, int group); void d_raw(unsigned char *buf, unsigned len); @@ -103,7 +105,7 @@ struct print_ops { void (*show_status)(int status); void (*show_error_status)(int status, const char *msg, va_list ap); - enum nvme_print_flags flags; + nvme_print_flags_t flags; }; struct nvme_bar_cap { @@ -129,158 +131,158 @@ struct nvme_bar_cap { #ifdef CONFIG_JSONC -struct print_ops *nvme_get_json_print_ops(enum nvme_print_flags flags); +struct print_ops *nvme_get_json_print_ops(nvme_print_flags_t flags); #else /* !CONFIG_JSONC */ -static inline struct print_ops *nvme_get_json_print_ops(enum nvme_print_flags flags) { return NULL; } +static inline struct print_ops *nvme_get_json_print_ops(nvme_print_flags_t flags) { return NULL; } #endif /* !CONFIG_JSONC */ -struct print_ops *nvme_get_stdout_print_ops(enum nvme_print_flags flags); -struct print_ops *nvme_get_binary_print_ops(enum nvme_print_flags flags); +struct print_ops *nvme_get_stdout_print_ops(nvme_print_flags_t flags); +struct print_ops *nvme_get_binary_print_ops(nvme_print_flags_t flags); void nvme_show_status(int status); void nvme_show_lba_status_info(__u32 result); void nvme_show_relatives(const char *name); -void nvme_show_id_iocs(struct nvme_id_iocs *iocs, enum nvme_print_flags flags); -void nvme_show_id_ctrl(struct nvme_id_ctrl *ctrl, enum nvme_print_flags flags, +void nvme_show_id_iocs(struct nvme_id_iocs *iocs, nvme_print_flags_t flags); +void nvme_show_id_ctrl(struct nvme_id_ctrl *ctrl, nvme_print_flags_t flags, void (*vendor_show)(__u8 *vs, struct json_object *root)); -void nvme_show_id_ctrl_rpmbs(__le32 ctrl_rpmbs, enum nvme_print_flags flags); +void nvme_show_id_ctrl_rpmbs(__le32 ctrl_rpmbs, nvme_print_flags_t flags); void nvme_show_id_ns(struct nvme_id_ns *ns, unsigned int nsid, - unsigned int lba_index, bool cap_only, enum nvme_print_flags flags); + unsigned int lba_index, bool cap_only, nvme_print_flags_t flags); void nvme_show_cmd_set_independent_id_ns( struct nvme_id_independent_id_ns *ns, unsigned int nsid, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_resv_report(struct nvme_resv_status *status, int bytes, bool eds, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_lba_range(struct nvme_lba_range_type *lbrt, int nr_ranges, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_supported_log(struct nvme_supported_log_pages *support, - const char *devname, enum nvme_print_flags flags); + const char *devname, nvme_print_flags_t flags); void nvme_show_error_log(struct nvme_error_log_page *err_log, int entries, - const char *devname, enum nvme_print_flags flags); -void nvme_show_smart_log(struct nvme_smart_log *smart, unsigned int nsid, - const char *devname, enum nvme_print_flags flags); + const char *devname, nvme_print_flags_t flags); +void nvme_show_smart_log(struct nvme_smart_log *smart, unsigned int nsid, const char *devname, + nvme_print_flags_t flags); void nvme_show_ana_log(struct nvme_ana_log *ana_log, const char *devname, - size_t len, enum nvme_print_flags flags); + size_t len, nvme_print_flags_t flags); void nvme_show_self_test_log(struct nvme_self_test_log *self_test, __u8 dst_entries, - __u32 size, const char *devname, enum nvme_print_flags flags); + __u32 size, const char *devname, nvme_print_flags_t flags); void nvme_show_fw_log(struct nvme_firmware_slot *fw_log, const char *devname, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_print_effects_log_pages(struct list_head *list, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_changed_ns_list_log(struct nvme_ns_list *log, - const char *devname, enum nvme_print_flags flags); + const char *devname, nvme_print_flags_t flags); void nvme_show_endurance_log(struct nvme_endurance_group_log *endurance_log, - __u16 group_id, const char *devname, enum nvme_print_flags flags); + __u16 group_id, const char *devname, nvme_print_flags_t flags); void nvme_show_sanitize_log(struct nvme_sanitize_log_page *sanitize, - const char *devname, enum nvme_print_flags flags); + const char *devname, nvme_print_flags_t flags); void nvme_show_predictable_latency_per_nvmset( struct nvme_nvmset_predictable_lat_log *plpns_log, - __u16 nvmset_id, const char *devname, enum nvme_print_flags flags); + __u16 nvmset_id, const char *devname, nvme_print_flags_t flags); void nvme_show_predictable_latency_event_agg_log( struct nvme_aggregate_predictable_lat_event *pea_log, __u64 log_entries, __u32 size, const char *devname, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_persistent_event_log(void *pevent_log_info, __u8 action, __u32 size, const char *devname, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_endurance_group_event_agg_log( struct nvme_aggregate_predictable_lat_event *endurance_log, __u64 log_entries, __u32 size, const char *devname, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_lba_status_log(void *lba_status, __u32 size, - const char *devname, enum nvme_print_flags flags); + const char *devname, nvme_print_flags_t flags); void nvme_show_resv_notif_log(struct nvme_resv_notification_log *resv, - const char *devname, enum nvme_print_flags flags); + const char *devname, nvme_print_flags_t flags); void nvme_show_boot_part_log(void *bp_log, const char *devname, - __u32 size, enum nvme_print_flags flags); + __u32 size, nvme_print_flags_t flags); void nvme_show_phy_rx_eom_log(struct nvme_phy_rx_eom_log *log, - __u16 controller, enum nvme_print_flags flags); + __u16 controller, nvme_print_flags_t flags); void nvme_show_fid_support_effects_log(struct nvme_fid_supported_effects_log *fid_log, - const char *devname, enum nvme_print_flags flags); + const char *devname, nvme_print_flags_t flags); void nvme_show_mi_cmd_support_effects_log(struct nvme_mi_cmd_supported_effects_log *mi_cmd_log, - const char *devname, enum nvme_print_flags flags); + const char *devname, nvme_print_flags_t flags); void nvme_show_media_unit_stat_log(struct nvme_media_unit_stat_log *mus, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_supported_cap_config_log(struct nvme_supported_cap_config_list_log *caplog, - enum nvme_print_flags flags); -void nvme_show_ctrl_registers(void *bar, bool fabrics, enum nvme_print_flags flags); -void nvme_show_ctrl_register(void *bar, bool fabrics, int offset, enum nvme_print_flags flags); -void nvme_show_single_property(int offset, uint64_t prop, enum nvme_print_flags flags); -void nvme_show_id_ns_descs(void *data, unsigned nsid, enum nvme_print_flags flags); + nvme_print_flags_t flags); +void nvme_show_ctrl_registers(void *bar, bool fabrics, nvme_print_flags_t flags); +void nvme_show_ctrl_register(void *bar, bool fabrics, int offset, nvme_print_flags_t flags); +void nvme_show_single_property(int offset, uint64_t prop, nvme_print_flags_t flags); +void nvme_show_id_ns_descs(void *data, unsigned int nsid, nvme_print_flags_t flags); void nvme_show_lba_status(struct nvme_lba_status *list, unsigned long len, - enum nvme_print_flags flags); -void nvme_show_list_items(nvme_root_t t, enum nvme_print_flags flags); + nvme_print_flags_t flags); +void nvme_show_list_items(nvme_root_t t, nvme_print_flags_t flags); void nvme_show_subsystem_list(nvme_root_t t, bool show_ana, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_id_nvmset(struct nvme_id_nvmset_list *nvmset, unsigned nvmset_id, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_primary_ctrl_cap(const struct nvme_primary_ctrl_cap *cap, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_list_secondary_ctrl(const struct nvme_secondary_ctrl_list *sc_list, - __u32 count, enum nvme_print_flags flags); + __u32 count, nvme_print_flags_t flags); void nvme_show_id_ns_granularity_list(const struct nvme_id_ns_granularity_list *glist, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_id_uuid_list(const struct nvme_id_uuid_list *uuid_list, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_list_ctrl(struct nvme_ctrl_list *ctrl_list, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_id_domain_list(struct nvme_id_domain_list *id_dom, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_endurance_group_list(struct nvme_id_endurance_group_list *endgrp_list, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_list_ns(struct nvme_ns_list *ns_list, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_topology(nvme_root_t t, enum nvme_cli_topo_ranking ranking, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_feature_show(enum nvme_features_id fid, int sel, unsigned int result); void nvme_feature_show_fields(enum nvme_features_id fid, unsigned int result, unsigned char *buf); void nvme_directive_show(__u8 type, __u8 oper, __u16 spec, __u32 nsid, __u32 result, - void *buf, __u32 len, enum nvme_print_flags flags); + void *buf, __u32 len, nvme_print_flags_t flags); void nvme_show_select_result(enum nvme_features_id fid, __u32 result); void nvme_show_zns_id_ctrl(struct nvme_zns_id_ctrl *ctrl, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_id_ctrl_nvm(struct nvme_id_ctrl_nvm *ctrl_nvm, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_nvm_id_ns(struct nvme_nvm_id_ns *nvm_ns, unsigned int nsid, struct nvme_id_ns *ns, unsigned int lba_index, - bool cap_only, enum nvme_print_flags flags); + bool cap_only, nvme_print_flags_t flags); void nvme_show_zns_id_ns(struct nvme_zns_id_ns *ns, - struct nvme_id_ns *id_ns, enum nvme_print_flags flags); + struct nvme_id_ns *id_ns, nvme_print_flags_t flags); void nvme_zns_start_zone_list(__u64 nr_zones, struct json_object **zone_list, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_zns_changed(struct nvme_zns_changed_zone_log *log, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_zns_finish_zone_list(__u64 nr_zones, struct json_object *zone_list, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_zns_report_zones(void *report, __u32 descs, __u8 ext_size, __u32 report_size, struct json_object *zone_list, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void json_nvme_finish_zone_list(__u64 nr_zones, struct json_object *zone_list); void nvme_show_list_item(nvme_ns_t n); void nvme_show_fdp_configs(struct nvme_fdp_config_log *configs, size_t len, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_fdp_stats(struct nvme_fdp_stats_log *log, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_fdp_events(struct nvme_fdp_events_log *log, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_fdp_usage(struct nvme_fdp_ruhu_log *log, size_t len, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_fdp_ruh_status(struct nvme_fdp_ruh_status *status, size_t len, - enum nvme_print_flags flags); + nvme_print_flags_t flags); void nvme_show_discovery_log(struct nvmf_discovery_log *log, uint64_t numrec, - enum nvme_print_flags flags); -void nvme_show_connect_msg(nvme_ctrl_t c, enum nvme_print_flags flags); + nvme_print_flags_t flags); +void nvme_show_connect_msg(nvme_ctrl_t c, nvme_print_flags_t flags); const char *nvme_ana_state_to_string(enum nvme_ana_state state); const char *nvme_cmd_to_string(int admin, __u8 opcode); @@ -320,4 +322,5 @@ void nvme_show_finish(void); bool nvme_is_fabrics_reg(int offset); bool nvme_registers_cmbloc_support(__u32 cmbsz); bool nvme_registers_pmrctl_ready(__u32 pmrctl); +const char *nvme_degrees_string(long t); #endif /* NVME_PRINT_H */ |