software/drivers/sd8887/src/bluetooth/bt/bt_main.c
/**
 *  @brief This function Set Evt Filter
 *
 *  @param priv    A pointer to bt_private structure
 *
 *  @return    BT_STATUS_SUCCESS or BT_STATUS_FAILURE
 */
@brief This function Set Evt Filter
@param priv    A pointer to bt_private structure


@brief This function Set Evt Filter @param priv A pointer to bt_private structure
int
bt_set_evt_filter(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((0x03 << 10) | BT_CMD_SET_EVT_FILTER);
	pcmd->length = 0x03;
	pcmd->data[0] = 0x02;
	pcmd->data[1] = 0x00;
	pcmd->data[2] = 0x03;
	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);
	PRINTM(CMD, "Queue Set Evt Filter Command(0x%x)\n",
	       __le16_to_cpu(pcmd->ocf_ogf));
	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: Set Evt Filter timeout\n");
		bt_cmd_timeout_func(priv, BT_CMD_SET_EVT_FILTER);
	}
exit:
	LEAVE();
	return ret;
}
int bt_set_evt_filter ( 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 ( ( 0x03 << 10 ) | BT_CMD_SET_EVT_FILTER ) ; pcmd -> length = 0x03 ; pcmd -> data [ 0 ] = 0x02 ; pcmd -> data [ 1 ] = 0x00 ; pcmd -> data [ 2 ] = 0x03 ; 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 ) ; PRINTM ( CMD , " \n " , __le16_to_cpu ( pcmd -> ocf_ogf ) ) ; 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_SET_EVT_FILTER ) ; } exit : LEAVE ( ) ; return ret ; }
@brief This function Set Evt Filter
  @param priv    A pointer to bt_private structure
@brief This function Set Evt Filter @param priv A pointer to bt_private structure