hci_event.c (2fc2991175bf77395e6b15fe6b2304d3bf72da40) hci_event.c (1ebb92521d0bc2d4ef772730d29333c06b807191)
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated
4
5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 2 as

--- 228 unchanged lines hidden (view full) ---

237 break;
238
239 case OCF_WRITE_VOICE_SETTING:
240 sent = hci_sent_cmd_data(hdev, OGF_HOST_CTL, OCF_WRITE_VOICE_SETTING);
241 if (!sent)
242 break;
243
244 status = *((__u8 *) skb->data);
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated
4
5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 2 as

--- 228 unchanged lines hidden (view full) ---

237 break;
238
239 case OCF_WRITE_VOICE_SETTING:
240 sent = hci_sent_cmd_data(hdev, OGF_HOST_CTL, OCF_WRITE_VOICE_SETTING);
241 if (!sent)
242 break;
243
244 status = *((__u8 *) skb->data);
245 setting = __le16_to_cpu(get_unaligned((__u16 *) sent));
245 setting = __le16_to_cpu(get_unaligned((__le16 *) sent));
246
247 if (!status && hdev->voice_setting != setting) {
248 hdev->voice_setting = setting;
249
250 BT_DBG("%s: voice setting 0x%04x", hdev->name, setting);
251
252 if (hdev->notify) {
253 tasklet_disable(&hdev->tx_task);

--- 469 unchanged lines hidden (view full) ---

723
724 hci_dev_unlock(hdev);
725}
726
727/* Number of completed packets */
728static inline void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *skb)
729{
730 struct hci_ev_num_comp_pkts *ev = (struct hci_ev_num_comp_pkts *) skb->data;
246
247 if (!status && hdev->voice_setting != setting) {
248 hdev->voice_setting = setting;
249
250 BT_DBG("%s: voice setting 0x%04x", hdev->name, setting);
251
252 if (hdev->notify) {
253 tasklet_disable(&hdev->tx_task);

--- 469 unchanged lines hidden (view full) ---

723
724 hci_dev_unlock(hdev);
725}
726
727/* Number of completed packets */
728static inline void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *skb)
729{
730 struct hci_ev_num_comp_pkts *ev = (struct hci_ev_num_comp_pkts *) skb->data;
731 __u16 *ptr;
731 __le16 *ptr;
732 int i;
733
734 skb_pull(skb, sizeof(*ev));
735
736 BT_DBG("%s num_hndl %d", hdev->name, ev->num_hndl);
737
738 if (skb->len < ev->num_hndl * 4) {
739 BT_DBG("%s bad parameters", hdev->name);
740 return;
741 }
742
743 tasklet_disable(&hdev->tx_task);
744
732 int i;
733
734 skb_pull(skb, sizeof(*ev));
735
736 BT_DBG("%s num_hndl %d", hdev->name, ev->num_hndl);
737
738 if (skb->len < ev->num_hndl * 4) {
739 BT_DBG("%s bad parameters", hdev->name);
740 return;
741 }
742
743 tasklet_disable(&hdev->tx_task);
744
745 for (i = 0, ptr = (__u16 *) skb->data; i < ev->num_hndl; i++) {
745 for (i = 0, ptr = (__le16 *) skb->data; i < ev->num_hndl; i++) {
746 struct hci_conn *conn;
747 __u16 handle, count;
748
749 handle = __le16_to_cpu(get_unaligned(ptr++));
750 count = __le16_to_cpu(get_unaligned(ptr++));
751
752 conn = hci_conn_hash_lookup_handle(hdev, handle);
753 if (conn) {

--- 376 unchanged lines hidden ---
746 struct hci_conn *conn;
747 __u16 handle, count;
748
749 handle = __le16_to_cpu(get_unaligned(ptr++));
750 count = __le16_to_cpu(get_unaligned(ptr++));
751
752 conn = hci_conn_hash_lookup_handle(hdev, handle);
753 if (conn) {

--- 376 unchanged lines hidden ---