software/drivers/sd8887/src/bluetooth/bt/bt_main.c
/**
 *  @brief This function handles the wrapper device transmit
 *
 *  @param m_dev   A pointer to m_dev structure
 *  @param skb     A pointer to sk_buff structure
 *
 *  @return    BT_STATUS_SUCCESS or other error no.
 */
@brief This function handles the wrapper device transmit
@param m_dev   A pointer to m_dev structure
@param skb     A pointer to sk_buff structure

@return    BT_STATUS_SUCCESS or other error no.
@brief This function handles the wrapper device transmit @param m_dev A pointer to m_dev structure @param skb A pointer to sk_buff structure @return BT_STATUS_SUCCESS or other error no .
static int
mdev_send_frame(struct m_dev *m_dev, struct sk_buff *skb)
{
	bt_private *priv = NULL;
	ENTER();
	if (!m_dev || !m_dev->driver_data) {
		PRINTM(ERROR, "Frame for unknown HCI device (m_dev=NULL)\n");
		LEAVE();
		return -ENODEV;
	}
	priv = (bt_private *)m_dev->driver_data;
	if (!test_bit(HCI_RUNNING, &m_dev->flags)) {
		PRINTM(ERROR, "Fail test HCI_RUNNING, flag=0x%lx\n",
		       m_dev->flags);
		LEAVE();
		return -EBUSY;
	}
	switch (bt_cb(skb)->pkt_type) {
	case HCI_COMMAND_PKT:
		m_dev->stat.cmd_tx++;
		break;
	case HCI_ACLDATA_PKT:
		m_dev->stat.acl_tx++;
		break;
	case HCI_SCODATA_PKT:
		m_dev->stat.sco_tx++;
		break;
	}
	if (priv->adapter->tx_lock == TRUE)
		skb_queue_tail(&priv->adapter->pending_queue, skb);
	else
		bt_queue_frame(priv, skb);
	wake_up_interruptible(&priv->MainThread.waitQ);
	LEAVE();
	return BT_STATUS_SUCCESS;
}
static int mdev_send_frame ( struct m_dev * m_dev , struct sk_buff * skb ) { bt_private * priv = NULL ; ENTER ( ) ; if ( ! m_dev || ! m_dev -> driver_data ) { PRINTM ( ERROR , " \n " ) ; LEAVE ( ) ; return - ENODEV ; } priv = ( bt_private * ) m_dev -> driver_data ; if ( ! test_bit ( HCI_RUNNING , & m_dev -> flags ) ) { PRINTM ( ERROR , " \n " , m_dev -> flags ) ; LEAVE ( ) ; return - EBUSY ; } switch ( bt_cb ( skb ) -> pkt_type ) { case HCI_COMMAND_PKT : m_dev -> stat . cmd_tx ++ ; break ; case HCI_ACLDATA_PKT : m_dev -> stat . acl_tx ++ ; break ; case HCI_SCODATA_PKT : m_dev -> stat . sco_tx ++ ; break ; } if ( priv -> adapter -> tx_lock == TRUE ) skb_queue_tail ( & priv -> adapter -> pending_queue , skb ) ; else bt_queue_frame ( priv , skb ) ; wake_up_interruptible ( & priv -> MainThread . waitQ ) ; LEAVE ( ) ; return BT_STATUS_SUCCESS ; }
@brief This function handles the wrapper device transmit
  @param m_dev   A pointer to m_dev structure
  @param skb     A pointer to sk_buff structure
@brief This function handles the wrapper device transmit @param m_dev A pointer to m_dev structure @param skb A pointer to sk_buff structure