software/drivers/sd8887/src/bluetooth/bt/bt_main.c
int
bt_send_sdio_pull_ctrl_cmd(bt_private *priv)
{
	struct sk_buff *skb = NULL;
	int ret = BT_STATUS_SUCCESS;
	BT_CMD *pcmd;
	ENTER();
	skb = bt_skb_alloc(sizeof(BT_CMD), GFP_ATOMIC);
	if (skb == NULL) {
		PRINTM(WARN, "No free skb\n");
		ret = BT_STATUS_FAILURE;
		goto exit;
	}
	pcmd = (BT_CMD *)skb->data;
	pcmd->ocf_ogf =
		__cpu_to_le16((VENDOR_OGF << 10) | BT_CMD_SDIO_PULL_CFG_REQ);
	pcmd->length = 4;
	pcmd->data[0] = (priv->bt_dev.sdio_pull_cfg & 0x000000ff);
	pcmd->data[1] = (priv->bt_dev.sdio_pull_cfg & 0x0000ff00) >> 8;
	pcmd->data[2] = (priv->bt_dev.sdio_pull_cfg & 0x00ff0000) >> 16;
	pcmd->data[3] = (priv->bt_dev.sdio_pull_cfg & 0xff000000) >> 24;
	bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
	skb_put(skb, BT_CMD_HEADER_SIZE + pcmd->length);
	skb->dev = (void *)(&(priv->bt_dev.m_dev[BT_SEQ]));
	skb_queue_head(&priv->adapter->tx_queue, skb);
	PRINTM(CMD,
	       "Queue SDIO PULL CFG Command(0x%x), PullUp=0x%x%x,PullDown=0x%x%x\n",
	       __le16_to_cpu(pcmd->ocf_ogf), pcmd->data[1], pcmd->data[0],
	       pcmd->data[3], pcmd->data[2]);
	priv->bt_dev.sendcmdflag = TRUE;
	priv->bt_dev.send_cmd_opcode = __le16_to_cpu(pcmd->ocf_ogf);
	priv->adapter->cmd_complete = FALSE;
	wake_up_interruptible(&priv->MainThread.waitQ);
	if (!os_wait_interruptible_timeout
	    (priv->adapter->cmd_wait_q, priv->adapter->cmd_complete,
	     WAIT_UNTIL_CMD_RESP)) {
		ret = BT_STATUS_FAILURE;
		PRINTM(MSG, "BT: SDIO PULL CFG timeout:\n");
		bt_cmd_timeout_func(priv, BT_CMD_SDIO_PULL_CFG_REQ);
	}
exit:
	LEAVE();
	return ret;
}
/**
 *  @brief This function sends sdio pull ctrl command
 *
 *  @param priv    A pointer to bt_private structure
 *  @return    BT_STATUS_SUCCESS or BT_STATUS_FAILURE
 */
@brief This function sends sdio pull ctrl command
@param priv    A pointer to bt_private structure
@return    BT_STATUS_SUCCESS or BT_STATUS_FAILURE
@brief This function sends sdio pull ctrl command @param priv A pointer to bt_private structure @return BT_STATUS_SUCCESS or BT_STATUS_FAILURE
int
bt_send_sdio_pull_ctrl_cmd(bt_private *priv)
{
	struct sk_buff *skb = NULL;
	int ret = BT_STATUS_SUCCESS;
	BT_CMD *pcmd;
	ENTER();
	skb = bt_skb_alloc(sizeof(BT_CMD), GFP_ATOMIC);
	if (skb == NULL) {
		PRINTM(WARN, "No free skb\n");
		ret = BT_STATUS_FAILURE;
		goto exit;
	}
	pcmd = (BT_CMD *)skb->data;
	pcmd->ocf_ogf =
		__cpu_to_le16((VENDOR_OGF << 10) | BT_CMD_SDIO_PULL_CFG_REQ);
	pcmd->length = 4;
	pcmd->data[0] = (priv->bt_dev.sdio_pull_cfg & 0x000000ff);
	pcmd->data[1] = (priv->bt_dev.sdio_pull_cfg & 0x0000ff00) >> 8;
	pcmd->data[2] = (priv->bt_dev.sdio_pull_cfg & 0x00ff0000) >> 16;
	pcmd->data[3] = (priv->bt_dev.sdio_pull_cfg & 0xff000000) >> 24;
	bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
	skb_put(skb, BT_CMD_HEADER_SIZE + pcmd->length);
	skb->dev = (void *)(&(priv->bt_dev.m_dev[BT_SEQ]));
	skb_queue_head(&priv->adapter->tx_queue, skb);
	PRINTM(CMD,
	       "Queue SDIO PULL CFG Command(0x%x), PullUp=0x%x%x,PullDown=0x%x%x\n",
	       __le16_to_cpu(pcmd->ocf_ogf), pcmd->data[1], pcmd->data[0],
	       pcmd->data[3], pcmd->data[2]);
	priv->bt_dev.sendcmdflag = TRUE;
	priv->bt_dev.send_cmd_opcode = __le16_to_cpu(pcmd->ocf_ogf);
	priv->adapter->cmd_complete = FALSE;
	wake_up_interruptible(&priv->MainThread.waitQ);
	if (!os_wait_interruptible_timeout
	    (priv->adapter->cmd_wait_q, priv->adapter->cmd_complete,
	     WAIT_UNTIL_CMD_RESP)) {
		ret = BT_STATUS_FAILURE;
		PRINTM(MSG, "BT: SDIO PULL CFG timeout:\n");
		bt_cmd_timeout_func(priv, BT_CMD_SDIO_PULL_CFG_REQ);
	}
exit:
	LEAVE();
	return ret;
}
int bt_send_sdio_pull_ctrl_cmd ( bt_private * priv ) { struct sk_buff * skb = NULL ; int ret = BT_STATUS_SUCCESS ; BT_CMD * pcmd ; ENTER ( ) ; skb = bt_skb_alloc ( sizeof ( BT_CMD ) , GFP_ATOMIC ) ; if ( skb == NULL ) { PRINTM ( WARN , " \n " ) ; ret = BT_STATUS_FAILURE ; goto exit ; } pcmd = ( BT_CMD * ) skb -> data ; pcmd -> ocf_ogf = __cpu_to_le16 ( ( VENDOR_OGF << 10 ) | BT_CMD_SDIO_PULL_CFG_REQ ) ; pcmd -> length = 4 ; pcmd -> data [ 0 ] = ( priv -> bt_dev . sdio_pull_cfg & 0x000000ff ) ; pcmd -> data [ 1 ] = ( priv -> bt_dev . sdio_pull_cfg & 0x0000ff00 ) >> 8 ; pcmd -> data [ 2 ] = ( priv -> bt_dev . sdio_pull_cfg & 0x00ff0000 ) >> 16 ; pcmd -> data [ 3 ] = ( priv -> bt_dev . sdio_pull_cfg & 0xff000000 ) >> 24 ; bt_cb ( skb ) -> pkt_type = MRVL_VENDOR_PKT ; skb_put ( skb , BT_CMD_HEADER_SIZE + pcmd -> length ) ; skb -> dev = ( void * ) ( & ( priv -> bt_dev . m_dev [ BT_SEQ ] ) ) ; skb_queue_head ( & priv -> adapter -> tx_queue , skb ) ; PRINTM ( CMD , " \n " , __le16_to_cpu ( pcmd -> ocf_ogf ) , pcmd -> data [ 1 ] , pcmd -> data [ 0 ] , pcmd -> data [ 3 ] , pcmd -> data [ 2 ] ) ; priv -> bt_dev . sendcmdflag = TRUE ; priv -> bt_dev . send_cmd_opcode = __le16_to_cpu ( pcmd -> ocf_ogf ) ; priv -> adapter -> cmd_complete = FALSE ; wake_up_interruptible ( & priv -> MainThread . waitQ ) ; if ( ! os_wait_interruptible_timeout ( priv -> adapter -> cmd_wait_q , priv -> adapter -> cmd_complete , WAIT_UNTIL_CMD_RESP ) ) { ret = BT_STATUS_FAILURE ; PRINTM ( MSG , " \n " ) ; bt_cmd_timeout_func ( priv , BT_CMD_SDIO_PULL_CFG_REQ ) ; } exit : LEAVE ( ) ; return ret ; }
@brief This function sends sdio pull ctrl command
  @param priv    A pointer to bt_private structure
  @return    BT_STATUS_SUCCESS or BT_STATUS_FAILURE
@brief This function sends sdio pull ctrl command @param priv A pointer to bt_private structure @return BT_STATUS_SUCCESS or BT_STATUS_FAILURE