From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: sniff mode
Date: Mon, 24 Aug 2009 16:26:30 -0300 [thread overview]
Message-ID: <2d5a2c100908241226y978afd2n44d69b7d27677c13@mail.gmail.com> (raw)
In-Reply-To: <1251139257.2950.60.camel@localhost.localdomain>
Hi Marcel,
On Mon, Aug 24, 2009 at 3:40 PM, Marcel Holtmann<marcel@holtmann.org> wrote=
:
> Hi Luiz,
>
>> It is just me or hci_conn_enter_active_mode will never do what its
>> name suggests. This check will always succeed:
>>
>> =A0 =A0 =A0 if (conn->mode !=3D HCI_CM_SNIFF || !conn->power_save)
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto timer;
>
> so conn->power_save is used to disable automatic sniff mode for incoming
> connections. Mainly HID since they manager it by themselves.
Hmm, but this seems to be done for any device regardless of its type.
So for example we start sending/receiving data to a headset it will
triggers hci_conn_enter_active_mode which I thought would exit sniff
mode, right? (yep, I have seem some headset that doesn't leave sniff
mode by their own).
>> But in hci_mode_change_evt whatever mode different than HCI_CM_ACTIVE
>> reset power_save to zero:
>>
>>
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!test_and_clear_bit(HCI_CONN_MODE_CHANGE=
_PEND, &conn->pend)) {
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (conn->mode =3D=3D HCI_CM=
_ACTIVE)
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 conn->power_=
save =3D 1;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 conn->power_=
save =3D 0;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
>
> And again, we are not setting the sniff mode. We disable automatic sniff
> mode feature.
It really seems the opposite, like we were disabling the automatic
active mode since this make us to always hit goto timer; while in
sniff mode. Perhaps this is meant for when remote device has been
controlling modes, which sound strange to me since hci_mode_change_evt
is called even when the we actively change the mode, right?
(hci_conn_idle does that)
--=20
Luiz Augusto von Dentz
Engenheiro de Computa=E7=E3o
next prev parent reply other threads:[~2009-08-24 19:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-24 18:26 sniff mode Luiz Augusto von Dentz
2009-08-24 18:40 ` Marcel Holtmann
2009-08-24 19:26 ` Luiz Augusto von Dentz [this message]
2009-08-24 19:33 ` Marcel Holtmann
2009-08-24 20:58 ` Luiz Augusto von Dentz
2009-08-24 21:12 ` Marcel Holtmann
2009-08-26 7:21 ` Ville Tervo
2009-08-26 18:04 ` Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2d5a2c100908241226y978afd2n44d69b7d27677c13@mail.gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox