Thread (8 messages) 8 messages, 3 authors, 2009-08-26
  • sniff mode · Luiz Augusto von Dentz <luiz.dentz@gmail.com> · 2009-08-24
  • Re: sniff mode · Marcel Holtmann <marcel@holtmann.org> · 2009-08-24
  • Re: sniff mode · Luiz Augusto von Dentz <luiz.dentz@gmail.com> · 2009-08-24
  • Re: sniff mode · Marcel Holtmann <marcel@holtmann.org> · 2009-08-24
  • Re: sniff mode · Luiz Augusto von Dentz <luiz.dentz@gmail.com> · 2009-08-24
  • Re: sniff mode · Marcel Holtmann <marcel@holtmann.org> · 2009-08-24
  • Re: sniff mode · Ville Tervo <hidden> · 2009-08-26
  • Re: sniff mode · Marcel Holtmann <marcel@holtmann.org> · 2009-08-26

sniff mode

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2009-08-24 18:26:42

Hi,

It is just me or hci_conn_enter_active_mode will never do what its
name suggests. This check will always succeed:

	if (conn->mode != HCI_CM_SNIFF || !conn->power_save)
		goto timer;

But in hci_mode_change_evt whatever mode different than HCI_CM_ACTIVE
reset power_save to zero:


		if (!test_and_clear_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) {
			if (conn->mode == HCI_CM_ACTIVE)
				conn->power_save = 1;
			else
				conn->power_save = 0;
		}

So it seems that if mode is SNIFF power_save is 0, so this check will
only fail if mode is in fact HCI_CM_ACTIVE, and then latter on we got
this:


	if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) {
		struct hci_cp_exit_sniff_mode cp;
		cp.handle = cpu_to_le16(conn->handle);
		hci_send_cmd(hdev, HCI_OP_EXIT_SNIFF_MODE, sizeof(cp), &cp);
	}

I was expecting that only when mode is HCI_CM_SNIFF it would send
HCI_OP_EXIT_SNIFF_MODE, or Im missing something?


-- 
Luiz Augusto von Dentz
Engenheiro de Computação
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help