X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=drivers%2Fbluetooth%2Fhci_ll.c;h=5c65014635bee18b493870f3a70b94b03b652df2;hb=cf9fe114e3b37e14fc8434d5abb192e35df551b1;hp=8c3e62a17b4a6f1714d91567bf20c91b569ebff2;hpb=166d2f6a4332aad53cb0750a296f76c06102552d;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c index 8c3e62a..5c65014 100644 --- a/drivers/bluetooth/hci_ll.c +++ b/drivers/bluetooth/hci_ll.c @@ -163,8 +163,7 @@ static int ll_close(struct hci_uart *hu) skb_queue_purge(&ll->tx_wait_q); skb_queue_purge(&ll->txq); - if (ll->rx_skb) - kfree_skb(ll->rx_skb); + kfree_skb(ll->rx_skb); hu->priv = NULL; @@ -204,6 +203,19 @@ static void ll_device_want_to_wakeup(struct hci_uart *hu) spin_lock_irqsave(&ll->hcill_lock, flags); switch (ll->hcill_state) { + case HCILL_ASLEEP_TO_AWAKE: + /* + * This state means that both the host and the BRF chip + * have simultaneously sent a wake-up-indication packet. + * Traditionaly, in this case, receiving a wake-up-indication + * was enough and an additional wake-up-ack wasn't needed. + * This has changed with the BRF6350, which does require an + * explicit wake-up-ack. Other BRF versions, which do not + * require an explicit ack here, do accept it, thus it is + * perfectly safe to always send one. + */ + BT_DBG("dual wake-up-indication"); + /* deliberate fall-through - do not add break */ case HCILL_ASLEEP: /* acknowledge device wake up */ if (send_hcill_cmd(HCILL_WAKE_UP_ACK, hu) < 0) { @@ -211,16 +223,8 @@ static void ll_device_want_to_wakeup(struct hci_uart *hu) goto out; } break; - case HCILL_ASLEEP_TO_AWAKE: - /* - * this state means that a wake-up-indication - * is already on its way to the device, - * and will serve as the required wake-up-ack - */ - BT_DBG("dual wake-up-indication"); - break; default: - /* any other state are illegal */ + /* any other state is illegal */ BT_ERR("received HCILL_WAKE_UP_IND in state %ld", ll->hcill_state); break; }