Skip to content

Commit 079804c

Browse files
Martin Belangerigaw
authored andcommitted
libnvme: add missing prototypes for exported symbols
Three __public symbols were listed in the version scripts but had no prototype in any installed header: libnvme_mi_submit_entry() -- weak tracing hook in mi.c libnvme_mi_submit_exit() -- weak tracing hook in mi.c libnvmf_context_set_fabrics_config() -- setter in fabrics.c whose getter libnvmf_context_get_fabrics_config() was already declared Without a prototype in an installed header, callers have no declaration to include and must either write their own or resort to dlsym(). Signed-off-by: Martin Belanger <[email protected]> Assisted-by: Claude Sonnet 4.6 <[email protected]>
1 parent eead61f commit 079804c

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

libnvme/src/nvme/fabrics.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,19 @@ int libnvmf_context_set_device(struct libnvmf_context *fctx, const char *device)
404404
struct libnvme_fabrics_config *libnvmf_context_get_fabrics_config(
405405
struct libnvmf_context *fctx);
406406

407+
/**
408+
* libnvmf_context_set_fabrics_config() - Set fabrics configuration for a
409+
* fabrics context
410+
* @fctx: Fabrics context
411+
* @cfg: Fabrics configuration to apply
412+
*
413+
* Copies the fields of @cfg into the fabrics configuration of @fctx.
414+
*
415+
* Return: 0 on success, or a negative error code on failure.
416+
*/
417+
int libnvmf_context_set_fabrics_config(struct libnvmf_context *fctx,
418+
struct libnvme_fabrics_config *cfg);
419+
407420
/**
408421
* libnvmf_ctrl_get_fabrics_config() - Fabrics configuration of a controller
409422
* @c: Controller instance

libnvme/src/nvme/mi.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,3 +947,37 @@ int libnvme_mi_aem_disable(libnvme_mi_ep_t ep);
947947
* Return: 0 is a success, nonzero is an error and errno may be read for further details
948948
*/
949949
int libnvme_mi_aem_process(libnvme_mi_ep_t ep, void *userdata);
950+
951+
/**
952+
* libnvme_mi_submit_entry() - Weak hook called before an MI message is sent.
953+
* @type: MCTP message type
954+
* @hdr: Pointer to the MI message header
955+
* @hdr_len: Length of the message header in bytes
956+
* @data: Pointer to message payload data
957+
* @data_len: Length of payload data in bytes
958+
*
959+
* This is a weak symbol that can be overridden by an application to intercept
960+
* outgoing MI messages for tracing or testing purposes. The return value is
961+
* passed back as @user_data to the matching libnvme_mi_submit_exit() call.
962+
*
963+
* Return: An opaque pointer passed to libnvme_mi_submit_exit(), or NULL.
964+
*/
965+
void *libnvme_mi_submit_entry(__u8 type, const struct nvme_mi_msg_hdr *hdr,
966+
size_t hdr_len, const void *data, size_t data_len);
967+
968+
/**
969+
* libnvme_mi_submit_exit() - Weak hook called after an MI message completes.
970+
* @type: MCTP message type
971+
* @hdr: Pointer to the MI response message header
972+
* @hdr_len: Length of the response message header in bytes
973+
* @data: Pointer to response payload data
974+
* @data_len: Length of response payload data in bytes
975+
* @user_data: Value returned by the matching libnvme_mi_submit_entry() call
976+
*
977+
* This is a weak symbol that can be overridden by an application to intercept
978+
* completed MI transactions. Called with the opaque pointer returned by the
979+
* corresponding libnvme_mi_submit_entry() call.
980+
*/
981+
void libnvme_mi_submit_exit(__u8 type, const struct nvme_mi_msg_hdr *hdr,
982+
size_t hdr_len, const void *data, size_t data_len,
983+
void *user_data);

0 commit comments

Comments
 (0)