Пример #1
0
/* hci_uart_tty_close()
 *
 *    Called when the line discipline is changed to something
 *    else, the tty is closed, or the tty detects a hangup.
 */
static void hci_uart_tty_close(struct tty_struct *tty)
{
	struct hci_uart *hu = (void *)tty->disc_data;

	BT_DBG("tty %p", tty);

	/* Detach from the tty */
	tty->disc_data = NULL;

	if (hu) {
		struct hci_dev *hdev = hu->hdev;

		if (hdev)
			hci_uart_close(hdev);

		if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {
			if (hdev) {
				hci_unregister_dev(hdev);
				hci_free_dev(hdev);
			}
			hu->proto->close(hu);
		}
		kfree(hu);
	}
}
Пример #2
0
/* hci_uart_tty_close()
 *
 *    Called when the line discipline is changed to something
 *    else, the tty is closed, or the tty detects a hangup.
 */
static void hci_uart_tty_close(struct tty_struct *tty)
{
    struct hci_uart *hu = (void *)tty->disc_data;
    BT_DBG("tty %p", tty);

    /* Detach from the tty */
    tty->disc_data = NULL;

#ifdef CONFIG_TROUT_UART_TRANSPORT_DEBUG
    if(NULL != &timer_retransmit)
    {
        del_timer(&timer_retransmit);
    }
#endif

    if (hu) {
        struct hci_dev *hdev = hu->hdev;

        if (hdev)
            hci_uart_close(hdev);

        if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {
            hu->proto->close(hu);
            if (hdev) {
                hci_unregister_dev(hdev);
                hci_free_dev(hdev);
            }
        }
    }
}
/* hci_uart_tty_close()
 *
 *    Called when the line discipline is changed to something
 *    else, the tty is closed, or the tty detects a hangup.
 */
static void hci_uart_tty_close(struct tty_struct *tty)
{
	struct hci_uart *hu = tty->disc_data;
	struct hci_dev *hdev;

	BT_DBG("tty %p", tty);

	/* Detach from the tty */
	tty->disc_data = NULL;

	if (!hu)
		return;

	hdev = hu->hdev;
	if (hdev)
		hci_uart_close(hdev);

	cancel_work_sync(&hu->write_work);

	if (test_and_clear_bit(HCI_UART_PROTO_READY, &hu->flags)) {
		if (hdev) {
			if (test_bit(HCI_UART_REGISTERED, &hu->flags))
				hci_unregister_dev(hdev);
			hci_free_dev(hdev);
		}
		hu->proto->close(hu);
	}
	clear_bit(HCI_UART_PROTO_SET, &hu->flags);

	kfree(hu);
}
/* hci_uart_tty_close()
 *
 *    Called when the line discipline is changed to something
 *    else, the tty is closed, or the tty detects a hangup.
 */
static void hci_uart_tty_close(struct tty_struct *tty)
{
	struct hci_uart *hu = (void *)tty->disc_data;

	BT_DBG("tty %p", tty);

	/* Detach from the tty */
	tty->disc_data = NULL;

	if (hu) {
		struct hci_dev *hdev = hu->hdev;

		if (hdev)
			hci_uart_close(hdev);

		cancel_work_sync(&hu->write_work);
		tasklet_kill(&hu->tty_wakeup_task);

		cancel_work_sync(&hu->write_work);

		if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {
			hu->proto->close(hu);
			if (hdev) {
				hci_unregister_dev(hdev);
				hci_free_dev(hdev);
			}
		}
	}
}
Пример #5
0
/* hci_uart_tty_close()
 *
 *    Called when the line discipline is changed to something
 *    else, the tty is closed, or the tty detects a hangup.
 */
static void hci_uart_tty_close(cyg_io_handle_t tty)
{
	struct hci_uart *hu = (struct hci_uart *)serial_getdisc(tty);//(void *)tty->disc_data;

	BT_DBG("tty %p", tty);

	/* Detach from the tty */
	//tty->disc_data = NULL;
	serial_setdisc(tty, NULL);

	if (hu) {
		struct hci_dev *hdev = &hu->hdev;
		hci_uart_close(hdev);

		if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {
			hu->proto->close(hu);
			hci_unregister_dev(hdev);
		}

		//MOD_DEC_USE_COUNT;
	}
}