software/drivers/sd8887/src/bluetooth/bt/bt_main.c
/**
 *  @brief This function send hardware remove event
 *
 *  @param priv    A pointer to bt_private
 *  @return        N/A
 */
@brief This function send hardware remove event
@param priv    A pointer to bt_private
@return        N/A
@brief This function send hardware remove event @param priv A pointer to bt_private @return N / A
void
bt_send_hw_remove_event(bt_private *priv)
{
	struct sk_buff *skb = NULL;
	struct hci_dev *hdev = NULL;
	ENTER();
	if (!priv->bt_dev.m_dev[BT_SEQ].dev_pointer) {
		LEAVE();
		return;
	}
	if (priv->bt_dev.m_dev[BT_SEQ].spec_type == BLUEZ_SPEC)
		hdev = (struct hci_dev *)priv->bt_dev.m_dev[BT_SEQ].dev_pointer;
#define HCI_HARDWARE_ERROR_EVT  0x10
#define HCI_HARDWARE_REMOVE     0x24
	skb = bt_skb_alloc(3, GFP_ATOMIC);
	skb->data[0] = HCI_HARDWARE_ERROR_EVT;
	skb->data[1] = 1;
	skb->data[2] = HCI_HARDWARE_REMOVE;
	bt_cb(skb)->pkt_type = HCI_EVENT_PKT;
	skb_put(skb, 3);
	if (hdev) {
		skb->dev = (void *)hdev;
		PRINTM(MSG, "Send HW ERROR event\n");
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
		hci_recv_frame(skb);
#else
		hci_recv_frame(hdev, skb);
#endif
		os_sched_timeout(5);
		hdev->stat.byte_rx += 3;
	}
	LEAVE();
	return;
}
void bt_send_hw_remove_event ( bt_private * priv ) { struct sk_buff * skb = NULL ; struct hci_dev * hdev = NULL ; ENTER ( ) ; if ( ! priv -> bt_dev . m_dev [ BT_SEQ ] . dev_pointer ) { LEAVE ( ) ; return ; } if ( priv -> bt_dev . m_dev [ BT_SEQ ] . spec_type == BLUEZ_SPEC ) hdev = ( struct hci_dev * ) priv -> bt_dev . m_dev [ BT_SEQ ] . dev_pointer ; #define HCI_HARDWARE_ERROR_EVT   0x10 #define HCI_HARDWARE_REMOVE      0x24 skb = bt_skb_alloc ( 3 , GFP_ATOMIC ) ; skb -> data [ 0 ] = HCI_HARDWARE_ERROR_EVT ; skb -> data [ 1 ] = 1 ; skb -> data [ 2 ] = HCI_HARDWARE_REMOVE ; bt_cb ( skb ) -> pkt_type = HCI_EVENT_PKT ; skb_put ( skb , 3 ) ; if ( hdev ) { skb -> dev = ( void * ) hdev ; PRINTM ( MSG , " \n " ) ; #if LINUX_VERSION_CODE < KERNEL_VERSION ( 3 , 13 , 0 ) hci_recv_frame ( skb ) ; #else hci_recv_frame ( hdev , skb ) ; #endif os_sched_timeout ( 5 ) ; hdev -> stat . byte_rx += 3 ; } LEAVE ( ) ; return ; }
@brief This function send hardware remove event
  @param priv    A pointer to bt_private
  @return        N/A
@brief This function send hardware remove event @param priv A pointer to bt_private @return N / A