Пример #1
0
/* Tx tasklet */
static void tdm_if_pcm_tx_process(unsigned long arg)
#endif
{
	TRC_REC("->%s\n",__FUNCTION__);

	if(pcm_enable) {
		if(txBuff == NULL) {
			TRC_REC("%s: Error, empty Tx processing\n",__FUNCTION__);
			return;
		}

		/* Dispatch Tx handler */
		tdm_if_register_ops->tdm_if_pcm_ops.pcm_tx_callback(txBuff, buff_size);

		if(test_enable == 0) {
			/* Fill Tx aggregated buffer */
#ifdef CONFIG_MV_TDM_SUPPORT
			if(mvTdmTx(txBuff) != MV_OK)
#else
			if(mvCommUnitTx(txBuff) != MV_OK)
#endif /* CONFIG_MV_TDM_SUPPORT */
				printk("%s: could not fill Tx buffer\n",__FUNCTION__);
		}
	}

	/* Clear txBuff for next iteration */
	txBuff = NULL;

	TRC_REC("<-%s\n",__FUNCTION__);
	return;
}
Пример #2
0
static ssize_t tdm_dev_write(struct file *file_p, const char __user *buf, size_t size, loff_t * ppos)
{
	unsigned long flags = 0;
	MV_STATUS status;
	size_t ret = size;

	TRC_REC("->%s\n",__FUNCTION__);

	if(tx_buff_p != NULL) {
		if (copy_from_user(tx_buff_p, buf, size))
			ret = -EFAULT;
		atomic_set(&tx_ready, DISABLE);
		spin_lock_irqsave(&tdm_dev_lock, flags);
#ifdef CONFIG_MV_TDM_SUPPORT
		status = mvTdmTx(tx_buff_p);
#else
		status = mvCommUnitTx(tx_buff_p);
#endif
		spin_unlock_irqrestore(&tdm_dev_lock, flags);
		tx_buff_p = NULL;
		if(status != MV_OK)
			printk("%s: could not fill Tx buffer\n",__FUNCTION__);
	} else {
		ret = 0;
		TRC_REC("%s: missed Tx buffer\n",__FUNCTION__);
	}
	TRC_REC("<-%s\n",__FUNCTION__);

	return ret;
}