diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-07 10:24:33 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-16 17:51:55 -0500 |
commit | 416dc94baa4a0de6904707d17522f7eae7778c8e (patch) | |
tree | 3ab74e081091366e3d790e682173e61c86b195c7 /net/bluetooth/hci_conn.c | |
parent | 3e9c40a6f72a4ee7a978204cac00f91ad08bbe9b (diff) |
Bluetooth: make hci_conn_enter_sniff_mode static
It isn't used outside hci_conn.c
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r-- | net/bluetooth/hci_conn.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index dfe807fb7e79..3131a99dd5f6 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -311,6 +311,42 @@ static void hci_conn_timeout(unsigned long arg) | |||
311 | hci_dev_unlock(hdev); | 311 | hci_dev_unlock(hdev); |
312 | } | 312 | } |
313 | 313 | ||
314 | /* Enter sniff mode */ | ||
315 | static void hci_conn_enter_sniff_mode(struct hci_conn *conn) | ||
316 | { | ||
317 | struct hci_dev *hdev = conn->hdev; | ||
318 | |||
319 | BT_DBG("conn %p mode %d", conn, conn->mode); | ||
320 | |||
321 | if (test_bit(HCI_RAW, &hdev->flags)) | ||
322 | return; | ||
323 | |||
324 | if (!lmp_sniff_capable(hdev) || !lmp_sniff_capable(conn)) | ||
325 | return; | ||
326 | |||
327 | if (conn->mode != HCI_CM_ACTIVE || !(conn->link_policy & HCI_LP_SNIFF)) | ||
328 | return; | ||
329 | |||
330 | if (lmp_sniffsubr_capable(hdev) && lmp_sniffsubr_capable(conn)) { | ||
331 | struct hci_cp_sniff_subrate cp; | ||
332 | cp.handle = cpu_to_le16(conn->handle); | ||
333 | cp.max_latency = cpu_to_le16(0); | ||
334 | cp.min_remote_timeout = cpu_to_le16(0); | ||
335 | cp.min_local_timeout = cpu_to_le16(0); | ||
336 | hci_send_cmd(hdev, HCI_OP_SNIFF_SUBRATE, sizeof(cp), &cp); | ||
337 | } | ||
338 | |||
339 | if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) { | ||
340 | struct hci_cp_sniff_mode cp; | ||
341 | cp.handle = cpu_to_le16(conn->handle); | ||
342 | cp.max_interval = cpu_to_le16(hdev->sniff_max_interval); | ||
343 | cp.min_interval = cpu_to_le16(hdev->sniff_min_interval); | ||
344 | cp.attempt = cpu_to_le16(4); | ||
345 | cp.timeout = cpu_to_le16(1); | ||
346 | hci_send_cmd(hdev, HCI_OP_SNIFF_MODE, sizeof(cp), &cp); | ||
347 | } | ||
348 | } | ||
349 | |||
314 | static void hci_conn_idle(unsigned long arg) | 350 | static void hci_conn_idle(unsigned long arg) |
315 | { | 351 | { |
316 | struct hci_conn *conn = (void *) arg; | 352 | struct hci_conn *conn = (void *) arg; |
@@ -767,42 +803,6 @@ timer: | |||
767 | jiffies + msecs_to_jiffies(hdev->idle_timeout)); | 803 | jiffies + msecs_to_jiffies(hdev->idle_timeout)); |
768 | } | 804 | } |
769 | 805 | ||
770 | /* Enter sniff mode */ | ||
771 | void hci_conn_enter_sniff_mode(struct hci_conn *conn) | ||
772 | { | ||
773 | struct hci_dev *hdev = conn->hdev; | ||
774 | |||
775 | BT_DBG("conn %p mode %d", conn, conn->mode); | ||
776 | |||
777 | if (test_bit(HCI_RAW, &hdev->flags)) | ||
778 | return; | ||
779 | |||
780 | if (!lmp_sniff_capable(hdev) || !lmp_sniff_capable(conn)) | ||
781 | return; | ||
782 | |||
783 | if (conn->mode != HCI_CM_ACTIVE || !(conn->link_policy & HCI_LP_SNIFF)) | ||
784 | return; | ||
785 | |||
786 | if (lmp_sniffsubr_capable(hdev) && lmp_sniffsubr_capable(conn)) { | ||
787 | struct hci_cp_sniff_subrate cp; | ||
788 | cp.handle = cpu_to_le16(conn->handle); | ||
789 | cp.max_latency = cpu_to_le16(0); | ||
790 | cp.min_remote_timeout = cpu_to_le16(0); | ||
791 | cp.min_local_timeout = cpu_to_le16(0); | ||
792 | hci_send_cmd(hdev, HCI_OP_SNIFF_SUBRATE, sizeof(cp), &cp); | ||
793 | } | ||
794 | |||
795 | if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) { | ||
796 | struct hci_cp_sniff_mode cp; | ||
797 | cp.handle = cpu_to_le16(conn->handle); | ||
798 | cp.max_interval = cpu_to_le16(hdev->sniff_max_interval); | ||
799 | cp.min_interval = cpu_to_le16(hdev->sniff_min_interval); | ||
800 | cp.attempt = cpu_to_le16(4); | ||
801 | cp.timeout = cpu_to_le16(1); | ||
802 | hci_send_cmd(hdev, HCI_OP_SNIFF_MODE, sizeof(cp), &cp); | ||
803 | } | ||
804 | } | ||
805 | |||
806 | /* Drop all connection on the device */ | 806 | /* Drop all connection on the device */ |
807 | void hci_conn_hash_flush(struct hci_dev *hdev) | 807 | void hci_conn_hash_flush(struct hci_dev *hdev) |
808 | { | 808 | { |