static inline int __stm_trace(uint32_t options, uint8_t entity_id,
			      uint8_t proto_id, const void *data, uint32_t size)
{
	struct stm_drvdata *drvdata = stmdrvdata;
	int len = 0;
	uint32_t ch;
	unsigned long ch_addr;

	/* Allocate channel and get the channel address */
	ch = stm_channel_alloc(0);
	ch_addr = (unsigned long)stm_channel_addr(drvdata, ch);

	/* Send the ost header */
	len += stm_trace_ost_header(ch_addr, options, entity_id, proto_id, data,
				    size);

	/* Send the payload data */
	len += stm_trace_data(ch_addr, options, data, size);

	/* Send the ost tail */
	len += stm_trace_ost_tail(ch_addr, options);

	/* We are done, free the channel */
	stm_channel_free(ch);

	return len;
}
static inline int __stm_trace(uint32_t options, uint8_t entity_id,
			      uint8_t proto_id, const void *data, uint32_t size)
{
	struct stm_drvdata *drvdata = stmdrvdata;
	int len = 0;
	uint32_t ch;
	unsigned long ch_addr;

	/*                                              */
	ch = stm_channel_alloc(0);
	ch_addr = (unsigned long)stm_channel_addr(drvdata, ch);

	if (drvdata->write_64bit) {
		/*                     */
		len += stm_trace_ost_header_64bit(ch_addr, options, entity_id,
						  proto_id, data, size);

		/*                       */
		len += stm_trace_data_64bit(ch_addr, options, data, size);

		/*                   */
		len += stm_trace_ost_tail_64bit(ch_addr, options);
	} else {
		/*                     */
		len += stm_trace_ost_header(ch_addr, options, entity_id,
					    proto_id, data, size);

		/*                       */
		len += stm_trace_data(ch_addr, options, data, size);

		/*                   */
		len += stm_trace_ost_tail(ch_addr, options);
	}

	/*                               */
	stm_channel_free(ch);

	return len;
}