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

Commit a193440e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 068491ae c5f3f855
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -2350,13 +2350,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;
@@ -2376,6 +2376,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
@@ -2406,7 +2407,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;

+25 −0
Original line number Diff line number Diff line
@@ -121,6 +121,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.
@@ -144,4 +146,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_ */