Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c5f3f855 authored by Eric Holmberg's avatar Eric Holmberg
Browse files

soc: qcom: glink: export transport name to id function



The unit test framework requires the transport name to id lookup
function that is currently private to glink.c.

Export through the transport interface function that is still private to
the G-Link framework, but allows usage of the function by the unit test
DLKM.

Change-Id: If0c019e510dda91c39fd8aba66c2352cb1ae2bdb
Signed-off-by: default avatarEric Holmberg <eholmber@codeaurora.org>
parent 42162e39
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -2321,13 +2321,13 @@ void glink_xprt_ctx_release(struct rwref_lock *xprt_st_lock)
}

/**
 * assign_id() - assign an id to a transport
 * glink_xprt_name_to_id() - convert transport name to id
 * @name:	Name of the transport.
 * @id:		Assigned id.
 *
 * Return: 0 on success or standlard linux error code.
 * Return: 0 on success or standard Linux error code.
 */
static int assign_id(const char *name, uint16_t *id)
int glink_xprt_name_to_id(const char *name, uint16_t *id)
{
	if (!strcmp(name, "smem")) {
		*id = SMEM_XPRT_ID;
@@ -2347,6 +2347,7 @@ static int assign_id(const char *name, uint16_t *id)
	}
	return -ENODEV;
}
EXPORT_SYMBOL(glink_xprt_name_to_id);

/**
 * glink_core_register_transport() - register a new transport
@@ -2377,7 +2378,7 @@ int glink_core_register_transport(struct glink_transport_if *if_ptr,
	if (cfg->versions_entries < 1)
		return -EINVAL;

	ret = assign_id(cfg->name, &id);
	ret = glink_xprt_name_to_id(cfg->name, &id);
	if (ret)
		return ret;

+26 −1
Original line number Diff line number Diff line
/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -120,6 +120,8 @@ struct glink_transport_if {
	struct glink_core_if *glink_core_if_ptr;
};

#ifdef CONFIG_MSM_GLINK

/**
 * get_tx_vaddr() - Get the virtual address from which the tx has to be done
 * @pctx:	transmit packet context.
@@ -143,4 +145,27 @@ static inline void *get_tx_vaddr(struct glink_core_tx_pkt *pctx, size_t offset,
	return NULL;
}

/**
 * glink_xprt_name_to_id() - convert transport name to id
 * @name:	Name of the transport.
 * @id:		Assigned id.
 *
 * Return: 0 on success or standard Linux error code.
 */
int glink_xprt_name_to_id(const char *name, uint16_t *id);


#else /* CONFIG_MSM_GLINK */
static inline void *get_tx_vaddr(struct glink_core_tx_pkt *pctx, size_t offset,
				 size_t *tx_size)
{
	return NULL;
}

static inline int glink_xprt_name_to_id(const char *name, uint16_t *id)
{
	return -ENODEV;
}

#endif /* CONFIG_MSM_GLINK */
#endif /* _SOC_QCOM_GLINK_XPRT_IF_H_ */