Changeset View
Changeset View
Standalone View
Standalone View
sbin/nvmecontrol/nvmecontrol.h
| Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | .size = sz, \ | ||||||||||
| static void logpage_reg_##unique(void) { logpage_register(&unique##_lpf); } | static void logpage_reg_##unique(void) { logpage_register(&unique##_lpf); } | ||||||||||
| #define DEFAULT_SIZE (4096) | #define DEFAULT_SIZE (4096) | ||||||||||
| struct kv_name { | struct kv_name { | ||||||||||
| uint32_t key; | uint32_t key; | ||||||||||
| const char *name; | const char *name; | ||||||||||
| }; | }; | ||||||||||
| /* | |||||||||||
| * Generically convert little endian to host endian, based on the type of the thing | |||||||||||
jhbUnsubmitted Not Done Inline Actions
jhb: | |||||||||||
| * being converted. Use the proposed name for future changes to endian.h. | |||||||||||
| */ | |||||||||||
| #define letoh(x) \ | |||||||||||
| _Generic(x, \ | |||||||||||
| uint8_t: (x), \ | |||||||||||
| uint16_t: le16toh(x), \ | |||||||||||
| uint32_t: le32toh(x), \ | |||||||||||
| uint64_t: le64toh(x)) | |||||||||||
| const char *kv_lookup(const struct kv_name *kv, size_t kv_count, uint32_t key); | const char *kv_lookup(const struct kv_name *kv, size_t kv_count, uint32_t key); | ||||||||||
| void logpage_register(struct logpage_function *p); | void logpage_register(struct logpage_function *p); | ||||||||||
| #define NVME_CTRLR_PREFIX "nvme" | #define NVME_CTRLR_PREFIX "nvme" | ||||||||||
| #define NVME_NS_PREFIX "ns" | #define NVME_NS_PREFIX "ns" | ||||||||||
| int open_dev(const char *str, int *fd, int write, int exit_on_error); | int open_dev(const char *str, int *fd, int write, int exit_on_error); | ||||||||||
| void get_nsid(int fd, char **ctrlr_str, uint32_t *nsid); | void get_nsid(int fd, char **ctrlr_str, uint32_t *nsid); | ||||||||||
| Show All 33 Lines | |||||||||||