static int bluesleep_lpm_btwrite(const char *val, const struct kernel_param *kp)
{
    int ret;

    ret = param_set_int(val, kp);

    if (ret) {
        BT_ERR("HCIATH3K: lpm btwrite parameter set failed");
        return ret;
    }

    BT_DBG("btwrite : %d", lpm_btwrite);
    if (is_lpm_enabled) {
        if (lpm_btwrite == 0) {
            /*Setting TXEXPIRED bit to make it
            compatible with current solution*/
            set_bit(BT_TXEXPIRED, &flags);
            hsuart_serial_clock_off(bsi->uport);
        } else if (lpm_btwrite == 1) {
            ath_wakeup_ar3k();
            clear_bit(BT_TXEXPIRED, &flags);
        } else {
            BT_ERR("HCIATH3K invalid btwrite value");
            return -EINVAL;
        }
    }
    return 0;
}
static void ath_hci_uart_work(struct work_struct *work)
{
    int status;
    struct ath_struct *ath;
    struct hci_uart *hu;

    ath = container_of(work, struct ath_struct, ctxtsw);

    hu = ath->hu;

    /* verify and wake up controller */
    if (test_bit(BT_SLEEPENABLE, &flags))
        status = ath_wakeup_ar3k();
    /* Ready to send Data */
    clear_bit(HCI_UART_SENDING, &hu->tx_state);
    hci_uart_tx_wakeup(hu);
}
Beispiel #3
0
static void ath_hci_uart_work(struct work_struct *work)
{
	int status;
	struct ath_struct *ath;
	struct hci_uart *hu;
	struct tty_struct *tty;

	ath = container_of(work, struct ath_struct, ctxtsw);

	hu = ath->hu;
	tty = hu->tty;

	/* verify and wake up controller */
	if (ath->cur_sleep) {
		status = ath_wakeup_ar3k(tty);
		if (!(status & TIOCM_CTS))
			return;
	}

	/* Ready to send Data */
	clear_bit(HCI_UART_SENDING, &hu->tx_state);
	hci_uart_tx_wakeup(hu);
}