software/drivers/sd8887/src/bluetooth/bt/bt_main.c
/**
 *  @brief This function load the calibrate EXT data
 *
 *  @param priv    A pointer to bt_private structure
 *  @param config_data     A pointer to calibrate data
 *  @param mac     A pointer to mac address
 *
 *  @return    BT_STATUS_SUCCESS or BT_STATUS_FAILURE
 */
@brief This function load the calibrate EXT data
@param priv    A pointer to bt_private structure
@param config_data     A pointer to calibrate data
@param mac     A pointer to mac address


@brief This function load the calibrate EXT data @param priv A pointer to bt_private structure @param config_data A pointer to calibrate data @param mac A pointer to mac address
int
bt_process_commands(bt_private *priv, u8 *cmd_data, u32 cmd_len)
{
	struct sk_buff *skb = NULL;
	int ret = BT_STATUS_SUCCESS;
	BT_CMD *pcmd;
	u16 ogf = 0;
	ENTER();
	PRINTM(CMD, "BT: init cmds: len=%d\n", cmd_len);
	if (cmd_len > BT_CMD_DATA_LEN) {
		PRINTM(WARN, "cfg_data_len is too long exceed %d.\n",
		       BT_CMD_DATA_LEN);
		ret = BT_STATUS_FAILURE;
		goto exit;
	}
	skb = bt_skb_alloc(sizeof(BT_CMD), GFP_ATOMIC);
	if (skb == NULL) {
		PRINTM(WARN, "No free skb\n");
		ret = BT_STATUS_FAILURE;
		goto exit;
	}
	memcpy(skb->data, cmd_data, cmd_len);
	pcmd = (BT_CMD *)skb->data;
	ogf = hci_opcode_ogf(pcmd->ocf_ogf);
	if (ogf == VENDOR_OGF)
		bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
	else
		bt_cb(skb)->pkt_type = HCI_COMMAND_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);
	priv->bt_dev.sendcmdflag = TRUE;
	priv->bt_dev.send_cmd_opcode = __le16_to_cpu(pcmd->ocf_ogf);
	priv->adapter->cmd_complete = FALSE;
	DBG_HEXDUMP(DAT_D, "init_cmds", skb->data, skb->len);
	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(ERROR, "BT: Load init cmds: timeout:\n");
		bt_cmd_timeout_func(priv, BT_CMD_LOAD_CONFIG_DATA_EXT);
	}
exit:
	LEAVE();
	return ret;
}
int bt_process_commands ( bt_private * priv , u8 * cmd_data , u32 cmd_len ) { struct sk_buff * skb = NULL ; int ret = BT_STATUS_SUCCESS ; BT_CMD * pcmd ; u16 ogf = 0 ; ENTER ( ) ; PRINTM ( CMD , " \n " , cmd_len ) ; if ( cmd_len > BT_CMD_DATA_LEN ) { PRINTM ( WARN , " \n " , BT_CMD_DATA_LEN ) ; ret = BT_STATUS_FAILURE ; goto exit ; } skb = bt_skb_alloc ( sizeof ( BT_CMD ) , GFP_ATOMIC ) ; if ( skb == NULL ) { PRINTM ( WARN , " \n " ) ; ret = BT_STATUS_FAILURE ; goto exit ; } memcpy ( skb -> data , cmd_data , cmd_len ) ; pcmd = ( BT_CMD * ) skb -> data ; ogf = hci_opcode_ogf ( pcmd -> ocf_ogf ) ; if ( ogf == VENDOR_OGF ) bt_cb ( skb ) -> pkt_type = MRVL_VENDOR_PKT ; else bt_cb ( skb ) -> pkt_type = HCI_COMMAND_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 ) ; priv -> bt_dev . sendcmdflag = TRUE ; priv -> bt_dev . send_cmd_opcode = __le16_to_cpu ( pcmd -> ocf_ogf ) ; priv -> adapter -> cmd_complete = FALSE ; DBG_HEXDUMP ( DAT_D , " " , skb -> data , skb -> len ) ; 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 ( ERROR , " \n " ) ; bt_cmd_timeout_func ( priv , BT_CMD_LOAD_CONFIG_DATA_EXT ) ; } exit : LEAVE ( ) ; return ret ; }
@brief This function load the calibrate EXT data
  @param priv    A pointer to bt_private structure
  @param config_data     A pointer to calibrate data
  @param mac     A pointer to mac address
@brief This function load the calibrate EXT data @param priv A pointer to bt_private structure @param config_data A pointer to calibrate data @param mac A pointer to mac address