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

@return    BT_STATUS_SUCCESS  or other
@brief This function initializes the wrapper device @param m_dev A pointer to m_dev structure @return BT_STATUS_SUCCESS or other
void
init_m_dev(struct m_dev *m_dev)
{
	m_dev->dev_pointer = NULL;
	m_dev->driver_data = NULL;
	m_dev->dev_type = 0;
	m_dev->spec_type = 0;
	skb_queue_head_init(&m_dev->rx_q);
	init_waitqueue_head(&m_dev->req_wait_q);
	init_waitqueue_head(&m_dev->rx_wait_q);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
	init_MUTEX(&m_dev->req_lock);
#else
	sema_init(&m_dev->req_lock, 1);
#endif
	spin_lock_init(&m_dev->rxlock);
	memset(&m_dev->stat, 0, sizeof(struct hci_dev_stats));
	m_dev->open = mdev_open;
	m_dev->close = mdev_close;
	m_dev->flush = mdev_flush;
	m_dev->send = mdev_send_frame;
	m_dev->destruct = mdev_destruct;
	m_dev->ioctl = mdev_ioctl;
	m_dev->query = mdev_query;
	m_dev->owner = THIS_MODULE;
}
void init_m_dev ( struct m_dev * m_dev ) { m_dev -> dev_pointer = NULL ; m_dev -> driver_data = NULL ; m_dev -> dev_type = 0 ; m_dev -> spec_type = 0 ; skb_queue_head_init ( & m_dev -> rx_q ) ; init_waitqueue_head ( & m_dev -> req_wait_q ) ; init_waitqueue_head ( & m_dev -> rx_wait_q ) ; #if LINUX_VERSION_CODE < KERNEL_VERSION ( 2 , 6 , 37 ) init_MUTEX ( & m_dev -> req_lock ) ; #else sema_init ( & m_dev -> req_lock , 1 ) ; #endif spin_lock_init ( & m_dev -> rxlock ) ; memset ( & m_dev -> stat , 0 , sizeof ( struct hci_dev_stats ) ) ; m_dev -> open = mdev_open ; m_dev -> close = mdev_close ; m_dev -> flush = mdev_flush ; m_dev -> send = mdev_send_frame ; m_dev -> destruct = mdev_destruct ; m_dev -> ioctl = mdev_ioctl ; m_dev -> query = mdev_query ; m_dev -> owner = THIS_MODULE ; }
@brief This function initializes the wrapper device
  @param m_dev   A pointer to m_dev structure
@brief This function initializes the wrapper device @param m_dev A pointer to m_dev structure